agentscape3d-engine 0.0.0-stage → 1.0.0-beta.2

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 (396) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +19 -2
  3. package/cli.mjs +53 -0
  4. package/dist/AssetCompiler-A99wKf7H.js +2424 -0
  5. package/dist/AssetCompiler-A99wKf7H.js.map +1 -0
  6. package/dist/AssetInputContracts-uKYeQu-X.js +245 -0
  7. package/dist/AssetInputContracts-uKYeQu-X.js.map +1 -0
  8. package/dist/AssetRecipe-DCaLLXvG.js +67 -0
  9. package/dist/AssetRecipe-DCaLLXvG.js.map +1 -0
  10. package/dist/BrowserCodeWorker.js +53850 -0
  11. package/dist/BrowserCodeWorker.js.map +1 -0
  12. package/dist/KinematicHypothesisScreen-4v7GBwdv.js +241 -0
  13. package/dist/KinematicHypothesisScreen-4v7GBwdv.js.map +1 -0
  14. package/dist/SceneSerializer-CLCzQjL_.js +350 -0
  15. package/dist/SceneSerializer-CLCzQjL_.js.map +1 -0
  16. package/dist/StylePack-CD_BC-Mv.js +6317 -0
  17. package/dist/StylePack-CD_BC-Mv.js.map +1 -0
  18. package/dist/WorldArchive-dYf1OpSe.js +417 -0
  19. package/dist/WorldArchive-dYf1OpSe.js.map +1 -0
  20. package/dist/WorldIO-Dqz4MqTQ.js +149 -0
  21. package/dist/WorldIO-Dqz4MqTQ.js.map +1 -0
  22. package/dist/blankWorld-OoOvN_IK.js +75 -0
  23. package/dist/blankWorld-OoOvN_IK.js.map +1 -0
  24. package/dist/core.d.ts +68 -0
  25. package/dist/core.js +209 -0
  26. package/dist/core.js.map +1 -0
  27. package/dist/disposeObject3D-B3HCflvO.js +128 -0
  28. package/dist/disposeObject3D-B3HCflvO.js.map +1 -0
  29. package/dist/environments-B1WaICAN.js +4197 -0
  30. package/dist/environments-B1WaICAN.js.map +1 -0
  31. package/dist/gltfIO-BMK1hc2D.js +9 -0
  32. package/dist/gltfIO-BMK1hc2D.js.map +1 -0
  33. package/dist/grandUrbanBlock-Bdjgc6ZT.js +515 -0
  34. package/dist/grandUrbanBlock-Bdjgc6ZT.js.map +1 -0
  35. package/dist/index.d.ts +275 -0
  36. package/dist/index.js +16239 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/magicCabin-DPQi_jh-.js +11019 -0
  39. package/dist/magicCabin-DPQi_jh-.js.map +1 -0
  40. package/dist/mcp.d.ts +2 -0
  41. package/dist/mcp.js +1 -0
  42. package/dist/monumentHall-IOLbRZQC.js +403 -0
  43. package/dist/monumentHall-IOLbRZQC.js.map +1 -0
  44. package/dist/node.d.ts +16 -0
  45. package/dist/node.js +26 -0
  46. package/dist/rolldown-runtime-D3KUYPsf.js +12 -0
  47. package/dist/ruinedCourtyard-BtaF_aOi.js +696 -0
  48. package/dist/ruinedCourtyard-BtaF_aOi.js.map +1 -0
  49. package/dist/runtime/application/AgentTools.js +28 -0
  50. package/dist/runtime/application/README.md +14 -0
  51. package/dist/runtime/application/agent/ProgressiveAgentTools.js +92 -0
  52. package/dist/runtime/application/agent/StudioMcpAllowlist.js +8 -0
  53. package/dist/runtime/application/buildTaskObservation.js +117 -0
  54. package/dist/runtime/application/code-execution/AuthoringSandboxEntry.js +46 -0
  55. package/dist/runtime/application/code-execution/BrowserCodeExecutor.js +35 -0
  56. package/dist/runtime/application/code-execution/BrowserCodeWorker.js +17 -0
  57. package/dist/runtime/application/code-execution/RemoteAuthoringDocument.js +72 -0
  58. package/dist/runtime/application/createSession.js +66 -0
  59. package/dist/runtime/application/createWorldAuthoringContext.js +400 -0
  60. package/dist/runtime/application/generation/GenerationOrchestrator.js +629 -0
  61. package/dist/runtime/application/generation/GenerationRuntime.js +214 -0
  62. package/dist/runtime/application/generation/PromptHybridWorldOrchestrator.js +285 -0
  63. package/dist/runtime/application/native-scene/CodeProject.js +119 -0
  64. package/dist/runtime/application/native-scene/CodeProjectModules.js +128 -0
  65. package/dist/runtime/application/native-scene/NativeEnvironmentGeometry.js +62 -0
  66. package/dist/runtime/application/native-scene/NativeOverlayCheckpoint.js +127 -0
  67. package/dist/runtime/application/native-scene/NativeRenderDiscovery.js +51 -0
  68. package/dist/runtime/application/native-scene/NativeSceneHost.js +319 -0
  69. package/dist/runtime/application/native-scene/NativeSceneOverlay.js +116 -0
  70. package/dist/runtime/application/native-scene/NativeThreeModule.js +16 -0
  71. package/dist/runtime/application/object-forge/SceneObjectForge.js +232 -0
  72. package/dist/runtime/application/programmatic-assets/ProgrammaticAssetBuilder.js +59 -0
  73. package/dist/runtime/application/programmatic-assets/ProgrammaticAssetContract.js +22 -0
  74. package/dist/runtime/application/programmatic-assets/ThreeCodeAsset.js +40 -0
  75. package/dist/runtime/application/scene/CapabilityResolver.js +79 -0
  76. package/dist/runtime/application/scene/RequestWindow.js +54 -0
  77. package/dist/runtime/application/scene/SceneAgentTools.js +21 -0
  78. package/dist/runtime/application/scene/SceneContracts.js +45 -0
  79. package/dist/runtime/application/scene/SceneEditService.js +144 -0
  80. package/dist/runtime/application/scene/SceneFacade.js +261 -0
  81. package/dist/runtime/application/scene/SceneInteractionAdapters.js +40 -0
  82. package/dist/runtime/application/scene/SceneJobController.js +229 -0
  83. package/dist/runtime/application/scene/SceneLifecycle.js +57 -0
  84. package/dist/runtime/application/scene/ScenePackage.js +162 -0
  85. package/dist/runtime/application/scene/ScenePersistence.js +50 -0
  86. package/dist/runtime/application/scene/SceneProject.js +95 -0
  87. package/dist/runtime/application/scene/SceneSkillNames.js +5 -0
  88. package/dist/runtime/application/scene/StarterScene.js +56 -0
  89. package/dist/runtime/application/scene/WorldArchive.js +87 -0
  90. package/dist/runtime/application/scene/WorldDirectory.js +20 -0
  91. package/dist/runtime/application/scene/WorldDocument.js +74 -0
  92. package/dist/runtime/application/scene/WorldIO.js +103 -0
  93. package/dist/runtime/application/scene/WorldStorage.js +137 -0
  94. package/dist/runtime/application/skills/SkillRegistry.js +189 -0
  95. package/dist/runtime/application/skills/packs/acceptanceSkills.js +32 -0
  96. package/dist/runtime/application/skills/packs/affordanceSkills.js +36 -0
  97. package/dist/runtime/application/skills/packs/assetSkills.js +46 -0
  98. package/dist/runtime/application/skills/packs/authoringSkills.js +16 -0
  99. package/dist/runtime/application/skills/packs/batchSkills.js +22 -0
  100. package/dist/runtime/application/skills/packs/codeSkills.js +106 -0
  101. package/dist/runtime/application/skills/packs/generationSkills.js +45 -0
  102. package/dist/runtime/application/skills/packs/interactionSkills.js +46 -0
  103. package/dist/runtime/application/skills/packs/recoverySkills.js +80 -0
  104. package/dist/runtime/application/skills/packs/sceneSkills.js +24 -0
  105. package/dist/runtime/application/skills/packs/spatialSkills.js +35 -0
  106. package/dist/runtime/application/skills/packs/verificationSkills.js +14 -0
  107. package/dist/runtime/application/skills/packs/worldSkills.js +45 -0
  108. package/dist/runtime/application/skills/registerCoreSkills.js +31 -0
  109. package/dist/runtime/application/skills/skillPrimitives.js +4 -0
  110. package/dist/runtime/application/tasks/CabinetCupTask.js +76 -0
  111. package/dist/runtime/application/tasks.jsonl +67 -0
  112. package/dist/runtime/application/world-authoring/AuthoringAssetProducer.js +42 -0
  113. package/dist/runtime/application/world-authoring/AuthoringDiff.js +149 -0
  114. package/dist/runtime/application/world-authoring/AuthoringDocument.js +825 -0
  115. package/dist/runtime/application/world-authoring/AuthoringExecutionHost.js +109 -0
  116. package/dist/runtime/application/world-authoring/AuthoringIdentity.js +17 -0
  117. package/dist/runtime/application/world-authoring/AuthoringModelResolver.js +29 -0
  118. package/dist/runtime/application/world-authoring/AuthoringPatch.js +118 -0
  119. package/dist/runtime/application/world-authoring/AuthoringPromotionController.js +334 -0
  120. package/dist/runtime/application/world-authoring/AuthoringPromotionSource.js +126 -0
  121. package/dist/runtime/application/world-authoring/AuthoringRevisionHistory.js +144 -0
  122. package/dist/runtime/application/world-authoring/HeadlessImageExport.js +174 -0
  123. package/dist/runtime/application/world-authoring/ModelRef.js +62 -0
  124. package/dist/runtime/apps/mcp-server/AUTHORING.md +71 -0
  125. package/dist/runtime/apps/mcp-server/AgentMcpCompat.js +77 -0
  126. package/dist/runtime/apps/mcp-server/AuthoringSandboxEntry.js +1 -0
  127. package/dist/runtime/apps/mcp-server/AuthoringSandboxWorker.mjs +30 -0
  128. package/dist/runtime/apps/mcp-server/BuildEnvironment.js +17 -0
  129. package/dist/runtime/apps/mcp-server/CodeExecutor.js +71 -0
  130. package/dist/runtime/apps/mcp-server/DEPLOYMENT-PC2.md +42 -0
  131. package/dist/runtime/apps/mcp-server/DockerBuildRunner.js +66 -0
  132. package/dist/runtime/apps/mcp-server/FileAssetRepository.js +159 -0
  133. package/dist/runtime/apps/mcp-server/HeadlessAssetIO.js +8 -0
  134. package/dist/runtime/apps/mcp-server/HeadlessGLTFLoader.js +47 -0
  135. package/dist/runtime/apps/mcp-server/HeadlessWorldHost.js +132 -0
  136. package/dist/runtime/apps/mcp-server/IsolatedAuthoringExecutor.js +6 -0
  137. package/dist/runtime/apps/mcp-server/PROGRAMMATIC-ASSETS.md +116 -0
  138. package/dist/runtime/apps/mcp-server/ProgrammaticAssets.js +60 -0
  139. package/dist/runtime/apps/mcp-server/README.md +150 -0
  140. package/dist/runtime/apps/mcp-server/RemoteAuthoringDocument.js +1 -0
  141. package/dist/runtime/apps/mcp-server/SandboxBundle.js +13 -0
  142. package/dist/runtime/apps/mcp-server/SessionManager.js +80 -0
  143. package/dist/runtime/apps/mcp-server/StudioBridgeHttp.js +58 -0
  144. package/dist/runtime/apps/mcp-server/StudioLiveBridge.js +190 -0
  145. package/dist/runtime/apps/mcp-server/TrustedAuthoringWorker.mjs +16 -0
  146. package/dist/runtime/apps/mcp-server/VALIDATION.md +45 -0
  147. package/dist/runtime/apps/mcp-server/acceptance-evidence.json +332 -0
  148. package/dist/runtime/apps/mcp-server/errorDiagnostics.js +32 -0
  149. package/dist/runtime/apps/mcp-server/examples/code-house.js +24 -0
  150. package/dist/runtime/apps/mcp-server/examples/procedural-assets.js +85 -0
  151. package/dist/runtime/apps/mcp-server/main.mjs +65 -0
  152. package/dist/runtime/apps/mcp-server/registerTools.js +225 -0
  153. package/dist/runtime/apps/mcp-server/sandbox/run.mjs +23 -0
  154. package/dist/runtime/apps/mcp-server/security.js +21 -0
  155. package/dist/runtime/apps/mcp-server/tasks.jsonl +9 -0
  156. package/dist/runtime/apps/server/CapabilityAdapterRegistry.js +157 -0
  157. package/dist/runtime/apps/server/README.md +7 -0
  158. package/dist/runtime/apps/server/WorldDiskStorage.js +51 -0
  159. package/dist/runtime/apps/server/openai-compatible-agent-gateway.mjs +278 -0
  160. package/dist/runtime/apps/server/tasks.jsonl +10 -0
  161. package/dist/runtime/foundation/EventBus.js +18 -0
  162. package/dist/runtime/foundation/JsonGateway.js +47 -0
  163. package/dist/runtime/foundation/PolicyEngine.js +21 -0
  164. package/dist/runtime/foundation/README.md +7 -0
  165. package/dist/runtime/foundation/TraceRecorder.js +76 -0
  166. package/dist/runtime/foundation/errors.js +8 -0
  167. package/dist/runtime/foundation/simulation/SimulationProfile.js +143 -0
  168. package/dist/runtime/foundation/version.js +2 -0
  169. package/dist/runtime/modules/agent/README.md +11 -0
  170. package/dist/runtime/modules/agent/ToolCallingAgent.js +19 -0
  171. package/dist/runtime/modules/agent/bootstrapWorld.js +10 -0
  172. package/dist/runtime/modules/agent/buildRecoveryProposals.js +533 -0
  173. package/dist/runtime/modules/agent/execution/AgentExecutionRules.js +128 -0
  174. package/dist/runtime/modules/agent/execution/AgentRunResults.js +55 -0
  175. package/dist/runtime/modules/agent/execution/AgentRunSession.js +393 -0
  176. package/dist/runtime/modules/agent/execution/AgentToolInvoker.js +40 -0
  177. package/dist/runtime/modules/agent/gateway/HttpLLMGateway.js +19 -0
  178. package/dist/runtime/modules/agent/prompt/index.js +52 -0
  179. package/dist/runtime/modules/agent/tasks.jsonl +94 -0
  180. package/dist/runtime/modules/artifact/ArtifactContentGate.js +144 -0
  181. package/dist/runtime/modules/artifact/ArtifactDescriptor.js +280 -0
  182. package/dist/runtime/modules/artifact/ArtifactImporter.js +185 -0
  183. package/dist/runtime/modules/artifact/ArtifactModule.js +111 -0
  184. package/dist/runtime/modules/artifact/ArtifactRegistry.js +197 -0
  185. package/dist/runtime/modules/artifact/IncrementalSha256.js +129 -0
  186. package/dist/runtime/modules/artifact/MemoryArtifactByteStore.js +115 -0
  187. package/dist/runtime/modules/artifact/README.md +7 -0
  188. package/dist/runtime/modules/artifact/storage/IndexedDbArtifactStore.js +67 -0
  189. package/dist/runtime/modules/artifact/tasks.jsonl +31 -0
  190. package/dist/runtime/modules/asset/AssetModule.js +399 -0
  191. package/dist/runtime/modules/asset/README.md +54 -0
  192. package/dist/runtime/modules/asset/loading/AssetLoader.js +157 -0
  193. package/dist/runtime/modules/asset/loading/GltfAssetLoader.js +61 -0
  194. package/dist/runtime/modules/asset/loading/builtins/BuiltinAssets.js +95 -0
  195. package/dist/runtime/modules/asset/loading/builtins/HouseDoor.js +33 -0
  196. package/dist/runtime/modules/asset/loading/builtins/IndustrialCabinet.js +103 -0
  197. package/dist/runtime/modules/asset/model/AssetInputContracts.js +100 -0
  198. package/dist/runtime/modules/asset/model/AssetRef.js +12 -0
  199. package/dist/runtime/modules/asset/model/MechanicalAssetDraft.js +172 -0
  200. package/dist/runtime/modules/asset/model/admission.js +117 -0
  201. package/dist/runtime/modules/asset/model/errors.js +6 -0
  202. package/dist/runtime/modules/asset/model/parts.js +27 -0
  203. package/dist/runtime/modules/asset/model/resourceBudget.js +10 -0
  204. package/dist/runtime/modules/asset/model/schema.js +150 -0
  205. package/dist/runtime/modules/asset/persistence/AssetManifestStore.js +78 -0
  206. package/dist/runtime/modules/asset/persistence/CompiledAssetStore.js +84 -0
  207. package/dist/runtime/modules/asset/persistence/LocalAssetLibrary.js +86 -0
  208. package/dist/runtime/modules/asset/persistence/LocalAssetLibraryStore.js +81 -0
  209. package/dist/runtime/modules/asset/production/AssetProductionPipeline.js +272 -0
  210. package/dist/runtime/modules/asset/production/AssetRecipe.js +47 -0
  211. package/dist/runtime/modules/asset/production/adapters/EmbodiedGenAdapter.js +45 -0
  212. package/dist/runtime/modules/asset/production/adapters/EmbodiedGenBundleAdapter.js +590 -0
  213. package/dist/runtime/modules/asset/production/compiler/AssetCompiler.js +173 -0
  214. package/dist/runtime/modules/asset/production/compiler/evidence/AnimationMotionEvidence.js +124 -0
  215. package/dist/runtime/modules/asset/production/compiler/evidence/StaticPanelEvidence.js +56 -0
  216. package/dist/runtime/modules/asset/production/compiler/gltfIO.js +6 -0
  217. package/dist/runtime/modules/asset/production/compiler/partGeometry.js +74 -0
  218. package/dist/runtime/modules/asset/production/compiler/passes/ArticulatedCollisionPass.js +63 -0
  219. package/dist/runtime/modules/asset/production/compiler/passes/ArticulationCandidatePass.js +48 -0
  220. package/dist/runtime/modules/asset/production/compiler/passes/AuthoringIntentPass.js +16 -0
  221. package/dist/runtime/modules/asset/production/compiler/passes/ColliderFallbackPass.js +30 -0
  222. package/dist/runtime/modules/asset/production/compiler/passes/CompileQualityPass.js +75 -0
  223. package/dist/runtime/modules/asset/production/compiler/passes/ExplicitDefinitionPass.js +20 -0
  224. package/dist/runtime/modules/asset/production/compiler/passes/GLTFInspectPass.js +34 -0
  225. package/dist/runtime/modules/asset/production/compiler/passes/GeometryPass.js +32 -0
  226. package/dist/runtime/modules/asset/production/compiler/passes/JointFramePass.js +116 -0
  227. package/dist/runtime/modules/asset/production/compiler/passes/KinematicEvidencePass.js +84 -0
  228. package/dist/runtime/modules/asset/production/compiler/passes/ManifestPass.js +63 -0
  229. package/dist/runtime/modules/asset/production/compiler/passes/NormalizeTransformPass.js +16 -0
  230. package/dist/runtime/modules/asset/production/compiler/passes/OptimizeGLBPass.js +23 -0
  231. package/dist/runtime/modules/asset/production/compiler/passes/PartColliderPass.js +50 -0
  232. package/dist/runtime/modules/asset/production/compiler/passes/PartGeometryEnrichmentPass.js +60 -0
  233. package/dist/runtime/modules/asset/production/compiler/passes/PartProposalPass.js +93 -0
  234. package/dist/runtime/modules/asset/production/compiler/passes/RemoteEnrichmentPass.js +32 -0
  235. package/dist/runtime/modules/asset/production/compiler/passes/ResourceBudgetPass.js +55 -0
  236. package/dist/runtime/modules/asset/production/compiler/passes/SegmentMaterializePass.js +203 -0
  237. package/dist/runtime/modules/asset/production/compiler/passes/SegmentationEvidencePass.js +43 -0
  238. package/dist/runtime/modules/asset/production/compiler/passes/SemanticHeuristicPass.js +33 -0
  239. package/dist/runtime/modules/asset/production/compiler/passes/StructurePass.js +60 -0
  240. package/dist/runtime/modules/asset/production/compiler/providers/HttpCompilerProvider.js +23 -0
  241. package/dist/runtime/modules/asset/production/verification/KinematicHypothesisScreen.js +198 -0
  242. package/dist/runtime/modules/asset/registry/AssetCatalog.js +72 -0
  243. package/dist/runtime/modules/asset/registry/AssetRegistry.js +51 -0
  244. package/dist/runtime/modules/asset/registry/manifests/index.js +173 -0
  245. package/dist/runtime/modules/asset/tasks.jsonl +87 -0
  246. package/dist/runtime/modules/generation/README.md +9 -0
  247. package/dist/runtime/modules/generation/connector/ConnectorArtifactClient.js +45 -0
  248. package/dist/runtime/modules/generation/connector/ConnectorCapabilityAdapter.js +169 -0
  249. package/dist/runtime/modules/generation/connector/ConnectorClient.js +192 -0
  250. package/dist/runtime/modules/generation/connector/ConnectorJobClient.js +167 -0
  251. package/dist/runtime/modules/generation/connector/ConnectorJobEventClient.js +179 -0
  252. package/dist/runtime/modules/generation/connector/ConnectorSession.js +202 -0
  253. package/dist/runtime/modules/generation/jobs/GenerationJobProjection.js +239 -0
  254. package/dist/runtime/modules/generation/jobs/GenerationJobReconciler.js +99 -0
  255. package/dist/runtime/modules/generation/jobs/GenerationJobStore.js +91 -0
  256. package/dist/runtime/modules/generation/jobs/GenerationJobTransportOverlay.js +50 -0
  257. package/dist/runtime/modules/generation/providers/ProviderRegistry.js +304 -0
  258. package/dist/runtime/modules/generation/tasks.jsonl +35 -0
  259. package/dist/runtime/modules/navigation/NavigationBackend.js +17 -0
  260. package/dist/runtime/modules/navigation/RecastNavigationBackend.js +245 -0
  261. package/dist/runtime/modules/physics/JoltPhysicsBackend.js +850 -0
  262. package/dist/runtime/modules/physics/PhysicsApiSurface.js +651 -0
  263. package/dist/runtime/modules/physics/PhysicsBackend.js +88 -0
  264. package/dist/runtime/modules/physics/RapierPhysicsBackend.js +410 -0
  265. package/dist/runtime/modules/rendering/README.md +7 -0
  266. package/dist/runtime/modules/rendering/RendererProbe.js +153 -0
  267. package/dist/runtime/modules/rendering/WebGpuPostFxPipeline.js +140 -0
  268. package/dist/runtime/modules/rendering/createRenderer.js +76 -0
  269. package/dist/runtime/modules/rendering/disposeObject3D.js +37 -0
  270. package/dist/runtime/modules/rendering/loadGaussianSplatVisual.js +74 -0
  271. package/dist/runtime/modules/rendering/spatial/ThreeBvhRuntime.js +107 -0
  272. package/dist/runtime/modules/rendering/style/StylePack.js +34 -0
  273. package/dist/runtime/modules/rendering/style/StyleSystem.js +173 -0
  274. package/dist/runtime/modules/rendering/tasks.jsonl +7 -0
  275. package/dist/runtime/modules/world/README.md +13 -0
  276. package/dist/runtime/modules/world/build/WorldBuilder.js +170 -0
  277. package/dist/runtime/modules/world/compiler/PipelineEngine.js +32 -0
  278. package/dist/runtime/modules/world/compiler/WorldAdmission.js +43 -0
  279. package/dist/runtime/modules/world/compiler/WorldBehaviorCompiler.js +68 -0
  280. package/dist/runtime/modules/world/compiler/WorldCompilation.js +157 -0
  281. package/dist/runtime/modules/world/compiler/WorldComposer.js +201 -0
  282. package/dist/runtime/modules/world/compiler/WorldPhysicsAdmission.js +76 -0
  283. package/dist/runtime/modules/world/compiler/WorldRecompiler.js +356 -0
  284. package/dist/runtime/modules/world/compiler/WorldRetry.js +75 -0
  285. package/dist/runtime/modules/world/compiler/createWorldPipeline.js +379 -0
  286. package/dist/runtime/modules/world/content/blankWorld.js +35 -0
  287. package/dist/runtime/modules/world/content/environments.js +84 -0
  288. package/dist/runtime/modules/world/content/grandUrbanBlock.js +189 -0
  289. package/dist/runtime/modules/world/content/magic-cabin/README.md +28 -0
  290. package/dist/runtime/modules/world/content/magic-cabin/affordances.js +64 -0
  291. package/dist/runtime/modules/world/content/magic-cabin/cabinContents.js +7078 -0
  292. package/dist/runtime/modules/world/content/magic-cabin/lighting.js +26 -0
  293. package/dist/runtime/modules/world/content/magic-cabin/materials.js +20 -0
  294. package/dist/runtime/modules/world/content/magicCabin.js +190 -0
  295. package/dist/runtime/modules/world/content/monumentHall.js +154 -0
  296. package/dist/runtime/modules/world/content/ruinedCourtyard.js +196 -0
  297. package/dist/runtime/modules/world/content/suzhouGarden/README.md +141 -0
  298. package/dist/runtime/modules/world/content/suzhouGarden/index.js +137 -0
  299. package/dist/runtime/modules/world/content/suzhouGarden/src/arch.js +491 -0
  300. package/dist/runtime/modules/world/content/suzhouGarden/src/buildings.js +670 -0
  301. package/dist/runtime/modules/world/content/suzhouGarden/src/core.js +578 -0
  302. package/dist/runtime/modules/world/content/suzhouGarden/src/lod.js +127 -0
  303. package/dist/runtime/modules/world/content/suzhouGarden/src/main.js +642 -0
  304. package/dist/runtime/modules/world/content/suzhouGarden/src/nature.js +650 -0
  305. package/dist/runtime/modules/world/content/suzhouGarden/src/rockery.js +280 -0
  306. package/dist/runtime/modules/world/content/suzhouGarden/src/sky.js +242 -0
  307. package/dist/runtime/modules/world/content/suzhouGarden/src/water.js +215 -0
  308. package/dist/runtime/modules/world/content/woodlandWorkshop.js +192 -0
  309. package/dist/runtime/modules/world/content/yuanmingyuan/README.md +36 -0
  310. package/dist/runtime/modules/world/content/yuanmingyuan/arch.js +351 -0
  311. package/dist/runtime/modules/world/content/yuanmingyuan/buildings.js +490 -0
  312. package/dist/runtime/modules/world/content/yuanmingyuan/core.js +505 -0
  313. package/dist/runtime/modules/world/content/yuanmingyuan/index.js +101 -0
  314. package/dist/runtime/modules/world/content/yuanmingyuan/nature.js +435 -0
  315. package/dist/runtime/modules/world/content/yuanmingyuan/sky.js +169 -0
  316. package/dist/runtime/modules/world/content/yuanmingyuan/water.js +245 -0
  317. package/dist/runtime/modules/world/errors.js +9 -0
  318. package/dist/runtime/modules/world/generated/GeneratedWorldCoordinates.js +50 -0
  319. package/dist/runtime/modules/world/generated/GeneratedWorldLoader.js +297 -0
  320. package/dist/runtime/modules/world/runtime/CommandHistory.js +80 -0
  321. package/dist/runtime/modules/world/runtime/EntityCapabilityRegistry.js +150 -0
  322. package/dist/runtime/modules/world/runtime/ObjectStore.js +31 -0
  323. package/dist/runtime/modules/world/runtime/ObjectTransform.js +62 -0
  324. package/dist/runtime/modules/world/runtime/ObservedEntity.js +37 -0
  325. package/dist/runtime/modules/world/runtime/ProjectCapabilities.js +207 -0
  326. package/dist/runtime/modules/world/runtime/SceneSerializer.js +246 -0
  327. package/dist/runtime/modules/world/runtime/WorldAuthority.js +41 -0
  328. package/dist/runtime/modules/world/runtime/WorldCollisionSignature.js +14 -0
  329. package/dist/runtime/modules/world/runtime/WorldCommands.js +502 -0
  330. package/dist/runtime/modules/world/runtime/WorldObservation.js +71 -0
  331. package/dist/runtime/modules/world/runtime/WorldQueries.js +340 -0
  332. package/dist/runtime/modules/world/runtime/WorldRecovery.js +78 -0
  333. package/dist/runtime/modules/world/runtime/WorldRuntime.js +665 -0
  334. package/dist/runtime/modules/world/runtime/affordance/ObjectAffordances.js +107 -0
  335. package/dist/runtime/modules/world/runtime/affordance/WorldAffordances.js +130 -0
  336. package/dist/runtime/modules/world/runtime/behavior/BehaviorCompiler.js +79 -0
  337. package/dist/runtime/modules/world/runtime/behavior/ProjectStateMachine.js +195 -0
  338. package/dist/runtime/modules/world/runtime/behavior/RuleGraph.js +70 -0
  339. package/dist/runtime/modules/world/runtime/behavior/RuleRuntime.js +115 -0
  340. package/dist/runtime/modules/world/runtime/graph/SceneGraph.js +305 -0
  341. package/dist/runtime/modules/world/runtime/interaction/ArticulationRuntime.js +214 -0
  342. package/dist/runtime/modules/world/runtime/interaction/CarryCapability.js +65 -0
  343. package/dist/runtime/modules/world/runtime/interaction/CarryRuntime.js +222 -0
  344. package/dist/runtime/modules/world/runtime/interaction/InteractionApproach.js +130 -0
  345. package/dist/runtime/modules/world/runtime/interaction/InteractionContract.js +57 -0
  346. package/dist/runtime/modules/world/runtime/interaction/RecoveryRuntime.js +123 -0
  347. package/dist/runtime/modules/world/runtime/interaction/SettleRuntime.js +120 -0
  348. package/dist/runtime/modules/world/runtime/semantic/SemanticWorldView.js +102 -0
  349. package/dist/runtime/modules/world/runtime/simulation/SimulationClock.js +89 -0
  350. package/dist/runtime/modules/world/runtime/simulation/SimulationSession.js +99 -0
  351. package/dist/runtime/modules/world/runtime/simulation/ThermalSystem.js +269 -0
  352. package/dist/runtime/modules/world/runtime/spatial/SpatialSnapshot.js +56 -0
  353. package/dist/runtime/modules/world/runtime/systems/AudioSystem.js +125 -0
  354. package/dist/runtime/modules/world/runtime/systems/Instrument.js +38 -0
  355. package/dist/runtime/modules/world/runtime/systems/InteractionSystem.js +728 -0
  356. package/dist/runtime/modules/world/runtime/systems/LocomotionSystem.js +269 -0
  357. package/dist/runtime/modules/world/runtime/systems/NavigationSystem.js +469 -0
  358. package/dist/runtime/modules/world/runtime/systems/PhysicsSystem.js +1673 -0
  359. package/dist/runtime/modules/world/runtime/systems/RenderingSystem.js +457 -0
  360. package/dist/runtime/modules/world/runtime/systems/SpatialSystem.js +284 -0
  361. package/dist/runtime/modules/world/spec/WorldIR.js +165 -0
  362. package/dist/runtime/modules/world/spec/WorldIRToolSchema.js +86 -0
  363. package/dist/runtime/modules/world/spec/WorldPlannerProposal.js +51 -0
  364. package/dist/runtime/modules/world/spec/WorldRevision.js +231 -0
  365. package/dist/runtime/modules/world/spec/WorldSpec.js +86 -0
  366. package/dist/runtime/modules/world/tasks.jsonl +530 -0
  367. package/dist/runtime/modules/world/verification/ArticulationVerifier.js +254 -0
  368. package/dist/runtime/modules/world/verification/Finding.js +105 -0
  369. package/dist/runtime/modules/world/verification/InteractionEvidence.js +69 -0
  370. package/dist/runtime/modules/world/verification/RepairEngine.js +49 -0
  371. package/dist/runtime/modules/world/verification/WorldAcceptance.js +158 -0
  372. package/dist/runtime/modules/world/verification/WorldValidator.js +65 -0
  373. package/dist/runtime/package-lock.json +16048 -0
  374. package/dist/runtime/package.json +105 -0
  375. package/dist/runtime/public/assets/cabinet.glb +0 -0
  376. package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_diff_1k.jpg +0 -0
  377. package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_nor_gl_1k.jpg +0 -0
  378. package/dist/runtime/public/assets/grand-urban-block/concrete_pavement_diff_1k.jpg +0 -0
  379. package/dist/runtime/public/assets/grand-urban-block/urban_street_01_1k.hdr +0 -0
  380. package/dist/runtime/public/assets/monument-hall/marble_diff_1k.jpg +0 -0
  381. package/dist/runtime/public/assets/monument-hall/marble_nor_gl_1k.jpg +0 -0
  382. package/dist/runtime/public/assets/monument-hall/marble_rough_1k.jpg +0 -0
  383. package/dist/runtime/public/assets/monument-hall/solitude_interior_1k.hdr +0 -0
  384. package/dist/runtime/public/assets/ruined-courtyard/courtyard_1k.hdr +0 -0
  385. package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_diff_1k.jpg +0 -0
  386. package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_nor_gl_1k.jpg +0 -0
  387. package/dist/runtime/public/assets/ruined-courtyard/mossy_sandstone_diff_1k.jpg +0 -0
  388. package/dist/schema-BWpTl0Wj.js +359 -0
  389. package/dist/schema-BWpTl0Wj.js.map +1 -0
  390. package/dist/suzhouGarden-H9tiPgxq.js +6150 -0
  391. package/dist/suzhouGarden-H9tiPgxq.js.map +1 -0
  392. package/dist/woodlandWorkshop-D6zzSbHr.js +483 -0
  393. package/dist/woodlandWorkshop-D6zzSbHr.js.map +1 -0
  394. package/dist/yuanmingyuan-D6IHqjZ-.js +4955 -0
  395. package/dist/yuanmingyuan-D6IHqjZ-.js.map +1 -0
  396. package/package.json +70 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SceneSerializer-CLCzQjL_.js","names":["clone"],"sources":["../../../modules/world/runtime/behavior/RuleGraph.js","../../../modules/world/runtime/WorldAuthority.js","../../../modules/world/runtime/SceneSerializer.js"],"sourcesContent":["const SCHEMA='agentscape.rule-graph';\nconst VERSION=1;\nconst allowedEffectKinds=new Set(['set-state']);\nconst clean=v=>typeof v==='string'?v.trim():'';\nconst scalar=v=>v===null||typeof v==='string'||typeof v==='number'||typeof v==='boolean';\n\nexport function compileRuleGraph(rules=[]){\n if(!Array.isArray(rules)) throw new TypeError('Rules must be an array');\n const ids=new Set();\n const compiled=rules.map((rule,index)=>{\n if(!rule||typeof rule!=='object'||Array.isArray(rule)) throw new TypeError(`Rule[${index}] must be an object`);\n const id=clean(rule.id),event=clean(rule.event),effect=rule.effect;\n if(!id||ids.has(id)) throw new TypeError(`Rule[${index}] requires unique id`); ids.add(id);\n if(!event) throw new TypeError(`Rule[${index}] requires event`);\n if(!effect||typeof effect!=='object'||allowedEffectKinds.has(effect.kind)===false) throw new TypeError(`Rule[${index}] unsupported effect`);\n const targetId=clean(effect.targetId),stateKey=clean(effect.stateKey);\n if(!targetId||!stateKey||!Object.prototype.hasOwnProperty.call(effect,'value')||!scalar(effect.value)) throw new TypeError(`Rule[${index}] set-state effect requires targetId/stateKey/scalar value`);\n const condition=rule.condition?compileCondition(rule.condition,`Rule[${index}] condition`):null;\n return {id,event,condition,effect:{kind:'set-state',targetId,stateKey,value:effect.value},description:clean(rule.description)||undefined};\n });\n return {schema:SCHEMA,schemaVersion:VERSION,rules:compiled};\n}\n\nfunction compileCondition(condition,label){\n if(!condition||typeof condition!=='object'||Array.isArray(condition)) throw new TypeError(`${label} must be an object`);\n const kind=clean(condition.kind);\n if(kind==='equals'){\n if(!clean(condition.targetId)||!clean(condition.stateKey)||!Object.prototype.hasOwnProperty.call(condition,'value')||!scalar(condition.value)) throw new TypeError(`${label} equals requires targetId/stateKey/value`);\n return {kind:'equals',targetId:clean(condition.targetId),stateKey:clean(condition.stateKey),value:condition.value};\n }\n if(kind==='not-equals'){\n if(!clean(condition.targetId)||!clean(condition.stateKey)||!Object.prototype.hasOwnProperty.call(condition,'value')||!scalar(condition.value)) throw new TypeError(`${label} not-equals requires targetId/stateKey/value`);\n return {kind:'not-equals',targetId:clean(condition.targetId),stateKey:clean(condition.stateKey),value:condition.value};\n }\n throw new TypeError(`${label} unsupported kind: ${kind}`);\n}\n\nexport function evaluateRuleGraph(graph,event,stateReader){\n if(graph?.schema!==SCHEMA||graph.schemaVersion!==VERSION) throw new TypeError('Unsupported rule graph');\n if(typeof stateReader!=='function') throw new TypeError('stateReader must be a function');\n const matches=[];\n for(const rule of graph.rules){\n if(rule.event!==event) continue;\n if(rule.condition&&!evaluateCondition(rule.condition,stateReader)) continue;\n matches.push(structuredClone(rule.effect));\n }\n return matches;\n}\n\nfunction evaluateCondition(condition,stateReader){\n const value=stateReader(condition.targetId,condition.stateKey);\n return condition.kind==='equals' ? Object.is(value,condition.value) : !Object.is(value,condition.value);\n}\n\nexport function executeRuleEffects(runtime,effects,{source='rule-graph',eventId=null,ruleCascadeDepth=null}={}){\n if(!Array.isArray(effects)) throw new TypeError('Rule effects must be an array');\n if(!effects.length) return Promise.resolve({status:'no-rule-match',effects:[]});\n return runtime.mutate(`rule:${eventId||source}`,async()=>{\n const applied=[];\n for(const effect of effects){\n if(effect.kind!=='set-state') { const error=new TypeError(`Unsupported rule effect: ${effect.kind}`); error.code='RULE_EFFECT_UNSUPPORTED'; throw error; }\n const result=runtime.applyStateTransition(effect.targetId,effect.stateKey,effect.value,{source:'rule-graph',event:eventId,...(ruleCascadeDepth == null ? {} : {ruleCascadeDepth})});\n if(result?.status!=='state-transition-applied') throw new Error(`Rule state transition rejected: ${effect.targetId}.${effect.stateKey}`);\n applied.push(result);\n }\n return {status:'rule-effects-applied',effects:applied};\n }, ruleCascadeDepth == null ? {} : {ruleCascadeDepth});\n}\n\nexport {SCHEMA as RULE_GRAPH_SCHEMA,VERSION as RULE_GRAPH_VERSION};\n","const clone = (value) => value == null ? value : structuredClone(value);\r\n\r\nexport function captureWorldAuthority(runtime) {\r\n return {\r\n currentWorldRevision:clone(runtime.currentWorldRevision) || null,\r\n currentBehaviorBundle:clone(runtime.currentBehaviorBundle) || null,\r\n currentPhysicsRequirements:clone(runtime.currentPhysicsRequirements) || null,\r\n lastAcceptanceBundle:clone(runtime.lastAcceptanceBundle) || null,\r\n restoredAcceptanceEvidence:clone(runtime.restoredAcceptanceEvidence) || null,\r\n interactionEvidence:runtime.interactionEvidence instanceof Map\r\n ? [...runtime.interactionEvidence.entries()].map(([key,value]) => [key,clone(value)])\r\n : null\r\n };\r\n}\r\n\r\nexport function restoreWorldAuthority(runtime, authority = {}) {\r\n runtime.currentWorldRevision = clone(authority.currentWorldRevision) || null;\r\n runtime.currentBehaviorBundle = clone(authority.currentBehaviorBundle) || null;\r\n runtime.currentPhysicsRequirements = clone(authority.currentPhysicsRequirements) || null;\r\n runtime.lastAcceptanceBundle = clone(authority.lastAcceptanceBundle) || null;\r\n runtime.restoredAcceptanceEvidence = clone(authority.restoredAcceptanceEvidence) || null;\r\n if (authority.interactionEvidence === null) delete runtime.interactionEvidence;\r\n else runtime.interactionEvidence = new Map((authority.interactionEvidence || []).map(([key,value]) => [key,clone(value)]));\r\n runtime.loadRuleGraph?.(authority.currentBehaviorBundle?.ruleGraph || []);\r\n}\r\n\r\nexport function commitWorldAuthority(runtime, {\r\n worldIR,\r\n behaviorBundle,\r\n physicsRequirements,\r\n acceptanceBundle = null\r\n} = {}) {\r\n runtime.currentWorldRevision = worldIR\r\n ? { revision:clone(worldIR.revision), provenance:clone(worldIR.provenance) }\r\n : null;\r\n runtime.currentBehaviorBundle = clone(behaviorBundle) || null;\r\n runtime.currentPhysicsRequirements = clone(physicsRequirements) || null;\r\n runtime.lastAcceptanceBundle = clone(acceptanceBundle) || null;\r\n runtime.restoredAcceptanceEvidence = null;\r\n runtime.loadRuleGraph?.(behaviorBundle?.ruleGraph || []);\r\n}\r\n","import { uniformScaleValue } from './ObjectTransform.js';\nimport { thermalStateSchema,validateThermalStateForProfile } from '../../../foundation/simulation/SimulationProfile.js';\nimport { compileRuleGraph } from './behavior/RuleGraph.js';\nimport { captureWorldAuthority, restoreWorldAuthority } from './WorldAuthority.js';\n\nexport const SCENE_SCHEMA = 'agentscape.scene';\nexport const SCENE_VERSION = 1;\n\nconst clone = (value) => JSON.parse(JSON.stringify(value));\nconst isFiniteVec = (value, length) => Array.isArray(value) && value.length === length && value.every(Number.isFinite);\n\nexport class SceneSerializer {\n *objects(runtime) {\n for (const [id, record] of runtime.store.entries()) {\n const object = record.object;\n const articulation = runtime.physics?.captureArticulationPose?.(id) || [];\n yield { id, assetId: record.assetId,\n transform: { position: object.position.toArray(), quaternion: object.quaternion.toArray(), scale: object.scale.toArray() },\n state: clone(record.state || {}), ...(runtime.thermal?.capture?.(id) ? { simulation:runtime.thermal.capture(id) } : {}),\n ...(record.active === false ? { active: false } : {}),\n ...(articulation.length ? { articulation } : record.dormantArticulation?.length ? { articulation: clone(record.dormantArticulation) } : {}) };\n }\n }\n\n serialize(runtime, { name = 'Untitled World', includeRelations = true, includeObjects = true } = {}) {\n if (includeRelations) runtime.sceneGraph?.update?.();\n const objects = includeObjects ? Array.from(this.objects(runtime)) : [];\n const usedAssets = new Set(objects.map(object => object.assetId));\n const assets = [...usedAssets].map(assetId => runtime.assetModule.getManifest(assetId))\n .filter(manifest => ['glb', 'compiled'].includes(manifest.source?.kind)).map(clone);\n\n const worldRevision=runtime.currentWorldRevision ? clone(runtime.currentWorldRevision) : null;\n const acceptanceEvidence=runtime.lastAcceptanceBundle ? clone(runtime.lastAcceptanceBundle) : null;\n const cameraState=runtime.rendering?.cameraState?.() || null;\n const stylePack=runtime.rendering?.serializeStyle?.() || null;\n return {\n schema: SCENE_SCHEMA,\n schemaVersion: SCENE_VERSION,\n metadata: {\n name,\n savedAt: new Date().toISOString(),\n generator: `AgentScape/${runtime.version || 'unknown'}`,\n environment: runtime.environment?.id || null,\n ...(stylePack?{stylePack}:{}),\n ...(runtime.environment?.snapshot ? {environmentState:clone(runtime.environment.snapshot())} : {}),\n ...(worldRevision?{worldRevision}:{})\n },\n assets,\n objects,\n configuration: {\n behaviorBundle: runtime.currentBehaviorBundle ? clone(runtime.currentBehaviorBundle) : null,\n physicsRequirements: runtime.currentPhysicsRequirements ? clone(runtime.currentPhysicsRequirements) : null\n },\n ...(includeRelations ? { relations:runtime.sceneGraph?.list?.() || [] } : {}),\n ...(acceptanceEvidence?{verification:{acceptanceEvidence}}:{}),\n ...(cameraState?{camera:cameraState}:{})\n };\n }\n\n validate(scene) {\n if (!scene || typeof scene !== 'object') throw new Error('Scene must be an object');\n if (scene.schema !== SCENE_SCHEMA) throw new Error(`Unsupported scene schema: ${scene.schema || 'missing'}`);\n if (scene.schemaVersion !== SCENE_VERSION) throw new Error(`Unsupported scene version: ${scene.schemaVersion}`);\n if (!Array.isArray(scene.objects)) throw new Error('Scene objects must be an array');\n if (!Array.isArray(scene.assets)) throw new Error('Scene assets must be an array');\n if (scene.camera != null && (!isFiniteVec(scene.camera.position,3) || !isFiniteVec(scene.camera.target,3))) throw new Error('Scene camera requires finite position and target');\n if (scene.relations != null && !Array.isArray(scene.relations)) throw new Error('Scene relations must be an array');\n const worldRevision=scene.metadata?.worldRevision;\n if (worldRevision != null) {\n if (!worldRevision || typeof worldRevision !== 'object' || Array.isArray(worldRevision)) throw new Error('Scene worldRevision must be an object');\n if (!worldRevision.revision?.id) throw new Error('Scene worldRevision requires revision.id');\n if (!worldRevision.provenance?.source) throw new Error('Scene worldRevision requires provenance.source');\n }\n const configuration = scene.configuration;\n if (configuration != null) {\n if (typeof configuration !== 'object' || Array.isArray(configuration)) throw new Error('Invalid scene configuration');\n for (const key of ['behaviorBundle', 'physicsRequirements']) {\n const value = configuration[key];\n if (value != null && (typeof value !== 'object' || Array.isArray(value))) throw new Error(`Invalid scene ${key}`);\n if (value?.worldRevisionId && value.worldRevisionId !== worldRevision?.revision?.id) {\n throw new Error(`Scene ${key} revision mismatch`);\n }\n }\n const graph = configuration.behaviorBundle?.ruleGraph || [];\n if (!Array.isArray(graph) && (graph.schema !== 'agentscape.rule-graph' || graph.schemaVersion !== 1)) {\n throw new Error('Invalid scene rule graph');\n }\n compileRuleGraph(Array.isArray(graph) ? graph : graph.rules);\n }\n const acceptanceEvidence=scene.verification?.acceptanceEvidence;\n if (acceptanceEvidence != null) {\n if (acceptanceEvidence.schema !== 'agentscape.acceptance-evidence' || acceptanceEvidence.schemaVersion !== 1) throw new Error('Unsupported acceptance evidence');\n if (!Array.isArray(acceptanceEvidence.criteria) || !acceptanceEvidence.result || typeof acceptanceEvidence.result !== 'object') throw new Error('Invalid acceptance evidence payload');\n const revisionId=worldRevision?.revision?.id || null;\n if (revisionId && acceptanceEvidence.worldRevisionId && acceptanceEvidence.worldRevisionId !== revisionId) throw new Error(`Acceptance evidence revision mismatch: ${acceptanceEvidence.worldRevisionId} != ${revisionId}`);\n }\n // 先只收集并校验标识,后续 heldBy 引用需要完整的 id 集合。\n const objectIds = new Set();\n for (const object of scene.objects) {\n if (!object.id || !object.assetId) throw new Error('Scene object requires id and assetId');\n if (object.active != null && typeof object.active !== 'boolean') throw new Error('Invalid entity activation');\n if (object.simulation != null) {\n if(!thermalStateSchema.safeParse(object.simulation).success)\n throw new Error('Invalid entity thermal state');\n }\n if (object.articulation != null) {\n if (!Array.isArray(object.articulation) || object.articulation.length > 128) throw new Error('Invalid articulation poses');\n const names = new Set();\n for (const part of object.articulation) {\n if (!part || typeof part.partName !== 'string' || names.has(part.partName) || !isFiniteVec(part.position,3) || !isFiniteVec(part.quaternion,4)\n || Math.abs(Math.hypot(...part.quaternion)-1) > .001 || (part.motorTarget != null && !Number.isFinite(part.motorTarget))) throw new Error('Invalid articulation pose');\n names.add(part.partName);\n }\n }\n if (objectIds.has(object.id)) throw new Error(`Duplicate scene object id: ${object.id}`);\n objectIds.add(object.id);\n }\n const heldOwners = new Set();\n for (const object of scene.objects) {\n if (!isFiniteVec(object.transform?.position, 3)) throw new Error(`${object.id}: invalid position`);\n if (!isFiniteVec(object.transform?.quaternion, 4)) throw new Error(`${object.id}: invalid quaternion`);\n if (!isFiniteVec(object.transform?.scale, 3)) throw new Error(`${object.id}: invalid scale`);\n uniformScaleValue(object.transform.scale);\n const heldBy = object.state?.heldBy;\n if (heldBy) {\n if (!['human','agent'].includes(heldBy.kind)) throw new Error(`${object.id}: invalid heldBy.kind`);\n const ownerKey = heldBy.kind === 'human' ? 'human' : `agent:${heldBy.id}`;\n if (heldBy.kind === 'agent' && (!heldBy.id || !objectIds.has(heldBy.id))) throw new Error(`${object.id}: heldBy agent is missing`);\n if (heldOwners.has(ownerKey)) throw new Error(`${ownerKey}: multiple held objects are not supported`);\n heldOwners.add(ownerKey);\n }\n }\n return scene;\n }\n\n async restore(runtime, input) {\n const scene = this.validate(clone(input));\n runtime.rendering?.validateStyle?.(scene.metadata?.stylePack || null);\n const sceneEnvironment = scene.metadata?.environment;\n const runtimeEnvironment = runtime.environment?.id;\n if (sceneEnvironment && runtimeEnvironment && sceneEnvironment !== runtimeEnvironment) {\n throw new Error(`Scene environment mismatch: ${sceneEnvironment} != ${runtimeEnvironment}`);\n }\n\n // 先完成所有不会破坏当前世界的检查。\n for (const manifest of scene.assets) runtime.assetModule.assertCompatibleManifest(manifest);\n for (const item of scene.objects) {\n if (!runtime.assetModule.hasAsset(item.assetId)) throw new Error(`Scene references unknown asset: ${item.assetId}`);\n if(item.simulation){\n const profile=runtime.assetModule.getManifest(item.assetId).simulation;\n if(!profile)throw new Error(`Scene has thermal state without a thermal asset: ${item.id}`);\n validateThermalStateForProfile(profile,item.simulation);\n }\n }\n if(scene.metadata?.environmentState)runtime.environment?.validateSnapshot?.(scene.metadata.environmentState);\n\n // 预检已通过,从这里开始才会破坏当前世界。失败时恢复加载前的场景,而不是留下半个世界。\n const previous = typeof runtime.snapshot === 'function' ? runtime.snapshot() : null;\n const previousAuthority = captureWorldAuthority(runtime);\n const previousPhysics = runtime.physics?.captureState?.();\n const attachments = runtime.projectCapabilities?.captureAttachments?.() || [];\n if (!previous) {\n const applied = await this.applyScene(runtime, scene);\n runtime.projectCapabilities?.rebindAttachments?.(attachments);\n return applied;\n }\n try {\n const applied = await this.applyScene(runtime, scene);\n runtime.projectCapabilities?.rebindAttachments?.(attachments);\n return applied;\n } catch (error) {\n try {\n await this.applyScene(runtime, previous);\n if (previousPhysics) {\n runtime.physics.restoreState(previousPhysics);\n runtime.sceneGraph?.invalidate?.();\n }\n restoreWorldAuthority(runtime, previousAuthority);\n runtime.projectCapabilities?.rebindAttachments?.(attachments);\n } catch (rollbackError) {\n const failure = new AggregateError([error, rollbackError], 'Scene restore rollback failed', { cause:error });\n failure.code = 'SCENE_RESTORE_ROLLBACK_FAILED';\n failure.rollbackError = rollbackError;\n throw failure;\n }\n throw error;\n }\n }\n\n // 破坏性应用。调用方必须保证 scene 已经 validate 并通过全部预检。\n async applyScene(runtime, scene) {\n runtime.affordances?.cancel('SCENE_RESTORE');\n\n if (typeof runtime.physics?.resetWorld === 'function') {\n runtime.locomotion?.cancelAll?.();\n runtime.interactions?.cancelPending?.('SCENE_RESTORE');\n runtime.physics.resetWorld();\n if (runtime.environment?.colliders?.length) {\n runtime.physics.addEnvironment(runtime.environment.colliders,{id:runtime.environment.id});\n }\n const characterOptions = runtime.environment?.physics?.characterController\n || runtime.environment?.characterController\n || null;\n if (characterOptions && typeof runtime.physics.setCharacterControllerOptions === 'function') {\n runtime.physics.setCharacterControllerOptions(characterOptions);\n }\n }\n\n await runtime.sceneGraph.batch(async () => {\n await runtime.clearObjects({silent:true});\n for (const item of scene.objects) {\n await runtime.spawn(item.assetId, {\n id:item.id,\n position:item.transform.position,\n quaternion:item.transform.quaternion,\n scale:item.transform.scale,\n active: item.active !== false\n });\n const record = runtime.store.get(item.id);\n if(item.simulation)runtime.thermal.restore(item.id,item.simulation);\n record.state = clone(item.state || {});\n runtime.restoreObjectState(item.id, record.state);\n if (item.articulation?.length) {\n if (record.active === false) record.dormantArticulation = clone(item.articulation);\n else runtime.physics.restoreArticulationPose(item.id, item.articulation);\n }\n }\n runtime.interactions?.rebuildHeldOwnership?.();\n runtime.sceneGraph.changed();\n });\n\n if(scene.metadata?.environmentState) runtime.environment?.restore?.(scene.metadata.environmentState);\n runtime.navigation?.invalidate?.('scene-restored');\n if (scene.camera) runtime.rendering?.applyCameraState?.(scene.camera);\n await runtime.rendering?.restoreStyle?.(scene.metadata?.stylePack || null);\n runtime.currentWorldRevision=scene.metadata?.worldRevision ? clone(scene.metadata.worldRevision) : null;\n runtime.restoredAcceptanceEvidence=scene.verification?.acceptanceEvidence ? clone(scene.verification.acceptanceEvidence) : null;\n runtime.lastAcceptanceBundle=null;\n runtime.currentBehaviorBundle=scene.configuration?.behaviorBundle ? clone(scene.configuration.behaviorBundle) : null;\n runtime.currentPhysicsRequirements=scene.configuration?.physicsRequirements ? clone(scene.configuration.physicsRequirements) : null;\n runtime.interactionEvidence?.clear?.();\n runtime.loadRuleGraph?.(runtime.currentBehaviorBundle?.ruleGraph || []);\n runtime.events.emit('scene.restored', { objects: scene.objects.length, worldRevisionId:runtime.currentWorldRevision?.revision?.id || null, hasAcceptanceEvidence:Boolean(runtime.restoredAcceptanceEvidence) });\n return scene;\n }\n}\n"],"mappings":";;;AAAA,MAAM,SAAO;AAEb,MAAM,qCAAmB,IAAI,IAAI,CAAC,WAAW,CAAC;AAC9C,MAAM,SAAM,MAAG,OAAO,MAAI,WAAS,EAAE,KAAK,IAAE;AAC5C,MAAM,UAAO,MAAG,MAAI,QAAM,OAAO,MAAI,YAAU,OAAO,MAAI,YAAU,OAAO,MAAI;AAE/E,SAAgB,iBAAiB,QAAM,CAAC,GAAE;CACxC,IAAG,CAAC,MAAM,QAAQ,KAAK,GAAG,MAAM,IAAI,UAAU,wBAAwB;CACtE,MAAM,sBAAI,IAAI,IAAI;CAClB,MAAM,WAAS,MAAM,KAAK,MAAK,UAAQ;EACrC,IAAG,CAAC,QAAM,OAAO,SAAO,YAAU,MAAM,QAAQ,IAAI,GAAG,MAAM,IAAI,UAAU,QAAQ,MA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