@bendyline/molen-tooling 0.0.1 → 0.0.3
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/README.md +22 -4
- package/dist/capture/harness.js +216 -216
- package/dist/capture/worldgen-preview.js +288 -288
- package/dist/cli.mjs +134 -12
- package/dist/docs-src/guide/3d-art-guidelines.md +2 -2
- package/dist/docs-src/guide/3d-model-assets.md +49 -13
- package/dist/docs-src/guide/adaptive-performance.md +4 -0
- package/dist/docs-src/guide/agent-loop.md +6 -6
- package/dist/docs-src/guide/aircraft.md +25 -17
- package/dist/docs-src/guide/audio.md +247 -0
- package/dist/docs-src/guide/browser-mount.md +17 -1
- package/dist/docs-src/guide/building-interiors.md +7 -5
- package/dist/docs-src/guide/determinism.md +27 -22
- package/dist/docs-src/guide/earth-view.md +444 -0
- package/dist/docs-src/guide/entities.md +17 -6
- package/dist/docs-src/guide/examples.md +39 -23
- package/dist/docs-src/guide/experience-playback.md +2 -3
- package/dist/docs-src/guide/game-samples.md +50 -21
- package/dist/docs-src/guide/graphics-performance.md +40 -8
- package/dist/docs-src/guide/input.md +9 -0
- package/dist/docs-src/guide/markers.md +52 -0
- package/dist/docs-src/guide/materials.md +10 -3
- package/dist/docs-src/guide/navigation.md +144 -0
- package/dist/docs-src/guide/project.md +23 -3
- package/dist/docs-src/guide/quickstart.md +39 -30
- package/dist/docs-src/guide/recognizable-places.md +24 -17
- package/dist/docs-src/guide/rendering-backends.md +5 -4
- package/dist/docs-src/guide/scripting.md +8 -4
- package/dist/docs-src/guide/sky.md +26 -9
- package/dist/docs-src/guide/source-bundles.md +0 -1
- package/dist/docs-src/guide/structure-library.md +20 -10
- package/dist/docs-src/guide/terrain.md +51 -6
- package/dist/docs-src/guide/vehicles.md +27 -14
- package/dist/docs-src/guide/worldgen.md +34 -24
- package/dist/docs-src/llms.txt +35 -18
- package/dist/docs-src/schemas/README.md +4 -1
- package/dist/docs-src/schemas/archive-set.md +175 -0
- package/dist/docs-src/schemas/components.md +1104 -1
- package/dist/docs-src/schemas/matgraph.md +6 -0
- package/dist/docs-src/schemas/soundbank.md +251 -0
- package/dist/docs-src/schemas/structure-placements.md +496 -0
- package/dist/docs-src/schemas/terrain-package.md +120 -0
- package/dist/index.d.mts +31 -3
- package/dist/index.mjs +2 -2
- package/dist/{mcp-BFnCWrg0.mjs → mcp-BTVwVKFb.mjs} +78 -4
- package/dist/{ops-BGxhSP6w.mjs → ops-BPdHodFR.mjs} +1181 -61
- package/dist/templates/city-courier/README.md +66 -0
- package/dist/templates/city-courier/checks.json +20 -0
- package/dist/templates/city-courier/commands.json +32 -0
- package/dist/templates/city-courier/delivery-run.replay.json +214 -0
- package/dist/templates/city-courier/gen/molen-types.ts +1016 -0
- package/dist/templates/city-courier/index.html +2 -0
- package/dist/templates/city-courier/package.json +26 -0
- package/dist/templates/city-courier/project.json +8 -0
- package/dist/templates/city-courier/scene.json +3474 -0
- package/dist/templates/city-courier/scripts/game.ts +131 -0
- package/dist/templates/city-courier/scripts/molen-scripts.d.ts +1288 -0
- package/dist/templates/city-courier/scripts/tsconfig.json +16 -0
- package/dist/templates/city-courier/src/audio.ts +96 -0
- package/dist/templates/city-courier/src/game-shell.css +317 -0
- package/dist/templates/city-courier/src/main.ts +84 -0
- package/dist/templates/city-courier/src/scene.ts +17 -0
- package/dist/templates/city-courier/src/vite-env.d.ts +1 -0
- package/dist/templates/city-courier/src/worker.ts +5 -0
- package/dist/templates/city-courier/test/headless.test.ts +95 -0
- package/dist/templates/city-courier/test/playthrough.test.js +52 -0
- package/dist/templates/city-courier/test/replay.test.ts +22 -0
- package/dist/templates/city-courier/tsconfig.json +17 -0
- package/dist/templates/city-courier/vite.config.ts +19 -0
- package/dist/templates/cubes/README.md +51 -0
- package/dist/templates/cubes/index.html +16 -0
- package/dist/templates/cubes/package.json +24 -0
- package/dist/templates/cubes/scene.json +15 -0
- package/dist/templates/cubes/src/cubes.ts +100 -0
- package/dist/templates/cubes/src/main.ts +21 -0
- package/dist/templates/cubes/src/worker.ts +15 -0
- package/dist/templates/cubes/test/headless.test.ts +98 -0
- package/dist/templates/cubes/tsconfig.json +17 -0
- package/dist/templates/cubes/vite.config.ts +17 -0
- package/dist/templates/data-viz/README.md +47 -0
- package/dist/templates/data-viz/camera-track.json +12 -0
- package/dist/templates/data-viz/data.json +9 -0
- package/dist/templates/data-viz/index.html +16 -0
- package/dist/templates/data-viz/package.json +25 -0
- package/dist/templates/data-viz/scene.json +7 -0
- package/dist/templates/data-viz/src/main.ts +39 -0
- package/dist/templates/data-viz/src/viz.ts +91 -0
- package/dist/templates/data-viz/src/worker.ts +12 -0
- package/dist/templates/data-viz/test/headless.test.ts +75 -0
- package/dist/templates/data-viz/tsconfig.json +17 -0
- package/dist/templates/data-viz/vite.config.ts +16 -0
- package/dist/templates/figures-gallery/README.md +46 -0
- package/dist/templates/figures-gallery/index.html +16 -0
- package/dist/templates/figures-gallery/package.json +25 -0
- package/dist/templates/figures-gallery/scene.json +276 -0
- package/dist/templates/figures-gallery/src/main.ts +44 -0
- package/dist/templates/figures-gallery/src/worker.ts +17 -0
- package/dist/templates/figures-gallery/test/headless.test.ts +90 -0
- package/dist/templates/figures-gallery/tsconfig.json +17 -0
- package/dist/templates/figures-gallery/vite.config.ts +17 -0
- package/dist/templates/index.json +191 -0
- package/dist/templates/skybound/README.md +66 -0
- package/dist/templates/skybound/checks.json +24 -0
- package/dist/templates/skybound/commands.json +32 -0
- package/dist/templates/skybound/first-leap.replay.json +224 -0
- package/dist/templates/skybound/gen/molen-types.ts +1016 -0
- package/dist/templates/skybound/index.html +2 -0
- package/dist/templates/skybound/package.json +26 -0
- package/dist/templates/skybound/project.json +8 -0
- package/dist/templates/skybound/scene.json +1777 -0
- package/dist/templates/skybound/scripts/game.ts +122 -0
- package/dist/templates/skybound/scripts/molen-scripts.d.ts +1288 -0
- package/dist/templates/skybound/scripts/tsconfig.json +16 -0
- package/dist/templates/skybound/src/audio.ts +96 -0
- package/dist/templates/skybound/src/game-shell.css +317 -0
- package/dist/templates/skybound/src/main.ts +63 -0
- package/dist/templates/skybound/src/scene.ts +17 -0
- package/dist/templates/skybound/src/vite-env.d.ts +1 -0
- package/dist/templates/skybound/src/worker.ts +5 -0
- package/dist/templates/skybound/test/headless.test.ts +124 -0
- package/dist/templates/skybound/test/playthrough.test.js +38 -0
- package/dist/templates/skybound/test/replay.test.ts +22 -0
- package/dist/templates/skybound/tsconfig.json +17 -0
- package/dist/templates/skybound/vite.config.ts +19 -0
- package/dist/templates/terrain-flyover/README.md +46 -0
- package/dist/templates/terrain-flyover/index.html +16 -0
- package/dist/templates/terrain-flyover/package.json +26 -0
- package/dist/templates/terrain-flyover/src/flyover.ts +23 -0
- package/dist/templates/terrain-flyover/src/main.ts +93 -0
- package/dist/templates/terrain-flyover/terrain.json +15 -0
- package/dist/templates/terrain-flyover/test/headless.test.ts +72 -0
- package/dist/templates/terrain-flyover/tsconfig.json +17 -0
- package/dist/templates/terrain-flyover/vite.config.ts +15 -0
- package/dist/templates/top-down-arena/README.md +65 -0
- package/dist/templates/top-down-arena/arena-skirmish.replay.json +204 -0
- package/dist/templates/top-down-arena/index.html +16 -0
- package/dist/templates/top-down-arena/package.json +26 -0
- package/dist/templates/top-down-arena/project.json +10 -0
- package/dist/templates/top-down-arena/scene.json +182 -0
- package/dist/templates/top-down-arena/scripts/chase.ts +17 -0
- package/dist/templates/top-down-arena/scripts/combat.ts +13 -0
- package/dist/templates/top-down-arena/scripts/control.ts +8 -0
- package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +1258 -0
- package/dist/templates/top-down-arena/scripts/spawner.ts +11 -0
- package/dist/templates/top-down-arena/scripts/tsconfig.json +16 -0
- package/dist/templates/top-down-arena/src/arena.ts +8 -0
- package/dist/templates/top-down-arena/src/audio.ts +96 -0
- package/dist/templates/top-down-arena/src/gen/molen-types.ts +1020 -0
- package/dist/templates/top-down-arena/src/main.ts +34 -0
- package/dist/templates/top-down-arena/src/scene.ts +24 -0
- package/dist/templates/top-down-arena/src/vite-env.d.ts +1 -0
- package/dist/templates/top-down-arena/src/worker.ts +7 -0
- package/dist/templates/top-down-arena/test/headless.test.ts +87 -0
- package/dist/templates/top-down-arena/test/replay.test.ts +22 -0
- package/dist/templates/top-down-arena/tsconfig.json +17 -0
- package/dist/templates/top-down-arena/types/arena.types.json +54 -0
- package/dist/templates/top-down-arena/vite.config.ts +21 -0
- package/package.json +14 -14
package/dist/index.d.mts
CHANGED
|
@@ -44,8 +44,12 @@ interface ImportAssetInput {
|
|
|
44
44
|
path: string;
|
|
45
45
|
/** Asset id (default: slugged filename). Dotted ids fall under namespace reservations. */
|
|
46
46
|
id?: string;
|
|
47
|
-
/** Output assets root
|
|
47
|
+
/** Output assets root; explicit overrides retain the <root>/<dotted-id-as-path> layout. */
|
|
48
48
|
outDir?: string;
|
|
49
|
+
/** Exact bundle directory, relative to cwd when not absolute. Mutually exclusive with outDir.
|
|
50
|
+
* Without either override, reimports preserve the project-registered asset directory; new
|
|
51
|
+
* assets use <project dir>/assets/<dotted-id-as-path> (or ./assets without a project). */
|
|
52
|
+
assetDir?: string;
|
|
49
53
|
/** Also extract a whole-asset collision trimesh into collision.bin. */
|
|
50
54
|
trimesh?: boolean;
|
|
51
55
|
/** Skip the normalize pass (dedup/prune/weld/quantize). */
|
|
@@ -945,6 +949,11 @@ interface ScaffoldInput {
|
|
|
945
949
|
dir?: string;
|
|
946
950
|
/** Replace scaffold-owned files that already exist. Default false. */
|
|
947
951
|
force?: boolean;
|
|
952
|
+
/**
|
|
953
|
+
* Copy a shipped sample instead of the built-in starter: a template id from `listTemplates()`
|
|
954
|
+
* (`molen templates`), e.g. `cubes` or `top-down-arena`.
|
|
955
|
+
*/
|
|
956
|
+
template?: string;
|
|
948
957
|
}
|
|
949
958
|
interface ScaffoldOutput {
|
|
950
959
|
ok: boolean;
|
|
@@ -953,7 +962,11 @@ interface ScaffoldOutput {
|
|
|
953
962
|
nextSteps?: string[];
|
|
954
963
|
error?: string;
|
|
955
964
|
}
|
|
956
|
-
/**
|
|
965
|
+
/**
|
|
966
|
+
* Scaffold a complete, runnable project: the built-in starter (manifest + scene + types + scripts
|
|
967
|
+
* + setup + browser app), or with `template` a copy of one of the shipped samples. Either way the
|
|
968
|
+
* project gets an AGENTS.md pointing a coding agent at the version-locked docs and its loop.
|
|
969
|
+
*/
|
|
957
970
|
declare function scaffoldExperience(input: ScaffoldInput): Promise<ScaffoldOutput>;
|
|
958
971
|
//#endregion
|
|
959
972
|
//#region src/ops/schema.d.ts
|
|
@@ -1021,6 +1034,21 @@ interface SimulateOutput {
|
|
|
1021
1034
|
/** Run a scene headlessly for N ticks, applying commands and evaluating assertions. */
|
|
1022
1035
|
declare function runSimulation(input: SimulateInput): Promise<SimulateOutput>;
|
|
1023
1036
|
//#endregion
|
|
1037
|
+
//#region src/ops/templates.d.ts
|
|
1038
|
+
interface TemplateEntry {
|
|
1039
|
+
/** Template id: the sample's directory name in the engine repository (e.g. `cubes`). */
|
|
1040
|
+
id: string;
|
|
1041
|
+
/** One line on what the sample shows. */
|
|
1042
|
+
description: string;
|
|
1043
|
+
}
|
|
1044
|
+
interface ListTemplatesOutput {
|
|
1045
|
+
ok: boolean;
|
|
1046
|
+
templates: TemplateEntry[];
|
|
1047
|
+
error?: string;
|
|
1048
|
+
}
|
|
1049
|
+
/** The sample templates `molen new --template <id>` can scaffold. */
|
|
1050
|
+
declare function listTemplates(): Promise<ListTemplatesOutput>;
|
|
1051
|
+
//#endregion
|
|
1024
1052
|
//#region src/ops/types-test.d.ts
|
|
1025
1053
|
interface TestTypesInput {
|
|
1026
1054
|
projectPath?: string;
|
|
@@ -1268,4 +1296,4 @@ declare function schemaToTsType(schema: unknown, indent?: string): string;
|
|
|
1268
1296
|
//#region src/index.d.ts
|
|
1269
1297
|
declare const TOOLING_PACKAGE = "@bendyline/molen-tooling";
|
|
1270
1298
|
//#endregion
|
|
1271
|
-
export { ASSET_INDEX_FILE, type ApplyUvPaintInput, type ApplyUvPaintOutput, type AssetShotInput, type AssetShotOutput, type CameraSpec, type CheckTypesOutput, type DiffSnapshotsInput, type DiffSnapshotsOutput, type DocHit, type DriveAction, type DriveFrame, type DriveInput, type DriveOutput, type ExperiencePlayAction, type ExperiencePlayDiagnostic, type ExperiencePlayFrame, type ExperiencePlayInput, type ExperiencePlayOutput, type ExperiencePlayScenario, type ExportFramesInput, type ExportFramesOutput, type GenerateTypesInput, type GenerateTypesOutput, type GetComponentOutput, type GetSchemaOutput, type GoldenOptions, type GoldenResult, type ImageDiff, type ImportAssetInput, type ImportAssetOutput, type InspectAssetInput, type InspectAssetOutput, type ListAssetsOutput, type ListTypesOutput, type LoadSceneOptions, type LoadedScene, OPS_CATALOG, type OpDescriptor, type OpParam, type PackAssetInput, type PackAssetOutput, type PackTextureMode, type PackedAsset, type PackedTexture, type ProjectContext, type ProjectInfoInput, type ProjectInfoOutput, type RasterizeInput, type RasterizeOutput, type RenderStats, type ReserveNamespaceInput, type ReserveNamespaceOutput, type RunReplayInput, type RunReplayOutput, type ScaffoldInput, type ScaffoldOutput, type ScreenshotInput, type ScreenshotOutput, type ScriptDiagnostic, type SearchDocsInput, type SearchDocsOutput, type SimWatchHandle, type SimWatchInput, type SimulateInput, type SimulateOutput, type StageAssetsInput, type StageAssetsOutput, type StagedAsset, TOOLING_PACKAGE, type TestTypesInput, type TestTypesOutput, type TypeTestResult, type ValidateInput, type ValidateOutput, type WorldgenBakeInput, type WorldgenBakeOutput, type WorldgenPreviewInput, type WorldgenPreviewOutput, type WorldgenStatsInput, type WorldgenStatsOutput, applyUvPaintOp, assetFileIndex, bakeWorldgen, buildContentPack, checkScripts, checkTypesOp, compareGolden, describeOps, diffImages, diffSnapshots, driveScene, exportFrames, extractContentPack, fetchContentPack, findProjectFile, formatOp, generateTypes, getComponentOp, getSchemaOp, importAsset, inspectAsset, inspectContentPack, lineupBatchDoc, listAssets, listComponentsOp, listSchemasOp, listTypes, loadProject, loadSceneDocument, loadSetupLike, loadStylePackFromDisk, locateDocsRoot, packAsset, parseExperiencePlayScenario, playExperience, previewWorldgen, projectInfo, rasterizeMaterial, registerExperiencePlaySchema, renderTypesModule, reserveNamespace, runReplayFile, runSimulation, scaffoldExperience, schemaToTsType, screenshotAsset, screenshotScene, searchDocs, simWatch, stageAssets, testTypes, updateProjectFile, validateAsset, verifyContentPack, worldgenStats };
|
|
1299
|
+
export { ASSET_INDEX_FILE, type ApplyUvPaintInput, type ApplyUvPaintOutput, type AssetShotInput, type AssetShotOutput, type CameraSpec, type CheckTypesOutput, type DiffSnapshotsInput, type DiffSnapshotsOutput, type DocHit, type DriveAction, type DriveFrame, type DriveInput, type DriveOutput, type ExperiencePlayAction, type ExperiencePlayDiagnostic, type ExperiencePlayFrame, type ExperiencePlayInput, type ExperiencePlayOutput, type ExperiencePlayScenario, type ExportFramesInput, type ExportFramesOutput, type GenerateTypesInput, type GenerateTypesOutput, type GetComponentOutput, type GetSchemaOutput, type GoldenOptions, type GoldenResult, type ImageDiff, type ImportAssetInput, type ImportAssetOutput, type InspectAssetInput, type InspectAssetOutput, type ListAssetsOutput, type ListTemplatesOutput, type ListTypesOutput, type LoadSceneOptions, type LoadedScene, OPS_CATALOG, type OpDescriptor, type OpParam, type PackAssetInput, type PackAssetOutput, type PackTextureMode, type PackedAsset, type PackedTexture, type ProjectContext, type ProjectInfoInput, type ProjectInfoOutput, type RasterizeInput, type RasterizeOutput, type RenderStats, type ReserveNamespaceInput, type ReserveNamespaceOutput, type RunReplayInput, type RunReplayOutput, type ScaffoldInput, type ScaffoldOutput, type ScreenshotInput, type ScreenshotOutput, type ScriptDiagnostic, type SearchDocsInput, type SearchDocsOutput, type SimWatchHandle, type SimWatchInput, type SimulateInput, type SimulateOutput, type StageAssetsInput, type StageAssetsOutput, type StagedAsset, TOOLING_PACKAGE, type TemplateEntry, type TestTypesInput, type TestTypesOutput, type TypeTestResult, type ValidateInput, type ValidateOutput, type WorldgenBakeInput, type WorldgenBakeOutput, type WorldgenPreviewInput, type WorldgenPreviewOutput, type WorldgenStatsInput, type WorldgenStatsOutput, applyUvPaintOp, assetFileIndex, bakeWorldgen, buildContentPack, checkScripts, checkTypesOp, compareGolden, describeOps, diffImages, diffSnapshots, driveScene, exportFrames, extractContentPack, fetchContentPack, findProjectFile, formatOp, generateTypes, getComponentOp, getSchemaOp, importAsset, inspectAsset, inspectContentPack, lineupBatchDoc, listAssets, listComponentsOp, listSchemasOp, listTemplates, listTypes, loadProject, loadSceneDocument, loadSetupLike, loadStylePackFromDisk, locateDocsRoot, packAsset, parseExperiencePlayScenario, playExperience, previewWorldgen, projectInfo, rasterizeMaterial, registerExperiencePlaySchema, renderTypesModule, reserveNamespace, runReplayFile, runSimulation, scaffoldExperience, schemaToTsType, screenshotAsset, screenshotScene, searchDocs, simWatch, stageAssets, testTypes, updateProjectFile, validateAsset, verifyContentPack, worldgenStats };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as packAsset, A as inspectContentPack, B as OPS_CATALOG, C as checkTypesOp, D as buildContentPack, E as reserveNamespace, H as formatOp, I as exportFrames, J as ASSET_INDEX_FILE, L as driveScene, M as generateTypes, N as renderTypesModule, O as extractContentPack, R as locateDocsRoot, S as rasterizeMaterial, T as projectInfo, U as checkScripts, V as describeOps, W as schemaToTsType, X as screenshotAsset, Y as stageAssets, a as lineupBatchDoc, at as loadProject, b as diffSnapshots, c as validateAsset, ct as updateProjectFile, d as runSimulation, dt as registerExperiencePlaySchema, et as inspectAsset, f as screenshotScene, g as listSchemasOp, h as listComponentsOp, i as bakeWorldgen, it as findProjectFile, j as verifyContentPack, k as fetchContentPack, l as applyUvPaintOp, lt as parseExperiencePlayScenario, m as getSchemaOp, n as worldgenStats, nt as assetFileIndex, o as loadStylePackFromDisk, ot as loadSceneDocument, p as getComponentOp, r as previewWorldgen, rt as importAsset, s as simWatch, st as loadSetupLike, tt as listAssets, u as testTypes, ut as playExperience, v as scaffoldExperience, w as listTypes, x as runReplayFile, y as listTemplates, z as searchDocs } from "./ops-BPdHodFR.mjs";
|
|
2
2
|
import { access, copyFile, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
3
|
import { dirname } from "node:path";
|
|
4
4
|
import pixelmatch from "pixelmatch";
|
|
@@ -75,4 +75,4 @@ async function compareGolden(candidatePath, goldenPath, diffPath, opts = {}) {
|
|
|
75
75
|
//#region src/index.ts
|
|
76
76
|
const TOOLING_PACKAGE = "@bendyline/molen-tooling";
|
|
77
77
|
//#endregion
|
|
78
|
-
export { ASSET_INDEX_FILE, OPS_CATALOG, TOOLING_PACKAGE, applyUvPaintOp, assetFileIndex, bakeWorldgen, buildContentPack, checkScripts, checkTypesOp, compareGolden, describeOps, diffImages, diffSnapshots, driveScene, exportFrames, extractContentPack, fetchContentPack, findProjectFile, formatOp, generateTypes, getComponentOp, getSchemaOp, importAsset, inspectAsset, inspectContentPack, lineupBatchDoc, listAssets, listComponentsOp, listSchemasOp, listTypes, loadProject, loadSceneDocument, loadSetupLike, loadStylePackFromDisk, locateDocsRoot, packAsset, parseExperiencePlayScenario, playExperience, previewWorldgen, projectInfo, rasterizeMaterial, registerExperiencePlaySchema, renderTypesModule, reserveNamespace, runReplayFile, runSimulation, scaffoldExperience, schemaToTsType, screenshotAsset, screenshotScene, searchDocs, simWatch, stageAssets, testTypes, updateProjectFile, validateAsset, verifyContentPack, worldgenStats };
|
|
78
|
+
export { ASSET_INDEX_FILE, OPS_CATALOG, TOOLING_PACKAGE, applyUvPaintOp, assetFileIndex, bakeWorldgen, buildContentPack, checkScripts, checkTypesOp, compareGolden, describeOps, diffImages, diffSnapshots, driveScene, exportFrames, extractContentPack, fetchContentPack, findProjectFile, formatOp, generateTypes, getComponentOp, getSchemaOp, importAsset, inspectAsset, inspectContentPack, lineupBatchDoc, listAssets, listComponentsOp, listSchemasOp, listTemplates, listTypes, loadProject, loadSceneDocument, loadSetupLike, loadStylePackFromDisk, locateDocsRoot, packAsset, parseExperiencePlayScenario, playExperience, previewWorldgen, projectInfo, rasterizeMaterial, registerExperiencePlaySchema, renderTypesModule, reserveNamespace, runReplayFile, runSimulation, scaffoldExperience, schemaToTsType, screenshotAsset, screenshotScene, searchDocs, simWatch, stageAssets, testTypes, updateProjectFile, validateAsset, verifyContentPack, worldgenStats };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as packAsset, A as inspectContentPack, C as checkTypesOp, D as buildContentPack, E as reserveNamespace, F as listFigurePresets, G as planAudio, H as formatOp, I as exportFrames, K as importSound, L as driveScene, M as generateTypes, O as extractContentPack, P as previewFigure, Q as formatPacked, S as rasterizeMaterial, T as projectInfo, U as checkScripts, V as describeOps, X as screenshotAsset, Y as stageAssets, _ as loadComponentRegistry, b as diffSnapshots, c as validateAsset, d as runSimulation, et as inspectAsset, f as screenshotScene, g as listSchemasOp, h as listComponentsOp, i as bakeWorldgen, j as verifyContentPack, k as fetchContentPack, l as applyUvPaintOp, m as getSchemaOp, n as worldgenStats, p as getComponentOp, q as checkSoundbank, r as previewWorldgen, rt as importAsset, tt as listAssets, u as testTypes, ut as playExperience, v as scaffoldExperience, w as listTypes, x as runReplayFile, y as listTemplates, z as searchDocs } from "./ops-BPdHodFR.mjs";
|
|
2
2
|
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -167,7 +167,7 @@ function createMcpServer() {
|
|
|
167
167
|
}, async (args) => {
|
|
168
168
|
const r = await runReplayFile(args);
|
|
169
169
|
if (r.error !== void 0) return text(r.error, true);
|
|
170
|
-
return text(r.report ?? (r.ok ? "✓ replay matches" : "
|
|
170
|
+
return text(r.report ?? (r.ok ? "✓ replay matches" : "× replay diverged"), !r.ok);
|
|
171
171
|
});
|
|
172
172
|
server.registerTool("apply_uv_paint", {
|
|
173
173
|
title: "Apply UV paint",
|
|
@@ -503,7 +503,7 @@ function createMcpServer() {
|
|
|
503
503
|
}, async (args) => {
|
|
504
504
|
const r = await testTypes(args);
|
|
505
505
|
if (r.error !== void 0) return text(r.error, true);
|
|
506
|
-
return text((r.results ?? []).map((t) => `${t.ok ? "✓" : "
|
|
506
|
+
return text((r.results ?? []).map((t) => `${t.ok ? "✓" : "×"} ${t.id}${t.error !== void 0 ? ` — ${t.error}` : ""}${t.issues !== void 0 ? ` — ${t.issues.map((i) => i.message).join("; ")}` : ""}`).join("\n") || "(no types registered)", !r.ok);
|
|
507
507
|
});
|
|
508
508
|
server.registerTool("import_asset", {
|
|
509
509
|
title: "Import asset",
|
|
@@ -512,6 +512,7 @@ function createMcpServer() {
|
|
|
512
512
|
path: z.string(),
|
|
513
513
|
id: z.string().optional(),
|
|
514
514
|
outDir: z.string().optional(),
|
|
515
|
+
assetDir: z.string().optional(),
|
|
515
516
|
trimesh: z.boolean().optional(),
|
|
516
517
|
optimize: z.boolean().optional(),
|
|
517
518
|
projectPath: z.string().optional(),
|
|
@@ -645,6 +646,69 @@ function createMcpServer() {
|
|
|
645
646
|
if (!r.ok) return text(r.error ?? "pack fetch failed", true);
|
|
646
647
|
return text([...(r.packs ?? []).map((pack) => `${pack.id}@${pack.version} -> ${r.outDir}/${pack.file} (${pack.size} bytes)`), r.projectPath !== void 0 ? `pinned in ${r.projectPath}` : "no project.json to pin in"].join("\n"));
|
|
647
648
|
});
|
|
649
|
+
server.registerTool("plan_audio", {
|
|
650
|
+
title: "Plan a scene's audio",
|
|
651
|
+
description: "Run a scene headlessly and list the sounds it would play: looping voices with start/stop ticks, peak gain and pitch range, one-shots by tick, audio.* script events, plus unknown sound ids and signals. Sound banks come from bankPaths or the project's packs (provides.soundbank). Returns the text timeline followed by the JSON report.",
|
|
652
|
+
inputSchema: {
|
|
653
|
+
scenePath: z.string(),
|
|
654
|
+
ticks: z.number().int().positive(),
|
|
655
|
+
bankPaths: z.array(z.string()).optional(),
|
|
656
|
+
commandsPath: z.string().optional(),
|
|
657
|
+
setupModule: z.string().optional(),
|
|
658
|
+
listener: z.string().optional(),
|
|
659
|
+
mode: z.string().optional(),
|
|
660
|
+
weather: z.string().optional(),
|
|
661
|
+
daylight: z.number().min(0).max(1).optional(),
|
|
662
|
+
projectPath: z.string().optional()
|
|
663
|
+
}
|
|
664
|
+
}, async (args) => {
|
|
665
|
+
const r = await planAudio(args);
|
|
666
|
+
if (r.error !== void 0) return text(r.error, true);
|
|
667
|
+
const { timeline, ...report } = r;
|
|
668
|
+
return text(`${timeline}\n\n${JSON.stringify(report, null, 2)}`, !r.ok);
|
|
669
|
+
});
|
|
670
|
+
server.registerTool("import_sound", {
|
|
671
|
+
title: "Import a sound",
|
|
672
|
+
description: "Add an audio clip to a molen/soundbank@1 file: copy it beside the bank, hash it, probe its duration, record license and provenance (source url, site, author, or prompt + generator). append adds a variation to an existing sound id. Rejects a license the bank policy does not allow.",
|
|
673
|
+
inputSchema: {
|
|
674
|
+
file: z.string(),
|
|
675
|
+
id: z.string(),
|
|
676
|
+
bankPath: z.string(),
|
|
677
|
+
license: z.string(),
|
|
678
|
+
source: z.string().optional(),
|
|
679
|
+
site: z.string().optional(),
|
|
680
|
+
author: z.string().optional(),
|
|
681
|
+
prompt: z.string().optional(),
|
|
682
|
+
generator: z.string().optional(),
|
|
683
|
+
description: z.string().optional(),
|
|
684
|
+
loop: z.boolean().optional(),
|
|
685
|
+
loopStart: z.number().nonnegative().optional(),
|
|
686
|
+
loopEnd: z.number().nonnegative().optional(),
|
|
687
|
+
bus: z.string().optional(),
|
|
688
|
+
gain: z.number().nonnegative().optional(),
|
|
689
|
+
durationS: z.number().positive().optional(),
|
|
690
|
+
append: z.boolean().optional(),
|
|
691
|
+
copyTo: z.string().optional()
|
|
692
|
+
}
|
|
693
|
+
}, async (args) => {
|
|
694
|
+
const r = await importSound(args);
|
|
695
|
+
const notes = r.warnings.map((w) => `! ${w}`).join("\n");
|
|
696
|
+
if (!r.ok) return text([notes, r.error ?? "import failed"].filter(Boolean).join("\n"), true);
|
|
697
|
+
return text([
|
|
698
|
+
notes,
|
|
699
|
+
`${r.id}: ${r.clip} -> ${r.bankPath}`,
|
|
700
|
+
JSON.stringify(r.entry, null, 2)
|
|
701
|
+
].filter(Boolean).join("\n"));
|
|
702
|
+
});
|
|
703
|
+
server.registerTool("check_soundbank", {
|
|
704
|
+
title: "Check a sound bank",
|
|
705
|
+
description: "Check a molen/soundbank@1 file and every clip it names: files present, hashes unchanged since import, durations and loop points consistent, provenance recorded. Returns issues and a license summary as JSON.",
|
|
706
|
+
inputSchema: { bankPath: z.string() }
|
|
707
|
+
}, async (args) => {
|
|
708
|
+
const r = await checkSoundbank(args);
|
|
709
|
+
if (r.error !== void 0) return text(r.error, true);
|
|
710
|
+
return text(JSON.stringify(r, null, 2), !r.ok);
|
|
711
|
+
});
|
|
648
712
|
server.registerTool("list_assets", {
|
|
649
713
|
title: "List assets",
|
|
650
714
|
description: "List the assets registered in the surrounding project.",
|
|
@@ -744,9 +808,10 @@ function createMcpServer() {
|
|
|
744
808
|
});
|
|
745
809
|
server.registerTool("new_experience", {
|
|
746
810
|
title: "New experience",
|
|
747
|
-
description: "Scaffold a runnable experience (scene + scripts + setup + commands + checks) on disk.",
|
|
811
|
+
description: "Scaffold a runnable experience (scene + scripts + setup + commands + checks + AGENTS.md) on disk, or pass `template` to copy a shipped sample as a standalone npm project (list_templates lists the ids).",
|
|
748
812
|
inputSchema: {
|
|
749
813
|
name: z.string(),
|
|
814
|
+
template: z.string().optional(),
|
|
750
815
|
dir: z.string().optional(),
|
|
751
816
|
force: z.boolean().optional()
|
|
752
817
|
}
|
|
@@ -755,6 +820,15 @@ function createMcpServer() {
|
|
|
755
820
|
if (!r.ok) return text(r.error ?? "scaffold failed", true);
|
|
756
821
|
return text(`created ${r.dir}\n${(r.files ?? []).join("\n")}\n\nnext:\n${(r.nextSteps ?? []).join("\n")}`);
|
|
757
822
|
});
|
|
823
|
+
server.registerTool("list_templates", {
|
|
824
|
+
title: "List templates",
|
|
825
|
+
description: "List the sample templates new_experience can copy with `template`: id + one-line description, as JSON.",
|
|
826
|
+
inputSchema: {}
|
|
827
|
+
}, async () => {
|
|
828
|
+
const r = await listTemplates();
|
|
829
|
+
if (!r.ok) return text(r.error ?? "failed to list templates", true);
|
|
830
|
+
return text(JSON.stringify(r.templates, null, 2));
|
|
831
|
+
});
|
|
758
832
|
return server;
|
|
759
833
|
}
|
|
760
834
|
/**
|