agentscape3d 1.0.0-beta.1 → 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -48
- package/dist/core.d.ts +68 -0
- package/dist/core.js +209 -0
- package/dist/core.js.map +1 -0
- package/dist/index.d.ts +10 -229
- package/dist/index.js +192 -15462
- package/dist/index.js.map +1 -1
- package/package.json +11 -40
- package/cli.mjs +0 -27
- package/dist/AssetCompiler-CDFiElji.js +0 -2451
- package/dist/AssetCompiler-CDFiElji.js.map +0 -1
- package/dist/AssetInputContracts-Dy8iU4eT.js +0 -228
- package/dist/AssetInputContracts-Dy8iU4eT.js.map +0 -1
- package/dist/AssetRecipe-DmFpzxr-.js +0 -55
- package/dist/AssetRecipe-DmFpzxr-.js.map +0 -1
- package/dist/BrowserCodeWorker.js +0 -53615
- package/dist/KinematicHypothesisScreen-D-z6qgMB.js +0 -242
- package/dist/KinematicHypothesisScreen-D-z6qgMB.js.map +0 -1
- package/dist/SceneSerializer-DPVOyeRk.js +0 -353
- package/dist/SceneSerializer-DPVOyeRk.js.map +0 -1
- package/dist/StylePack-DNrdLeGI.js +0 -6314
- package/dist/StylePack-DNrdLeGI.js.map +0 -1
- package/dist/WorldArchive-pSBIGxLa.js +0 -420
- package/dist/WorldArchive-pSBIGxLa.js.map +0 -1
- package/dist/WorldIO-wsDfZGM4.js +0 -150
- package/dist/WorldIO-wsDfZGM4.js.map +0 -1
- package/dist/blankWorld-CBWbwJGj.js +0 -76
- package/dist/blankWorld-CBWbwJGj.js.map +0 -1
- package/dist/disposeObject3D-BQ9TyVC_.js +0 -54
- package/dist/disposeObject3D-BQ9TyVC_.js.map +0 -1
- package/dist/environments-DgH66NqV.js +0 -4220
- package/dist/environments-DgH66NqV.js.map +0 -1
- package/dist/gltfIO-B87nJaat.js +0 -10
- package/dist/gltfIO-B87nJaat.js.map +0 -1
- package/dist/grandUrbanBlock-Ob9pN-CB.js +0 -516
- package/dist/grandUrbanBlock-Ob9pN-CB.js.map +0 -1
- package/dist/magicCabin-D64fD1E2.js +0 -11024
- package/dist/magicCabin-D64fD1E2.js.map +0 -1
- package/dist/mcp.d.ts +0 -2
- package/dist/mcp.js +0 -1
- package/dist/monumentHall-BKbs0UOQ.js +0 -404
- package/dist/monumentHall-BKbs0UOQ.js.map +0 -1
- package/dist/node.d.ts +0 -16
- package/dist/node.js +0 -25
- package/dist/ruinedCourtyard-BoZxHldu.js +0 -697
- package/dist/ruinedCourtyard-BoZxHldu.js.map +0 -1
- package/dist/runtime/application/AgentTools.js +0 -25
- package/dist/runtime/application/README.md +0 -14
- package/dist/runtime/application/buildTaskObservation.js +0 -117
- package/dist/runtime/application/code-execution/AuthoringSandboxEntry.js +0 -46
- package/dist/runtime/application/code-execution/BrowserCodeExecutor.js +0 -35
- package/dist/runtime/application/code-execution/BrowserCodeWorker.js +0 -17
- package/dist/runtime/application/code-execution/RemoteAuthoringDocument.js +0 -72
- package/dist/runtime/application/createSession.js +0 -66
- package/dist/runtime/application/createWorldAuthoringContext.js +0 -400
- package/dist/runtime/application/generation/GenerationOrchestrator.js +0 -629
- package/dist/runtime/application/generation/GenerationRuntime.js +0 -214
- package/dist/runtime/application/generation/PromptHybridWorldOrchestrator.js +0 -285
- package/dist/runtime/application/native-scene/CodeProject.js +0 -119
- package/dist/runtime/application/native-scene/CodeProjectModules.js +0 -128
- package/dist/runtime/application/native-scene/NativeEnvironmentGeometry.js +0 -62
- package/dist/runtime/application/native-scene/NativeOverlayCheckpoint.js +0 -127
- package/dist/runtime/application/native-scene/NativeRenderDiscovery.js +0 -51
- package/dist/runtime/application/native-scene/NativeSceneHost.js +0 -164
- package/dist/runtime/application/native-scene/NativeSceneOverlay.js +0 -116
- package/dist/runtime/application/native-scene/NativeThreeModule.js +0 -16
- package/dist/runtime/application/object-forge/SceneObjectForge.js +0 -232
- package/dist/runtime/application/programmatic-assets/ProgrammaticAssetBuilder.js +0 -54
- package/dist/runtime/application/programmatic-assets/ProgrammaticAssetContract.js +0 -22
- package/dist/runtime/application/programmatic-assets/ThreeCodeAsset.js +0 -40
- package/dist/runtime/application/scene/CapabilityResolver.js +0 -79
- package/dist/runtime/application/scene/RequestWindow.js +0 -54
- package/dist/runtime/application/scene/SceneAgentTools.js +0 -21
- package/dist/runtime/application/scene/SceneContracts.js +0 -45
- package/dist/runtime/application/scene/SceneEditService.js +0 -144
- package/dist/runtime/application/scene/SceneFacade.js +0 -267
- package/dist/runtime/application/scene/SceneInteractionAdapters.js +0 -40
- package/dist/runtime/application/scene/SceneJobController.js +0 -229
- package/dist/runtime/application/scene/ScenePackage.js +0 -162
- package/dist/runtime/application/scene/ScenePersistence.js +0 -50
- package/dist/runtime/application/scene/SceneProject.js +0 -95
- package/dist/runtime/application/scene/SceneSkillNames.js +0 -5
- package/dist/runtime/application/scene/StarterScene.js +0 -56
- package/dist/runtime/application/scene/WorldArchive.js +0 -87
- package/dist/runtime/application/scene/WorldDirectory.js +0 -20
- package/dist/runtime/application/scene/WorldDocument.js +0 -74
- package/dist/runtime/application/scene/WorldIO.js +0 -103
- package/dist/runtime/application/scene/WorldStorage.js +0 -137
- package/dist/runtime/application/skills/SkillRegistry.js +0 -163
- package/dist/runtime/application/skills/packs/acceptanceSkills.js +0 -32
- package/dist/runtime/application/skills/packs/affordanceSkills.js +0 -36
- package/dist/runtime/application/skills/packs/assetSkills.js +0 -46
- package/dist/runtime/application/skills/packs/authoringSkills.js +0 -16
- package/dist/runtime/application/skills/packs/batchSkills.js +0 -22
- package/dist/runtime/application/skills/packs/codeSkills.js +0 -106
- package/dist/runtime/application/skills/packs/generationSkills.js +0 -45
- package/dist/runtime/application/skills/packs/interactionSkills.js +0 -46
- package/dist/runtime/application/skills/packs/recoverySkills.js +0 -80
- package/dist/runtime/application/skills/packs/sceneSkills.js +0 -24
- package/dist/runtime/application/skills/packs/spatialSkills.js +0 -35
- package/dist/runtime/application/skills/packs/verificationSkills.js +0 -14
- package/dist/runtime/application/skills/packs/worldSkills.js +0 -45
- package/dist/runtime/application/skills/registerCoreSkills.js +0 -31
- package/dist/runtime/application/skills/skillPrimitives.js +0 -4
- package/dist/runtime/application/tasks/CabinetCupTask.js +0 -76
- package/dist/runtime/application/tasks.jsonl +0 -67
- package/dist/runtime/application/world-authoring/AuthoringAssetProducer.js +0 -42
- package/dist/runtime/application/world-authoring/AuthoringDiff.js +0 -149
- package/dist/runtime/application/world-authoring/AuthoringDocument.js +0 -825
- package/dist/runtime/application/world-authoring/AuthoringExecutionHost.js +0 -109
- package/dist/runtime/application/world-authoring/AuthoringIdentity.js +0 -17
- package/dist/runtime/application/world-authoring/AuthoringModelResolver.js +0 -29
- package/dist/runtime/application/world-authoring/AuthoringPatch.js +0 -118
- package/dist/runtime/application/world-authoring/AuthoringPromotionController.js +0 -334
- package/dist/runtime/application/world-authoring/AuthoringPromotionSource.js +0 -126
- package/dist/runtime/application/world-authoring/AuthoringRevisionHistory.js +0 -144
- package/dist/runtime/application/world-authoring/HeadlessImageExport.js +0 -174
- package/dist/runtime/application/world-authoring/ModelRef.js +0 -62
- package/dist/runtime/apps/mcp-server/AUTHORING.md +0 -71
- package/dist/runtime/apps/mcp-server/AuthoringSandboxEntry.js +0 -1
- package/dist/runtime/apps/mcp-server/AuthoringSandboxWorker.mjs +0 -30
- package/dist/runtime/apps/mcp-server/BuildEnvironment.js +0 -17
- package/dist/runtime/apps/mcp-server/CodeExecutor.js +0 -71
- package/dist/runtime/apps/mcp-server/DEPLOYMENT-PC2.md +0 -42
- package/dist/runtime/apps/mcp-server/DockerBuildRunner.js +0 -66
- package/dist/runtime/apps/mcp-server/FileAssetRepository.js +0 -159
- package/dist/runtime/apps/mcp-server/HeadlessAssetIO.js +0 -8
- package/dist/runtime/apps/mcp-server/HeadlessGLTFLoader.js +0 -47
- package/dist/runtime/apps/mcp-server/HeadlessWorldHost.js +0 -132
- package/dist/runtime/apps/mcp-server/IsolatedAuthoringExecutor.js +0 -6
- package/dist/runtime/apps/mcp-server/PROGRAMMATIC-ASSETS.md +0 -116
- package/dist/runtime/apps/mcp-server/ProgrammaticAssets.js +0 -60
- package/dist/runtime/apps/mcp-server/README.md +0 -150
- package/dist/runtime/apps/mcp-server/RemoteAuthoringDocument.js +0 -1
- package/dist/runtime/apps/mcp-server/SandboxBundle.js +0 -13
- package/dist/runtime/apps/mcp-server/SessionManager.js +0 -80
- package/dist/runtime/apps/mcp-server/StudioBridgeHttp.js +0 -58
- package/dist/runtime/apps/mcp-server/StudioLiveBridge.js +0 -190
- package/dist/runtime/apps/mcp-server/TrustedAuthoringWorker.mjs +0 -16
- package/dist/runtime/apps/mcp-server/VALIDATION.md +0 -45
- package/dist/runtime/apps/mcp-server/acceptance-evidence.json +0 -332
- package/dist/runtime/apps/mcp-server/errorDiagnostics.js +0 -32
- package/dist/runtime/apps/mcp-server/examples/code-house.js +0 -24
- package/dist/runtime/apps/mcp-server/examples/procedural-assets.js +0 -37
- package/dist/runtime/apps/mcp-server/main.mjs +0 -56
- package/dist/runtime/apps/mcp-server/registerTools.js +0 -215
- package/dist/runtime/apps/mcp-server/sandbox/run.mjs +0 -23
- package/dist/runtime/apps/mcp-server/security.js +0 -21
- package/dist/runtime/apps/mcp-server/tasks.jsonl +0 -9
- package/dist/runtime/apps/server/CapabilityAdapterRegistry.js +0 -157
- package/dist/runtime/apps/server/README.md +0 -7
- package/dist/runtime/apps/server/WorldDiskStorage.js +0 -51
- package/dist/runtime/apps/server/openai-compatible-agent-gateway.mjs +0 -278
- package/dist/runtime/apps/server/tasks.jsonl +0 -10
- package/dist/runtime/foundation/EventBus.js +0 -18
- package/dist/runtime/foundation/JsonGateway.js +0 -47
- package/dist/runtime/foundation/PolicyEngine.js +0 -21
- package/dist/runtime/foundation/README.md +0 -7
- package/dist/runtime/foundation/TraceRecorder.js +0 -76
- package/dist/runtime/foundation/errors.js +0 -8
- package/dist/runtime/foundation/simulation/SimulationProfile.js +0 -143
- package/dist/runtime/foundation/version.js +0 -2
- package/dist/runtime/modules/agent/README.md +0 -11
- package/dist/runtime/modules/agent/ToolCallingAgent.js +0 -19
- package/dist/runtime/modules/agent/bootstrapWorld.js +0 -10
- package/dist/runtime/modules/agent/buildRecoveryProposals.js +0 -533
- package/dist/runtime/modules/agent/execution/AgentExecutionRules.js +0 -127
- package/dist/runtime/modules/agent/execution/AgentRunResults.js +0 -55
- package/dist/runtime/modules/agent/execution/AgentRunSession.js +0 -390
- package/dist/runtime/modules/agent/execution/AgentToolInvoker.js +0 -39
- package/dist/runtime/modules/agent/gateway/HttpLLMGateway.js +0 -19
- package/dist/runtime/modules/agent/prompt/index.js +0 -46
- package/dist/runtime/modules/agent/tasks.jsonl +0 -94
- package/dist/runtime/modules/artifact/ArtifactContentGate.js +0 -144
- package/dist/runtime/modules/artifact/ArtifactDescriptor.js +0 -280
- package/dist/runtime/modules/artifact/ArtifactImporter.js +0 -185
- package/dist/runtime/modules/artifact/ArtifactModule.js +0 -111
- package/dist/runtime/modules/artifact/ArtifactRegistry.js +0 -197
- package/dist/runtime/modules/artifact/IncrementalSha256.js +0 -129
- package/dist/runtime/modules/artifact/MemoryArtifactByteStore.js +0 -115
- package/dist/runtime/modules/artifact/README.md +0 -7
- package/dist/runtime/modules/artifact/storage/IndexedDbArtifactStore.js +0 -67
- package/dist/runtime/modules/artifact/tasks.jsonl +0 -31
- package/dist/runtime/modules/asset/AssetModule.js +0 -399
- package/dist/runtime/modules/asset/README.md +0 -54
- package/dist/runtime/modules/asset/loading/AssetLoader.js +0 -157
- package/dist/runtime/modules/asset/loading/GltfAssetLoader.js +0 -61
- package/dist/runtime/modules/asset/loading/builtins/BuiltinAssets.js +0 -95
- package/dist/runtime/modules/asset/loading/builtins/HouseDoor.js +0 -33
- package/dist/runtime/modules/asset/loading/builtins/IndustrialCabinet.js +0 -103
- package/dist/runtime/modules/asset/model/AssetInputContracts.js +0 -95
- package/dist/runtime/modules/asset/model/AssetRef.js +0 -12
- package/dist/runtime/modules/asset/model/MechanicalAssetDraft.js +0 -172
- package/dist/runtime/modules/asset/model/admission.js +0 -117
- package/dist/runtime/modules/asset/model/errors.js +0 -6
- package/dist/runtime/modules/asset/model/parts.js +0 -27
- package/dist/runtime/modules/asset/model/resourceBudget.js +0 -10
- package/dist/runtime/modules/asset/model/schema.js +0 -150
- package/dist/runtime/modules/asset/persistence/AssetManifestStore.js +0 -78
- package/dist/runtime/modules/asset/persistence/CompiledAssetStore.js +0 -84
- package/dist/runtime/modules/asset/persistence/LocalAssetLibrary.js +0 -86
- package/dist/runtime/modules/asset/persistence/LocalAssetLibraryStore.js +0 -81
- package/dist/runtime/modules/asset/production/AssetProductionPipeline.js +0 -272
- package/dist/runtime/modules/asset/production/AssetRecipe.js +0 -32
- package/dist/runtime/modules/asset/production/adapters/EmbodiedGenAdapter.js +0 -45
- package/dist/runtime/modules/asset/production/adapters/EmbodiedGenBundleAdapter.js +0 -590
- package/dist/runtime/modules/asset/production/compiler/AssetCompiler.js +0 -173
- package/dist/runtime/modules/asset/production/compiler/evidence/AnimationMotionEvidence.js +0 -124
- package/dist/runtime/modules/asset/production/compiler/evidence/StaticPanelEvidence.js +0 -56
- package/dist/runtime/modules/asset/production/compiler/gltfIO.js +0 -6
- package/dist/runtime/modules/asset/production/compiler/partGeometry.js +0 -74
- package/dist/runtime/modules/asset/production/compiler/passes/ArticulatedCollisionPass.js +0 -63
- package/dist/runtime/modules/asset/production/compiler/passes/ArticulationCandidatePass.js +0 -48
- package/dist/runtime/modules/asset/production/compiler/passes/AuthoringIntentPass.js +0 -16
- package/dist/runtime/modules/asset/production/compiler/passes/ColliderFallbackPass.js +0 -30
- package/dist/runtime/modules/asset/production/compiler/passes/CompileQualityPass.js +0 -75
- package/dist/runtime/modules/asset/production/compiler/passes/ExplicitDefinitionPass.js +0 -20
- package/dist/runtime/modules/asset/production/compiler/passes/GLTFInspectPass.js +0 -34
- package/dist/runtime/modules/asset/production/compiler/passes/GeometryPass.js +0 -32
- package/dist/runtime/modules/asset/production/compiler/passes/JointFramePass.js +0 -116
- package/dist/runtime/modules/asset/production/compiler/passes/KinematicEvidencePass.js +0 -84
- package/dist/runtime/modules/asset/production/compiler/passes/ManifestPass.js +0 -63
- package/dist/runtime/modules/asset/production/compiler/passes/NormalizeTransformPass.js +0 -16
- package/dist/runtime/modules/asset/production/compiler/passes/OptimizeGLBPass.js +0 -23
- package/dist/runtime/modules/asset/production/compiler/passes/PartColliderPass.js +0 -50
- package/dist/runtime/modules/asset/production/compiler/passes/PartGeometryEnrichmentPass.js +0 -60
- package/dist/runtime/modules/asset/production/compiler/passes/PartProposalPass.js +0 -93
- package/dist/runtime/modules/asset/production/compiler/passes/RemoteEnrichmentPass.js +0 -32
- package/dist/runtime/modules/asset/production/compiler/passes/ResourceBudgetPass.js +0 -55
- package/dist/runtime/modules/asset/production/compiler/passes/SegmentMaterializePass.js +0 -203
- package/dist/runtime/modules/asset/production/compiler/passes/SegmentationEvidencePass.js +0 -43
- package/dist/runtime/modules/asset/production/compiler/passes/SemanticHeuristicPass.js +0 -33
- package/dist/runtime/modules/asset/production/compiler/passes/StructurePass.js +0 -60
- package/dist/runtime/modules/asset/production/compiler/providers/HttpCompilerProvider.js +0 -23
- package/dist/runtime/modules/asset/production/verification/KinematicHypothesisScreen.js +0 -198
- package/dist/runtime/modules/asset/registry/AssetCatalog.js +0 -72
- package/dist/runtime/modules/asset/registry/AssetRegistry.js +0 -51
- package/dist/runtime/modules/asset/registry/manifests/index.js +0 -173
- package/dist/runtime/modules/asset/tasks.jsonl +0 -87
- package/dist/runtime/modules/generation/README.md +0 -9
- package/dist/runtime/modules/generation/connector/ConnectorArtifactClient.js +0 -45
- package/dist/runtime/modules/generation/connector/ConnectorCapabilityAdapter.js +0 -169
- package/dist/runtime/modules/generation/connector/ConnectorClient.js +0 -192
- package/dist/runtime/modules/generation/connector/ConnectorJobClient.js +0 -167
- package/dist/runtime/modules/generation/connector/ConnectorJobEventClient.js +0 -179
- package/dist/runtime/modules/generation/connector/ConnectorSession.js +0 -202
- package/dist/runtime/modules/generation/jobs/GenerationJobProjection.js +0 -239
- package/dist/runtime/modules/generation/jobs/GenerationJobReconciler.js +0 -99
- package/dist/runtime/modules/generation/jobs/GenerationJobStore.js +0 -91
- package/dist/runtime/modules/generation/jobs/GenerationJobTransportOverlay.js +0 -50
- package/dist/runtime/modules/generation/providers/ProviderRegistry.js +0 -304
- package/dist/runtime/modules/generation/tasks.jsonl +0 -35
- package/dist/runtime/modules/navigation/NavigationBackend.js +0 -17
- package/dist/runtime/modules/navigation/RecastNavigationBackend.js +0 -245
- package/dist/runtime/modules/physics/JoltPhysicsBackend.js +0 -850
- package/dist/runtime/modules/physics/PhysicsApiSurface.js +0 -651
- package/dist/runtime/modules/physics/PhysicsBackend.js +0 -88
- package/dist/runtime/modules/physics/RapierPhysicsBackend.js +0 -410
- package/dist/runtime/modules/rendering/README.md +0 -7
- package/dist/runtime/modules/rendering/RendererProbe.js +0 -153
- package/dist/runtime/modules/rendering/WebGpuPostFxPipeline.js +0 -140
- package/dist/runtime/modules/rendering/createRenderer.js +0 -76
- package/dist/runtime/modules/rendering/disposeObject3D.js +0 -34
- package/dist/runtime/modules/rendering/loadGaussianSplatVisual.js +0 -74
- package/dist/runtime/modules/rendering/style/StylePack.js +0 -34
- package/dist/runtime/modules/rendering/style/StyleSystem.js +0 -173
- package/dist/runtime/modules/rendering/tasks.jsonl +0 -7
- package/dist/runtime/modules/world/README.md +0 -13
- package/dist/runtime/modules/world/build/WorldBuilder.js +0 -170
- package/dist/runtime/modules/world/compiler/PipelineEngine.js +0 -32
- package/dist/runtime/modules/world/compiler/WorldAdmission.js +0 -43
- package/dist/runtime/modules/world/compiler/WorldBehaviorCompiler.js +0 -68
- package/dist/runtime/modules/world/compiler/WorldCompilation.js +0 -157
- package/dist/runtime/modules/world/compiler/WorldComposer.js +0 -201
- package/dist/runtime/modules/world/compiler/WorldPhysicsAdmission.js +0 -76
- package/dist/runtime/modules/world/compiler/WorldRecompiler.js +0 -356
- package/dist/runtime/modules/world/compiler/WorldRetry.js +0 -75
- package/dist/runtime/modules/world/compiler/createWorldPipeline.js +0 -379
- package/dist/runtime/modules/world/content/blankWorld.js +0 -35
- package/dist/runtime/modules/world/content/environments.js +0 -84
- package/dist/runtime/modules/world/content/grandUrbanBlock.js +0 -189
- package/dist/runtime/modules/world/content/magic-cabin/README.md +0 -28
- package/dist/runtime/modules/world/content/magic-cabin/affordances.js +0 -64
- package/dist/runtime/modules/world/content/magic-cabin/cabinContents.js +0 -7078
- package/dist/runtime/modules/world/content/magic-cabin/lighting.js +0 -26
- package/dist/runtime/modules/world/content/magic-cabin/materials.js +0 -20
- package/dist/runtime/modules/world/content/magicCabin.js +0 -190
- package/dist/runtime/modules/world/content/monumentHall.js +0 -154
- package/dist/runtime/modules/world/content/ruinedCourtyard.js +0 -196
- package/dist/runtime/modules/world/content/suzhouGarden/README.md +0 -141
- package/dist/runtime/modules/world/content/suzhouGarden/index.js +0 -137
- package/dist/runtime/modules/world/content/suzhouGarden/src/arch.js +0 -491
- package/dist/runtime/modules/world/content/suzhouGarden/src/buildings.js +0 -670
- package/dist/runtime/modules/world/content/suzhouGarden/src/core.js +0 -578
- package/dist/runtime/modules/world/content/suzhouGarden/src/lod.js +0 -127
- package/dist/runtime/modules/world/content/suzhouGarden/src/main.js +0 -642
- package/dist/runtime/modules/world/content/suzhouGarden/src/nature.js +0 -650
- package/dist/runtime/modules/world/content/suzhouGarden/src/rockery.js +0 -280
- package/dist/runtime/modules/world/content/suzhouGarden/src/sky.js +0 -242
- package/dist/runtime/modules/world/content/suzhouGarden/src/water.js +0 -215
- package/dist/runtime/modules/world/content/woodlandWorkshop.js +0 -192
- package/dist/runtime/modules/world/content/yuanmingyuan/README.md +0 -36
- package/dist/runtime/modules/world/content/yuanmingyuan/arch.js +0 -351
- package/dist/runtime/modules/world/content/yuanmingyuan/buildings.js +0 -490
- package/dist/runtime/modules/world/content/yuanmingyuan/core.js +0 -505
- package/dist/runtime/modules/world/content/yuanmingyuan/index.js +0 -101
- package/dist/runtime/modules/world/content/yuanmingyuan/nature.js +0 -435
- package/dist/runtime/modules/world/content/yuanmingyuan/sky.js +0 -169
- package/dist/runtime/modules/world/content/yuanmingyuan/water.js +0 -245
- package/dist/runtime/modules/world/errors.js +0 -9
- package/dist/runtime/modules/world/generated/GeneratedWorldCoordinates.js +0 -50
- package/dist/runtime/modules/world/generated/GeneratedWorldLoader.js +0 -297
- package/dist/runtime/modules/world/runtime/CommandHistory.js +0 -80
- package/dist/runtime/modules/world/runtime/ObjectStore.js +0 -31
- package/dist/runtime/modules/world/runtime/ObjectTransform.js +0 -62
- package/dist/runtime/modules/world/runtime/ObservedEntity.js +0 -37
- package/dist/runtime/modules/world/runtime/ProjectCapabilities.js +0 -207
- package/dist/runtime/modules/world/runtime/SceneSerializer.js +0 -246
- package/dist/runtime/modules/world/runtime/WorldAuthority.js +0 -41
- package/dist/runtime/modules/world/runtime/WorldCollisionSignature.js +0 -14
- package/dist/runtime/modules/world/runtime/WorldCommands.js +0 -502
- package/dist/runtime/modules/world/runtime/WorldObservation.js +0 -71
- package/dist/runtime/modules/world/runtime/WorldQueries.js +0 -340
- package/dist/runtime/modules/world/runtime/WorldRecovery.js +0 -78
- package/dist/runtime/modules/world/runtime/WorldRuntime.js +0 -649
- package/dist/runtime/modules/world/runtime/affordance/ObjectAffordances.js +0 -107
- package/dist/runtime/modules/world/runtime/affordance/WorldAffordances.js +0 -130
- package/dist/runtime/modules/world/runtime/behavior/BehaviorCompiler.js +0 -79
- package/dist/runtime/modules/world/runtime/behavior/ProjectStateMachine.js +0 -195
- package/dist/runtime/modules/world/runtime/behavior/RuleGraph.js +0 -70
- package/dist/runtime/modules/world/runtime/behavior/RuleRuntime.js +0 -115
- package/dist/runtime/modules/world/runtime/graph/SceneGraph.js +0 -216
- package/dist/runtime/modules/world/runtime/interaction/ArticulationRuntime.js +0 -214
- package/dist/runtime/modules/world/runtime/interaction/CarryCapability.js +0 -65
- package/dist/runtime/modules/world/runtime/interaction/CarryRuntime.js +0 -222
- package/dist/runtime/modules/world/runtime/interaction/InteractionApproach.js +0 -130
- package/dist/runtime/modules/world/runtime/interaction/InteractionContract.js +0 -57
- package/dist/runtime/modules/world/runtime/interaction/RecoveryRuntime.js +0 -123
- package/dist/runtime/modules/world/runtime/interaction/SettleRuntime.js +0 -120
- package/dist/runtime/modules/world/runtime/semantic/SemanticWorldView.js +0 -102
- package/dist/runtime/modules/world/runtime/simulation/SimulationClock.js +0 -89
- package/dist/runtime/modules/world/runtime/simulation/SimulationSession.js +0 -99
- package/dist/runtime/modules/world/runtime/simulation/ThermalSystem.js +0 -269
- package/dist/runtime/modules/world/runtime/spatial/SpatialSnapshot.js +0 -56
- package/dist/runtime/modules/world/runtime/spatial/ThreeBvhRuntime.js +0 -36
- package/dist/runtime/modules/world/runtime/systems/InteractionSystem.js +0 -728
- package/dist/runtime/modules/world/runtime/systems/LocomotionSystem.js +0 -269
- package/dist/runtime/modules/world/runtime/systems/NavigationSystem.js +0 -469
- package/dist/runtime/modules/world/runtime/systems/PhysicsSystem.js +0 -1657
- package/dist/runtime/modules/world/runtime/systems/RenderingSystem.js +0 -457
- package/dist/runtime/modules/world/runtime/systems/SpatialSystem.js +0 -284
- package/dist/runtime/modules/world/spec/WorldIR.js +0 -165
- package/dist/runtime/modules/world/spec/WorldIRToolSchema.js +0 -86
- package/dist/runtime/modules/world/spec/WorldPlannerProposal.js +0 -51
- package/dist/runtime/modules/world/spec/WorldRevision.js +0 -231
- package/dist/runtime/modules/world/spec/WorldSpec.js +0 -86
- package/dist/runtime/modules/world/tasks.jsonl +0 -530
- package/dist/runtime/modules/world/verification/ArticulationVerifier.js +0 -254
- package/dist/runtime/modules/world/verification/Finding.js +0 -105
- package/dist/runtime/modules/world/verification/InteractionEvidence.js +0 -69
- package/dist/runtime/modules/world/verification/RepairEngine.js +0 -49
- package/dist/runtime/modules/world/verification/WorldAcceptance.js +0 -158
- package/dist/runtime/modules/world/verification/WorldValidator.js +0 -65
- package/dist/runtime/package-lock.json +0 -6245
- package/dist/runtime/package.json +0 -91
- package/dist/runtime/public/assets/cabinet.glb +0 -0
- package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_nor_gl_1k.jpg +0 -0
- package/dist/runtime/public/assets/grand-urban-block/concrete_pavement_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/grand-urban-block/urban_street_01_1k.hdr +0 -0
- package/dist/runtime/public/assets/monument-hall/marble_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/monument-hall/marble_nor_gl_1k.jpg +0 -0
- package/dist/runtime/public/assets/monument-hall/marble_rough_1k.jpg +0 -0
- package/dist/runtime/public/assets/monument-hall/solitude_interior_1k.hdr +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/courtyard_1k.hdr +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_nor_gl_1k.jpg +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/mossy_sandstone_diff_1k.jpg +0 -0
- package/dist/schema-Dudvovhu.js +0 -364
- package/dist/schema-Dudvovhu.js.map +0 -1
- package/dist/suzhouGarden-BCx_JeV5.js +0 -6159
- package/dist/suzhouGarden-BCx_JeV5.js.map +0 -1
- package/dist/woodlandWorkshop-BGNWPNdK.js +0 -484
- package/dist/woodlandWorkshop-BGNWPNdK.js.map +0 -1
- package/dist/yuanmingyuan-DAIb1msO.js +0 -4962
- package/dist/yuanmingyuan-DAIb1msO.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ruinedCourtyard-BoZxHldu.js","names":[],"sources":["../../../modules/world/content/ruinedCourtyard.js"],"sourcesContent":["import * as THREE from 'three';\r\n\r\nexport const RUINED_COURTYARD_ASSETS = Object.freeze({\r\n hdri: 'assets/ruined-courtyard/courtyard_1k.hdr',\r\n groundDiffuse: 'assets/ruined-courtyard/mossy_cobblestone_diff_1k.jpg',\r\n groundNormal: 'assets/ruined-courtyard/mossy_cobblestone_nor_gl_1k.jpg',\r\n wallDiffuse: 'assets/ruined-courtyard/mossy_sandstone_diff_1k.jpg'\r\n});\r\n\r\nconst box = (halfExtents, translation, rotation = null) => ({ shape:'box', halfExtents, translation, ...(rotation ? { rotation } : {}) });\r\nconst cylinder = (radius, halfHeight, translation, rotation = null) => ({ shape:'cylinder', radius, halfHeight, translation, ...(rotation ? { rotation } : {}) });\r\nconst qx = (a) => [Math.sin(a / 2), 0, 0, Math.cos(a / 2)];\r\nconst qy = (a) => [0, Math.sin(a / 2), 0, Math.cos(a / 2)];\r\nconst qz = (a) => [0, 0, Math.sin(a / 2), Math.cos(a / 2)];\r\nconst rotateXZ = (x, z, a) => [Math.cos(a) * x + Math.sin(a) * z, -Math.sin(a) * x + Math.cos(a) * z];\r\nconst archColliders = (x, z, angle = 0) => {\r\n const rotation = qy(angle);\r\n const at = (lx, y, lz) => {\r\n const [dx, dz] = rotateXZ(lx, lz, angle);\r\n return [x + dx, y, z + dz];\r\n };\r\n return [\r\n box([.55, 2.4, .375], at(-2.45, 2.4, 0), rotation),\r\n box([.55, 2.4, .375], at(2.45, 2.4, 0), rotation),\r\n box([3, .5, .375], at(0, 5, 0), rotation)\r\n ];\r\n};\r\n\r\nconst EAST_STEPS = Array.from({ length:6 }, (_, i) => box([.25, (i + 1) * .1, 2.1], [4.25 + i * .5, (i + 1) * .1, 4.8]));\r\nconst WEST_STEPS = Array.from({ length:4 }, (_, i) => box([.25, (i + 1) * .1, 1.8], [-5.95 - i * .5, (i + 1) * .1, -6.2]));\r\n\r\nexport const RUINED_COURTYARD_COLLIDERS = Object.freeze([\r\n box([18, .15, 15], [0, -.15, 0]),\r\n box([5.2, .6, 5.4], [12.2, .6, 4.8]),\r\n box([4.5, .4, 4.6], [-12.2, .4, -6.2]),\r\n ...EAST_STEPS,\r\n ...WEST_STEPS,\r\n box([5.8, 2.4, .28], [-11.9, 2.4, -14.6]),\r\n box([5.8, 2.4, .28], [11.9, 2.4, -14.6]),\r\n box([2.2, .75, .28], [0, 4.05, -14.6]),\r\n box([.28, 2.7, 5.2], [-17.6, 2.7, -7.8]),\r\n box([.28, 1.9, 3.1], [-17.6, 1.9, 7.8]),\r\n box([.28, 2.2, 4.4], [17.6, 2.2, -8.4]),\r\n box([.28, 1.5, 2.6], [17.6, 1.5, 8.8]),\r\n ...archColliders(0, -14.25),\r\n ...archColliders(-17.25, 1.3, Math.PI / 2),\r\n ...archColliders(17.25, 1.0, -Math.PI / 2),\r\n cylinder(2.0, .42, [0, .42, -1.8]),\r\n cylinder(.42, 3.2, [-6.2, .55, 3.7], qz(Math.PI / 2)),\r\n cylinder(.38, 2.5, [7.2, .5, -8.0], qx(Math.PI / 2)),\r\n box([2.1, .45, .55], [-3.8, .45, 9.6], qz(-.18)),\r\n box([1.7, .35, .5], [4.6, .35, 10.4], qz(.13))\r\n]);\r\n\r\nconst mesh = (geometry, material, { position, rotation, name, castShadow = true, receiveShadow = true, navigationIgnore = false } = {}) => {\r\n const value = new THREE.Mesh(geometry, material);\r\n if (position) value.position.set(...position);\r\n if (rotation) value.rotation.set(...rotation);\r\n value.name = name || '';\r\n value.castShadow = castShadow;\r\n value.receiveShadow = receiveShadow;\r\n if (navigationIgnore) value.userData.navigationIgnore = true;\r\n return value;\r\n};\r\n\r\nconst tile = (texture, repeat, color = false) => {\r\n texture.wrapS = texture.wrapT = THREE.RepeatWrapping;\r\n texture.repeat.set(...repeat);\r\n texture.anisotropy = 4;\r\n if (color) texture.colorSpace = THREE.SRGBColorSpace;\r\n return texture;\r\n};\r\n\r\nconst addArch = (root, material, x, z, rotationY = 0, name = 'Arch') => {\r\n const group = new THREE.Group();\r\n group.name = name;\r\n group.position.set(x, 0, z);\r\n group.rotation.y = rotationY;\r\n group.add(\r\n mesh(new THREE.BoxGeometry(1.1, 4.8, .75), material, { position:[-2.45, 2.4, 0] }),\r\n mesh(new THREE.BoxGeometry(1.1, 4.8, .75), material, { position:[2.45, 2.4, 0] }),\r\n mesh(new THREE.BoxGeometry(6, 1.0, .75), material, { position:[0, 5.0, 0] }),\r\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 })\r\n );\r\n root.add(group);\r\n};\r\n\r\nconst addGrass = (root) => {\r\n const geometry = new THREE.ConeGeometry(.08, .55, 5);\r\n const material = new THREE.MeshStandardMaterial({ color:0x405d31, roughness:.9 });\r\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]];\r\n const instanced = new THREE.InstancedMesh(geometry, material, patches.length * 9);\r\n instanced.name = 'CourtyardGrass';\r\n instanced.userData.navigationIgnore = true;\r\n instanced.castShadow = true;\r\n instanced.receiveShadow = true;\r\n const matrix = new THREE.Matrix4();\r\n let index = 0;\r\n for (const [x, y, z] of patches) {\r\n for (let i = 0; i < 9; i++) {\r\n const px = x + ((i * 37) % 7 - 3) * .16;\r\n const pz = z + ((i * 53) % 7 - 3) * .15;\r\n const scale = .55 + ((i * 29) % 5) * .12;\r\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));\r\n instanced.setMatrixAt(index++, matrix);\r\n }\r\n }\r\n instanced.instanceMatrix.needsUpdate = true;\r\n root.add(instanced);\r\n};\r\n\r\nexport function createRuinedCourtyard({ loadAssets = true } = {}) {\r\n const root = new THREE.Group();\r\n root.name = 'RuinedCourtyard';\r\n root.userData.environment = 'ruined-courtyard';\r\n\r\n const ground = new THREE.MeshStandardMaterial({ color:0x66655a, roughness:.94, metalness:0 });\r\n const sandstone = new THREE.MeshStandardMaterial({ color:0x777568, roughness:.92 });\r\n const darkStone = new THREE.MeshStandardMaterial({ color:0x343932, roughness:.98 });\r\n const water = new THREE.MeshPhysicalMaterial({ color:0x203f43, roughness:.2, transmission:.08, transparent:true, opacity:.72 });\r\n\r\n const floor = mesh(new THREE.BoxGeometry(36, .3, 30), ground, { position:[0, -.15, 0], name:'CourtyardFloor', castShadow:false });\r\n root.add(floor);\r\n root.add(\r\n mesh(new THREE.BoxGeometry(10.4, 1.2, 10.8), darkStone, { position:[12.2, .6, 4.8], name:'EastTerrace' }),\r\n mesh(new THREE.BoxGeometry(9, .8, 9.2), darkStone, { position:[-12.2, .4, -6.2], name:'WestTerrace' })\r\n );\r\n\r\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}` }));\r\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}` }));\r\n\r\n const wall = (size, position, name) => root.add(mesh(new THREE.BoxGeometry(...size), sandstone, { position, name, castShadow:false }));\r\n wall([11.6, 4.8, .56], [-11.9, 2.4, -14.6], 'NorthWallWest');\r\n wall([11.6, 4.8, .56], [11.9, 2.4, -14.6], 'NorthWallEast');\r\n wall([4.4, 1.5, .56], [0, 4.05, -14.6], 'NorthLintel');\r\n wall([.56, 5.4, 10.4], [-17.6, 2.7, -7.8], 'WestWallNorth');\r\n wall([.56, 3.8, 6.2], [-17.6, 1.9, 7.8], 'WestWallSouth');\r\n wall([.56, 4.4, 8.8], [17.6, 2.2, -8.4], 'EastWallNorth');\r\n wall([.56, 3.0, 5.2], [17.6, 1.5, 8.8], 'EastWallSouth');\r\n\r\n addArch(root, sandstone, 0, -14.25, 0, 'NorthGate');\r\n addArch(root, sandstone, -17.25, 1.3, Math.PI / 2, 'WestArcade');\r\n addArch(root, sandstone, 17.25, 1.0, -Math.PI / 2, 'EastArcade');\r\n\r\n root.add(\r\n mesh(new THREE.CylinderGeometry(2, 2.25, .84, 40), darkStone, { position:[0, .42, -1.8], name:'DryFountain' }),\r\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 }),\r\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' }),\r\n mesh(new THREE.CylinderGeometry(.38, .42, 5, 18), sandstone, { position:[7.2, .5, -8], rotation:[Math.PI / 2, 0, 0], name:'FallenColumnEast' }),\r\n mesh(new THREE.BoxGeometry(4.2, .9, 1.1), sandstone, { position:[-3.8, .45, 9.6], rotation:[0, 0, -.18], name:'CollapsedBeamWest' }),\r\n mesh(new THREE.BoxGeometry(3.4, .7, 1), sandstone, { position:[4.6, .35, 10.4], rotation:[0, 0, .13], name:'CollapsedBeamEast' })\r\n );\r\n\r\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]]) {\r\n const rock = mesh(new THREE.DodecahedronGeometry(s, 0), darkStone, { position:[x, y, z], name:'Rubble', navigationIgnore:true });\r\n rock.rotation.set(.2 + x * .01, .4 + z * .02, .15);\r\n root.add(rock);\r\n }\r\n addGrass(root);\r\n\r\n const hemi = new THREE.HemisphereLight(0xc8d6c2, 0x263127, 1.9);\r\n const sun = new THREE.DirectionalLight(0xffe0ad, 4.1);\r\n sun.position.set(-11, 17, 10);\r\n sun.castShadow = true;\r\n sun.shadow.mapSize.set(2048, 2048);\r\n Object.assign(sun.shadow.camera, { left:-24, right:24, top:20, bottom:-20, near:1, far:55 });\r\n const fill = new THREE.DirectionalLight(0x91aec4, .8);\r\n fill.position.set(12, 8, -14);\r\n root.add(hemi, sun, fill);\r\n\r\n let active = true;\r\n const loader = loadAssets ? new THREE.TextureLoader() : null;\r\n const loadTexture = (url, configure, apply) => loader?.load(url, (texture) => {\r\n if (!active) { texture.dispose(); return; }\r\n configure?.(texture);\r\n apply(texture);\r\n });\r\n if (loadAssets) {\r\n loadTexture(RUINED_COURTYARD_ASSETS.groundDiffuse, (t) => tile(t, [12, 10], true), (t) => { ground.map = t; ground.needsUpdate = true; });\r\n loadTexture(RUINED_COURTYARD_ASSETS.groundNormal, (t) => tile(t, [12, 10]), (t) => { ground.normalMap = t; ground.normalScale.set(.42, .42); ground.needsUpdate = true; });\r\n loadTexture(RUINED_COURTYARD_ASSETS.wallDiffuse, (t) => tile(t, [5, 3], true), (t) => { sandstone.map = t; sandstone.needsUpdate = true; });\r\n }\r\n\r\n return {\r\n id:'ruined-courtyard',\r\n root,\r\n floor,\r\n colliders:RUINED_COURTYARD_COLLIDERS.map((value) => structuredClone(value)),\r\n layout:{bounds:{min:[-17,-14],max:[17,14]},groundY:0,margin:1},\r\n camera:{ position:[16.8, 8.8, 19.5], target:[0, 1.2, -2.6] },\r\n rendering:{ background:0x667160, fog:{ color:0x667160, near:24, far:72 }, exposure:1.08 , ibl:loadAssets?{url:RUINED_COURTYARD_ASSETS.hdri,intensity:1}:null },\r\n dispose() {\r\n active = false;\r\n }\r\n };\r\n}\r\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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eAAe,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC,IAAI,MAAM;GAAE,OAAO,YAAY;GAAG,OAAO,YAAY,IAAI,KAAK,GAAG;GAAG,OAAO,cAAc;EAAM,CAAC;EACzK,YAAY,wBAAwB,cAAc,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"}
|
|
@@ -1,25 +0,0 @@
|
|
|
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), { code: response.error.code });
|
|
23
|
-
return response.result;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
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。
|
|
@@ -1,117 +0,0 @@
|
|
|
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) => {
|
|
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 [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)
|
|
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
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
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
|
-
scene.traverse(node=>{
|
|
19
|
-
if (node!==scene && !['Mesh','Group','Object3D'].includes(node.type)) throw new Error('AUTHORING_NODE_UNSUPPORTED');
|
|
20
|
-
if (node.animations?.length || node.onBeforeRender!==defaultBeforeRender || node.onAfterRender!==defaultAfterRender) throw new Error('AUTHORING_RUNTIME_CALLBACK_UNSUPPORTED');
|
|
21
|
-
if (node.isMesh) {
|
|
22
|
-
if (Array.isArray(node.material) || !['MeshBasicMaterial','MeshStandardMaterial','MeshPhysicalMaterial'].includes(node.material.type) || node.material.onBeforeCompile!==defaultCompile) throw new Error('AUTHORING_MATERIAL_UNSUPPORTED');
|
|
23
|
-
// Materialize real buffers before crossing the boundary; never trust allocation parameters.
|
|
24
|
-
delete node.geometry.parameters;
|
|
25
|
-
node.geometry.type='BufferGeometry';
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
const output=exportAuthoringDocument(captureAuthoringState(scene));
|
|
29
|
-
validateRemoteAuthoringDocument(output);
|
|
30
|
-
return output;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function build(source) {
|
|
34
|
-
if (!/^\s*export\s+function\s+createAsset\s*\(/m.test(source)) throw new Error('PROCEDURAL_ENTRY_REQUIRED');
|
|
35
|
-
const code=source.replace(/\bexport\s+function\s+createAsset\s*\(/,'function createAsset(');
|
|
36
|
-
const root=new Function('THREE',`"use strict";\n${code}\nreturn createAsset(THREE);`)(THREE);
|
|
37
|
-
return serializeAsset(root);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function serializeAsset(root) {
|
|
41
|
-
if (!root?.isObject3D || root.isScene) throw new Error('PROCEDURAL_ROOT_INVALID');
|
|
42
|
-
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');
|
|
43
|
-
const scene=new THREE.Scene();root.userData.authoringId='asset-root';scene.add(root);
|
|
44
|
-
return serialize(scene);
|
|
45
|
-
}
|
|
46
|
-
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { serializeAsset, execute } from './AuthoringSandboxEntry.js';
|
|
3
|
-
self.onmessage = async ({ data }) => {
|
|
4
|
-
let url;
|
|
5
|
-
try {
|
|
6
|
-
let document;
|
|
7
|
-
if(data.mode === 'procedural') {
|
|
8
|
-
url=URL.createObjectURL(new Blob([data.source],{type:'text/javascript'}));
|
|
9
|
-
const module=await import(/* @vite-ignore */ url);
|
|
10
|
-
if(typeof module.createAsset !== 'function')throw new Error('PROCEDURAL_ENTRY_REQUIRED');
|
|
11
|
-
document=serializeAsset(await module.createAsset(THREE));
|
|
12
|
-
} else document=execute(data.code,data.document);
|
|
13
|
-
self.postMessage({document});
|
|
14
|
-
}
|
|
15
|
-
catch (error) { self.postMessage({ error:String(error.message).slice(0,500) }); }
|
|
16
|
-
finally {if(url)URL.revokeObjectURL(url);}
|
|
17
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// Validate all data crossing the code-runtime boundary before Three.js allocates it.
|
|
2
|
-
export const remoteAuthoringLimits = Object.freeze({ maxBytes:2097152, maxNodes:128, maxDepth:16, maxVertices:20000, maxIndices:120000 });
|
|
3
|
-
const fail = () => { throw new Error('AUTHORING_DOCUMENT_UNSUPPORTED'); };
|
|
4
|
-
const safeId = value => typeof value === 'string' && /^[a-zA-Z0-9_-]{1,100}$/.test(value) && !['__proto__','constructor','prototype'].includes(value);
|
|
5
|
-
const types = new Set(['Float32Array','Uint32Array','Uint16Array','Uint8Array','Int32Array','Int16Array','Int8Array']);
|
|
6
|
-
const materials = new Set(['MeshBasicMaterial','MeshStandardMaterial','MeshPhysicalMaterial']);
|
|
7
|
-
export function validateRemoteAuthoringDocument(document) {
|
|
8
|
-
if (JSON.stringify(document).length > remoteAuthoringLimits.maxBytes) fail();
|
|
9
|
-
const scan = (value, depth=0) => {
|
|
10
|
-
if (depth > 40) fail();
|
|
11
|
-
if (typeof value === 'number' && !Number.isFinite(value)) fail();
|
|
12
|
-
if (!value || typeof value !== 'object') return;
|
|
13
|
-
for (const [key,item] of Object.entries(value)) {
|
|
14
|
-
if (['__proto__','constructor','prototype'].includes(key)) fail();
|
|
15
|
-
scan(item,depth+1);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
scan(document);
|
|
19
|
-
if (document?.format !== 'agentscape-world-authoring' || document.version !== 1 || document.root?.id !== 'root') fail();
|
|
20
|
-
for (const key of ['geometries','materials','textures']) {
|
|
21
|
-
const entries=Object.entries(document[key] || {});
|
|
22
|
-
if (entries.length > 128 || entries.some(([id])=>!safeId(id))) fail();
|
|
23
|
-
}
|
|
24
|
-
let vertices=0,indices=0;
|
|
25
|
-
for (const definition of Object.values(document.geometries || {})) {
|
|
26
|
-
// Primitive parameters can request enormous allocations despite a tiny JSON payload.
|
|
27
|
-
if (definition.type !== 'BufferGeometry' || !definition.json?.data?.attributes?.position) fail();
|
|
28
|
-
const data=definition.json.data;
|
|
29
|
-
if (data.morphAttributes && Object.keys(data.morphAttributes).length) fail();
|
|
30
|
-
for (const attribute of Object.values(data.attributes)) {
|
|
31
|
-
if (!types.has(attribute.type) || !Number.isInteger(attribute.itemSize) || attribute.itemSize<1 || attribute.itemSize>4 || !Array.isArray(attribute.array) || attribute.array.length>remoteAuthoringLimits.maxVertices*4 || attribute.array.some(v=>typeof v!=='number'||!Number.isFinite(v)) || attribute.isInterleavedBufferAttribute) fail();
|
|
32
|
-
}
|
|
33
|
-
const count=data.attributes.position.array.length/3;
|
|
34
|
-
if (data.attributes.position.itemSize !== 3 || !Number.isInteger(count)) fail();
|
|
35
|
-
if (data.attributes.position.array.some(v=>Math.abs(v)>100)) fail();
|
|
36
|
-
vertices+=count;
|
|
37
|
-
if (data.index) {
|
|
38
|
-
if (!['Uint16Array','Uint32Array'].includes(data.index.type) || !Array.isArray(data.index.array) || data.index.array.some(i=>!Number.isInteger(i)||i<0||i>=count)) fail();
|
|
39
|
-
indices+=data.index.array.length;
|
|
40
|
-
}
|
|
41
|
-
if (data.groups) {
|
|
42
|
-
if (!Array.isArray(data.groups) || data.groups.length>128) fail();
|
|
43
|
-
const available=data.index?.array.length ?? count;
|
|
44
|
-
for (const group of data.groups) if (!Number.isInteger(group.start) || !Number.isInteger(group.count) || group.start<0 || group.count<0 || group.start+group.count>available) fail();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
if (vertices>remoteAuthoringLimits.maxVertices || indices>remoteAuthoringLimits.maxIndices) fail();
|
|
48
|
-
const textureSlots=new Set(['map','normalMap','roughnessMap','metalnessMap','emissiveMap','alphaMap','aoMap']);
|
|
49
|
-
for (const material of Object.values(document.materials || {})) {
|
|
50
|
-
if (!materials.has(material.type)) fail();
|
|
51
|
-
for (const [key,value] of Object.entries(material)) if ((key==='map'||key.endsWith('Map')) && value!=null && (!textureSlots.has(key) || !Object.hasOwn(document.textures||{},value))) fail();
|
|
52
|
-
}
|
|
53
|
-
for (const texture of Object.values(document.textures || {})) {
|
|
54
|
-
const s=texture.source;
|
|
55
|
-
if (s?.type!=='data' || s.dataType!=='Uint8Array' || !Number.isInteger(s.width) || !Number.isInteger(s.height) || s.width<1 || s.height<1 || s.width>256 || s.height>256 || !Array.isArray(s.data) || s.data.length!==s.width*s.height*4 || s.data.some(n=>!Number.isInteger(n)||n<0||n>255)) fail();
|
|
56
|
-
}
|
|
57
|
-
const ids=new Set();
|
|
58
|
-
const visit=(node,depth=0)=>{
|
|
59
|
-
if (depth>remoteAuthoringLimits.maxDepth || !safeId(node.id) || ids.has(node.id) || ids.size>=remoteAuthoringLimits.maxNodes) fail();
|
|
60
|
-
ids.add(node.id);
|
|
61
|
-
const c=node.components;
|
|
62
|
-
if (!c || Object.keys(c).some(k=>!['transform','mesh','geometry','material','scene'].includes(k)) || (depth && c.scene)) fail();
|
|
63
|
-
const t=c.transform?.properties;
|
|
64
|
-
for (const [key,length] of [['position',3],['quaternion',4],['scale',3]]) if (!Array.isArray(t?.[key]) || t[key].length!==length || t[key].some(v=>typeof v!=='number'||!Number.isFinite(v)||Math.abs(v)>100)) fail();
|
|
65
|
-
if (t.scale.some(v=>v<=0) || Math.hypot(...t.quaternion)<1e-6) fail();
|
|
66
|
-
if (c.mesh && (!Object.hasOwn(document.geometries||{},c.geometry?.properties?.geometryId) || !Object.hasOwn(document.materials||{},c.material?.properties?.materialId))) fail();
|
|
67
|
-
if (node.children && !Array.isArray(node.children)) fail();
|
|
68
|
-
for (const child of node.children || []) visit(child,depth+1);
|
|
69
|
-
};
|
|
70
|
-
visit(document.root);
|
|
71
|
-
return document;
|
|
72
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { WorldRuntime } from '../modules/world/runtime/WorldRuntime.js';
|
|
2
|
-
import { RenderingSystem } from '../modules/world/runtime/systems/RenderingSystem.js';
|
|
3
|
-
import { createAssetModule } from '../modules/asset/AssetModule.js';
|
|
4
|
-
import { attachGenerationRuntime } from './generation/GenerationRuntime.js';
|
|
5
|
-
import { SkillRegistry } from './skills/SkillRegistry.js';
|
|
6
|
-
import { registerCoreSkills } from './skills/registerCoreSkills.js';
|
|
7
|
-
import { createWorldAuthoringContext } from './createWorldAuthoringContext.js';
|
|
8
|
-
import { ArticulationVerifier } from '../modules/world/verification/ArticulationVerifier.js';
|
|
9
|
-
import { AuthoringPromotionController } from './world-authoring/AuthoringPromotionController.js';
|
|
10
|
-
import { createAuthoringAssetProducer } from './world-authoring/AuthoringAssetProducer.js';
|
|
11
|
-
import { registerAuthoringSkills } from './skills/packs/authoringSkills.js';
|
|
12
|
-
import { registerCodeSkills } from './skills/packs/codeSkills.js';
|
|
13
|
-
import { createSceneFacade, sceneAgentModelSchema } from './scene/SceneFacade.js';
|
|
14
|
-
import * as z from 'zod/v4';
|
|
15
|
-
|
|
16
|
-
// Composition only. DOM rendering is attached here; frame scheduling and input stay with the host.
|
|
17
|
-
export function createSession(container, {
|
|
18
|
-
generation: generationOptions = {},
|
|
19
|
-
rendererFactory = null,
|
|
20
|
-
rendererMode = 'auto',
|
|
21
|
-
rendererTiming = false,
|
|
22
|
-
rendererPixelRatioScale = 1,
|
|
23
|
-
articulationVerifier = null,
|
|
24
|
-
authoringOptions = null,
|
|
25
|
-
codeExecutor = null,
|
|
26
|
-
codeGLTFLoader = undefined,
|
|
27
|
-
...worldOptions
|
|
28
|
-
} = {}) {
|
|
29
|
-
const assetModule = worldOptions.assetModule || createAssetModule();
|
|
30
|
-
assetModule.configureVerification({
|
|
31
|
-
articulationVerifier:articulationVerifier || new ArticulationVerifier({
|
|
32
|
-
assetRegistry:assetModule.registry,
|
|
33
|
-
assetLoader:assetModule.loader,
|
|
34
|
-
...(worldOptions.physicsFactory ? { physicsFactory:worldOptions.physicsFactory } : {})
|
|
35
|
-
})
|
|
36
|
-
});
|
|
37
|
-
const world = new WorldRuntime({
|
|
38
|
-
...worldOptions,
|
|
39
|
-
assetModule
|
|
40
|
-
});
|
|
41
|
-
if (container) {
|
|
42
|
-
const renderingOptions = {
|
|
43
|
-
container,
|
|
44
|
-
scene:world.scene,
|
|
45
|
-
events:world.events,
|
|
46
|
-
rendererMode,
|
|
47
|
-
rendererTiming,
|
|
48
|
-
pixelRatioScale:rendererPixelRatioScale
|
|
49
|
-
};
|
|
50
|
-
if (rendererFactory) renderingOptions.rendererFactory = rendererFactory;
|
|
51
|
-
world.attachRendering(new RenderingSystem(renderingOptions));
|
|
52
|
-
}
|
|
53
|
-
const generation = attachGenerationRuntime(world, generationOptions);
|
|
54
|
-
world.skills = registerCoreSkills(new SkillRegistry({
|
|
55
|
-
policy: world.policy, trace: world.trace, runtime: world
|
|
56
|
-
}), world);
|
|
57
|
-
const authoring = world.rendering || authoringOptions ? createWorldAuthoringContext(world, authoringOptions || {}) : null;
|
|
58
|
-
const promotion = authoring ? new AuthoringPromotionController({ authoring, world,
|
|
59
|
-
produceAsset:createAuthoringAssetProducer({ assets:assetModule, artifacts:generation.artifacts }) }) : null;
|
|
60
|
-
if (promotion) registerAuthoringSkills((name, options, handler) => world.skills.register({ name, ...options, handler }), promotion);
|
|
61
|
-
if (authoring) registerCodeSkills((name, options, handler) => world.skills.register({ name, ...options, handler }), authoring);
|
|
62
|
-
const scene = createSceneFacade(world, { codeExecutor, codeGLTFLoader });
|
|
63
|
-
world.skills.register({ name:'addSceneModel', description:'通过 Scene API 添加已有 AssetRef 或声明式 Asset Recipe。基础几何用 Recipe JSON,不生成或执行 JavaScript。返回添加、准入和验证三个独立结果。', permissions:['world.write','asset.write'], required:['model'], properties:{model:z.toJSONSchema(sceneAgentModelSchema)}, mutates:true, manualMutation:true, batchable:false,
|
|
64
|
-
handler:({model})=>scene.addModel(sceneAgentModelSchema.parse(model)) });
|
|
65
|
-
return { world, generation, authoring, promotion, scene };
|
|
66
|
-
}
|