agentscape3d-engine 0.0.0-stage → 1.0.0-beta.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/LICENSE +21 -0
- package/README.md +19 -2
- package/cli.mjs +53 -0
- package/dist/ArticulationVerifier-BfGxXY8V.js +337 -0
- package/dist/ArticulationVerifier-BfGxXY8V.js.map +1 -0
- package/dist/AssetCompiler-BLj09iu1.js +2424 -0
- package/dist/AssetCompiler-BLj09iu1.js.map +1 -0
- package/dist/AssetModule-DME-XaFS.js +2637 -0
- package/dist/AssetModule-DME-XaFS.js.map +1 -0
- package/dist/AssetRecipe-g8dZBhgJ.js +298 -0
- package/dist/AssetRecipe-g8dZBhgJ.js.map +1 -0
- package/dist/BrowserCodeWorker.js +53856 -0
- package/dist/BrowserCodeWorker.js.map +1 -0
- package/dist/CarryCapability-CXwHU5ay.js +104 -0
- package/dist/CarryCapability-CXwHU5ay.js.map +1 -0
- package/dist/KinematicHypothesisScreen-C3TKiuYR.js +241 -0
- package/dist/KinematicHypothesisScreen-C3TKiuYR.js.map +1 -0
- package/dist/ObjectTransform-BlQUNK7c.js +61 -0
- package/dist/ObjectTransform-BlQUNK7c.js.map +1 -0
- package/dist/RapierPhysicsBackend-B2wQe_Vl.js +3259 -0
- package/dist/RapierPhysicsBackend-B2wQe_Vl.js.map +1 -0
- package/dist/RenderingSystem-WIr1ZuGu.js +1042 -0
- package/dist/RenderingSystem-WIr1ZuGu.js.map +1 -0
- package/dist/ScenePresentation-LsYiDxbm.js +152 -0
- package/dist/ScenePresentation-LsYiDxbm.js.map +1 -0
- package/dist/SceneProject-K7HH1s8o.js +2687 -0
- package/dist/SceneProject-K7HH1s8o.js.map +1 -0
- package/dist/SceneSerializer-zOzbX4jZ.js +932 -0
- package/dist/SceneSerializer-zOzbX4jZ.js.map +1 -0
- package/dist/SimulationProfile-DSYZbBLQ.js +165 -0
- package/dist/SimulationProfile-DSYZbBLQ.js.map +1 -0
- package/dist/StylePack-DcRa_kU0.js +88 -0
- package/dist/StylePack-DcRa_kU0.js.map +1 -0
- package/dist/WorldArchive-BiFGLt--.js +451 -0
- package/dist/WorldArchive-BiFGLt--.js.map +1 -0
- package/dist/WorldCommands-Debj7V4L.js +2207 -0
- package/dist/WorldCommands-Debj7V4L.js.map +1 -0
- package/dist/WorldIO-Ch8QBfKY.js +151 -0
- package/dist/WorldIO-Ch8QBfKY.js.map +1 -0
- package/dist/admission-CVEvsrdz.js +121 -0
- package/dist/admission-CVEvsrdz.js.map +1 -0
- package/dist/blankWorld-B0MW6g7q.js +75 -0
- package/dist/blankWorld-B0MW6g7q.js.map +1 -0
- package/dist/core.d.ts +68 -0
- package/dist/core.js +209 -0
- package/dist/core.js.map +1 -0
- package/dist/disposeObject3D-DIMzy0FA.js +128 -0
- package/dist/disposeObject3D-DIMzy0FA.js.map +1 -0
- package/dist/environments-HOe3sJXH.js +567 -0
- package/dist/environments-HOe3sJXH.js.map +1 -0
- package/dist/gltfIO-BzVKLyaL.js +339 -0
- package/dist/gltfIO-BzVKLyaL.js.map +1 -0
- package/dist/grandUrbanBlock-DRndRZjF.js +515 -0
- package/dist/grandUrbanBlock-DRndRZjF.js.map +1 -0
- package/dist/index.d.ts +345 -0
- package/dist/index.js +16952 -0
- package/dist/index.js.map +1 -0
- package/dist/magicCabin-CfBZjx2Q.js +11019 -0
- package/dist/magicCabin-CfBZjx2Q.js.map +1 -0
- package/dist/manifests-D0LwbJ36.js +866 -0
- package/dist/manifests-D0LwbJ36.js.map +1 -0
- package/dist/mcp.d.ts +2 -0
- package/dist/mcp.js +1 -0
- package/dist/monumentHall-awZiGtda.js +403 -0
- package/dist/monumentHall-awZiGtda.js.map +1 -0
- package/dist/node.d.ts +16 -0
- package/dist/node.js +26 -0
- package/dist/parts-DrEcfJRl.js +37 -0
- package/dist/parts-DrEcfJRl.js.map +1 -0
- package/dist/rolldown-runtime-D3KUYPsf.js +12 -0
- package/dist/ruinedCourtyard-DuF7NmUU.js +696 -0
- package/dist/ruinedCourtyard-DuF7NmUU.js.map +1 -0
- package/dist/runtime/application/AgentTools.js +28 -0
- package/dist/runtime/application/README.md +14 -0
- package/dist/runtime/application/agent/ProgressiveAgentTools.js +92 -0
- package/dist/runtime/application/agent/StudioMcpAllowlist.js +10 -0
- package/dist/runtime/application/agent/StudioProjectTools.js +18 -0
- package/dist/runtime/application/agent/TaskEvidence.js +199 -0
- package/dist/runtime/application/buildTaskObservation.js +117 -0
- package/dist/runtime/application/code-execution/AuthoringSandboxEntry.js +50 -0
- package/dist/runtime/application/code-execution/BrowserCodeExecutor.js +35 -0
- package/dist/runtime/application/code-execution/BrowserCodeWorker.js +17 -0
- package/dist/runtime/application/code-execution/RemoteAuthoringDocument.js +82 -0
- package/dist/runtime/application/createSession.js +66 -0
- package/dist/runtime/application/createWorldAuthoringContext.js +400 -0
- package/dist/runtime/application/generation/GenerationOrchestrator.js +630 -0
- package/dist/runtime/application/generation/GenerationRuntime.js +215 -0
- package/dist/runtime/application/generation/PromptHybridWorldOrchestrator.js +289 -0
- package/dist/runtime/application/native-scene/CodeProject.js +215 -0
- package/dist/runtime/application/native-scene/CodeProjectModules.js +143 -0
- package/dist/runtime/application/native-scene/ExampleWorldCatalog.js +35 -0
- package/dist/runtime/application/native-scene/NativeArticulation.js +53 -0
- package/dist/runtime/application/native-scene/NativeEditableRegistry.js +150 -0
- package/dist/runtime/application/native-scene/NativeEnvironmentGeometry.js +85 -0
- package/dist/runtime/application/native-scene/NativeLightingInspection.js +33 -0
- package/dist/runtime/application/native-scene/NativeMaterialInspection.js +52 -0
- package/dist/runtime/application/native-scene/NativeOverlayCheckpoint.js +127 -0
- package/dist/runtime/application/native-scene/NativePhysicsGeometry.js +64 -0
- package/dist/runtime/application/native-scene/NativeRenderDiscovery.js +51 -0
- package/dist/runtime/application/native-scene/NativeSceneHost.js +406 -0
- package/dist/runtime/application/native-scene/NativeSceneInspection.js +203 -0
- package/dist/runtime/application/native-scene/NativeSceneOverlay.js +116 -0
- package/dist/runtime/application/native-scene/NativeSceneQuery.js +123 -0
- package/dist/runtime/application/native-scene/NativeSceneReview.js +132 -0
- package/dist/runtime/application/native-scene/NativeThreeModule.js +16 -0
- package/dist/runtime/application/native-scene/SceneObserver.js +97 -0
- package/dist/runtime/application/native-scene/VisualCapturePolicy.js +4 -0
- package/dist/runtime/application/object-forge/SceneObjectForge.js +263 -0
- package/dist/runtime/application/programmatic-assets/ProgrammaticAssetBuilder.js +59 -0
- package/dist/runtime/application/programmatic-assets/ProgrammaticAssetContract.js +22 -0
- package/dist/runtime/application/programmatic-assets/ThreeCodeAsset.js +40 -0
- package/dist/runtime/application/scene/CapabilityResolver.js +90 -0
- package/dist/runtime/application/scene/NativeEditableContracts.js +18 -0
- package/dist/runtime/application/scene/RequestWindow.js +54 -0
- package/dist/runtime/application/scene/SceneAgentTools.js +21 -0
- package/dist/runtime/application/scene/SceneContracts.js +49 -0
- package/dist/runtime/application/scene/SceneEditService.js +154 -0
- package/dist/runtime/application/scene/SceneFacade.js +356 -0
- package/dist/runtime/application/scene/SceneInteractionAdapters.js +41 -0
- package/dist/runtime/application/scene/SceneJobController.js +320 -0
- package/dist/runtime/application/scene/SceneLifecycle.js +57 -0
- package/dist/runtime/application/scene/ScenePackage.js +173 -0
- package/dist/runtime/application/scene/ScenePersistence.js +50 -0
- package/dist/runtime/application/scene/SceneProject.js +95 -0
- package/dist/runtime/application/scene/SceneSkillNames.js +5 -0
- package/dist/runtime/application/scene/StarterScene.js +56 -0
- package/dist/runtime/application/scene/WorldArchive.js +89 -0
- package/dist/runtime/application/scene/WorldDirectory.js +20 -0
- package/dist/runtime/application/scene/WorldDocument.js +76 -0
- package/dist/runtime/application/scene/WorldIO.js +103 -0
- package/dist/runtime/application/scene/WorldStorage.js +155 -0
- package/dist/runtime/application/skills/SkillRegistry.js +193 -0
- package/dist/runtime/application/skills/packs/acceptanceSkills.js +32 -0
- package/dist/runtime/application/skills/packs/affordanceSkills.js +36 -0
- package/dist/runtime/application/skills/packs/assetSkills.js +46 -0
- package/dist/runtime/application/skills/packs/authoringSkills.js +16 -0
- package/dist/runtime/application/skills/packs/batchSkills.js +22 -0
- package/dist/runtime/application/skills/packs/codeSkills.js +106 -0
- package/dist/runtime/application/skills/packs/generationSkills.js +45 -0
- package/dist/runtime/application/skills/packs/interactionSkills.js +46 -0
- package/dist/runtime/application/skills/packs/recoverySkills.js +80 -0
- package/dist/runtime/application/skills/packs/sceneSkills.js +24 -0
- package/dist/runtime/application/skills/packs/spatialSkills.js +35 -0
- package/dist/runtime/application/skills/packs/verificationSkills.js +14 -0
- package/dist/runtime/application/skills/packs/worldSkills.js +45 -0
- package/dist/runtime/application/skills/registerCoreSkills.js +31 -0
- package/dist/runtime/application/skills/skillPrimitives.js +4 -0
- package/dist/runtime/application/tasks/CabinetCupTask.js +76 -0
- package/dist/runtime/application/tasks.jsonl +67 -0
- package/dist/runtime/application/world-authoring/AuthoringAssetProducer.js +42 -0
- package/dist/runtime/application/world-authoring/AuthoringDiff.js +149 -0
- package/dist/runtime/application/world-authoring/AuthoringDocument.js +825 -0
- package/dist/runtime/application/world-authoring/AuthoringExecutionHost.js +109 -0
- package/dist/runtime/application/world-authoring/AuthoringIdentity.js +17 -0
- package/dist/runtime/application/world-authoring/AuthoringModelResolver.js +29 -0
- package/dist/runtime/application/world-authoring/AuthoringPatch.js +118 -0
- package/dist/runtime/application/world-authoring/AuthoringPromotionController.js +334 -0
- package/dist/runtime/application/world-authoring/AuthoringPromotionSource.js +126 -0
- package/dist/runtime/application/world-authoring/AuthoringRevisionHistory.js +144 -0
- package/dist/runtime/application/world-authoring/HeadlessImageExport.js +92 -0
- package/dist/runtime/application/world-authoring/ModelRef.js +62 -0
- package/dist/runtime/application/world-authoring/SceneGLBExport.js +88 -0
- package/dist/runtime/apps/mcp-server/AUTHORING.md +71 -0
- package/dist/runtime/apps/mcp-server/AgentMcpCompat.js +68 -0
- package/dist/runtime/apps/mcp-server/AuthoringSandboxEntry.js +1 -0
- package/dist/runtime/apps/mcp-server/AuthoringSandboxWorker.mjs +30 -0
- package/dist/runtime/apps/mcp-server/BuildEnvironment.js +17 -0
- package/dist/runtime/apps/mcp-server/CodeExecutor.js +71 -0
- package/dist/runtime/apps/mcp-server/DEPLOYMENT-PC2.md +42 -0
- package/dist/runtime/apps/mcp-server/DockerBuildRunner.js +66 -0
- package/dist/runtime/apps/mcp-server/FileAssetRepository.js +159 -0
- package/dist/runtime/apps/mcp-server/HeadlessAssetIO.js +8 -0
- package/dist/runtime/apps/mcp-server/HeadlessGLTFLoader.js +47 -0
- package/dist/runtime/apps/mcp-server/HeadlessWorldHost.js +157 -0
- package/dist/runtime/apps/mcp-server/IsolatedAuthoringExecutor.js +6 -0
- package/dist/runtime/apps/mcp-server/PROGRAMMATIC-ASSETS.md +116 -0
- package/dist/runtime/apps/mcp-server/ProgrammaticAssets.js +60 -0
- package/dist/runtime/apps/mcp-server/README.md +269 -0
- package/dist/runtime/apps/mcp-server/RemoteAuthoringDocument.js +1 -0
- package/dist/runtime/apps/mcp-server/SandboxBundle.js +13 -0
- package/dist/runtime/apps/mcp-server/SessionManager.js +148 -0
- package/dist/runtime/apps/mcp-server/StudioBridgeHttp.js +75 -0
- package/dist/runtime/apps/mcp-server/StudioLiveBridge.js +246 -0
- package/dist/runtime/apps/mcp-server/StudioProjectToolContracts.js +58 -0
- package/dist/runtime/apps/mcp-server/TransferHttp.js +47 -0
- package/dist/runtime/apps/mcp-server/TransferLimits.js +6 -0
- package/dist/runtime/apps/mcp-server/TransferStore.js +134 -0
- package/dist/runtime/apps/mcp-server/TrustedAuthoringWorker.mjs +16 -0
- package/dist/runtime/apps/mcp-server/VALIDATION.md +45 -0
- package/dist/runtime/apps/mcp-server/acceptance-evidence.json +332 -0
- package/dist/runtime/apps/mcp-server/errorDiagnostics.js +32 -0
- package/dist/runtime/apps/mcp-server/examples/code-house.js +24 -0
- package/dist/runtime/apps/mcp-server/examples/procedural-assets.js +85 -0
- package/dist/runtime/apps/mcp-server/main.mjs +82 -0
- package/dist/runtime/apps/mcp-server/registerTools.js +274 -0
- package/dist/runtime/apps/mcp-server/sandbox/run.mjs +23 -0
- package/dist/runtime/apps/mcp-server/security.js +23 -0
- package/dist/runtime/apps/mcp-server/tasks.jsonl +9 -0
- package/dist/runtime/apps/server/CapabilityAdapterRegistry.js +157 -0
- package/dist/runtime/apps/server/README.md +7 -0
- package/dist/runtime/apps/server/WorldRepository.js +338 -0
- package/dist/runtime/apps/server/WorldRepositoryHttp.js +96 -0
- package/dist/runtime/apps/server/openai-compatible-agent-gateway.mjs +278 -0
- package/dist/runtime/apps/server/tasks.jsonl +10 -0
- package/dist/runtime/apps/shared/node/WorldDiskStorage.js +62 -0
- package/dist/runtime/foundation/EventBus.js +26 -0
- package/dist/runtime/foundation/JsonGateway.js +47 -0
- package/dist/runtime/foundation/PngRgba.js +99 -0
- package/dist/runtime/foundation/PolicyEngine.js +21 -0
- package/dist/runtime/foundation/README.md +7 -0
- package/dist/runtime/foundation/TraceRecorder.js +76 -0
- package/dist/runtime/foundation/errors.js +8 -0
- package/dist/runtime/foundation/simulation/SimulationProfile.js +143 -0
- package/dist/runtime/foundation/version.js +2 -0
- package/dist/runtime/modules/agent/README.md +11 -0
- package/dist/runtime/modules/agent/ToolCallingAgent.js +19 -0
- package/dist/runtime/modules/agent/bootstrapWorld.js +10 -0
- package/dist/runtime/modules/agent/buildRecoveryProposals.js +533 -0
- package/dist/runtime/modules/agent/execution/AgentExecutionRules.js +128 -0
- package/dist/runtime/modules/agent/execution/AgentRunResults.js +55 -0
- package/dist/runtime/modules/agent/execution/AgentRunSession.js +393 -0
- package/dist/runtime/modules/agent/execution/AgentToolInvoker.js +40 -0
- package/dist/runtime/modules/agent/gateway/HttpLLMGateway.js +19 -0
- package/dist/runtime/modules/agent/prompt/index.js +52 -0
- package/dist/runtime/modules/agent/tasks.jsonl +94 -0
- package/dist/runtime/modules/artifact/ArtifactContentGate.js +144 -0
- package/dist/runtime/modules/artifact/ArtifactDescriptor.js +280 -0
- package/dist/runtime/modules/artifact/ArtifactImporter.js +185 -0
- package/dist/runtime/modules/artifact/ArtifactModule.js +111 -0
- package/dist/runtime/modules/artifact/ArtifactRegistry.js +197 -0
- package/dist/runtime/modules/artifact/IncrementalSha256.js +129 -0
- package/dist/runtime/modules/artifact/MemoryArtifactByteStore.js +115 -0
- package/dist/runtime/modules/artifact/README.md +7 -0
- package/dist/runtime/modules/artifact/storage/IndexedDbArtifactStore.js +67 -0
- package/dist/runtime/modules/artifact/tasks.jsonl +31 -0
- package/dist/runtime/modules/asset/AssetModule.js +416 -0
- package/dist/runtime/modules/asset/README.md +67 -0
- package/dist/runtime/modules/asset/loading/AssetLoader.js +157 -0
- package/dist/runtime/modules/asset/loading/GltfAssetLoader.js +61 -0
- package/dist/runtime/modules/asset/loading/builtins/BuiltinAssets.js +95 -0
- package/dist/runtime/modules/asset/loading/builtins/HouseDoor.js +33 -0
- package/dist/runtime/modules/asset/loading/builtins/IndustrialCabinet.js +103 -0
- package/dist/runtime/modules/asset/model/AssetInputContracts.js +139 -0
- package/dist/runtime/modules/asset/model/AssetRef.js +12 -0
- package/dist/runtime/modules/asset/model/MechanicalAssetDraft.js +172 -0
- package/dist/runtime/modules/asset/model/ProceduralTextureContract.js +24 -0
- package/dist/runtime/modules/asset/model/admission.js +117 -0
- package/dist/runtime/modules/asset/model/errors.js +6 -0
- package/dist/runtime/modules/asset/model/parts.js +27 -0
- package/dist/runtime/modules/asset/model/resourceBudget.js +10 -0
- package/dist/runtime/modules/asset/model/schema.js +150 -0
- package/dist/runtime/modules/asset/persistence/AssetManifestStore.js +78 -0
- package/dist/runtime/modules/asset/persistence/CompiledAssetStore.js +84 -0
- package/dist/runtime/modules/asset/persistence/LocalAssetLibrary.js +86 -0
- package/dist/runtime/modules/asset/persistence/LocalAssetLibraryStore.js +81 -0
- package/dist/runtime/modules/asset/production/AssetProductionPipeline.js +272 -0
- package/dist/runtime/modules/asset/production/AssetRecipe.js +91 -0
- package/dist/runtime/modules/asset/production/ProceduralTexture.js +85 -0
- package/dist/runtime/modules/asset/production/adapters/EmbodiedGenAdapter.js +45 -0
- package/dist/runtime/modules/asset/production/adapters/EmbodiedGenBundleAdapter.js +590 -0
- package/dist/runtime/modules/asset/production/compiler/AssetCompiler.js +173 -0
- package/dist/runtime/modules/asset/production/compiler/evidence/AnimationMotionEvidence.js +124 -0
- package/dist/runtime/modules/asset/production/compiler/evidence/StaticPanelEvidence.js +56 -0
- package/dist/runtime/modules/asset/production/compiler/gltfIO.js +6 -0
- package/dist/runtime/modules/asset/production/compiler/partGeometry.js +74 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ArticulatedCollisionPass.js +63 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ArticulationCandidatePass.js +48 -0
- package/dist/runtime/modules/asset/production/compiler/passes/AuthoringIntentPass.js +16 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ColliderFallbackPass.js +30 -0
- package/dist/runtime/modules/asset/production/compiler/passes/CompileQualityPass.js +75 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ExplicitDefinitionPass.js +20 -0
- package/dist/runtime/modules/asset/production/compiler/passes/GLTFInspectPass.js +34 -0
- package/dist/runtime/modules/asset/production/compiler/passes/GeometryPass.js +32 -0
- package/dist/runtime/modules/asset/production/compiler/passes/JointFramePass.js +116 -0
- package/dist/runtime/modules/asset/production/compiler/passes/KinematicEvidencePass.js +84 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ManifestPass.js +63 -0
- package/dist/runtime/modules/asset/production/compiler/passes/NormalizeTransformPass.js +16 -0
- package/dist/runtime/modules/asset/production/compiler/passes/OptimizeGLBPass.js +23 -0
- package/dist/runtime/modules/asset/production/compiler/passes/PartColliderPass.js +50 -0
- package/dist/runtime/modules/asset/production/compiler/passes/PartGeometryEnrichmentPass.js +60 -0
- package/dist/runtime/modules/asset/production/compiler/passes/PartProposalPass.js +93 -0
- package/dist/runtime/modules/asset/production/compiler/passes/RemoteEnrichmentPass.js +32 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ResourceBudgetPass.js +55 -0
- package/dist/runtime/modules/asset/production/compiler/passes/SegmentMaterializePass.js +203 -0
- package/dist/runtime/modules/asset/production/compiler/passes/SegmentationEvidencePass.js +43 -0
- package/dist/runtime/modules/asset/production/compiler/passes/SemanticHeuristicPass.js +33 -0
- package/dist/runtime/modules/asset/production/compiler/passes/StructurePass.js +60 -0
- package/dist/runtime/modules/asset/production/compiler/providers/HttpCompilerProvider.js +23 -0
- package/dist/runtime/modules/asset/production/verification/KinematicHypothesisScreen.js +198 -0
- package/dist/runtime/modules/asset/registry/AssetCatalog.js +72 -0
- package/dist/runtime/modules/asset/registry/AssetRegistry.js +51 -0
- package/dist/runtime/modules/asset/registry/manifests/index.js +173 -0
- package/dist/runtime/modules/asset/tasks.jsonl +87 -0
- package/dist/runtime/modules/generation/README.md +9 -0
- package/dist/runtime/modules/generation/connector/ConnectorArtifactClient.js +45 -0
- package/dist/runtime/modules/generation/connector/ConnectorCapabilityAdapter.js +169 -0
- package/dist/runtime/modules/generation/connector/ConnectorClient.js +192 -0
- package/dist/runtime/modules/generation/connector/ConnectorJobClient.js +167 -0
- package/dist/runtime/modules/generation/connector/ConnectorJobEventClient.js +179 -0
- package/dist/runtime/modules/generation/connector/ConnectorSession.js +202 -0
- package/dist/runtime/modules/generation/jobs/GenerationJobProjection.js +239 -0
- package/dist/runtime/modules/generation/jobs/GenerationJobReconciler.js +99 -0
- package/dist/runtime/modules/generation/jobs/GenerationJobStore.js +91 -0
- package/dist/runtime/modules/generation/jobs/GenerationJobTransportOverlay.js +50 -0
- package/dist/runtime/modules/generation/providers/ProviderRegistry.js +304 -0
- package/dist/runtime/modules/generation/tasks.jsonl +35 -0
- package/dist/runtime/modules/navigation/NavigationBackend.js +17 -0
- package/dist/runtime/modules/navigation/RecastNavigationBackend.js +263 -0
- package/dist/runtime/modules/physics/JoltPhysicsBackend.js +850 -0
- package/dist/runtime/modules/physics/PhysicsApiSurface.js +660 -0
- package/dist/runtime/modules/physics/PhysicsBackend.js +88 -0
- package/dist/runtime/modules/physics/RapierPhysicsBackend.js +414 -0
- package/dist/runtime/modules/rendering/README.md +7 -0
- package/dist/runtime/modules/rendering/RendererProbe.js +153 -0
- package/dist/runtime/modules/rendering/WebGpuPostFxPipeline.js +140 -0
- package/dist/runtime/modules/rendering/captureStill.js +54 -0
- package/dist/runtime/modules/rendering/createRenderer.js +76 -0
- package/dist/runtime/modules/rendering/disposeObject3D.js +37 -0
- package/dist/runtime/modules/rendering/loadGaussianSplatVisual.js +74 -0
- package/dist/runtime/modules/rendering/spatial/ThreeBvhRuntime.js +107 -0
- package/dist/runtime/modules/rendering/style/StylePack.js +34 -0
- package/dist/runtime/modules/rendering/style/StyleSystem.js +173 -0
- package/dist/runtime/modules/rendering/tasks.jsonl +7 -0
- package/dist/runtime/modules/world/README.md +13 -0
- package/dist/runtime/modules/world/build/WorldBuilder.js +170 -0
- package/dist/runtime/modules/world/compiler/PipelineEngine.js +32 -0
- package/dist/runtime/modules/world/compiler/WorldAdmission.js +43 -0
- package/dist/runtime/modules/world/compiler/WorldBehaviorCompiler.js +68 -0
- package/dist/runtime/modules/world/compiler/WorldCompilation.js +157 -0
- package/dist/runtime/modules/world/compiler/WorldComposer.js +201 -0
- package/dist/runtime/modules/world/compiler/WorldPhysicsAdmission.js +76 -0
- package/dist/runtime/modules/world/compiler/WorldRecompiler.js +356 -0
- package/dist/runtime/modules/world/compiler/WorldRetry.js +75 -0
- package/dist/runtime/modules/world/compiler/createWorldPipeline.js +379 -0
- package/dist/runtime/modules/world/content/blankWorld.js +35 -0
- package/dist/runtime/modules/world/content/environments.js +84 -0
- package/dist/runtime/modules/world/content/grandUrbanBlock.js +189 -0
- package/dist/runtime/modules/world/content/magic-cabin/README.md +28 -0
- package/dist/runtime/modules/world/content/magic-cabin/affordances.js +64 -0
- package/dist/runtime/modules/world/content/magic-cabin/cabinContents.js +7078 -0
- package/dist/runtime/modules/world/content/magic-cabin/lighting.js +26 -0
- package/dist/runtime/modules/world/content/magic-cabin/materials.js +20 -0
- package/dist/runtime/modules/world/content/magicCabin.js +190 -0
- package/dist/runtime/modules/world/content/monumentHall.js +154 -0
- package/dist/runtime/modules/world/content/ruinedCourtyard.js +196 -0
- package/dist/runtime/modules/world/content/suzhouGarden/README.md +141 -0
- package/dist/runtime/modules/world/content/suzhouGarden/index.js +137 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/arch.js +491 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/buildings.js +670 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/core.js +578 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/lod.js +127 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/main.js +642 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/nature.js +650 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/rockery.js +280 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/sky.js +242 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/water.js +215 -0
- package/dist/runtime/modules/world/content/woodlandWorkshop.js +192 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/README.md +36 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/arch.js +351 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/buildings.js +490 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/core.js +505 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/index.js +101 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/nature.js +435 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/sky.js +169 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/water.js +245 -0
- package/dist/runtime/modules/world/errors.js +9 -0
- package/dist/runtime/modules/world/generated/GeneratedWorldCoordinates.js +50 -0
- package/dist/runtime/modules/world/generated/GeneratedWorldLoader.js +297 -0
- package/dist/runtime/modules/world/runtime/CommandHistory.js +111 -0
- package/dist/runtime/modules/world/runtime/EntityCapabilityRegistry.js +165 -0
- package/dist/runtime/modules/world/runtime/NativeNavigationGeometry.js +84 -0
- package/dist/runtime/modules/world/runtime/NativePhysicsSnapshot.js +245 -0
- package/dist/runtime/modules/world/runtime/ObjectStore.js +31 -0
- package/dist/runtime/modules/world/runtime/ObjectTransform.js +62 -0
- package/dist/runtime/modules/world/runtime/ObservedEntity.js +37 -0
- package/dist/runtime/modules/world/runtime/ProjectCapabilities.js +240 -0
- package/dist/runtime/modules/world/runtime/SceneExtensions.js +36 -0
- package/dist/runtime/modules/world/runtime/ScenePresentation.js +101 -0
- package/dist/runtime/modules/world/runtime/SceneSerializer.js +281 -0
- package/dist/runtime/modules/world/runtime/WorldAuthority.js +41 -0
- package/dist/runtime/modules/world/runtime/WorldCollisionSignature.js +14 -0
- package/dist/runtime/modules/world/runtime/WorldCommands.js +503 -0
- package/dist/runtime/modules/world/runtime/WorldObservation.js +71 -0
- package/dist/runtime/modules/world/runtime/WorldQueries.js +340 -0
- package/dist/runtime/modules/world/runtime/WorldRecovery.js +78 -0
- package/dist/runtime/modules/world/runtime/WorldRuntime.js +806 -0
- package/dist/runtime/modules/world/runtime/affordance/ObjectAffordances.js +110 -0
- package/dist/runtime/modules/world/runtime/affordance/WorldAffordances.js +130 -0
- package/dist/runtime/modules/world/runtime/behavior/BehaviorCompiler.js +79 -0
- package/dist/runtime/modules/world/runtime/behavior/ProjectStateMachine.js +195 -0
- package/dist/runtime/modules/world/runtime/behavior/RuleGraph.js +70 -0
- package/dist/runtime/modules/world/runtime/behavior/RuleRuntime.js +115 -0
- package/dist/runtime/modules/world/runtime/graph/SceneGraph.js +390 -0
- package/dist/runtime/modules/world/runtime/interaction/ArticulationRuntime.js +214 -0
- package/dist/runtime/modules/world/runtime/interaction/CarryCapability.js +65 -0
- package/dist/runtime/modules/world/runtime/interaction/CarryRuntime.js +244 -0
- package/dist/runtime/modules/world/runtime/interaction/InteractionApproach.js +147 -0
- package/dist/runtime/modules/world/runtime/interaction/InteractionContract.js +57 -0
- package/dist/runtime/modules/world/runtime/interaction/ManipulationActions.js +7 -0
- package/dist/runtime/modules/world/runtime/interaction/NativePhysicalTarget.js +31 -0
- package/dist/runtime/modules/world/runtime/interaction/RecoveryRuntime.js +123 -0
- package/dist/runtime/modules/world/runtime/interaction/SettleRuntime.js +134 -0
- package/dist/runtime/modules/world/runtime/semantic/NativePhysicsState.js +89 -0
- package/dist/runtime/modules/world/runtime/semantic/SemanticWorldView.js +129 -0
- package/dist/runtime/modules/world/runtime/simulation/SimulationClock.js +89 -0
- package/dist/runtime/modules/world/runtime/simulation/SimulationSession.js +104 -0
- package/dist/runtime/modules/world/runtime/simulation/ThermalSystem.js +269 -0
- package/dist/runtime/modules/world/runtime/simulation/WorldTimeline.js +110 -0
- package/dist/runtime/modules/world/runtime/spatial/SpatialSnapshot.js +56 -0
- package/dist/runtime/modules/world/runtime/spatial/VisualMeshBounds.js +41 -0
- package/dist/runtime/modules/world/runtime/systems/AudioSystem.js +306 -0
- package/dist/runtime/modules/world/runtime/systems/Instrument.js +39 -0
- package/dist/runtime/modules/world/runtime/systems/InteractionSystem.js +806 -0
- package/dist/runtime/modules/world/runtime/systems/LocomotionSystem.js +281 -0
- package/dist/runtime/modules/world/runtime/systems/NavigationSystem.js +561 -0
- package/dist/runtime/modules/world/runtime/systems/PhysicsSystem.js +1752 -0
- package/dist/runtime/modules/world/runtime/systems/RenderingSystem.js +527 -0
- package/dist/runtime/modules/world/runtime/systems/SpatialSystem.js +402 -0
- package/dist/runtime/modules/world/spec/WorldIR.js +165 -0
- package/dist/runtime/modules/world/spec/WorldIRToolSchema.js +86 -0
- package/dist/runtime/modules/world/spec/WorldPlannerProposal.js +51 -0
- package/dist/runtime/modules/world/spec/WorldRevision.js +231 -0
- package/dist/runtime/modules/world/spec/WorldSpec.js +86 -0
- package/dist/runtime/modules/world/tasks.jsonl +530 -0
- package/dist/runtime/modules/world/verification/ArticulationVerifier.js +254 -0
- package/dist/runtime/modules/world/verification/Finding.js +105 -0
- package/dist/runtime/modules/world/verification/InteractionEvidence.js +73 -0
- package/dist/runtime/modules/world/verification/RepairEngine.js +49 -0
- package/dist/runtime/modules/world/verification/VisualLayoutAcceptance.js +58 -0
- package/dist/runtime/modules/world/verification/WorldAcceptance.js +176 -0
- package/dist/runtime/modules/world/verification/WorldValidator.js +67 -0
- package/dist/runtime/package-lock.json +16071 -0
- package/dist/runtime/package.json +106 -0
- package/dist/runtime/public/assets/cabinet.glb +0 -0
- package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_nor_gl_1k.jpg +0 -0
- package/dist/runtime/public/assets/grand-urban-block/concrete_pavement_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/grand-urban-block/urban_street_01_1k.hdr +0 -0
- package/dist/runtime/public/assets/monument-hall/marble_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/monument-hall/marble_nor_gl_1k.jpg +0 -0
- package/dist/runtime/public/assets/monument-hall/marble_rough_1k.jpg +0 -0
- package/dist/runtime/public/assets/monument-hall/solitude_interior_1k.hdr +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/courtyard_1k.hdr +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_nor_gl_1k.jpg +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/mossy_sandstone_diff_1k.jpg +0 -0
- package/dist/schema-DT7K9NjP.js +165 -0
- package/dist/schema-DT7K9NjP.js.map +1 -0
- package/dist/suzhouGarden-Y3hny8j6.js +6150 -0
- package/dist/suzhouGarden-Y3hny8j6.js.map +1 -0
- package/dist/version-CHc-i8ch.js +5 -0
- package/dist/version-CHc-i8ch.js.map +1 -0
- package/dist/woodlandWorkshop-DsScU-cx.js +483 -0
- package/dist/woodlandWorkshop-DsScU-cx.js.map +1 -0
- package/dist/yuanmingyuan-DsFnPzzR.js +4955 -0
- package/dist/yuanmingyuan-DsFnPzzR.js.map +1 -0
- package/package.json +75 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SceneSerializer-zOzbX4jZ.js","names":["z","z","clone"],"sources":["../../../modules/world/runtime/SceneExtensions.js","../../../modules/world/runtime/simulation/WorldTimeline.js","../../../modules/world/runtime/behavior/RuleGraph.js","../../../modules/world/runtime/WorldAuthority.js","../../../modules/world/runtime/NativePhysicsSnapshot.js","../../../modules/world/runtime/SceneSerializer.js"],"sourcesContent":["import { z } from 'zod';\n\nconst volume = z.number().min(0).max(1);\nconst mix = z.object({music:volume.optional(),ambience:volume.optional(),sfx:volume.optional(),voice:volume.optional()}).strict();\nconst envelope = z.object({version:z.number().int().positive(),required:z.boolean(),state:z.json()}).passthrough();\nconst extensionMap = z.record(z.string().min(1),envelope);\n\nexport function validateSceneExtensions(input,runtime) {\n if (input === undefined) return;\n const extensions = extensionMap.parse(input);\n for (const [id,entry] of Object.entries(extensions)) {\n if (id==='agentscape.audio' && entry.version===1) {\n mix.parse(entry.state);\n if (runtime && entry.required && !runtime.audio) throw new Error('Required audio output unavailable');\n }\n else if (entry.required || id==='agentscape.audio') throw new Error('Unsupported scene extension: '+id+' v'+entry.version);\n }\n}\n\nexport function captureSceneExtensions(runtime) {\n const extensions=structuredClone(runtime.preservedSceneExtensions ?? {});\n if (runtime.audio) {\n const state=runtime.audio.snapshotMix();\n if (Object.keys(state).length || extensions['agentscape.audio']) {\n extensions['agentscape.audio']={...extensions['agentscape.audio'],version:1,required:extensions['agentscape.audio']?.required ?? false,state};\n }\n }\n return Object.keys(extensions).length ? {extensions} : {};\n}\n\nexport function restoreSceneExtensions(runtime,extensions) {\n const audio=extensions?.['agentscape.audio'];\n if (audio?.required && !runtime.audio) throw new Error('Required audio output unavailable');\n runtime.audio?.restoreMix(audio?.state ?? {});\n runtime.preservedSceneExtensions=structuredClone(extensions ?? {});\n}\n","import { z } from 'zod';\nimport { Vector3, Quaternion } from 'three';\n\nconst positiveTicks=z.number().int().positive().max(Number.MAX_SAFE_INTEGER);\nconst environment=z.object({weather:z.enum(['clear','rain','snow']),daylight:z.number().min(0).max(1)});\nconst sound=z.object({kind:z.literal('sound'),source:z.string().min(1).max(256),category:z.string().min(1).max(256),\n radius:z.number().positive(),ticks:positiveTicks});\nconst cueSchema=z.discriminatedUnion('kind',[sound,environment.extend({kind:z.literal('environment')})]);\nexport const timelineSnapshotSchema=z.object({\n version:z.literal(1),environment,cues:z.array(z.object({after:positiveTicks,cue:cueSchema})).max(4096),\n sounds:z.array(z.object({remaining:positiveTicks,cue:sound})).max(256)\n});\n\n/** Simulation cues and sensory observations scoped to one simulation session. */\nexport class WorldTimeline {\n constructor(world) {\n this.world = world;\n this.reset();\n }\n\n reset() {\n this.cues = [];\n this.sounds = [];\n this.environment = {weather:'clear', daylight:1};\n }\n\n schedule(tick, cue) {\n if (!Number.isSafeInteger(tick) || tick <= this.world.simulation.tick) throw new RangeError('Expected a future simulation tick');\n if (this.cues.length >= 4096) throw new RangeError('Timeline cue limit exceeded');\n const entry = {tick,cue:cueSchema.parse(cue)};\n this.cues.push(entry);\n this.cues.sort((a,b)=>a.tick-b.tick);\n return () => {\n const index = this.cues.indexOf(entry);\n if (index >= 0) this.cues.splice(index,1);\n };\n }\n\n snapshot() {\n const now=this.world.simulation.tick;\n return {version:1,environment:{...this.environment},\n cues:this.cues.map(({tick,cue})=>({after:tick-now,cue:{...cue}})),\n sounds:this.sounds.filter(s=>s.until>now && this.object(s.source)===s.object)\n .map(({object,until,...cue})=>({remaining:until-now,cue}))};\n }\n\n rebase(delta) {\n for (const entry of this.cues) entry.tick+=delta;\n for (const sound of this.sounds) sound.until+=delta;\n }\n\n restore(saved) {\n const state=saved && timelineSnapshotSchema.parse(saved);\n this.reset();\n if (!state) return;\n const now=this.world.simulation.tick;\n this.environment=state.environment;\n for (const {after,cue} of state.cues) this.schedule(now+after,cue);\n for (const {remaining,cue} of state.sounds) {\n const object=this.object(cue.source);\n if (object) this.sounds.push({...cue,object,until:now+remaining});\n }\n }\n\n object(id) {\n if (this.world.store.has(id)) {\n const record = this.world.store.get(id);\n if (record.active === false) return null;\n }\n return this.world.entities.get(id)?.object;\n }\n\n advance(tick) {\n if (this.sounds.length) this.sounds = this.sounds.filter(sound=>sound.until>tick);\n if (!this.cues.length || this.cues[0].tick>tick) return;\n const due=[];\n while (this.cues.length && this.cues[0].tick<=tick) due.push(this.cues.shift());\n for (const {cue} of due) {\n if (cue.kind==='environment') {\n this.environment={weather:cue.weather,daylight:cue.daylight};\n } else {\n const object=this.object(cue.source);\n if (!object) continue;\n if (this.sounds.length===256) this.sounds.shift();\n this.sounds.push({...cue,object,until:tick+cue.ticks});\n }\n this.world.events.emit('timeline.'+cue.kind,{...cue,tick},{isolateListeners:true});\n }\n }\n\n observeSounds(observerId) {\n const observer=this.object(observerId);\n if (!observer) throw new Error('Missing sound observer');\n const origin=observer.getWorldPosition(new Vector3());\n const inverse=observer.getWorldQuaternion(new Quaternion()).invert();\n const result=[];\n for (const sound of this.sounds) {\n if (this.object(sound.source)!==sound.object) continue;\n const delta=sound.object.getWorldPosition(new Vector3()).sub(origin);\n const distance=delta.length();\n if (distance>=sound.radius) continue;\n const target=sound.object.getWorldPosition(new Vector3());\n const hit=this.world.physics?.raycast?.(origin.toArray(),target.toArray(),{excludeIds:[observerId,sound.source]});\n const occluded=Boolean(hit && hit.distance < distance-1e-5);\n result.push({occluded,source:sound.source,category:sound.category,distance,\n direction:delta.normalize().applyQuaternion(inverse).toArray(),audibility:(1-distance/sound.radius)*(occluded ? 0.35 : 1)});\n }\n return result;\n }\n}\n","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);\n\nexport function captureWorldAuthority(runtime) {\n return {\n currentWorldRevision:clone(runtime.currentWorldRevision) || null,\n currentBehaviorBundle:clone(runtime.currentBehaviorBundle) || null,\n currentPhysicsRequirements:clone(runtime.currentPhysicsRequirements) || null,\n lastAcceptanceBundle:clone(runtime.lastAcceptanceBundle) || null,\n restoredAcceptanceEvidence:clone(runtime.restoredAcceptanceEvidence) || null,\n interactionEvidence:runtime.interactionEvidence instanceof Map\n ? [...runtime.interactionEvidence.entries()].map(([key,value]) => [key,clone(value)])\n : null\n };\n}\n\nexport function restoreWorldAuthority(runtime, authority = {}) {\n runtime.currentWorldRevision = clone(authority.currentWorldRevision) || null;\n runtime.currentBehaviorBundle = clone(authority.currentBehaviorBundle) || null;\n runtime.currentPhysicsRequirements = clone(authority.currentPhysicsRequirements) || null;\n runtime.lastAcceptanceBundle = clone(authority.lastAcceptanceBundle) || null;\n runtime.restoredAcceptanceEvidence = clone(authority.restoredAcceptanceEvidence) || null;\n if (authority.interactionEvidence === null) delete runtime.interactionEvidence;\n else runtime.interactionEvidence = new Map((authority.interactionEvidence || []).map(([key,value]) => [key,clone(value)]));\n runtime.loadRuleGraph?.(authority.currentBehaviorBundle?.ruleGraph || []);\n}\n\nexport function commitWorldAuthority(runtime, {\n worldIR,\n behaviorBundle,\n physicsRequirements,\n acceptanceBundle = null\n} = {}) {\n runtime.currentWorldRevision = worldIR\n ? { revision:clone(worldIR.revision), provenance:clone(worldIR.provenance) }\n : null;\n runtime.currentBehaviorBundle = clone(behaviorBundle) || null;\n runtime.currentPhysicsRequirements = clone(physicsRequirements) || null;\n runtime.lastAcceptanceBundle = clone(acceptanceBundle) || null;\n runtime.restoredAcceptanceEvidence = null;\n runtime.loadRuleGraph?.(behaviorBundle?.ruleGraph || []);\n}\n","import * as THREE from 'three';\nimport * as z from 'zod/v4';\nimport { inferCarryCapability } from './interaction/CarryCapability.js';\n\nconst fail=code=>Object.assign(new Error(code),{code});\nconst id=z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/);\nconst number=z.number().finite().min(-1e6).max(1e6);\nconst vec3=z.tuple([number,number,number]);\nconst quaternion=z.tuple([number,number,number,number]).refine(q=>Math.abs(Math.hypot(...q)-1)<.001);\nconst pose=z.object({position:vec3,rotation:quaternion}).strict();\nconst motion=z.object({linearVelocity:vec3,angularVelocity:vec3,sleeping:z.boolean()}).strict();\nconst held=z.object({kind:z.literal('agent'),id,anchor:z.literal('hold')}).strict();\nconst partSnapshot=z.object({name:id,pose,motion,motorTarget:number.nullable()}).strict();\nconst base={id,signature:z.string().regex(/^[a-f0-9]{64}$/),bindingId:z.string().uuid().optional()};\nconst record=z.discriminatedUnion('body',[\n z.object({...base,body:z.literal('kinematic')}).strict(),\n z.object({...base,body:z.literal('fixed'),pose,parts:z.array(partSnapshot).min(1).max(16).optional()}).strict(),\n z.object({...base,body:z.literal('dynamic'),pose,motion,heldBy:held.nullable()}).strict()\n]);\nconst schema=z.object({schema:z.literal('agentscape.native-physics-state'),schemaVersion:z.literal(1),\n bodies:z.array(record).max(1024)}).strict();\n\nexport function nativePhysicsBindings(runtime){\n const bindings=new Map();\n for(const item of runtime.entities?.list?.({source:'native',capability:'physics'})||[]){\n const entity=runtime.entities.get(item.id);\n const spec=entity.manifest?.physics;\n let mounted=false;\n for(let node=entity.object;node;node=node.parent)if(node.uuid===entity.metadata.hostSceneUuid){mounted=true;break;}\n if(!mounted||!spec||!entity.metadata.physicsSignature||!entity.metadata.bindingId)throw fail('NATIVE_PHYSICS_BINDING_INVALID');\n bindings.set(entity.id,entity);\n }\n return bindings;\n}\n\n/** Portable snapshots identify the source-declared body; history additionally pins the live registration. */\nexport function captureNativePhysics(runtime,{identity=false}={}){\n const bindings=nativePhysicsBindings(runtime);\n if(!bindings.size)return undefined;\n const bodies=[];\n for(const [id,entity] of [...bindings].sort(([a],[b])=>a.localeCompare(b,'en'))){\n const spec=entity.manifest.physics,entry=runtime.physics.entries.get(id);\n if(entity.manifest.nativeArticulation)linkNodes(entity);\n if(!entry?.body||entry.root!==entity.object||entry.parts.size!==Object.keys(entity.manifest.parts||{}).length)throw fail('NATIVE_PHYSICS_BODY_UNAVAILABLE');\n const body=spec.body;\n const row={id,signature:entity.metadata.physicsSignature,body,...(identity?{bindingId:entity.metadata.bindingId}:{})};\n const heldBy=entity.state?.heldBy||null;\n const actual=runtime.physics.backend.bodyType(entry.body);\n if(actual!==(heldBy?'kinematic':body)||Boolean(entry.held)!==Boolean(heldBy))throw fail('NATIVE_PHYSICS_OWNERSHIP_MISMATCH');\n if(body!=='kinematic')row.pose=runtime.physics.backend.bodyPose(entry.body);\n if(body==='dynamic'){\n const {linearVelocity,angularVelocity,sleeping}=runtime.physics.getMotion(id);\n row.motion={linearVelocity:heldBy?[0,0,0]:linearVelocity,angularVelocity:heldBy?[0,0,0]:angularVelocity,sleeping:heldBy?false:sleeping};\n row.heldBy=heldBy?structuredClone(heldBy):null;\n }\n if(entry.parts.size)row.parts=[...entry.parts].map(([name,part])=>{\n if(runtime.physics.backend.bodyType(part.body)!=='dynamic')throw fail('NATIVE_ARTICULATION_BODY_INVALID');\n const {linearVelocity,angularVelocity,sleeping}=runtime.physics.backend.bodyMotion(part.body);\n return {name,pose:runtime.physics.backend.bodyPose(part.body),motion:{linearVelocity,angularVelocity,sleeping},motorTarget:part.motorTarget??null};\n });\n bodies.push(row);\n }\n return validateNativePhysics({schema:'agentscape.native-physics-state',schemaVersion:1,bodies});\n}\n\nexport function validateNativePhysics(input,objects=null){\n const result=schema.safeParse(input);\n if(!result.success)throw fail('NATIVE_PHYSICS_SNAPSHOT_INVALID');\n const snapshot=result.data,ids=new Set(),owners=new Set();\n const managed=objects&&new Map(objects.map(object=>[object.id,object]));\n if(objects)for(const object of objects)if(object.state?.heldBy?.kind==='agent')owners.add(object.state.heldBy.id);\n if(snapshot.bodies.reduce((n,row)=>n+1+(row.parts?.length||0),0)>1024)throw fail('NATIVE_PHYSICS_SNAPSHOT_LIMIT');\n for(const row of snapshot.bodies){\n if(row.parts&&new Set(row.parts.map(p=>p.name)).size!==row.parts.length)throw fail('NATIVE_ARTICULATION_SNAPSHOT_INVALID');\n if(ids.has(row.id)||managed?.has(row.id))throw fail('NATIVE_PHYSICS_ID_CONFLICT');\n ids.add(row.id);\n if(row.heldBy){\n const owner=row.heldBy.id;\n if(owners.has(owner)||(managed&&(!managed.has(owner)||managed.get(owner).active===false)))throw fail('NATIVE_PHYSICS_HELD_OWNER_INVALID');\n if(row.motion.sleeping||[...row.motion.linearVelocity,...row.motion.angularVelocity].some(n=>n!==0))throw fail('NATIVE_PHYSICS_HELD_MOTION_INVALID');\n owners.add(owner);\n }\n }\n return snapshot;\n}\n\n/** Preflight before resetting a solver or replacing any managed entity. No body definitions are trusted from a save. */\nexport function prepareNativePhysics(runtime,input,objects=null,{compatible=false}={}){\n const snapshot=validateNativePhysics(input,objects),bindings=nativePhysicsBindings(runtime),selected=[],skipped=[];\n const matches=row=>{\n const entity=bindings.get(row.id);\n return entity&&entity.metadata.physicsSignature===row.signature&&entity.manifest.physics.body===row.body&&\n (!row.bindingId||entity.metadata.bindingId===row.bindingId);\n };\n for(const row of snapshot.bodies){\n if(!matches(row)){\n if(!compatible||row.heldBy)throw fail('NATIVE_PHYSICS_BINDING_MISMATCH');\n skipped.push({id:row.id,reason:'BINDING_CHANGED_OR_MISSING'});continue;\n }\n if(row.heldBy&&(bindings.get(row.id).manifest.physics.carryable!==true||!inferCarryCapability(bindings.get(row.id).manifest).eligible))throw fail('NATIVE_PHYSICS_HELD_BODY_INVALID');\n validateArticulationSnapshot(bindings.get(row.id),row);\n selected.push(row);\n }\n const selectedIds=new Set(selected.map(row=>row.id));\n for(const id of bindings.keys())if(!selectedIds.has(id)){\n if(!compatible)throw fail('NATIVE_PHYSICS_BINDING_MISMATCH');\n if(!skipped.some(row=>row.id===id))skipped.push({id,reason:'NEW_BINDING'});\n }\n return {snapshot:{...snapshot,bodies:selected},bindings,skipped};\n}\n\nfunction linkNodes(entity){\n const definitions=entity.manifest.parts||{},nodes=new Map();\n if(!Object.keys(definitions).length)return nodes;\n const names=new Set(Object.values(definitions).map(part=>part.node)),byName=new Map();\n let count=0;\n entity.object.traverse(node=>{\n if(++count>8192)throw fail('NATIVE_ARTICULATION_NODE_LIMIT');\n if(!names.has(node.name))return;\n if(node===entity.object||byName.has(node.name))throw fail('NATIVE_ARTICULATION_LINK_HIERARCHY_INVALID');\n byName.set(node.name,node);\n });\n for(const [id,part] of Object.entries(definitions)){\n const node=byName.get(part.node);\n const parent=part.parent==='$root'?entity.object:byName.get(definitions[part.parent]?.node);\n if(!node||!parent||node.uuid!==entity.metadata.articulationNodeUuids?.[id]||node.parent!==parent||!node.matrixAutoUpdate||\n node.scale.toArray().some(n=>!Number.isFinite(n)||Math.abs(n-1)>1e-6))throw fail('NATIVE_ARTICULATION_LINK_HIERARCHY_INVALID');\n nodes.set(id,node);\n }\n return nodes;\n}\n\nfunction relativePose(parent,child){\n const inverse=new THREE.Quaternion(...parent.rotation).invert();\n return {position:new THREE.Vector3(...child.position).sub(new THREE.Vector3(...parent.position)).applyQuaternion(inverse).toArray(),\n rotation:inverse.multiply(new THREE.Quaternion(...child.rotation)).normalize().toArray()};\n}\n\nfunction validateArticulationSnapshot(entity,row){\n const definitions=entity.manifest.parts||{},expected=Object.keys(definitions),parts=row.parts||[];\n if(parts.length!==expected.length||parts.some(p=>!Object.hasOwn(definitions,p.name)))\n throw fail('NATIVE_ARTICULATION_SNAPSHOT_MISMATCH');\n if(!parts.length)return;\n linkNodes(entity);\n const poses=new Map(parts.map(p=>[p.name,p.pose]));poses.set('$root',row.pose);\n for(const part of parts){\n const definition=definitions[part.name],joint=definition.joint,rest=entity.metadata.articulationRest[part.name];\n const local=relativePose(poses.get(definition.parent),part.pose);\n const axis=new THREE.Vector3(...joint.axis),rotation=new THREE.Quaternion(...local.rotation);\n const delta=rotation.clone().multiply(new THREE.Quaternion(...rest.rotation).invert()).normalize();\n const displacement=new THREE.Vector3(...local.position).sub(new THREE.Vector3(...rest.position));\n const coordinate=joint.type==='prismatic'?displacement.dot(axis):\n Math.atan2(Math.sin(2*Math.atan2(delta.x*axis.x+delta.y*axis.y+delta.z*axis.z,delta.w)),\n Math.cos(2*Math.atan2(delta.x*axis.x+delta.y*axis.y+delta.z*axis.z,delta.w)));\n const expectedRotation=joint.type==='prismatic'?new THREE.Quaternion(...rest.rotation):\n new THREE.Quaternion().setFromAxisAngle(axis,coordinate).multiply(new THREE.Quaternion(...rest.rotation));\n const anchorError=new THREE.Vector3(...local.position).add(new THREE.Vector3(...joint.childAnchor).applyQuaternion(rotation))\n .sub(new THREE.Vector3(...joint.parentAnchor));\n if(joint.type==='prismatic')anchorError.addScaledVector(axis,-coordinate);\n const tolerance=joint.type==='prismatic'?.03:.08;\n if(!Number.isFinite(coordinate)||coordinate<joint.limits[0]-tolerance||coordinate>joint.limits[1]+tolerance||\n anchorError.length()>.06||rotation.angleTo(expectedRotation)>.1||\n (part.motorTarget!==null&&(part.motorTarget<joint.limits[0]||part.motorTarget>joint.limits[1])))\n throw fail('NATIVE_ARTICULATION_SNAPSHOT_POSE_INVALID');\n }\n}\n\nfunction localPose(entity,worldPose){\n const object=entity.object,parent=object.parent;\n const position=new THREE.Vector3(...worldPose.position),rotation=new THREE.Quaternion(...worldPose.rotation);\n if(parent){\n parent.updateWorldMatrix(true,false);\n const p=new THREE.Vector3(),q=new THREE.Quaternion(),s=new THREE.Vector3();\n parent.matrixWorld.decompose(p,q,s);\n if(s.toArray().some(value=>Math.abs(value-1)>1e-6)||\n parent.matrixWorld.elements.some((value,index)=>Math.abs(value-new THREE.Matrix4().compose(p,q,s).elements[index])>1e-6))\n throw fail('NATIVE_PHYSICS_PARENT_TRANSFORM_INVALID');\n parent.worldToLocal(position);rotation.premultiply(q.invert()).normalize();\n }\n return {position:position.toArray(),rotation:rotation.toArray()};\n}\n\n/** Called after managed agents and their held ownership have been restored. Native objects are never recreated. */\nexport function applyNativePhysics(runtime,prepared){\n const {snapshot,bindings}=prepared;\n const carry=runtime.interactions?.carry;\n for(const entity of bindings.values()){\n if(entity.state?.heldBy)carry.releaseHeld(entity.id,'NATIVE_PHYSICS_RESTORE',{silent:true});\n const entry=runtime.physics.entries.get(entity.id);\n if(!entry){\n // Recreate joints at the authored rest frame, never at a previously moved pose.\n for(const [name,node] of linkNodes(entity)){\n const rest=entity.metadata.articulationRest[name];\n node.position.fromArray(rest.position);node.quaternion.fromArray(rest.rotation);\n }\n entity.object.updateMatrixWorld(true);\n runtime.physics.addObject(entity.id,entity.manifest,entity.object);\n }\n else if(entry.root!==entity.object)throw fail('NATIVE_PHYSICS_BODY_CONFLICT');\n if(entity.manifest.physics.body==='kinematic'){\n // Source restore() can update host-owned kinematic objects after setup.\n // Synchronize immediately without treating their visual state as solver-owned.\n const body=runtime.physics.entries.get(entity.id).body;\n const pose={position:entity.object.getWorldPosition(new THREE.Vector3()).toArray(),\n rotation:entity.object.getWorldQuaternion(new THREE.Quaternion()).toArray()};\n runtime.physics.backend.setBodyPose(body,{...pose,wake:false});\n runtime.physics.backend.setBodyPose(body,{...pose,next:true,wake:false});\n }\n }\n // First restore all solver-owned bodies; then validate and rebuild anchor ownership.\n const checkpoints=[];\n for(const row of snapshot.bodies){\n if(row.body==='kinematic')continue; // Host code, not the serializer, owns this transform.\n const entity=bindings.get(row.id),heldBy=row.heldBy||null;\n const root={...localPose(entity,row.pose),type:heldBy?'kinematic':row.body,pose:row.pose,\n ...(row.motion?{motion:row.motion}:{}),...(heldBy?{nextPose:row.pose}:{})};\n const savedParts=new Map((row.parts||[]).map(part=>[part.name,part]));\n const poses=new Map((row.parts||[]).map(part=>[part.name,part.pose]));poses.set('$root',row.pose);\n const entry=runtime.physics.entries.get(row.id);\n const parts=[...entry.parts].map(([name,part])=>{\n const saved=savedParts.get(name);\n if(!saved)throw fail('NATIVE_ARTICULATION_SNAPSHOT_MISMATCH');\n return {name,...relativePose(poses.get(part.parentName),saved.pose),type:'dynamic',pose:saved.pose,motion:saved.motion,motorTarget:saved.motorTarget};\n });\n checkpoints.push({id:row.id,root,parts,held:Boolean(heldBy),heldOriginalType:heldBy?'dynamic':null});\n }\n runtime.physics.restoreState(checkpoints);\n runtime.physics.backend.syncSceneQueries(runtime.physics.world);\n for(const row of snapshot.bodies){\n if(!row.heldBy)continue;\n const {id:actor}=row.heldBy,entity=bindings.get(row.id);\n const owner=runtime.store.has(actor)?runtime.store.get(actor):null;\n if(!carry||!owner||owner.active===false||owner.manifest.type!=='agent'||carry.heldByAgent(actor))throw fail('NATIVE_PHYSICS_HELD_OWNER_INVALID');\n const anchor=runtime.physics.anchorPose(actor,carry.holdAnchor(actor));\n const positionError=anchor?Math.hypot(...row.pose.position.map((n,i)=>n-anchor.position[i])):Infinity;\n const angleError=anchor?new THREE.Quaternion(...row.pose.rotation).angleTo(new THREE.Quaternion(...anchor.rotation)):Infinity;\n if(positionError>.15||angleError>.2||!runtime.physics.checkBodyPose(row.id,row.pose.position,row.pose.rotation,{excludeIds:[actor]}).clear)\n throw fail('NATIVE_PHYSICS_HELD_POSE_INVALID');\n entity.state.heldBy=structuredClone(row.heldBy);\n carry.agentHeld.set(actor,row.id);\n runtime.physics.setHeldTarget(row.id,anchor.position,anchor.rotation);\n }\n runtime.navigation?.invalidate?.('native-physics-restored');\n return {restored:snapshot.bodies.length,skipped:prepared.skipped};\n}\n","import { validateSceneExtensions, captureSceneExtensions, restoreSceneExtensions } from './SceneExtensions.js';\nimport { timelineSnapshotSchema } from './simulation/WorldTimeline.js';\nimport { parseScenePresentation } from './ScenePresentation.js';\nimport { uniformScaleValue } from './ObjectTransform.js';\nimport { thermalStateSchema,validateThermalStateForProfile } from '../../../foundation/simulation/SimulationProfile.js';\nimport { compileRuleGraph } from './behavior/RuleGraph.js';\nimport { captureWorldAuthority, restoreWorldAuthority } from './WorldAuthority.js';\nimport { captureNativePhysics,validateNativePhysics,prepareNativePhysics,applyNativePhysics } from './NativePhysicsSnapshot.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, nativeIdentity=false } = {}) {\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 nativePhysics=captureNativePhysics(runtime,{identity:nativeIdentity});\n const cameraState=runtime.rendering?.cameraState?.() || null;\n const presentation=runtime.presentation?.snapshot() || null;\n const stylePack=runtime.rendering?.serializeStyle?.() ?? runtime.styleSystem?.export() ?? 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 ...captureSceneExtensions(runtime),\n assets,\n objects,\n ...(nativePhysics?{nativePhysics}:{}),\n configuration: {\n ...(runtime.timeline ? {timeline:runtime.timeline.snapshot()} : {}),\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 ...(presentation?{presentation}:{})\n };\n }\n\n validate(scene,runtime) {\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 validateSceneExtensions(scene.extensions,runtime);\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.configuration?.timeline != null) timelineSnapshotSchema.parse(scene.configuration.timeline);\n if (scene.presentation != null) parseScenePresentation(scene.presentation);\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 if(scene.nativePhysics!=null)validateNativePhysics(scene.nativePhysics,scene.objects);\n return scene;\n }\n\n async restore(runtime, input, physics) {\n const scene = this.validate(clone(input),runtime);\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 const incoming = new Map();\n for (const manifest of scene.assets) {\n if (incoming.has(manifest.id)) throw new Error('Duplicate scene asset: ' + manifest.id);\n runtime.assetModule.assertCompatibleManifest(manifest);\n incoming.set(manifest.id, manifest);\n }\n for (const item of scene.objects) {\n if (!incoming.has(item.assetId) && !runtime.assetModule.hasAsset(item.assetId)) throw new Error(`Scene references unknown asset: ${item.assetId}`);\n if(item.simulation){\n const profile=(incoming.get(item.assetId) ?? 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 // Legacy snapshots preserve existing native bindings rather than dropping them.\n const nativePhysics=scene.nativePhysics??captureNativePhysics(runtime,{identity:true});\n if(nativePhysics){prepareNativePhysics(runtime,nativePhysics,scene.objects);scene.nativePhysics=nativePhysics;}\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 const added = [];\n try {\n for (const manifest of scene.assets) {\n if (!runtime.assetModule.hasAsset(manifest.id) && runtime.assetModule.registry.registerManifest(manifest)) added.push(manifest.id);\n }\n const applied = await this.applyScene(runtime, scene);\n if (physics) { runtime.physics.restoreState(physics); runtime.sceneGraph?.invalidate(); }\n runtime.projectCapabilities?.rebindAttachments?.(attachments);\n return applied;\n } catch (error) {\n for (const id of added) runtime.assetModule.registry.removeManifest(id);\n if (!previous) throw 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 runtime.quarantine?.(failure.code);\n failure.rollbackError = rollbackError;\n throw failure;\n }\n throw error;\n }\n }\n\n // 破坏性应用。调用方必须保证 scene 已经 validate 并通过全部预检。\n async applyScene(runtime, scene) {\n const nativePhysics=scene.nativePhysics??captureNativePhysics(runtime,{identity:true});\n const preparedNative=nativePhysics?prepareNativePhysics(runtime,nativePhysics,scene.objects):null;\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 runtime.restoreObjectState(item.id, clone(item.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 if(preparedNative)applyNativePhysics(runtime,preparedNative);\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 runtime.presentation?.replace(scene.presentation??{});\n const style=scene.metadata?.stylePack ?? null;\n if(runtime.rendering?.restoreStyle) await runtime.rendering.restoreStyle(style);\n else if(runtime.styleSystem){\n if(style) await runtime.styleSystem.set(style);\n else runtime.styleSystem.clear();\n }\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 restoreSceneExtensions(runtime,scene.extensions);\n runtime.timeline?.restore(scene.configuration?.timeline);\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":";;;;;;;;;AAEA,MAAM,SAASA,IAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACtC,MAAM,MAAMA,IAAE,OAAO;CAAC,OAAM,OAAO,SAAS;CAAE,UAAS,OAAO,SAAS;CAAE,KAAI,OAAO,SAAS;CAAE,OAAM,OAAO,SAAS;AAAC,CAAC,CAAC,CAAC,OAAO;AAChI,MAAM,WAAWA,IAAE,OAAO;CAAC,SAAQA,IAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;CAAE,UAASA,IAAE,QAAQ;CAAE,OAAMA,IAAE,KAAK;AAAC,CAAC,CAAC,CAAC,YAAY;AACjH,MAAM,eAAeA,IAAE,OAAOA,IAAE,OAAO,CAAC,CAAC,IAAI,CAAC,GAAE,QAAQ;AAExD,SAAgB,wBAAwB,OAAM,SAAS;CACrD,IAAI,UAAU,KAAA,GAAW;CACzB,MAAM,aAAa,aAAa,MAAM,KAAK;CAC3C,KAAK,MAAM,CAAC,IAAG,UAAU,OAAO,QAAQ,UAAU,GAChD,IAAI,OAAK,sBAAsB,MAAM,YAAU,GAAG;EAChD,IAAI,MAAM,MAAM,KAAK;EACrB,IAAI,WAAW,MAAM,YAAY,CAAC,QAAQ,OAAO,MAAM,IAAI,MAAM,mCAAmC;CACtG,OACK,IAAI,MAAM,YAAY,OAAK,oBAAoB,MAAM,IAAI,MAAM,kCAAgC,KAAG,OAAK,MAAM,OAAO;AAE7H;AAEA,SAAgB,uBAAuB,SAAS;CAC9C,MAAM,aAAW,gBAAgB,QAAQ,4BAA4B,CAAC,CAAC;CACvE,IAAI,QAAQ,OAAO;EACjB,MAAM,QAAM,QAAQ,MAAM,YA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,IAAG,QAAQ,WAAW,cAAc,MAAM,QAAQ,UAAU,aAAa,KAAK;OACzE,IAAG,QAAQ,aAAY;GAC1B,IAAG,OAAO,MAAM,QAAQ,YAAY,IAAI,KAAK;QACxC,QAAQ,YAAY,MAAM;EACjC;EACA,QAAQ,uBAAqB,MAAM,UAAU,gBAAgB,MAAM,MAAM,SAAS,aAAa,IAAI;EACnG,QAAQ,6BAA2B,MAAM,cAAc,qBAAqB,MAAM,MAAM,aAAa,kBAAkB,IAAI;EAC3H,QAAQ,uBAAqB;EAC7B,QAAQ,wBAAsB,MAAM,eAAe,iBAAiB,MAAM,MAAM,cAAc,cAAc,IAAI;EAChH,QAAQ,6BAA2B,MAAM,eAAe,sBAAsB,MAAM,MAAM,cAAc,mBAAmB,IAAI;EAC/H,QAAQ,qBAAqB,QAAQ;EACrC,QAAQ,gBAAgB,QAAQ,uBAAuB,aAAa,CAAC,CAAC;EACtE,uBAAuB,SAAQ,MAAM,UAAU;EAC/C,QAAQ,UAAU,QAAQ,MAAM,eAAe,QAAQ;EACvD,QAAQ,OAAO,KAAK,kBAAkB;GAAE,SAAS,MAAM,QAAQ;GAAQ,iBAAgB,QAAQ,sBAAsB,UAAU,MAAM;GAAM,uBAAsB,QAAQ,QAAQ,0BAA0B;EAAE,CAAC;EAC9M,OAAO;CACT;AACF"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
// foundation/simulation/SimulationProfile.js
|
|
3
|
+
const positive = z.number().finite().positive().max(0xe8d4a51000);
|
|
4
|
+
const nonnegative = z.number().finite().min(0).max(0xe8d4a51000);
|
|
5
|
+
const temperature = z.number().finite().min(0).max(1e6);
|
|
6
|
+
const power = z.number().finite().min(-1e9).max(1e9);
|
|
7
|
+
const nodeId = z.string().regex(/^[A-Za-z][A-Za-z0-9_-]{0,63}$/);
|
|
8
|
+
const materialDefinitionSchema = z.object({
|
|
9
|
+
name: z.string().trim().min(1).max(80),
|
|
10
|
+
densityKgM3: positive,
|
|
11
|
+
specificHeatJkgK: positive,
|
|
12
|
+
conductivityWmK: nonnegative.optional(),
|
|
13
|
+
provenance: z.enum([
|
|
14
|
+
"authored",
|
|
15
|
+
"ai-estimated",
|
|
16
|
+
"reference"
|
|
17
|
+
]).default("authored")
|
|
18
|
+
}).strict();
|
|
19
|
+
const mass = z.discriminatedUnion("mode", [z.object({
|
|
20
|
+
mode: z.literal("explicit"),
|
|
21
|
+
massKg: positive
|
|
22
|
+
}).strict(), z.object({
|
|
23
|
+
mode: z.literal("density-volume"),
|
|
24
|
+
volumeM3: positive
|
|
25
|
+
}).strict()]);
|
|
26
|
+
const thermalDefinitionSchema = z.object({
|
|
27
|
+
mass,
|
|
28
|
+
initialTemperatureK: temperature.default(293.15),
|
|
29
|
+
heatPowerW: power.default(0),
|
|
30
|
+
ambientTemperatureK: temperature.default(293.15),
|
|
31
|
+
ambientConductanceWPerK: nonnegative.default(0),
|
|
32
|
+
contactConductanceWPerK: nonnegative.default(0)
|
|
33
|
+
}).strict();
|
|
34
|
+
const simulationProfileV1Schema = z.object({
|
|
35
|
+
schema: z.literal("agentscape.simulation-profile"),
|
|
36
|
+
schemaVersion: z.literal(1),
|
|
37
|
+
model: z.literal("lumped-thermal-v1"),
|
|
38
|
+
material: materialDefinitionSchema,
|
|
39
|
+
thermal: thermalDefinitionSchema
|
|
40
|
+
}).strict();
|
|
41
|
+
const simulationProfileV2Schema = z.object({
|
|
42
|
+
schema: z.literal("agentscape.simulation-profile"),
|
|
43
|
+
schemaVersion: z.literal(2),
|
|
44
|
+
model: z.literal("thermal-network-v1"),
|
|
45
|
+
nodes: z.array(z.object({
|
|
46
|
+
id: nodeId,
|
|
47
|
+
partName: z.union([z.literal("$root"), nodeId]),
|
|
48
|
+
material: materialDefinitionSchema,
|
|
49
|
+
thermal: thermalDefinitionSchema
|
|
50
|
+
}).strict()).min(1).max(32),
|
|
51
|
+
links: z.array(z.object({
|
|
52
|
+
from: nodeId,
|
|
53
|
+
to: nodeId,
|
|
54
|
+
conductanceWPerK: positive
|
|
55
|
+
}).strict()).max(96).default([])
|
|
56
|
+
}).strict().superRefine((profile, ctx) => {
|
|
57
|
+
const ids = /* @__PURE__ */ new Set(), parts = /* @__PURE__ */ new Set();
|
|
58
|
+
for (const node of profile.nodes) {
|
|
59
|
+
if (ids.has(node.id)) ctx.addIssue({
|
|
60
|
+
code: "custom",
|
|
61
|
+
message: "Duplicate thermal node ID: " + node.id
|
|
62
|
+
});
|
|
63
|
+
if (parts.has(node.partName)) ctx.addIssue({
|
|
64
|
+
code: "custom",
|
|
65
|
+
message: "Thermal nodes must have unique physical part names: " + node.partName
|
|
66
|
+
});
|
|
67
|
+
if (node.partName === "$root" !== (node.id === "root")) ctx.addIssue({
|
|
68
|
+
code: "custom",
|
|
69
|
+
message: "The physical root must use id \"root\" and partName \"$root\""
|
|
70
|
+
});
|
|
71
|
+
ids.add(node.id);
|
|
72
|
+
parts.add(node.partName);
|
|
73
|
+
}
|
|
74
|
+
if (!ids.has("root")) ctx.addIssue({
|
|
75
|
+
code: "custom",
|
|
76
|
+
message: "A root thermal node is required"
|
|
77
|
+
});
|
|
78
|
+
const edges = /* @__PURE__ */ new Set();
|
|
79
|
+
for (const link of profile.links) {
|
|
80
|
+
if (!ids.has(link.from) || !ids.has(link.to) || link.from === link.to) ctx.addIssue({
|
|
81
|
+
code: "custom",
|
|
82
|
+
message: "Thermal link references missing or identical nodes"
|
|
83
|
+
});
|
|
84
|
+
const key = [link.from, link.to].sort().join("|");
|
|
85
|
+
if (edges.has(key)) ctx.addIssue({
|
|
86
|
+
code: "custom",
|
|
87
|
+
message: "Duplicate thermal link: " + key
|
|
88
|
+
});
|
|
89
|
+
edges.add(key);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
const simulationProfileSchema = z.discriminatedUnion("schemaVersion", [simulationProfileV1Schema, simulationProfileV2Schema]);
|
|
93
|
+
const stateTemperature = z.number().finite().min(0).max(1e6);
|
|
94
|
+
const v1State = z.object({
|
|
95
|
+
schema: z.literal("agentscape.thermal-state"),
|
|
96
|
+
schemaVersion: z.literal(1),
|
|
97
|
+
temperatureK: stateTemperature,
|
|
98
|
+
heatPowerW: power
|
|
99
|
+
}).strict();
|
|
100
|
+
const v2State = z.object({
|
|
101
|
+
schema: z.literal("agentscape.thermal-state"),
|
|
102
|
+
schemaVersion: z.literal(2),
|
|
103
|
+
nodes: z.array(z.object({
|
|
104
|
+
id: nodeId,
|
|
105
|
+
temperatureK: stateTemperature,
|
|
106
|
+
heatPowerW: power
|
|
107
|
+
}).strict()).min(1).max(32)
|
|
108
|
+
}).strict().superRefine((state, ctx) => {
|
|
109
|
+
if (new Set(state.nodes.map((node) => node.id)).size !== state.nodes.length) ctx.addIssue({
|
|
110
|
+
code: "custom",
|
|
111
|
+
message: "Duplicate saved thermal node IDs"
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
const thermalStateSchema = z.discriminatedUnion("schemaVersion", [v1State, v2State]);
|
|
115
|
+
const properties = (material, thermal) => {
|
|
116
|
+
const massKg = thermal.mass.mode === "explicit" ? thermal.mass.massKg : material.densityKgM3 * thermal.mass.volumeM3;
|
|
117
|
+
const heatCapacityJPerK = massKg * material.specificHeatJkgK;
|
|
118
|
+
if (!Number.isFinite(massKg) || !Number.isFinite(heatCapacityJPerK) || massKg <= 0 || heatCapacityJPerK <= 0 || heatCapacityJPerK > 0xde0b6b3a7640000) throw Object.assign(/* @__PURE__ */ new RangeError("Thermal mass or heat capacity is not representable"), { code: "SIMULATION_PROFILE_INVALID" });
|
|
119
|
+
return {
|
|
120
|
+
massKg,
|
|
121
|
+
heatCapacityJPerK
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
function thermalDefinitions(input) {
|
|
125
|
+
const profile = simulationProfileSchema.parse(input);
|
|
126
|
+
return {
|
|
127
|
+
profile,
|
|
128
|
+
nodes: (profile.schemaVersion === 1 ? [{
|
|
129
|
+
id: "root",
|
|
130
|
+
partName: "$root",
|
|
131
|
+
material: profile.material,
|
|
132
|
+
thermal: profile.thermal
|
|
133
|
+
}] : profile.nodes).map((node) => ({
|
|
134
|
+
...node,
|
|
135
|
+
...properties(node.material, node.thermal)
|
|
136
|
+
})),
|
|
137
|
+
links: profile.schemaVersion === 2 ? profile.links : []
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function thermalProperties(input) {
|
|
141
|
+
const { profile, nodes } = thermalDefinitions(input);
|
|
142
|
+
const root = nodes.find((node) => node.id === "root");
|
|
143
|
+
return {
|
|
144
|
+
profile,
|
|
145
|
+
massKg: root.massKg,
|
|
146
|
+
heatCapacityJPerK: root.heatCapacityJPerK
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function validateSimulationProfile(input) {
|
|
150
|
+
if (input == null) return null;
|
|
151
|
+
return thermalDefinitions(input).profile;
|
|
152
|
+
}
|
|
153
|
+
function validateThermalStateForProfile(profileInput, stateInput) {
|
|
154
|
+
const { profile, nodes } = thermalDefinitions(profileInput);
|
|
155
|
+
const state = thermalStateSchema.parse(stateInput);
|
|
156
|
+
if (state.schemaVersion !== profile.schemaVersion) throw new Error("THERMAL_STATE_VERSION_MISMATCH");
|
|
157
|
+
if (state.schemaVersion === 2) {
|
|
158
|
+
const expected = new Set(nodes.map((node) => node.id));
|
|
159
|
+
if (state.nodes.length !== expected.size || state.nodes.some((node) => !expected.delete(node.id))) throw new Error("THERMAL_STATE_NODE_MISMATCH");
|
|
160
|
+
}
|
|
161
|
+
return state;
|
|
162
|
+
}
|
|
163
|
+
export { validateSimulationProfile as a, thermalStateSchema as i, thermalDefinitions as n, validateThermalStateForProfile as o, thermalProperties as r, simulationProfileSchema as t };
|
|
164
|
+
|
|
165
|
+
//# sourceMappingURL=SimulationProfile-DSYZbBLQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimulationProfile-DSYZbBLQ.js","names":[],"sources":["../../../foundation/simulation/SimulationProfile.js"],"sourcesContent":["import * as z from 'zod/v4';\n\n// Versioned SI contracts shared by Asset admission and World simulation.\n// Material conductivity is descriptive metadata; interface conductance is a\n// separate, explicitly authored parameter, not a derived physical certainty.\nconst positive=z.number().finite().positive().max(1e12);\nconst nonnegative=z.number().finite().min(0).max(1e12);\nconst temperature=z.number().finite().min(0).max(1e6);\nconst power=z.number().finite().min(-1e9).max(1e9);\nconst nodeId=z.string().regex(/^[A-Za-z][A-Za-z0-9_-]{0,63}$/);\n\nexport const materialDefinitionSchema=z.object({\n name:z.string().trim().min(1).max(80),\n densityKgM3:positive,\n specificHeatJkgK:positive,\n conductivityWmK:nonnegative.optional(),\n provenance:z.enum(['authored','ai-estimated','reference']).default('authored')\n}).strict();\n\nconst mass=z.discriminatedUnion('mode',[\n z.object({mode:z.literal('explicit'),massKg:positive}).strict(),\n z.object({mode:z.literal('density-volume'),volumeM3:positive}).strict()\n]);\nexport const thermalDefinitionSchema=z.object({\n mass,\n initialTemperatureK:temperature.default(293.15),\n heatPowerW:power.default(0),\n ambientTemperatureK:temperature.default(293.15),\n ambientConductanceWPerK:nonnegative.default(0),\n contactConductanceWPerK:nonnegative.default(0)\n}).strict();\n\nexport const simulationProfileV1Schema=z.object({\n schema:z.literal('agentscape.simulation-profile'),\n schemaVersion:z.literal(1),\n model:z.literal('lumped-thermal-v1'),\n material:materialDefinitionSchema,\n thermal:thermalDefinitionSchema\n}).strict();\n\nexport const simulationProfileV2Schema=z.object({\n schema:z.literal('agentscape.simulation-profile'),\n schemaVersion:z.literal(2),\n model:z.literal('thermal-network-v1'),\n nodes:z.array(z.object({\n id:nodeId,\n partName:z.union([z.literal('$root'),nodeId]),\n material:materialDefinitionSchema,\n thermal:thermalDefinitionSchema\n }).strict()).min(1).max(32),\n links:z.array(z.object({\n from:nodeId,\n to:nodeId,\n conductanceWPerK:positive\n }).strict()).max(96).default([])\n}).strict().superRefine((profile,ctx)=>{\n const ids=new Set(),parts=new Set();\n for(const node of profile.nodes){\n if(ids.has(node.id))ctx.addIssue({code:'custom',message:'Duplicate thermal node ID: '+node.id});\n if(parts.has(node.partName))ctx.addIssue({code:'custom',message:'Thermal nodes must have unique physical part names: '+node.partName});\n if((node.partName==='$root') !== (node.id==='root'))\n ctx.addIssue({code:'custom',message:'The physical root must use id \"root\" and partName \"$root\"'});\n ids.add(node.id);parts.add(node.partName);\n }\n if(!ids.has('root'))ctx.addIssue({code:'custom',message:'A root thermal node is required'});\n const edges=new Set();\n for(const link of profile.links){\n if(!ids.has(link.from)||!ids.has(link.to)||link.from===link.to)\n ctx.addIssue({code:'custom',message:'Thermal link references missing or identical nodes'});\n const key=[link.from,link.to].sort().join('|');\n if(edges.has(key))ctx.addIssue({code:'custom',message:'Duplicate thermal link: '+key});\n edges.add(key);\n }\n});\n\nexport const simulationProfileSchema=z.discriminatedUnion('schemaVersion',[\n simulationProfileV1Schema,simulationProfileV2Schema\n]);\n\nconst stateTemperature=z.number().finite().min(0).max(1e6);\nconst v1State=z.object({\n schema:z.literal('agentscape.thermal-state'),schemaVersion:z.literal(1),\n temperatureK:stateTemperature,heatPowerW:power\n}).strict();\nconst v2State=z.object({\n schema:z.literal('agentscape.thermal-state'),schemaVersion:z.literal(2),\n nodes:z.array(z.object({\n id:nodeId,temperatureK:stateTemperature,heatPowerW:power\n }).strict()).min(1).max(32)\n}).strict().superRefine((state,ctx)=>{\n if(new Set(state.nodes.map(node=>node.id)).size!==state.nodes.length)\n ctx.addIssue({code:'custom',message:'Duplicate saved thermal node IDs'});\n});\nexport const thermalStateSchema=z.discriminatedUnion('schemaVersion',[v1State,v2State]);\n\nconst properties=(material,thermal)=>{\n const massKg=thermal.mass.mode==='explicit' ? thermal.mass.massKg\n : material.densityKgM3*thermal.mass.volumeM3;\n const heatCapacityJPerK=massKg*material.specificHeatJkgK;\n if(!Number.isFinite(massKg)||!Number.isFinite(heatCapacityJPerK)\n ||massKg<=0||heatCapacityJPerK<=0||heatCapacityJPerK>1e18)\n throw Object.assign(new RangeError('Thermal mass or heat capacity is not representable'),{\n code:'SIMULATION_PROFILE_INVALID'\n });\n return {massKg,heatCapacityJPerK};\n};\n\nexport function thermalDefinitions(input){\n const profile=simulationProfileSchema.parse(input);\n const nodes=profile.schemaVersion===1\n ? [{id:'root',partName:'$root',material:profile.material,thermal:profile.thermal}]\n : profile.nodes;\n return {\n profile,\n nodes:nodes.map(node=>({...node,...properties(node.material,node.thermal)})),\n links:profile.schemaVersion===2 ? profile.links : []\n };\n}\n\nexport function thermalProperties(input){\n const {profile,nodes}=thermalDefinitions(input);\n const root=nodes.find(node=>node.id==='root');\n return {profile,massKg:root.massKg,heatCapacityJPerK:root.heatCapacityJPerK};\n}\n\nexport function validateSimulationProfile(input){\n if(input == null)return null;\n return thermalDefinitions(input).profile;\n}\n\nexport function validateThermalStateForProfile(profileInput,stateInput) {\n const {profile,nodes}=thermalDefinitions(profileInput);\n const state=thermalStateSchema.parse(stateInput);\n if(state.schemaVersion!==profile.schemaVersion)\n throw new Error('THERMAL_STATE_VERSION_MISMATCH');\n if(state.schemaVersion===2){\n const expected=new Set(nodes.map(node=>node.id));\n if(state.nodes.length!==expected.size\n ||state.nodes.some(node=>!expected.delete(node.id)))\n throw new Error('THERMAL_STATE_NODE_MISMATCH');\n }\n return state;\n}\n"],"mappings":";;AAKA,MAAM,WAAS,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,YAAI;AACtD,MAAM,cAAY,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,YAAI;AACrD,MAAM,cAAY,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;AACpD,MAAM,QAAM,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,GAAG;AACjD,MAAM,SAAO,EAAE,OAAO,CAAC,CAAC,MAAM,+BAA+B;AAE7D,MAAa,2BAAyB,E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88 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
// modules/rendering/style/StylePack.js
|
|
3
|
+
const color = z.string().regex(/^#[a-fA-F0-9]{6}$/);
|
|
4
|
+
const stylePackSchema = z.object({
|
|
5
|
+
schema: z.literal("agentscape.style-pack"),
|
|
6
|
+
schemaVersion: z.literal(1),
|
|
7
|
+
id: z.string().regex(/^[A-Za-z][A-Za-z0-9_/-]{0,99}$/),
|
|
8
|
+
version: z.string().regex(/^\d+\.\d+\.\d+$/),
|
|
9
|
+
requires: z.array(z.string().min(1).max(64)).max(16).default([]),
|
|
10
|
+
material: z.object({
|
|
11
|
+
mode: z.enum([
|
|
12
|
+
"standard",
|
|
13
|
+
"toon",
|
|
14
|
+
"flat"
|
|
15
|
+
]),
|
|
16
|
+
roughness: z.number().min(0).max(1).default(.8),
|
|
17
|
+
metalness: z.number().min(0).max(1).default(0),
|
|
18
|
+
unsupported: z.enum(["preserve", "reject"]).default("reject")
|
|
19
|
+
}).strict(),
|
|
20
|
+
lighting: z.object({
|
|
21
|
+
ambient: z.number().min(0).max(5),
|
|
22
|
+
directional: z.number().min(0).max(5)
|
|
23
|
+
}).strict(),
|
|
24
|
+
scene: z.object({
|
|
25
|
+
background: color,
|
|
26
|
+
fog: z.object({
|
|
27
|
+
color,
|
|
28
|
+
near: z.number().min(0).max(1e3),
|
|
29
|
+
far: z.number().positive().max(1e4)
|
|
30
|
+
}).strict().refine((f) => f.far > f.near).optional()
|
|
31
|
+
}).strict(),
|
|
32
|
+
postprocessing: z.object({
|
|
33
|
+
exposure: z.number().min(.1).max(4),
|
|
34
|
+
toneMapping: z.enum(["aces", "linear"]),
|
|
35
|
+
shadows: z.boolean()
|
|
36
|
+
}).strict(),
|
|
37
|
+
fallbackStyle: z.string().regex(/^builtin:\/\/[a-z-]+$/).optional()
|
|
38
|
+
}).strict();
|
|
39
|
+
const pack = (id, mode, background, exposure, ambient, directional) => ({
|
|
40
|
+
schema: "agentscape.style-pack",
|
|
41
|
+
schemaVersion: 1,
|
|
42
|
+
id: `builtin/${id}`,
|
|
43
|
+
version: "1.0.0",
|
|
44
|
+
requires: [`material.${mode}`, "renderer.exposure"],
|
|
45
|
+
material: {
|
|
46
|
+
mode,
|
|
47
|
+
roughness: mode === "flat" ? 1 : .75,
|
|
48
|
+
metalness: 0,
|
|
49
|
+
unsupported: "preserve"
|
|
50
|
+
},
|
|
51
|
+
lighting: {
|
|
52
|
+
ambient,
|
|
53
|
+
directional
|
|
54
|
+
},
|
|
55
|
+
scene: { background },
|
|
56
|
+
postprocessing: {
|
|
57
|
+
exposure,
|
|
58
|
+
toneMapping: "aces",
|
|
59
|
+
shadows: true
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
const freeze = (value) => {
|
|
63
|
+
if (value && typeof value === "object") {
|
|
64
|
+
Object.values(value).forEach(freeze);
|
|
65
|
+
Object.freeze(value);
|
|
66
|
+
}
|
|
67
|
+
return value;
|
|
68
|
+
};
|
|
69
|
+
const officialStylePacks = freeze({
|
|
70
|
+
realistic: pack("realistic", "standard", "#dce5ef", 1.15, 1, 1.6),
|
|
71
|
+
toon: pack("toon", "toon", "#e3e7f5", 1.05, 1.4, 1.8),
|
|
72
|
+
"low-poly": pack("low-poly", "flat", "#cfded0", 1.1, 1.2, 1.4)
|
|
73
|
+
});
|
|
74
|
+
function resolveStylePack(input) {
|
|
75
|
+
if (typeof input !== "string") {
|
|
76
|
+
const parsed = stylePackSchema.parse(input);
|
|
77
|
+
if (parsed.id.startsWith("builtin/")) {
|
|
78
|
+
const official = officialStylePacks[parsed.id.slice(8)];
|
|
79
|
+
if (!official || JSON.stringify(parsed) !== JSON.stringify(stylePackSchema.parse(official))) throw Object.assign(/* @__PURE__ */ new Error("STYLE_ID_CONFLICT"), { code: "STYLE_ID_CONFLICT" });
|
|
80
|
+
}
|
|
81
|
+
return parsed;
|
|
82
|
+
}
|
|
83
|
+
if (!input.startsWith("builtin://") || !officialStylePacks[input.slice(10)]) throw Object.assign(/* @__PURE__ */ new Error("STYLE_UNAVAILABLE"), { code: "STYLE_UNAVAILABLE" });
|
|
84
|
+
return stylePackSchema.parse(structuredClone(officialStylePacks[input.slice(10)]));
|
|
85
|
+
}
|
|
86
|
+
export { resolveStylePack as n, stylePackSchema as r, officialStylePacks as t };
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=StylePack-DcRa_kU0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StylePack-DcRa_kU0.js","names":[],"sources":["../../../modules/rendering/style/StylePack.js"],"sourcesContent":["import * as z from 'zod/v4';\nconst color = z.string().regex(/^#[a-fA-F0-9]{6}$/);\nexport const stylePackSchema = z.object({\n schema: z.literal('agentscape.style-pack'), schemaVersion: z.literal(1),\n id: z.string().regex(/^[A-Za-z][A-Za-z0-9_/-]{0,99}$/), version: z.string().regex(/^\\d+\\.\\d+\\.\\d+$/),\n requires: z.array(z.string().min(1).max(64)).max(16).default([]),\n material: z.object({ mode: z.enum(['standard', 'toon', 'flat']), roughness: z.number().min(0).max(1).default(0.8), metalness: z.number().min(0).max(1).default(0), unsupported: z.enum(['preserve', 'reject']).default('reject') }).strict(),\n lighting: z.object({ ambient: z.number().min(0).max(5), directional: z.number().min(0).max(5) }).strict(),\n scene: z.object({ background: color, fog: z.object({ color, near: z.number().min(0).max(1000), far: z.number().positive().max(10000) }).strict().refine(f => f.far > f.near).optional() }).strict(),\n postprocessing: z.object({ exposure: z.number().min(0.1).max(4), toneMapping: z.enum(['aces', 'linear']), shadows: z.boolean() }).strict(),\n fallbackStyle: z.string().regex(/^builtin:\\/\\/[a-z-]+$/).optional()\n}).strict();\n\nconst pack = (id, mode, background, exposure, ambient, directional) => ({ schema: 'agentscape.style-pack', schemaVersion: 1, id: `builtin/${id}`, version: '1.0.0',\n requires: [`material.${mode}`, 'renderer.exposure'], material: { mode, roughness: mode === 'flat' ? 1 : 0.75, metalness: 0, unsupported: 'preserve' },\n lighting: { ambient, directional }, scene: { background }, postprocessing: { exposure, toneMapping: 'aces', shadows: true } });\nconst freeze = value => { if (value && typeof value === 'object') { Object.values(value).forEach(freeze); Object.freeze(value); } return value; };\nexport const officialStylePacks = freeze({\n realistic: pack('realistic', 'standard', '#dce5ef', 1.15, 1, 1.6),\n toon: pack('toon', 'toon', '#e3e7f5', 1.05, 1.4, 1.8),\n 'low-poly': pack('low-poly', 'flat', '#cfded0', 1.1, 1.2, 1.4)\n});\nexport function resolveStylePack(input) {\n if (typeof input !== 'string') {\n const parsed = stylePackSchema.parse(input);\n if (parsed.id.startsWith('builtin/')) {\n const official = officialStylePacks[parsed.id.slice(8)];\n if (!official || JSON.stringify(parsed) !== JSON.stringify(stylePackSchema.parse(official))) throw Object.assign(new Error('STYLE_ID_CONFLICT'), { code: 'STYLE_ID_CONFLICT' });\n }\n return parsed;\n }\n if (!input.startsWith('builtin://') || !officialStylePacks[input.slice(10)]) throw Object.assign(new Error('STYLE_UNAVAILABLE'), { code: 'STYLE_UNAVAILABLE' });\n return stylePackSchema.parse(structuredClone(officialStylePacks[input.slice(10)]));\n}\n"],"mappings":";;AACA,MAAM,QAAQ,EAAE,OAAO,CAAC,CAAC,MAAM,mBAAmB;AAClD,MAAa,kBAAkB,EAAE,OAAO;CACtC,QAAQ,EAAE,QAAQ,uBAAuB;CAAG,eAAe,EAAE,QAAQ,CAAC;CACtE,IAAI,EAAE,OAAO,CAAC,CAAC,MAAM,gCAAgC;CAAG,SAAS,EAAE,OAAO,CAAC,CAAC,MAAM,iBAAiB;CACnG,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;CAC/D,UAAU,EAAE,OAAO;EAAE,MAAM,EAAE,KAAK;GAAC;GAAY;GAAQ;EAAM,CAAC;EAAG,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,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