agentscape3d-engine 0.0.0-stage → 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +19 -2
- package/cli.mjs +53 -0
- package/dist/AssetCompiler-A99wKf7H.js +2424 -0
- package/dist/AssetCompiler-A99wKf7H.js.map +1 -0
- package/dist/AssetInputContracts-uKYeQu-X.js +245 -0
- package/dist/AssetInputContracts-uKYeQu-X.js.map +1 -0
- package/dist/AssetRecipe-DCaLLXvG.js +67 -0
- package/dist/AssetRecipe-DCaLLXvG.js.map +1 -0
- package/dist/BrowserCodeWorker.js +53850 -0
- package/dist/BrowserCodeWorker.js.map +1 -0
- package/dist/KinematicHypothesisScreen-4v7GBwdv.js +241 -0
- package/dist/KinematicHypothesisScreen-4v7GBwdv.js.map +1 -0
- package/dist/SceneSerializer-CLCzQjL_.js +350 -0
- package/dist/SceneSerializer-CLCzQjL_.js.map +1 -0
- package/dist/StylePack-CD_BC-Mv.js +6317 -0
- package/dist/StylePack-CD_BC-Mv.js.map +1 -0
- package/dist/WorldArchive-dYf1OpSe.js +417 -0
- package/dist/WorldArchive-dYf1OpSe.js.map +1 -0
- package/dist/WorldIO-Dqz4MqTQ.js +149 -0
- package/dist/WorldIO-Dqz4MqTQ.js.map +1 -0
- package/dist/blankWorld-OoOvN_IK.js +75 -0
- package/dist/blankWorld-OoOvN_IK.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-B3HCflvO.js +128 -0
- package/dist/disposeObject3D-B3HCflvO.js.map +1 -0
- package/dist/environments-B1WaICAN.js +4197 -0
- package/dist/environments-B1WaICAN.js.map +1 -0
- package/dist/gltfIO-BMK1hc2D.js +9 -0
- package/dist/gltfIO-BMK1hc2D.js.map +1 -0
- package/dist/grandUrbanBlock-Bdjgc6ZT.js +515 -0
- package/dist/grandUrbanBlock-Bdjgc6ZT.js.map +1 -0
- package/dist/index.d.ts +275 -0
- package/dist/index.js +16239 -0
- package/dist/index.js.map +1 -0
- package/dist/magicCabin-DPQi_jh-.js +11019 -0
- package/dist/magicCabin-DPQi_jh-.js.map +1 -0
- package/dist/mcp.d.ts +2 -0
- package/dist/mcp.js +1 -0
- package/dist/monumentHall-IOLbRZQC.js +403 -0
- package/dist/monumentHall-IOLbRZQC.js.map +1 -0
- package/dist/node.d.ts +16 -0
- package/dist/node.js +26 -0
- package/dist/rolldown-runtime-D3KUYPsf.js +12 -0
- package/dist/ruinedCourtyard-BtaF_aOi.js +696 -0
- package/dist/ruinedCourtyard-BtaF_aOi.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 +8 -0
- package/dist/runtime/application/buildTaskObservation.js +117 -0
- package/dist/runtime/application/code-execution/AuthoringSandboxEntry.js +46 -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 +72 -0
- package/dist/runtime/application/createSession.js +66 -0
- package/dist/runtime/application/createWorldAuthoringContext.js +400 -0
- package/dist/runtime/application/generation/GenerationOrchestrator.js +629 -0
- package/dist/runtime/application/generation/GenerationRuntime.js +214 -0
- package/dist/runtime/application/generation/PromptHybridWorldOrchestrator.js +285 -0
- package/dist/runtime/application/native-scene/CodeProject.js +119 -0
- package/dist/runtime/application/native-scene/CodeProjectModules.js +128 -0
- package/dist/runtime/application/native-scene/NativeEnvironmentGeometry.js +62 -0
- package/dist/runtime/application/native-scene/NativeOverlayCheckpoint.js +127 -0
- package/dist/runtime/application/native-scene/NativeRenderDiscovery.js +51 -0
- package/dist/runtime/application/native-scene/NativeSceneHost.js +319 -0
- package/dist/runtime/application/native-scene/NativeSceneOverlay.js +116 -0
- package/dist/runtime/application/native-scene/NativeThreeModule.js +16 -0
- package/dist/runtime/application/object-forge/SceneObjectForge.js +232 -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 +79 -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 +45 -0
- package/dist/runtime/application/scene/SceneEditService.js +144 -0
- package/dist/runtime/application/scene/SceneFacade.js +261 -0
- package/dist/runtime/application/scene/SceneInteractionAdapters.js +40 -0
- package/dist/runtime/application/scene/SceneJobController.js +229 -0
- package/dist/runtime/application/scene/SceneLifecycle.js +57 -0
- package/dist/runtime/application/scene/ScenePackage.js +162 -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 +87 -0
- package/dist/runtime/application/scene/WorldDirectory.js +20 -0
- package/dist/runtime/application/scene/WorldDocument.js +74 -0
- package/dist/runtime/application/scene/WorldIO.js +103 -0
- package/dist/runtime/application/scene/WorldStorage.js +137 -0
- package/dist/runtime/application/skills/SkillRegistry.js +189 -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 +174 -0
- package/dist/runtime/application/world-authoring/ModelRef.js +62 -0
- package/dist/runtime/apps/mcp-server/AUTHORING.md +71 -0
- package/dist/runtime/apps/mcp-server/AgentMcpCompat.js +77 -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 +132 -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 +150 -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 +80 -0
- package/dist/runtime/apps/mcp-server/StudioBridgeHttp.js +58 -0
- package/dist/runtime/apps/mcp-server/StudioLiveBridge.js +190 -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 +65 -0
- package/dist/runtime/apps/mcp-server/registerTools.js +225 -0
- package/dist/runtime/apps/mcp-server/sandbox/run.mjs +23 -0
- package/dist/runtime/apps/mcp-server/security.js +21 -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/WorldDiskStorage.js +51 -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/foundation/EventBus.js +18 -0
- package/dist/runtime/foundation/JsonGateway.js +47 -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 +399 -0
- package/dist/runtime/modules/asset/README.md +54 -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 +100 -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/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 +47 -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 +245 -0
- package/dist/runtime/modules/physics/JoltPhysicsBackend.js +850 -0
- package/dist/runtime/modules/physics/PhysicsApiSurface.js +651 -0
- package/dist/runtime/modules/physics/PhysicsBackend.js +88 -0
- package/dist/runtime/modules/physics/RapierPhysicsBackend.js +410 -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/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 +80 -0
- package/dist/runtime/modules/world/runtime/EntityCapabilityRegistry.js +150 -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 +207 -0
- package/dist/runtime/modules/world/runtime/SceneSerializer.js +246 -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 +502 -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 +665 -0
- package/dist/runtime/modules/world/runtime/affordance/ObjectAffordances.js +107 -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 +305 -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 +222 -0
- package/dist/runtime/modules/world/runtime/interaction/InteractionApproach.js +130 -0
- package/dist/runtime/modules/world/runtime/interaction/InteractionContract.js +57 -0
- package/dist/runtime/modules/world/runtime/interaction/RecoveryRuntime.js +123 -0
- package/dist/runtime/modules/world/runtime/interaction/SettleRuntime.js +120 -0
- package/dist/runtime/modules/world/runtime/semantic/SemanticWorldView.js +102 -0
- package/dist/runtime/modules/world/runtime/simulation/SimulationClock.js +89 -0
- package/dist/runtime/modules/world/runtime/simulation/SimulationSession.js +99 -0
- package/dist/runtime/modules/world/runtime/simulation/ThermalSystem.js +269 -0
- package/dist/runtime/modules/world/runtime/spatial/SpatialSnapshot.js +56 -0
- package/dist/runtime/modules/world/runtime/systems/AudioSystem.js +125 -0
- package/dist/runtime/modules/world/runtime/systems/Instrument.js +38 -0
- package/dist/runtime/modules/world/runtime/systems/InteractionSystem.js +728 -0
- package/dist/runtime/modules/world/runtime/systems/LocomotionSystem.js +269 -0
- package/dist/runtime/modules/world/runtime/systems/NavigationSystem.js +469 -0
- package/dist/runtime/modules/world/runtime/systems/PhysicsSystem.js +1673 -0
- package/dist/runtime/modules/world/runtime/systems/RenderingSystem.js +457 -0
- package/dist/runtime/modules/world/runtime/systems/SpatialSystem.js +284 -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 +69 -0
- package/dist/runtime/modules/world/verification/RepairEngine.js +49 -0
- package/dist/runtime/modules/world/verification/WorldAcceptance.js +158 -0
- package/dist/runtime/modules/world/verification/WorldValidator.js +65 -0
- package/dist/runtime/package-lock.json +16048 -0
- package/dist/runtime/package.json +105 -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-BWpTl0Wj.js +359 -0
- package/dist/schema-BWpTl0Wj.js.map +1 -0
- package/dist/suzhouGarden-H9tiPgxq.js +6150 -0
- package/dist/suzhouGarden-H9tiPgxq.js.map +1 -0
- package/dist/woodlandWorkshop-D6zzSbHr.js +483 -0
- package/dist/woodlandWorkshop-D6zzSbHr.js.map +1 -0
- package/dist/yuanmingyuan-D6IHqjZ-.js +4955 -0
- package/dist/yuanmingyuan-D6IHqjZ-.js.map +1 -0
- package/package.json +70 -4
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { createRequestWindow } from '../../application/scene/RequestWindow.js';
|
|
2
|
+
import { randomBytes, randomUUID, timingSafeEqual } from 'node:crypto';
|
|
3
|
+
|
|
4
|
+
const issue = (code) => Object.assign(new Error(code), {code});
|
|
5
|
+
const secret = () => randomBytes(32).toString('hex');
|
|
6
|
+
const equal = (left, right) => typeof left === 'string' && typeof right === 'string'
|
|
7
|
+
&& left.length === right.length && timingSafeEqual(Buffer.from(left),Buffer.from(right));
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Ephemeral transport, not a second WorldRuntime.
|
|
11
|
+
* Studio owns the only Runtime; MCP supplies authenticated and bounded commands.
|
|
12
|
+
* Browser pairing requires a human-delivered one-time capability (not the MCP Bearer token).
|
|
13
|
+
*/
|
|
14
|
+
export class StudioLiveBridge {
|
|
15
|
+
constructor({now=()=>Date.now(),pairTtlMs=120000,heartbeatMs=30000,rpcTimeoutMs=30000}={}) {
|
|
16
|
+
this.now=now;
|
|
17
|
+
this.pairTtlMs=pairTtlMs;
|
|
18
|
+
this.heartbeatMs=heartbeatMs;
|
|
19
|
+
this.rpcTimeoutMs=rpcTimeoutMs;
|
|
20
|
+
this.sessions=new Map();
|
|
21
|
+
this.autoByInstance=new Map();
|
|
22
|
+
this.autoOwnerHistory=new Map(); // Short-lived tab binding across disconnect/reconnect.
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
pair(owner) {
|
|
26
|
+
if(!owner)throw issue('OWNER_REQUIRED');
|
|
27
|
+
for(const [id,entry] of this.sessions)if(!entry.connected&&this.now()>entry.expiresAt)this.disconnect(id,'PAIR_CODE_EXPIRED');
|
|
28
|
+
if([...this.sessions.values()].filter(entry=>entry.owner===owner).length>=4)throw issue('STUDIO_SESSION_LIMIT');
|
|
29
|
+
if(this.sessions.size>=32)throw issue('STUDIO_SESSION_LIMIT');
|
|
30
|
+
const worldSessionId=randomUUID(),pairCode=secret();
|
|
31
|
+
this.sessions.set(worldSessionId,{owner,pairCode,expiresAt:this.now()+this.pairTtlMs,
|
|
32
|
+
token:null,connected:false,lastSeen:0,pending:new Map(),requests:createRequestWindow({now:this.now}),queue:[],pollWaiter:null});
|
|
33
|
+
return {worldSessionId,pairCode,expiresInSeconds:Math.ceil(this.pairTtlMs/1000),status:'awaiting-studio'};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Loopback auto mode: an approved local Studio origin registers a live tab.
|
|
38
|
+
* No MCP bearer is exposed to the browser; all Scene tools still require MCP auth.
|
|
39
|
+
*/
|
|
40
|
+
registerAuto(instanceId,worldId) {
|
|
41
|
+
if(typeof instanceId!=='string'||!/^[a-f0-9-]{36}$/i.test(instanceId))throw issue('STUDIO_INSTANCE_INVALID');
|
|
42
|
+
if(typeof worldId!=='string'||worldId.length>128||!worldId.length)throw issue('STUDIO_WORLD_INVALID');
|
|
43
|
+
for(const [id,session] of this.sessions) {
|
|
44
|
+
if(session.auto && (!session.connected||this.now()-session.lastSeen>this.heartbeatMs))this.disconnect(id,'STUDIO_DISCONNECTED');
|
|
45
|
+
}
|
|
46
|
+
const previous=this.autoByInstance.get(instanceId);
|
|
47
|
+
for(const [key,entry] of this.autoOwnerHistory)if(entry.expiresAt<=this.now())this.autoOwnerHistory.delete(key);
|
|
48
|
+
const previousOwner=(previous?this.sessions.get(previous)?.owner:null)??this.autoOwnerHistory.get(instanceId)?.owner??null;
|
|
49
|
+
if(previous)this.disconnect(previous,'STUDIO_REPLACED');
|
|
50
|
+
if(this.autoByInstance.size>=8)throw issue('STUDIO_TAB_LIMIT');
|
|
51
|
+
const worldSessionId=randomUUID(),token=secret();
|
|
52
|
+
this.sessions.set(worldSessionId,{
|
|
53
|
+
owner:previousOwner,auto:true,instanceId,worldId,pairCode:null,expiresAt:0,
|
|
54
|
+
token,connected:true,lastSeen:this.now(),pending:new Map(),requests:createRequestWindow({now:this.now}),queue:[],pollWaiter:null
|
|
55
|
+
});
|
|
56
|
+
this.autoByInstance.set(instanceId,worldSessionId);
|
|
57
|
+
return {worldSessionId,studioToken:token,status:'connected',mode:'automatic',worldId};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
currentSession(owner=null) {
|
|
61
|
+
const active=[];
|
|
62
|
+
for(const [id,s] of this.sessions){
|
|
63
|
+
if(!s.auto)continue;
|
|
64
|
+
if(!s.connected||this.now()-s.lastSeen>this.heartbeatMs){this.disconnect(id,'STUDIO_DISCONNECTED');continue;}
|
|
65
|
+
if(owner!=null && s.owner!=null && s.owner!==owner)continue;
|
|
66
|
+
active.push({worldSessionId:id,worldId:s.worldId,status:'connected',connected:true,mode:'automatic'});
|
|
67
|
+
}
|
|
68
|
+
if(!active.length)throw issue('STUDIO_NOT_CONNECTED');
|
|
69
|
+
if(active.length>1)throw issue('STUDIO_MULTIPLE_WORLDS');
|
|
70
|
+
if(owner!=null)this.ownerSession(owner,active[0].worldSessionId);
|
|
71
|
+
return active[0];
|
|
72
|
+
}
|
|
73
|
+
isStudioSession(id) {return this.sessions.has(id);}
|
|
74
|
+
ownerSession(owner,id) {
|
|
75
|
+
const s=this.sessions.get(id);
|
|
76
|
+
if(!s||(s.owner!=null && s.owner!==owner))throw issue('SESSION_NOT_FOUND');
|
|
77
|
+
if(s.auto && s.owner==null){if(!owner)throw issue('OWNER_REQUIRED');s.owner=owner;}
|
|
78
|
+
return s;
|
|
79
|
+
}
|
|
80
|
+
status(owner,id) {
|
|
81
|
+
const s=this.ownerSession(owner,id);
|
|
82
|
+
if(s.connected&&this.now()-s.lastSeen>this.heartbeatMs)this.disconnect(id,'STUDIO_DISCONNECTED');
|
|
83
|
+
return {worldSessionId:id,mode:s.auto?'automatic':'paired',worldId:s.worldId||null,status:s.connected?'connected':s.pairCode&&this.now()<s.expiresAt?'awaiting-studio':'disconnected',
|
|
84
|
+
connected:s.connected,lastSeen:s.lastSeen||null};
|
|
85
|
+
}
|
|
86
|
+
connect(pairCode) {
|
|
87
|
+
const candidate=[...this.sessions.entries()].find(([,s])=>s.pairCode&&equal(s.pairCode,pairCode));
|
|
88
|
+
if(!candidate)throw issue('PAIR_CODE_INVALID');
|
|
89
|
+
const [id,s]=candidate;
|
|
90
|
+
if(this.now()>s.expiresAt) {this.disconnect(id,'PAIR_CODE_EXPIRED');throw issue('PAIR_CODE_EXPIRED');}
|
|
91
|
+
s.pairCode=null;
|
|
92
|
+
s.token=secret();
|
|
93
|
+
s.connected=true;
|
|
94
|
+
s.lastSeen=this.now();
|
|
95
|
+
return {worldSessionId:id,studioToken:s.token,status:'connected'};
|
|
96
|
+
}
|
|
97
|
+
authorized(id,token) {
|
|
98
|
+
const s=this.sessions.get(id);
|
|
99
|
+
if(!s||!s.connected||!equal(s.token,token))throw issue('STUDIO_AUTH_FAILED');
|
|
100
|
+
if(this.now()-s.lastSeen>this.heartbeatMs) {this.disconnect(id,'STUDIO_DISCONNECTED');throw issue('STUDIO_DISCONNECTED');}
|
|
101
|
+
return s;
|
|
102
|
+
}
|
|
103
|
+
async poll(id,token) {
|
|
104
|
+
const s=this.authorized(id,token);
|
|
105
|
+
s.lastSeen=this.now();
|
|
106
|
+
if(s.queue.length)return {request:s.queue.shift()};
|
|
107
|
+
// Poll has its own short deadline to allow rapid disconnect and heartbeat.
|
|
108
|
+
if(s.pollWaiter)throw issue('STUDIO_POLL_CONFLICT');
|
|
109
|
+
return new Promise(resolve=>{
|
|
110
|
+
const timer=setTimeout(()=>{
|
|
111
|
+
if(s.pollWaiter?.resolve===resolve)s.pollWaiter=null;
|
|
112
|
+
resolve({request:null});
|
|
113
|
+
},8000);
|
|
114
|
+
timer.unref?.();
|
|
115
|
+
s.pollWaiter={resolve,timer};
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
reply(id,token,{requestId,result,error}) {
|
|
119
|
+
const s=this.authorized(id,token);
|
|
120
|
+
s.lastSeen=this.now();
|
|
121
|
+
const pending=s.pending.get(requestId);
|
|
122
|
+
if(!pending)throw issue('STUDIO_REQUEST_NOT_FOUND');
|
|
123
|
+
s.pending.delete(requestId);
|
|
124
|
+
clearTimeout(pending.timer);
|
|
125
|
+
if(error)pending.reject(issue(typeof error.code==='string'&&/^[A-Z_]+$/.test(error.code)?error.code:'STUDIO_OPERATION_FAILED'));
|
|
126
|
+
else pending.resolve(result);
|
|
127
|
+
return {status:'accepted'};
|
|
128
|
+
}
|
|
129
|
+
async call(owner,id,method,args,{signal,requestId}={}) {
|
|
130
|
+
const s=this.ownerSession(owner,id);
|
|
131
|
+
if(!s.connected||this.now()-s.lastSeen>this.heartbeatMs){
|
|
132
|
+
this.disconnect(id,'STUDIO_DISCONNECTED');
|
|
133
|
+
throw issue('STUDIO_DISCONNECTED');
|
|
134
|
+
}
|
|
135
|
+
const fingerprint=requestId?JSON.stringify([method,args]):null;
|
|
136
|
+
const replay=s.requests.replay(requestId,fingerprint);
|
|
137
|
+
if(replay)return replay;
|
|
138
|
+
if(requestId)s.requests.ensureCapacity();
|
|
139
|
+
if(s.pending.size>=1)throw issue('STUDIO_BUSY');
|
|
140
|
+
if(signal?.aborted)throw issue('ACTION_CANCELLED');
|
|
141
|
+
const transportId=randomUUID();
|
|
142
|
+
const promise=new Promise((resolve,reject)=>{
|
|
143
|
+
const cancel=()=>{const item=s.pending.get(transportId);if(!item)return;clearTimeout(item.timer);s.pending.delete(transportId);s.queue=s.queue.filter(item=>item.requestId!==transportId);item.reject(issue('ACTION_CANCELLED'));};
|
|
144
|
+
const timer=setTimeout(()=>{
|
|
145
|
+
s.pending.delete(transportId);
|
|
146
|
+
s.queue=s.queue.filter(item=>item.requestId!==transportId);
|
|
147
|
+
signal?.removeEventListener('abort',cancel);
|
|
148
|
+
reject(issue('STUDIO_TIMEOUT'));
|
|
149
|
+
},this.rpcTimeoutMs);
|
|
150
|
+
timer.unref?.();
|
|
151
|
+
const pending={
|
|
152
|
+
timer,
|
|
153
|
+
resolve:value=>{signal?.removeEventListener('abort',cancel);resolve(value);},
|
|
154
|
+
reject:error=>{signal?.removeEventListener('abort',cancel);reject(error);}
|
|
155
|
+
};
|
|
156
|
+
s.pending.set(transportId,pending);
|
|
157
|
+
signal?.addEventListener('abort',cancel,{once:true});
|
|
158
|
+
const request={requestId:transportId,method,args};
|
|
159
|
+
if(s.pollWaiter){
|
|
160
|
+
clearTimeout(s.pollWaiter.timer);
|
|
161
|
+
const waiter=s.pollWaiter;s.pollWaiter=null;
|
|
162
|
+
waiter.resolve({request});
|
|
163
|
+
}else s.queue.push(request);
|
|
164
|
+
});
|
|
165
|
+
if(requestId){
|
|
166
|
+
s.requests.track(requestId,fingerprint,promise);
|
|
167
|
+
}
|
|
168
|
+
return promise;
|
|
169
|
+
}
|
|
170
|
+
disconnect(id,reason='STUDIO_DISCONNECTED') {
|
|
171
|
+
const s=this.sessions.get(id);
|
|
172
|
+
if(!s)return false;
|
|
173
|
+
this.sessions.delete(id);
|
|
174
|
+
if(s.auto && this.autoByInstance.get(s.instanceId)===id)this.autoByInstance.delete(s.instanceId);
|
|
175
|
+
if(s.auto && s.owner!=null){
|
|
176
|
+
this.autoOwnerHistory.delete(s.instanceId);
|
|
177
|
+
this.autoOwnerHistory.set(s.instanceId,{owner:s.owner,expiresAt:this.now()+10*60_000});
|
|
178
|
+
while(this.autoOwnerHistory.size>64)this.autoOwnerHistory.delete(this.autoOwnerHistory.keys().next().value);
|
|
179
|
+
}
|
|
180
|
+
s.connected=false;
|
|
181
|
+
if(s.pollWaiter){
|
|
182
|
+
clearTimeout(s.pollWaiter.timer);s.pollWaiter.resolve({request:null});s.pollWaiter=null;
|
|
183
|
+
}
|
|
184
|
+
for(const pending of s.pending.values()){clearTimeout(pending.timer);pending.reject(issue(reason));}
|
|
185
|
+
s.pending.clear();s.queue.length=0;
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
close(owner,id) {this.ownerSession(owner,id);this.disconnect(id);return {worldSessionId:id,status:'disconnected'};}
|
|
189
|
+
dispose(){for(const id of [...this.sessions.keys()])this.disconnect(id);this.autoOwnerHistory.clear();}
|
|
190
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { parentPort, workerData } from 'node:worker_threads';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import { serializeAsset, execute } from './AuthoringSandboxEntry.js';
|
|
4
|
+
|
|
5
|
+
// Explicitly trusted Node code: filesystem/network access is NOT isolated.
|
|
6
|
+
try {
|
|
7
|
+
let document;
|
|
8
|
+
if(workerData.mode === 'procedural') {
|
|
9
|
+
const module = await import(`data:text/javascript;base64,${Buffer.from(workerData.source).toString('base64')}`);
|
|
10
|
+
if(typeof module.createAsset !== 'function')throw new Error('PROCEDURAL_ENTRY_REQUIRED');
|
|
11
|
+
document = serializeAsset(await module.createAsset(THREE));
|
|
12
|
+
} else document = execute(workerData.code, workerData.document);
|
|
13
|
+
const json = JSON.stringify(document);
|
|
14
|
+
if (json.length > 2097152) throw new Error('BUILD_OUTPUT_LIMIT');
|
|
15
|
+
parentPort.postMessage({ json });
|
|
16
|
+
} catch (error) { parentPort.postMessage({ error: String(error.message).slice(0, 500) }); }
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# 验证记录
|
|
2
|
+
|
|
3
|
+
## v0.3 程序化资产发布与世界恢复
|
|
4
|
+
|
|
5
|
+
2026-11-04,功能分支 `feat/mcp-programmatic-assets`,在 v0.2 上扩展原 MCP,未创建第二套服务或编辑器。
|
|
6
|
+
|
|
7
|
+
- 真实 Docker Desktop Linux 引擎;运行容器 inspect 核对无网络、只读根、UID65534、cap-drop ALL、no-new-privileges、1 CPU/256MiB/64 PID、无宿主挂载。镜像固定不可变 ID,运行代码 digest 与本地受信任 bundle 匹配。缺环境返回 SANDBOX_UNAVAILABLE,无回退。
|
|
8
|
+
- 箱子、带 top 面桌子、门轴冰箱:通过原 GLB 导出、AssetCompiler、Manifest Schema、requiredNodes、物理注册及关节运动验证;发布版本均 ready。真实世界完成新箱子拾取、放到新桌面、冰箱 open/close,动作均 verified。
|
|
9
|
+
- 独立 HTTP Server/SessionManager 关闭重新建立后从磁盘恢复7对象;源码及 GLB/Manifest 哈希校验通过;旧交互验收证据不自动生效,重新执行开门后通过参数化验收。
|
|
10
|
+
- 版本测试:源码修改创建新 Asset ID,旧实例不自动升级;replaceAsset 失败时原实体与物理体恢复;旧存档继续恢复旧版本。相同配置强制重建复核产物一致,不覆盖旧版本。
|
|
11
|
+
- 安全测试:宿主文件/环境变量/网络/模块不可访问,循环、内存和几何超量被拒绝或中断;Manifest 自证验证、非法物理被拒绝;取消销毁对应容器;跨身份构建、资产和存档访问拒绝;GLB 篡改校验失败;超出可读存储封装预算的快照不发布。
|
|
12
|
+
- `AGENTSCAPE_SANDBOX_INTEGRATION=1 npm run check`:317测试文件、1598项测试,架构、Planning、资产、世界可用性、类型检查和构建通过;保留既有构建分块提示。真实容器用例已启用,未以跳过代替通过。
|
|
13
|
+
- PC2 AgentDock `agentscape-world`:v0.3.0、ready、24工具。通过实际工具调用构建发布三个示例、执行动作、保存、关闭会话、终止并重启 Node,再恢复7对象、读取原源码并重新开门验证。完整记录在私有运行目录 `C:\Users\yuminghui\.agentdock\agentscape-world\programmatic-acceptance.json`,不含认证凭据。
|
|
14
|
+
|
|
15
|
+
尚未验证宿主断电、Docker内核漏洞、多进程共享数据目录。已发布版本与存档默认长期保留,有引用和配额保护;尚无在线GC接口。统一 Scene API 和 Visual/Physical/Interactive 快速路径留给独立的后续接口精简,不在此功能分支搬迁底层引擎。
|
|
16
|
+
|
|
17
|
+
## v0.2 程序化创作
|
|
18
|
+
|
|
19
|
+
2026-11-04:当前 `feat/ui-design-system-unify` 分支。增加隔离创作、草稿查询、准备、晋升、显式更新、验证、源码导出七个 MCP 工具,共十六工具;复用既有应用层创作晋升链,增加 Node 嵌入纹理加载和盒状物体搬运。
|
|
20
|
+
|
|
21
|
+
- `npm run check`:架构、Planning、资产、世界可用性、类型检查、314测试文件/1592项测试、构建通过;最终边界检查补充后 MCP 六文件/七测试再次通过。
|
|
22
|
+
- 隔离执行测试:循环中断、超内存分配拒绝、Node/网络不可用、回调和 Shader 拒绝、旧草稿不被失败覆盖、数据纹理保留、原始几何参数和过大绘制分组被拒绝。
|
|
23
|
+
- HTTP 工作流:真实编译新纹理盒状物体,默认拒绝 provisional 晋升;显式编辑态晋升后真实 pickup/place 均 verified;自定义存在、拾取和桌面支撑验收通过;源码导出保持一个成功版本,重试不重复执行,失败不进入版本记录。
|
|
24
|
+
- 物理回归:盒状物体路径遇墙阻挡,带局部旋转的盒状碰撞体正确检查终点占用;原圆柱/胶囊搬运、放置与 Studio 创作测试通过。
|
|
25
|
+
- PC2 AgentDock 已 refresh 为 ready/16工具。独立真实会话提交带2×2纹理的 Three.js 方块,晋升后 pickup=held/verified、place=placed/verified,自定义三项验收通过、最终空手。源码导出成功并关闭会话。
|
|
26
|
+
- PC2 完整调用记录位于私有运行目录 `C:\Users\yuminghui\.agentdock\agentscape-world\authoring-acceptance.json`。这份记录不含认证凭据,不随 Git 发布。
|
|
27
|
+
|
|
28
|
+
本阶段不宣称完整项目导入、服务重启后恢复、Studio 实时同步、截图或任意动画/Shader 的无损接入。资产 provisional 状态未被动作成功提升;详见 AUTHORING.md。
|
|
29
|
+
|
|
30
|
+
## v0.1 历史基线
|
|
31
|
+
|
|
32
|
+
基线:1ebb6b5,独立分支 feat/agentscape-remote-mcp。环境:Windows、Node.js v24.18.0、npm 12.2.0。
|
|
33
|
+
|
|
34
|
+
- `npm ci --ignore-scripts --no-audit --no-fund`:独立检出安装通过。
|
|
35
|
+
- `npm run world:viability`:现有真实物理、导航和具身任务通过。
|
|
36
|
+
- `npm run check`:架构、Planning、资产、世界可用性、TypeScript、311个测试文件/1588个测试及生产构建通过。仍有原有大分块提示。
|
|
37
|
+
- 最后一次 SessionManager 关闭状态保护修改后,`npm run test:mcp` 再次通过:3文件/4测试。
|
|
38
|
+
- `git diff --check`:通过。
|
|
39
|
+
- 原目录 Git HEAD 保持 1ebb6b5,tracked/untracked 状态输出为空。未读取 .env.local 或密钥,未启动原目录服务。
|
|
40
|
+
|
|
41
|
+
官方 MCP Client 使用 Streamable HTTP,发现9工具;Alice/Bob 两身份创建独立世界。依次 action-completed / held / placed,均由 Runtime 分类 verified;最终 world-accepted、Agent carry=empty。导出9140字节 JSON。完整逐项证据在 acceptance-evidence.json。
|
|
42
|
+
|
|
43
|
+
测试覆盖详情见 README。安全测试和真实动作使用同一正式 Runtime 装配。未运行付费生成、外部模型推理或部署;未验证具体托管 Agent 产品接入,也未重新进行 Studio 浏览器交互验收。Studio/Observatory 回归依据既有自动测试与生产构建;未修改其源码。
|
|
44
|
+
|
|
45
|
+
崩溃测试边界:覆盖残留损坏临时文件与旧会话目录不会自动加载,尚未通过强制杀进程验证所有操作系统崩溃/断电情形。每会话使用有界对象/动作预算,未实现 OS 级硬内存隔离。私有 TLS 代理部署需由使用者配置;本次不发布公网服务。
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "agentscape.remote-mcp.acceptance",
|
|
3
|
+
"actions": [
|
|
4
|
+
{
|
|
5
|
+
"state": "verified",
|
|
6
|
+
"status": "action-completed",
|
|
7
|
+
"steps": 285
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"state": "verified",
|
|
11
|
+
"status": "held",
|
|
12
|
+
"steps": 60
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"state": "verified",
|
|
16
|
+
"status": "placed",
|
|
17
|
+
"steps": 336
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"verification": {
|
|
21
|
+
"state": "verified",
|
|
22
|
+
"evidence": {
|
|
23
|
+
"schema": "agentscape.world-acceptance",
|
|
24
|
+
"schemaVersion": 1,
|
|
25
|
+
"status": "world-accepted",
|
|
26
|
+
"checks": [
|
|
27
|
+
{
|
|
28
|
+
"id": "valid",
|
|
29
|
+
"kind": "world-valid",
|
|
30
|
+
"verified": true,
|
|
31
|
+
"evidence": {
|
|
32
|
+
"validation": {
|
|
33
|
+
"schema": 1,
|
|
34
|
+
"ok": true,
|
|
35
|
+
"counts": {
|
|
36
|
+
"hard": 0,
|
|
37
|
+
"advisory": 0
|
|
38
|
+
},
|
|
39
|
+
"hard": [],
|
|
40
|
+
"advisory": [],
|
|
41
|
+
"coverage": {
|
|
42
|
+
"objects": 4,
|
|
43
|
+
"relations": 8
|
|
44
|
+
},
|
|
45
|
+
"findings": []
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "open",
|
|
51
|
+
"kind": "interaction-verified",
|
|
52
|
+
"verified": true,
|
|
53
|
+
"targetId": "cabinet_01",
|
|
54
|
+
"expected": "OPEN",
|
|
55
|
+
"evidence": {
|
|
56
|
+
"schema": "agentscape.interaction-evidence",
|
|
57
|
+
"schemaVersion": 1,
|
|
58
|
+
"worldRevisionId": "remote-monument-r1",
|
|
59
|
+
"targetId": "cabinet_01",
|
|
60
|
+
"capability": "OPEN",
|
|
61
|
+
"verified": true,
|
|
62
|
+
"source": "approachAndInteract",
|
|
63
|
+
"commandId": "interaction:direct-open",
|
|
64
|
+
"result": {
|
|
65
|
+
"status": "action-completed",
|
|
66
|
+
"action": "open",
|
|
67
|
+
"targetId": "cabinet_01",
|
|
68
|
+
"actorId": "agent_01",
|
|
69
|
+
"targetReached": true,
|
|
70
|
+
"settled": true
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id": "pickup",
|
|
76
|
+
"kind": "interaction-verified",
|
|
77
|
+
"verified": true,
|
|
78
|
+
"targetId": "cup_01",
|
|
79
|
+
"expected": "PICKUP",
|
|
80
|
+
"evidence": {
|
|
81
|
+
"schema": "agentscape.interaction-evidence",
|
|
82
|
+
"schemaVersion": 1,
|
|
83
|
+
"worldRevisionId": "remote-monument-r1",
|
|
84
|
+
"targetId": "cup_01",
|
|
85
|
+
"capability": "PICKUP",
|
|
86
|
+
"verified": true,
|
|
87
|
+
"source": "approachAndPickup",
|
|
88
|
+
"commandId": "interaction:direct-pickup",
|
|
89
|
+
"result": {
|
|
90
|
+
"status": "held",
|
|
91
|
+
"targetId": "cup_01",
|
|
92
|
+
"actorId": "agent_01"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "place",
|
|
98
|
+
"kind": "interaction-verified",
|
|
99
|
+
"verified": true,
|
|
100
|
+
"targetId": "table_01",
|
|
101
|
+
"expected": "PLACE",
|
|
102
|
+
"evidence": {
|
|
103
|
+
"schema": "agentscape.interaction-evidence",
|
|
104
|
+
"schemaVersion": 1,
|
|
105
|
+
"worldRevisionId": "remote-monument-r1",
|
|
106
|
+
"targetId": "table_01",
|
|
107
|
+
"capability": "PLACE",
|
|
108
|
+
"verified": true,
|
|
109
|
+
"source": "approachAndPlace",
|
|
110
|
+
"commandId": "interaction:direct-place",
|
|
111
|
+
"result": {
|
|
112
|
+
"status": "placed",
|
|
113
|
+
"targetId": "table_01",
|
|
114
|
+
"actorId": "agent_01",
|
|
115
|
+
"settled": true,
|
|
116
|
+
"supportVerified": true
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"id": "support",
|
|
122
|
+
"kind": "relation-exists",
|
|
123
|
+
"verified": true,
|
|
124
|
+
"subject": "cup_01",
|
|
125
|
+
"predicate": "ON",
|
|
126
|
+
"object": "table_01",
|
|
127
|
+
"surfaceId": "top",
|
|
128
|
+
"evidence": {
|
|
129
|
+
"subject": "cup_01",
|
|
130
|
+
"predicate": "ON",
|
|
131
|
+
"object": "table_01",
|
|
132
|
+
"meta": {
|
|
133
|
+
"surfaceId": "top",
|
|
134
|
+
"gap": 0.02,
|
|
135
|
+
"evidence": "spatial-geometry"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"id": "unresolved",
|
|
141
|
+
"kind": "no-unresolved",
|
|
142
|
+
"verified": true
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"verifiedCount": 6,
|
|
146
|
+
"failedCount": 0,
|
|
147
|
+
"acceptanceBundle": {
|
|
148
|
+
"schema": "agentscape.acceptance-evidence",
|
|
149
|
+
"schemaVersion": 1,
|
|
150
|
+
"required": true,
|
|
151
|
+
"source": "agent-tool",
|
|
152
|
+
"worldRevisionId": "remote-monument-r1",
|
|
153
|
+
"provenance": {
|
|
154
|
+
"source": "remote-mcp",
|
|
155
|
+
"createdBy": "AgentScape",
|
|
156
|
+
"evidenceRefs": []
|
|
157
|
+
},
|
|
158
|
+
"criteria": [
|
|
159
|
+
{
|
|
160
|
+
"id": "valid",
|
|
161
|
+
"kind": "world-valid"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "open",
|
|
165
|
+
"kind": "interaction-verified",
|
|
166
|
+
"targetId": "cabinet_01",
|
|
167
|
+
"capability": "OPEN"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"id": "pickup",
|
|
171
|
+
"kind": "interaction-verified",
|
|
172
|
+
"targetId": "cup_01",
|
|
173
|
+
"capability": "PICKUP"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"id": "place",
|
|
177
|
+
"kind": "interaction-verified",
|
|
178
|
+
"targetId": "table_01",
|
|
179
|
+
"capability": "PLACE"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"id": "support",
|
|
183
|
+
"kind": "relation-exists",
|
|
184
|
+
"subject": "cup_01",
|
|
185
|
+
"predicate": "ON",
|
|
186
|
+
"object": "table_01",
|
|
187
|
+
"surfaceId": "top"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"id": "unresolved",
|
|
191
|
+
"kind": "no-unresolved"
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
"result": {
|
|
195
|
+
"schema": "agentscape.world-acceptance",
|
|
196
|
+
"schemaVersion": 1,
|
|
197
|
+
"status": "world-accepted",
|
|
198
|
+
"checks": [
|
|
199
|
+
{
|
|
200
|
+
"id": "valid",
|
|
201
|
+
"kind": "world-valid",
|
|
202
|
+
"verified": true,
|
|
203
|
+
"evidence": {
|
|
204
|
+
"validation": {
|
|
205
|
+
"schema": 1,
|
|
206
|
+
"ok": true,
|
|
207
|
+
"counts": {
|
|
208
|
+
"hard": 0,
|
|
209
|
+
"advisory": 0
|
|
210
|
+
},
|
|
211
|
+
"hard": [],
|
|
212
|
+
"advisory": [],
|
|
213
|
+
"coverage": {
|
|
214
|
+
"objects": 4,
|
|
215
|
+
"relations": 8
|
|
216
|
+
},
|
|
217
|
+
"findings": []
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"id": "open",
|
|
223
|
+
"kind": "interaction-verified",
|
|
224
|
+
"verified": true,
|
|
225
|
+
"targetId": "cabinet_01",
|
|
226
|
+
"expected": "OPEN",
|
|
227
|
+
"evidence": {
|
|
228
|
+
"schema": "agentscape.interaction-evidence",
|
|
229
|
+
"schemaVersion": 1,
|
|
230
|
+
"worldRevisionId": "remote-monument-r1",
|
|
231
|
+
"targetId": "cabinet_01",
|
|
232
|
+
"capability": "OPEN",
|
|
233
|
+
"verified": true,
|
|
234
|
+
"source": "approachAndInteract",
|
|
235
|
+
"commandId": "interaction:direct-open",
|
|
236
|
+
"result": {
|
|
237
|
+
"status": "action-completed",
|
|
238
|
+
"action": "open",
|
|
239
|
+
"targetId": "cabinet_01",
|
|
240
|
+
"actorId": "agent_01",
|
|
241
|
+
"targetReached": true,
|
|
242
|
+
"settled": true
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"id": "pickup",
|
|
248
|
+
"kind": "interaction-verified",
|
|
249
|
+
"verified": true,
|
|
250
|
+
"targetId": "cup_01",
|
|
251
|
+
"expected": "PICKUP",
|
|
252
|
+
"evidence": {
|
|
253
|
+
"schema": "agentscape.interaction-evidence",
|
|
254
|
+
"schemaVersion": 1,
|
|
255
|
+
"worldRevisionId": "remote-monument-r1",
|
|
256
|
+
"targetId": "cup_01",
|
|
257
|
+
"capability": "PICKUP",
|
|
258
|
+
"verified": true,
|
|
259
|
+
"source": "approachAndPickup",
|
|
260
|
+
"commandId": "interaction:direct-pickup",
|
|
261
|
+
"result": {
|
|
262
|
+
"status": "held",
|
|
263
|
+
"targetId": "cup_01",
|
|
264
|
+
"actorId": "agent_01"
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"id": "place",
|
|
270
|
+
"kind": "interaction-verified",
|
|
271
|
+
"verified": true,
|
|
272
|
+
"targetId": "table_01",
|
|
273
|
+
"expected": "PLACE",
|
|
274
|
+
"evidence": {
|
|
275
|
+
"schema": "agentscape.interaction-evidence",
|
|
276
|
+
"schemaVersion": 1,
|
|
277
|
+
"worldRevisionId": "remote-monument-r1",
|
|
278
|
+
"targetId": "table_01",
|
|
279
|
+
"capability": "PLACE",
|
|
280
|
+
"verified": true,
|
|
281
|
+
"source": "approachAndPlace",
|
|
282
|
+
"commandId": "interaction:direct-place",
|
|
283
|
+
"result": {
|
|
284
|
+
"status": "placed",
|
|
285
|
+
"targetId": "table_01",
|
|
286
|
+
"actorId": "agent_01",
|
|
287
|
+
"settled": true,
|
|
288
|
+
"supportVerified": true
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"id": "support",
|
|
294
|
+
"kind": "relation-exists",
|
|
295
|
+
"verified": true,
|
|
296
|
+
"subject": "cup_01",
|
|
297
|
+
"predicate": "ON",
|
|
298
|
+
"object": "table_01",
|
|
299
|
+
"surfaceId": "top",
|
|
300
|
+
"evidence": {
|
|
301
|
+
"subject": "cup_01",
|
|
302
|
+
"predicate": "ON",
|
|
303
|
+
"object": "table_01",
|
|
304
|
+
"meta": {
|
|
305
|
+
"surfaceId": "top",
|
|
306
|
+
"gap": 0.02,
|
|
307
|
+
"evidence": "spatial-geometry"
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"id": "unresolved",
|
|
313
|
+
"kind": "no-unresolved",
|
|
314
|
+
"verified": true
|
|
315
|
+
}
|
|
316
|
+
],
|
|
317
|
+
"verifiedCount": 6,
|
|
318
|
+
"failedCount": 0
|
|
319
|
+
},
|
|
320
|
+
"findings": []
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
"carry": {
|
|
324
|
+
"status": "empty",
|
|
325
|
+
"actorId": "agent_01"
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
"export": {
|
|
329
|
+
"bytes": 9140,
|
|
330
|
+
"scope": "scene-json-only"
|
|
331
|
+
}
|
|
332
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
|
|
3
|
+
// Expose bounded, structured physics evidence without leaking internal exception stacks.
|
|
4
|
+
export function publicMcpError(error) {
|
|
5
|
+
const code=error instanceof z.ZodError ? 'INVALID_ARGUMENTS'
|
|
6
|
+
: /^[A-Z_]+$/.test(error?.code || '') ? error.code
|
|
7
|
+
: /^[A-Z_]+$/.test(error?.message || '') ? error.message : 'RUNTIME_ERROR';
|
|
8
|
+
if (code === 'AUTHORING_PLACEMENT_BLOCKED' && Array.isArray(error?.details?.blockedBy)) {
|
|
9
|
+
return {state:'failed',code,diagnostics:{
|
|
10
|
+
blockedBy:error.details.blockedBy.slice(0,8).map(id => String(id || '').slice(0,64))
|
|
11
|
+
}};
|
|
12
|
+
}
|
|
13
|
+
if (code !== 'ASSET_PHYSICS_VERIFICATION_FAILED' || !Array.isArray(error?.details?.parts)) {
|
|
14
|
+
return {state:'failed',code};
|
|
15
|
+
}
|
|
16
|
+
const parts=error.details.parts.slice(0,8).map(part=>({
|
|
17
|
+
part:String(part.part || '').slice(0,64),
|
|
18
|
+
actions:(part.actions || []).slice(0,8).filter(action=>action.ok === false).map(action=>({
|
|
19
|
+
name:String(action.action || '').slice(0,64),
|
|
20
|
+
failures:(action.failures || []).slice(0,5).map(failure=>({
|
|
21
|
+
code:/^[A-Z_]+$/.test(failure.code || '') ? failure.code : 'PHYSICS_CHECK_FAILED',
|
|
22
|
+
stage:/^[A-Z_]+$/.test(failure.stage || '') ? failure.stage : 'VERIFICATION',
|
|
23
|
+
collisions:(failure.collisions || []).slice(0,4).map(hit=>({
|
|
24
|
+
sourcePart:String(hit.sourcePart || '').slice(0,64),
|
|
25
|
+
targetPart:String(hit.targetPart || '').slice(0,64),
|
|
26
|
+
depth:Number.isFinite(hit.depth) ? Number(hit.depth.toFixed(4)) : null
|
|
27
|
+
}))
|
|
28
|
+
}))
|
|
29
|
+
}))
|
|
30
|
+
}));
|
|
31
|
+
return {state:'failed',code,diagnostics:{tested:error.details.tested,parts}};
|
|
32
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Shared source/definition fixture for SDK, MCP and Studio project bundles.
|
|
2
|
+
const panels = [
|
|
3
|
+
[[6,.2,5],[0,.1,0]], [[.2,3,5],[-3,1.5,0]], [[.2,3,5],[3,1.5,0]],
|
|
4
|
+
[[6,3,.2],[0,1.5,-2.5]], [[2,3,.2],[-2,1.5,2.5]], [[2,3,.2],[2,1.5,2.5]],
|
|
5
|
+
[[2,.6,.2],[0,2.7,2.5]], [[6.4,.2,5.4],[0,3.1,0]]
|
|
6
|
+
];
|
|
7
|
+
const stairs = Array.from({length:6},(_,i)=>[[1,.2*(i+1),.4],[-2,.2+.1*(i+1),1-i*.4]]);
|
|
8
|
+
export const house = {
|
|
9
|
+
source:`export function createAsset(THREE) {
|
|
10
|
+
const root=new THREE.Group(); root.name='House';
|
|
11
|
+
const material=new THREE.MeshStandardMaterial({color:'#eeeecc'});
|
|
12
|
+
const panels=${JSON.stringify([...panels,...stairs])};
|
|
13
|
+
panels.forEach(([size,position],i)=>{const mesh=new THREE.Mesh(new THREE.BoxGeometry(...size),material);mesh.name='panel_'+i;mesh.position.set(...position);root.add(mesh);});
|
|
14
|
+
const hinge=new THREE.Group();hinge.name='doorHinge';hinge.position.set(-1,1.2,2.65);root.add(hinge);
|
|
15
|
+
const door=new THREE.Mesh(new THREE.BoxGeometry(2,2.4,.12),new THREE.MeshStandardMaterial({color:'#884422'}));door.position.x=1;door.name='Door';hinge.add(door);
|
|
16
|
+
return root;
|
|
17
|
+
}`,
|
|
18
|
+
definition:{id:'house',type:'building',label:'Code house with stairs and hinged door',actions:['open','close'],requiredNodes:['Door','doorHinge'],
|
|
19
|
+
physics:{body:'fixed',navigationObstacle:true,colliders:[...panels,...stairs].map(([size,translation])=>({shape:'box',halfExtents:size.map(n=>n/2),translation}))},
|
|
20
|
+
parts:{door:{node:'doorHinge',semantic:'door',actions:['open','close'],targets:{open:-1.4,close:0},
|
|
21
|
+
physics:{body:'dynamic',mass:8,colliders:[{shape:'box',halfExtents:[1,1.2,.06],translation:[1,0,0]}]},
|
|
22
|
+
joint:{type:'revolute',axis:[0,1,0],limits:[-1.4,0],parentAnchor:[-1,1.2,2.65],childAnchor:[0,0,0],motor:{stiffness:80,damping:12}}}}
|
|
23
|
+
}
|
|
24
|
+
};
|