@womp/spark-agent 8.0.0 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -0
- package/README.md +3 -2
- package/dist/capabilities/materials.d.ts +10 -1
- package/dist/capabilities/materials.js +30 -10
- package/dist/generated/materials-declarations.d.ts +1 -1
- package/dist/generated/materials-declarations.js +1 -1
- package/dist/generated/materials-flowir-declarations.d.ts +1 -0
- package/dist/generated/materials-flowir-declarations.js +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -1
- package/dist/kakapo.d.ts +1 -1
- package/dist/materials/flowir.d.ts +15 -0
- package/dist/materials/flowir.js +362 -0
- package/dist/materials/graph.d.ts +7 -0
- package/dist/materials/graph.js +13 -1
- package/dist/materials/lift.d.ts +3 -0
- package/dist/materials/lift.js +216 -0
- package/dist/materials/schemas/materials-dialect.json +690 -0
- package/dist/materials/types.d.ts +15 -0
- package/dist/scene-operations.d.ts +2 -17
- package/dist/scene-operations.js +4 -40
- package/dist/sdk-geometry-host.js +1 -2
- package/dist/sdk-materials-host.js +136 -10
- package/dist/sdk-openscad-host.js +1 -3
- package/dist/sdk-scene-host.d.ts +3 -5
- package/dist/sdk-scene-host.js +5 -15
- package/dist/server/sqlite-store.d.ts +1 -5
- package/dist/server/sqlite-store.js +3 -40
- package/dist/server/standalone.js +0 -1
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,64 @@ 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
|
+
## 9.1.0 — 2026-10-12
|
|
8
|
+
|
|
9
|
+
The agent writes procedural materials as FlowIR programs, the same way it writes Geometry Nodes,
|
|
10
|
+
instead of building native shader-graph JSON.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `womp.materials.writeProgram({ cloneFrom | materialId, layerIndex, source, objectIds })` compiles
|
|
15
|
+
a FlowIR program to a Kakapo shader graph and writes one layer. It keeps the material's base
|
|
16
|
+
properties and other layers, gives a shared shader its own storage before editing it, and
|
|
17
|
+
carries panel overrides over by parameter name and type, reporting the ones it resets.
|
|
18
|
+
- `womp.materials.readProgram(materialId, layerIndex)` returns the layer's FlowIR source: the
|
|
19
|
+
saved source while it still matches the native graph, otherwise source lifted from the graph,
|
|
20
|
+
or `null` with diagnostics when the graph cannot be represented without loss.
|
|
21
|
+
- The materials dialect covers 61 node types. The written source is saved in the scene's
|
|
22
|
+
`shadersExt[shaderId].flowirSource`.
|
|
23
|
+
- `yarn test:live:materials` writes and reads every dialect node against a running Kakapo.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- When the materials host provides `writeProgram`, `procedural-materials` (skill version 18)
|
|
28
|
+
teaches FlowIR authoring, and the native JSON graph API moves to
|
|
29
|
+
`procedural-materials-reference` (version 9) and `procedural-materials-recipes` (version 10).
|
|
30
|
+
`createSdkMaterialsHost` always provides it, so Swan, Crow and the standalone server switch to
|
|
31
|
+
FlowIR materials when they take this version. A host that supplies its own `MaterialsHost`
|
|
32
|
+
without `writeProgram` keeps the previous skills.
|
|
33
|
+
|
|
34
|
+
## 9.0.0 — 2026-10-12
|
|
35
|
+
|
|
36
|
+
The scene operation journal is gone: every SDK scene adapter applies each edit directly to the
|
|
37
|
+
scene and saves it, as the browser has since it moved to scene events. The journal only deduped an
|
|
38
|
+
edit whose tool call ran again with the same operation id and settled uncertain edits that turned
|
|
39
|
+
out to change nothing; no host re-runs a tool call within a live run, and a restart ends the run.
|
|
40
|
+
|
|
41
|
+
### Removed
|
|
42
|
+
|
|
43
|
+
- `SceneOperationStore`, `recoverSceneOperation` and the `operations` option of
|
|
44
|
+
`SdkSceneEditorOptions` (and so of `createSdkSceneEditor` and `createSdkSceneHost`).
|
|
45
|
+
- `SdkSceneEditor.getOperation`.
|
|
46
|
+
- `SceneOperation.revision`, which only versioned journal records.
|
|
47
|
+
- `executeSceneOperation`'s `store` option and the `reused` flag on its result.
|
|
48
|
+
- The standalone SQLite store's `scene_operations` table. Opening an older database drops it and
|
|
49
|
+
sets the schema version to 5.
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
|
|
53
|
+
- Every edit that fails after it began throws `SceneOperationError`, whose `operation` reports
|
|
54
|
+
whether it was committed, rolled back or left uncertain. Before, hosts that supplied
|
|
55
|
+
`operations` got the original error unwrapped; it is now the error's `cause`.
|
|
56
|
+
- Receipts no longer carry `details.synchronized`; `details.synchronizationError` still reports
|
|
57
|
+
a failed `onCommitted`.
|
|
58
|
+
|
|
59
|
+
### Migrating
|
|
60
|
+
|
|
61
|
+
Stop passing `operations` and delete any `SceneOperationStore` implementation. A custom
|
|
62
|
+
`SdkSceneEditor` drops `getOperation`. Code that read an edit's outcome from the journal after a
|
|
63
|
+
failure reads `error.operation` from the `SceneOperationError` instead.
|
|
64
|
+
|
|
7
65
|
## 8.0.0 — 2026-10-12
|
|
8
66
|
|
|
9
67
|
Geometry Nodes moves to FlowIR 0.5.0. The dialect is FlowIR's strict, flat format, the
|
package/README.md
CHANGED
|
@@ -59,8 +59,9 @@ locks. The run stays active with `requires_action` progress and resumes the same
|
|
|
59
59
|
input; the wait is excluded from the execution budget. Abort settles the wait and late answers
|
|
60
60
|
cannot revive it. Custom executors must honor the optional host-owned `userWait` argument to `execute`.
|
|
61
61
|
|
|
62
|
-
Shared SDK scene adapters
|
|
63
|
-
|
|
62
|
+
Shared SDK scene adapters apply each edit directly to the scene and save it; nothing is journaled
|
|
63
|
+
or replayed. An edit that fails after it began throws `SceneOperationError`, whose `operation`
|
|
64
|
+
reports whether the edit was committed, rolled back or left uncertain.
|
|
64
65
|
|
|
65
66
|
### Persistence and run lifecycle
|
|
66
67
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SparkCapability, SparkInvocationContext } from "../capabilities.js";
|
|
2
2
|
import { type MaterialInspectionOptions, type MaterialInspectionResult, type MaterialInspectionHost } from "../materials/inspection.js";
|
|
3
|
-
import type { MaterialCatalog, MaterialCatalogOptions, MaterialNode, MaterialNodeOptions, MaterialRecipeOptions, MaterialGraph, MaterialField, MaterialFieldOptions, MaterialCompositionOptions, MaterialShapeOptions, MaterialSnapshot, MaterialWrite, MaterialWriteResult } from "../materials/types.js";
|
|
3
|
+
import type { MaterialCatalog, MaterialCatalogOptions, MaterialNode, MaterialNodeOptions, MaterialRecipeOptions, MaterialGraph, MaterialField, MaterialFieldOptions, MaterialCompositionOptions, MaterialShapeOptions, MaterialSnapshot, MaterialWrite, MaterialWriteResult, MaterialProgramWrite, MaterialProgramRead } from "../materials/types.js";
|
|
4
4
|
export type * from "../materials/types.js";
|
|
5
5
|
export type { MaterialInspectionOptions, MaterialInspectionResult, MaterialInspectionHost } from "../materials/inspection.js";
|
|
6
6
|
export type MaterialStatus = {
|
|
@@ -34,12 +34,21 @@ export type WompMaterialsApi = {
|
|
|
34
34
|
/** Available when the host supplies scene captures. Primes, waits and returns joint inspection views. */
|
|
35
35
|
inspect?: (options: MaterialInspectionOptions) => Promise<MaterialInspectionResult>;
|
|
36
36
|
write(options: MaterialWrite): Promise<MaterialWriteResult>;
|
|
37
|
+
readProgram?(materialId: number, layerIndex: number): Promise<MaterialProgramRead>;
|
|
38
|
+
writeProgram?(options: MaterialProgramWrite): Promise<MaterialWriteResult>;
|
|
37
39
|
status(): Promise<MaterialStatus>;
|
|
38
40
|
};
|
|
41
|
+
export type WompMaterialsFlowirApi = Pick<WompMaterialsApi, "catalog" | "read" | "write" | "readProgram" | "writeProgram" | "inspect" | "status"> & {
|
|
42
|
+
recipe(options: MaterialRecipeOptions & {
|
|
43
|
+
pattern: "grid";
|
|
44
|
+
}): Promise<MaterialGraph>;
|
|
45
|
+
};
|
|
39
46
|
export interface MaterialsHost {
|
|
40
47
|
catalog(options: MaterialCatalogOptions, context: SparkInvocationContext): Promise<MaterialCatalog>;
|
|
41
48
|
read(materialId: number | undefined, context: SparkInvocationContext): Promise<MaterialSnapshot>;
|
|
42
49
|
write(options: MaterialWrite, context: SparkInvocationContext): Promise<MaterialWriteResult>;
|
|
50
|
+
readProgram?(materialId: number, layerIndex: number, context: SparkInvocationContext): Promise<MaterialProgramRead>;
|
|
51
|
+
writeProgram?(options: MaterialProgramWrite, context: SparkInvocationContext): Promise<MaterialWriteResult>;
|
|
43
52
|
status(context: SparkInvocationContext): Promise<MaterialStatus>;
|
|
44
53
|
}
|
|
45
54
|
export declare function createMaterialsCapability(host: MaterialsHost, captures?: MaterialInspectionHost): SparkCapability<WompMaterialsApi>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { WOMP_MATERIALS_DECLARATIONS } from "../generated/materials-declarations.js";
|
|
2
|
+
import { WOMP_MATERIALS_FLOWIR_DECLARATIONS } from "../generated/materials-flowir-declarations.js";
|
|
2
3
|
import { catalogOptionsSchema, makeMaterialNode, materialId, writeSchema, } from "../materials/graph.js";
|
|
3
4
|
import { MATERIALS_REFERENCE } from "../materials/reference.js";
|
|
4
5
|
import { MATERIALS_RECIPES } from "../materials/recipes.js";
|
|
5
6
|
import { MATERIALS_STRUCTURE_GUIDANCE, MATERIALS_QUALITY_GUIDANCE } from "../materials/structure.js";
|
|
7
|
+
import { materialFlowirReference } from "../materials/flowir.js";
|
|
6
8
|
import { makeMaterialShape, materialShapeOperations, materialShapeSchema } from "../materials/shaping.js";
|
|
7
9
|
import { inspectMaterial, materialInspectionSchema } from "../materials/inspection.js";
|
|
8
10
|
import { makeMaterialField, materialFieldOperations, materialFieldSchema, makeMaterialRecipe, materialRecipeOperations, materialRecipeSchema, MATERIAL_RECIPE_RELIEF_GUIDANCE } from "../materials/surface-recipes.js";
|
|
@@ -12,9 +14,22 @@ export function createMaterialsCapability(host, captures) {
|
|
|
12
14
|
skills: [
|
|
13
15
|
{
|
|
14
16
|
name: "procedural-materials",
|
|
15
|
-
version: "
|
|
16
|
-
description:
|
|
17
|
-
|
|
17
|
+
version: "18",
|
|
18
|
+
description: host.writeProgram
|
|
19
|
+
? "Author procedural surfaces with FlowIR, calibrate mapping, edit controls, clone, assign and inspect materials."
|
|
20
|
+
: "Discover live texture resources, build procedural shader layers, edit material constants, clone and assign materials.",
|
|
21
|
+
instructions: host.writeProgram ? `Use womp.materials for procedural surface appearance. Supply a complete FlowIR program to writeProgram({cloneFrom,layerIndex:0,source,objectIds}) for an isolated material, or {materialId,layerIndex,source} to edit one existing layer. The FlowIR language and supported nodes are documented below. The backend resolves native operations, slot indices, enums and binary payloads; no descriptor inspection is needed for supported FlowIR nodes.
|
|
22
|
+
read() lists material IDs and direct users. Existing-material changes affect every reference, including procedural geometry references that are not listed. cloneFrom creates an independent copy; shared shader storage is isolated automatically. writeProgram preserves base properties and unrelated layers. readProgram(materialId,layerIndex) returns editable source or null with diagnostics when the native graph cannot be safely represented. Preserve unrelated statements and parameter names while editing. Compatible panel overrides migrate by name and type; reset overrides are reported. Returned parameters contain current reference IDs and complete value/color pairs; use write({materialId,constants}) for control-only refinement, preserving the counterpart field. A null constant resets it and returns a new handle.
|
|
23
|
+
Use recipe({pattern:'grid',coordinateSpace:'object',featureSize:1,colorA:{x:0.45,y:0.35,z:0.2},colorB:{x:0.02,y:0.02,z:0.02},roughnessA:0.45,roughnessB:0.45,relief:'height',reliefScale:0.0003}) for the two-scale base-color probe, then write({cloneFrom:materialId,layers:[graph],objectIds}). It contains both 1-unit and 0.1-unit lines; choose the base color for the target. reliefScale is native shading-normal strength, not millimeters; 0.0003 is the tested starting strength for this grid. Final FlowIR OutputHeight.Scale depends on height slope and feature spacing, independently of probe values.
|
|
24
|
+
Scene axes are known: public X maps to negative renderer Z, public Y to renderer Y, public Z to negative renderer X. Object coordinates follow carrier and ancestor transforms; world coordinates use native renderer units, where 1 unit is 25 mm. Compensate non-uniform scaling in mapping without modifying geometry.
|
|
25
|
+
Procedural colors are linear RGB in 0..1. For this renderer's gamma-2.2 display/base colors, decode with (channel/255)**2.2; preserve already-linear colors and scalar channels. catalog({includeTextures:true}) supplies available texture paths when using PredefinedTexture. Refresh textures after resource changes. inspect() waits and supplies joint inspection views when available; status() only reports global queues and does not prove visual success.
|
|
26
|
+
IncomingMaterial reads the material entering the selected layer. In layer 0, decode its primary, secondary and subsurface colors with MathPower Second=2.2 before linear calculations or writing them back; later layers already return linear colors. Connect those decoded colors when preserving color while changing only finish. Direct linear literals and decoded texture colors need no layer-specific correction. Use ScalarNoise for grayscale fields, VectorNoise for coordinate distortion, and ScalarAdd/Subtract/Multiply/Divide for scalar controls. FrequencyScale changes feature spacing; Amplitude changes signal strength. Pair world-space Position with InputWorldNormal, and object-space Position with InputNormal.
|
|
27
|
+
Keep source in the saved layer. After every writeProgram, replacement or constant reset, use the returned current parameter handles. Print materialId, diagnostics and only the controls needed for the next correction; inspect() results need only queueSettled, timedOut, status and emitted frames. Collect target IDs, material users, units, dimensions and ancestor transforms together in the initial inspection, including bounds in that execution. Once targets and sharing are understood, create, assign and inspect the grid in one execution; assess it before constructing the final surface. For each candidate, combine its write and joint inspection in one execution. Change related controls together using returned handles. When a structural edit needs readProgram, read, patch, write and inspect in the same execution instead of returning the source for a separate call. Include final assignment and preservation checks with the final inspection. Record the largest mismatch, relevant scales and expected correction.
|
|
28
|
+
${MATERIALS_QUALITY_GUIDANCE.replace("Build all planned components and finish channels together using field, shape and compose. Their supported operations and selectors are resolved internally; construct masks, palettes and blends directly from these helpers.", "Build all planned components and finish channels together in one FlowIR program; use explicit math, palettes and masks for defining features.").replace("World-space field sizes are physical millimeters; object-space sizes follow carrier coordinates and transforms.", "FlowIR world positions are native scene units (25 mm per unit); object positions follow carrier coordinates and transforms.")}
|
|
29
|
+
|
|
30
|
+
${materialFlowirReference()}
|
|
31
|
+
|
|
32
|
+
Ports marked literal in the dialect require written values: ColorRamp stop positions/colors and ProjectionModeSelector options cannot be wired to parameters or node outputs. Parameters become editable panel controls; const values remain internal. OutputMaterial literals are lowered to connected values automatically.` : `Use womp.materials for procedural surface appearance.
|
|
18
33
|
recipe() builds editable grid, noise, grain and woven starting graphs and resolves live operation selectors internally. Use it directly for these patterns; no preliminary descriptor dump is needed. It does not write or assign a material. featureSize is in object-coordinate units for coordinateSpace:'object', or physical millimeters for 'world'; vector components use graph axes. Object mapping follows the owning carrier and its transforms; world mapping stays fixed in the scene. Grid includes major cells at featureSize and minor cells at one tenth of it, with lower minor contrast. colorA is the base and colorB the grid-line color. Use shallow relief for probes.
|
|
19
34
|
field() builds terminal-free noise, grain, woven, grid or cellular structures. It shares the recipe coordinate/feature-size convention; rotation is in degrees. cellMode selects a cellular pattern or boundary mask; remap controls contrast and can invert a mask. compose() merges these fields or arbitrary custom {graph,source:{node,slot}} fields, wiring independent color, roughness and combined height/bump weights. Color/roughness weights are nonnegative and sum to at most 1; fields must be normalized to 0..1. Relief weights may be signed. This is generic construction, not a finished material preset. Keep broad variation, defining shapes and fine roughness/relief separate. Independent feature colors use shape palette and blend; compose preserves their RGB with color low zero, high one, and weight one. Scalar channels consume X.
|
|
20
35
|
Coordinate axes are known: scene.access public X corresponds to negative renderer Z, public Y to renderer Y, public Z to negative renderer X. World-space featureSize uses renderer axes in physical mm: for grain running along public X, make Z the largest feature-size component, such as {x:1,y:1,z:40}; public Z uses the largest X component. These are orientation examples; choose sizes from the target. Object-space coordinates additionally follow carrier transforms and primitive/mesh mapping. A symmetric grid measures spacing/stretch but cannot establish axis identity. Use the known basis plus carrier transforms, or physical world mapping when local axis identity is uncertain; world mapping remains scene anchored.
|
|
@@ -29,8 +44,11 @@ write replaces the full layers array when supplied. Preserve unrelated layers, n
|
|
|
29
44
|
Base properties and names remain available through scene.access; material names have a 63-character limit. Procedural colors, including recipe palettes, Constant colors and ramp stops, are linear RGB in 0..1. Decode display RGB before supplying it; for this renderer's gamma-2.2 base colors use (channel/255)**2.2. Do not apply this conversion to roughness, metalness, height or normals, or to colors already linear. Graph coordinates use native conventions, not scene.access's mm convenience API.
|
|
30
45
|
Writes use the host's protected scene access, persistence, permissions and receipts. Read current layers before replacing them. After an uncertain commit/save, inspect receipts and scene state; do not replay blindly.
|
|
31
46
|
status() reports independent global compiler-queue and pending-resource observations. A null field means its query failed; errors identifies the source. Per-shader diagnostics are unavailable. Catalogue names do not establish texture channels, color space or normal convention; choose decoding only when the resource encoding is known. Applied means committed. When inspect is available, use inspect({views:[...]}) after writes; it primes registration once, polls status without screenshot loops and captures the angles sequentially. Emit every returned frame within the same execution for joint comparison. queueSettled describes observations, not visual correctness; Report pending/unavailable observations honestly; fewer frames than requested means inspection is incomplete. When inspect is unavailable, prime with a screenshot, then observe status and capture the needed angles.`,
|
|
32
|
-
declarations: WOMP_MATERIALS_DECLARATIONS,
|
|
33
|
-
examples: [
|
|
47
|
+
declarations: host.writeProgram ? WOMP_MATERIALS_FLOWIR_DECLARATIONS : WOMP_MATERIALS_DECLARATIONS,
|
|
48
|
+
examples: host.writeProgram ? [
|
|
49
|
+
"const source = 'param Vec3 tint = Vec3(0.2,0.08,0.03)\\nparam Float finish = 0.5 min=0 max=1 step=0.01\\nnode output OutputMaterial PrimaryColor=tint Roughness=finish'; print(await womp.materials.writeProgram({cloneFrom:materialId,layerIndex:0,source,objectIds:[objectId]}));",
|
|
50
|
+
"const layer = await womp.materials.readProgram(materialId,0); print({source:layer.source,diagnostics:layer.diagnostics});",
|
|
51
|
+
] : [
|
|
34
52
|
"const fields = await Promise.all([womp.materials.field({pattern:'noise',coordinateSpace:'world',featureSize:8}),womp.materials.field({pattern:'noise',coordinateSpace:'world',featureSize:0.2})]); const graph = await womp.materials.compose({fields,color:{low:{x:0.2,y:0.15,z:0.1},high:{x:0.4,y:0.3,z:0.2},weights:[0.7,0.1]},roughness:{low:0.6,high:0.9,weights:[0.1,0.8]},relief:{mode:'height',scale:0.003,weights:[0.3,0.05]}}); const result = await womp.materials.write({materialId,layers:[graph]}); print({materialId:result.materialId,parameters:result.parameters?.filter(p=>['relief.scale','color.low','color.high','roughness.low','roughness.high'].includes(p.name))});",
|
|
35
53
|
"const graph = await womp.materials.recipe({pattern:'grid',coordinateSpace:'object',featureSize:1,colorA:{x:0.45,y:0.35,z:0.2},colorB:{x:0.02,y:0.02,z:0.02},roughnessA:0.45,roughnessB:0.45,relief:'height',reliefScale:0.0003}); print(await womp.materials.write({cloneFrom:materialId,layers:[graph],objectIds:[objectId]}));",
|
|
36
54
|
"const graph = await womp.materials.recipe({pattern:'noise',coordinateSpace:'world',featureSize:2,colorA:{x:0.6,y:0.55,z:0.45},colorB:{x:0.65,y:0.6,z:0.5},roughnessA:0.8,roughnessB:0.85,relief:'height',reliefScale:0.003}); print(await womp.materials.write({materialId,layers:[graph],objectIds:[objectId]}));",
|
|
@@ -39,16 +57,16 @@ status() reports independent global compiler-queue and pending-resource observat
|
|
|
39
57
|
},
|
|
40
58
|
{
|
|
41
59
|
name: "procedural-materials-reference",
|
|
42
|
-
version: "
|
|
43
|
-
description: "
|
|
60
|
+
version: "9",
|
|
61
|
+
description: "Low-level native JSON shader graphs: numeric ports, binary payloads and direct node construction.",
|
|
44
62
|
instructions: MATERIALS_REFERENCE,
|
|
45
|
-
declarations: "",
|
|
63
|
+
declarations: host.writeProgram ? WOMP_MATERIALS_DECLARATIONS : "",
|
|
46
64
|
examples: [],
|
|
47
65
|
},
|
|
48
66
|
{
|
|
49
67
|
name: "procedural-materials-recipes",
|
|
50
|
-
version: "
|
|
51
|
-
description: "
|
|
68
|
+
version: "10",
|
|
69
|
+
description: "Native JSON graph helper snippets for field, shape and compose, texture mapping and normal composition.",
|
|
52
70
|
instructions: MATERIALS_RECIPES,
|
|
53
71
|
declarations: "",
|
|
54
72
|
examples: [],
|
|
@@ -83,6 +101,8 @@ status() reports independent global compiler-queue and pending-resource observat
|
|
|
83
101
|
},
|
|
84
102
|
...(captures ? { inspect: (options) => inspectMaterial(host, captures, materialInspectionSchema.parse(options), context) } : {}),
|
|
85
103
|
write: (options) => host.write(writeSchema.parse(options), context),
|
|
104
|
+
...(host.readProgram ? { readProgram: (materialId, layerIndex) => host.readProgram(materialId, layerIndex, context) } : {}),
|
|
105
|
+
...(host.writeProgram ? { writeProgram: (options) => host.writeProgram(options, context) } : {}),
|
|
86
106
|
status: () => host.status(context),
|
|
87
107
|
}),
|
|
88
108
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const WOMP_MATERIALS_DECLARATIONS = "declare const womp: { materials: {\n\"catalog\": ((options?: undefined | {\n\"refreshTextures\"?: undefined | false | true;\n\"includeTextures\"?: undefined | false | true;\n\"operations\"?: undefined | Array<string>;\n}) => Promise<{\n\"operations\": Array<{\n\"op\": string;\n\"category\": string;\n\"title\": string;\n}>;\n\"nodes\": {\n[key: string]: {\n\"type\": string;\n\"title\": string;\n\"description\": string;\n\"inputs\": Array<{\n\"title\": string;\n\"type\": string;\n\"values\"?: undefined | Array<string>;\n}>;\n\"outputs\": Array<{\n\"title\": string;\n\"type\": string;\n\"values\"?: undefined | Array<string>;\n}>;\n};\n};\n\"textureCount\": number;\n\"textures\"?: undefined | Array<string>;\n\"textureMetadata\"?: undefined | {\n\"channels\": \"unknown\";\n\"colorSpace\": \"unknown\";\n\"normalConvention\": \"unknown\";\n\"reason\": string;\n};\n}>);\n\"read\": ((materialId?: undefined | number) => Promise<{\n\"materials\": Array<{\n\"id\": number;\n\"shaderIds\": Array<number>;\n\"objectIds\": Array<number>;\n}>;\n\"material\"?: undefined | {\n\"id\": number;\n\"data\": {\n[key: string]: unknown;\n};\n\"layers\": Array<null | {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>;\n};\n\"diagnostics\": Array<string>;\n}>);\n\"node\": ((options: {\n\"op\": string;\n\"name\"?: undefined | string;\n\"reference_id\"?: undefined | number;\n\"inputs\"?: undefined | {\n[key: string]: number | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n};\n\"texture\"?: undefined | string;\n\"ramp\"?: undefined | Array<{\n\"position\": number;\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n}>;\n\"options\"?: undefined | Array<{\n\"name\": string;\n\"value\": number;\n}>;\n}) => {\n\"op\": string;\n[key: string]: unknown;\n});\n\"recipe\": ((options: {\n\"pattern\": \"noise\" | \"grain\" | \"woven\" | \"grid\";\n\"coordinateSpace\": \"object\" | \"world\";\n\"featureSize\": number | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"colorA\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"colorB\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"roughnessA\": number;\n\"roughnessB\": number;\n\"metalness\"?: undefined | number;\n\"detail\"?: undefined | number;\n\"relief\": \"height\" | \"bump\";\n\"reliefScale\": number;\n}) => Promise<{\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>);\n\"field\": ((options: {\n\"pattern\": \"noise\" | \"grain\" | \"woven\" | \"grid\" | \"cells\";\n\"coordinateSpace\": \"object\" | \"world\";\n\"featureSize\": number | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"detail\"?: undefined | number;\n\"rotation\"?: undefined | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"cellMode\"?: undefined | \"Distance\" | \"Edge distance\" | \"Color\" | \"Smooth Distance\" | \"Smooth Color\";\n\"remap\"?: undefined | {\n\"low\": number;\n\"high\": number;\n};\n}) => Promise<{\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n}>);\n\"compose\": ((options: {\n\"fields\": Array<{\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n}>;\n\"color\"?: undefined | {\n\"low\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"high\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"weights\": Array<number>;\n};\n\"roughness\"?: undefined | {\n\"low\": number;\n\"high\": number;\n\"weights\": Array<number>;\n};\n\"metalness\"?: undefined | number;\n\"relief\"?: undefined | {\n\"mode\": \"height\" | \"bump\";\n\"scale\": number;\n\"weights\": Array<number>;\n\"center\"?: undefined | number;\n};\n}) => Promise<{\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>);\n\"shape\": ((field: {\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n}, options: {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"remap\";\n\"low\": number;\n\"high\": number;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"ridge\";\n\"center\": number;\n\"width\": number;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"periodic\";\n\"coordinates\"?: undefined | number;\n\"axis\": 0 | 1 | 2;\n\"sharpness\": number;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"warp\";\n\"coordinates\"?: undefined | number;\n\"frequency\": number;\n\"amplitude\": number;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"palette\";\n\"mode\": \"Constant\" | \"Linear\" | \"Smooth\";\n\"stops\": Array<{\n\"position\": number;\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n}>;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"blend\";\n\"overlay\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n} | {\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n};\n\"mask\": number | {\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n};\n}) => Promise<{\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n}>);\n\"inspect\"?: undefined | ((options: {\n\"views\": Array<{\n\"camera\"?: undefined | {\n\"position\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"target\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"projection\"?: undefined | \"perspective\" | \"orthographic\";\n\"horizontalFovDegrees\"?: undefined | number;\n\"orthographicWidth\"?: undefined | number;\n};\n}>;\n\"timeoutMs\"?: undefined | number;\n}) => Promise<{\n\"frames\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"queueSettled\": false | true;\n\"timedOut\": false | true;\n\"status\": {\n\"remaining\": null | number;\n\"pendingResources\": null | {\n[key: string]: Array<string>;\n};\n\"errors\"?: undefined | Array<{\n\"source\": \"compiler-progress\" | \"pending-resources\";\n\"message\": string;\n}>;\n\"shaderDiagnostics\"?: undefined | {\n\"status\": \"unavailable\";\n\"reason\": string;\n};\n\"rendering\": \"unverified\";\n\"explanation\": string;\n};\n}>);\n\"write\": ((options: {\n\"materialId\"?: undefined | number;\n\"cloneFrom\"?: undefined | number;\n\"layers\"?: undefined | Array<null | {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>;\n\"constants\"?: undefined | {\n[key: string]: null | {\n\"value\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n};\n};\n\"objectIds\"?: undefined | Array<number>;\n}) => Promise<{\n\"materialId\": number;\n\"objectIds\": Array<number>;\n\"referenceIdChanges\": {\n[key: string]: number;\n};\n\"parameters\"?: undefined | Array<{\n\"name\": string;\n\"referenceId\": number;\n\"value\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"exposed\"?: undefined | false | true;\n}>;\n\"status\": \"applied\";\n\"rendering\": \"unverified\";\n}>);\n\"status\": (() => Promise<{\n\"remaining\": null | number;\n\"pendingResources\": null | {\n[key: string]: Array<string>;\n};\n\"errors\"?: undefined | Array<{\n\"source\": \"compiler-progress\" | \"pending-resources\";\n\"message\": string;\n}>;\n\"shaderDiagnostics\"?: undefined | {\n\"status\": \"unavailable\";\n\"reason\": string;\n};\n\"rendering\": \"unverified\";\n\"explanation\": string;\n}>);\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_MATERIALS_DECLARATIONS = "declare const womp: { materials: {\n\"catalog\": ((options?: undefined | {\n\"refreshTextures\"?: undefined | false | true;\n\"includeTextures\"?: undefined | false | true;\n\"operations\"?: undefined | Array<string>;\n}) => Promise<{\n\"operations\": Array<{\n\"op\": string;\n\"category\": string;\n\"title\": string;\n}>;\n\"nodes\": {\n[key: string]: {\n\"type\": string;\n\"title\": string;\n\"description\": string;\n\"inputs\": Array<{\n\"title\": string;\n\"type\": string;\n\"values\"?: undefined | Array<string>;\n}>;\n\"outputs\": Array<{\n\"title\": string;\n\"type\": string;\n\"values\"?: undefined | Array<string>;\n}>;\n};\n};\n\"textureCount\": number;\n\"textures\"?: undefined | Array<string>;\n\"textureMetadata\"?: undefined | {\n\"channels\": \"unknown\";\n\"colorSpace\": \"unknown\";\n\"normalConvention\": \"unknown\";\n\"reason\": string;\n};\n}>);\n\"read\": ((materialId?: undefined | number) => Promise<{\n\"materials\": Array<{\n\"id\": number;\n\"shaderIds\": Array<number>;\n\"objectIds\": Array<number>;\n}>;\n\"material\"?: undefined | {\n\"id\": number;\n\"data\": {\n[key: string]: unknown;\n};\n\"layers\": Array<null | {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>;\n};\n\"diagnostics\": Array<string>;\n}>);\n\"node\": ((options: {\n\"op\": string;\n\"name\"?: undefined | string;\n\"reference_id\"?: undefined | number;\n\"inputs\"?: undefined | {\n[key: string]: number | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n};\n\"texture\"?: undefined | string;\n\"ramp\"?: undefined | Array<{\n\"position\": number;\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n}>;\n\"options\"?: undefined | Array<{\n\"name\": string;\n\"value\": number;\n}>;\n}) => {\n\"op\": string;\n[key: string]: unknown;\n});\n\"recipe\": ((options: {\n\"pattern\": \"noise\" | \"grain\" | \"woven\" | \"grid\";\n\"coordinateSpace\": \"object\" | \"world\";\n\"featureSize\": number | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"colorA\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"colorB\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"roughnessA\": number;\n\"roughnessB\": number;\n\"metalness\"?: undefined | number;\n\"detail\"?: undefined | number;\n\"relief\": \"height\" | \"bump\";\n\"reliefScale\": number;\n}) => Promise<{\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>);\n\"field\": ((options: {\n\"pattern\": \"noise\" | \"grain\" | \"woven\" | \"grid\" | \"cells\";\n\"coordinateSpace\": \"object\" | \"world\";\n\"featureSize\": number | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"detail\"?: undefined | number;\n\"rotation\"?: undefined | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"cellMode\"?: undefined | \"Distance\" | \"Edge distance\" | \"Color\" | \"Smooth Distance\" | \"Smooth Color\";\n\"remap\"?: undefined | {\n\"low\": number;\n\"high\": number;\n};\n}) => Promise<{\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n}>);\n\"compose\": ((options: {\n\"fields\": Array<{\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n}>;\n\"color\"?: undefined | {\n\"low\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"high\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"weights\": Array<number>;\n};\n\"roughness\"?: undefined | {\n\"low\": number;\n\"high\": number;\n\"weights\": Array<number>;\n};\n\"metalness\"?: undefined | number;\n\"relief\"?: undefined | {\n\"mode\": \"height\" | \"bump\";\n\"scale\": number;\n\"weights\": Array<number>;\n\"center\"?: undefined | number;\n};\n}) => Promise<{\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>);\n\"shape\": ((field: {\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n}, options: {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"remap\";\n\"low\": number;\n\"high\": number;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"ridge\";\n\"center\": number;\n\"width\": number;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"periodic\";\n\"coordinates\"?: undefined | number;\n\"axis\": 0 | 1 | 2;\n\"sharpness\": number;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"warp\";\n\"coordinates\"?: undefined | number;\n\"frequency\": number;\n\"amplitude\": number;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"palette\";\n\"mode\": \"Constant\" | \"Linear\" | \"Smooth\";\n\"stops\": Array<{\n\"position\": number;\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n}>;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"blend\";\n\"overlay\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n} | {\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n};\n\"mask\": number | {\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n};\n}) => Promise<{\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n}>);\n\"inspect\"?: undefined | ((options: {\n\"views\": Array<{\n\"camera\"?: undefined | {\n\"position\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"target\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"projection\"?: undefined | \"perspective\" | \"orthographic\";\n\"horizontalFovDegrees\"?: undefined | number;\n\"orthographicWidth\"?: undefined | number;\n};\n}>;\n\"timeoutMs\"?: undefined | number;\n}) => Promise<{\n\"frames\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"queueSettled\": false | true;\n\"timedOut\": false | true;\n\"status\": {\n\"remaining\": null | number;\n\"pendingResources\": null | {\n[key: string]: Array<string>;\n};\n\"errors\"?: undefined | Array<{\n\"source\": \"compiler-progress\" | \"pending-resources\";\n\"message\": string;\n}>;\n\"shaderDiagnostics\"?: undefined | {\n\"status\": \"unavailable\";\n\"reason\": string;\n};\n\"rendering\": \"unverified\";\n\"explanation\": string;\n};\n}>);\n\"write\": ((options: {\n\"materialId\"?: undefined | number;\n\"cloneFrom\"?: undefined | number;\n\"layers\"?: undefined | Array<null | {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>;\n\"constants\"?: undefined | {\n[key: string]: null | {\n\"value\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n};\n};\n\"objectIds\"?: undefined | Array<number>;\n}) => Promise<{\n\"materialId\": number;\n\"objectIds\": Array<number>;\n\"referenceIdChanges\": {\n[key: string]: number;\n};\n\"parameters\"?: undefined | Array<{\n\"name\": string;\n\"referenceId\": number;\n\"value\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"exposed\"?: undefined | false | true;\n}>;\n\"diagnostics\"?: undefined | Array<string>;\n\"status\": \"applied\";\n\"rendering\": \"unverified\";\n}>);\n\"readProgram\"?: undefined | ((materialId: number, layerIndex: number) => Promise<{\n\"materialId\": number;\n\"layerIndex\": number;\n\"source\": null | string;\n\"diagnostics\": Array<string>;\n}>);\n\"writeProgram\"?: undefined | ((options: {\n\"materialId\"?: undefined | number;\n\"cloneFrom\"?: undefined | number;\n\"layerIndex\": number;\n\"source\": string;\n\"objectIds\"?: undefined | Array<number>;\n}) => Promise<{\n\"materialId\": number;\n\"objectIds\": Array<number>;\n\"referenceIdChanges\": {\n[key: string]: number;\n};\n\"parameters\"?: undefined | Array<{\n\"name\": string;\n\"referenceId\": number;\n\"value\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"exposed\"?: undefined | false | true;\n}>;\n\"diagnostics\"?: undefined | Array<string>;\n\"status\": \"applied\";\n\"rendering\": \"unverified\";\n}>);\n\"status\": (() => Promise<{\n\"remaining\": null | number;\n\"pendingResources\": null | {\n[key: string]: Array<string>;\n};\n\"errors\"?: undefined | Array<{\n\"source\": \"compiler-progress\" | \"pending-resources\";\n\"message\": string;\n}>;\n\"shaderDiagnostics\"?: undefined | {\n\"status\": \"unavailable\";\n\"reason\": string;\n};\n\"rendering\": \"unverified\";\n\"explanation\": string;\n}>);\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_MATERIALS_DECLARATIONS = "declare const womp: { materials: {\n\"catalog\": ((options?: undefined | {\n\"refreshTextures\"?: undefined | false | true;\n\"includeTextures\"?: undefined | false | true;\n\"operations\"?: undefined | Array<string>;\n}) => Promise<{\n\"operations\": Array<{\n\"op\": string;\n\"category\": string;\n\"title\": string;\n}>;\n\"nodes\": {\n[key: string]: {\n\"type\": string;\n\"title\": string;\n\"description\": string;\n\"inputs\": Array<{\n\"title\": string;\n\"type\": string;\n\"values\"?: undefined | Array<string>;\n}>;\n\"outputs\": Array<{\n\"title\": string;\n\"type\": string;\n\"values\"?: undefined | Array<string>;\n}>;\n};\n};\n\"textureCount\": number;\n\"textures\"?: undefined | Array<string>;\n\"textureMetadata\"?: undefined | {\n\"channels\": \"unknown\";\n\"colorSpace\": \"unknown\";\n\"normalConvention\": \"unknown\";\n\"reason\": string;\n};\n}>);\n\"read\": ((materialId?: undefined | number) => Promise<{\n\"materials\": Array<{\n\"id\": number;\n\"shaderIds\": Array<number>;\n\"objectIds\": Array<number>;\n}>;\n\"material\"?: undefined | {\n\"id\": number;\n\"data\": {\n[key: string]: unknown;\n};\n\"layers\": Array<null | {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>;\n};\n\"diagnostics\": Array<string>;\n}>);\n\"node\": ((options: {\n\"op\": string;\n\"name\"?: undefined | string;\n\"reference_id\"?: undefined | number;\n\"inputs\"?: undefined | {\n[key: string]: number | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n};\n\"texture\"?: undefined | string;\n\"ramp\"?: undefined | Array<{\n\"position\": number;\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n}>;\n\"options\"?: undefined | Array<{\n\"name\": string;\n\"value\": number;\n}>;\n}) => {\n\"op\": string;\n[key: string]: unknown;\n});\n\"recipe\": ((options: {\n\"pattern\": \"noise\" | \"grain\" | \"woven\" | \"grid\";\n\"coordinateSpace\": \"object\" | \"world\";\n\"featureSize\": number | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"colorA\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"colorB\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"roughnessA\": number;\n\"roughnessB\": number;\n\"metalness\"?: undefined | number;\n\"detail\"?: undefined | number;\n\"relief\": \"height\" | \"bump\";\n\"reliefScale\": number;\n}) => Promise<{\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>);\n\"field\": ((options: {\n\"pattern\": \"noise\" | \"grain\" | \"woven\" | \"grid\" | \"cells\";\n\"coordinateSpace\": \"object\" | \"world\";\n\"featureSize\": number | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"detail\"?: undefined | number;\n\"rotation\"?: undefined | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"cellMode\"?: undefined | \"Distance\" | \"Edge distance\" | \"Color\" | \"Smooth Distance\" | \"Smooth Color\";\n\"remap\"?: undefined | {\n\"low\": number;\n\"high\": number;\n};\n}) => Promise<{\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n}>);\n\"compose\": ((options: {\n\"fields\": Array<{\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n}>;\n\"color\"?: undefined | {\n\"low\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"high\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"weights\": Array<number>;\n};\n\"roughness\"?: undefined | {\n\"low\": number;\n\"high\": number;\n\"weights\": Array<number>;\n};\n\"metalness\"?: undefined | number;\n\"relief\"?: undefined | {\n\"mode\": \"height\" | \"bump\";\n\"scale\": number;\n\"weights\": Array<number>;\n\"center\"?: undefined | number;\n};\n}) => Promise<{\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>);\n\"shape\": ((field: {\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n}, options: {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"remap\";\n\"low\": number;\n\"high\": number;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"ridge\";\n\"center\": number;\n\"width\": number;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"periodic\";\n\"coordinates\"?: undefined | number;\n\"axis\": 0 | 1 | 2;\n\"sharpness\": number;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"warp\";\n\"coordinates\"?: undefined | number;\n\"frequency\": number;\n\"amplitude\": number;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"palette\";\n\"mode\": \"Constant\" | \"Linear\" | \"Smooth\";\n\"stops\": Array<{\n\"position\": number;\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n}>;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"blend\";\n\"overlay\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n} | {\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n};\n\"mask\": number | {\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n};\n}) => Promise<{\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n}>);\n\"inspect\"?: undefined | ((options: {\n\"views\": Array<{\n\"camera\"?: undefined | {\n\"position\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"target\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"projection\"?: undefined | \"perspective\" | \"orthographic\";\n\"horizontalFovDegrees\"?: undefined | number;\n\"orthographicWidth\"?: undefined | number;\n};\n}>;\n\"timeoutMs\"?: undefined | number;\n}) => Promise<{\n\"frames\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"queueSettled\": false | true;\n\"timedOut\": false | true;\n\"status\": {\n\"remaining\": null | number;\n\"pendingResources\": null | {\n[key: string]: Array<string>;\n};\n\"errors\"?: undefined | Array<{\n\"source\": \"compiler-progress\" | \"pending-resources\";\n\"message\": string;\n}>;\n\"shaderDiagnostics\"?: undefined | {\n\"status\": \"unavailable\";\n\"reason\": string;\n};\n\"rendering\": \"unverified\";\n\"explanation\": string;\n};\n}>);\n\"write\": ((options: {\n\"materialId\"?: undefined | number;\n\"cloneFrom\"?: undefined | number;\n\"layers\"?: undefined | Array<null | {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>;\n\"constants\"?: undefined | {\n[key: string]: null | {\n\"value\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n};\n};\n\"objectIds\"?: undefined | Array<number>;\n}) => Promise<{\n\"materialId\": number;\n\"objectIds\": Array<number>;\n\"referenceIdChanges\": {\n[key: string]: number;\n};\n\"parameters\"?: undefined | Array<{\n\"name\": string;\n\"referenceId\": number;\n\"value\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"exposed\"?: undefined | false | true;\n}>;\n\"status\": \"applied\";\n\"rendering\": \"unverified\";\n}>);\n\"status\": (() => Promise<{\n\"remaining\": null | number;\n\"pendingResources\": null | {\n[key: string]: Array<string>;\n};\n\"errors\"?: undefined | Array<{\n\"source\": \"compiler-progress\" | \"pending-resources\";\n\"message\": string;\n}>;\n\"shaderDiagnostics\"?: undefined | {\n\"status\": \"unavailable\";\n\"reason\": string;\n};\n\"rendering\": \"unverified\";\n\"explanation\": string;\n}>);\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_MATERIALS_DECLARATIONS = "declare const womp: { materials: {\n\"catalog\": ((options?: undefined | {\n\"refreshTextures\"?: undefined | false | true;\n\"includeTextures\"?: undefined | false | true;\n\"operations\"?: undefined | Array<string>;\n}) => Promise<{\n\"operations\": Array<{\n\"op\": string;\n\"category\": string;\n\"title\": string;\n}>;\n\"nodes\": {\n[key: string]: {\n\"type\": string;\n\"title\": string;\n\"description\": string;\n\"inputs\": Array<{\n\"title\": string;\n\"type\": string;\n\"values\"?: undefined | Array<string>;\n}>;\n\"outputs\": Array<{\n\"title\": string;\n\"type\": string;\n\"values\"?: undefined | Array<string>;\n}>;\n};\n};\n\"textureCount\": number;\n\"textures\"?: undefined | Array<string>;\n\"textureMetadata\"?: undefined | {\n\"channels\": \"unknown\";\n\"colorSpace\": \"unknown\";\n\"normalConvention\": \"unknown\";\n\"reason\": string;\n};\n}>);\n\"read\": ((materialId?: undefined | number) => Promise<{\n\"materials\": Array<{\n\"id\": number;\n\"shaderIds\": Array<number>;\n\"objectIds\": Array<number>;\n}>;\n\"material\"?: undefined | {\n\"id\": number;\n\"data\": {\n[key: string]: unknown;\n};\n\"layers\": Array<null | {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>;\n};\n\"diagnostics\": Array<string>;\n}>);\n\"node\": ((options: {\n\"op\": string;\n\"name\"?: undefined | string;\n\"reference_id\"?: undefined | number;\n\"inputs\"?: undefined | {\n[key: string]: number | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n};\n\"texture\"?: undefined | string;\n\"ramp\"?: undefined | Array<{\n\"position\": number;\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n}>;\n\"options\"?: undefined | Array<{\n\"name\": string;\n\"value\": number;\n}>;\n}) => {\n\"op\": string;\n[key: string]: unknown;\n});\n\"recipe\": ((options: {\n\"pattern\": \"noise\" | \"grain\" | \"woven\" | \"grid\";\n\"coordinateSpace\": \"object\" | \"world\";\n\"featureSize\": number | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"colorA\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"colorB\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"roughnessA\": number;\n\"roughnessB\": number;\n\"metalness\"?: undefined | number;\n\"detail\"?: undefined | number;\n\"relief\": \"height\" | \"bump\";\n\"reliefScale\": number;\n}) => Promise<{\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>);\n\"field\": ((options: {\n\"pattern\": \"noise\" | \"grain\" | \"woven\" | \"grid\" | \"cells\";\n\"coordinateSpace\": \"object\" | \"world\";\n\"featureSize\": number | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"detail\"?: undefined | number;\n\"rotation\"?: undefined | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"cellMode\"?: undefined | \"Distance\" | \"Edge distance\" | \"Color\" | \"Smooth Distance\" | \"Smooth Color\";\n\"remap\"?: undefined | {\n\"low\": number;\n\"high\": number;\n};\n}) => Promise<{\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n}>);\n\"compose\": ((options: {\n\"fields\": Array<{\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n}>;\n\"color\"?: undefined | {\n\"low\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"high\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"weights\": Array<number>;\n};\n\"roughness\"?: undefined | {\n\"low\": number;\n\"high\": number;\n\"weights\": Array<number>;\n};\n\"metalness\"?: undefined | number;\n\"relief\"?: undefined | {\n\"mode\": \"height\" | \"bump\";\n\"scale\": number;\n\"weights\": Array<number>;\n\"center\"?: undefined | number;\n};\n}) => Promise<{\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>);\n\"shape\": ((field: {\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n}, options: {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"remap\";\n\"low\": number;\n\"high\": number;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"ridge\";\n\"center\": number;\n\"width\": number;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"periodic\";\n\"coordinates\"?: undefined | number;\n\"axis\": 0 | 1 | 2;\n\"sharpness\": number;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"warp\";\n\"coordinates\"?: undefined | number;\n\"frequency\": number;\n\"amplitude\": number;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"palette\";\n\"mode\": \"Constant\" | \"Linear\" | \"Smooth\";\n\"stops\": Array<{\n\"position\": number;\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n}>;\n} | {\n\"name\"?: undefined | string;\n} & {\n\"kind\": \"blend\";\n\"overlay\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n} | {\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n};\n\"mask\": number | {\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n};\n}) => Promise<{\n\"graph\": {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n};\n\"source\": {\n\"node\": number;\n\"slot\": number;\n};\n}>);\n\"inspect\"?: undefined | ((options: {\n\"views\": Array<{\n\"camera\"?: undefined | {\n\"position\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"target\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"projection\"?: undefined | \"perspective\" | \"orthographic\";\n\"horizontalFovDegrees\"?: undefined | number;\n\"orthographicWidth\"?: undefined | number;\n};\n}>;\n\"timeoutMs\"?: undefined | number;\n}) => Promise<{\n\"frames\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"queueSettled\": false | true;\n\"timedOut\": false | true;\n\"status\": {\n\"remaining\": null | number;\n\"pendingResources\": null | {\n[key: string]: Array<string>;\n};\n\"errors\"?: undefined | Array<{\n\"source\": \"compiler-progress\" | \"pending-resources\";\n\"message\": string;\n}>;\n\"shaderDiagnostics\"?: undefined | {\n\"status\": \"unavailable\";\n\"reason\": string;\n};\n\"rendering\": \"unverified\";\n\"explanation\": string;\n};\n}>);\n\"write\": ((options: {\n\"materialId\"?: undefined | number;\n\"cloneFrom\"?: undefined | number;\n\"layers\"?: undefined | Array<null | {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>;\n\"constants\"?: undefined | {\n[key: string]: null | {\n\"value\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n};\n};\n\"objectIds\"?: undefined | Array<number>;\n}) => Promise<{\n\"materialId\": number;\n\"objectIds\": Array<number>;\n\"referenceIdChanges\": {\n[key: string]: number;\n};\n\"parameters\"?: undefined | Array<{\n\"name\": string;\n\"referenceId\": number;\n\"value\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"exposed\"?: undefined | false | true;\n}>;\n\"diagnostics\"?: undefined | Array<string>;\n\"status\": \"applied\";\n\"rendering\": \"unverified\";\n}>);\n\"readProgram\"?: undefined | ((materialId: number, layerIndex: number) => Promise<{\n\"materialId\": number;\n\"layerIndex\": number;\n\"source\": null | string;\n\"diagnostics\": Array<string>;\n}>);\n\"writeProgram\"?: undefined | ((options: {\n\"materialId\"?: undefined | number;\n\"cloneFrom\"?: undefined | number;\n\"layerIndex\": number;\n\"source\": string;\n\"objectIds\"?: undefined | Array<number>;\n}) => Promise<{\n\"materialId\": number;\n\"objectIds\": Array<number>;\n\"referenceIdChanges\": {\n[key: string]: number;\n};\n\"parameters\"?: undefined | Array<{\n\"name\": string;\n\"referenceId\": number;\n\"value\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"exposed\"?: undefined | false | true;\n}>;\n\"diagnostics\"?: undefined | Array<string>;\n\"status\": \"applied\";\n\"rendering\": \"unverified\";\n}>);\n\"status\": (() => Promise<{\n\"remaining\": null | number;\n\"pendingResources\": null | {\n[key: string]: Array<string>;\n};\n\"errors\"?: undefined | Array<{\n\"source\": \"compiler-progress\" | \"pending-resources\";\n\"message\": string;\n}>;\n\"shaderDiagnostics\"?: undefined | {\n\"status\": \"unavailable\";\n\"reason\": string;\n};\n\"rendering\": \"unverified\";\n\"explanation\": string;\n}>);\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";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const WOMP_MATERIALS_FLOWIR_DECLARATIONS = "declare const womp: { materials: {\n\"catalog\": ((options?: undefined | {\n\"refreshTextures\"?: undefined | false | true;\n\"includeTextures\"?: undefined | false | true;\n\"operations\"?: undefined | Array<string>;\n}) => Promise<{\n\"operations\": Array<{\n\"op\": string;\n\"category\": string;\n\"title\": string;\n}>;\n\"nodes\": {\n[key: string]: {\n\"type\": string;\n\"title\": string;\n\"description\": string;\n\"inputs\": Array<{\n\"title\": string;\n\"type\": string;\n\"values\"?: undefined | Array<string>;\n}>;\n\"outputs\": Array<{\n\"title\": string;\n\"type\": string;\n\"values\"?: undefined | Array<string>;\n}>;\n};\n};\n\"textureCount\": number;\n\"textures\"?: undefined | Array<string>;\n\"textureMetadata\"?: undefined | {\n\"channels\": \"unknown\";\n\"colorSpace\": \"unknown\";\n\"normalConvention\": \"unknown\";\n\"reason\": string;\n};\n}>);\n\"read\": ((materialId?: undefined | number) => Promise<{\n\"materials\": Array<{\n\"id\": number;\n\"shaderIds\": Array<number>;\n\"objectIds\": Array<number>;\n}>;\n\"material\"?: undefined | {\n\"id\": number;\n\"data\": {\n[key: string]: unknown;\n};\n\"layers\": Array<null | {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>;\n};\n\"diagnostics\": Array<string>;\n}>);\n\"write\": ((options: {\n\"materialId\"?: undefined | number;\n\"cloneFrom\"?: undefined | number;\n\"layers\"?: undefined | Array<null | {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>;\n\"constants\"?: undefined | {\n[key: string]: null | {\n\"value\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n};\n};\n\"objectIds\"?: undefined | Array<number>;\n}) => Promise<{\n\"materialId\": number;\n\"objectIds\": Array<number>;\n\"referenceIdChanges\": {\n[key: string]: number;\n};\n\"parameters\"?: undefined | Array<{\n\"name\": string;\n\"referenceId\": number;\n\"value\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"exposed\"?: undefined | false | true;\n}>;\n\"diagnostics\"?: undefined | Array<string>;\n\"status\": \"applied\";\n\"rendering\": \"unverified\";\n}>);\n\"readProgram\"?: undefined | ((materialId: number, layerIndex: number) => Promise<{\n\"materialId\": number;\n\"layerIndex\": number;\n\"source\": null | string;\n\"diagnostics\": Array<string>;\n}>);\n\"writeProgram\"?: undefined | ((options: {\n\"materialId\"?: undefined | number;\n\"cloneFrom\"?: undefined | number;\n\"layerIndex\": number;\n\"source\": string;\n\"objectIds\"?: undefined | Array<number>;\n}) => Promise<{\n\"materialId\": number;\n\"objectIds\": Array<number>;\n\"referenceIdChanges\": {\n[key: string]: number;\n};\n\"parameters\"?: undefined | Array<{\n\"name\": string;\n\"referenceId\": number;\n\"value\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"exposed\"?: undefined | false | true;\n}>;\n\"diagnostics\"?: undefined | Array<string>;\n\"status\": \"applied\";\n\"rendering\": \"unverified\";\n}>);\n\"inspect\"?: undefined | ((options: {\n\"views\": Array<{\n\"camera\"?: undefined | {\n\"position\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"target\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"projection\"?: undefined | \"perspective\" | \"orthographic\";\n\"horizontalFovDegrees\"?: undefined | number;\n\"orthographicWidth\"?: undefined | number;\n};\n}>;\n\"timeoutMs\"?: undefined | number;\n}) => Promise<{\n\"frames\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"queueSettled\": false | true;\n\"timedOut\": false | true;\n\"status\": {\n\"remaining\": null | number;\n\"pendingResources\": null | {\n[key: string]: Array<string>;\n};\n\"errors\"?: undefined | Array<{\n\"source\": \"compiler-progress\" | \"pending-resources\";\n\"message\": string;\n}>;\n\"shaderDiagnostics\"?: undefined | {\n\"status\": \"unavailable\";\n\"reason\": string;\n};\n\"rendering\": \"unverified\";\n\"explanation\": string;\n};\n}>);\n\"status\": (() => Promise<{\n\"remaining\": null | number;\n\"pendingResources\": null | {\n[key: string]: Array<string>;\n};\n\"errors\"?: undefined | Array<{\n\"source\": \"compiler-progress\" | \"pending-resources\";\n\"message\": string;\n}>;\n\"shaderDiagnostics\"?: undefined | {\n\"status\": \"unavailable\";\n\"reason\": string;\n};\n\"rendering\": \"unverified\";\n\"explanation\": string;\n}>);\n} & {\n\"recipe\": ((options: {\n\"pattern\": \"noise\" | \"grain\" | \"woven\" | \"grid\";\n\"coordinateSpace\": \"object\" | \"world\";\n\"featureSize\": number | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"colorA\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"colorB\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"roughnessA\": number;\n\"roughnessB\": number;\n\"metalness\"?: undefined | number;\n\"detail\"?: undefined | number;\n\"relief\": \"height\" | \"bump\";\n\"reliefScale\": number;\n} & {\n\"pattern\": \"grid\";\n}) => Promise<{\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>);\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";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Generated by scripts/generate-skill-declarations.mjs.
|
|
2
|
+
// prettier-ignore
|
|
3
|
+
export const WOMP_MATERIALS_FLOWIR_DECLARATIONS = "declare const womp: { materials: {\n\"catalog\": ((options?: undefined | {\n\"refreshTextures\"?: undefined | false | true;\n\"includeTextures\"?: undefined | false | true;\n\"operations\"?: undefined | Array<string>;\n}) => Promise<{\n\"operations\": Array<{\n\"op\": string;\n\"category\": string;\n\"title\": string;\n}>;\n\"nodes\": {\n[key: string]: {\n\"type\": string;\n\"title\": string;\n\"description\": string;\n\"inputs\": Array<{\n\"title\": string;\n\"type\": string;\n\"values\"?: undefined | Array<string>;\n}>;\n\"outputs\": Array<{\n\"title\": string;\n\"type\": string;\n\"values\"?: undefined | Array<string>;\n}>;\n};\n};\n\"textureCount\": number;\n\"textures\"?: undefined | Array<string>;\n\"textureMetadata\"?: undefined | {\n\"channels\": \"unknown\";\n\"colorSpace\": \"unknown\";\n\"normalConvention\": \"unknown\";\n\"reason\": string;\n};\n}>);\n\"read\": ((materialId?: undefined | number) => Promise<{\n\"materials\": Array<{\n\"id\": number;\n\"shaderIds\": Array<number>;\n\"objectIds\": Array<number>;\n}>;\n\"material\"?: undefined | {\n\"id\": number;\n\"data\": {\n[key: string]: unknown;\n};\n\"layers\": Array<null | {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>;\n};\n\"diagnostics\": Array<string>;\n}>);\n\"write\": ((options: {\n\"materialId\"?: undefined | number;\n\"cloneFrom\"?: undefined | number;\n\"layers\"?: undefined | Array<null | {\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>;\n\"constants\"?: undefined | {\n[key: string]: null | {\n\"value\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n};\n};\n\"objectIds\"?: undefined | Array<number>;\n}) => Promise<{\n\"materialId\": number;\n\"objectIds\": Array<number>;\n\"referenceIdChanges\": {\n[key: string]: number;\n};\n\"parameters\"?: undefined | Array<{\n\"name\": string;\n\"referenceId\": number;\n\"value\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"exposed\"?: undefined | false | true;\n}>;\n\"diagnostics\"?: undefined | Array<string>;\n\"status\": \"applied\";\n\"rendering\": \"unverified\";\n}>);\n\"readProgram\"?: undefined | ((materialId: number, layerIndex: number) => Promise<{\n\"materialId\": number;\n\"layerIndex\": number;\n\"source\": null | string;\n\"diagnostics\": Array<string>;\n}>);\n\"writeProgram\"?: undefined | ((options: {\n\"materialId\"?: undefined | number;\n\"cloneFrom\"?: undefined | number;\n\"layerIndex\": number;\n\"source\": string;\n\"objectIds\"?: undefined | Array<number>;\n}) => Promise<{\n\"materialId\": number;\n\"objectIds\": Array<number>;\n\"referenceIdChanges\": {\n[key: string]: number;\n};\n\"parameters\"?: undefined | Array<{\n\"name\": string;\n\"referenceId\": number;\n\"value\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"color\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"exposed\"?: undefined | false | true;\n}>;\n\"diagnostics\"?: undefined | Array<string>;\n\"status\": \"applied\";\n\"rendering\": \"unverified\";\n}>);\n\"inspect\"?: undefined | ((options: {\n\"views\": Array<{\n\"camera\"?: undefined | {\n\"position\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"target\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"projection\"?: undefined | \"perspective\" | \"orthographic\";\n\"horizontalFovDegrees\"?: undefined | number;\n\"orthographicWidth\"?: undefined | number;\n};\n}>;\n\"timeoutMs\"?: undefined | number;\n}) => Promise<{\n\"frames\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"queueSettled\": false | true;\n\"timedOut\": false | true;\n\"status\": {\n\"remaining\": null | number;\n\"pendingResources\": null | {\n[key: string]: Array<string>;\n};\n\"errors\"?: undefined | Array<{\n\"source\": \"compiler-progress\" | \"pending-resources\";\n\"message\": string;\n}>;\n\"shaderDiagnostics\"?: undefined | {\n\"status\": \"unavailable\";\n\"reason\": string;\n};\n\"rendering\": \"unverified\";\n\"explanation\": string;\n};\n}>);\n\"status\": (() => Promise<{\n\"remaining\": null | number;\n\"pendingResources\": null | {\n[key: string]: Array<string>;\n};\n\"errors\"?: undefined | Array<{\n\"source\": \"compiler-progress\" | \"pending-resources\";\n\"message\": string;\n}>;\n\"shaderDiagnostics\"?: undefined | {\n\"status\": \"unavailable\";\n\"reason\": string;\n};\n\"rendering\": \"unverified\";\n\"explanation\": string;\n}>);\n} & {\n\"recipe\": ((options: {\n\"pattern\": \"noise\" | \"grain\" | \"woven\" | \"grid\";\n\"coordinateSpace\": \"object\" | \"world\";\n\"featureSize\": number | {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"colorA\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"colorB\": {\n\"x\": number;\n\"y\": number;\n\"z\": number;\n};\n\"roughnessA\": number;\n\"roughnessB\": number;\n\"metalness\"?: undefined | number;\n\"detail\"?: undefined | number;\n\"relief\": \"height\" | \"bump\";\n\"reliefScale\": number;\n} & {\n\"pattern\": \"grid\";\n}) => Promise<{\n\"nodes\": Array<{\n\"op\": string;\n[key: string]: unknown;\n}>;\n\"connections\": Array<{\n\"input_node\": number;\n\"input_slot\": number;\n\"output_node\": number;\n\"output_slot\": number;\n\"flags\"?: undefined | number;\n}>;\n}>);\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";
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { applyCompaction, latestCompaction, type SparkCompactionLimits } from ".
|
|
|
5
5
|
export * from "./context-window.js";
|
|
6
6
|
export * from "./capabilities.js";
|
|
7
7
|
export { createSdkSceneEditor, createSdkSceneHost, type SdkSceneEditor, type SdkSceneEditorOptions, type SdkSceneEditIdentity, type SdkSceneServices, } from "./sdk-scene-host.js";
|
|
8
|
-
export {
|
|
8
|
+
export type { SceneOperation } from "./scene-operations.js";
|
|
9
9
|
export type { JavaScriptExecutor, JavaScriptGlobals, JavaScriptUserWait } from "./executor.js";
|
|
10
10
|
export { DEFAULT_MODEL_ID, getSparkModel, REASONING_EFFORT_LABELS, resolveReasoningEffort, SPARK_MODELS, } from "./models.js";
|
|
11
11
|
export type { ModelProvider, ReasoningEffort, SparkModel } from "./models.js";
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,5 @@ export { applyCompaction, latestCompaction } from "./compaction.js";
|
|
|
5
5
|
export * from "./context-window.js";
|
|
6
6
|
export * from "./capabilities.js";
|
|
7
7
|
export { createSdkSceneEditor, createSdkSceneHost, } from "./sdk-scene-host.js";
|
|
8
|
-
export { recoverSceneOperation } from "./scene-operations.js";
|
|
9
8
|
export { DEFAULT_MODEL_ID, getSparkModel, REASONING_EFFORT_LABELS, resolveReasoningEffort, SPARK_MODELS, } from "./models.js";
|
|
10
9
|
export { SPARK_AGENT_PROMPT, sparkSystemPrompt } from "./prompt.js";
|
package/dist/kakapo.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { KakapoRuntime } from "./runtime.js";
|
|
2
2
|
export { createSdkSceneDraft, createSdkSceneEditor, createSdkSceneHost, type SdkSceneEditor, type SdkSceneEditorOptions, type SdkSceneEditIdentity, type SdkSceneServices, } from "./sdk-scene-host.js";
|
|
3
|
-
export type { SceneOperation
|
|
3
|
+
export type { SceneOperation } from "./scene-operations.js";
|
|
4
4
|
export { createWompSceneApi, NodeType, OperationType, PrimitiveTypeValue, } from "./womp-scene-api.js";
|
|
5
5
|
export type { WompSceneApi, WompSceneApiContext } from "./womp-scene-api.js";
|
|
6
6
|
export { createSdkGeometryHost, type SdkGeometryHostOptions, } from "./sdk-geometry-host.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as flowir from "@womp/flowir";
|
|
2
|
+
import type { MaterialGraph, MaterialNodeDescription } from "./types.js";
|
|
3
|
+
export declare const materialFlowirRegistry: flowir.Registry;
|
|
4
|
+
export declare const materialDialectNames: Record<string, string>;
|
|
5
|
+
export declare const materialScalarMathOperations: readonly ["ScalarAdd", "ScalarSubtract", "ScalarMultiply", "ScalarDivide"];
|
|
6
|
+
export declare function materialFlowirReference(): string;
|
|
7
|
+
export declare const materialMathOperations: readonly ["MathAdd", "MathSubtract", "MathMultiply", "MathDivide", "", "MathPower", "MathSine", "MathCosine", "MathAbsoluteValue", "MathLength", "MathFraction", "MathModulo", "MathFloor", "MathMin", "MathMax", "MathDotProduct", "MathNormalize", "MathDistance", "MathSnap", "MathPingPong", "MathTangent", "MathArcsine", "MathArccosine", "MathArctangent", "MathArctan2"];
|
|
8
|
+
type Lowered = {
|
|
9
|
+
graph: MaterialGraph;
|
|
10
|
+
symbols: Record<string, number>;
|
|
11
|
+
};
|
|
12
|
+
export declare function comparableMaterialGraph(graph: MaterialGraph): string;
|
|
13
|
+
export declare function materialPortSlot(nodeType: string, name: string, index: number): number;
|
|
14
|
+
export declare function compileMaterialFlowir(source: string, catalog: Record<string, MaterialNodeDescription>): Lowered;
|
|
15
|
+
export {};
|