agentscape3d-engine 0.0.0-stage → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +19 -2
- package/cli.mjs +53 -0
- package/dist/ArticulationVerifier-BfGxXY8V.js +337 -0
- package/dist/ArticulationVerifier-BfGxXY8V.js.map +1 -0
- package/dist/AssetCompiler-BLj09iu1.js +2424 -0
- package/dist/AssetCompiler-BLj09iu1.js.map +1 -0
- package/dist/AssetModule-DME-XaFS.js +2637 -0
- package/dist/AssetModule-DME-XaFS.js.map +1 -0
- package/dist/AssetRecipe-g8dZBhgJ.js +298 -0
- package/dist/AssetRecipe-g8dZBhgJ.js.map +1 -0
- package/dist/BrowserCodeWorker.js +53856 -0
- package/dist/BrowserCodeWorker.js.map +1 -0
- package/dist/CarryCapability-CXwHU5ay.js +104 -0
- package/dist/CarryCapability-CXwHU5ay.js.map +1 -0
- package/dist/KinematicHypothesisScreen-C3TKiuYR.js +241 -0
- package/dist/KinematicHypothesisScreen-C3TKiuYR.js.map +1 -0
- package/dist/ObjectTransform-BlQUNK7c.js +61 -0
- package/dist/ObjectTransform-BlQUNK7c.js.map +1 -0
- package/dist/RapierPhysicsBackend-B2wQe_Vl.js +3259 -0
- package/dist/RapierPhysicsBackend-B2wQe_Vl.js.map +1 -0
- package/dist/RenderingSystem-WIr1ZuGu.js +1042 -0
- package/dist/RenderingSystem-WIr1ZuGu.js.map +1 -0
- package/dist/ScenePresentation-LsYiDxbm.js +152 -0
- package/dist/ScenePresentation-LsYiDxbm.js.map +1 -0
- package/dist/SceneProject-K7HH1s8o.js +2687 -0
- package/dist/SceneProject-K7HH1s8o.js.map +1 -0
- package/dist/SceneSerializer-zOzbX4jZ.js +932 -0
- package/dist/SceneSerializer-zOzbX4jZ.js.map +1 -0
- package/dist/SimulationProfile-DSYZbBLQ.js +165 -0
- package/dist/SimulationProfile-DSYZbBLQ.js.map +1 -0
- package/dist/StylePack-DcRa_kU0.js +88 -0
- package/dist/StylePack-DcRa_kU0.js.map +1 -0
- package/dist/WorldArchive-BiFGLt--.js +451 -0
- package/dist/WorldArchive-BiFGLt--.js.map +1 -0
- package/dist/WorldCommands-Debj7V4L.js +2207 -0
- package/dist/WorldCommands-Debj7V4L.js.map +1 -0
- package/dist/WorldIO-Ch8QBfKY.js +151 -0
- package/dist/WorldIO-Ch8QBfKY.js.map +1 -0
- package/dist/admission-CVEvsrdz.js +121 -0
- package/dist/admission-CVEvsrdz.js.map +1 -0
- package/dist/blankWorld-B0MW6g7q.js +75 -0
- package/dist/blankWorld-B0MW6g7q.js.map +1 -0
- package/dist/core.d.ts +68 -0
- package/dist/core.js +209 -0
- package/dist/core.js.map +1 -0
- package/dist/disposeObject3D-DIMzy0FA.js +128 -0
- package/dist/disposeObject3D-DIMzy0FA.js.map +1 -0
- package/dist/environments-HOe3sJXH.js +567 -0
- package/dist/environments-HOe3sJXH.js.map +1 -0
- package/dist/gltfIO-BzVKLyaL.js +339 -0
- package/dist/gltfIO-BzVKLyaL.js.map +1 -0
- package/dist/grandUrbanBlock-DRndRZjF.js +515 -0
- package/dist/grandUrbanBlock-DRndRZjF.js.map +1 -0
- package/dist/index.d.ts +345 -0
- package/dist/index.js +16952 -0
- package/dist/index.js.map +1 -0
- package/dist/magicCabin-CfBZjx2Q.js +11019 -0
- package/dist/magicCabin-CfBZjx2Q.js.map +1 -0
- package/dist/manifests-D0LwbJ36.js +866 -0
- package/dist/manifests-D0LwbJ36.js.map +1 -0
- package/dist/mcp.d.ts +2 -0
- package/dist/mcp.js +1 -0
- package/dist/monumentHall-awZiGtda.js +403 -0
- package/dist/monumentHall-awZiGtda.js.map +1 -0
- package/dist/node.d.ts +16 -0
- package/dist/node.js +26 -0
- package/dist/parts-DrEcfJRl.js +37 -0
- package/dist/parts-DrEcfJRl.js.map +1 -0
- package/dist/rolldown-runtime-D3KUYPsf.js +12 -0
- package/dist/ruinedCourtyard-DuF7NmUU.js +696 -0
- package/dist/ruinedCourtyard-DuF7NmUU.js.map +1 -0
- package/dist/runtime/application/AgentTools.js +28 -0
- package/dist/runtime/application/README.md +14 -0
- package/dist/runtime/application/agent/ProgressiveAgentTools.js +92 -0
- package/dist/runtime/application/agent/StudioMcpAllowlist.js +10 -0
- package/dist/runtime/application/agent/StudioProjectTools.js +18 -0
- package/dist/runtime/application/agent/TaskEvidence.js +199 -0
- package/dist/runtime/application/buildTaskObservation.js +117 -0
- package/dist/runtime/application/code-execution/AuthoringSandboxEntry.js +50 -0
- package/dist/runtime/application/code-execution/BrowserCodeExecutor.js +35 -0
- package/dist/runtime/application/code-execution/BrowserCodeWorker.js +17 -0
- package/dist/runtime/application/code-execution/RemoteAuthoringDocument.js +82 -0
- package/dist/runtime/application/createSession.js +66 -0
- package/dist/runtime/application/createWorldAuthoringContext.js +400 -0
- package/dist/runtime/application/generation/GenerationOrchestrator.js +630 -0
- package/dist/runtime/application/generation/GenerationRuntime.js +215 -0
- package/dist/runtime/application/generation/PromptHybridWorldOrchestrator.js +289 -0
- package/dist/runtime/application/native-scene/CodeProject.js +215 -0
- package/dist/runtime/application/native-scene/CodeProjectModules.js +143 -0
- package/dist/runtime/application/native-scene/ExampleWorldCatalog.js +35 -0
- package/dist/runtime/application/native-scene/NativeArticulation.js +53 -0
- package/dist/runtime/application/native-scene/NativeEditableRegistry.js +150 -0
- package/dist/runtime/application/native-scene/NativeEnvironmentGeometry.js +85 -0
- package/dist/runtime/application/native-scene/NativeLightingInspection.js +33 -0
- package/dist/runtime/application/native-scene/NativeMaterialInspection.js +52 -0
- package/dist/runtime/application/native-scene/NativeOverlayCheckpoint.js +127 -0
- package/dist/runtime/application/native-scene/NativePhysicsGeometry.js +64 -0
- package/dist/runtime/application/native-scene/NativeRenderDiscovery.js +51 -0
- package/dist/runtime/application/native-scene/NativeSceneHost.js +406 -0
- package/dist/runtime/application/native-scene/NativeSceneInspection.js +203 -0
- package/dist/runtime/application/native-scene/NativeSceneOverlay.js +116 -0
- package/dist/runtime/application/native-scene/NativeSceneQuery.js +123 -0
- package/dist/runtime/application/native-scene/NativeSceneReview.js +132 -0
- package/dist/runtime/application/native-scene/NativeThreeModule.js +16 -0
- package/dist/runtime/application/native-scene/SceneObserver.js +97 -0
- package/dist/runtime/application/native-scene/VisualCapturePolicy.js +4 -0
- package/dist/runtime/application/object-forge/SceneObjectForge.js +263 -0
- package/dist/runtime/application/programmatic-assets/ProgrammaticAssetBuilder.js +59 -0
- package/dist/runtime/application/programmatic-assets/ProgrammaticAssetContract.js +22 -0
- package/dist/runtime/application/programmatic-assets/ThreeCodeAsset.js +40 -0
- package/dist/runtime/application/scene/CapabilityResolver.js +90 -0
- package/dist/runtime/application/scene/NativeEditableContracts.js +18 -0
- package/dist/runtime/application/scene/RequestWindow.js +54 -0
- package/dist/runtime/application/scene/SceneAgentTools.js +21 -0
- package/dist/runtime/application/scene/SceneContracts.js +49 -0
- package/dist/runtime/application/scene/SceneEditService.js +154 -0
- package/dist/runtime/application/scene/SceneFacade.js +356 -0
- package/dist/runtime/application/scene/SceneInteractionAdapters.js +41 -0
- package/dist/runtime/application/scene/SceneJobController.js +320 -0
- package/dist/runtime/application/scene/SceneLifecycle.js +57 -0
- package/dist/runtime/application/scene/ScenePackage.js +173 -0
- package/dist/runtime/application/scene/ScenePersistence.js +50 -0
- package/dist/runtime/application/scene/SceneProject.js +95 -0
- package/dist/runtime/application/scene/SceneSkillNames.js +5 -0
- package/dist/runtime/application/scene/StarterScene.js +56 -0
- package/dist/runtime/application/scene/WorldArchive.js +89 -0
- package/dist/runtime/application/scene/WorldDirectory.js +20 -0
- package/dist/runtime/application/scene/WorldDocument.js +76 -0
- package/dist/runtime/application/scene/WorldIO.js +103 -0
- package/dist/runtime/application/scene/WorldStorage.js +155 -0
- package/dist/runtime/application/skills/SkillRegistry.js +193 -0
- package/dist/runtime/application/skills/packs/acceptanceSkills.js +32 -0
- package/dist/runtime/application/skills/packs/affordanceSkills.js +36 -0
- package/dist/runtime/application/skills/packs/assetSkills.js +46 -0
- package/dist/runtime/application/skills/packs/authoringSkills.js +16 -0
- package/dist/runtime/application/skills/packs/batchSkills.js +22 -0
- package/dist/runtime/application/skills/packs/codeSkills.js +106 -0
- package/dist/runtime/application/skills/packs/generationSkills.js +45 -0
- package/dist/runtime/application/skills/packs/interactionSkills.js +46 -0
- package/dist/runtime/application/skills/packs/recoverySkills.js +80 -0
- package/dist/runtime/application/skills/packs/sceneSkills.js +24 -0
- package/dist/runtime/application/skills/packs/spatialSkills.js +35 -0
- package/dist/runtime/application/skills/packs/verificationSkills.js +14 -0
- package/dist/runtime/application/skills/packs/worldSkills.js +45 -0
- package/dist/runtime/application/skills/registerCoreSkills.js +31 -0
- package/dist/runtime/application/skills/skillPrimitives.js +4 -0
- package/dist/runtime/application/tasks/CabinetCupTask.js +76 -0
- package/dist/runtime/application/tasks.jsonl +67 -0
- package/dist/runtime/application/world-authoring/AuthoringAssetProducer.js +42 -0
- package/dist/runtime/application/world-authoring/AuthoringDiff.js +149 -0
- package/dist/runtime/application/world-authoring/AuthoringDocument.js +825 -0
- package/dist/runtime/application/world-authoring/AuthoringExecutionHost.js +109 -0
- package/dist/runtime/application/world-authoring/AuthoringIdentity.js +17 -0
- package/dist/runtime/application/world-authoring/AuthoringModelResolver.js +29 -0
- package/dist/runtime/application/world-authoring/AuthoringPatch.js +118 -0
- package/dist/runtime/application/world-authoring/AuthoringPromotionController.js +334 -0
- package/dist/runtime/application/world-authoring/AuthoringPromotionSource.js +126 -0
- package/dist/runtime/application/world-authoring/AuthoringRevisionHistory.js +144 -0
- package/dist/runtime/application/world-authoring/HeadlessImageExport.js +92 -0
- package/dist/runtime/application/world-authoring/ModelRef.js +62 -0
- package/dist/runtime/application/world-authoring/SceneGLBExport.js +88 -0
- package/dist/runtime/apps/mcp-server/AUTHORING.md +71 -0
- package/dist/runtime/apps/mcp-server/AgentMcpCompat.js +68 -0
- package/dist/runtime/apps/mcp-server/AuthoringSandboxEntry.js +1 -0
- package/dist/runtime/apps/mcp-server/AuthoringSandboxWorker.mjs +30 -0
- package/dist/runtime/apps/mcp-server/BuildEnvironment.js +17 -0
- package/dist/runtime/apps/mcp-server/CodeExecutor.js +71 -0
- package/dist/runtime/apps/mcp-server/DEPLOYMENT-PC2.md +42 -0
- package/dist/runtime/apps/mcp-server/DockerBuildRunner.js +66 -0
- package/dist/runtime/apps/mcp-server/FileAssetRepository.js +159 -0
- package/dist/runtime/apps/mcp-server/HeadlessAssetIO.js +8 -0
- package/dist/runtime/apps/mcp-server/HeadlessGLTFLoader.js +47 -0
- package/dist/runtime/apps/mcp-server/HeadlessWorldHost.js +157 -0
- package/dist/runtime/apps/mcp-server/IsolatedAuthoringExecutor.js +6 -0
- package/dist/runtime/apps/mcp-server/PROGRAMMATIC-ASSETS.md +116 -0
- package/dist/runtime/apps/mcp-server/ProgrammaticAssets.js +60 -0
- package/dist/runtime/apps/mcp-server/README.md +269 -0
- package/dist/runtime/apps/mcp-server/RemoteAuthoringDocument.js +1 -0
- package/dist/runtime/apps/mcp-server/SandboxBundle.js +13 -0
- package/dist/runtime/apps/mcp-server/SessionManager.js +148 -0
- package/dist/runtime/apps/mcp-server/StudioBridgeHttp.js +75 -0
- package/dist/runtime/apps/mcp-server/StudioLiveBridge.js +246 -0
- package/dist/runtime/apps/mcp-server/StudioProjectToolContracts.js +58 -0
- package/dist/runtime/apps/mcp-server/TransferHttp.js +47 -0
- package/dist/runtime/apps/mcp-server/TransferLimits.js +6 -0
- package/dist/runtime/apps/mcp-server/TransferStore.js +134 -0
- package/dist/runtime/apps/mcp-server/TrustedAuthoringWorker.mjs +16 -0
- package/dist/runtime/apps/mcp-server/VALIDATION.md +45 -0
- package/dist/runtime/apps/mcp-server/acceptance-evidence.json +332 -0
- package/dist/runtime/apps/mcp-server/errorDiagnostics.js +32 -0
- package/dist/runtime/apps/mcp-server/examples/code-house.js +24 -0
- package/dist/runtime/apps/mcp-server/examples/procedural-assets.js +85 -0
- package/dist/runtime/apps/mcp-server/main.mjs +82 -0
- package/dist/runtime/apps/mcp-server/registerTools.js +274 -0
- package/dist/runtime/apps/mcp-server/sandbox/run.mjs +23 -0
- package/dist/runtime/apps/mcp-server/security.js +23 -0
- package/dist/runtime/apps/mcp-server/tasks.jsonl +9 -0
- package/dist/runtime/apps/server/CapabilityAdapterRegistry.js +157 -0
- package/dist/runtime/apps/server/README.md +7 -0
- package/dist/runtime/apps/server/WorldRepository.js +338 -0
- package/dist/runtime/apps/server/WorldRepositoryHttp.js +96 -0
- package/dist/runtime/apps/server/openai-compatible-agent-gateway.mjs +278 -0
- package/dist/runtime/apps/server/tasks.jsonl +10 -0
- package/dist/runtime/apps/shared/node/WorldDiskStorage.js +62 -0
- package/dist/runtime/foundation/EventBus.js +26 -0
- package/dist/runtime/foundation/JsonGateway.js +47 -0
- package/dist/runtime/foundation/PngRgba.js +99 -0
- package/dist/runtime/foundation/PolicyEngine.js +21 -0
- package/dist/runtime/foundation/README.md +7 -0
- package/dist/runtime/foundation/TraceRecorder.js +76 -0
- package/dist/runtime/foundation/errors.js +8 -0
- package/dist/runtime/foundation/simulation/SimulationProfile.js +143 -0
- package/dist/runtime/foundation/version.js +2 -0
- package/dist/runtime/modules/agent/README.md +11 -0
- package/dist/runtime/modules/agent/ToolCallingAgent.js +19 -0
- package/dist/runtime/modules/agent/bootstrapWorld.js +10 -0
- package/dist/runtime/modules/agent/buildRecoveryProposals.js +533 -0
- package/dist/runtime/modules/agent/execution/AgentExecutionRules.js +128 -0
- package/dist/runtime/modules/agent/execution/AgentRunResults.js +55 -0
- package/dist/runtime/modules/agent/execution/AgentRunSession.js +393 -0
- package/dist/runtime/modules/agent/execution/AgentToolInvoker.js +40 -0
- package/dist/runtime/modules/agent/gateway/HttpLLMGateway.js +19 -0
- package/dist/runtime/modules/agent/prompt/index.js +52 -0
- package/dist/runtime/modules/agent/tasks.jsonl +94 -0
- package/dist/runtime/modules/artifact/ArtifactContentGate.js +144 -0
- package/dist/runtime/modules/artifact/ArtifactDescriptor.js +280 -0
- package/dist/runtime/modules/artifact/ArtifactImporter.js +185 -0
- package/dist/runtime/modules/artifact/ArtifactModule.js +111 -0
- package/dist/runtime/modules/artifact/ArtifactRegistry.js +197 -0
- package/dist/runtime/modules/artifact/IncrementalSha256.js +129 -0
- package/dist/runtime/modules/artifact/MemoryArtifactByteStore.js +115 -0
- package/dist/runtime/modules/artifact/README.md +7 -0
- package/dist/runtime/modules/artifact/storage/IndexedDbArtifactStore.js +67 -0
- package/dist/runtime/modules/artifact/tasks.jsonl +31 -0
- package/dist/runtime/modules/asset/AssetModule.js +416 -0
- package/dist/runtime/modules/asset/README.md +67 -0
- package/dist/runtime/modules/asset/loading/AssetLoader.js +157 -0
- package/dist/runtime/modules/asset/loading/GltfAssetLoader.js +61 -0
- package/dist/runtime/modules/asset/loading/builtins/BuiltinAssets.js +95 -0
- package/dist/runtime/modules/asset/loading/builtins/HouseDoor.js +33 -0
- package/dist/runtime/modules/asset/loading/builtins/IndustrialCabinet.js +103 -0
- package/dist/runtime/modules/asset/model/AssetInputContracts.js +139 -0
- package/dist/runtime/modules/asset/model/AssetRef.js +12 -0
- package/dist/runtime/modules/asset/model/MechanicalAssetDraft.js +172 -0
- package/dist/runtime/modules/asset/model/ProceduralTextureContract.js +24 -0
- package/dist/runtime/modules/asset/model/admission.js +117 -0
- package/dist/runtime/modules/asset/model/errors.js +6 -0
- package/dist/runtime/modules/asset/model/parts.js +27 -0
- package/dist/runtime/modules/asset/model/resourceBudget.js +10 -0
- package/dist/runtime/modules/asset/model/schema.js +150 -0
- package/dist/runtime/modules/asset/persistence/AssetManifestStore.js +78 -0
- package/dist/runtime/modules/asset/persistence/CompiledAssetStore.js +84 -0
- package/dist/runtime/modules/asset/persistence/LocalAssetLibrary.js +86 -0
- package/dist/runtime/modules/asset/persistence/LocalAssetLibraryStore.js +81 -0
- package/dist/runtime/modules/asset/production/AssetProductionPipeline.js +272 -0
- package/dist/runtime/modules/asset/production/AssetRecipe.js +91 -0
- package/dist/runtime/modules/asset/production/ProceduralTexture.js +85 -0
- package/dist/runtime/modules/asset/production/adapters/EmbodiedGenAdapter.js +45 -0
- package/dist/runtime/modules/asset/production/adapters/EmbodiedGenBundleAdapter.js +590 -0
- package/dist/runtime/modules/asset/production/compiler/AssetCompiler.js +173 -0
- package/dist/runtime/modules/asset/production/compiler/evidence/AnimationMotionEvidence.js +124 -0
- package/dist/runtime/modules/asset/production/compiler/evidence/StaticPanelEvidence.js +56 -0
- package/dist/runtime/modules/asset/production/compiler/gltfIO.js +6 -0
- package/dist/runtime/modules/asset/production/compiler/partGeometry.js +74 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ArticulatedCollisionPass.js +63 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ArticulationCandidatePass.js +48 -0
- package/dist/runtime/modules/asset/production/compiler/passes/AuthoringIntentPass.js +16 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ColliderFallbackPass.js +30 -0
- package/dist/runtime/modules/asset/production/compiler/passes/CompileQualityPass.js +75 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ExplicitDefinitionPass.js +20 -0
- package/dist/runtime/modules/asset/production/compiler/passes/GLTFInspectPass.js +34 -0
- package/dist/runtime/modules/asset/production/compiler/passes/GeometryPass.js +32 -0
- package/dist/runtime/modules/asset/production/compiler/passes/JointFramePass.js +116 -0
- package/dist/runtime/modules/asset/production/compiler/passes/KinematicEvidencePass.js +84 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ManifestPass.js +63 -0
- package/dist/runtime/modules/asset/production/compiler/passes/NormalizeTransformPass.js +16 -0
- package/dist/runtime/modules/asset/production/compiler/passes/OptimizeGLBPass.js +23 -0
- package/dist/runtime/modules/asset/production/compiler/passes/PartColliderPass.js +50 -0
- package/dist/runtime/modules/asset/production/compiler/passes/PartGeometryEnrichmentPass.js +60 -0
- package/dist/runtime/modules/asset/production/compiler/passes/PartProposalPass.js +93 -0
- package/dist/runtime/modules/asset/production/compiler/passes/RemoteEnrichmentPass.js +32 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ResourceBudgetPass.js +55 -0
- package/dist/runtime/modules/asset/production/compiler/passes/SegmentMaterializePass.js +203 -0
- package/dist/runtime/modules/asset/production/compiler/passes/SegmentationEvidencePass.js +43 -0
- package/dist/runtime/modules/asset/production/compiler/passes/SemanticHeuristicPass.js +33 -0
- package/dist/runtime/modules/asset/production/compiler/passes/StructurePass.js +60 -0
- package/dist/runtime/modules/asset/production/compiler/providers/HttpCompilerProvider.js +23 -0
- package/dist/runtime/modules/asset/production/verification/KinematicHypothesisScreen.js +198 -0
- package/dist/runtime/modules/asset/registry/AssetCatalog.js +72 -0
- package/dist/runtime/modules/asset/registry/AssetRegistry.js +51 -0
- package/dist/runtime/modules/asset/registry/manifests/index.js +173 -0
- package/dist/runtime/modules/asset/tasks.jsonl +87 -0
- package/dist/runtime/modules/generation/README.md +9 -0
- package/dist/runtime/modules/generation/connector/ConnectorArtifactClient.js +45 -0
- package/dist/runtime/modules/generation/connector/ConnectorCapabilityAdapter.js +169 -0
- package/dist/runtime/modules/generation/connector/ConnectorClient.js +192 -0
- package/dist/runtime/modules/generation/connector/ConnectorJobClient.js +167 -0
- package/dist/runtime/modules/generation/connector/ConnectorJobEventClient.js +179 -0
- package/dist/runtime/modules/generation/connector/ConnectorSession.js +202 -0
- package/dist/runtime/modules/generation/jobs/GenerationJobProjection.js +239 -0
- package/dist/runtime/modules/generation/jobs/GenerationJobReconciler.js +99 -0
- package/dist/runtime/modules/generation/jobs/GenerationJobStore.js +91 -0
- package/dist/runtime/modules/generation/jobs/GenerationJobTransportOverlay.js +50 -0
- package/dist/runtime/modules/generation/providers/ProviderRegistry.js +304 -0
- package/dist/runtime/modules/generation/tasks.jsonl +35 -0
- package/dist/runtime/modules/navigation/NavigationBackend.js +17 -0
- package/dist/runtime/modules/navigation/RecastNavigationBackend.js +263 -0
- package/dist/runtime/modules/physics/JoltPhysicsBackend.js +850 -0
- package/dist/runtime/modules/physics/PhysicsApiSurface.js +660 -0
- package/dist/runtime/modules/physics/PhysicsBackend.js +88 -0
- package/dist/runtime/modules/physics/RapierPhysicsBackend.js +414 -0
- package/dist/runtime/modules/rendering/README.md +7 -0
- package/dist/runtime/modules/rendering/RendererProbe.js +153 -0
- package/dist/runtime/modules/rendering/WebGpuPostFxPipeline.js +140 -0
- package/dist/runtime/modules/rendering/captureStill.js +54 -0
- package/dist/runtime/modules/rendering/createRenderer.js +76 -0
- package/dist/runtime/modules/rendering/disposeObject3D.js +37 -0
- package/dist/runtime/modules/rendering/loadGaussianSplatVisual.js +74 -0
- package/dist/runtime/modules/rendering/spatial/ThreeBvhRuntime.js +107 -0
- package/dist/runtime/modules/rendering/style/StylePack.js +34 -0
- package/dist/runtime/modules/rendering/style/StyleSystem.js +173 -0
- package/dist/runtime/modules/rendering/tasks.jsonl +7 -0
- package/dist/runtime/modules/world/README.md +13 -0
- package/dist/runtime/modules/world/build/WorldBuilder.js +170 -0
- package/dist/runtime/modules/world/compiler/PipelineEngine.js +32 -0
- package/dist/runtime/modules/world/compiler/WorldAdmission.js +43 -0
- package/dist/runtime/modules/world/compiler/WorldBehaviorCompiler.js +68 -0
- package/dist/runtime/modules/world/compiler/WorldCompilation.js +157 -0
- package/dist/runtime/modules/world/compiler/WorldComposer.js +201 -0
- package/dist/runtime/modules/world/compiler/WorldPhysicsAdmission.js +76 -0
- package/dist/runtime/modules/world/compiler/WorldRecompiler.js +356 -0
- package/dist/runtime/modules/world/compiler/WorldRetry.js +75 -0
- package/dist/runtime/modules/world/compiler/createWorldPipeline.js +379 -0
- package/dist/runtime/modules/world/content/blankWorld.js +35 -0
- package/dist/runtime/modules/world/content/environments.js +84 -0
- package/dist/runtime/modules/world/content/grandUrbanBlock.js +189 -0
- package/dist/runtime/modules/world/content/magic-cabin/README.md +28 -0
- package/dist/runtime/modules/world/content/magic-cabin/affordances.js +64 -0
- package/dist/runtime/modules/world/content/magic-cabin/cabinContents.js +7078 -0
- package/dist/runtime/modules/world/content/magic-cabin/lighting.js +26 -0
- package/dist/runtime/modules/world/content/magic-cabin/materials.js +20 -0
- package/dist/runtime/modules/world/content/magicCabin.js +190 -0
- package/dist/runtime/modules/world/content/monumentHall.js +154 -0
- package/dist/runtime/modules/world/content/ruinedCourtyard.js +196 -0
- package/dist/runtime/modules/world/content/suzhouGarden/README.md +141 -0
- package/dist/runtime/modules/world/content/suzhouGarden/index.js +137 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/arch.js +491 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/buildings.js +670 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/core.js +578 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/lod.js +127 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/main.js +642 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/nature.js +650 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/rockery.js +280 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/sky.js +242 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/water.js +215 -0
- package/dist/runtime/modules/world/content/woodlandWorkshop.js +192 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/README.md +36 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/arch.js +351 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/buildings.js +490 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/core.js +505 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/index.js +101 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/nature.js +435 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/sky.js +169 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/water.js +245 -0
- package/dist/runtime/modules/world/errors.js +9 -0
- package/dist/runtime/modules/world/generated/GeneratedWorldCoordinates.js +50 -0
- package/dist/runtime/modules/world/generated/GeneratedWorldLoader.js +297 -0
- package/dist/runtime/modules/world/runtime/CommandHistory.js +111 -0
- package/dist/runtime/modules/world/runtime/EntityCapabilityRegistry.js +165 -0
- package/dist/runtime/modules/world/runtime/NativeNavigationGeometry.js +84 -0
- package/dist/runtime/modules/world/runtime/NativePhysicsSnapshot.js +245 -0
- package/dist/runtime/modules/world/runtime/ObjectStore.js +31 -0
- package/dist/runtime/modules/world/runtime/ObjectTransform.js +62 -0
- package/dist/runtime/modules/world/runtime/ObservedEntity.js +37 -0
- package/dist/runtime/modules/world/runtime/ProjectCapabilities.js +240 -0
- package/dist/runtime/modules/world/runtime/SceneExtensions.js +36 -0
- package/dist/runtime/modules/world/runtime/ScenePresentation.js +101 -0
- package/dist/runtime/modules/world/runtime/SceneSerializer.js +281 -0
- package/dist/runtime/modules/world/runtime/WorldAuthority.js +41 -0
- package/dist/runtime/modules/world/runtime/WorldCollisionSignature.js +14 -0
- package/dist/runtime/modules/world/runtime/WorldCommands.js +503 -0
- package/dist/runtime/modules/world/runtime/WorldObservation.js +71 -0
- package/dist/runtime/modules/world/runtime/WorldQueries.js +340 -0
- package/dist/runtime/modules/world/runtime/WorldRecovery.js +78 -0
- package/dist/runtime/modules/world/runtime/WorldRuntime.js +806 -0
- package/dist/runtime/modules/world/runtime/affordance/ObjectAffordances.js +110 -0
- package/dist/runtime/modules/world/runtime/affordance/WorldAffordances.js +130 -0
- package/dist/runtime/modules/world/runtime/behavior/BehaviorCompiler.js +79 -0
- package/dist/runtime/modules/world/runtime/behavior/ProjectStateMachine.js +195 -0
- package/dist/runtime/modules/world/runtime/behavior/RuleGraph.js +70 -0
- package/dist/runtime/modules/world/runtime/behavior/RuleRuntime.js +115 -0
- package/dist/runtime/modules/world/runtime/graph/SceneGraph.js +390 -0
- package/dist/runtime/modules/world/runtime/interaction/ArticulationRuntime.js +214 -0
- package/dist/runtime/modules/world/runtime/interaction/CarryCapability.js +65 -0
- package/dist/runtime/modules/world/runtime/interaction/CarryRuntime.js +244 -0
- package/dist/runtime/modules/world/runtime/interaction/InteractionApproach.js +147 -0
- package/dist/runtime/modules/world/runtime/interaction/InteractionContract.js +57 -0
- package/dist/runtime/modules/world/runtime/interaction/ManipulationActions.js +7 -0
- package/dist/runtime/modules/world/runtime/interaction/NativePhysicalTarget.js +31 -0
- package/dist/runtime/modules/world/runtime/interaction/RecoveryRuntime.js +123 -0
- package/dist/runtime/modules/world/runtime/interaction/SettleRuntime.js +134 -0
- package/dist/runtime/modules/world/runtime/semantic/NativePhysicsState.js +89 -0
- package/dist/runtime/modules/world/runtime/semantic/SemanticWorldView.js +129 -0
- package/dist/runtime/modules/world/runtime/simulation/SimulationClock.js +89 -0
- package/dist/runtime/modules/world/runtime/simulation/SimulationSession.js +104 -0
- package/dist/runtime/modules/world/runtime/simulation/ThermalSystem.js +269 -0
- package/dist/runtime/modules/world/runtime/simulation/WorldTimeline.js +110 -0
- package/dist/runtime/modules/world/runtime/spatial/SpatialSnapshot.js +56 -0
- package/dist/runtime/modules/world/runtime/spatial/VisualMeshBounds.js +41 -0
- package/dist/runtime/modules/world/runtime/systems/AudioSystem.js +306 -0
- package/dist/runtime/modules/world/runtime/systems/Instrument.js +39 -0
- package/dist/runtime/modules/world/runtime/systems/InteractionSystem.js +806 -0
- package/dist/runtime/modules/world/runtime/systems/LocomotionSystem.js +281 -0
- package/dist/runtime/modules/world/runtime/systems/NavigationSystem.js +561 -0
- package/dist/runtime/modules/world/runtime/systems/PhysicsSystem.js +1752 -0
- package/dist/runtime/modules/world/runtime/systems/RenderingSystem.js +527 -0
- package/dist/runtime/modules/world/runtime/systems/SpatialSystem.js +402 -0
- package/dist/runtime/modules/world/spec/WorldIR.js +165 -0
- package/dist/runtime/modules/world/spec/WorldIRToolSchema.js +86 -0
- package/dist/runtime/modules/world/spec/WorldPlannerProposal.js +51 -0
- package/dist/runtime/modules/world/spec/WorldRevision.js +231 -0
- package/dist/runtime/modules/world/spec/WorldSpec.js +86 -0
- package/dist/runtime/modules/world/tasks.jsonl +530 -0
- package/dist/runtime/modules/world/verification/ArticulationVerifier.js +254 -0
- package/dist/runtime/modules/world/verification/Finding.js +105 -0
- package/dist/runtime/modules/world/verification/InteractionEvidence.js +73 -0
- package/dist/runtime/modules/world/verification/RepairEngine.js +49 -0
- package/dist/runtime/modules/world/verification/VisualLayoutAcceptance.js +58 -0
- package/dist/runtime/modules/world/verification/WorldAcceptance.js +176 -0
- package/dist/runtime/modules/world/verification/WorldValidator.js +67 -0
- package/dist/runtime/package-lock.json +16071 -0
- package/dist/runtime/package.json +106 -0
- package/dist/runtime/public/assets/cabinet.glb +0 -0
- package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_nor_gl_1k.jpg +0 -0
- package/dist/runtime/public/assets/grand-urban-block/concrete_pavement_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/grand-urban-block/urban_street_01_1k.hdr +0 -0
- package/dist/runtime/public/assets/monument-hall/marble_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/monument-hall/marble_nor_gl_1k.jpg +0 -0
- package/dist/runtime/public/assets/monument-hall/marble_rough_1k.jpg +0 -0
- package/dist/runtime/public/assets/monument-hall/solitude_interior_1k.hdr +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/courtyard_1k.hdr +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_nor_gl_1k.jpg +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/mossy_sandstone_diff_1k.jpg +0 -0
- package/dist/schema-DT7K9NjP.js +165 -0
- package/dist/schema-DT7K9NjP.js.map +1 -0
- package/dist/suzhouGarden-Y3hny8j6.js +6150 -0
- package/dist/suzhouGarden-Y3hny8j6.js.map +1 -0
- package/dist/version-CHc-i8ch.js +5 -0
- package/dist/version-CHc-i8ch.js.map +1 -0
- package/dist/woodlandWorkshop-DsScU-cx.js +483 -0
- package/dist/woodlandWorkshop-DsScU-cx.js.map +1 -0
- package/dist/yuanmingyuan-DsFnPzzR.js +4955 -0
- package/dist/yuanmingyuan-DsFnPzzR.js.map +1 -0
- package/package.json +75 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ruinedCourtyard-DuF7NmUU.js","names":[],"sources":["../../../modules/world/content/ruinedCourtyard.js"],"sourcesContent":["import * as THREE from 'three';\n\nexport const RUINED_COURTYARD_ASSETS = Object.freeze({\n hdri: '/assets/ruined-courtyard/courtyard_1k.hdr',\n groundDiffuse: '/assets/ruined-courtyard/mossy_cobblestone_diff_1k.jpg',\n groundNormal: '/assets/ruined-courtyard/mossy_cobblestone_nor_gl_1k.jpg',\n wallDiffuse: '/assets/ruined-courtyard/mossy_sandstone_diff_1k.jpg'\n});\n\nconst box = (halfExtents, translation, rotation = null) => ({ shape:'box', halfExtents, translation, ...(rotation ? { rotation } : {}) });\nconst cylinder = (radius, halfHeight, translation, rotation = null) => ({ shape:'cylinder', radius, halfHeight, translation, ...(rotation ? { rotation } : {}) });\nconst qx = (a) => [Math.sin(a / 2), 0, 0, Math.cos(a / 2)];\nconst qy = (a) => [0, Math.sin(a / 2), 0, Math.cos(a / 2)];\nconst qz = (a) => [0, 0, Math.sin(a / 2), Math.cos(a / 2)];\nconst rotateXZ = (x, z, a) => [Math.cos(a) * x + Math.sin(a) * z, -Math.sin(a) * x + Math.cos(a) * z];\nconst archColliders = (x, z, angle = 0) => {\n const rotation = qy(angle);\n const at = (lx, y, lz) => {\n const [dx, dz] = rotateXZ(lx, lz, angle);\n return [x + dx, y, z + dz];\n };\n return [\n box([.55, 2.4, .375], at(-2.45, 2.4, 0), rotation),\n box([.55, 2.4, .375], at(2.45, 2.4, 0), rotation),\n box([3, .5, .375], at(0, 5, 0), rotation)\n ];\n};\n\nconst EAST_STEPS = Array.from({ length:6 }, (_, i) => box([.25, (i + 1) * .1, 2.1], [4.25 + i * .5, (i + 1) * .1, 4.8]));\nconst WEST_STEPS = Array.from({ length:4 }, (_, i) => box([.25, (i + 1) * .1, 1.8], [-5.95 - i * .5, (i + 1) * .1, -6.2]));\n\nexport const RUINED_COURTYARD_COLLIDERS = Object.freeze([\n box([18, .15, 15], [0, -.15, 0]),\n box([5.2, .6, 5.4], [12.2, .6, 4.8]),\n box([4.5, .4, 4.6], [-12.2, .4, -6.2]),\n ...EAST_STEPS,\n ...WEST_STEPS,\n box([5.8, 2.4, .28], [-11.9, 2.4, -14.6]),\n box([5.8, 2.4, .28], [11.9, 2.4, -14.6]),\n box([2.2, .75, .28], [0, 4.05, -14.6]),\n box([.28, 2.7, 5.2], [-17.6, 2.7, -7.8]),\n box([.28, 1.9, 3.1], [-17.6, 1.9, 7.8]),\n box([.28, 2.2, 4.4], [17.6, 2.2, -8.4]),\n box([.28, 1.5, 2.6], [17.6, 1.5, 8.8]),\n ...archColliders(0, -14.25),\n ...archColliders(-17.25, 1.3, Math.PI / 2),\n ...archColliders(17.25, 1.0, -Math.PI / 2),\n cylinder(2.0, .42, [0, .42, -1.8]),\n cylinder(.42, 3.2, [-6.2, .55, 3.7], qz(Math.PI / 2)),\n cylinder(.38, 2.5, [7.2, .5, -8.0], qx(Math.PI / 2)),\n box([2.1, .45, .55], [-3.8, .45, 9.6], qz(-.18)),\n box([1.7, .35, .5], [4.6, .35, 10.4], qz(.13))\n]);\n\nconst mesh = (geometry, material, { position, rotation, name, castShadow = true, receiveShadow = true, navigationIgnore = false } = {}) => {\n const value = new THREE.Mesh(geometry, material);\n if (position) value.position.set(...position);\n if (rotation) value.rotation.set(...rotation);\n value.name = name || '';\n value.castShadow = castShadow;\n value.receiveShadow = receiveShadow;\n if (navigationIgnore) value.userData.navigationIgnore = true;\n return value;\n};\n\nconst tile = (texture, repeat, color = false) => {\n texture.wrapS = texture.wrapT = THREE.RepeatWrapping;\n texture.repeat.set(...repeat);\n texture.anisotropy = 4;\n if (color) texture.colorSpace = THREE.SRGBColorSpace;\n return texture;\n};\n\nconst addArch = (root, material, x, z, rotationY = 0, name = 'Arch') => {\n const group = new THREE.Group();\n group.name = name;\n group.position.set(x, 0, z);\n group.rotation.y = rotationY;\n group.add(\n mesh(new THREE.BoxGeometry(1.1, 4.8, .75), material, { position:[-2.45, 2.4, 0] }),\n mesh(new THREE.BoxGeometry(1.1, 4.8, .75), material, { position:[2.45, 2.4, 0] }),\n mesh(new THREE.BoxGeometry(6, 1.0, .75), material, { position:[0, 5.0, 0] }),\n mesh(new THREE.TorusGeometry(2.45, .28, 10, 48, Math.PI), material, { position:[0, 4.25, 0], rotation:[0, 0, Math.PI], navigationIgnore:true })\n );\n root.add(group);\n};\n\nconst addGrass = (root) => {\n const geometry = new THREE.ConeGeometry(.08, .55, 5);\n const material = new THREE.MeshStandardMaterial({ color:0x405d31, roughness:.9 });\n const patches = [[-14,0,11],[-11,0,7],[-7,0,12],[-3,0,11],[3,0,12],[8,0,11],[12,1.2,5],[14,1.2,2],[-13,.8,-5],[-11,.8,-9],[14,0,-10],[8,0,-12]];\n const instanced = new THREE.InstancedMesh(geometry, material, patches.length * 9);\n instanced.name = 'CourtyardGrass';\n instanced.userData.navigationIgnore = true;\n instanced.castShadow = true;\n instanced.receiveShadow = true;\n const matrix = new THREE.Matrix4();\n let index = 0;\n for (const [x, y, z] of patches) {\n for (let i = 0; i < 9; i++) {\n const px = x + ((i * 37) % 7 - 3) * .16;\n const pz = z + ((i * 53) % 7 - 3) * .15;\n const scale = .55 + ((i * 29) % 5) * .12;\n matrix.compose(new THREE.Vector3(px, y + .25 * scale, pz), new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), i * .77), new THREE.Vector3(scale, scale, scale));\n instanced.setMatrixAt(index++, matrix);\n }\n }\n instanced.instanceMatrix.needsUpdate = true;\n root.add(instanced);\n};\n\nexport function createRuinedCourtyard({ loadAssets = true } = {}) {\n const root = new THREE.Group();\n root.name = 'RuinedCourtyard';\n root.userData.environment = 'ruined-courtyard';\n\n const ground = new THREE.MeshStandardMaterial({ color:0x66655a, roughness:.94, metalness:0 });\n const sandstone = new THREE.MeshStandardMaterial({ color:0x777568, roughness:.92 });\n const darkStone = new THREE.MeshStandardMaterial({ color:0x343932, roughness:.98 });\n const water = new THREE.MeshPhysicalMaterial({ color:0x203f43, roughness:.2, transmission:.08, transparent:true, opacity:.72 });\n\n const floor = mesh(new THREE.BoxGeometry(36, .3, 30), ground, { position:[0, -.15, 0], name:'CourtyardFloor', castShadow:false });\n root.add(floor);\n root.add(\n mesh(new THREE.BoxGeometry(10.4, 1.2, 10.8), darkStone, { position:[12.2, .6, 4.8], name:'EastTerrace' }),\n mesh(new THREE.BoxGeometry(9, .8, 9.2), darkStone, { position:[-12.2, .4, -6.2], name:'WestTerrace' })\n );\n\n for (let i = 0; i < 6; i++) root.add(mesh(new THREE.BoxGeometry(.5, (i + 1) * .2, 4.2), ground, { position:[4.25 + i * .5, (i + 1) * .1, 4.8], name:`EastStep_${i}` }));\n for (let i = 0; i < 4; i++) root.add(mesh(new THREE.BoxGeometry(.5, (i + 1) * .2, 3.6), ground, { position:[-5.95 - i * .5, (i + 1) * .1, -6.2], name:`WestStep_${i}` }));\n\n const wall = (size, position, name) => root.add(mesh(new THREE.BoxGeometry(...size), sandstone, { position, name, castShadow:false }));\n wall([11.6, 4.8, .56], [-11.9, 2.4, -14.6], 'NorthWallWest');\n wall([11.6, 4.8, .56], [11.9, 2.4, -14.6], 'NorthWallEast');\n wall([4.4, 1.5, .56], [0, 4.05, -14.6], 'NorthLintel');\n wall([.56, 5.4, 10.4], [-17.6, 2.7, -7.8], 'WestWallNorth');\n wall([.56, 3.8, 6.2], [-17.6, 1.9, 7.8], 'WestWallSouth');\n wall([.56, 4.4, 8.8], [17.6, 2.2, -8.4], 'EastWallNorth');\n wall([.56, 3.0, 5.2], [17.6, 1.5, 8.8], 'EastWallSouth');\n\n addArch(root, sandstone, 0, -14.25, 0, 'NorthGate');\n addArch(root, sandstone, -17.25, 1.3, Math.PI / 2, 'WestArcade');\n addArch(root, sandstone, 17.25, 1.0, -Math.PI / 2, 'EastArcade');\n\n root.add(\n mesh(new THREE.CylinderGeometry(2, 2.25, .84, 40), darkStone, { position:[0, .42, -1.8], name:'DryFountain' }),\n mesh(new THREE.CylinderGeometry(1.55, 1.55, .06, 40), water, { position:[0, .87, -1.8], name:'FountainWater', castShadow:false, receiveShadow:false, navigationIgnore:true }),\n mesh(new THREE.CylinderGeometry(.42, .46, 6.4, 18), sandstone, { position:[-6.2, .55, 3.7], rotation:[0, 0, Math.PI / 2], name:'FallenColumnWest' }),\n mesh(new THREE.CylinderGeometry(.38, .42, 5, 18), sandstone, { position:[7.2, .5, -8], rotation:[Math.PI / 2, 0, 0], name:'FallenColumnEast' }),\n mesh(new THREE.BoxGeometry(4.2, .9, 1.1), sandstone, { position:[-3.8, .45, 9.6], rotation:[0, 0, -.18], name:'CollapsedBeamWest' }),\n mesh(new THREE.BoxGeometry(3.4, .7, 1), sandstone, { position:[4.6, .35, 10.4], rotation:[0, 0, .13], name:'CollapsedBeamEast' })\n );\n\n for (const [x, y, z, s] of [[-14,.82,9,.65],[-9,.2,10,.45],[-3,.2,12,.5],[5,.2,12,.4],[13,1.35,7,.5],[-13,1.0,-10,.55],[12,.2,-11,.5]]) {\n const rock = mesh(new THREE.DodecahedronGeometry(s, 0), darkStone, { position:[x, y, z], name:'Rubble', navigationIgnore:true });\n rock.rotation.set(.2 + x * .01, .4 + z * .02, .15);\n root.add(rock);\n }\n addGrass(root);\n\n const hemi = new THREE.HemisphereLight(0xc8d6c2, 0x263127, 1.9);\n const sun = new THREE.DirectionalLight(0xffe0ad, 4.1);\n sun.position.set(-11, 17, 10);\n sun.castShadow = true;\n sun.shadow.mapSize.set(2048, 2048);\n Object.assign(sun.shadow.camera, { left:-24, right:24, top:20, bottom:-20, near:1, far:55 });\n const fill = new THREE.DirectionalLight(0x91aec4, .8);\n fill.position.set(12, 8, -14);\n root.add(hemi, sun, fill);\n\n let active = true;\n const loader = loadAssets ? new THREE.TextureLoader() : null;\n const loadTexture = (url, configure, apply) => loader?.load(url, (texture) => {\n if (!active) { texture.dispose(); return; }\n configure?.(texture);\n apply(texture);\n });\n if (loadAssets) {\n loadTexture(RUINED_COURTYARD_ASSETS.groundDiffuse, (t) => tile(t, [12, 10], true), (t) => { ground.map = t; ground.needsUpdate = true; });\n loadTexture(RUINED_COURTYARD_ASSETS.groundNormal, (t) => tile(t, [12, 10]), (t) => { ground.normalMap = t; ground.normalScale.set(.42, .42); ground.needsUpdate = true; });\n loadTexture(RUINED_COURTYARD_ASSETS.wallDiffuse, (t) => tile(t, [5, 3], true), (t) => { sandstone.map = t; sandstone.needsUpdate = true; });\n }\n\n return {\n id:'ruined-courtyard',\n root,\n floor,\n colliders:RUINED_COURTYARD_COLLIDERS.map((value) => structuredClone(value)),\n layout:{bounds:{min:[-17,-14],max:[17,14]},groundY:0,margin:1},\n camera:{ position:[16.8, 8.8, 19.5], target:[0, 1.2, -2.6] },\n rendering:{ background:0x667160, fog:{ color:0x667160, near:24, far:72 }, exposure:1.08 , ibl:loadAssets?{url:RUINED_COURTYARD_ASSETS.hdri,intensity:1}:null },\n dispose() {\n active = false;\n }\n };\n}\n"],"mappings":";;AAEA,MAAa,0BAA0B,OAAO,OAAO;CACnD,MAAM;CACN,eAAe;CACf,cAAc;CACd,aAAa;AACf,CAAC;AAED,MAAM,OAAO,aAAa,aAAa,WAAW,UAAU;CAAE,OAAM;CAAO;CAAa;CAAa,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;AAAG;AACvI,MAAM,YAAY,QAAQ,YAAY,aAAa,WAAW,UAAU;CAAE,OAAM;CAAY;CAAQ;CAAY;CAAa,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;AAAG;AAC/J,MAAM,MAAM,MAAM;CAAC,KAAK,IAAI,IAAI,CAAC;CAAG;CAAG;CAAG,KAAK,IAAI,IAAI,CAAC;AAAC;AACzD,MAAM,MAAM,MAAM;CAAC;CAAG,KAAK,IAAI,IAAI,CAAC;CAAG;CAAG,KAAK,IAAI,IAAI,CAAC;AAAC;AACzD,MAAM,MAAM,MAAM;CAAC;C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MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,MAAM;GAAE,UAAU,MAAM;GAAG,UAAU,cAAc;EAAM,CAAC;CAC5I;CAEA,OAAO;EACL,IAAG;EACH;EACA;EACA,WAAU,2BAA2B,KAAK,UAAU,gBAAgB,KAAK,CAAC;EAC1E,QAAO;GAAC,QAAO;IAAC,KAAI,CAAC,KAAI,GAAG;IAAE,KAAI,CAAC,IAAG,EAAE;GAAC;GAAE,SAAQ;GAAE,QAAO;EAAC;EAC7D,QAAO;GAAE,UAAS;IAAC;IAAM;IAAK;GAAI;GAAG,QAAO;IAAC;IAAG;IAAK;GAAI;EAAE;EAC3D,WAAU;GAAE,YAAW;GAAU,KAAI;IAAE,OAAM;IAAU,MAAK;IAAI,KAAI;GAAG;GAAG,UAAS;GAAO,KAAI,aAAW;IAAC,KAAI,wBAAwB;IAAK,WAAU;GAAC,IAAE;EAAK;EAC7J,UAAU;GACR,SAAS;EACX;CACF;AACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { buildTaskObservation } from './buildTaskObservation.js';
|
|
2
|
+
|
|
3
|
+
export class AgentTools {
|
|
4
|
+
constructor(runtime, { profile = 'builder', actor = 'agent', source = null } = {}) {
|
|
5
|
+
this.runtime = runtime;
|
|
6
|
+
this.profile = profile;
|
|
7
|
+
this.actor = actor;
|
|
8
|
+
this.source = source;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
definitions() { return this.runtime.skills.definitions(); }
|
|
12
|
+
executionPolicy(name, result) { return this.runtime.skills.executionPolicy(name, result); }
|
|
13
|
+
taskObservation(state = {}) { return buildTaskObservation(this.runtime,{ actor:this.actor,...state }); }
|
|
14
|
+
recordSequence(payload) {
|
|
15
|
+
const event={...payload,...(this.source?{source:this.source}:{})};
|
|
16
|
+
this.runtime.events.emit('agent.sequence', event);
|
|
17
|
+
this.runtime.trace?.emit('agent.sequence', event, { actor:this.actor });
|
|
18
|
+
}
|
|
19
|
+
async call(name, args = {}, internalContext = {}) {
|
|
20
|
+
this.runtime.events.emit('tool.called', { name, args, ...(this.source?{source:this.source}:{}) });
|
|
21
|
+
const response = await this.runtime.skills.invoke(name, args, { ...internalContext, profile:this.profile, actor:this.actor });
|
|
22
|
+
if (!response.success) throw Object.assign(new Error(response.error.message), {
|
|
23
|
+
code:response.error.code,
|
|
24
|
+
...(response.error.details ? { diagnostics:response.error.details } : {})
|
|
25
|
+
});
|
|
26
|
+
return response.result;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Application
|
|
2
|
+
|
|
3
|
+
自由代码世界入口:`native-scene/CodeProject.js`。它承载持续项目模块并通过既有 SceneFacade 暴露动态能力,复用 Runtime 与资产迁移;契约见 `docs/modules/code-project.md`,示例在 `examples/code-project/`。
|
|
4
|
+
|
|
5
|
+
跨域工作现场:装配模块、注册产品 Skills、组装 Agent 观察,协调生成到资产再到世界的流程。
|
|
6
|
+
|
|
7
|
+
入口:createSession.js、skills/registerCoreSkills.js、generation/GenerationRuntime.js。
|
|
8
|
+
Studio 使用 createSession 创建 World、Asset、Generation 与 Skills;初始化顺序和宿主帧循环仍由 Studio 控制。
|
|
9
|
+
AgentTools 和 buildTaskObservation 放在这里,Agent 执行循环不需要知道各模块的内部装配。
|
|
10
|
+
|
|
11
|
+
generation/ 保留已有协调文件,不再属于 modules/generation。此处不拥有第二份资产或世界事实。
|
|
12
|
+
当前仍通过 world.generation/world.skills 连接既有代码;进一步缩小接口应按具体任务进行,不能仅靠搬文件宣称解耦完成。
|
|
13
|
+
|
|
14
|
+
任务见 tasks.jsonl。验证:npm run world:viability 与 npm run test。
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Studio-only progressive disclosure for the large runtime tool catalog.
|
|
3
|
+
* Discovery changes LLM visibility, not Runtime permissions or capabilities.
|
|
4
|
+
*/
|
|
5
|
+
const INITIAL_TOOLS = Object.freeze([
|
|
6
|
+
'listObjects', 'observeScene', 'verifyScene', 'planSceneTask', 'interactScene', 'diagnoseSceneNavigation',
|
|
7
|
+
'searchAssets', 'generateAsset', 'addSceneModel',
|
|
8
|
+
'approachAndInteract', 'approachAndPickup', 'approachAndPlace',
|
|
9
|
+
'navigateTo', 'listInteractablesNearMe',
|
|
10
|
+
'readStudioProject', 'writeStudioProject', 'readStudioFile', 'editStudioFile',
|
|
11
|
+
'previewStudioProjectBatch', 'applyStudioProjectBatch', 'runStudioProject', 'saveStudioProject'
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
const DISCOVER = Object.freeze({
|
|
15
|
+
name:'discoverAgentTools',
|
|
16
|
+
description:'List additional available tool names and short descriptions, or activate up to 20 named tools for the next planning round. Call with {} to inspect the catalog; then call with names:[...] to expose full JSON schemas. This changes only tool visibility, never world state.',
|
|
17
|
+
parameters:{
|
|
18
|
+
type:'object',
|
|
19
|
+
properties:{
|
|
20
|
+
query:{type:'string',description:'Optional name/description search; omit to list every available tool.'},
|
|
21
|
+
names:{type:'array',items:{type:'string'},minItems:1,maxItems:20,description:'Existing tool names to expose in subsequent planning rounds.'}
|
|
22
|
+
},
|
|
23
|
+
additionalProperties:false
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
function invalidCatalogRequest(message) {
|
|
28
|
+
const error = new Error(message);
|
|
29
|
+
error.code = 'TOOL_DISCOVERY_INVALID';
|
|
30
|
+
return error;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Wrap only the LLM-facing Studio tools. Direct Studio/MCP invocations remain unchanged. */
|
|
34
|
+
export function createProgressiveAgentTools(base, { initialNames = INITIAL_TOOLS } = {}) {
|
|
35
|
+
if (!base || typeof base.definitions !== 'function' || typeof base.call !== 'function')
|
|
36
|
+
throw new TypeError('Progressive tools require AgentTools');
|
|
37
|
+
let exposed = new Set(initialNames);
|
|
38
|
+
const fullDefinitions = () => base.definitions();
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
get runtime() { return base.runtime; },
|
|
42
|
+
get actor() { return base.actor; },
|
|
43
|
+
beginTask(text) {
|
|
44
|
+
exposed = new Set(initialNames);
|
|
45
|
+
base.beginTask?.(text);
|
|
46
|
+
},
|
|
47
|
+
fullDefinitions,
|
|
48
|
+
definitions() {
|
|
49
|
+
return [...fullDefinitions().filter(tool => exposed.has(tool.name)), DISCOVER];
|
|
50
|
+
},
|
|
51
|
+
executionPolicy(name, result) {
|
|
52
|
+
if (name === DISCOVER.name) return {
|
|
53
|
+
mutates:false, history:false, barrier:false, auxiliary:true,
|
|
54
|
+
tracksUnresolved:false, batchable:false, batchAcceptable:true,
|
|
55
|
+
outcome:{state:'accepted',verified:null}
|
|
56
|
+
};
|
|
57
|
+
return base.executionPolicy(name,result);
|
|
58
|
+
},
|
|
59
|
+
taskObservation(state) { return base.taskObservation?.(state) || null; },
|
|
60
|
+
recordSequence(payload) { return base.recordSequence?.(payload); },
|
|
61
|
+
async call(name, args = {}, context = {}) {
|
|
62
|
+
if (name !== DISCOVER.name) return base.call(name,args,context);
|
|
63
|
+
const catalog = fullDefinitions();
|
|
64
|
+
const byName = new Map(catalog.map(tool => [tool.name,tool]));
|
|
65
|
+
base.runtime?.events?.emit?.('tool.called',{name,args,source:'studio-agent-discovery'});
|
|
66
|
+
if (args.names !== undefined) {
|
|
67
|
+
if (!Array.isArray(args.names) || args.names.length < 1 || args.names.length > 20)
|
|
68
|
+
throw invalidCatalogRequest('names must contain 1-20 available tool names');
|
|
69
|
+
const names = [...new Set(args.names)];
|
|
70
|
+
const unknown = names.filter(value => typeof value !== 'string' || !byName.has(value));
|
|
71
|
+
if (unknown.length) throw invalidCatalogRequest('Unknown tool names: ' + unknown.map(String).join(', '));
|
|
72
|
+
for (const value of names) exposed.add(value);
|
|
73
|
+
return {status:'tool-catalog-updated',exposed:names,
|
|
74
|
+
totalExposed:catalog.filter(tool=>exposed.has(tool.name)).length,
|
|
75
|
+
instruction:'The named tool schemas will appear in the next planning round.'};
|
|
76
|
+
}
|
|
77
|
+
if (args.query !== undefined && typeof args.query !== 'string')
|
|
78
|
+
throw invalidCatalogRequest('query must be a string');
|
|
79
|
+
const query=(args.query || '').trim().toLowerCase();
|
|
80
|
+
const remaining=catalog.filter(tool=>!exposed.has(tool.name));
|
|
81
|
+
const matched=query
|
|
82
|
+
? remaining.filter(tool=>(tool.name+' '+(tool.description||'')).toLowerCase().includes(query))
|
|
83
|
+
: remaining;
|
|
84
|
+
return {
|
|
85
|
+
status:'tool-catalog',totalAvailable:catalog.length,totalHidden:remaining.length,
|
|
86
|
+
query:query || null,
|
|
87
|
+
tools:matched.map(tool=>({name:tool.name,description:String(tool.description || '').slice(0,125)})),
|
|
88
|
+
instruction:'Call discoverAgentTools with names:[...] to expose selected tool schemas.'
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { STUDIO_PROJECT_TOOLS } from './StudioProjectTools.js';
|
|
2
|
+
|
|
3
|
+
/** Tools available to external Pi and DSH agents. Never expose host-code execution. */
|
|
4
|
+
export const AGENT_STUDIO_MCP_TOOLS = Object.freeze([
|
|
5
|
+
'session_attach','studio_session_status','studio_sessions_list',
|
|
6
|
+
'scene_observe','scene_verify','scene_navigation','scene_add_model','scene_apply','scene_history',
|
|
7
|
+
'scene_interact','scene_job','scene_cancel',...STUDIO_PROJECT_TOOLS,
|
|
8
|
+
'asset_build_submit','asset_build_status','asset_publish','asset_inspect'
|
|
9
|
+
]);
|
|
10
|
+
export const AGENT_STUDIO_MCP_SET = new Set(AGENT_STUDIO_MCP_TOOLS);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Shared MCP tool names and mutation semantics, independent of transport and Studio. */
|
|
2
|
+
export const STUDIO_PROJECT_TOOLS=Object.freeze(['studio_project','studio_files','scene_query','scene_capture','scene_timeline']);
|
|
3
|
+
export const STUDIO_PROJECT_TOOL_SET=new Set(STUDIO_PROJECT_TOOLS);
|
|
4
|
+
export const SCOPED_STUDIO_TOOLS=new Set(['session_attach',...STUDIO_PROJECT_TOOLS,'scene_observe','scene_verify']);
|
|
5
|
+
export function projectToolMutates(name,args={}){
|
|
6
|
+
switch(name){
|
|
7
|
+
case 'studio_project':return ['create','create_world','run','open','close'].includes(args.operation);
|
|
8
|
+
case 'studio_files':return ['write','patch','file','resource','apply_batch','undo_batch'].includes(args.operation);
|
|
9
|
+
case 'scene_timeline':return (args.command??'status')!=='status';
|
|
10
|
+
default:return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/** Normalize the public protocol into the existing Studio Bridge project operations. */
|
|
14
|
+
export function projectBridgeArgs(name,input){
|
|
15
|
+
if(name==='scene_timeline')return {...input,operation:'timeline'};
|
|
16
|
+
if(name==='studio_project'&&input.operation==='create')return {...input,operation:'write',create:true};
|
|
17
|
+
return input;
|
|
18
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/** Task admission evidence, not a new source of world state. No renderer or transport dependency. */
|
|
2
|
+
const dimensions=Object.freeze(['structure','behavior','visual']);
|
|
3
|
+
const boundedCode=value=>typeof value==='string'&&/^[A-Z_]{3,80}$/.test(value)?value:undefined;
|
|
4
|
+
const same=(a,b)=>Array.isArray(a)&&Array.isArray(b)?a.length===b.length&&a.every((v,i)=>Object.is(v,b[i])):Object.is(a,b);
|
|
5
|
+
const dimensionOf=kind=>['state-equals','interaction-verified'].includes(kind)?'behavior':'structure';
|
|
6
|
+
|
|
7
|
+
/** Envelope-level check only; final admission additionally validates exact criteria. */
|
|
8
|
+
export function acceptedSceneChecks(result){
|
|
9
|
+
const evidence=result?.verification?.evidence;
|
|
10
|
+
return result?.schema==='agentscape.scene-result'&&result.operation==='verify'&&result.status==='succeeded'&&
|
|
11
|
+
result.verification?.status==='verified'&&evidence?.status==='world-accepted'&&Array.isArray(evidence.checks)&&
|
|
12
|
+
evidence.checks.length&&evidence.checks.every(check=>check?.verified===true)?evidence.checks:[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function worldBinding(world={}){
|
|
16
|
+
return Object.fromEntries(['worldSessionId','projectId','projectRevision','runtimeId','sceneRevision'].map(key=>[key,world[key]??null]));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function matchesWorldBinding(observation,world){
|
|
20
|
+
if(!world)return true;
|
|
21
|
+
if(!observation)return false;
|
|
22
|
+
const actual={...observation,projectRevision:observation.projectRevision??observation.revision};
|
|
23
|
+
return Object.entries(worldBinding(world)).every(([key,value])=>value==null||actual[key]===value);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Frame/tick identify a sampled runtime state independently of editable revisions. */
|
|
27
|
+
export function observationFrame(value){
|
|
28
|
+
const frame=value?.frame??value?.playback?.frames,tick=value?.tick??value?.playback?.simulation?.tick;
|
|
29
|
+
return Number.isSafeInteger(frame)&&frame>=0&&Number.isSafeInteger(tick)&&tick>=0?{frame,tick}:null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function matchesObservationFrame(value,expected){
|
|
33
|
+
if(!expected)return true;
|
|
34
|
+
const observed=observationFrame(value);
|
|
35
|
+
return Boolean(observed&&observed.frame===expected.frame&&observed.tick===expected.tick);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function criterionRecord(criterion){
|
|
39
|
+
return {id:criterion.id,kind:criterion.kind,dimension:dimensionOf(criterion.kind),
|
|
40
|
+
type:criterion.kind==='interaction-verified'?'action-receipt':criterion.kind==='state-equals'?'state-snapshot':'world-postcondition',
|
|
41
|
+
criterion:structuredClone(criterion)};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function pendingSceneRecords(criteria){
|
|
45
|
+
return criteria.map(criterion=>({...criterionRecord(criterion),status:'unverified',reason:'CHECK_NOT_OBSERVED'}));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function matchesCriterion(check,criterion){
|
|
49
|
+
if(!check||check.id!==criterion.id||check.kind!==criterion.kind||typeof check.verified!=='boolean')return false;
|
|
50
|
+
switch(criterion.kind){
|
|
51
|
+
case 'world-valid':return true;
|
|
52
|
+
case 'object-exists':return check.targetId===criterion.targetId;
|
|
53
|
+
case 'state-equals':
|
|
54
|
+
return check.targetId===criterion.targetId&&check.stateKey===criterion.stateKey&&same(check.expected,criterion.value)&&
|
|
55
|
+
(!criterion.source||check.source===criterion.source)&&(!check.verified||same(check.actual,criterion.value));
|
|
56
|
+
case 'interaction-verified':{
|
|
57
|
+
if(check.targetId!==criterion.targetId||check.expected!==criterion.capability||
|
|
58
|
+
(criterion.source&&check.source!==criterion.source)||(criterion.partName&&check.partName!==criterion.partName))return false;
|
|
59
|
+
if(!check.verified)return true;
|
|
60
|
+
const receipt=check.evidence;
|
|
61
|
+
const source=criterion.source==='asset'?'physical-articulation':criterion.source==='project'?'project-defined':criterion.source;
|
|
62
|
+
return receipt?.schema==='agentscape.interaction-evidence'&&receipt.schemaVersion===1&&receipt.verified===true&&
|
|
63
|
+
receipt.targetId===criterion.targetId&&receipt.capability===criterion.capability&&
|
|
64
|
+
typeof receipt.worldRevisionId==='string'&&receipt.worldRevisionId.length>0&&typeof receipt.source==='string'&&receipt.source.length>0&&
|
|
65
|
+
(!source||receipt.source===source)&&(!criterion.partName||receipt.partName===criterion.partName);
|
|
66
|
+
}
|
|
67
|
+
case 'relation-exists':
|
|
68
|
+
return check.subject===criterion.subject&&check.predicate===criterion.predicate&&
|
|
69
|
+
same(check.object,criterion.object)&&same(check.objectAnyOf,criterion.objectAnyOf)&&same(check.surfaceId,criterion.surfaceId);
|
|
70
|
+
default:return false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Validate independent live verifier coverage. A successful envelope cannot omit or substitute required checks. */
|
|
75
|
+
export function collectSceneChecks(result,criteria,{allowScopedExtras=false}={}){
|
|
76
|
+
const evidence=result?.verification?.evidence;
|
|
77
|
+
const validEnvelope=result?.schema==='agentscape.scene-result'&&result.operation==='verify'&&
|
|
78
|
+
result.status==='succeeded'&&Array.isArray(evidence?.checks)&&evidence.checks.length>0;
|
|
79
|
+
const returned=validEnvelope?evidence.checks:[];
|
|
80
|
+
const byId=new Map(),duplicate=new Set();
|
|
81
|
+
for(const check of returned){
|
|
82
|
+
if(typeof check?.id!=='string')continue;
|
|
83
|
+
if(byId.has(check.id))duplicate.add(check.id);
|
|
84
|
+
byId.set(check.id,check);
|
|
85
|
+
}
|
|
86
|
+
const ids=new Set(criteria.map(item=>item.id));
|
|
87
|
+
const extras=returned.filter(check=>!ids.has(check?.id));
|
|
88
|
+
const extrasValid=extras.every(check=>allowScopedExtras&&typeof check?.id==='string'&&check.id.startsWith('task-entity-')&&
|
|
89
|
+
check.kind==='object-exists'&&typeof check.targetId==='string'&&check.targetId.length>0&&typeof check.verified==='boolean');
|
|
90
|
+
const expected=extrasValid?[...criteria,...extras.map(({id,kind,targetId})=>({id,kind,targetId}))]:criteria;
|
|
91
|
+
const records=expected.map(criterion=>{
|
|
92
|
+
const check=byId.get(criterion.id);
|
|
93
|
+
const valid=!duplicate.has(criterion.id)&&matchesCriterion(check,criterion);
|
|
94
|
+
return {...criterionRecord(criterion),
|
|
95
|
+
status:!valid?'unverified':check.verified?'verified':(check.truth==='unknown'||check.kind==='interaction-verified')?'unverified':'failed',
|
|
96
|
+
...(!valid?{reason:'CHECK_RESPONSE_MISMATCH'}:!check.verified?{reason:boundedCode(check.reason)||'CHECK_UNVERIFIED'}:{}),
|
|
97
|
+
...(valid&&typeof check.source==='string'?{source:check.source}:{}),
|
|
98
|
+
...(valid&&typeof check.evidenceKind==='string'?{evidenceKind:check.evidenceKind}:{}),
|
|
99
|
+
...(valid&&check.kind==='state-equals'&&(check.actual===null||['string','number','boolean'].includes(typeof check.actual))?{actual:check.actual}:{}),
|
|
100
|
+
...(valid&&check.kind==='interaction-verified'&&check.verified?{receipt:{
|
|
101
|
+
source:check.evidence.source,worldRevisionId:check.evidence.worldRevisionId,
|
|
102
|
+
...(check.evidence.partName?{partName:check.evidence.partName}:{}),
|
|
103
|
+
...(check.evidence.commandId?{commandId:check.evidence.commandId}:{})
|
|
104
|
+
}}:{})};
|
|
105
|
+
});
|
|
106
|
+
const accepted=validEnvelope&&duplicate.size===0&&extrasValid&&criteria.length>0&&
|
|
107
|
+
acceptedSceneChecks(result).length>0&&records.every(item=>item.status==='verified');
|
|
108
|
+
return {accepted,records,checks:validEnvelope?returned:[]};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Native inspection is a bounded observation, never a geometric/visual verdict. */
|
|
112
|
+
export function nativeObservation(value,world){
|
|
113
|
+
if(value?.status!=='inspected'||!matchesWorldBinding(value,world)||
|
|
114
|
+
value.node?.nodePath!==''||!Number.isSafeInteger(value.counts?.nodes)||value.counts.nodes<1||
|
|
115
|
+
typeof value.boundsComplete!=='boolean')return {status:'unavailable',reason:'NATIVE_EVIDENCE_INVALID'};
|
|
116
|
+
const counts=Object.fromEntries(Object.entries(value.counts).filter(([,n])=>Number.isSafeInteger(n)&&n>=0));
|
|
117
|
+
return {status:'observed',source:'scene_query',binding:worldBinding(world),counts,
|
|
118
|
+
boundsComplete:value.boundsComplete,
|
|
119
|
+
...(value.bounds&&['min','max','size'].every(key=>Array.isArray(value.bounds[key])&&value.bounds[key].length===3&&value.bounds[key].every(Number.isFinite))?
|
|
120
|
+
{bounds:{min:value.bounds.min,max:value.bounds.max,size:value.bounds.size}}:{}),
|
|
121
|
+
limitations:Array.isArray(value.limitations)?value.limitations.filter(x=>typeof x==='string').slice(0,20):[],
|
|
122
|
+
...(Number.isSafeInteger(value.playback?.frames)?{frame:value.playback.frames}:{}),
|
|
123
|
+
...(Number.isSafeInteger(value.playback?.simulation?.tick)?{tick:value.playback.simulation.tick}:{})};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function category(records,bound){
|
|
127
|
+
if(!records.length)return {required:false,status:'not-required',checks:[]};
|
|
128
|
+
const status=!bound?'unverified':records.every(x=>x.status==='verified')?'verified':
|
|
129
|
+
records.some(x=>x.status==='failed')?'failed':'unverified';
|
|
130
|
+
return {required:true,status,checks:records.map(record=>({...record,...(!bound&&record.status!=='unverified'?{status:'unverified',reason:'WORLD_BINDING_UNCONFIRMED'}:{})}))};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function buildTaskEvidence({world,scope,records=[],bound=false,native=null,visualRequired=false,worldReady=false,reason=null,persistenceRequired=false,savedCheckpoint=null,taskSpecStatus,readOnly=false,snapshot=null}={}){
|
|
134
|
+
const binding=worldBinding(world);
|
|
135
|
+
const structure=category(records.filter(item=>item.dimension==='structure'),bound);
|
|
136
|
+
if(native)structure.native=bound?native:{status:'unavailable',reason:'WORLD_BINDING_UNCONFIRMED'};
|
|
137
|
+
const behavior=category(records.filter(item=>item.dimension==='behavior'),bound);
|
|
138
|
+
const visual={required:visualRequired,status:visualRequired?'pending':'not-required',reviews:[]};
|
|
139
|
+
return {schema:'agentscape.task-evidence',schemaVersion:1,binding,scope,
|
|
140
|
+
...(bound&&snapshot?{snapshot:{...snapshot,scope:'sampled-runtime-state'}}:{}),
|
|
141
|
+
coverage:readOnly?'read-only':scope==='task-criteria'?(taskSpecStatus==='ready'?'user-derived-checks':'unresolved-user-requirements'):'agent-selected-postconditions',
|
|
142
|
+
worldStatus:readOnly?'not-required':worldReady?'verified':bound?'unverified':'unconfirmed',
|
|
143
|
+
reason:boundedCode(reason)??null,
|
|
144
|
+
dimensions:{structure,behavior,visual},
|
|
145
|
+
persistence:{required:persistenceRequired,status:!persistenceRequired?'not-required':
|
|
146
|
+
bound&&savedCheckpoint&&matchesWorldBinding(savedCheckpoint,bindingWithoutSession(binding))?'verified':'unverified',
|
|
147
|
+
...(bound&&savedCheckpoint&&matchesWorldBinding(savedCheckpoint,bindingWithoutSession(binding))?{digest:savedCheckpoint.digest}:{})},
|
|
148
|
+
limitations:['World validity and postconditions are not proof of all user intent.',
|
|
149
|
+
'State and spatial checks are observations, not proof of executed motion.',
|
|
150
|
+
'Code-world snapshot checks and image describe one sampled host frame, not continuous validity. Animation may advance afterwards; external timers and custom render side effects are not tracked.',
|
|
151
|
+
'Persistence verifies the saved edit revision, not identical animated state at the later evidence frame.',
|
|
152
|
+
'Native root counts may include Studio helpers and are not proof of a specific requested shape.']};
|
|
153
|
+
}
|
|
154
|
+
function bindingWithoutSession(binding){return {...binding,worldSessionId:null};}
|
|
155
|
+
|
|
156
|
+
/** Attach visual judgments only to the exact world that was independently accepted. */
|
|
157
|
+
export function withVisualTaskEvidence(result,visual,{invalidateWorld=false}={}){
|
|
158
|
+
if(!result.evidence)return {...result,taskStatus:'incomplete',verified:false,visual:{status:'unavailable',reason:'WORLD_EVIDENCE_MISSING',reviews:[]}};
|
|
159
|
+
const current=result.evidence;
|
|
160
|
+
const fullyBound=['worldSessionId','projectId','runtimeId'].every(key=>typeof current.binding[key]==='string'&¤t.binding[key].length>0)&&
|
|
161
|
+
['projectRevision','sceneRevision'].every(key=>Number.isSafeInteger(current.binding[key]));
|
|
162
|
+
const history=visual.reviews||[];
|
|
163
|
+
const reviews=history.map((review,index)=>({
|
|
164
|
+
status:review.status,score:review.score,issues:review.issues,
|
|
165
|
+
binding:worldBinding({...review,projectRevision:review.revision}),
|
|
166
|
+
...(review.imageDigest?{imageDigest:review.imageDigest}:{}),
|
|
167
|
+
...(Number.isSafeInteger(review.frame)?{frame:review.frame}:{}),
|
|
168
|
+
...(Number.isSafeInteger(review.tick)?{tick:review.tick}:{}),
|
|
169
|
+
current:index===history.length-1&&!invalidateWorld&&fullyBound&¤t.worldStatus==='verified'&&matchesWorldBinding(review,current.binding)&&matchesObservationFrame(review,current.snapshot)&&
|
|
170
|
+
(!current.snapshot?.imageDigest||review.imageDigest===current.snapshot.imageDigest)
|
|
171
|
+
}));
|
|
172
|
+
const last=reviews.at(-1);
|
|
173
|
+
const passed=visual.status==='passed'&&last?.current===true&&last.status==='passed'&&
|
|
174
|
+
Number.isFinite(last.score)&&last.score>=7&&last.score<=10&&/^[a-f0-9]{64}$/.test(last.imageDigest||'');
|
|
175
|
+
const status=passed?'assessed-pass':visual.status==='needs-revision'?'assessed-fail':
|
|
176
|
+
visual.status==='passed'?'unavailable':visual.status;
|
|
177
|
+
const categories={...current.dimensions,visual:{required:true,status,source:'model-review-of-real-frame',reviews,
|
|
178
|
+
...(visual.reason?{reason:visual.reason}:{}),...(visual.status==='passed'&&!passed?{reason:'VISUAL_EVIDENCE_MISMATCH'}:{})}};
|
|
179
|
+
if(invalidateWorld){
|
|
180
|
+
for(const name of dimensions.filter(name=>name!=='visual')){
|
|
181
|
+
const dimension=categories[name];
|
|
182
|
+
categories[name]={...dimension,status:dimension.required?'unverified':'not-required',
|
|
183
|
+
checks:dimension.checks.map(check=>({...check,status:'unverified',reason:'WORLD_MAY_HAVE_CHANGED'})),
|
|
184
|
+
...(dimension.native?{native:{status:'unavailable',reason:'WORLD_MAY_HAVE_CHANGED'}}:{})};
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
const complete=passed&&!invalidateWorld&¤t.worldStatus==='verified'&&
|
|
188
|
+
Object.values(categories).every(item=>!item.required||['verified','assessed-pass'].includes(item.status))&&
|
|
189
|
+
(!current.persistence.required||current.persistence.status==='verified');
|
|
190
|
+
const reason=visual.reason||'VISUAL_EVIDENCE_MISMATCH';
|
|
191
|
+
return {...result,taskStatus:complete?'completed':'incomplete',verified:complete,
|
|
192
|
+
...(visual.status==='passed'&&!complete?{visual:{...visual,status:'unavailable',reason}}:{}),
|
|
193
|
+
...(complete?{unresolvedMutations:[]}:{unresolvedMutations:[...(result.unresolvedMutations||[]).filter(item=>item.reason!=='VISUAL_REVIEW_PENDING'),{reason:visual.reason||'VISUAL_EVIDENCE_MISMATCH'}]}),
|
|
194
|
+
...(invalidateWorld?{verification:{...result.verification,status:'unverified',reason:'WORLD_MAY_HAVE_CHANGED'}}:
|
|
195
|
+
current.worldStatus==='verified'?{verification:{...result.verification,reason:null}}:{}),
|
|
196
|
+
evidence:{...current,worldStatus:invalidateWorld?'unconfirmed':current.worldStatus,
|
|
197
|
+
reason:complete?null:visual.reason||'VISUAL_EVIDENCE_MISMATCH',dimensions:categories,
|
|
198
|
+
...(invalidateWorld?{persistence:{required:current.persistence.required,status:current.persistence.required?'unverified':'not-required'}}:{})}};
|
|
199
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
const round = (value, digits = 3) => Number.isFinite(value) ? Number(value.toFixed(digits)) : value;
|
|
2
|
+
const roundVec = (value) => Array.isArray(value) ? value.map((item) => round(item)) : value;
|
|
3
|
+
|
|
4
|
+
const relevantIds = (actor, lastMutation, unresolved = []) => {
|
|
5
|
+
const ids = new Set(actor ? [actor] : []);
|
|
6
|
+
const addArgs = (args = {}) => {
|
|
7
|
+
for (const key of ['actorId','id','targetId','supportId','instanceId']) if (typeof args[key] === 'string') ids.add(args[key]);
|
|
8
|
+
for(const key of ['actor','target'])if(typeof args.interaction?.[key]==='string')ids.add(args.interaction[key]);
|
|
9
|
+
};
|
|
10
|
+
addArgs(lastMutation?.args);
|
|
11
|
+
for (const entry of unresolved) addArgs(entry?.args);
|
|
12
|
+
return [...ids];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const recoveryHints = (focusMutation, sceneNavigation = false) => {
|
|
16
|
+
const outcome = focusMutation?.outcome;
|
|
17
|
+
if (!outcome || ['verified','accepted'].includes(outcome.state)) return [];
|
|
18
|
+
const reason = outcome.reason || outcome.status || outcome.state;
|
|
19
|
+
const hint = (tool, purpose) => ({ tool,purpose,status:'provisional',basedOn:reason });
|
|
20
|
+
if (['STALL','LIMIT_VIOLATION','TIMEOUT','JOINT_STATE_UNAVAILABLE'].includes(reason)) {
|
|
21
|
+
return [{ action:'report-incomplete-or-retry-after-world-change', purpose:'Live articulation evidence is already embedded in this task observation; do not repeat articulation reads unless the world changes.', status:'provisional', basedOn:reason }];
|
|
22
|
+
}
|
|
23
|
+
if (['CARRIED_OBJECT_BLOCKED','APPROACH_FAILED','NO_INTERACTION_POSE'].includes(reason)) {
|
|
24
|
+
return [{ action:'replan-from-current-pose', purpose:'Current locomotion and carry state are already embedded; choose a different verified route/action or report blocked.', status:'provisional', basedOn:reason }];
|
|
25
|
+
}
|
|
26
|
+
if (['PLACE_TRANSFER_BLOCKED','CARRY_REORIENT_BLOCKED','RELEASE_OUT_OF_RANGE','NO_FREE_SURFACE_SPACE_AFTER_APPROACH'].includes(reason)) {
|
|
27
|
+
return [hint('findFreeSpace','Re-evaluate support-surface free space; any subsequent place attempt must still pass embodied reach and collision checks.')];
|
|
28
|
+
}
|
|
29
|
+
if (['SUPPORT_NOT_REACHED','SETTLE_TIMEOUT'].includes(reason)) {
|
|
30
|
+
return [{ action:'report-unverified-or-retry-place', purpose:'Relevant support relations are already embedded when available; do not claim success without a new verified place outcome.', status:'provisional', basedOn:reason }];
|
|
31
|
+
}
|
|
32
|
+
if (String(reason).includes('PATH') || String(reason).includes('NAVIGATION')) {
|
|
33
|
+
return [...(sceneNavigation?[hint('diagnoseSceneNavigation','Use the current actor and observed destination to check registered joint alternatives without moving anything.')]:[]),hint('suggestNavigationActions','Request provisional action-aware navigation diagnosis, then re-query the real path after any world change.')];
|
|
34
|
+
}
|
|
35
|
+
return [{ purpose:'Re-observe the failed semantic step before any dependent mutation.', status:'provisional', basedOn:reason }];
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export function buildTaskObservation(runtime, {
|
|
39
|
+
actor = 'agent_01',
|
|
40
|
+
lastMutation = null,
|
|
41
|
+
unresolvedMutations = [],
|
|
42
|
+
maxRelations = 8
|
|
43
|
+
} = {}) {
|
|
44
|
+
const view = runtime.observation;
|
|
45
|
+
if (!view?.object || !view?.relations || !view?.actor || !view?.articulation) {
|
|
46
|
+
throw new TypeError('buildTaskObservation requires WorldRuntime.observation');
|
|
47
|
+
}
|
|
48
|
+
const ids = relevantIds(actor,lastMutation,unresolvedMutations);
|
|
49
|
+
const objects = ids.map((id)=>view.object(id)).filter(Boolean).map((item)=>({
|
|
50
|
+
id:item.id,asset:item.asset,type:item.type,...(item.position ? {position:roundVec(item.position)} : {})
|
|
51
|
+
}));
|
|
52
|
+
|
|
53
|
+
const focusMutation=(lastMutation && !['verified','accepted'].includes(lastMutation.outcome?.state)) ? lastMutation : unresolvedMutations.at(-1);
|
|
54
|
+
const observation = {
|
|
55
|
+
schema:'agentscape.task-observation.v1',
|
|
56
|
+
actor:{ id:actor },
|
|
57
|
+
lastMutation:lastMutation ? structuredClone(lastMutation) : null,
|
|
58
|
+
unresolvedMutations:unresolvedMutations.map((entry)=>structuredClone(entry)),
|
|
59
|
+
objects,
|
|
60
|
+
relations:view.relations(ids,{limit:maxRelations}).map((edge)=>({
|
|
61
|
+
subject:edge.subject,predicate:edge.predicate,object:edge.object,
|
|
62
|
+
...(edge.meta?.distance != null ? {distance:round(edge.meta.distance)} : {}),
|
|
63
|
+
...(edge.meta?.surfaceId ? {surfaceId:edge.meta.surfaceId} : {})
|
|
64
|
+
})),
|
|
65
|
+
recoveryHints:recoveryHints(focusMutation,Boolean(runtime.skills?.get?.('diagnoseSceneNavigation')))
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const actorState=view.actor(actor);
|
|
69
|
+
if (actorState?.position) observation.actor.position=roundVec(actorState.position);
|
|
70
|
+
if (actorState?.navigation) observation.actor.navigation=actorState.navigation;
|
|
71
|
+
if (actorState?.carry) observation.actor.carry=actorState.carry;
|
|
72
|
+
|
|
73
|
+
const articulation = [];
|
|
74
|
+
const affordances=view.affordances?.(ids,{actorId:actor}) || null;
|
|
75
|
+
if(affordances) observation.worldAffordances={count:affordances.count,discoverWith:'listWorldAffordances',lastResult:affordances.lastResult,focus:affordances.focus};
|
|
76
|
+
for (const id of ids) {
|
|
77
|
+
const status=view.articulation(id);
|
|
78
|
+
if (!status) continue;
|
|
79
|
+
articulation.push({
|
|
80
|
+
id:status.id,
|
|
81
|
+
parts:(status.parts || []).map((part)=>({
|
|
82
|
+
partName:part.partName,status:part.status,
|
|
83
|
+
requestedAction:part.requestedAction ?? null,verifiedAction:part.verifiedAction ?? null,
|
|
84
|
+
...(part.live ? { live:{
|
|
85
|
+
coordinate:round(part.live.coordinate),target:round(part.live.target),error:round(part.live.error),tolerance:round(part.live.tolerance),coordinateReference:part.live.coordinateReference
|
|
86
|
+
} } : {}),
|
|
87
|
+
...(part.last ? { last:{
|
|
88
|
+
status:part.last.status,reason:part.last.reason || null,targetReached:part.last.targetReached ?? null,settled:part.last.settled ?? null,
|
|
89
|
+
...(part.last.attribution ? { attribution:{
|
|
90
|
+
status:part.last.attribution.status,
|
|
91
|
+
evidence:part.last.attribution.evidence,
|
|
92
|
+
blockerCandidates:(part.last.attribution.blockerCandidates || []).map((item)=>structuredClone(item)),
|
|
93
|
+
contactEvidence:(part.last.attribution.contactEvidence || []).slice(0,4).map((item)=>({
|
|
94
|
+
source:structuredClone(item.source),target:structuredClone(item.target),
|
|
95
|
+
contactCount:item.contactCount,activeContactCount:item.activeContactCount,minDistance:round(item.minDistance),totalImpulse:round(item.totalImpulse),
|
|
96
|
+
evidenceKind:item.evidenceKind || 'contact',impulseAvailable:item.impulseAvailable===true,normal:roundVec(item.normal)
|
|
97
|
+
}))
|
|
98
|
+
} } : {})
|
|
99
|
+
} } : {})
|
|
100
|
+
}))
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
if (articulation.length) observation.articulation=articulation;
|
|
104
|
+
const focusTargetId=focusMutation?.args?.targetId || focusMutation?.args?.id || null;
|
|
105
|
+
const focusPartName=focusMutation?.args?.partName || null;
|
|
106
|
+
const focusReason=focusMutation?.outcome?.reason || focusMutation?.outcome?.status || null;
|
|
107
|
+
const attributedFailure=focusReason==='STALL' ? articulation.flatMap((entry)=>entry.parts.map((part)=>({id:entry.id,part})))
|
|
108
|
+
.find(({id,part})=>id===focusTargetId && (!focusPartName || part.partName===focusPartName) && part.last?.reason==='STALL' && part.last?.attribution?.status==='contact-evidence' && part.last.attribution.blockerCandidates?.length) : null;
|
|
109
|
+
if (attributedFailure) observation.recoveryHints=[{
|
|
110
|
+
tool:'suggestRecoveryActions',
|
|
111
|
+
args:{actorId:actor,targetId:attributedFailure.id,partName:attributedFailure.part.partName},
|
|
112
|
+
purpose:'Evaluate current contact blocker candidates against embodied capability and Policy before any recovery mutation.',
|
|
113
|
+
status:'provisional',basedOn:'current-contact-at-failure'
|
|
114
|
+
}];
|
|
115
|
+
|
|
116
|
+
return observation;
|
|
117
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { captureAuthoringState, exportAuthoringDocument, hydrateAuthoringState, parseAuthoringDocument } from '../world-authoring/AuthoringDocument.js';
|
|
3
|
+
import { validateRemoteAuthoringDocument } from './RemoteAuthoringDocument.js';
|
|
4
|
+
const defaultBeforeRender=THREE.Object3D.prototype.onBeforeRender;
|
|
5
|
+
const defaultAfterRender=THREE.Object3D.prototype.onAfterRender;
|
|
6
|
+
const defaultCompile=THREE.Material.prototype.onBeforeCompile;
|
|
7
|
+
|
|
8
|
+
export function execute(code, document) {
|
|
9
|
+
const scene=hydrateAuthoringState(parseAuthoringDocument(validateRemoteAuthoringDocument(document)));
|
|
10
|
+
const clear=()=>{ for(const child of [...scene.children]) scene.remove(child); };
|
|
11
|
+
const unsupported=()=>{ throw new Error('AUTHORING_RUNTIME_CALLBACK_UNSUPPORTED'); };
|
|
12
|
+
// This Function belongs to the WASM QuickJS VM, never to the Node host.
|
|
13
|
+
const result=new Function('THREE','scene','clear','onFrame','modelRef',`"use strict";\n${code}`)(THREE,scene,clear,unsupported,unsupported);
|
|
14
|
+
if (result && typeof result.then==='function') throw new Error('AUTHORING_ASYNC_UNSUPPORTED');
|
|
15
|
+
return serialize(scene);
|
|
16
|
+
}
|
|
17
|
+
function serialize(scene) {
|
|
18
|
+
const buffers=new Map();
|
|
19
|
+
scene.traverse(node=>{
|
|
20
|
+
if (node!==scene && !['Mesh','Group','Object3D'].includes(node.type)) throw new Error('AUTHORING_NODE_UNSUPPORTED');
|
|
21
|
+
if (node.animations?.length || node.onBeforeRender!==defaultBeforeRender || node.onAfterRender!==defaultAfterRender) throw new Error('AUTHORING_RUNTIME_CALLBACK_UNSUPPORTED');
|
|
22
|
+
if (node.isMesh) {
|
|
23
|
+
if (Array.isArray(node.material) || !['MeshBasicMaterial','MeshStandardMaterial','MeshPhysicalMaterial'].includes(node.material.type) || node.material.onBeforeCompile!==defaultCompile) throw new Error('AUTHORING_MATERIAL_UNSUPPORTED');
|
|
24
|
+
// Use an actual base geometry: subclasses such as TubeGeometry and
|
|
25
|
+
// ExtrudeGeometry override toJSON and require their original parameters.
|
|
26
|
+
// Keep shared geometries shared; only materialized buffers cross the boundary.
|
|
27
|
+
const geometry=node.geometry;
|
|
28
|
+
if (!buffers.has(geometry)) buffers.set(geometry,new THREE.BufferGeometry().copy(geometry));
|
|
29
|
+
node.geometry=buffers.get(geometry);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const output=exportAuthoringDocument(captureAuthoringState(scene));
|
|
33
|
+
validateRemoteAuthoringDocument(output);
|
|
34
|
+
return output;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function build(source) {
|
|
38
|
+
if (!/^\s*export\s+function\s+createAsset\s*\(/m.test(source)) throw new Error('PROCEDURAL_ENTRY_REQUIRED');
|
|
39
|
+
const code=source.replace(/\bexport\s+function\s+createAsset\s*\(/,'function createAsset(');
|
|
40
|
+
const root=new Function('THREE',`"use strict";\n${code}\nreturn createAsset(THREE);`)(THREE);
|
|
41
|
+
return serializeAsset(root);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function serializeAsset(root) {
|
|
45
|
+
if (!root?.isObject3D || root.isScene) throw new Error('PROCEDURAL_ROOT_INVALID');
|
|
46
|
+
if (root.position.length()>1e-8 || root.scale.distanceTo(new THREE.Vector3(1,1,1))>1e-8 || Math.abs(root.quaternion.w)<1-1e-8) throw new Error('PROCEDURAL_ROOT_TRANSFORM_UNSUPPORTED');
|
|
47
|
+
const scene=new THREE.Scene();root.userData.authoringId='asset-root';scene.add(root);
|
|
48
|
+
return serialize(scene);
|
|
49
|
+
}
|
|
50
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { validateRemoteAuthoringDocument } from './RemoteAuthoringDocument.js';
|
|
2
|
+
|
|
3
|
+
/** Trusted browser Worker. No OS isolation; never execute source on the UI thread. */
|
|
4
|
+
export function createBrowserCodeExecutor({ mode='disabled', authorized=false, wallTimeoutMs=30000 } = {}) {
|
|
5
|
+
if (mode === 'disabled') return null;
|
|
6
|
+
if (mode !== 'trusted-local') throw new Error('BROWSER_CODE_MODE_UNSUPPORTED');
|
|
7
|
+
if (authorized !== true) throw new Error('CODE_EXECUTION_AUTHORIZATION_REQUIRED');
|
|
8
|
+
let closed=false;
|
|
9
|
+
const active=new Set();
|
|
10
|
+
const executor={
|
|
11
|
+
async environment() { return {engine:'browser-trusted-worker',builderVersion:'1',threeVersion:'0.186.0'}; },
|
|
12
|
+
async run(request,{signal}={}) {
|
|
13
|
+
if(closed)throw new Error('AUTHORING_EXECUTOR_CLOSED');
|
|
14
|
+
if(signal?.aborted)throw new Error('BUILD_CANCELLED');
|
|
15
|
+
return new Promise((resolve,reject)=>{
|
|
16
|
+
const worker=new Worker(new URL('./BrowserCodeWorker.js',import.meta.url),{type:'module'});
|
|
17
|
+
let done=false;
|
|
18
|
+
const finish=(error,value)=>{if(done)return;done=true;clearTimeout(timer);worker.terminate();active.delete(cancel);signal?.removeEventListener('abort',abort);error?reject(error):resolve(value);};
|
|
19
|
+
const abort=()=>finish(new Error('BUILD_CANCELLED'));
|
|
20
|
+
const cancel=()=>finish(new Error('AUTHORING_EXECUTOR_CLOSED'));
|
|
21
|
+
const timer=setTimeout(()=>finish(new Error('AUTHORING_CODE_TIMEOUT')),wallTimeoutMs);
|
|
22
|
+
active.add(cancel);signal?.addEventListener('abort',abort,{once:true});
|
|
23
|
+
worker.onmessage=async({data})=>{
|
|
24
|
+
try { if(data.error)throw new Error(data.error);finish(null,{document:validateRemoteAuthoringDocument(data.document),environment:await executor.environment(),security:{osIsolation:false,trusted:true}}); }
|
|
25
|
+
catch(error){finish(error);}
|
|
26
|
+
};
|
|
27
|
+
worker.onerror=()=>finish(new Error('AUTHORING_SANDBOX_FAILED'));
|
|
28
|
+
worker.postMessage(request);
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
async execute(request,options){return(await executor.run({...request,mode:'authoring'},options)).document;},
|
|
32
|
+
close(){closed=true;for(const cancel of active)cancel();}
|
|
33
|
+
};
|
|
34
|
+
return executor;
|
|
35
|
+
}
|