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,231 +0,0 @@
|
|
|
1
|
-
import { assertFindingRevision, normalizeFinding } from '../verification/Finding.js';
|
|
2
|
-
import { normalizeWorldIR } from './WorldIR.js';
|
|
3
|
-
|
|
4
|
-
export const WORLD_REVISION_CONTEXT_SCHEMA='agentscape.world-revision-context';
|
|
5
|
-
export const WORLD_REVISION_PROPOSAL_SCHEMA='agentscape.world-revision-proposal';
|
|
6
|
-
export const WORLD_REVISION_VERSION=1;
|
|
7
|
-
|
|
8
|
-
const clean=v=>typeof v==='string'?v.trim():'';
|
|
9
|
-
const finiteVec3=v=>Array.isArray(v)&&v.length===3&&v.every(Number.isFinite)?v.map(Number):null;
|
|
10
|
-
|
|
11
|
-
const text={type:'string',minLength:1};
|
|
12
|
-
const scalar={anyOf:[{type:'string'},{type:'number'},{type:'boolean'},{type:'null'}]};
|
|
13
|
-
const strict=(properties,required=[])=>({type:'object',additionalProperties:false,properties,required});
|
|
14
|
-
const assetSchema=strict({assetId:text,query:text,prompt:text,type:text,generate:{type:'boolean'},provider:text});
|
|
15
|
-
assetSchema.anyOf=[{required:['assetId']},{required:['query']},{required:['prompt']},{required:['type']}];
|
|
16
|
-
const physicsRequirementSchema=strict({
|
|
17
|
-
bodyClass:{type:'string',enum:['transform','rigid','articulated','character','soft','cloth']},
|
|
18
|
-
requiredCapabilities:{type:'array',items:text,uniqueItems:true},
|
|
19
|
-
executionMode:{type:'string',enum:['render-only','realtime','validation-only']},
|
|
20
|
-
qualityPolicy:strict({deterministicRequired:{type:'boolean'},realtimeRequired:{type:'boolean'},fallbackPolicy:{type:'string',enum:['deny']}})
|
|
21
|
-
});
|
|
22
|
-
export const WORLD_REVISION_EDIT_TOOL_SCHEMA={oneOf:[
|
|
23
|
-
strict({kind:{type:'string',enum:['set-position']},entityId:text,position:{type:'array',items:{type:'number'},minItems:3,maxItems:3}},['kind','entityId','position']),
|
|
24
|
-
strict({kind:{type:'string',enum:['set-generation']},entityId:text,generate:{type:'boolean'}},['kind','entityId','generate']),
|
|
25
|
-
strict({kind:{type:'string',enum:['replace-asset']},entityId:text,asset:assetSchema},['kind','entityId','asset']),
|
|
26
|
-
strict({kind:{type:'string',enum:['set-initial-state']},entityId:text,state:{type:'object',additionalProperties:scalar}},['kind','entityId','state']),
|
|
27
|
-
strict({kind:{type:'string',enum:['set-capability-intent']},entityId:text,capabilities:{type:'array',items:text,uniqueItems:true}},['kind','entityId','capabilities']),
|
|
28
|
-
strict({kind:{type:'string',enum:['set-physics-requirement']},entityId:text,requirement:{anyOf:[physicsRequirementSchema,{type:'null'}]}},['kind','entityId','requirement'])
|
|
29
|
-
]};
|
|
30
|
-
export const WORLD_REVISION_REQUEST_TOOL_SCHEMA=strict({reason:{type:'string'},edits:{type:'array',items:WORLD_REVISION_EDIT_TOOL_SCHEMA,minItems:1}},['edits']);
|
|
31
|
-
export const WORLD_REVISION_PROPOSAL_TOOL_SCHEMA=strict({
|
|
32
|
-
schema:{type:'string',enum:[WORLD_REVISION_PROPOSAL_SCHEMA]},schemaVersion:{type:'integer',enum:[WORLD_REVISION_VERSION]},
|
|
33
|
-
status:{type:'string',enum:['changed-plan-required']},baseRevisionId:text,nextRevisionId:text,
|
|
34
|
-
findingIds:{type:'array',items:text,uniqueItems:true},affectedEntityIds:{type:'array',items:text,uniqueItems:true},
|
|
35
|
-
reason:text,edits:{type:'array',items:WORLD_REVISION_EDIT_TOOL_SCHEMA,minItems:1}
|
|
36
|
-
},['schema','schemaVersion','status','baseRevisionId','nextRevisionId','findingIds','affectedEntityIds','reason','edits']);
|
|
37
|
-
|
|
38
|
-
export function buildWorldRevisionContext(worldIR,findings=[]){
|
|
39
|
-
const ir=normalizeWorldIR(worldIR);
|
|
40
|
-
const normalized=(findings||[]).map((finding,index)=>normalizeFinding(finding,{index}));
|
|
41
|
-
const baseRevisionId=ir.revision.id;
|
|
42
|
-
assertFindingRevision(normalized,baseRevisionId);
|
|
43
|
-
|
|
44
|
-
const seedEntityIds=new Set(normalized.flatMap((finding)=>finding.affectedObjects||[]).filter(Boolean));
|
|
45
|
-
const contextEntityIds=new Set(seedEntityIds);
|
|
46
|
-
for(const relation of ir.spatial.relations){
|
|
47
|
-
if(seedEntityIds.has(relation.subject)||seedEntityIds.has(relation.object)){
|
|
48
|
-
contextEntityIds.add(relation.subject); contextEntityIds.add(relation.object);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
for(const constraint of ir.spatial.constraints){
|
|
52
|
-
if(seedEntityIds.has(constraint.subject)||seedEntityIds.has(constraint.object)){
|
|
53
|
-
if(constraint.subject) contextEntityIds.add(constraint.subject);
|
|
54
|
-
if(constraint.object) contextEntityIds.add(constraint.object);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
const knownEntityIds=new Set(ir.entities.map((entity)=>entity.id).filter(Boolean));
|
|
58
|
-
const editableEntityIds=[...seedEntityIds].filter((id)=>knownEntityIds.has(id));
|
|
59
|
-
const missingEntityIds=[...seedEntityIds].filter((id)=>!knownEntityIds.has(id));
|
|
60
|
-
return {
|
|
61
|
-
schema:WORLD_REVISION_CONTEXT_SCHEMA,schemaVersion:WORLD_REVISION_VERSION,
|
|
62
|
-
baseRevisionId,
|
|
63
|
-
findingIds:normalized.map((finding)=>finding.id),
|
|
64
|
-
findings:structuredClone(normalized),
|
|
65
|
-
affected:{
|
|
66
|
-
seedEntityIds:[...seedEntityIds],
|
|
67
|
-
contextEntityIds:[...contextEntityIds],
|
|
68
|
-
editableEntityIds,
|
|
69
|
-
missingEntityIds
|
|
70
|
-
},
|
|
71
|
-
subgraph:{
|
|
72
|
-
entities:ir.entities.filter((entity)=>entity.id&&contextEntityIds.has(entity.id)).map((entity)=>structuredClone(entity)),
|
|
73
|
-
spatial:{
|
|
74
|
-
relations:ir.spatial.relations.filter((relation)=>contextEntityIds.has(relation.subject)||contextEntityIds.has(relation.object)).map((relation)=>structuredClone(relation)),
|
|
75
|
-
constraints:ir.spatial.constraints.filter((constraint)=>contextEntityIds.has(constraint.subject)||contextEntityIds.has(constraint.object)).map((constraint)=>structuredClone(constraint))
|
|
76
|
-
},
|
|
77
|
-
interactions:ir.interactions.filter((item)=>[item.actorId,item.targetId,item.supportId].some((id)=>id&&contextEntityIds.has(id))).map((item)=>structuredClone(item)),
|
|
78
|
-
acceptance:ir.acceptance.filter((item)=>[item.targetId,item.subject,item.object].some((id)=>id&&contextEntityIds.has(id))).map((item)=>structuredClone(item))
|
|
79
|
-
},
|
|
80
|
-
rulesReviewRequired:Boolean(ir.rules.length&&contextEntityIds.size)
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const normalizeEditedEntity=(context,entityId,mutate)=>{
|
|
86
|
-
const source=context.subgraph?.entities?.find((entity)=>entity.id===entityId);
|
|
87
|
-
if(!source){const error=new Error(`World revision context entity missing: ${entityId}`);error.code='WORLD_REVISION_CONTEXT_ENTITY_MISSING';throw error;}
|
|
88
|
-
const candidate=structuredClone(source);
|
|
89
|
-
mutate(candidate);
|
|
90
|
-
return normalizeWorldIR({
|
|
91
|
-
schema:'agentscape.world-ir',schemaVersion:1,
|
|
92
|
-
revision:{id:context.baseRevisionId},provenance:{source:'world-revision-normalization'},intent:{name:'World Revision'},
|
|
93
|
-
entities:[candidate],spatial:{relations:[],constraints:[]},interactions:[],rules:[],acceptance:[]
|
|
94
|
-
}).entities[0];
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export function createWorldRevisionProposal(context,{nextRevisionId,reason='bounded finding repair',edits=[]}={}){
|
|
98
|
-
if(context?.schema!==WORLD_REVISION_CONTEXT_SCHEMA||context.schemaVersion!==WORLD_REVISION_VERSION) throw new TypeError('Unsupported WorldRevision context');
|
|
99
|
-
const nextId=clean(nextRevisionId);
|
|
100
|
-
if(!nextId||nextId===context.baseRevisionId) throw new TypeError('World revision proposal requires a new nextRevisionId');
|
|
101
|
-
if(!Array.isArray(edits)) throw new TypeError('World revision edits must be an array');
|
|
102
|
-
if(!edits.length) throw new TypeError('World revision proposal requires at least one edit');
|
|
103
|
-
const editable=new Set(context.affected?.editableEntityIds||[]);
|
|
104
|
-
const seen=new Set();
|
|
105
|
-
const normalized=edits.map((edit,index)=>{
|
|
106
|
-
if(!edit||typeof edit!=='object'||Array.isArray(edit)) throw new TypeError(`World revision edit[${index}] must be an object`);
|
|
107
|
-
const kind=clean(edit.kind),entityId=clean(edit.entityId);
|
|
108
|
-
if(!entityId||!editable.has(entityId)){
|
|
109
|
-
const error=new Error(`World revision edit outside affected subgraph: ${entityId||'$missing'}`);
|
|
110
|
-
error.code='WORLD_REVISION_SCOPE_VIOLATION'; throw error;
|
|
111
|
-
}
|
|
112
|
-
const key=`${kind}:${entityId}`; if(seen.has(key)) throw new TypeError(`Duplicate world revision edit: ${key}`); seen.add(key);
|
|
113
|
-
if(kind==='set-position'){
|
|
114
|
-
const position=finiteVec3(edit.position); if(!position) throw new TypeError(`World revision edit[${index}] requires finite position[3]`);
|
|
115
|
-
return {kind,entityId,position};
|
|
116
|
-
}
|
|
117
|
-
if(kind==='set-generation'){
|
|
118
|
-
if(typeof edit.generate!=='boolean') throw new TypeError(`World revision edit[${index}] requires boolean generate`);
|
|
119
|
-
return {kind,entityId,generate:edit.generate};
|
|
120
|
-
}
|
|
121
|
-
if(kind==='replace-asset'){
|
|
122
|
-
if(!edit.asset||typeof edit.asset!=='object'||Array.isArray(edit.asset)) throw new TypeError(`World revision edit[${index}] requires asset object`);
|
|
123
|
-
const entity=normalizeEditedEntity(context,entityId,(candidate)=>{candidate.asset=structuredClone(edit.asset);});
|
|
124
|
-
return {kind,entityId,asset:structuredClone(entity.asset)};
|
|
125
|
-
}
|
|
126
|
-
if(kind==='set-initial-state'){
|
|
127
|
-
if(!edit.state||typeof edit.state!=='object'||Array.isArray(edit.state)) throw new TypeError(`World revision edit[${index}] requires state object`);
|
|
128
|
-
const entity=normalizeEditedEntity(context,entityId,(candidate)=>{candidate.initialState=structuredClone(edit.state);});
|
|
129
|
-
return {kind,entityId,state:structuredClone(entity.initialState)};
|
|
130
|
-
}
|
|
131
|
-
if(kind==='set-capability-intent'){
|
|
132
|
-
if(!Array.isArray(edit.capabilities)) throw new TypeError(`World revision edit[${index}] requires capabilities array`);
|
|
133
|
-
const entity=normalizeEditedEntity(context,entityId,(candidate)=>{candidate.capabilityIntent=structuredClone(edit.capabilities);});
|
|
134
|
-
return {kind,entityId,capabilities:[...entity.capabilityIntent]};
|
|
135
|
-
}
|
|
136
|
-
if(kind==='set-physics-requirement'){
|
|
137
|
-
if(edit.requirement!==null&&(!edit.requirement||typeof edit.requirement!=='object'||Array.isArray(edit.requirement))) throw new TypeError(`World revision edit[${index}] requires requirement object or null`);
|
|
138
|
-
const entity=normalizeEditedEntity(context,entityId,(candidate)=>{
|
|
139
|
-
if(edit.requirement===null) delete candidate.physicsRequirement;
|
|
140
|
-
else candidate.physicsRequirement=structuredClone(edit.requirement);
|
|
141
|
-
});
|
|
142
|
-
return {kind,entityId,requirement:entity.physicsRequirement?structuredClone(entity.physicsRequirement):null};
|
|
143
|
-
}
|
|
144
|
-
const error=new TypeError(`Unsupported world revision edit kind: ${kind}`); error.code='WORLD_REVISION_EDIT_UNSUPPORTED'; throw error;
|
|
145
|
-
});
|
|
146
|
-
return {
|
|
147
|
-
schema:WORLD_REVISION_PROPOSAL_SCHEMA,schemaVersion:WORLD_REVISION_VERSION,
|
|
148
|
-
status:'changed-plan-required',baseRevisionId:context.baseRevisionId,nextRevisionId:nextId,
|
|
149
|
-
findingIds:[...(context.findingIds||[])],affectedEntityIds:[...(context.affected?.editableEntityIds||[])],
|
|
150
|
-
reason:clean(reason)||'bounded finding repair',edits:normalized
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const REVISION_EDIT_DOMAINS={
|
|
156
|
-
'set-initial-state':['state','acceptance'],
|
|
157
|
-
'set-position':['transform','layout','spatial','physics','navigation','acceptance'],
|
|
158
|
-
'set-generation':['asset','generation','layout','behavior','physics','acceptance'],
|
|
159
|
-
'replace-asset':['asset','generation','layout','behavior','physics','spatial','navigation','acceptance'],
|
|
160
|
-
'set-capability-intent':['behavior','acceptance'],
|
|
161
|
-
'set-physics-requirement':['physics','acceptance']
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
export function classifyWorldRevisionImpact(proposal={}){
|
|
165
|
-
const edits=Array.isArray(proposal.edits)?proposal.edits:[];
|
|
166
|
-
const editKinds=[...new Set(edits.map((edit)=>clean(edit.kind)).filter(Boolean))];
|
|
167
|
-
const affectedEntityIds=[...new Set(edits.map((edit)=>clean(edit.entityId)).filter(Boolean))];
|
|
168
|
-
const domains=[...new Set(editKinds.flatMap((kind)=>REVISION_EDIT_DOMAINS[kind]||['unknown']))];
|
|
169
|
-
const stateOnly=edits.length>0 && domains.every((domain)=>['state','acceptance'].includes(domain));
|
|
170
|
-
const behaviorOnly=edits.length>0 && domains.every((domain)=>['behavior','acceptance'].includes(domain));
|
|
171
|
-
const physicsOnly=edits.length>0 && domains.every((domain)=>['physics','acceptance'].includes(domain));
|
|
172
|
-
const singlePosition=edits.length===1 && editKinds.length===1 && editKinds[0]==='set-position';
|
|
173
|
-
return {
|
|
174
|
-
mode:stateOnly?'incremental-state':behaviorOnly?'incremental-behavior':physicsOnly?'incremental-physics':singlePosition?'incremental-position':'full',
|
|
175
|
-
editKinds,affectedEntityIds,domains
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export function applyWorldRevisionProposal(worldIR,proposal,{acceptChangedPlan=false}={}){
|
|
180
|
-
const ir=normalizeWorldIR(worldIR);
|
|
181
|
-
if(proposal?.schema!==WORLD_REVISION_PROPOSAL_SCHEMA||proposal.schemaVersion!==WORLD_REVISION_VERSION) throw new TypeError('Unsupported WorldRevision proposal');
|
|
182
|
-
if(proposal.baseRevisionId!==ir.revision.id){ const error=new Error(`World revision base mismatch: ${proposal.baseRevisionId} != ${ir.revision.id}`); error.code='WORLD_REVISION_BASE_MISMATCH'; throw error; }
|
|
183
|
-
if(acceptChangedPlan!==true){ const error=new Error('World revision proposal requires explicit changed-plan acceptance'); error.code='WORLD_REVISION_CHANGE_NOT_ACCEPTED'; throw error; }
|
|
184
|
-
const allowed=new Set(proposal.affectedEntityIds||[]);
|
|
185
|
-
const next=structuredClone(ir);
|
|
186
|
-
let changed=false;
|
|
187
|
-
for(const edit of proposal.edits||[]){
|
|
188
|
-
if(!allowed.has(edit.entityId)){ const error=new Error(`World revision edit outside accepted scope: ${edit.entityId}`); error.code='WORLD_REVISION_SCOPE_VIOLATION'; throw error; }
|
|
189
|
-
const entity=next.entities.find((item)=>item.id===edit.entityId);
|
|
190
|
-
if(!entity){ const error=new Error(`World revision entity missing: ${edit.entityId}`); error.code='WORLD_REVISION_ENTITY_MISSING'; throw error; }
|
|
191
|
-
if(edit.kind==='set-position'){
|
|
192
|
-
if(JSON.stringify(entity.transform?.position||null)!==JSON.stringify(edit.position)){ entity.transform||={}; entity.transform.position=[...edit.position]; changed=true; }
|
|
193
|
-
continue;
|
|
194
|
-
}
|
|
195
|
-
if(edit.kind==='set-generation'){
|
|
196
|
-
if(entity.asset.generate!==edit.generate){ entity.asset.generate=edit.generate; changed=true; }
|
|
197
|
-
continue;
|
|
198
|
-
}
|
|
199
|
-
if(edit.kind==='replace-asset'){
|
|
200
|
-
if(JSON.stringify(entity.asset)!==JSON.stringify(edit.asset)){ entity.asset=structuredClone(edit.asset); changed=true; }
|
|
201
|
-
continue;
|
|
202
|
-
}
|
|
203
|
-
if(edit.kind==='set-initial-state'){
|
|
204
|
-
if(JSON.stringify(entity.initialState)!==JSON.stringify(edit.state)){ entity.initialState=structuredClone(edit.state); changed=true; }
|
|
205
|
-
continue;
|
|
206
|
-
}
|
|
207
|
-
if(edit.kind==='set-capability-intent'){
|
|
208
|
-
if(JSON.stringify(entity.capabilityIntent)!==JSON.stringify(edit.capabilities)){ entity.capabilityIntent=[...edit.capabilities]; changed=true; }
|
|
209
|
-
continue;
|
|
210
|
-
}
|
|
211
|
-
if(edit.kind==='set-physics-requirement'){
|
|
212
|
-
const current=entity.physicsRequirement||null;
|
|
213
|
-
if(JSON.stringify(current)!==JSON.stringify(edit.requirement)){
|
|
214
|
-
if(edit.requirement===null) delete entity.physicsRequirement;
|
|
215
|
-
else entity.physicsRequirement=structuredClone(edit.requirement);
|
|
216
|
-
changed=true;
|
|
217
|
-
}
|
|
218
|
-
continue;
|
|
219
|
-
}
|
|
220
|
-
const error=new TypeError(`Unsupported world revision edit kind: ${edit.kind}`); error.code='WORLD_REVISION_EDIT_UNSUPPORTED'; throw error;
|
|
221
|
-
}
|
|
222
|
-
if(!changed){ const error=new Error('World revision proposal does not change the plan'); error.code='WORLD_REVISION_NO_CHANGE'; throw error; }
|
|
223
|
-
next.revision={id:proposal.nextRevisionId,parentId:ir.revision.id,reason:proposal.reason};
|
|
224
|
-
next.provenance={
|
|
225
|
-
...next.provenance,
|
|
226
|
-
source:'finding-revision',
|
|
227
|
-
sourceId:proposal.findingIds?.[0] || ir.revision.id,
|
|
228
|
-
evidenceRefs:[...new Set([...(next.provenance.evidenceRefs||[]),...(proposal.findingIds||[])])]
|
|
229
|
-
};
|
|
230
|
-
return normalizeWorldIR(next);
|
|
231
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
export const WORLD_SPEC_SCHEMA = {
|
|
2
|
-
type:'object',additionalProperties:false,
|
|
3
|
-
properties:{
|
|
4
|
-
name:{type:'string',description:'Human-readable world name.'},description:{type:'string',description:'World intent and task context; not executable truth.'},
|
|
5
|
-
generation:{type:'object',additionalProperties:false,properties:{provider:{type:'string',description:'Generator provider for missing assets.'},generate:{type:'boolean',description:'Allow generation only when reuse cannot resolve an asset.'}}},
|
|
6
|
-
assets:{type:'array',items:{type:'object',additionalProperties:false,properties:{
|
|
7
|
-
id:{type:'string',description:'Instance id inside the new world, e.g. table_01. This is not the asset catalog id.'},assetId:{type:'string',description:'Existing registered asset id, normally copied from searchAssets result.id when reusing an asset.'},query:{type:'string',description:'Asset-library lookup query when assetId is not known.'},prompt:{type:'string',description:'Generator prompt for a missing asset; does not imply verification.'},type:{type:'string',description:'Semantic asset type used for reuse lookup or generation intent.'},
|
|
8
|
-
position:{type:'array',items:{type:'number'},minItems:3,maxItems:3,description:'Optional exact world position. Omit unless the user explicitly constrains coordinates; Runtime composes omitted positions.'},generate:{type:'boolean',description:'Whether this request may generate if reuse fails.'},provider:{type:'string',description:'Per-asset generator provider override.'}
|
|
9
|
-
}}},
|
|
10
|
-
relations:{type:'array',items:{type:'object',additionalProperties:false,required:['subject','predicate','object'],properties:{
|
|
11
|
-
subject:{type:'string',description:'World instance id being placed/moved.'},predicate:{type:'string',enum:['ON','NEAR','INSIDE']},object:{type:'string',description:'World instance id used as support/near target.'},surfaceId:{type:'string'},receptacleId:{type:'string'},distance:{type:'number',exclusiveMinimum:0,description:'Optional center distance for NEAR. Omit to let Runtime derive safe spacing from collider footprints.'}
|
|
12
|
-
}}}
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const finiteVec3 = (value, fallback = null) => {
|
|
17
|
-
if (value == null && fallback) return [...fallback];
|
|
18
|
-
if (!Array.isArray(value) || value.length !== 3 || !value.every(Number.isFinite)) return null;
|
|
19
|
-
return value.map(Number);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const clean = (value) => typeof value === 'string' ? value.trim() : '';
|
|
23
|
-
|
|
24
|
-
const assertKnownKeys = (value, allowed, label) => {
|
|
25
|
-
for (const key of Object.keys(value || {})) {
|
|
26
|
-
if (!allowed.has(key)) throw new TypeError(`${label} unknown field: ${key}`);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const TOP_LEVEL_KEYS=new Set(['name','description','generation','assets','relations']);
|
|
31
|
-
const GENERATION_KEYS=new Set(['provider','generate']);
|
|
32
|
-
const ASSET_KEYS=new Set(['id','assetId','query','prompt','type','position','generate','provider']);
|
|
33
|
-
const RELATION_KEYS=new Set(['subject','predicate','object','surfaceId','receptacleId','distance']);
|
|
34
|
-
|
|
35
|
-
export function normalizeWorldSpec(input = {}) {
|
|
36
|
-
if (!input || typeof input !== 'object' || Array.isArray(input)) throw new TypeError('WorldSpec must be an object');
|
|
37
|
-
assertKnownKeys(input,TOP_LEVEL_KEYS,'WorldSpec');
|
|
38
|
-
const generation = input.generation && typeof input.generation === 'object' ? input.generation : {};
|
|
39
|
-
assertKnownKeys(generation,GENERATION_KEYS,'WorldSpec generation');
|
|
40
|
-
const defaultProvider = clean(generation.provider) || null;
|
|
41
|
-
const defaultGenerate = generation.generate === true;
|
|
42
|
-
const ids = new Set();
|
|
43
|
-
const assets = (input.assets || []).map((request, index) => {
|
|
44
|
-
if (!request || typeof request !== 'object' || Array.isArray(request)) throw new TypeError(`WorldSpec asset[${index}] must be an object`);
|
|
45
|
-
assertKnownKeys(request,ASSET_KEYS,`WorldSpec asset[${index}]`);
|
|
46
|
-
const assetId = clean(request.assetId) || null;
|
|
47
|
-
const type = clean(request.type) || null;
|
|
48
|
-
const prompt = clean(request.prompt) || null;
|
|
49
|
-
const query = clean(request.query) || prompt || type || assetId;
|
|
50
|
-
if (!query) throw new TypeError(`WorldSpec asset[${index}] requires assetId, query, prompt, or type`);
|
|
51
|
-
const id = clean(request.id) || null;
|
|
52
|
-
if (id && ids.has(id)) throw new TypeError(`WorldSpec duplicate instance id: ${id}`);
|
|
53
|
-
if (id) ids.add(id);
|
|
54
|
-
const position = request.position == null ? null : finiteVec3(request.position);
|
|
55
|
-
if (request.position != null && !position) throw new TypeError(`WorldSpec asset[${index}] position requires finite [3]`);
|
|
56
|
-
const provider = clean(request.provider) || defaultProvider;
|
|
57
|
-
return {
|
|
58
|
-
...(id ? { id } : {}),
|
|
59
|
-
...(assetId ? { assetId } : {}),
|
|
60
|
-
query,
|
|
61
|
-
...(type ? { type } : {}),
|
|
62
|
-
...(prompt ? { prompt } : {}),
|
|
63
|
-
...(position ? { position } : {}),
|
|
64
|
-
generate: request.generate == null ? defaultGenerate : request.generate === true,
|
|
65
|
-
...(provider ? { provider } : {})
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
const relations = (input.relations || []).map((relation, index) => {
|
|
69
|
-
if (!relation || typeof relation !== 'object' || Array.isArray(relation)) throw new TypeError(`WorldSpec relation[${index}] must be an object`);
|
|
70
|
-
assertKnownKeys(relation,RELATION_KEYS,`WorldSpec relation[${index}]`);
|
|
71
|
-
const subject = clean(relation.subject), predicate = clean(relation.predicate).toUpperCase(), object = clean(relation.object);
|
|
72
|
-
if (!subject || !predicate || !object) throw new TypeError(`WorldSpec relation[${index}] requires subject, predicate, object`);
|
|
73
|
-
if (!['ON','NEAR','INSIDE'].includes(predicate)) throw new TypeError(`WorldSpec relation[${index}] unsupported predicate: ${predicate}`);
|
|
74
|
-
const distance = relation.distance == null ? null : Number(relation.distance);
|
|
75
|
-
if (distance != null && (!Number.isFinite(distance) || distance <= 0)) throw new TypeError(`WorldSpec relation[${index}] distance must be positive finite`);
|
|
76
|
-
return { subject, predicate, object, ...(clean(relation.surfaceId) ? { surfaceId:clean(relation.surfaceId) } : {}), ...(clean(relation.receptacleId) ? { receptacleId:clean(relation.receptacleId) } : {}), ...(distance != null ? { distance } : {}) };
|
|
77
|
-
});
|
|
78
|
-
return {
|
|
79
|
-
schema: 1,
|
|
80
|
-
name: clean(input.name) || 'Generated World',
|
|
81
|
-
description: clean(input.description),
|
|
82
|
-
generation: { ...(defaultProvider ? { provider:defaultProvider } : {}), generate:defaultGenerate },
|
|
83
|
-
assets,
|
|
84
|
-
relations
|
|
85
|
-
};
|
|
86
|
-
}
|