@womp/spark-agent 9.0.0 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/dist/capabilities/flow-runs.d.ts +95 -0
- package/dist/capabilities/flow-runs.js +77 -0
- package/dist/capabilities/materials.d.ts +10 -1
- package/dist/capabilities/materials.js +30 -10
- package/dist/capabilities.d.ts +2 -0
- package/dist/capabilities.js +1 -0
- package/dist/generated/flow-runs-declarations.d.ts +1 -0
- package/dist/generated/flow-runs-declarations.js +3 -0
- 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/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/sdk-materials-host.js +136 -10
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,44 @@ 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.2.0 — 2026-10-12
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `flowRuns` capability (`flow-runs` skill, `womp.flowRuns`): describe, run, follow (`status`,
|
|
12
|
+
`wait` up to 60 s) and cancel a run of the user's saved Flow pipeline, with no canvas open.
|
|
13
|
+
Hosts implement `FlowRunsHost`; one run starts per JavaScript call, and run ids are validated
|
|
14
|
+
before the host is called. Crow composes it under the run's `flowRun` gate.
|
|
15
|
+
- flowRuns.run({ copy: true }) runs the flow on a new copy of the project ("Flow runs" folder); start and status report projectId, sourceProjectId and projectUrl. A copy start waits through `waitForService` ("Copying the project") when the host has it, so the copy is outside the 60 s JavaScript budget.
|
|
16
|
+
- flowRuns.run({ copy: true, deleteCopy: true }) deletes the copy once the run ends, and flowRuns.deleteCopy(runId) deletes an ended copy run's copy (through `waitForService`, "Deleting the copy"). Start and status report deleteCopy and copyDeletedAt; projectUrl is null once the copy is gone. Output links keep working. Right after a cancel, deleteCopy(runId) may answer run_active for about a minute while the run stops; the skill says to retry later.
|
|
17
|
+
|
|
18
|
+
## 9.1.0 — 2026-10-12
|
|
19
|
+
|
|
20
|
+
The agent writes procedural materials as FlowIR programs, the same way it writes Geometry Nodes,
|
|
21
|
+
instead of building native shader-graph JSON.
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- `womp.materials.writeProgram({ cloneFrom | materialId, layerIndex, source, objectIds })` compiles
|
|
26
|
+
a FlowIR program to a Kakapo shader graph and writes one layer. It keeps the material's base
|
|
27
|
+
properties and other layers, gives a shared shader its own storage before editing it, and
|
|
28
|
+
carries panel overrides over by parameter name and type, reporting the ones it resets.
|
|
29
|
+
- `womp.materials.readProgram(materialId, layerIndex)` returns the layer's FlowIR source: the
|
|
30
|
+
saved source while it still matches the native graph, otherwise source lifted from the graph,
|
|
31
|
+
or `null` with diagnostics when the graph cannot be represented without loss.
|
|
32
|
+
- The materials dialect covers 61 node types. The written source is saved in the scene's
|
|
33
|
+
`shadersExt[shaderId].flowirSource`.
|
|
34
|
+
- `yarn test:live:materials` writes and reads every dialect node against a running Kakapo.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- When the materials host provides `writeProgram`, `procedural-materials` (skill version 18)
|
|
39
|
+
teaches FlowIR authoring, and the native JSON graph API moves to
|
|
40
|
+
`procedural-materials-reference` (version 9) and `procedural-materials-recipes` (version 10).
|
|
41
|
+
`createSdkMaterialsHost` always provides it, so Swan, Crow and the standalone server switch to
|
|
42
|
+
FlowIR materials when they take this version. A host that supplies its own `MaterialsHost`
|
|
43
|
+
without `writeProgram` keeps the previous skills.
|
|
44
|
+
|
|
7
45
|
## 9.0.0 — 2026-10-12
|
|
8
46
|
|
|
9
47
|
The scene operation journal is gone: every SDK scene adapter applies each edit directly to the
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { SparkCapability, SparkInvocationContext } from "../capabilities.js";
|
|
2
|
+
/** An input the flow can be run with, addressed by its input node id. */
|
|
3
|
+
export type FlowRunInput = {
|
|
4
|
+
nodeId: string;
|
|
5
|
+
typeId: string;
|
|
6
|
+
valueType: string;
|
|
7
|
+
/** The value saved in the flow now. */
|
|
8
|
+
value: unknown;
|
|
9
|
+
/** Wired into the graph: a run needs a value for it. */
|
|
10
|
+
required: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type FlowRunOutputNode = {
|
|
13
|
+
nodeId: string;
|
|
14
|
+
typeId: string;
|
|
15
|
+
};
|
|
16
|
+
export type FlowRunLive = {
|
|
17
|
+
runId: string;
|
|
18
|
+
trigger: string;
|
|
19
|
+
};
|
|
20
|
+
export type FlowRunDescription = {
|
|
21
|
+
projectId: number;
|
|
22
|
+
snapshotId: string;
|
|
23
|
+
inputs: FlowRunInput[];
|
|
24
|
+
outputs: FlowRunOutputNode[];
|
|
25
|
+
/** The run live on this flow now, if any; only one can be. */
|
|
26
|
+
liveRun: FlowRunLive | null;
|
|
27
|
+
};
|
|
28
|
+
export type FlowRunStarted = {
|
|
29
|
+
runId: string;
|
|
30
|
+
status: string;
|
|
31
|
+
repeated: boolean;
|
|
32
|
+
/** The project the run runs on: the copy for a copy run. */
|
|
33
|
+
projectId: number;
|
|
34
|
+
/** The copied project for a copy run; null in place. */
|
|
35
|
+
sourceProjectId: number | null;
|
|
36
|
+
/** The URL of projectId; null once a copy run's copy was deleted. */
|
|
37
|
+
projectUrl: string | null;
|
|
38
|
+
/** The copy is deleted when the run ends (run({ copy: true, deleteCopy: true })). */
|
|
39
|
+
deleteCopy: boolean;
|
|
40
|
+
/** When the copy was deleted (ISO); null while it exists. */
|
|
41
|
+
copyDeletedAt: string | null;
|
|
42
|
+
};
|
|
43
|
+
export type FlowRunStatus = {
|
|
44
|
+
runId: string;
|
|
45
|
+
/** "running", "completed", "failed" or "cancelled". */
|
|
46
|
+
status: string;
|
|
47
|
+
/** The output nodes' values once completed. */
|
|
48
|
+
outputs: unknown;
|
|
49
|
+
error: string | null;
|
|
50
|
+
errorCode: string | null;
|
|
51
|
+
/** For an ended run: "now" when this call reports it, "earlier" when it was already reported. */
|
|
52
|
+
reported: "now" | "earlier" | null;
|
|
53
|
+
projectId: number;
|
|
54
|
+
sourceProjectId: number | null;
|
|
55
|
+
projectUrl: string | null;
|
|
56
|
+
deleteCopy: boolean;
|
|
57
|
+
copyDeletedAt: string | null;
|
|
58
|
+
};
|
|
59
|
+
export type FlowRunCancelled = {
|
|
60
|
+
runId: string;
|
|
61
|
+
status: string;
|
|
62
|
+
cancelled: boolean;
|
|
63
|
+
};
|
|
64
|
+
export type FlowRunCopyDeleted = {
|
|
65
|
+
runId: string;
|
|
66
|
+
copyDeletedAt: string;
|
|
67
|
+
};
|
|
68
|
+
export type WompFlowRunsApi = {
|
|
69
|
+
describe(): Promise<FlowRunDescription>;
|
|
70
|
+
run(options?: {
|
|
71
|
+
inputs?: Record<string, unknown>;
|
|
72
|
+
copy?: boolean;
|
|
73
|
+
deleteCopy?: boolean;
|
|
74
|
+
}): Promise<FlowRunStarted>;
|
|
75
|
+
status(runId: string): Promise<FlowRunStatus>;
|
|
76
|
+
wait(runId: string, seconds?: number): Promise<FlowRunStatus>;
|
|
77
|
+
cancel(runId: string): Promise<FlowRunCancelled>;
|
|
78
|
+
deleteCopy(runId: string): Promise<FlowRunCopyDeleted>;
|
|
79
|
+
};
|
|
80
|
+
export type FlowRunsHost = {
|
|
81
|
+
describe(context: SparkInvocationContext): Promise<FlowRunDescription>;
|
|
82
|
+
start(options: {
|
|
83
|
+
inputs: Record<string, unknown>;
|
|
84
|
+
copy: boolean;
|
|
85
|
+
deleteCopy: boolean;
|
|
86
|
+
}, context: SparkInvocationContext): Promise<FlowRunStarted>;
|
|
87
|
+
status(runId: string, context: SparkInvocationContext): Promise<FlowRunStatus>;
|
|
88
|
+
/** Waits at most `seconds` for the run to end and returns its status either way. */
|
|
89
|
+
wait(runId: string, seconds: number, context: SparkInvocationContext): Promise<FlowRunStatus>;
|
|
90
|
+
cancel(runId: string, context: SparkInvocationContext): Promise<FlowRunCancelled>;
|
|
91
|
+
deleteCopy(runId: string, context: SparkInvocationContext): Promise<FlowRunCopyDeleted>;
|
|
92
|
+
};
|
|
93
|
+
export declare const FLOW_RUN_WAIT_MAX_SECONDS = 60;
|
|
94
|
+
export declare const FLOW_RUN_WAIT_DEFAULT_SECONDS = 30;
|
|
95
|
+
export declare function createFlowRunsCapability(host: FlowRunsHost): SparkCapability<WompFlowRunsApi>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { WOMP_FLOW_RUNS_DECLARATIONS } from "../generated/flow-runs-declarations.js";
|
|
3
|
+
export const FLOW_RUN_WAIT_MAX_SECONDS = 60;
|
|
4
|
+
export const FLOW_RUN_WAIT_DEFAULT_SECONDS = 30;
|
|
5
|
+
const runId = z
|
|
6
|
+
.string()
|
|
7
|
+
.regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, "Use a runId returned by run().");
|
|
8
|
+
const runOptions = z
|
|
9
|
+
.object({
|
|
10
|
+
inputs: z.record(z.string().min(1).max(200), z.json()).optional(),
|
|
11
|
+
copy: z.boolean().optional(),
|
|
12
|
+
deleteCopy: z.boolean().optional(),
|
|
13
|
+
})
|
|
14
|
+
.strict()
|
|
15
|
+
.refine((options) => !options.deleteCopy || options.copy === true, { message: "deleteCopy needs copy: true." });
|
|
16
|
+
const waitSeconds = z.number().int().min(1).max(FLOW_RUN_WAIT_MAX_SECONDS).default(FLOW_RUN_WAIT_DEFAULT_SECONDS);
|
|
17
|
+
export function createFlowRunsCapability(host) {
|
|
18
|
+
return {
|
|
19
|
+
skills: [
|
|
20
|
+
{
|
|
21
|
+
name: "flow-runs",
|
|
22
|
+
version: "1",
|
|
23
|
+
description: "Run the user's saved Flow (AI Nodes) pipeline on their project, follow the run, and report its result.",
|
|
24
|
+
instructions: `Use womp.flowRuns to run the user's saved Flow pipeline. No canvas needs to be open.
|
|
25
|
+
A run operates on the user's real flow: the input values you pass are written into the flow and become its saved values. describe() lists the inputs by node id with their current values, and the output nodes. Pass only input node ids it lists.
|
|
26
|
+
Only one run of a flow can be live. run() starts the run and returns at once. For a short flow, call wait(runId) and then report the result.
|
|
27
|
+
To leave the user's flow untouched, pass copy: true. The run then happens on a new copy of the project, placed in the user's "Flow runs" folder: the input values, outputs and any scene changes land on the copy, and the user's flow, its saved values and its scene are not changed. Use it when the user wants to try values without changing their flow, or when their flow is busy. A copy run does not lock the scene. run() returns the copy's projectUrl; give it to the user so they can open the result.
|
|
28
|
+
To keep only the result of a copy run, also pass deleteCopy: true: the copy is deleted when the run ends, whether it completed, failed or was cancelled. Use it when the user wants the outputs, not the project; do not give them that run's projectUrl, which stops working (status() then returns projectUrl null).
|
|
29
|
+
To delete a copy run's copy later, call deleteCopy(runId) once the run has ended; it is refused for a run that is still running (cancel it first) or one that did not run on a copy. Right after cancel(), deleteCopy() may answer run_active for about a minute while the run stops: retry later, or pass deleteCopy: true at start instead. Output links keep working after the copy is deleted, either way.
|
|
30
|
+
A run may outlive your turn. If it does, the system reports the result in a follow-up, so do not keep calling status() across many calls.
|
|
31
|
+
When status() or wait() returns an ended run with reported "now", the result is yours to tell the user. With reported "earlier", the result was already reported, earlier in the conversation or by the refusal run() returned to you; do not repeat it.
|
|
32
|
+
Errors start with a code. flow_busy and snapshot_changed mean the user is using the flow: tell them and do not retry. backend_deploying means try again later. not_authorized is final. no_project means the conversation needs a project first.
|
|
33
|
+
Codes starting with input_ mean fix the inputs using describe() and run again. Any other code means tell the user what happened, and do not start another run unless they ask.
|
|
34
|
+
While a run is live on this project (not a copy run), womp.scene.access is refused, for inspecting the scene as well as editing it; womp.scene.health and womp.scene.screenshot still work. To use the scene, wait for the run to end or cancel it.`,
|
|
35
|
+
declarations: WOMP_FLOW_RUNS_DECLARATIONS,
|
|
36
|
+
examples: [
|
|
37
|
+
"print(await womp.flowRuns.describe());",
|
|
38
|
+
'const started = await womp.flowRuns.run({ inputs: { "input-node-id": 123 } }); print(await womp.flowRuns.wait(started.runId, 60));',
|
|
39
|
+
'const started = await womp.flowRuns.run({ inputs: { "input-node-id": 123 }, copy: true }); print(started.projectUrl);',
|
|
40
|
+
'const started = await womp.flowRuns.run({ inputs: { "input-node-id": 123 }, copy: true, deleteCopy: true }); print(await womp.flowRuns.wait(started.runId, 60));',
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
createApi: (context) => {
|
|
45
|
+
let started = false;
|
|
46
|
+
return {
|
|
47
|
+
describe: () => host.describe(context),
|
|
48
|
+
run: async (options) => {
|
|
49
|
+
context.signal.throwIfAborted();
|
|
50
|
+
const parsed = runOptions.parse(options ?? {});
|
|
51
|
+
if (started)
|
|
52
|
+
throw new Error("Start one flow run per JavaScript call. Continue in a new call.");
|
|
53
|
+
started = true;
|
|
54
|
+
const copy = parsed.copy ?? false;
|
|
55
|
+
const start = () => host.start({ inputs: parsed.inputs ?? {}, copy, deleteCopy: parsed.deleteCopy ?? false }, context);
|
|
56
|
+
// Copying can outlast the 60 s JavaScript budget; a service wait is
|
|
57
|
+
// outside it, so the host's own copy timeout applies instead.
|
|
58
|
+
if (copy && context.waitForService)
|
|
59
|
+
return context.waitForService("Copying the project", start);
|
|
60
|
+
return start();
|
|
61
|
+
},
|
|
62
|
+
status: async (id) => host.status(runId.parse(id), context),
|
|
63
|
+
wait: async (id, seconds) => host.wait(runId.parse(id), waitSeconds.parse(seconds), context),
|
|
64
|
+
cancel: async (id) => host.cancel(runId.parse(id), context),
|
|
65
|
+
deleteCopy: async (id) => {
|
|
66
|
+
context.signal.throwIfAborted();
|
|
67
|
+
const parsed = runId.parse(id);
|
|
68
|
+
const remove = () => host.deleteCopy(parsed, context);
|
|
69
|
+
// Deleting a project can outlast the 60 s JavaScript budget, as copying one can.
|
|
70
|
+
if (context.waitForService)
|
|
71
|
+
return context.waitForService("Deleting the copy", remove);
|
|
72
|
+
return remove();
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
@@ -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
|
};
|
package/dist/capabilities.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export { createGeometryCapability } from "./capabilities/geometry.js";
|
|
|
17
17
|
export type { SceneHealthHost } from "./capabilities/scene.js";
|
|
18
18
|
export { createFlowCapability } from "./capabilities/flow.js";
|
|
19
19
|
export type { FlowHost, FlowSnapshot, FlowWrite, FlowWriteResult, WompFlowApi, } from "./capabilities/flow.js";
|
|
20
|
+
export { createFlowRunsCapability, FLOW_RUN_WAIT_DEFAULT_SECONDS, FLOW_RUN_WAIT_MAX_SECONDS, } from "./capabilities/flow-runs.js";
|
|
21
|
+
export type { FlowRunCancelled, FlowRunCopyDeleted, FlowRunDescription, FlowRunInput, FlowRunLive, FlowRunOutputNode, FlowRunStarted, FlowRunStatus, FlowRunsHost, WompFlowRunsApi, } from "./capabilities/flow-runs.js";
|
|
20
22
|
export type { GeometryHost, GeometryTarget, GeometryInstance, GeometryParamValue, GeometryWrite, GeometryWriteResult, WompGeometryApi, } from "./capabilities/geometry.js";
|
|
21
23
|
export type { WompOpenScadApi, OpenScadHost, OpenScadTarget, OpenScadSource, OpenScadCreate, OpenScadUpdate, OpenScadValidation, OpenScadPrintability, OpenScadWriteResult, } from "./capabilities/openscad.js";
|
|
22
24
|
export type ArtifactRef = {
|
package/dist/capabilities.js
CHANGED
|
@@ -6,6 +6,7 @@ export { createAssetsCapability } from "./capabilities/assets.js";
|
|
|
6
6
|
export { createOpenScadCapability } from "./capabilities/openscad.js";
|
|
7
7
|
export { createGeometryCapability } from "./capabilities/geometry.js";
|
|
8
8
|
export { createFlowCapability } from "./capabilities/flow.js";
|
|
9
|
+
export { createFlowRunsCapability, FLOW_RUN_WAIT_DEFAULT_SECONDS, FLOW_RUN_WAIT_MAX_SECONDS, } from "./capabilities/flow-runs.js";
|
|
9
10
|
/** The enabled bindings are also the only source of discoverable skills. */
|
|
10
11
|
export function composeCapabilities(capabilities) {
|
|
11
12
|
const skills = Object.values(capabilities).flatMap((capability) => capability.skills);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const WOMP_FLOW_RUNS_DECLARATIONS = "declare const womp: { flowRuns: {\n\"describe\": (() => Promise<{\n\"projectId\": number;\n\"snapshotId\": string;\n\"inputs\": Array<{\n\"nodeId\": string;\n\"typeId\": string;\n\"valueType\": string;\n\"value\": unknown;\n\"required\": false | true;\n}>;\n\"outputs\": Array<{\n\"nodeId\": string;\n\"typeId\": string;\n}>;\n\"liveRun\": null | {\n\"runId\": string;\n\"trigger\": string;\n};\n}>);\n\"run\": ((options?: undefined | {\n\"inputs\"?: undefined | {\n[key: string]: unknown;\n};\n\"copy\"?: undefined | false | true;\n\"deleteCopy\"?: undefined | false | true;\n}) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"repeated\": false | true;\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n}>);\n\"status\": ((runId: string) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"outputs\": unknown;\n\"error\": null | string;\n\"errorCode\": null | string;\n\"reported\": null | \"now\" | \"earlier\";\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n}>);\n\"wait\": ((runId: string, seconds?: undefined | number) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"outputs\": unknown;\n\"error\": null | string;\n\"errorCode\": null | string;\n\"reported\": null | \"now\" | \"earlier\";\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n}>);\n\"cancel\": ((runId: string) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"cancelled\": false | true;\n}>);\n\"deleteCopy\": ((runId: string) => Promise<{\n\"runId\": string;\n\"copyDeletedAt\": 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,3 @@
|
|
|
1
|
+
// Generated by scripts/generate-skill-declarations.mjs.
|
|
2
|
+
// prettier-ignore
|
|
3
|
+
export const WOMP_FLOW_RUNS_DECLARATIONS = "declare const womp: { flowRuns: {\n\"describe\": (() => Promise<{\n\"projectId\": number;\n\"snapshotId\": string;\n\"inputs\": Array<{\n\"nodeId\": string;\n\"typeId\": string;\n\"valueType\": string;\n\"value\": unknown;\n\"required\": false | true;\n}>;\n\"outputs\": Array<{\n\"nodeId\": string;\n\"typeId\": string;\n}>;\n\"liveRun\": null | {\n\"runId\": string;\n\"trigger\": string;\n};\n}>);\n\"run\": ((options?: undefined | {\n\"inputs\"?: undefined | {\n[key: string]: unknown;\n};\n\"copy\"?: undefined | false | true;\n\"deleteCopy\"?: undefined | false | true;\n}) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"repeated\": false | true;\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n}>);\n\"status\": ((runId: string) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"outputs\": unknown;\n\"error\": null | string;\n\"errorCode\": null | string;\n\"reported\": null | \"now\" | \"earlier\";\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n}>);\n\"wait\": ((runId: string, seconds?: undefined | number) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"outputs\": unknown;\n\"error\": null | string;\n\"errorCode\": null | string;\n\"reported\": null | \"now\" | \"earlier\";\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n}>);\n\"cancel\": ((runId: string) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"cancelled\": false | true;\n}>);\n\"deleteCopy\": ((runId: string) => Promise<{\n\"runId\": string;\n\"copyDeletedAt\": 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 +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";
|
|
@@ -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 {};
|