@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.
Files changed (158) hide show
  1. package/README.md +22 -4
  2. package/dist/capture/harness.js +216 -216
  3. package/dist/capture/worldgen-preview.js +288 -288
  4. package/dist/cli.mjs +134 -12
  5. package/dist/docs-src/guide/3d-art-guidelines.md +2 -2
  6. package/dist/docs-src/guide/3d-model-assets.md +49 -13
  7. package/dist/docs-src/guide/adaptive-performance.md +4 -0
  8. package/dist/docs-src/guide/agent-loop.md +6 -6
  9. package/dist/docs-src/guide/aircraft.md +25 -17
  10. package/dist/docs-src/guide/audio.md +247 -0
  11. package/dist/docs-src/guide/browser-mount.md +17 -1
  12. package/dist/docs-src/guide/building-interiors.md +7 -5
  13. package/dist/docs-src/guide/determinism.md +27 -22
  14. package/dist/docs-src/guide/earth-view.md +444 -0
  15. package/dist/docs-src/guide/entities.md +17 -6
  16. package/dist/docs-src/guide/examples.md +39 -23
  17. package/dist/docs-src/guide/experience-playback.md +2 -3
  18. package/dist/docs-src/guide/game-samples.md +50 -21
  19. package/dist/docs-src/guide/graphics-performance.md +40 -8
  20. package/dist/docs-src/guide/input.md +9 -0
  21. package/dist/docs-src/guide/markers.md +52 -0
  22. package/dist/docs-src/guide/materials.md +10 -3
  23. package/dist/docs-src/guide/navigation.md +144 -0
  24. package/dist/docs-src/guide/project.md +23 -3
  25. package/dist/docs-src/guide/quickstart.md +39 -30
  26. package/dist/docs-src/guide/recognizable-places.md +24 -17
  27. package/dist/docs-src/guide/rendering-backends.md +5 -4
  28. package/dist/docs-src/guide/scripting.md +8 -4
  29. package/dist/docs-src/guide/sky.md +26 -9
  30. package/dist/docs-src/guide/source-bundles.md +0 -1
  31. package/dist/docs-src/guide/structure-library.md +20 -10
  32. package/dist/docs-src/guide/terrain.md +51 -6
  33. package/dist/docs-src/guide/vehicles.md +27 -14
  34. package/dist/docs-src/guide/worldgen.md +34 -24
  35. package/dist/docs-src/llms.txt +35 -18
  36. package/dist/docs-src/schemas/README.md +4 -1
  37. package/dist/docs-src/schemas/archive-set.md +175 -0
  38. package/dist/docs-src/schemas/components.md +1104 -1
  39. package/dist/docs-src/schemas/matgraph.md +6 -0
  40. package/dist/docs-src/schemas/soundbank.md +251 -0
  41. package/dist/docs-src/schemas/structure-placements.md +496 -0
  42. package/dist/docs-src/schemas/terrain-package.md +120 -0
  43. package/dist/index.d.mts +31 -3
  44. package/dist/index.mjs +2 -2
  45. package/dist/{mcp-BFnCWrg0.mjs → mcp-BTVwVKFb.mjs} +78 -4
  46. package/dist/{ops-BGxhSP6w.mjs → ops-BPdHodFR.mjs} +1181 -61
  47. package/dist/templates/city-courier/README.md +66 -0
  48. package/dist/templates/city-courier/checks.json +20 -0
  49. package/dist/templates/city-courier/commands.json +32 -0
  50. package/dist/templates/city-courier/delivery-run.replay.json +214 -0
  51. package/dist/templates/city-courier/gen/molen-types.ts +1016 -0
  52. package/dist/templates/city-courier/index.html +2 -0
  53. package/dist/templates/city-courier/package.json +26 -0
  54. package/dist/templates/city-courier/project.json +8 -0
  55. package/dist/templates/city-courier/scene.json +3474 -0
  56. package/dist/templates/city-courier/scripts/game.ts +131 -0
  57. package/dist/templates/city-courier/scripts/molen-scripts.d.ts +1288 -0
  58. package/dist/templates/city-courier/scripts/tsconfig.json +16 -0
  59. package/dist/templates/city-courier/src/audio.ts +96 -0
  60. package/dist/templates/city-courier/src/game-shell.css +317 -0
  61. package/dist/templates/city-courier/src/main.ts +84 -0
  62. package/dist/templates/city-courier/src/scene.ts +17 -0
  63. package/dist/templates/city-courier/src/vite-env.d.ts +1 -0
  64. package/dist/templates/city-courier/src/worker.ts +5 -0
  65. package/dist/templates/city-courier/test/headless.test.ts +95 -0
  66. package/dist/templates/city-courier/test/playthrough.test.js +52 -0
  67. package/dist/templates/city-courier/test/replay.test.ts +22 -0
  68. package/dist/templates/city-courier/tsconfig.json +17 -0
  69. package/dist/templates/city-courier/vite.config.ts +19 -0
  70. package/dist/templates/cubes/README.md +51 -0
  71. package/dist/templates/cubes/index.html +16 -0
  72. package/dist/templates/cubes/package.json +24 -0
  73. package/dist/templates/cubes/scene.json +15 -0
  74. package/dist/templates/cubes/src/cubes.ts +100 -0
  75. package/dist/templates/cubes/src/main.ts +21 -0
  76. package/dist/templates/cubes/src/worker.ts +15 -0
  77. package/dist/templates/cubes/test/headless.test.ts +98 -0
  78. package/dist/templates/cubes/tsconfig.json +17 -0
  79. package/dist/templates/cubes/vite.config.ts +17 -0
  80. package/dist/templates/data-viz/README.md +47 -0
  81. package/dist/templates/data-viz/camera-track.json +12 -0
  82. package/dist/templates/data-viz/data.json +9 -0
  83. package/dist/templates/data-viz/index.html +16 -0
  84. package/dist/templates/data-viz/package.json +25 -0
  85. package/dist/templates/data-viz/scene.json +7 -0
  86. package/dist/templates/data-viz/src/main.ts +39 -0
  87. package/dist/templates/data-viz/src/viz.ts +91 -0
  88. package/dist/templates/data-viz/src/worker.ts +12 -0
  89. package/dist/templates/data-viz/test/headless.test.ts +75 -0
  90. package/dist/templates/data-viz/tsconfig.json +17 -0
  91. package/dist/templates/data-viz/vite.config.ts +16 -0
  92. package/dist/templates/figures-gallery/README.md +46 -0
  93. package/dist/templates/figures-gallery/index.html +16 -0
  94. package/dist/templates/figures-gallery/package.json +25 -0
  95. package/dist/templates/figures-gallery/scene.json +276 -0
  96. package/dist/templates/figures-gallery/src/main.ts +44 -0
  97. package/dist/templates/figures-gallery/src/worker.ts +17 -0
  98. package/dist/templates/figures-gallery/test/headless.test.ts +90 -0
  99. package/dist/templates/figures-gallery/tsconfig.json +17 -0
  100. package/dist/templates/figures-gallery/vite.config.ts +17 -0
  101. package/dist/templates/index.json +191 -0
  102. package/dist/templates/skybound/README.md +66 -0
  103. package/dist/templates/skybound/checks.json +24 -0
  104. package/dist/templates/skybound/commands.json +32 -0
  105. package/dist/templates/skybound/first-leap.replay.json +224 -0
  106. package/dist/templates/skybound/gen/molen-types.ts +1016 -0
  107. package/dist/templates/skybound/index.html +2 -0
  108. package/dist/templates/skybound/package.json +26 -0
  109. package/dist/templates/skybound/project.json +8 -0
  110. package/dist/templates/skybound/scene.json +1777 -0
  111. package/dist/templates/skybound/scripts/game.ts +122 -0
  112. package/dist/templates/skybound/scripts/molen-scripts.d.ts +1288 -0
  113. package/dist/templates/skybound/scripts/tsconfig.json +16 -0
  114. package/dist/templates/skybound/src/audio.ts +96 -0
  115. package/dist/templates/skybound/src/game-shell.css +317 -0
  116. package/dist/templates/skybound/src/main.ts +63 -0
  117. package/dist/templates/skybound/src/scene.ts +17 -0
  118. package/dist/templates/skybound/src/vite-env.d.ts +1 -0
  119. package/dist/templates/skybound/src/worker.ts +5 -0
  120. package/dist/templates/skybound/test/headless.test.ts +124 -0
  121. package/dist/templates/skybound/test/playthrough.test.js +38 -0
  122. package/dist/templates/skybound/test/replay.test.ts +22 -0
  123. package/dist/templates/skybound/tsconfig.json +17 -0
  124. package/dist/templates/skybound/vite.config.ts +19 -0
  125. package/dist/templates/terrain-flyover/README.md +46 -0
  126. package/dist/templates/terrain-flyover/index.html +16 -0
  127. package/dist/templates/terrain-flyover/package.json +26 -0
  128. package/dist/templates/terrain-flyover/src/flyover.ts +23 -0
  129. package/dist/templates/terrain-flyover/src/main.ts +93 -0
  130. package/dist/templates/terrain-flyover/terrain.json +15 -0
  131. package/dist/templates/terrain-flyover/test/headless.test.ts +72 -0
  132. package/dist/templates/terrain-flyover/tsconfig.json +17 -0
  133. package/dist/templates/terrain-flyover/vite.config.ts +15 -0
  134. package/dist/templates/top-down-arena/README.md +65 -0
  135. package/dist/templates/top-down-arena/arena-skirmish.replay.json +204 -0
  136. package/dist/templates/top-down-arena/index.html +16 -0
  137. package/dist/templates/top-down-arena/package.json +26 -0
  138. package/dist/templates/top-down-arena/project.json +10 -0
  139. package/dist/templates/top-down-arena/scene.json +182 -0
  140. package/dist/templates/top-down-arena/scripts/chase.ts +17 -0
  141. package/dist/templates/top-down-arena/scripts/combat.ts +13 -0
  142. package/dist/templates/top-down-arena/scripts/control.ts +8 -0
  143. package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +1258 -0
  144. package/dist/templates/top-down-arena/scripts/spawner.ts +11 -0
  145. package/dist/templates/top-down-arena/scripts/tsconfig.json +16 -0
  146. package/dist/templates/top-down-arena/src/arena.ts +8 -0
  147. package/dist/templates/top-down-arena/src/audio.ts +96 -0
  148. package/dist/templates/top-down-arena/src/gen/molen-types.ts +1020 -0
  149. package/dist/templates/top-down-arena/src/main.ts +34 -0
  150. package/dist/templates/top-down-arena/src/scene.ts +24 -0
  151. package/dist/templates/top-down-arena/src/vite-env.d.ts +1 -0
  152. package/dist/templates/top-down-arena/src/worker.ts +7 -0
  153. package/dist/templates/top-down-arena/test/headless.test.ts +87 -0
  154. package/dist/templates/top-down-arena/test/replay.test.ts +22 -0
  155. package/dist/templates/top-down-arena/tsconfig.json +17 -0
  156. package/dist/templates/top-down-arena/types/arena.types.json +54 -0
  157. package/dist/templates/top-down-arena/vite.config.ts +21 -0
  158. 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 (default: <project dir>/assets, else ./assets). */
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
- /** Scaffold a complete, runnable project (manifest + scene + types + scripts + setup + browser app). */
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 importAsset, A as verifyContentPack, B as describeOps, C as listTypes, D as extractContentPack, E as buildContentPack, F as exportFrames, G as stageAssets, H as checkScripts, I as driveScene, K as screenshotAsset, L as locateDocsRoot, M as renderTypesModule, O as fetchContentPack, Q as assetFileIndex, R as searchDocs, S as checkTypesOp, T as reserveNamespace, U as schemaToTsType, V as formatOp, W as ASSET_INDEX_FILE, X as inspectAsset, Y as packAsset, Z as listAssets, a as lineupBatchDoc, at as parseExperiencePlayScenario, b as runReplayFile, c as validateAsset, d as runSimulation, et as findProjectFile, f as screenshotScene, g as listSchemasOp, h as listComponentsOp, i as bakeWorldgen, it as updateProjectFile, j as generateTypes, k as inspectContentPack, l as applyUvPaintOp, m as getSchemaOp, n as worldgenStats, nt as loadSceneDocument, o as loadStylePackFromDisk, ot as playExperience, p as getComponentOp, r as previewWorldgen, rt as loadSetupLike, s as simWatch, st as registerExperiencePlaySchema, tt as loadProject, u as testTypes, v as scaffoldExperience, w as projectInfo, x as rasterizeMaterial, y as diffSnapshots, z as OPS_CATALOG } from "./ops-BGxhSP6w.mjs";
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 importAsset, A as verifyContentPack, B as describeOps, C as listTypes, D as extractContentPack, E as buildContentPack, F as exportFrames, G as stageAssets, H as checkScripts, I as driveScene, J as formatPacked, K as screenshotAsset, N as previewFigure, O as fetchContentPack, P as listFigurePresets, R as searchDocs, S as checkTypesOp, T as reserveNamespace, V as formatOp, X as inspectAsset, Y as packAsset, Z as listAssets, _ as loadComponentRegistry, b as runReplayFile, c as validateAsset, d as runSimulation, f as screenshotScene, g as listSchemasOp, h as listComponentsOp, i as bakeWorldgen, j as generateTypes, k as inspectContentPack, l as applyUvPaintOp, m as getSchemaOp, n as worldgenStats, ot as playExperience, p as getComponentOp, r as previewWorldgen, u as testTypes, v as scaffoldExperience, w as projectInfo, x as rasterizeMaterial, y as diffSnapshots } from "./ops-BGxhSP6w.mjs";
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" : "✖ replay diverged"), !r.ok);
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 ? "✓" : "✖"} ${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);
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
  /**