agentscape3d 1.0.0-beta.1 → 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -48
- package/dist/core.d.ts +68 -0
- package/dist/core.js +209 -0
- package/dist/core.js.map +1 -0
- package/dist/index.d.ts +10 -229
- package/dist/index.js +192 -15462
- package/dist/index.js.map +1 -1
- package/package.json +11 -40
- package/cli.mjs +0 -27
- package/dist/AssetCompiler-CDFiElji.js +0 -2451
- package/dist/AssetCompiler-CDFiElji.js.map +0 -1
- package/dist/AssetInputContracts-Dy8iU4eT.js +0 -228
- package/dist/AssetInputContracts-Dy8iU4eT.js.map +0 -1
- package/dist/AssetRecipe-DmFpzxr-.js +0 -55
- package/dist/AssetRecipe-DmFpzxr-.js.map +0 -1
- package/dist/BrowserCodeWorker.js +0 -53615
- package/dist/KinematicHypothesisScreen-D-z6qgMB.js +0 -242
- package/dist/KinematicHypothesisScreen-D-z6qgMB.js.map +0 -1
- package/dist/SceneSerializer-DPVOyeRk.js +0 -353
- package/dist/SceneSerializer-DPVOyeRk.js.map +0 -1
- package/dist/StylePack-DNrdLeGI.js +0 -6314
- package/dist/StylePack-DNrdLeGI.js.map +0 -1
- package/dist/WorldArchive-pSBIGxLa.js +0 -420
- package/dist/WorldArchive-pSBIGxLa.js.map +0 -1
- package/dist/WorldIO-wsDfZGM4.js +0 -150
- package/dist/WorldIO-wsDfZGM4.js.map +0 -1
- package/dist/blankWorld-CBWbwJGj.js +0 -76
- package/dist/blankWorld-CBWbwJGj.js.map +0 -1
- package/dist/disposeObject3D-BQ9TyVC_.js +0 -54
- package/dist/disposeObject3D-BQ9TyVC_.js.map +0 -1
- package/dist/environments-DgH66NqV.js +0 -4220
- package/dist/environments-DgH66NqV.js.map +0 -1
- package/dist/gltfIO-B87nJaat.js +0 -10
- package/dist/gltfIO-B87nJaat.js.map +0 -1
- package/dist/grandUrbanBlock-Ob9pN-CB.js +0 -516
- package/dist/grandUrbanBlock-Ob9pN-CB.js.map +0 -1
- package/dist/magicCabin-D64fD1E2.js +0 -11024
- package/dist/magicCabin-D64fD1E2.js.map +0 -1
- package/dist/mcp.d.ts +0 -2
- package/dist/mcp.js +0 -1
- package/dist/monumentHall-BKbs0UOQ.js +0 -404
- package/dist/monumentHall-BKbs0UOQ.js.map +0 -1
- package/dist/node.d.ts +0 -16
- package/dist/node.js +0 -25
- package/dist/ruinedCourtyard-BoZxHldu.js +0 -697
- package/dist/ruinedCourtyard-BoZxHldu.js.map +0 -1
- package/dist/runtime/application/AgentTools.js +0 -25
- package/dist/runtime/application/README.md +0 -14
- package/dist/runtime/application/buildTaskObservation.js +0 -117
- package/dist/runtime/application/code-execution/AuthoringSandboxEntry.js +0 -46
- package/dist/runtime/application/code-execution/BrowserCodeExecutor.js +0 -35
- package/dist/runtime/application/code-execution/BrowserCodeWorker.js +0 -17
- package/dist/runtime/application/code-execution/RemoteAuthoringDocument.js +0 -72
- package/dist/runtime/application/createSession.js +0 -66
- package/dist/runtime/application/createWorldAuthoringContext.js +0 -400
- package/dist/runtime/application/generation/GenerationOrchestrator.js +0 -629
- package/dist/runtime/application/generation/GenerationRuntime.js +0 -214
- package/dist/runtime/application/generation/PromptHybridWorldOrchestrator.js +0 -285
- package/dist/runtime/application/native-scene/CodeProject.js +0 -119
- package/dist/runtime/application/native-scene/CodeProjectModules.js +0 -128
- package/dist/runtime/application/native-scene/NativeEnvironmentGeometry.js +0 -62
- package/dist/runtime/application/native-scene/NativeOverlayCheckpoint.js +0 -127
- package/dist/runtime/application/native-scene/NativeRenderDiscovery.js +0 -51
- package/dist/runtime/application/native-scene/NativeSceneHost.js +0 -164
- package/dist/runtime/application/native-scene/NativeSceneOverlay.js +0 -116
- package/dist/runtime/application/native-scene/NativeThreeModule.js +0 -16
- package/dist/runtime/application/object-forge/SceneObjectForge.js +0 -232
- package/dist/runtime/application/programmatic-assets/ProgrammaticAssetBuilder.js +0 -54
- package/dist/runtime/application/programmatic-assets/ProgrammaticAssetContract.js +0 -22
- package/dist/runtime/application/programmatic-assets/ThreeCodeAsset.js +0 -40
- package/dist/runtime/application/scene/CapabilityResolver.js +0 -79
- package/dist/runtime/application/scene/RequestWindow.js +0 -54
- package/dist/runtime/application/scene/SceneAgentTools.js +0 -21
- package/dist/runtime/application/scene/SceneContracts.js +0 -45
- package/dist/runtime/application/scene/SceneEditService.js +0 -144
- package/dist/runtime/application/scene/SceneFacade.js +0 -267
- package/dist/runtime/application/scene/SceneInteractionAdapters.js +0 -40
- package/dist/runtime/application/scene/SceneJobController.js +0 -229
- package/dist/runtime/application/scene/ScenePackage.js +0 -162
- package/dist/runtime/application/scene/ScenePersistence.js +0 -50
- package/dist/runtime/application/scene/SceneProject.js +0 -95
- package/dist/runtime/application/scene/SceneSkillNames.js +0 -5
- package/dist/runtime/application/scene/StarterScene.js +0 -56
- package/dist/runtime/application/scene/WorldArchive.js +0 -87
- package/dist/runtime/application/scene/WorldDirectory.js +0 -20
- package/dist/runtime/application/scene/WorldDocument.js +0 -74
- package/dist/runtime/application/scene/WorldIO.js +0 -103
- package/dist/runtime/application/scene/WorldStorage.js +0 -137
- package/dist/runtime/application/skills/SkillRegistry.js +0 -163
- package/dist/runtime/application/skills/packs/acceptanceSkills.js +0 -32
- package/dist/runtime/application/skills/packs/affordanceSkills.js +0 -36
- package/dist/runtime/application/skills/packs/assetSkills.js +0 -46
- package/dist/runtime/application/skills/packs/authoringSkills.js +0 -16
- package/dist/runtime/application/skills/packs/batchSkills.js +0 -22
- package/dist/runtime/application/skills/packs/codeSkills.js +0 -106
- package/dist/runtime/application/skills/packs/generationSkills.js +0 -45
- package/dist/runtime/application/skills/packs/interactionSkills.js +0 -46
- package/dist/runtime/application/skills/packs/recoverySkills.js +0 -80
- package/dist/runtime/application/skills/packs/sceneSkills.js +0 -24
- package/dist/runtime/application/skills/packs/spatialSkills.js +0 -35
- package/dist/runtime/application/skills/packs/verificationSkills.js +0 -14
- package/dist/runtime/application/skills/packs/worldSkills.js +0 -45
- package/dist/runtime/application/skills/registerCoreSkills.js +0 -31
- package/dist/runtime/application/skills/skillPrimitives.js +0 -4
- package/dist/runtime/application/tasks/CabinetCupTask.js +0 -76
- package/dist/runtime/application/tasks.jsonl +0 -67
- package/dist/runtime/application/world-authoring/AuthoringAssetProducer.js +0 -42
- package/dist/runtime/application/world-authoring/AuthoringDiff.js +0 -149
- package/dist/runtime/application/world-authoring/AuthoringDocument.js +0 -825
- package/dist/runtime/application/world-authoring/AuthoringExecutionHost.js +0 -109
- package/dist/runtime/application/world-authoring/AuthoringIdentity.js +0 -17
- package/dist/runtime/application/world-authoring/AuthoringModelResolver.js +0 -29
- package/dist/runtime/application/world-authoring/AuthoringPatch.js +0 -118
- package/dist/runtime/application/world-authoring/AuthoringPromotionController.js +0 -334
- package/dist/runtime/application/world-authoring/AuthoringPromotionSource.js +0 -126
- package/dist/runtime/application/world-authoring/AuthoringRevisionHistory.js +0 -144
- package/dist/runtime/application/world-authoring/HeadlessImageExport.js +0 -174
- package/dist/runtime/application/world-authoring/ModelRef.js +0 -62
- package/dist/runtime/apps/mcp-server/AUTHORING.md +0 -71
- package/dist/runtime/apps/mcp-server/AuthoringSandboxEntry.js +0 -1
- package/dist/runtime/apps/mcp-server/AuthoringSandboxWorker.mjs +0 -30
- package/dist/runtime/apps/mcp-server/BuildEnvironment.js +0 -17
- package/dist/runtime/apps/mcp-server/CodeExecutor.js +0 -71
- package/dist/runtime/apps/mcp-server/DEPLOYMENT-PC2.md +0 -42
- package/dist/runtime/apps/mcp-server/DockerBuildRunner.js +0 -66
- package/dist/runtime/apps/mcp-server/FileAssetRepository.js +0 -159
- package/dist/runtime/apps/mcp-server/HeadlessAssetIO.js +0 -8
- package/dist/runtime/apps/mcp-server/HeadlessGLTFLoader.js +0 -47
- package/dist/runtime/apps/mcp-server/HeadlessWorldHost.js +0 -132
- package/dist/runtime/apps/mcp-server/IsolatedAuthoringExecutor.js +0 -6
- package/dist/runtime/apps/mcp-server/PROGRAMMATIC-ASSETS.md +0 -116
- package/dist/runtime/apps/mcp-server/ProgrammaticAssets.js +0 -60
- package/dist/runtime/apps/mcp-server/README.md +0 -150
- package/dist/runtime/apps/mcp-server/RemoteAuthoringDocument.js +0 -1
- package/dist/runtime/apps/mcp-server/SandboxBundle.js +0 -13
- package/dist/runtime/apps/mcp-server/SessionManager.js +0 -80
- package/dist/runtime/apps/mcp-server/StudioBridgeHttp.js +0 -58
- package/dist/runtime/apps/mcp-server/StudioLiveBridge.js +0 -190
- package/dist/runtime/apps/mcp-server/TrustedAuthoringWorker.mjs +0 -16
- package/dist/runtime/apps/mcp-server/VALIDATION.md +0 -45
- package/dist/runtime/apps/mcp-server/acceptance-evidence.json +0 -332
- package/dist/runtime/apps/mcp-server/errorDiagnostics.js +0 -32
- package/dist/runtime/apps/mcp-server/examples/code-house.js +0 -24
- package/dist/runtime/apps/mcp-server/examples/procedural-assets.js +0 -37
- package/dist/runtime/apps/mcp-server/main.mjs +0 -56
- package/dist/runtime/apps/mcp-server/registerTools.js +0 -215
- package/dist/runtime/apps/mcp-server/sandbox/run.mjs +0 -23
- package/dist/runtime/apps/mcp-server/security.js +0 -21
- package/dist/runtime/apps/mcp-server/tasks.jsonl +0 -9
- package/dist/runtime/apps/server/CapabilityAdapterRegistry.js +0 -157
- package/dist/runtime/apps/server/README.md +0 -7
- package/dist/runtime/apps/server/WorldDiskStorage.js +0 -51
- package/dist/runtime/apps/server/openai-compatible-agent-gateway.mjs +0 -278
- package/dist/runtime/apps/server/tasks.jsonl +0 -10
- package/dist/runtime/foundation/EventBus.js +0 -18
- package/dist/runtime/foundation/JsonGateway.js +0 -47
- package/dist/runtime/foundation/PolicyEngine.js +0 -21
- package/dist/runtime/foundation/README.md +0 -7
- package/dist/runtime/foundation/TraceRecorder.js +0 -76
- package/dist/runtime/foundation/errors.js +0 -8
- package/dist/runtime/foundation/simulation/SimulationProfile.js +0 -143
- package/dist/runtime/foundation/version.js +0 -2
- package/dist/runtime/modules/agent/README.md +0 -11
- package/dist/runtime/modules/agent/ToolCallingAgent.js +0 -19
- package/dist/runtime/modules/agent/bootstrapWorld.js +0 -10
- package/dist/runtime/modules/agent/buildRecoveryProposals.js +0 -533
- package/dist/runtime/modules/agent/execution/AgentExecutionRules.js +0 -127
- package/dist/runtime/modules/agent/execution/AgentRunResults.js +0 -55
- package/dist/runtime/modules/agent/execution/AgentRunSession.js +0 -390
- package/dist/runtime/modules/agent/execution/AgentToolInvoker.js +0 -39
- package/dist/runtime/modules/agent/gateway/HttpLLMGateway.js +0 -19
- package/dist/runtime/modules/agent/prompt/index.js +0 -46
- package/dist/runtime/modules/agent/tasks.jsonl +0 -94
- package/dist/runtime/modules/artifact/ArtifactContentGate.js +0 -144
- package/dist/runtime/modules/artifact/ArtifactDescriptor.js +0 -280
- package/dist/runtime/modules/artifact/ArtifactImporter.js +0 -185
- package/dist/runtime/modules/artifact/ArtifactModule.js +0 -111
- package/dist/runtime/modules/artifact/ArtifactRegistry.js +0 -197
- package/dist/runtime/modules/artifact/IncrementalSha256.js +0 -129
- package/dist/runtime/modules/artifact/MemoryArtifactByteStore.js +0 -115
- package/dist/runtime/modules/artifact/README.md +0 -7
- package/dist/runtime/modules/artifact/storage/IndexedDbArtifactStore.js +0 -67
- package/dist/runtime/modules/artifact/tasks.jsonl +0 -31
- package/dist/runtime/modules/asset/AssetModule.js +0 -399
- package/dist/runtime/modules/asset/README.md +0 -54
- package/dist/runtime/modules/asset/loading/AssetLoader.js +0 -157
- package/dist/runtime/modules/asset/loading/GltfAssetLoader.js +0 -61
- package/dist/runtime/modules/asset/loading/builtins/BuiltinAssets.js +0 -95
- package/dist/runtime/modules/asset/loading/builtins/HouseDoor.js +0 -33
- package/dist/runtime/modules/asset/loading/builtins/IndustrialCabinet.js +0 -103
- package/dist/runtime/modules/asset/model/AssetInputContracts.js +0 -95
- package/dist/runtime/modules/asset/model/AssetRef.js +0 -12
- package/dist/runtime/modules/asset/model/MechanicalAssetDraft.js +0 -172
- package/dist/runtime/modules/asset/model/admission.js +0 -117
- package/dist/runtime/modules/asset/model/errors.js +0 -6
- package/dist/runtime/modules/asset/model/parts.js +0 -27
- package/dist/runtime/modules/asset/model/resourceBudget.js +0 -10
- package/dist/runtime/modules/asset/model/schema.js +0 -150
- package/dist/runtime/modules/asset/persistence/AssetManifestStore.js +0 -78
- package/dist/runtime/modules/asset/persistence/CompiledAssetStore.js +0 -84
- package/dist/runtime/modules/asset/persistence/LocalAssetLibrary.js +0 -86
- package/dist/runtime/modules/asset/persistence/LocalAssetLibraryStore.js +0 -81
- package/dist/runtime/modules/asset/production/AssetProductionPipeline.js +0 -272
- package/dist/runtime/modules/asset/production/AssetRecipe.js +0 -32
- package/dist/runtime/modules/asset/production/adapters/EmbodiedGenAdapter.js +0 -45
- package/dist/runtime/modules/asset/production/adapters/EmbodiedGenBundleAdapter.js +0 -590
- package/dist/runtime/modules/asset/production/compiler/AssetCompiler.js +0 -173
- package/dist/runtime/modules/asset/production/compiler/evidence/AnimationMotionEvidence.js +0 -124
- package/dist/runtime/modules/asset/production/compiler/evidence/StaticPanelEvidence.js +0 -56
- package/dist/runtime/modules/asset/production/compiler/gltfIO.js +0 -6
- package/dist/runtime/modules/asset/production/compiler/partGeometry.js +0 -74
- package/dist/runtime/modules/asset/production/compiler/passes/ArticulatedCollisionPass.js +0 -63
- package/dist/runtime/modules/asset/production/compiler/passes/ArticulationCandidatePass.js +0 -48
- package/dist/runtime/modules/asset/production/compiler/passes/AuthoringIntentPass.js +0 -16
- package/dist/runtime/modules/asset/production/compiler/passes/ColliderFallbackPass.js +0 -30
- package/dist/runtime/modules/asset/production/compiler/passes/CompileQualityPass.js +0 -75
- package/dist/runtime/modules/asset/production/compiler/passes/ExplicitDefinitionPass.js +0 -20
- package/dist/runtime/modules/asset/production/compiler/passes/GLTFInspectPass.js +0 -34
- package/dist/runtime/modules/asset/production/compiler/passes/GeometryPass.js +0 -32
- package/dist/runtime/modules/asset/production/compiler/passes/JointFramePass.js +0 -116
- package/dist/runtime/modules/asset/production/compiler/passes/KinematicEvidencePass.js +0 -84
- package/dist/runtime/modules/asset/production/compiler/passes/ManifestPass.js +0 -63
- package/dist/runtime/modules/asset/production/compiler/passes/NormalizeTransformPass.js +0 -16
- package/dist/runtime/modules/asset/production/compiler/passes/OptimizeGLBPass.js +0 -23
- package/dist/runtime/modules/asset/production/compiler/passes/PartColliderPass.js +0 -50
- package/dist/runtime/modules/asset/production/compiler/passes/PartGeometryEnrichmentPass.js +0 -60
- package/dist/runtime/modules/asset/production/compiler/passes/PartProposalPass.js +0 -93
- package/dist/runtime/modules/asset/production/compiler/passes/RemoteEnrichmentPass.js +0 -32
- package/dist/runtime/modules/asset/production/compiler/passes/ResourceBudgetPass.js +0 -55
- package/dist/runtime/modules/asset/production/compiler/passes/SegmentMaterializePass.js +0 -203
- package/dist/runtime/modules/asset/production/compiler/passes/SegmentationEvidencePass.js +0 -43
- package/dist/runtime/modules/asset/production/compiler/passes/SemanticHeuristicPass.js +0 -33
- package/dist/runtime/modules/asset/production/compiler/passes/StructurePass.js +0 -60
- package/dist/runtime/modules/asset/production/compiler/providers/HttpCompilerProvider.js +0 -23
- package/dist/runtime/modules/asset/production/verification/KinematicHypothesisScreen.js +0 -198
- package/dist/runtime/modules/asset/registry/AssetCatalog.js +0 -72
- package/dist/runtime/modules/asset/registry/AssetRegistry.js +0 -51
- package/dist/runtime/modules/asset/registry/manifests/index.js +0 -173
- package/dist/runtime/modules/asset/tasks.jsonl +0 -87
- package/dist/runtime/modules/generation/README.md +0 -9
- package/dist/runtime/modules/generation/connector/ConnectorArtifactClient.js +0 -45
- package/dist/runtime/modules/generation/connector/ConnectorCapabilityAdapter.js +0 -169
- package/dist/runtime/modules/generation/connector/ConnectorClient.js +0 -192
- package/dist/runtime/modules/generation/connector/ConnectorJobClient.js +0 -167
- package/dist/runtime/modules/generation/connector/ConnectorJobEventClient.js +0 -179
- package/dist/runtime/modules/generation/connector/ConnectorSession.js +0 -202
- package/dist/runtime/modules/generation/jobs/GenerationJobProjection.js +0 -239
- package/dist/runtime/modules/generation/jobs/GenerationJobReconciler.js +0 -99
- package/dist/runtime/modules/generation/jobs/GenerationJobStore.js +0 -91
- package/dist/runtime/modules/generation/jobs/GenerationJobTransportOverlay.js +0 -50
- package/dist/runtime/modules/generation/providers/ProviderRegistry.js +0 -304
- package/dist/runtime/modules/generation/tasks.jsonl +0 -35
- package/dist/runtime/modules/navigation/NavigationBackend.js +0 -17
- package/dist/runtime/modules/navigation/RecastNavigationBackend.js +0 -245
- package/dist/runtime/modules/physics/JoltPhysicsBackend.js +0 -850
- package/dist/runtime/modules/physics/PhysicsApiSurface.js +0 -651
- package/dist/runtime/modules/physics/PhysicsBackend.js +0 -88
- package/dist/runtime/modules/physics/RapierPhysicsBackend.js +0 -410
- package/dist/runtime/modules/rendering/README.md +0 -7
- package/dist/runtime/modules/rendering/RendererProbe.js +0 -153
- package/dist/runtime/modules/rendering/WebGpuPostFxPipeline.js +0 -140
- package/dist/runtime/modules/rendering/createRenderer.js +0 -76
- package/dist/runtime/modules/rendering/disposeObject3D.js +0 -34
- package/dist/runtime/modules/rendering/loadGaussianSplatVisual.js +0 -74
- package/dist/runtime/modules/rendering/style/StylePack.js +0 -34
- package/dist/runtime/modules/rendering/style/StyleSystem.js +0 -173
- package/dist/runtime/modules/rendering/tasks.jsonl +0 -7
- package/dist/runtime/modules/world/README.md +0 -13
- package/dist/runtime/modules/world/build/WorldBuilder.js +0 -170
- package/dist/runtime/modules/world/compiler/PipelineEngine.js +0 -32
- package/dist/runtime/modules/world/compiler/WorldAdmission.js +0 -43
- package/dist/runtime/modules/world/compiler/WorldBehaviorCompiler.js +0 -68
- package/dist/runtime/modules/world/compiler/WorldCompilation.js +0 -157
- package/dist/runtime/modules/world/compiler/WorldComposer.js +0 -201
- package/dist/runtime/modules/world/compiler/WorldPhysicsAdmission.js +0 -76
- package/dist/runtime/modules/world/compiler/WorldRecompiler.js +0 -356
- package/dist/runtime/modules/world/compiler/WorldRetry.js +0 -75
- package/dist/runtime/modules/world/compiler/createWorldPipeline.js +0 -379
- package/dist/runtime/modules/world/content/blankWorld.js +0 -35
- package/dist/runtime/modules/world/content/environments.js +0 -84
- package/dist/runtime/modules/world/content/grandUrbanBlock.js +0 -189
- package/dist/runtime/modules/world/content/magic-cabin/README.md +0 -28
- package/dist/runtime/modules/world/content/magic-cabin/affordances.js +0 -64
- package/dist/runtime/modules/world/content/magic-cabin/cabinContents.js +0 -7078
- package/dist/runtime/modules/world/content/magic-cabin/lighting.js +0 -26
- package/dist/runtime/modules/world/content/magic-cabin/materials.js +0 -20
- package/dist/runtime/modules/world/content/magicCabin.js +0 -190
- package/dist/runtime/modules/world/content/monumentHall.js +0 -154
- package/dist/runtime/modules/world/content/ruinedCourtyard.js +0 -196
- package/dist/runtime/modules/world/content/suzhouGarden/README.md +0 -141
- package/dist/runtime/modules/world/content/suzhouGarden/index.js +0 -137
- package/dist/runtime/modules/world/content/suzhouGarden/src/arch.js +0 -491
- package/dist/runtime/modules/world/content/suzhouGarden/src/buildings.js +0 -670
- package/dist/runtime/modules/world/content/suzhouGarden/src/core.js +0 -578
- package/dist/runtime/modules/world/content/suzhouGarden/src/lod.js +0 -127
- package/dist/runtime/modules/world/content/suzhouGarden/src/main.js +0 -642
- package/dist/runtime/modules/world/content/suzhouGarden/src/nature.js +0 -650
- package/dist/runtime/modules/world/content/suzhouGarden/src/rockery.js +0 -280
- package/dist/runtime/modules/world/content/suzhouGarden/src/sky.js +0 -242
- package/dist/runtime/modules/world/content/suzhouGarden/src/water.js +0 -215
- package/dist/runtime/modules/world/content/woodlandWorkshop.js +0 -192
- package/dist/runtime/modules/world/content/yuanmingyuan/README.md +0 -36
- package/dist/runtime/modules/world/content/yuanmingyuan/arch.js +0 -351
- package/dist/runtime/modules/world/content/yuanmingyuan/buildings.js +0 -490
- package/dist/runtime/modules/world/content/yuanmingyuan/core.js +0 -505
- package/dist/runtime/modules/world/content/yuanmingyuan/index.js +0 -101
- package/dist/runtime/modules/world/content/yuanmingyuan/nature.js +0 -435
- package/dist/runtime/modules/world/content/yuanmingyuan/sky.js +0 -169
- package/dist/runtime/modules/world/content/yuanmingyuan/water.js +0 -245
- package/dist/runtime/modules/world/errors.js +0 -9
- package/dist/runtime/modules/world/generated/GeneratedWorldCoordinates.js +0 -50
- package/dist/runtime/modules/world/generated/GeneratedWorldLoader.js +0 -297
- package/dist/runtime/modules/world/runtime/CommandHistory.js +0 -80
- package/dist/runtime/modules/world/runtime/ObjectStore.js +0 -31
- package/dist/runtime/modules/world/runtime/ObjectTransform.js +0 -62
- package/dist/runtime/modules/world/runtime/ObservedEntity.js +0 -37
- package/dist/runtime/modules/world/runtime/ProjectCapabilities.js +0 -207
- package/dist/runtime/modules/world/runtime/SceneSerializer.js +0 -246
- package/dist/runtime/modules/world/runtime/WorldAuthority.js +0 -41
- package/dist/runtime/modules/world/runtime/WorldCollisionSignature.js +0 -14
- package/dist/runtime/modules/world/runtime/WorldCommands.js +0 -502
- package/dist/runtime/modules/world/runtime/WorldObservation.js +0 -71
- package/dist/runtime/modules/world/runtime/WorldQueries.js +0 -340
- package/dist/runtime/modules/world/runtime/WorldRecovery.js +0 -78
- package/dist/runtime/modules/world/runtime/WorldRuntime.js +0 -649
- package/dist/runtime/modules/world/runtime/affordance/ObjectAffordances.js +0 -107
- package/dist/runtime/modules/world/runtime/affordance/WorldAffordances.js +0 -130
- package/dist/runtime/modules/world/runtime/behavior/BehaviorCompiler.js +0 -79
- package/dist/runtime/modules/world/runtime/behavior/ProjectStateMachine.js +0 -195
- package/dist/runtime/modules/world/runtime/behavior/RuleGraph.js +0 -70
- package/dist/runtime/modules/world/runtime/behavior/RuleRuntime.js +0 -115
- package/dist/runtime/modules/world/runtime/graph/SceneGraph.js +0 -216
- package/dist/runtime/modules/world/runtime/interaction/ArticulationRuntime.js +0 -214
- package/dist/runtime/modules/world/runtime/interaction/CarryCapability.js +0 -65
- package/dist/runtime/modules/world/runtime/interaction/CarryRuntime.js +0 -222
- package/dist/runtime/modules/world/runtime/interaction/InteractionApproach.js +0 -130
- package/dist/runtime/modules/world/runtime/interaction/InteractionContract.js +0 -57
- package/dist/runtime/modules/world/runtime/interaction/RecoveryRuntime.js +0 -123
- package/dist/runtime/modules/world/runtime/interaction/SettleRuntime.js +0 -120
- package/dist/runtime/modules/world/runtime/semantic/SemanticWorldView.js +0 -102
- package/dist/runtime/modules/world/runtime/simulation/SimulationClock.js +0 -89
- package/dist/runtime/modules/world/runtime/simulation/SimulationSession.js +0 -99
- package/dist/runtime/modules/world/runtime/simulation/ThermalSystem.js +0 -269
- package/dist/runtime/modules/world/runtime/spatial/SpatialSnapshot.js +0 -56
- package/dist/runtime/modules/world/runtime/spatial/ThreeBvhRuntime.js +0 -36
- package/dist/runtime/modules/world/runtime/systems/InteractionSystem.js +0 -728
- package/dist/runtime/modules/world/runtime/systems/LocomotionSystem.js +0 -269
- package/dist/runtime/modules/world/runtime/systems/NavigationSystem.js +0 -469
- package/dist/runtime/modules/world/runtime/systems/PhysicsSystem.js +0 -1657
- package/dist/runtime/modules/world/runtime/systems/RenderingSystem.js +0 -457
- package/dist/runtime/modules/world/runtime/systems/SpatialSystem.js +0 -284
- package/dist/runtime/modules/world/spec/WorldIR.js +0 -165
- package/dist/runtime/modules/world/spec/WorldIRToolSchema.js +0 -86
- package/dist/runtime/modules/world/spec/WorldPlannerProposal.js +0 -51
- package/dist/runtime/modules/world/spec/WorldRevision.js +0 -231
- package/dist/runtime/modules/world/spec/WorldSpec.js +0 -86
- package/dist/runtime/modules/world/tasks.jsonl +0 -530
- package/dist/runtime/modules/world/verification/ArticulationVerifier.js +0 -254
- package/dist/runtime/modules/world/verification/Finding.js +0 -105
- package/dist/runtime/modules/world/verification/InteractionEvidence.js +0 -69
- package/dist/runtime/modules/world/verification/RepairEngine.js +0 -49
- package/dist/runtime/modules/world/verification/WorldAcceptance.js +0 -158
- package/dist/runtime/modules/world/verification/WorldValidator.js +0 -65
- package/dist/runtime/package-lock.json +0 -6245
- package/dist/runtime/package.json +0 -91
- 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-Dudvovhu.js +0 -364
- package/dist/schema-Dudvovhu.js.map +0 -1
- package/dist/suzhouGarden-BCx_JeV5.js +0 -6159
- package/dist/suzhouGarden-BCx_JeV5.js.map +0 -1
- package/dist/woodlandWorkshop-BGNWPNdK.js +0 -484
- package/dist/woodlandWorkshop-BGNWPNdK.js.map +0 -1
- package/dist/yuanmingyuan-DAIb1msO.js +0 -4962
- package/dist/yuanmingyuan-DAIb1msO.js.map +0 -1
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
// A read-only semantic projection. State and geometry remain owned by their providers.
|
|
2
|
-
const spatialPredicates = new Set(['ON', 'NEAR', 'INSIDE', 'CONTAINS', 'SUPPORTS']);
|
|
3
|
-
|
|
4
|
-
function recordFor(runtime, id) {
|
|
5
|
-
if (!runtime?.store?.get || runtime.store.has?.(id) === false) return null;
|
|
6
|
-
try { return runtime.store.get(id) || null; }
|
|
7
|
-
catch { return null; }
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function unknown(base, reason) { return { ...base, status:'unknown', reason }; }
|
|
11
|
-
|
|
12
|
-
export class SemanticWorldView {
|
|
13
|
-
constructor(runtime) { this.runtime = runtime; }
|
|
14
|
-
|
|
15
|
-
entity(id) {
|
|
16
|
-
const runtime = this.runtime;
|
|
17
|
-
const physical = recordFor(runtime, id);
|
|
18
|
-
const project = Boolean(runtime?.projectCapabilities?.has?.(id));
|
|
19
|
-
if (physical) { const providers=['runtime',...(project?['project']:[]),...(runtime?.thermal?.has?.(id)?['simulation']:[])];
|
|
20
|
-
return { exists:true,source:'runtime',...(providers.length>1?{providers}:{}) }; }
|
|
21
|
-
if (runtime?.affordances?.get?.(id)) return { exists:true, source:'environment' };
|
|
22
|
-
if (project && runtime.projectCapabilities.attachmentOf?.(id) === 'runtime') {
|
|
23
|
-
return { exists:false, source:'none', reason:'PROJECT_ATTACHMENT_TARGET_MISSING' };
|
|
24
|
-
}
|
|
25
|
-
if (project) return { exists:true, source:'project' };
|
|
26
|
-
return { exists:false, source:'none', reason:'OBJECT_NOT_FOUND' };
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
state(targetId, stateKey, {source = null} = {}) {
|
|
30
|
-
const owner = this.entity(targetId);
|
|
31
|
-
const base = { kind:'state', targetId, stateKey, source:source || owner.source };
|
|
32
|
-
if (!owner.exists) return unknown(base, owner.reason || 'OBJECT_NOT_FOUND');
|
|
33
|
-
|
|
34
|
-
const runtime = this.runtime;
|
|
35
|
-
const readers = [];
|
|
36
|
-
const record = recordFor(runtime, targetId);
|
|
37
|
-
if (record) readers.push(['runtime', () => record.state]);
|
|
38
|
-
const environment = runtime?.affordances?.get?.(targetId);
|
|
39
|
-
if (environment) readers.push(['environment', () => {
|
|
40
|
-
if (environment.kind === 'text') {
|
|
41
|
-
const error = new Error('ENVIRONMENT_TEXT_REQUIRES_ACTOR_READ');
|
|
42
|
-
error.code = 'ENVIRONMENT_TEXT_REQUIRES_ACTOR_READ'; throw error;
|
|
43
|
-
}
|
|
44
|
-
return environment.read?.();
|
|
45
|
-
}]);
|
|
46
|
-
if (runtime?.projectCapabilities?.has?.(targetId)) {
|
|
47
|
-
readers.push(['project', () => runtime.projectCapabilities.readState(targetId)]);
|
|
48
|
-
}
|
|
49
|
-
if (runtime?.thermal?.has?.(targetId)) readers.push(['simulation',()=>runtime.thermal.readState(targetId)]);
|
|
50
|
-
const selected = readers.filter(([provider]) => source == null || provider === source);
|
|
51
|
-
if (!selected.length) return unknown(base, 'STATE_PROVIDER_UNAVAILABLE');
|
|
52
|
-
|
|
53
|
-
const found = [];
|
|
54
|
-
for (const [provider, read] of selected) {
|
|
55
|
-
let state;
|
|
56
|
-
try { state = read(); }
|
|
57
|
-
catch (error) { return unknown({ ...base, source:provider }, error?.code === 'ENVIRONMENT_TEXT_REQUIRES_ACTOR_READ'
|
|
58
|
-
? error.code : 'STATE_READ_FAILED'); }
|
|
59
|
-
if (state && typeof state === 'object' && Object.hasOwn(state, stateKey) && state[stateKey] !== undefined) {
|
|
60
|
-
found.push({ provider, value:state[stateKey] });
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (!found.length) return unknown(base, 'STATE_NOT_OBSERVED');
|
|
64
|
-
if (found.length > 1) return unknown({ ...base, source:'multiple',
|
|
65
|
-
providers:found.map(item => item.provider) }, 'STATE_PROVIDER_CONFLICT');
|
|
66
|
-
return { ...base, source:found[0].provider, status:'known',
|
|
67
|
-
value:structuredClone(found[0].value), evidenceKind:'owner-state' };
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
relation({ subject, predicate, object, objectAnyOf, surfaceId } = {}) {
|
|
71
|
-
const targets = objectAnyOf || [object];
|
|
72
|
-
const base = { kind:'relation', subject, predicate, ...(objectAnyOf ? { objectAnyOf:[...objectAnyOf] } : { object }),
|
|
73
|
-
...(surfaceId ? { surfaceId } : {}) };
|
|
74
|
-
const graph = this.runtime?.sceneGraph;
|
|
75
|
-
if (!graph?.list) return { ...base, truth:'unknown', source:'none', reason:'RELATION_GRAPH_UNAVAILABLE' };
|
|
76
|
-
|
|
77
|
-
let unobservable = false;
|
|
78
|
-
try {
|
|
79
|
-
graph.update?.();
|
|
80
|
-
for (const target of targets) {
|
|
81
|
-
const edges = graph.list({ subject, predicate, object:target });
|
|
82
|
-
const matching = edges.find(edge => !surfaceId || edge.meta?.surfaceId === surfaceId);
|
|
83
|
-
if (matching) {
|
|
84
|
-
return { ...base, truth:'true', source:'scene-graph',
|
|
85
|
-
evidenceKind:matching.meta?.evidence || (spatialPredicates.has(predicate) ? 'spatial-relation' : 'declared-relation'),
|
|
86
|
-
evidence:structuredClone(matching) };
|
|
87
|
-
}
|
|
88
|
-
// Absence is a reliable negative only when both objects participate in
|
|
89
|
-
// the active spatial snapshot, or when a known edge has the wrong surface.
|
|
90
|
-
const source = recordFor(this.runtime, subject), destination = recordFor(this.runtime, target);
|
|
91
|
-
const measured = spatialPredicates.has(predicate) && typeof this.runtime?.spatial?.snapshot === 'function'
|
|
92
|
-
&& source?.active !== false && destination?.active !== false && Boolean(source && destination);
|
|
93
|
-
if (!measured && !(surfaceId && edges.length)) unobservable = true;
|
|
94
|
-
}
|
|
95
|
-
} catch {
|
|
96
|
-
return { ...base, truth:'unknown', source:'scene-graph', reason:'RELATION_READ_FAILED' };
|
|
97
|
-
}
|
|
98
|
-
return unobservable
|
|
99
|
-
? { ...base, truth:'unknown', source:'scene-graph', reason:'RELATION_NOT_OBSERVED' }
|
|
100
|
-
: { ...base, truth:'false', source:'scene-graph', reason:'RELATION_NOT_FOUND' };
|
|
101
|
-
}
|
|
102
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
const positiveFinite = (value) => Number.isFinite(value) && value > 0;
|
|
2
|
-
|
|
3
|
-
export class SimulationClock {
|
|
4
|
-
constructor({ fixedDt = 1 / 60, maxSubSteps = 8, maxFrameDelta = 0.25 } = {}) {
|
|
5
|
-
if (!positiveFinite(fixedDt)) throw new TypeError('fixedDt must be greater than zero');
|
|
6
|
-
if (!Number.isInteger(maxSubSteps) || maxSubSteps < 1) throw new TypeError('maxSubSteps must be a positive integer');
|
|
7
|
-
if (!positiveFinite(maxFrameDelta)) throw new TypeError('maxFrameDelta must be greater than zero');
|
|
8
|
-
this.fixedDt = fixedDt;
|
|
9
|
-
this.maxSubSteps = maxSubSteps;
|
|
10
|
-
this.maxFrameDelta = maxFrameDelta;
|
|
11
|
-
this.reset();
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
reset() {
|
|
15
|
-
this.running = false;
|
|
16
|
-
this.tick = 0;
|
|
17
|
-
this.time = 0;
|
|
18
|
-
this.accumulator = 0;
|
|
19
|
-
this.lastTimestamp = null;
|
|
20
|
-
return this.snapshot();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
play() {
|
|
24
|
-
this.running = true;
|
|
25
|
-
this.lastTimestamp = null;
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
pause() {
|
|
30
|
-
this.running = false;
|
|
31
|
-
this.lastTimestamp = null;
|
|
32
|
-
this.accumulator = 0;
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
consume(timestampMs) {
|
|
37
|
-
if (!this.running || !Number.isFinite(timestampMs)) return 0;
|
|
38
|
-
if (this.lastTimestamp == null) {
|
|
39
|
-
this.lastTimestamp = timestampMs;
|
|
40
|
-
return 0;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const elapsed = Math.min(Math.max((timestampMs - this.lastTimestamp) / 1000, 0), this.maxFrameDelta);
|
|
44
|
-
this.lastTimestamp = timestampMs;
|
|
45
|
-
this.accumulator += elapsed;
|
|
46
|
-
|
|
47
|
-
let steps = 0;
|
|
48
|
-
while (this.accumulator + Number.EPSILON >= this.fixedDt && steps < this.maxSubSteps) {
|
|
49
|
-
this.accumulator -= this.fixedDt;
|
|
50
|
-
steps += 1;
|
|
51
|
-
}
|
|
52
|
-
if (steps === this.maxSubSteps) this.accumulator = Math.min(this.accumulator, this.fixedDt);
|
|
53
|
-
return steps;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
advance() {
|
|
57
|
-
this.tick += 1;
|
|
58
|
-
this.time = this.tick * this.fixedDt;
|
|
59
|
-
return this.tick;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
snapshot() {
|
|
63
|
-
return {
|
|
64
|
-
fixedDt: this.fixedDt,
|
|
65
|
-
tick: this.tick,
|
|
66
|
-
time: this.time
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
validateSnapshot(snapshot = {}) {
|
|
71
|
-
if (!snapshot || typeof snapshot !== 'object') throw new TypeError('SimulationClock snapshot must be an object');
|
|
72
|
-
if (snapshot.fixedDt !== this.fixedDt) {
|
|
73
|
-
const error = new Error(`SimulationClock fixedDt mismatch: ${snapshot.fixedDt} != ${this.fixedDt}`);
|
|
74
|
-
error.code = 'SIMULATION_FIXED_DT_MISMATCH';
|
|
75
|
-
throw error;
|
|
76
|
-
}
|
|
77
|
-
if (!Number.isInteger(snapshot.tick) || snapshot.tick < 0) throw new TypeError('SimulationClock snapshot tick must be a non-negative integer');
|
|
78
|
-
return snapshot;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
restore(snapshot = {}) {
|
|
82
|
-
this.validateSnapshot(snapshot);
|
|
83
|
-
this.tick = snapshot.tick;
|
|
84
|
-
this.time = this.tick * this.fixedDt;
|
|
85
|
-
this.accumulator = 0;
|
|
86
|
-
this.lastTimestamp = null;
|
|
87
|
-
return this.snapshot();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { SimulationClock } from './SimulationClock.js';
|
|
2
|
-
|
|
3
|
-
export const SIMULATION_SESSION_SCHEMA = 'agentscape.simulation-session';
|
|
4
|
-
export const SIMULATION_SESSION_VERSION = 1;
|
|
5
|
-
|
|
6
|
-
export class SimulationSession {
|
|
7
|
-
constructor({
|
|
8
|
-
fixedDt = 1 / 60,
|
|
9
|
-
maxSubSteps = 8,
|
|
10
|
-
executeStep,
|
|
11
|
-
snapshotWorld = null,
|
|
12
|
-
restoreWorld = null,
|
|
13
|
-
events = null
|
|
14
|
-
} = {}) {
|
|
15
|
-
if (typeof executeStep !== 'function') throw new TypeError('SimulationSession requires executeStep');
|
|
16
|
-
if (snapshotWorld !== null && typeof snapshotWorld !== 'function') throw new TypeError('snapshotWorld must be a function');
|
|
17
|
-
if (restoreWorld !== null && typeof restoreWorld !== 'function') throw new TypeError('restoreWorld must be a function');
|
|
18
|
-
this.clock = new SimulationClock({ fixedDt, maxSubSteps });
|
|
19
|
-
this.executeStep = executeStep;
|
|
20
|
-
this.snapshotWorld = snapshotWorld;
|
|
21
|
-
this.restoreWorld = restoreWorld;
|
|
22
|
-
this.events = events;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
get fixedDt() { return this.clock.fixedDt; }
|
|
26
|
-
get tick() { return this.clock.tick; }
|
|
27
|
-
get time() { return this.clock.time; }
|
|
28
|
-
get running() { return this.clock.running; }
|
|
29
|
-
|
|
30
|
-
reset() {
|
|
31
|
-
const clock = this.clock.reset();
|
|
32
|
-
this.events?.emit?.('simulation.reset', { tick:clock.tick, time:clock.time, fixedDt:clock.fixedDt });
|
|
33
|
-
return clock;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
play() { return this.clock.play(); }
|
|
37
|
-
pause() { return this.clock.pause(); }
|
|
38
|
-
|
|
39
|
-
step() {
|
|
40
|
-
const tick = this.clock.tick + 1;
|
|
41
|
-
const time = tick * this.fixedDt;
|
|
42
|
-
if (this.executeStep(this.fixedDt, { tick, time }) === false) {
|
|
43
|
-
return { tick:this.tick, time:this.time, dt:0, skipped:true };
|
|
44
|
-
}
|
|
45
|
-
this.clock.advance();
|
|
46
|
-
return { tick:this.tick, time:this.time, dt:this.fixedDt };
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
pump(timestampMs = performance.now()) {
|
|
50
|
-
const count = this.clock.consume(timestampMs);
|
|
51
|
-
for (let index = 0; index < count; index += 1) this.step();
|
|
52
|
-
return count;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
snapshot() {
|
|
56
|
-
if (!this.snapshotWorld) throw new Error('SimulationSession snapshotWorld is not configured');
|
|
57
|
-
return {
|
|
58
|
-
schema: SIMULATION_SESSION_SCHEMA,
|
|
59
|
-
schemaVersion: SIMULATION_SESSION_VERSION,
|
|
60
|
-
exact: false,
|
|
61
|
-
scope: 'canonical-world+clock',
|
|
62
|
-
clock: this.clock.snapshot(),
|
|
63
|
-
world: this.snapshotWorld()
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
async restore(snapshot) {
|
|
68
|
-
this.validateSnapshot(snapshot);
|
|
69
|
-
if (!this.restoreWorld) throw new Error('SimulationSession restoreWorld is not configured');
|
|
70
|
-
const wasRunning = this.running;
|
|
71
|
-
this.pause();
|
|
72
|
-
try {
|
|
73
|
-
await this.restoreWorld(snapshot.world);
|
|
74
|
-
this.clock.restore(snapshot.clock);
|
|
75
|
-
} finally {
|
|
76
|
-
if (wasRunning) this.play();
|
|
77
|
-
}
|
|
78
|
-
this.events?.emit?.('simulation.restored', {
|
|
79
|
-
tick:this.tick,
|
|
80
|
-
time:this.time,
|
|
81
|
-
fixedDt:this.fixedDt,
|
|
82
|
-
exact:false
|
|
83
|
-
});
|
|
84
|
-
return snapshot;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
validateSnapshot(snapshot) {
|
|
88
|
-
if (!snapshot || typeof snapshot !== 'object') throw new TypeError('SimulationSession snapshot must be an object');
|
|
89
|
-
if (snapshot.schema !== SIMULATION_SESSION_SCHEMA || snapshot.schemaVersion !== SIMULATION_SESSION_VERSION) {
|
|
90
|
-
throw new Error('Unsupported SimulationSession snapshot');
|
|
91
|
-
}
|
|
92
|
-
if (snapshot.exact !== false || snapshot.scope !== 'canonical-world+clock') {
|
|
93
|
-
throw new Error('SimulationSession v1 only accepts canonical-world+clock snapshots');
|
|
94
|
-
}
|
|
95
|
-
this.clock.validateSnapshot(snapshot.clock);
|
|
96
|
-
if (!snapshot.world || typeof snapshot.world !== 'object') throw new TypeError('SimulationSession snapshot requires world state');
|
|
97
|
-
return snapshot;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
thermalDefinitions,validateThermalStateForProfile
|
|
3
|
-
} from '../../../../foundation/simulation/SimulationProfile.js';
|
|
4
|
-
|
|
5
|
-
const fail=(code)=>Object.assign(new Error(code),{code});
|
|
6
|
-
const MAX_POWER_W=1e9;
|
|
7
|
-
const ROOT='root';
|
|
8
|
-
const SAMPLE_INTERVAL=0.1;
|
|
9
|
-
const MAX_SAMPLES=600;
|
|
10
|
-
const clone=structuredClone;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* An instance owns one or more independent lumped temperature nodes.
|
|
14
|
-
* Declared internal links and solver-observed external body/part contacts
|
|
15
|
-
* exchange energy symmetrically; nothing here claims chemical or phase change.
|
|
16
|
-
*/
|
|
17
|
-
export class ThermalSystem {
|
|
18
|
-
constructor({physics=null,contactProvider=null,isActive=null}={}) {
|
|
19
|
-
this.physics=physics;
|
|
20
|
-
this.contactProvider=contactProvider;
|
|
21
|
-
this.isActive=isActive||(()=>true);
|
|
22
|
-
this.entries=new Map();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
register(id,definition,{scale=1}={}) {
|
|
26
|
-
if(!definition)return false;
|
|
27
|
-
if(this.entries.has(id))throw fail('THERMAL_ENTITY_CONFLICT');
|
|
28
|
-
const {profile,nodes,links}=thermalDefinitions(definition);
|
|
29
|
-
const entry={
|
|
30
|
-
profile,links,elapsedSec:0,samples:[],
|
|
31
|
-
nodes:new Map(nodes.map(node=>[node.id,{
|
|
32
|
-
...node,baseMassKg:node.massKg,
|
|
33
|
-
baseHeatCapacityJPerK:node.heatCapacityJPerK,
|
|
34
|
-
temperatureK:node.thermal.initialTemperatureK,
|
|
35
|
-
heatPowerW:node.thermal.heatPowerW
|
|
36
|
-
}]))
|
|
37
|
-
};
|
|
38
|
-
this.entries.set(id,entry);
|
|
39
|
-
try {this.setScale(id,scale);this._record(entry);}
|
|
40
|
-
catch(error){this.entries.delete(id);throw error;}
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
has(id){return this.entries.has(id);}
|
|
45
|
-
list(){return [...this.entries].map(([id,entry])=>({
|
|
46
|
-
id,model:entry.profile.model,nodeCount:entry.nodes.size,
|
|
47
|
-
temperatureK:entry.nodes.get(ROOT).temperatureK
|
|
48
|
-
}));}
|
|
49
|
-
remove(id){return this.entries.delete(id);}
|
|
50
|
-
clear(){this.entries.clear();}
|
|
51
|
-
|
|
52
|
-
_node(id,nodeId=ROOT) {
|
|
53
|
-
const node=this.entries.get(id)?.nodes.get(nodeId);
|
|
54
|
-
if(!node)throw fail(this.entries.has(id)?'THERMAL_NODE_NOT_FOUND':'THERMAL_ENTITY_NOT_FOUND');
|
|
55
|
-
return node;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
assertScale(id,scale) {
|
|
59
|
-
const entry=this.entries.get(id);
|
|
60
|
-
if(!entry)return null;
|
|
61
|
-
const volumeFactor=scale**3;
|
|
62
|
-
const changes=[];
|
|
63
|
-
for(const node of entry.nodes.values()){
|
|
64
|
-
const massKg=node.baseMassKg*volumeFactor;
|
|
65
|
-
const heatCapacityJPerK=node.baseHeatCapacityJPerK*volumeFactor;
|
|
66
|
-
if(!Number.isFinite(massKg)||massKg<=0||!Number.isFinite(heatCapacityJPerK)
|
|
67
|
-
||heatCapacityJPerK<=0||heatCapacityJPerK>1e18)
|
|
68
|
-
throw fail('THERMAL_SCALE_INVALID');
|
|
69
|
-
changes.push({id:node.id,massKg,heatCapacityJPerK});
|
|
70
|
-
}
|
|
71
|
-
return changes;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
setScale(id,scale) {
|
|
75
|
-
const changes=this.assertScale(id,scale);
|
|
76
|
-
if(!changes)return;
|
|
77
|
-
for(const next of changes)Object.assign(this._node(id,next.id),{
|
|
78
|
-
massKg:next.massKg,heatCapacityJPerK:next.heatCapacityJPerK
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
readState(id,nodeId=ROOT){
|
|
83
|
-
const node=this.entries.get(id)?.nodes.get(nodeId);
|
|
84
|
-
if(!node)return null;
|
|
85
|
-
return {
|
|
86
|
-
temperatureK:node.temperatureK,
|
|
87
|
-
internalEnergyJ:node.temperatureK*node.heatCapacityJPerK,
|
|
88
|
-
massKg:node.massKg,
|
|
89
|
-
heatCapacityJPerK:node.heatCapacityJPerK,
|
|
90
|
-
heatPowerW:node.heatPowerW
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
inspect(id){
|
|
95
|
-
const entry=this.entries.get(id);
|
|
96
|
-
if(!entry)return null;
|
|
97
|
-
return {
|
|
98
|
-
model:entry.profile.model,evidenceKind:'simulated-lumped-thermal',
|
|
99
|
-
material:clone(entry.nodes.get(ROOT).material),
|
|
100
|
-
state:this.readState(id),
|
|
101
|
-
...(entry.profile.schemaVersion===2 ? {nodes:[...entry.nodes.values()].map(node=>({
|
|
102
|
-
id:node.id,partName:node.partName,material:clone(node.material),
|
|
103
|
-
state:this.readState(id,node.id)
|
|
104
|
-
})),links:clone(entry.links)} : {})
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
setHeatPower(id,powerW,{nodeId=ROOT}={}){
|
|
109
|
-
if(!Number.isFinite(powerW)||Math.abs(powerW)>MAX_POWER_W)
|
|
110
|
-
throw fail('THERMAL_POWER_INVALID');
|
|
111
|
-
this._node(id,nodeId).heatPowerW=powerW;
|
|
112
|
-
this._record(this.entries.get(id));
|
|
113
|
-
return this.readState(id,nodeId);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
capture(id){
|
|
117
|
-
const entry=this.entries.get(id);
|
|
118
|
-
if(!entry)return null;
|
|
119
|
-
if(entry.profile.schemaVersion===1){
|
|
120
|
-
const node=entry.nodes.get(ROOT);
|
|
121
|
-
return {schema:'agentscape.thermal-state',schemaVersion:1,
|
|
122
|
-
temperatureK:node.temperatureK,heatPowerW:node.heatPowerW};
|
|
123
|
-
}
|
|
124
|
-
return {schema:'agentscape.thermal-state',schemaVersion:2,
|
|
125
|
-
nodes:[...entry.nodes.values()].map(node=>({
|
|
126
|
-
id:node.id,temperatureK:node.temperatureK,heatPowerW:node.heatPowerW
|
|
127
|
-
}))};
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
validateState(id,state){
|
|
131
|
-
const entry=this.entries.get(id);
|
|
132
|
-
if(!entry)throw fail('THERMAL_ENTITY_NOT_FOUND');
|
|
133
|
-
try{return validateThermalStateForProfile(entry.profile,state);}
|
|
134
|
-
catch(error){throw fail(error.message==='THERMAL_STATE_NODE_MISMATCH'?'THERMAL_STATE_NODE_MISMATCH':'THERMAL_STATE_INVALID');}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
restore(id,state){
|
|
138
|
-
const validated=this.validateState(id,state);
|
|
139
|
-
const entry=this.entries.get(id);
|
|
140
|
-
if(validated.schemaVersion===1){
|
|
141
|
-
Object.assign(entry.nodes.get(ROOT),{
|
|
142
|
-
temperatureK:validated.temperatureK,heatPowerW:validated.heatPowerW
|
|
143
|
-
});
|
|
144
|
-
} else for(const node of validated.nodes){
|
|
145
|
-
Object.assign(entry.nodes.get(node.id),{
|
|
146
|
-
temperatureK:node.temperatureK,heatPowerW:node.heatPowerW
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
entry.elapsedSec=0;
|
|
150
|
-
entry.samples=[];
|
|
151
|
-
this._record(entry);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
_record(entry) {
|
|
155
|
-
const latest={
|
|
156
|
-
timeSec:entry.elapsedSec,
|
|
157
|
-
nodes:Object.fromEntries([...entry.nodes.values()].map(node=>[node.id,{
|
|
158
|
-
temperatureK:node.temperatureK,
|
|
159
|
-
internalEnergyJ:node.temperatureK*node.heatCapacityJPerK,
|
|
160
|
-
heatPowerW:node.heatPowerW
|
|
161
|
-
}]))
|
|
162
|
-
};
|
|
163
|
-
if(entry.samples.at(-1)?.timeSec===entry.elapsedSec)entry.samples[entry.samples.length-1]=latest;
|
|
164
|
-
else entry.samples.push(latest);
|
|
165
|
-
if(entry.samples.length>MAX_SAMPLES)entry.samples.shift();
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
series(id,{limit=240,nodeId=null}={}){
|
|
169
|
-
const entry=this.entries.get(id);
|
|
170
|
-
if(!entry)throw fail('THERMAL_ENTITY_NOT_FOUND');
|
|
171
|
-
if(!Number.isInteger(limit)||limit<1||limit>MAX_SAMPLES)throw fail('THERMAL_SERIES_LIMIT_INVALID');
|
|
172
|
-
if(nodeId!=null)this._node(id,nodeId);
|
|
173
|
-
const nodes=[...entry.nodes.values()].filter(node=>nodeId==null||node.id===nodeId)
|
|
174
|
-
.map(node=>({id:node.id,partName:node.partName,material:clone(node.material)}));
|
|
175
|
-
const samples=[...entry.samples];
|
|
176
|
-
if(samples.length && samples.at(-1).timeSec<entry.elapsedSec){
|
|
177
|
-
samples.push({timeSec:entry.elapsedSec,
|
|
178
|
-
nodes:Object.fromEntries([...entry.nodes.values()].map(node=>[node.id,{
|
|
179
|
-
temperatureK:node.temperatureK,
|
|
180
|
-
internalEnergyJ:node.temperatureK*node.heatCapacityJPerK,
|
|
181
|
-
heatPowerW:node.heatPowerW
|
|
182
|
-
}]))});
|
|
183
|
-
}
|
|
184
|
-
return {schema:'agentscape.thermal-series',schemaVersion:1,targetId:id,
|
|
185
|
-
model:entry.profile.model,units:{timeSec:'s',temperatureK:'K',internalEnergyJ:'J',heatPowerW:'W'},
|
|
186
|
-
nodes,samples:samples.slice(-limit).map(sample=>({
|
|
187
|
-
timeSec:sample.timeSec,
|
|
188
|
-
nodes:Object.fromEntries(nodes.map(node=>[node.id,clone(sample.nodes[node.id])]))
|
|
189
|
-
}))
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
contactPairs(ids) {
|
|
194
|
-
if(this.contactProvider)return this.contactProvider(ids);
|
|
195
|
-
if(this.physics?.contactPartPairs)return this.physics.contactPartPairs(ids);
|
|
196
|
-
return this.physics?.contactObjectPairs?.(ids)||[];
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
step(dt){
|
|
200
|
-
if(!Number.isFinite(dt)||dt<0)throw fail('THERMAL_STEP_INVALID');
|
|
201
|
-
if(dt===0||!this.entries.size)return;
|
|
202
|
-
const active=[...this.entries].filter(([id])=>this.isActive(id)).sort(([a],[b])=>a.localeCompare(b));
|
|
203
|
-
if(!active.length)return;
|
|
204
|
-
const values=[],index=new Map(),partIndex=new Map();
|
|
205
|
-
for(const [objectId,entry] of active){
|
|
206
|
-
for(const node of entry.nodes.values()){
|
|
207
|
-
const slot=values.length;
|
|
208
|
-
values.push({objectId,entry,node});
|
|
209
|
-
index.set(objectId+'\u0000'+node.id,slot);
|
|
210
|
-
partIndex.set(objectId+'\u0000'+node.partName,slot);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
const edges=[];
|
|
215
|
-
for(const [objectId,entry] of active){
|
|
216
|
-
for(const link of entry.links)edges.push({
|
|
217
|
-
a:index.get(objectId+'\u0000'+link.from),
|
|
218
|
-
b:index.get(objectId+'\u0000'+link.to),
|
|
219
|
-
g:link.conductanceWPerK
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
const contactOwners=new Set(values.filter(({node})=>node.thermal.contactConductanceWPerK>0)
|
|
224
|
-
.map(({objectId})=>objectId));
|
|
225
|
-
if(contactOwners.size>=2){
|
|
226
|
-
const seen=new Set();
|
|
227
|
-
for(const pair of this.contactPairs([...contactOwners])){
|
|
228
|
-
const a=partIndex.get((pair.sourceId||pair.source?.objectId)+'\u0000'+
|
|
229
|
-
(pair.sourcePartName||pair.source?.partName||'$root'));
|
|
230
|
-
const b=partIndex.get((pair.targetId||pair.target?.objectId)+'\u0000'+
|
|
231
|
-
(pair.targetPartName||pair.target?.partName||'$root'));
|
|
232
|
-
if(a==null||b==null||a===b||values[a].objectId===values[b].objectId)continue;
|
|
233
|
-
const key=[Math.min(a,b),Math.max(a,b)].join(':');
|
|
234
|
-
if(seen.has(key))continue;
|
|
235
|
-
seen.add(key);
|
|
236
|
-
const ga=values[a].node.thermal.contactConductanceWPerK;
|
|
237
|
-
const gb=values[b].node.thermal.contactConductanceWPerK;
|
|
238
|
-
if(ga>0&&gb>0)edges.push({a,b,g:ga*gb/(ga+gb)});
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
const rates=values.map(({node})=>node.thermal.ambientConductanceWPerK);
|
|
243
|
-
for(const {a,b,g} of edges){rates[a]+=g;rates[b]+=g;}
|
|
244
|
-
const substeps=Math.max(1,Math.ceil(dt*Math.max(...values.map(({node},i)=>
|
|
245
|
-
rates[i]/node.heatCapacityJPerK))/0.25));
|
|
246
|
-
if(substeps>1024)throw fail('THERMAL_STEP_TOO_STIFF');
|
|
247
|
-
const h=dt/substeps;
|
|
248
|
-
let temps=values.map(({node})=>node.temperatureK);
|
|
249
|
-
for(let n=0;n<substeps;n++){
|
|
250
|
-
const q=values.map(({node},i)=>{
|
|
251
|
-
const t=node.thermal;
|
|
252
|
-
return (node.heatPowerW+t.ambientConductanceWPerK*(t.ambientTemperatureK-temps[i]))*h;
|
|
253
|
-
});
|
|
254
|
-
for(const {a,b,g} of edges){
|
|
255
|
-
const dq=g*(temps[b]-temps[a])*h;
|
|
256
|
-
q[a]+=dq;q[b]-=dq;
|
|
257
|
-
}
|
|
258
|
-
const next=temps.map((t,i)=>t+q[i]/values[i].node.heatCapacityJPerK);
|
|
259
|
-
if(next.some(t=>!Number.isFinite(t)||t<0||t>1e6))throw fail('THERMAL_STATE_OUT_OF_RANGE');
|
|
260
|
-
temps=next;
|
|
261
|
-
}
|
|
262
|
-
for(let i=0;i<values.length;i++)values[i].node.temperatureK=temps[i];
|
|
263
|
-
for(const [,entry] of active){
|
|
264
|
-
entry.elapsedSec+=dt;
|
|
265
|
-
if(entry.elapsedSec-(entry.samples.at(-1)?.timeSec??0)>=SAMPLE_INTERVAL-1e-8)
|
|
266
|
-
this._record(entry);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
|
|
3
|
-
const rounded = (vector) => vector.toArray().map((value) => Number(value.toFixed(3)));
|
|
4
|
-
|
|
5
|
-
export function spatialSnapshotEntry(id, object) {
|
|
6
|
-
const box = new THREE.Box3().setFromObject(object);
|
|
7
|
-
const size = box.getSize(new THREE.Vector3());
|
|
8
|
-
const center = box.getCenter(new THREE.Vector3());
|
|
9
|
-
return {
|
|
10
|
-
id,
|
|
11
|
-
box,
|
|
12
|
-
center,
|
|
13
|
-
size,
|
|
14
|
-
bounds: { id, min: rounded(box.min), max: rounded(box.max), center: rounded(center), size: rounded(size) }
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function objectWorldPosition(object) {
|
|
19
|
-
return object.getWorldPosition(new THREE.Vector3());
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function translateSpatialEntry(entry, delta) {
|
|
23
|
-
const offset = delta?.isVector3 ? delta : new THREE.Vector3(...delta);
|
|
24
|
-
const box = entry.box.clone().translate(offset);
|
|
25
|
-
const center = entry.center.clone().add(offset);
|
|
26
|
-
const size = entry.size.clone();
|
|
27
|
-
return {
|
|
28
|
-
id: entry.id,
|
|
29
|
-
box,
|
|
30
|
-
center,
|
|
31
|
-
size,
|
|
32
|
-
bounds: {
|
|
33
|
-
id: entry.id,
|
|
34
|
-
min: rounded(box.min),
|
|
35
|
-
max: rounded(box.max),
|
|
36
|
-
center: rounded(center),
|
|
37
|
-
size: rounded(size)
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function spatialEntryAtRootPosition(entry, currentRootPosition, candidateRootPosition) {
|
|
43
|
-
const current = currentRootPosition?.isVector3 ? currentRootPosition : new THREE.Vector3(...currentRootPosition);
|
|
44
|
-
const candidate = candidateRootPosition?.isVector3 ? candidateRootPosition : new THREE.Vector3(...candidateRootPosition);
|
|
45
|
-
return translateSpatialEntry(entry, candidate.clone().sub(current));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function boxesOverlap(left, right, margin = 0) {
|
|
49
|
-
const inset = Math.max(0, Number.isFinite(margin) ? margin : 0);
|
|
50
|
-
const aminX = left.min.x + inset, aminY = left.min.y + inset, aminZ = left.min.z + inset;
|
|
51
|
-
const amaxX = left.max.x - inset, amaxY = left.max.y - inset, amaxZ = left.max.z - inset;
|
|
52
|
-
const bminX = right.min.x + inset, bminY = right.min.y + inset, bminZ = right.min.z + inset;
|
|
53
|
-
const bmaxX = right.max.x - inset, bmaxY = right.max.y - inset, bmaxZ = right.max.z - inset;
|
|
54
|
-
if (aminX > amaxX || aminY > amaxY || aminZ > amaxZ || bminX > bmaxX || bminY > bmaxY || bminZ > bmaxZ) return false;
|
|
55
|
-
return aminX <= bmaxX && amaxX >= bminX && aminY <= bmaxY && amaxY >= bminY && aminZ <= bmaxZ && amaxZ >= bminZ;
|
|
56
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import { acceleratedRaycast, computeBoundsTree, disposeBoundsTree } from "three-mesh-bvh";
|
|
3
|
-
|
|
4
|
-
let installed = false;
|
|
5
|
-
|
|
6
|
-
export function installThreeBvhRuntime() {
|
|
7
|
-
THREE.BufferGeometry.prototype.computeBoundsTree = computeBoundsTree;
|
|
8
|
-
THREE.BufferGeometry.prototype.disposeBoundsTree = disposeBoundsTree;
|
|
9
|
-
THREE.Mesh.prototype.raycast = acceleratedRaycast;
|
|
10
|
-
installed = true;
|
|
11
|
-
return bvhRuntimeStatus();
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function bvhRuntimeStatus() {
|
|
15
|
-
return {
|
|
16
|
-
installed: installed
|
|
17
|
-
&& THREE.BufferGeometry.prototype.computeBoundsTree === computeBoundsTree
|
|
18
|
-
&& THREE.BufferGeometry.prototype.disposeBoundsTree === disposeBoundsTree
|
|
19
|
-
&& THREE.Mesh.prototype.raycast === acceleratedRaycast,
|
|
20
|
-
raycast: THREE.Mesh.prototype.raycast === acceleratedRaycast ? "three-mesh-bvh" : "three-default"
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function ensureBoundsTrees(root) {
|
|
25
|
-
let meshCount = 0;
|
|
26
|
-
let builtCount = 0;
|
|
27
|
-
root?.traverse?.((node) => {
|
|
28
|
-
if (!node.isMesh || !node.geometry) return;
|
|
29
|
-
meshCount += 1;
|
|
30
|
-
if (!node.geometry.boundsTree) {
|
|
31
|
-
node.geometry.computeBoundsTree?.();
|
|
32
|
-
if (node.geometry.boundsTree) builtCount += 1;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
return { meshCount, builtCount };
|
|
36
|
-
}
|