agentscape3d-engine 0.0.0-stage → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +19 -2
- package/cli.mjs +53 -0
- package/dist/ArticulationVerifier-BfGxXY8V.js +337 -0
- package/dist/ArticulationVerifier-BfGxXY8V.js.map +1 -0
- package/dist/AssetCompiler-BLj09iu1.js +2424 -0
- package/dist/AssetCompiler-BLj09iu1.js.map +1 -0
- package/dist/AssetModule-DME-XaFS.js +2637 -0
- package/dist/AssetModule-DME-XaFS.js.map +1 -0
- package/dist/AssetRecipe-g8dZBhgJ.js +298 -0
- package/dist/AssetRecipe-g8dZBhgJ.js.map +1 -0
- package/dist/BrowserCodeWorker.js +53856 -0
- package/dist/BrowserCodeWorker.js.map +1 -0
- package/dist/CarryCapability-CXwHU5ay.js +104 -0
- package/dist/CarryCapability-CXwHU5ay.js.map +1 -0
- package/dist/KinematicHypothesisScreen-C3TKiuYR.js +241 -0
- package/dist/KinematicHypothesisScreen-C3TKiuYR.js.map +1 -0
- package/dist/ObjectTransform-BlQUNK7c.js +61 -0
- package/dist/ObjectTransform-BlQUNK7c.js.map +1 -0
- package/dist/RapierPhysicsBackend-B2wQe_Vl.js +3259 -0
- package/dist/RapierPhysicsBackend-B2wQe_Vl.js.map +1 -0
- package/dist/RenderingSystem-WIr1ZuGu.js +1042 -0
- package/dist/RenderingSystem-WIr1ZuGu.js.map +1 -0
- package/dist/ScenePresentation-LsYiDxbm.js +152 -0
- package/dist/ScenePresentation-LsYiDxbm.js.map +1 -0
- package/dist/SceneProject-K7HH1s8o.js +2687 -0
- package/dist/SceneProject-K7HH1s8o.js.map +1 -0
- package/dist/SceneSerializer-zOzbX4jZ.js +932 -0
- package/dist/SceneSerializer-zOzbX4jZ.js.map +1 -0
- package/dist/SimulationProfile-DSYZbBLQ.js +165 -0
- package/dist/SimulationProfile-DSYZbBLQ.js.map +1 -0
- package/dist/StylePack-DcRa_kU0.js +88 -0
- package/dist/StylePack-DcRa_kU0.js.map +1 -0
- package/dist/WorldArchive-BiFGLt--.js +451 -0
- package/dist/WorldArchive-BiFGLt--.js.map +1 -0
- package/dist/WorldCommands-Debj7V4L.js +2207 -0
- package/dist/WorldCommands-Debj7V4L.js.map +1 -0
- package/dist/WorldIO-Ch8QBfKY.js +151 -0
- package/dist/WorldIO-Ch8QBfKY.js.map +1 -0
- package/dist/admission-CVEvsrdz.js +121 -0
- package/dist/admission-CVEvsrdz.js.map +1 -0
- package/dist/blankWorld-B0MW6g7q.js +75 -0
- package/dist/blankWorld-B0MW6g7q.js.map +1 -0
- package/dist/core.d.ts +68 -0
- package/dist/core.js +209 -0
- package/dist/core.js.map +1 -0
- package/dist/disposeObject3D-DIMzy0FA.js +128 -0
- package/dist/disposeObject3D-DIMzy0FA.js.map +1 -0
- package/dist/environments-HOe3sJXH.js +567 -0
- package/dist/environments-HOe3sJXH.js.map +1 -0
- package/dist/gltfIO-BzVKLyaL.js +339 -0
- package/dist/gltfIO-BzVKLyaL.js.map +1 -0
- package/dist/grandUrbanBlock-DRndRZjF.js +515 -0
- package/dist/grandUrbanBlock-DRndRZjF.js.map +1 -0
- package/dist/index.d.ts +345 -0
- package/dist/index.js +16952 -0
- package/dist/index.js.map +1 -0
- package/dist/magicCabin-CfBZjx2Q.js +11019 -0
- package/dist/magicCabin-CfBZjx2Q.js.map +1 -0
- package/dist/manifests-D0LwbJ36.js +866 -0
- package/dist/manifests-D0LwbJ36.js.map +1 -0
- package/dist/mcp.d.ts +2 -0
- package/dist/mcp.js +1 -0
- package/dist/monumentHall-awZiGtda.js +403 -0
- package/dist/monumentHall-awZiGtda.js.map +1 -0
- package/dist/node.d.ts +16 -0
- package/dist/node.js +26 -0
- package/dist/parts-DrEcfJRl.js +37 -0
- package/dist/parts-DrEcfJRl.js.map +1 -0
- package/dist/rolldown-runtime-D3KUYPsf.js +12 -0
- package/dist/ruinedCourtyard-DuF7NmUU.js +696 -0
- package/dist/ruinedCourtyard-DuF7NmUU.js.map +1 -0
- package/dist/runtime/application/AgentTools.js +28 -0
- package/dist/runtime/application/README.md +14 -0
- package/dist/runtime/application/agent/ProgressiveAgentTools.js +92 -0
- package/dist/runtime/application/agent/StudioMcpAllowlist.js +10 -0
- package/dist/runtime/application/agent/StudioProjectTools.js +18 -0
- package/dist/runtime/application/agent/TaskEvidence.js +199 -0
- package/dist/runtime/application/buildTaskObservation.js +117 -0
- package/dist/runtime/application/code-execution/AuthoringSandboxEntry.js +50 -0
- package/dist/runtime/application/code-execution/BrowserCodeExecutor.js +35 -0
- package/dist/runtime/application/code-execution/BrowserCodeWorker.js +17 -0
- package/dist/runtime/application/code-execution/RemoteAuthoringDocument.js +82 -0
- package/dist/runtime/application/createSession.js +66 -0
- package/dist/runtime/application/createWorldAuthoringContext.js +400 -0
- package/dist/runtime/application/generation/GenerationOrchestrator.js +630 -0
- package/dist/runtime/application/generation/GenerationRuntime.js +215 -0
- package/dist/runtime/application/generation/PromptHybridWorldOrchestrator.js +289 -0
- package/dist/runtime/application/native-scene/CodeProject.js +215 -0
- package/dist/runtime/application/native-scene/CodeProjectModules.js +143 -0
- package/dist/runtime/application/native-scene/ExampleWorldCatalog.js +35 -0
- package/dist/runtime/application/native-scene/NativeArticulation.js +53 -0
- package/dist/runtime/application/native-scene/NativeEditableRegistry.js +150 -0
- package/dist/runtime/application/native-scene/NativeEnvironmentGeometry.js +85 -0
- package/dist/runtime/application/native-scene/NativeLightingInspection.js +33 -0
- package/dist/runtime/application/native-scene/NativeMaterialInspection.js +52 -0
- package/dist/runtime/application/native-scene/NativeOverlayCheckpoint.js +127 -0
- package/dist/runtime/application/native-scene/NativePhysicsGeometry.js +64 -0
- package/dist/runtime/application/native-scene/NativeRenderDiscovery.js +51 -0
- package/dist/runtime/application/native-scene/NativeSceneHost.js +406 -0
- package/dist/runtime/application/native-scene/NativeSceneInspection.js +203 -0
- package/dist/runtime/application/native-scene/NativeSceneOverlay.js +116 -0
- package/dist/runtime/application/native-scene/NativeSceneQuery.js +123 -0
- package/dist/runtime/application/native-scene/NativeSceneReview.js +132 -0
- package/dist/runtime/application/native-scene/NativeThreeModule.js +16 -0
- package/dist/runtime/application/native-scene/SceneObserver.js +97 -0
- package/dist/runtime/application/native-scene/VisualCapturePolicy.js +4 -0
- package/dist/runtime/application/object-forge/SceneObjectForge.js +263 -0
- package/dist/runtime/application/programmatic-assets/ProgrammaticAssetBuilder.js +59 -0
- package/dist/runtime/application/programmatic-assets/ProgrammaticAssetContract.js +22 -0
- package/dist/runtime/application/programmatic-assets/ThreeCodeAsset.js +40 -0
- package/dist/runtime/application/scene/CapabilityResolver.js +90 -0
- package/dist/runtime/application/scene/NativeEditableContracts.js +18 -0
- package/dist/runtime/application/scene/RequestWindow.js +54 -0
- package/dist/runtime/application/scene/SceneAgentTools.js +21 -0
- package/dist/runtime/application/scene/SceneContracts.js +49 -0
- package/dist/runtime/application/scene/SceneEditService.js +154 -0
- package/dist/runtime/application/scene/SceneFacade.js +356 -0
- package/dist/runtime/application/scene/SceneInteractionAdapters.js +41 -0
- package/dist/runtime/application/scene/SceneJobController.js +320 -0
- package/dist/runtime/application/scene/SceneLifecycle.js +57 -0
- package/dist/runtime/application/scene/ScenePackage.js +173 -0
- package/dist/runtime/application/scene/ScenePersistence.js +50 -0
- package/dist/runtime/application/scene/SceneProject.js +95 -0
- package/dist/runtime/application/scene/SceneSkillNames.js +5 -0
- package/dist/runtime/application/scene/StarterScene.js +56 -0
- package/dist/runtime/application/scene/WorldArchive.js +89 -0
- package/dist/runtime/application/scene/WorldDirectory.js +20 -0
- package/dist/runtime/application/scene/WorldDocument.js +76 -0
- package/dist/runtime/application/scene/WorldIO.js +103 -0
- package/dist/runtime/application/scene/WorldStorage.js +155 -0
- package/dist/runtime/application/skills/SkillRegistry.js +193 -0
- package/dist/runtime/application/skills/packs/acceptanceSkills.js +32 -0
- package/dist/runtime/application/skills/packs/affordanceSkills.js +36 -0
- package/dist/runtime/application/skills/packs/assetSkills.js +46 -0
- package/dist/runtime/application/skills/packs/authoringSkills.js +16 -0
- package/dist/runtime/application/skills/packs/batchSkills.js +22 -0
- package/dist/runtime/application/skills/packs/codeSkills.js +106 -0
- package/dist/runtime/application/skills/packs/generationSkills.js +45 -0
- package/dist/runtime/application/skills/packs/interactionSkills.js +46 -0
- package/dist/runtime/application/skills/packs/recoverySkills.js +80 -0
- package/dist/runtime/application/skills/packs/sceneSkills.js +24 -0
- package/dist/runtime/application/skills/packs/spatialSkills.js +35 -0
- package/dist/runtime/application/skills/packs/verificationSkills.js +14 -0
- package/dist/runtime/application/skills/packs/worldSkills.js +45 -0
- package/dist/runtime/application/skills/registerCoreSkills.js +31 -0
- package/dist/runtime/application/skills/skillPrimitives.js +4 -0
- package/dist/runtime/application/tasks/CabinetCupTask.js +76 -0
- package/dist/runtime/application/tasks.jsonl +67 -0
- package/dist/runtime/application/world-authoring/AuthoringAssetProducer.js +42 -0
- package/dist/runtime/application/world-authoring/AuthoringDiff.js +149 -0
- package/dist/runtime/application/world-authoring/AuthoringDocument.js +825 -0
- package/dist/runtime/application/world-authoring/AuthoringExecutionHost.js +109 -0
- package/dist/runtime/application/world-authoring/AuthoringIdentity.js +17 -0
- package/dist/runtime/application/world-authoring/AuthoringModelResolver.js +29 -0
- package/dist/runtime/application/world-authoring/AuthoringPatch.js +118 -0
- package/dist/runtime/application/world-authoring/AuthoringPromotionController.js +334 -0
- package/dist/runtime/application/world-authoring/AuthoringPromotionSource.js +126 -0
- package/dist/runtime/application/world-authoring/AuthoringRevisionHistory.js +144 -0
- package/dist/runtime/application/world-authoring/HeadlessImageExport.js +92 -0
- package/dist/runtime/application/world-authoring/ModelRef.js +62 -0
- package/dist/runtime/application/world-authoring/SceneGLBExport.js +88 -0
- package/dist/runtime/apps/mcp-server/AUTHORING.md +71 -0
- package/dist/runtime/apps/mcp-server/AgentMcpCompat.js +68 -0
- package/dist/runtime/apps/mcp-server/AuthoringSandboxEntry.js +1 -0
- package/dist/runtime/apps/mcp-server/AuthoringSandboxWorker.mjs +30 -0
- package/dist/runtime/apps/mcp-server/BuildEnvironment.js +17 -0
- package/dist/runtime/apps/mcp-server/CodeExecutor.js +71 -0
- package/dist/runtime/apps/mcp-server/DEPLOYMENT-PC2.md +42 -0
- package/dist/runtime/apps/mcp-server/DockerBuildRunner.js +66 -0
- package/dist/runtime/apps/mcp-server/FileAssetRepository.js +159 -0
- package/dist/runtime/apps/mcp-server/HeadlessAssetIO.js +8 -0
- package/dist/runtime/apps/mcp-server/HeadlessGLTFLoader.js +47 -0
- package/dist/runtime/apps/mcp-server/HeadlessWorldHost.js +157 -0
- package/dist/runtime/apps/mcp-server/IsolatedAuthoringExecutor.js +6 -0
- package/dist/runtime/apps/mcp-server/PROGRAMMATIC-ASSETS.md +116 -0
- package/dist/runtime/apps/mcp-server/ProgrammaticAssets.js +60 -0
- package/dist/runtime/apps/mcp-server/README.md +269 -0
- package/dist/runtime/apps/mcp-server/RemoteAuthoringDocument.js +1 -0
- package/dist/runtime/apps/mcp-server/SandboxBundle.js +13 -0
- package/dist/runtime/apps/mcp-server/SessionManager.js +148 -0
- package/dist/runtime/apps/mcp-server/StudioBridgeHttp.js +75 -0
- package/dist/runtime/apps/mcp-server/StudioLiveBridge.js +246 -0
- package/dist/runtime/apps/mcp-server/StudioProjectToolContracts.js +58 -0
- package/dist/runtime/apps/mcp-server/TransferHttp.js +47 -0
- package/dist/runtime/apps/mcp-server/TransferLimits.js +6 -0
- package/dist/runtime/apps/mcp-server/TransferStore.js +134 -0
- package/dist/runtime/apps/mcp-server/TrustedAuthoringWorker.mjs +16 -0
- package/dist/runtime/apps/mcp-server/VALIDATION.md +45 -0
- package/dist/runtime/apps/mcp-server/acceptance-evidence.json +332 -0
- package/dist/runtime/apps/mcp-server/errorDiagnostics.js +32 -0
- package/dist/runtime/apps/mcp-server/examples/code-house.js +24 -0
- package/dist/runtime/apps/mcp-server/examples/procedural-assets.js +85 -0
- package/dist/runtime/apps/mcp-server/main.mjs +82 -0
- package/dist/runtime/apps/mcp-server/registerTools.js +274 -0
- package/dist/runtime/apps/mcp-server/sandbox/run.mjs +23 -0
- package/dist/runtime/apps/mcp-server/security.js +23 -0
- package/dist/runtime/apps/mcp-server/tasks.jsonl +9 -0
- package/dist/runtime/apps/server/CapabilityAdapterRegistry.js +157 -0
- package/dist/runtime/apps/server/README.md +7 -0
- package/dist/runtime/apps/server/WorldRepository.js +338 -0
- package/dist/runtime/apps/server/WorldRepositoryHttp.js +96 -0
- package/dist/runtime/apps/server/openai-compatible-agent-gateway.mjs +278 -0
- package/dist/runtime/apps/server/tasks.jsonl +10 -0
- package/dist/runtime/apps/shared/node/WorldDiskStorage.js +62 -0
- package/dist/runtime/foundation/EventBus.js +26 -0
- package/dist/runtime/foundation/JsonGateway.js +47 -0
- package/dist/runtime/foundation/PngRgba.js +99 -0
- package/dist/runtime/foundation/PolicyEngine.js +21 -0
- package/dist/runtime/foundation/README.md +7 -0
- package/dist/runtime/foundation/TraceRecorder.js +76 -0
- package/dist/runtime/foundation/errors.js +8 -0
- package/dist/runtime/foundation/simulation/SimulationProfile.js +143 -0
- package/dist/runtime/foundation/version.js +2 -0
- package/dist/runtime/modules/agent/README.md +11 -0
- package/dist/runtime/modules/agent/ToolCallingAgent.js +19 -0
- package/dist/runtime/modules/agent/bootstrapWorld.js +10 -0
- package/dist/runtime/modules/agent/buildRecoveryProposals.js +533 -0
- package/dist/runtime/modules/agent/execution/AgentExecutionRules.js +128 -0
- package/dist/runtime/modules/agent/execution/AgentRunResults.js +55 -0
- package/dist/runtime/modules/agent/execution/AgentRunSession.js +393 -0
- package/dist/runtime/modules/agent/execution/AgentToolInvoker.js +40 -0
- package/dist/runtime/modules/agent/gateway/HttpLLMGateway.js +19 -0
- package/dist/runtime/modules/agent/prompt/index.js +52 -0
- package/dist/runtime/modules/agent/tasks.jsonl +94 -0
- package/dist/runtime/modules/artifact/ArtifactContentGate.js +144 -0
- package/dist/runtime/modules/artifact/ArtifactDescriptor.js +280 -0
- package/dist/runtime/modules/artifact/ArtifactImporter.js +185 -0
- package/dist/runtime/modules/artifact/ArtifactModule.js +111 -0
- package/dist/runtime/modules/artifact/ArtifactRegistry.js +197 -0
- package/dist/runtime/modules/artifact/IncrementalSha256.js +129 -0
- package/dist/runtime/modules/artifact/MemoryArtifactByteStore.js +115 -0
- package/dist/runtime/modules/artifact/README.md +7 -0
- package/dist/runtime/modules/artifact/storage/IndexedDbArtifactStore.js +67 -0
- package/dist/runtime/modules/artifact/tasks.jsonl +31 -0
- package/dist/runtime/modules/asset/AssetModule.js +416 -0
- package/dist/runtime/modules/asset/README.md +67 -0
- package/dist/runtime/modules/asset/loading/AssetLoader.js +157 -0
- package/dist/runtime/modules/asset/loading/GltfAssetLoader.js +61 -0
- package/dist/runtime/modules/asset/loading/builtins/BuiltinAssets.js +95 -0
- package/dist/runtime/modules/asset/loading/builtins/HouseDoor.js +33 -0
- package/dist/runtime/modules/asset/loading/builtins/IndustrialCabinet.js +103 -0
- package/dist/runtime/modules/asset/model/AssetInputContracts.js +139 -0
- package/dist/runtime/modules/asset/model/AssetRef.js +12 -0
- package/dist/runtime/modules/asset/model/MechanicalAssetDraft.js +172 -0
- package/dist/runtime/modules/asset/model/ProceduralTextureContract.js +24 -0
- package/dist/runtime/modules/asset/model/admission.js +117 -0
- package/dist/runtime/modules/asset/model/errors.js +6 -0
- package/dist/runtime/modules/asset/model/parts.js +27 -0
- package/dist/runtime/modules/asset/model/resourceBudget.js +10 -0
- package/dist/runtime/modules/asset/model/schema.js +150 -0
- package/dist/runtime/modules/asset/persistence/AssetManifestStore.js +78 -0
- package/dist/runtime/modules/asset/persistence/CompiledAssetStore.js +84 -0
- package/dist/runtime/modules/asset/persistence/LocalAssetLibrary.js +86 -0
- package/dist/runtime/modules/asset/persistence/LocalAssetLibraryStore.js +81 -0
- package/dist/runtime/modules/asset/production/AssetProductionPipeline.js +272 -0
- package/dist/runtime/modules/asset/production/AssetRecipe.js +91 -0
- package/dist/runtime/modules/asset/production/ProceduralTexture.js +85 -0
- package/dist/runtime/modules/asset/production/adapters/EmbodiedGenAdapter.js +45 -0
- package/dist/runtime/modules/asset/production/adapters/EmbodiedGenBundleAdapter.js +590 -0
- package/dist/runtime/modules/asset/production/compiler/AssetCompiler.js +173 -0
- package/dist/runtime/modules/asset/production/compiler/evidence/AnimationMotionEvidence.js +124 -0
- package/dist/runtime/modules/asset/production/compiler/evidence/StaticPanelEvidence.js +56 -0
- package/dist/runtime/modules/asset/production/compiler/gltfIO.js +6 -0
- package/dist/runtime/modules/asset/production/compiler/partGeometry.js +74 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ArticulatedCollisionPass.js +63 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ArticulationCandidatePass.js +48 -0
- package/dist/runtime/modules/asset/production/compiler/passes/AuthoringIntentPass.js +16 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ColliderFallbackPass.js +30 -0
- package/dist/runtime/modules/asset/production/compiler/passes/CompileQualityPass.js +75 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ExplicitDefinitionPass.js +20 -0
- package/dist/runtime/modules/asset/production/compiler/passes/GLTFInspectPass.js +34 -0
- package/dist/runtime/modules/asset/production/compiler/passes/GeometryPass.js +32 -0
- package/dist/runtime/modules/asset/production/compiler/passes/JointFramePass.js +116 -0
- package/dist/runtime/modules/asset/production/compiler/passes/KinematicEvidencePass.js +84 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ManifestPass.js +63 -0
- package/dist/runtime/modules/asset/production/compiler/passes/NormalizeTransformPass.js +16 -0
- package/dist/runtime/modules/asset/production/compiler/passes/OptimizeGLBPass.js +23 -0
- package/dist/runtime/modules/asset/production/compiler/passes/PartColliderPass.js +50 -0
- package/dist/runtime/modules/asset/production/compiler/passes/PartGeometryEnrichmentPass.js +60 -0
- package/dist/runtime/modules/asset/production/compiler/passes/PartProposalPass.js +93 -0
- package/dist/runtime/modules/asset/production/compiler/passes/RemoteEnrichmentPass.js +32 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ResourceBudgetPass.js +55 -0
- package/dist/runtime/modules/asset/production/compiler/passes/SegmentMaterializePass.js +203 -0
- package/dist/runtime/modules/asset/production/compiler/passes/SegmentationEvidencePass.js +43 -0
- package/dist/runtime/modules/asset/production/compiler/passes/SemanticHeuristicPass.js +33 -0
- package/dist/runtime/modules/asset/production/compiler/passes/StructurePass.js +60 -0
- package/dist/runtime/modules/asset/production/compiler/providers/HttpCompilerProvider.js +23 -0
- package/dist/runtime/modules/asset/production/verification/KinematicHypothesisScreen.js +198 -0
- package/dist/runtime/modules/asset/registry/AssetCatalog.js +72 -0
- package/dist/runtime/modules/asset/registry/AssetRegistry.js +51 -0
- package/dist/runtime/modules/asset/registry/manifests/index.js +173 -0
- package/dist/runtime/modules/asset/tasks.jsonl +87 -0
- package/dist/runtime/modules/generation/README.md +9 -0
- package/dist/runtime/modules/generation/connector/ConnectorArtifactClient.js +45 -0
- package/dist/runtime/modules/generation/connector/ConnectorCapabilityAdapter.js +169 -0
- package/dist/runtime/modules/generation/connector/ConnectorClient.js +192 -0
- package/dist/runtime/modules/generation/connector/ConnectorJobClient.js +167 -0
- package/dist/runtime/modules/generation/connector/ConnectorJobEventClient.js +179 -0
- package/dist/runtime/modules/generation/connector/ConnectorSession.js +202 -0
- package/dist/runtime/modules/generation/jobs/GenerationJobProjection.js +239 -0
- package/dist/runtime/modules/generation/jobs/GenerationJobReconciler.js +99 -0
- package/dist/runtime/modules/generation/jobs/GenerationJobStore.js +91 -0
- package/dist/runtime/modules/generation/jobs/GenerationJobTransportOverlay.js +50 -0
- package/dist/runtime/modules/generation/providers/ProviderRegistry.js +304 -0
- package/dist/runtime/modules/generation/tasks.jsonl +35 -0
- package/dist/runtime/modules/navigation/NavigationBackend.js +17 -0
- package/dist/runtime/modules/navigation/RecastNavigationBackend.js +263 -0
- package/dist/runtime/modules/physics/JoltPhysicsBackend.js +850 -0
- package/dist/runtime/modules/physics/PhysicsApiSurface.js +660 -0
- package/dist/runtime/modules/physics/PhysicsBackend.js +88 -0
- package/dist/runtime/modules/physics/RapierPhysicsBackend.js +414 -0
- package/dist/runtime/modules/rendering/README.md +7 -0
- package/dist/runtime/modules/rendering/RendererProbe.js +153 -0
- package/dist/runtime/modules/rendering/WebGpuPostFxPipeline.js +140 -0
- package/dist/runtime/modules/rendering/captureStill.js +54 -0
- package/dist/runtime/modules/rendering/createRenderer.js +76 -0
- package/dist/runtime/modules/rendering/disposeObject3D.js +37 -0
- package/dist/runtime/modules/rendering/loadGaussianSplatVisual.js +74 -0
- package/dist/runtime/modules/rendering/spatial/ThreeBvhRuntime.js +107 -0
- package/dist/runtime/modules/rendering/style/StylePack.js +34 -0
- package/dist/runtime/modules/rendering/style/StyleSystem.js +173 -0
- package/dist/runtime/modules/rendering/tasks.jsonl +7 -0
- package/dist/runtime/modules/world/README.md +13 -0
- package/dist/runtime/modules/world/build/WorldBuilder.js +170 -0
- package/dist/runtime/modules/world/compiler/PipelineEngine.js +32 -0
- package/dist/runtime/modules/world/compiler/WorldAdmission.js +43 -0
- package/dist/runtime/modules/world/compiler/WorldBehaviorCompiler.js +68 -0
- package/dist/runtime/modules/world/compiler/WorldCompilation.js +157 -0
- package/dist/runtime/modules/world/compiler/WorldComposer.js +201 -0
- package/dist/runtime/modules/world/compiler/WorldPhysicsAdmission.js +76 -0
- package/dist/runtime/modules/world/compiler/WorldRecompiler.js +356 -0
- package/dist/runtime/modules/world/compiler/WorldRetry.js +75 -0
- package/dist/runtime/modules/world/compiler/createWorldPipeline.js +379 -0
- package/dist/runtime/modules/world/content/blankWorld.js +35 -0
- package/dist/runtime/modules/world/content/environments.js +84 -0
- package/dist/runtime/modules/world/content/grandUrbanBlock.js +189 -0
- package/dist/runtime/modules/world/content/magic-cabin/README.md +28 -0
- package/dist/runtime/modules/world/content/magic-cabin/affordances.js +64 -0
- package/dist/runtime/modules/world/content/magic-cabin/cabinContents.js +7078 -0
- package/dist/runtime/modules/world/content/magic-cabin/lighting.js +26 -0
- package/dist/runtime/modules/world/content/magic-cabin/materials.js +20 -0
- package/dist/runtime/modules/world/content/magicCabin.js +190 -0
- package/dist/runtime/modules/world/content/monumentHall.js +154 -0
- package/dist/runtime/modules/world/content/ruinedCourtyard.js +196 -0
- package/dist/runtime/modules/world/content/suzhouGarden/README.md +141 -0
- package/dist/runtime/modules/world/content/suzhouGarden/index.js +137 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/arch.js +491 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/buildings.js +670 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/core.js +578 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/lod.js +127 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/main.js +642 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/nature.js +650 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/rockery.js +280 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/sky.js +242 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/water.js +215 -0
- package/dist/runtime/modules/world/content/woodlandWorkshop.js +192 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/README.md +36 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/arch.js +351 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/buildings.js +490 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/core.js +505 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/index.js +101 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/nature.js +435 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/sky.js +169 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/water.js +245 -0
- package/dist/runtime/modules/world/errors.js +9 -0
- package/dist/runtime/modules/world/generated/GeneratedWorldCoordinates.js +50 -0
- package/dist/runtime/modules/world/generated/GeneratedWorldLoader.js +297 -0
- package/dist/runtime/modules/world/runtime/CommandHistory.js +111 -0
- package/dist/runtime/modules/world/runtime/EntityCapabilityRegistry.js +165 -0
- package/dist/runtime/modules/world/runtime/NativeNavigationGeometry.js +84 -0
- package/dist/runtime/modules/world/runtime/NativePhysicsSnapshot.js +245 -0
- package/dist/runtime/modules/world/runtime/ObjectStore.js +31 -0
- package/dist/runtime/modules/world/runtime/ObjectTransform.js +62 -0
- package/dist/runtime/modules/world/runtime/ObservedEntity.js +37 -0
- package/dist/runtime/modules/world/runtime/ProjectCapabilities.js +240 -0
- package/dist/runtime/modules/world/runtime/SceneExtensions.js +36 -0
- package/dist/runtime/modules/world/runtime/ScenePresentation.js +101 -0
- package/dist/runtime/modules/world/runtime/SceneSerializer.js +281 -0
- package/dist/runtime/modules/world/runtime/WorldAuthority.js +41 -0
- package/dist/runtime/modules/world/runtime/WorldCollisionSignature.js +14 -0
- package/dist/runtime/modules/world/runtime/WorldCommands.js +503 -0
- package/dist/runtime/modules/world/runtime/WorldObservation.js +71 -0
- package/dist/runtime/modules/world/runtime/WorldQueries.js +340 -0
- package/dist/runtime/modules/world/runtime/WorldRecovery.js +78 -0
- package/dist/runtime/modules/world/runtime/WorldRuntime.js +806 -0
- package/dist/runtime/modules/world/runtime/affordance/ObjectAffordances.js +110 -0
- package/dist/runtime/modules/world/runtime/affordance/WorldAffordances.js +130 -0
- package/dist/runtime/modules/world/runtime/behavior/BehaviorCompiler.js +79 -0
- package/dist/runtime/modules/world/runtime/behavior/ProjectStateMachine.js +195 -0
- package/dist/runtime/modules/world/runtime/behavior/RuleGraph.js +70 -0
- package/dist/runtime/modules/world/runtime/behavior/RuleRuntime.js +115 -0
- package/dist/runtime/modules/world/runtime/graph/SceneGraph.js +390 -0
- package/dist/runtime/modules/world/runtime/interaction/ArticulationRuntime.js +214 -0
- package/dist/runtime/modules/world/runtime/interaction/CarryCapability.js +65 -0
- package/dist/runtime/modules/world/runtime/interaction/CarryRuntime.js +244 -0
- package/dist/runtime/modules/world/runtime/interaction/InteractionApproach.js +147 -0
- package/dist/runtime/modules/world/runtime/interaction/InteractionContract.js +57 -0
- package/dist/runtime/modules/world/runtime/interaction/ManipulationActions.js +7 -0
- package/dist/runtime/modules/world/runtime/interaction/NativePhysicalTarget.js +31 -0
- package/dist/runtime/modules/world/runtime/interaction/RecoveryRuntime.js +123 -0
- package/dist/runtime/modules/world/runtime/interaction/SettleRuntime.js +134 -0
- package/dist/runtime/modules/world/runtime/semantic/NativePhysicsState.js +89 -0
- package/dist/runtime/modules/world/runtime/semantic/SemanticWorldView.js +129 -0
- package/dist/runtime/modules/world/runtime/simulation/SimulationClock.js +89 -0
- package/dist/runtime/modules/world/runtime/simulation/SimulationSession.js +104 -0
- package/dist/runtime/modules/world/runtime/simulation/ThermalSystem.js +269 -0
- package/dist/runtime/modules/world/runtime/simulation/WorldTimeline.js +110 -0
- package/dist/runtime/modules/world/runtime/spatial/SpatialSnapshot.js +56 -0
- package/dist/runtime/modules/world/runtime/spatial/VisualMeshBounds.js +41 -0
- package/dist/runtime/modules/world/runtime/systems/AudioSystem.js +306 -0
- package/dist/runtime/modules/world/runtime/systems/Instrument.js +39 -0
- package/dist/runtime/modules/world/runtime/systems/InteractionSystem.js +806 -0
- package/dist/runtime/modules/world/runtime/systems/LocomotionSystem.js +281 -0
- package/dist/runtime/modules/world/runtime/systems/NavigationSystem.js +561 -0
- package/dist/runtime/modules/world/runtime/systems/PhysicsSystem.js +1752 -0
- package/dist/runtime/modules/world/runtime/systems/RenderingSystem.js +527 -0
- package/dist/runtime/modules/world/runtime/systems/SpatialSystem.js +402 -0
- package/dist/runtime/modules/world/spec/WorldIR.js +165 -0
- package/dist/runtime/modules/world/spec/WorldIRToolSchema.js +86 -0
- package/dist/runtime/modules/world/spec/WorldPlannerProposal.js +51 -0
- package/dist/runtime/modules/world/spec/WorldRevision.js +231 -0
- package/dist/runtime/modules/world/spec/WorldSpec.js +86 -0
- package/dist/runtime/modules/world/tasks.jsonl +530 -0
- package/dist/runtime/modules/world/verification/ArticulationVerifier.js +254 -0
- package/dist/runtime/modules/world/verification/Finding.js +105 -0
- package/dist/runtime/modules/world/verification/InteractionEvidence.js +73 -0
- package/dist/runtime/modules/world/verification/RepairEngine.js +49 -0
- package/dist/runtime/modules/world/verification/VisualLayoutAcceptance.js +58 -0
- package/dist/runtime/modules/world/verification/WorldAcceptance.js +176 -0
- package/dist/runtime/modules/world/verification/WorldValidator.js +67 -0
- package/dist/runtime/package-lock.json +16071 -0
- package/dist/runtime/package.json +106 -0
- package/dist/runtime/public/assets/cabinet.glb +0 -0
- package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_nor_gl_1k.jpg +0 -0
- package/dist/runtime/public/assets/grand-urban-block/concrete_pavement_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/grand-urban-block/urban_street_01_1k.hdr +0 -0
- package/dist/runtime/public/assets/monument-hall/marble_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/monument-hall/marble_nor_gl_1k.jpg +0 -0
- package/dist/runtime/public/assets/monument-hall/marble_rough_1k.jpg +0 -0
- package/dist/runtime/public/assets/monument-hall/solitude_interior_1k.hdr +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/courtyard_1k.hdr +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_nor_gl_1k.jpg +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/mossy_sandstone_diff_1k.jpg +0 -0
- package/dist/schema-DT7K9NjP.js +165 -0
- package/dist/schema-DT7K9NjP.js.map +1 -0
- package/dist/suzhouGarden-Y3hny8j6.js +6150 -0
- package/dist/suzhouGarden-Y3hny8j6.js.map +1 -0
- package/dist/version-CHc-i8ch.js +5 -0
- package/dist/version-CHc-i8ch.js.map +1 -0
- package/dist/woodlandWorkshop-DsScU-cx.js +483 -0
- package/dist/woodlandWorkshop-DsScU-cx.js.map +1 -0
- package/dist/yuanmingyuan-DsFnPzzR.js +4955 -0
- package/dist/yuanmingyuan-DsFnPzzR.js.map +1 -0
- package/package.json +75 -4
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.js";
|
|
2
|
+
import { d as recipeSchema, m as proceduralTextureSchema, p as PROCEDURAL_TEXTURE_PALETTES, t as createAssetGLTFIO } from "./gltfIO-BzVKLyaL.js";
|
|
3
|
+
import { BoxGeometry, Color, CylinderGeometry, ExtrudeGeometry, Path, Quaternion, Shape, SphereGeometry, Vector3 } from "three";
|
|
4
|
+
import { Document } from "@gltf-transform/core";
|
|
5
|
+
import { KHRMaterialsClearcoat, KHRMaterialsEmissiveStrength, KHRMaterialsIOR, KHRMaterialsTransmission } from "@gltf-transform/extensions";
|
|
6
|
+
// foundation/PngRgba.js
|
|
7
|
+
const PNG_SIGNATURE = new Uint8Array([
|
|
8
|
+
137,
|
|
9
|
+
80,
|
|
10
|
+
78,
|
|
11
|
+
71,
|
|
12
|
+
13,
|
|
13
|
+
10,
|
|
14
|
+
26,
|
|
15
|
+
10
|
|
16
|
+
]);
|
|
17
|
+
const ZLIB_HEADER = new Uint8Array([120, 1]);
|
|
18
|
+
const STORED_BLOCK_MAX = 65535;
|
|
19
|
+
const CRC_TABLE = (() => {
|
|
20
|
+
const table = /* @__PURE__ */ new Uint32Array(256);
|
|
21
|
+
for (let n = 0; n < 256; n++) {
|
|
22
|
+
let c = n;
|
|
23
|
+
for (let k = 0; k < 8; k++) c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
24
|
+
table[n] = c >>> 0;
|
|
25
|
+
}
|
|
26
|
+
return table;
|
|
27
|
+
})();
|
|
28
|
+
function crc32(bytes, start, end) {
|
|
29
|
+
let crc = 4294967295;
|
|
30
|
+
for (let i = start; i < end; i++) crc = CRC_TABLE[(crc ^ bytes[i]) & 255] ^ crc >>> 8;
|
|
31
|
+
return (crc ^ 4294967295) >>> 0;
|
|
32
|
+
}
|
|
33
|
+
function adler32(bytes) {
|
|
34
|
+
let a = 1;
|
|
35
|
+
let b = 0;
|
|
36
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
37
|
+
a = (a + bytes[i]) % 65521;
|
|
38
|
+
b = (b + a) % 65521;
|
|
39
|
+
}
|
|
40
|
+
return (b << 16 | a) >>> 0;
|
|
41
|
+
}
|
|
42
|
+
function concat(parts) {
|
|
43
|
+
let length = 0;
|
|
44
|
+
for (const part of parts) length += part.length;
|
|
45
|
+
const out = new Uint8Array(length);
|
|
46
|
+
let offset = 0;
|
|
47
|
+
for (const part of parts) {
|
|
48
|
+
out.set(part, offset);
|
|
49
|
+
offset += part.length;
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
function pngChunk(type, data) {
|
|
54
|
+
const out = new Uint8Array(12 + data.length);
|
|
55
|
+
const view = new DataView(out.buffer);
|
|
56
|
+
view.setUint32(0, data.length);
|
|
57
|
+
for (let i = 0; i < 4; i++) out[4 + i] = type.charCodeAt(i);
|
|
58
|
+
out.set(data, 8);
|
|
59
|
+
view.setUint32(8 + data.length, crc32(out, 4, 8 + data.length));
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
function zlibStored(raw) {
|
|
63
|
+
const parts = [ZLIB_HEADER];
|
|
64
|
+
const blocks = Math.max(1, Math.ceil(raw.length / STORED_BLOCK_MAX));
|
|
65
|
+
for (let i = 0; i < blocks; i++) {
|
|
66
|
+
const start = i * STORED_BLOCK_MAX;
|
|
67
|
+
const length = Math.min(STORED_BLOCK_MAX, raw.length - start);
|
|
68
|
+
const header = /* @__PURE__ */ new Uint8Array(5);
|
|
69
|
+
header[0] = i === blocks - 1 ? 1 : 0;
|
|
70
|
+
header[1] = length & 255;
|
|
71
|
+
header[2] = length >>> 8 & 255;
|
|
72
|
+
header[3] = ~length & 255;
|
|
73
|
+
header[4] = ~length >>> 8 & 255;
|
|
74
|
+
parts.push(header, raw.subarray(start, start + length));
|
|
75
|
+
}
|
|
76
|
+
const checksum = /* @__PURE__ */ new Uint8Array(4);
|
|
77
|
+
new DataView(checksum.buffer).setUint32(0, adler32(raw));
|
|
78
|
+
parts.push(checksum);
|
|
79
|
+
return concat(parts);
|
|
80
|
+
}
|
|
81
|
+
function encodePngRgba(rgba, width, height) {
|
|
82
|
+
if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) throw new TypeError("PNG dimensions must be positive integers");
|
|
83
|
+
if (rgba.length !== width * height * 4) throw new TypeError(`RGBA buffer must contain ${width * height * 4} bytes`);
|
|
84
|
+
const stride = width * 4;
|
|
85
|
+
const raw = new Uint8Array(height * (stride + 1));
|
|
86
|
+
for (let y = 0; y < height; y++) {
|
|
87
|
+
raw[y * (stride + 1)] = 0;
|
|
88
|
+
raw.set(rgba.subarray(y * stride, (y + 1) * stride), y * (stride + 1) + 1);
|
|
89
|
+
}
|
|
90
|
+
const ihdr = /* @__PURE__ */ new Uint8Array(13);
|
|
91
|
+
const view = new DataView(ihdr.buffer);
|
|
92
|
+
view.setUint32(0, width);
|
|
93
|
+
view.setUint32(4, height);
|
|
94
|
+
ihdr[8] = 8;
|
|
95
|
+
ihdr[9] = 6;
|
|
96
|
+
return concat([
|
|
97
|
+
PNG_SIGNATURE,
|
|
98
|
+
pngChunk("IHDR", ihdr),
|
|
99
|
+
pngChunk("IDAT", zlibStored(raw)),
|
|
100
|
+
pngChunk("IEND", /* @__PURE__ */ new Uint8Array(0))
|
|
101
|
+
]);
|
|
102
|
+
}
|
|
103
|
+
// modules/asset/production/ProceduralTexture.js
|
|
104
|
+
const TAU = 2 * Math.PI;
|
|
105
|
+
const clamp = (v) => Math.max(0, Math.min(1, v));
|
|
106
|
+
const lerp = (a, b, t) => a + (b - a) * t;
|
|
107
|
+
const smooth = (t) => t * t * (3 - 2 * t);
|
|
108
|
+
const wrap = (n, p) => (n % p + p) % p;
|
|
109
|
+
const rgb = (hex) => [
|
|
110
|
+
1,
|
|
111
|
+
3,
|
|
112
|
+
5
|
|
113
|
+
].map((i) => parseInt(hex.slice(i, i + 2), 16));
|
|
114
|
+
function hash(x, y, seed) {
|
|
115
|
+
let n = (Math.imul(x + 1, 2654435761) ^ Math.imul(y + 1, 2246822507) ^ seed) >>> 0;
|
|
116
|
+
n = Math.imul(n ^ n >>> 16, 2146121005);
|
|
117
|
+
n = Math.imul(n ^ n >>> 15, 2221713035);
|
|
118
|
+
return ((n ^ n >>> 16) >>> 0) / 4294967295;
|
|
119
|
+
}
|
|
120
|
+
function noise(u, v, px, py, seed) {
|
|
121
|
+
const x = u * px, y = v * py, ix = Math.floor(x), iy = Math.floor(y);
|
|
122
|
+
const tx = smooth(x - ix), ty = smooth(y - iy);
|
|
123
|
+
const sample = (a, b) => hash(wrap(a, px), wrap(b, py), seed);
|
|
124
|
+
return lerp(lerp(sample(ix, iy), sample(ix + 1, iy), tx), lerp(sample(ix, iy + 1), sample(ix + 1, iy + 1), tx), ty);
|
|
125
|
+
}
|
|
126
|
+
function samplePattern({ pattern, seed, frequency: f }, u, v) {
|
|
127
|
+
const n = (x, y, s = 0) => noise(u, v, x * f, y * f, seed + s >>> 0);
|
|
128
|
+
if (pattern === "wood") {
|
|
129
|
+
const distortion = n(3, 2, 17);
|
|
130
|
+
const grain = .5 + .5 * Math.sin(TAU * (u * 9 * f + distortion * .8 + n(12, 3, 31) * .13));
|
|
131
|
+
return clamp(.48 * grain + .38 * n(20, 3) + .14 * n(45, 5, 5));
|
|
132
|
+
}
|
|
133
|
+
if (pattern === "stone") return clamp(.5 * n(5, 5) + .3 * n(13, 13, 13) + .2 * n(37, 37, 23));
|
|
134
|
+
if (pattern === "fabric") {
|
|
135
|
+
const a = Math.sin(TAU * u * 8 * f), b = Math.sin(TAU * v * 8 * f);
|
|
136
|
+
const weave = .5 + .5 * a * b;
|
|
137
|
+
return clamp(.72 * weave + .28 * n(23, 23, 11));
|
|
138
|
+
}
|
|
139
|
+
return clamp(.72 * n(42, 3) + .2 * n(18, 2, 19) + .08 * n(12, 12, 7));
|
|
140
|
+
}
|
|
141
|
+
/** Pure, bounded, reproducible UV texture generation. No renderer or network. */
|
|
142
|
+
function generateProceduralTexture(input) {
|
|
143
|
+
const spec = proceduralTextureSchema.parse(input), size = spec.resolution;
|
|
144
|
+
const palette = PROCEDURAL_TEXTURE_PALETTES[spec.pattern];
|
|
145
|
+
const dark = rgb(spec.darkColor ?? palette[0]), light = rgb(spec.lightColor ?? palette[1]);
|
|
146
|
+
const height = new Float32Array(size * size);
|
|
147
|
+
const base = new Uint8Array(size * size * 4);
|
|
148
|
+
const normal = spec.normalStrength ? new Uint8Array(base.length) : null;
|
|
149
|
+
for (let y = 0; y < size; y++) for (let x = 0; x < size; x++) {
|
|
150
|
+
const i = y * size + x, t = samplePattern(spec, (x + .5) / size, (y + .5) / size);
|
|
151
|
+
height[i] = t;
|
|
152
|
+
const shade = lerp(.5, t, spec.contrast);
|
|
153
|
+
for (let c = 0; c < 3; c++) base[i * 4 + c] = Math.round(lerp(dark[c], light[c], shade));
|
|
154
|
+
base[i * 4 + 3] = 255;
|
|
155
|
+
}
|
|
156
|
+
if (normal) {
|
|
157
|
+
const at = (x, y) => height[wrap(y, size) * size + wrap(x, size)];
|
|
158
|
+
for (let y = 0; y < size; y++) for (let x = 0; x < size; x++) {
|
|
159
|
+
const i = (y * size + x) * 4;
|
|
160
|
+
const nx = -(at(x + 1, y) - at(x - 1, y)) * spec.normalStrength * 4;
|
|
161
|
+
const ny = (at(x, y + 1) - at(x, y - 1)) * spec.normalStrength * 4;
|
|
162
|
+
const len = Math.hypot(nx, ny, 1);
|
|
163
|
+
normal.set([
|
|
164
|
+
Math.round((nx / len * .5 + .5) * 255),
|
|
165
|
+
Math.round((ny / len * .5 + .5) * 255),
|
|
166
|
+
Math.round((1 / len * .5 + .5) * 255),
|
|
167
|
+
255
|
|
168
|
+
], i);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return {
|
|
172
|
+
size,
|
|
173
|
+
baseColor: encodePngRgba(base, size, size),
|
|
174
|
+
normal: normal ? encodePngRgba(normal, size, size) : null
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/** Cache only within a single compile; the GLB owns the generated bytes. */
|
|
178
|
+
function attachProceduralTexture(document, material, spec, cache) {
|
|
179
|
+
const key = JSON.stringify(spec);
|
|
180
|
+
let textures = cache.get(key);
|
|
181
|
+
if (!textures) {
|
|
182
|
+
const { baseColor, normal } = generateProceduralTexture(spec);
|
|
183
|
+
textures = {
|
|
184
|
+
base: document.createTexture(spec.pattern + "-color").setMimeType("image/png").setImage(baseColor),
|
|
185
|
+
normal: normal ? document.createTexture(spec.pattern + "-normal").setMimeType("image/png").setImage(normal) : null
|
|
186
|
+
};
|
|
187
|
+
cache.set(key, textures);
|
|
188
|
+
}
|
|
189
|
+
material.setBaseColorTexture(textures.base);
|
|
190
|
+
if (textures.normal) material.setNormalTexture(textures.normal);
|
|
191
|
+
}
|
|
192
|
+
// modules/asset/production/AssetRecipe.js
|
|
193
|
+
var AssetRecipe_exports = /* @__PURE__ */ __exportAll({ compileRecipeGeometry: () => compileRecipeGeometry });
|
|
194
|
+
function createPartGeometry(spec) {
|
|
195
|
+
if (spec.type === "box") return new BoxGeometry(...spec.size);
|
|
196
|
+
if (spec.type === "perforated-box") {
|
|
197
|
+
const [width, height, depth] = spec.size;
|
|
198
|
+
const shape = new Shape();
|
|
199
|
+
shape.moveTo(-width / 2, -depth / 2);
|
|
200
|
+
shape.lineTo(width / 2, -depth / 2);
|
|
201
|
+
shape.lineTo(width / 2, depth / 2);
|
|
202
|
+
shape.lineTo(-width / 2, depth / 2);
|
|
203
|
+
shape.closePath();
|
|
204
|
+
for (const { center: [x, z], radius } of spec.holes) {
|
|
205
|
+
const hole = new Path();
|
|
206
|
+
hole.absarc(x, -z, radius, 0, 2 * Math.PI, true);
|
|
207
|
+
shape.holes.push(hole);
|
|
208
|
+
}
|
|
209
|
+
return new ExtrudeGeometry(shape, {
|
|
210
|
+
depth: height,
|
|
211
|
+
bevelEnabled: false,
|
|
212
|
+
steps: 1,
|
|
213
|
+
curveSegments: 12
|
|
214
|
+
}).rotateX(-Math.PI / 2).translate(0, -height / 2, 0);
|
|
215
|
+
}
|
|
216
|
+
if (spec.type === "sphere") return new SphereGeometry(spec.radius, 16, 12);
|
|
217
|
+
if (spec.type === "ellipsoid") return new SphereGeometry(1, 20, 14).scale(...spec.radii);
|
|
218
|
+
if (spec.type === "cylinder") return new CylinderGeometry(spec.radius, spec.radius, spec.height, 16);
|
|
219
|
+
if (spec.type === "tapered-cylinder") return new CylinderGeometry(spec.radiusTop, spec.radiusBottom, spec.height, 16);
|
|
220
|
+
const from = new Vector3(...spec.from), to = new Vector3(...spec.to);
|
|
221
|
+
const direction = to.clone().sub(from);
|
|
222
|
+
const geometry = new CylinderGeometry(spec.radiusEnd, spec.radiusStart, direction.length(), 12);
|
|
223
|
+
geometry.applyQuaternion(new Quaternion().setFromUnitVectors(new Vector3(0, 1, 0), direction.normalize()));
|
|
224
|
+
geometry.translate(...from.add(to).multiplyScalar(.5).toArray());
|
|
225
|
+
return geometry;
|
|
226
|
+
}
|
|
227
|
+
/** Trusted compiler implementation for a bounded declarative language. */
|
|
228
|
+
async function compileRecipeGeometry(input) {
|
|
229
|
+
const recipe = recipeSchema.parse(input);
|
|
230
|
+
const document = new Document(), buffer = document.createBuffer();
|
|
231
|
+
const scene = document.createScene("Recipe");
|
|
232
|
+
document.getRoot().setDefaultScene(scene);
|
|
233
|
+
const nodes = /* @__PURE__ */ new Map(), textures = /* @__PURE__ */ new Map();
|
|
234
|
+
for (const part of recipe.parts) {
|
|
235
|
+
const node = document.createNode(part.id).setTranslation(part.position).setRotation(part.quaternion).setScale([
|
|
236
|
+
part.scale,
|
|
237
|
+
part.scale,
|
|
238
|
+
part.scale
|
|
239
|
+
]);
|
|
240
|
+
nodes.set(part.id, node);
|
|
241
|
+
if (!part.geometry) continue;
|
|
242
|
+
const spec = part.geometry;
|
|
243
|
+
const geometry = createPartGeometry(spec);
|
|
244
|
+
try {
|
|
245
|
+
const primitive = document.createPrimitive();
|
|
246
|
+
for (const [attribute, semantic] of [
|
|
247
|
+
["position", "POSITION"],
|
|
248
|
+
["normal", "NORMAL"],
|
|
249
|
+
["uv", "TEXCOORD_0"]
|
|
250
|
+
]) {
|
|
251
|
+
const data = geometry.getAttribute(attribute);
|
|
252
|
+
if (data) primitive.setAttribute(semantic, document.createAccessor().setType(data.itemSize === 2 ? "VEC2" : "VEC3").setArray(data.array.slice()).setBuffer(buffer));
|
|
253
|
+
}
|
|
254
|
+
if (geometry.index) primitive.setIndices(document.createAccessor().setType("SCALAR").setArray(geometry.index.array.slice()).setBuffer(buffer));
|
|
255
|
+
const color = new Color(part.material?.color || "#aaaaaa");
|
|
256
|
+
const opacity = part.material?.opacity ?? 1;
|
|
257
|
+
const material = document.createMaterial().setBaseColorFactor([
|
|
258
|
+
color.r,
|
|
259
|
+
color.g,
|
|
260
|
+
color.b,
|
|
261
|
+
opacity
|
|
262
|
+
]).setRoughnessFactor(part.material?.roughness ?? .7).setMetallicFactor(part.material?.metalness ?? 0);
|
|
263
|
+
if (opacity < 1) material.setAlphaMode("BLEND");
|
|
264
|
+
if (part.material?.emissive) material.setEmissiveFactor(new Color(part.material.emissive).toArray());
|
|
265
|
+
if (part.material?.doubleSided) material.setDoubleSided(true);
|
|
266
|
+
const surface = part.material;
|
|
267
|
+
if (surface?.clearcoat !== void 0 || surface?.clearcoatRoughness !== void 0) {
|
|
268
|
+
const ext = document.createExtension(KHRMaterialsClearcoat);
|
|
269
|
+
material.setExtension(ext.extensionName, ext.createClearcoat().setClearcoatFactor(surface.clearcoat ?? 0).setClearcoatRoughnessFactor(surface.clearcoatRoughness ?? 0));
|
|
270
|
+
}
|
|
271
|
+
if (surface?.transmission !== void 0) {
|
|
272
|
+
const ext = document.createExtension(KHRMaterialsTransmission);
|
|
273
|
+
material.setExtension(ext.extensionName, ext.createTransmission().setTransmissionFactor(surface.transmission));
|
|
274
|
+
}
|
|
275
|
+
if (surface?.ior !== void 0) {
|
|
276
|
+
const ext = document.createExtension(KHRMaterialsIOR);
|
|
277
|
+
material.setExtension(ext.extensionName, ext.createIOR().setIOR(surface.ior));
|
|
278
|
+
}
|
|
279
|
+
if (surface?.emissiveIntensity !== void 0) {
|
|
280
|
+
const ext = document.createExtension(KHRMaterialsEmissiveStrength);
|
|
281
|
+
material.setExtension(ext.extensionName, ext.createEmissiveStrength().setEmissiveStrength(surface.emissiveIntensity));
|
|
282
|
+
}
|
|
283
|
+
if (surface?.texture) attachProceduralTexture(document, material, surface.texture, textures);
|
|
284
|
+
primitive.setMaterial(material);
|
|
285
|
+
node.setMesh(document.createMesh(part.id).addPrimitive(primitive));
|
|
286
|
+
} finally {
|
|
287
|
+
geometry.dispose();
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
for (const part of recipe.parts) (part.parent ? nodes.get(part.parent) : scene).addChild(nodes.get(part.id));
|
|
291
|
+
return {
|
|
292
|
+
recipe,
|
|
293
|
+
bytes: await createAssetGLTFIO().writeBinary(document)
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
export { compileRecipeGeometry as n, encodePngRgba as r, AssetRecipe_exports as t };
|
|
297
|
+
|
|
298
|
+
//# sourceMappingURL=AssetRecipe-g8dZBhgJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssetRecipe-g8dZBhgJ.js","names":[],"sources":["../../../foundation/PngRgba.js","../../../modules/asset/production/ProceduralTexture.js","../../../modules/asset/production/AssetRecipe.js"],"sourcesContent":["// Dependency-free deterministic PNG encoding for RGBA8 pixel buffers.\nconst PNG_SIGNATURE = new Uint8Array([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);\nconst ZLIB_HEADER = new Uint8Array([0x78, 0x01]);\nconst STORED_BLOCK_MAX = 0xffff;\n\nconst CRC_TABLE = (() => {\n const table = new Uint32Array(256);\n for (let n = 0; n < 256; n++) {\n let c = n;\n for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;\n table[n] = c >>> 0;\n }\n return table;\n})();\n\nfunction crc32(bytes, start, end) {\n let crc = 0xffffffff;\n for (let i = start; i < end; i++) crc = CRC_TABLE[(crc ^ bytes[i]) & 0xff] ^ (crc >>> 8);\n return (crc ^ 0xffffffff) >>> 0;\n}\n\nfunction adler32(bytes) {\n let a = 1;\n let b = 0;\n for (let i = 0; i < bytes.length; i++) {\n a = (a + bytes[i]) % 65521;\n b = (b + a) % 65521;\n }\n return ((b << 16) | a) >>> 0;\n}\n\nfunction concat(parts) {\n let length = 0;\n for (const part of parts) length += part.length;\n const out = new Uint8Array(length);\n let offset = 0;\n for (const part of parts) { out.set(part, offset); offset += part.length; }\n return out;\n}\n\nfunction pngChunk(type, data) {\n const out = new Uint8Array(12 + data.length);\n const view = new DataView(out.buffer);\n view.setUint32(0, data.length);\n for (let i = 0; i < 4; i++) out[4 + i] = type.charCodeAt(i);\n out.set(data, 8);\n view.setUint32(8 + data.length, crc32(out, 4, 8 + data.length));\n return out;\n}\n\n// zlib stream using stored (uncompressed) deflate blocks - no compression library needed.\nfunction zlibStored(raw) {\n const parts = [ZLIB_HEADER];\n const blocks = Math.max(1, Math.ceil(raw.length / STORED_BLOCK_MAX));\n for (let i = 0; i < blocks; i++) {\n const start = i * STORED_BLOCK_MAX;\n const length = Math.min(STORED_BLOCK_MAX, raw.length - start);\n const header = new Uint8Array(5);\n header[0] = i === blocks - 1 ? 0x01 : 0x00; // BFINAL | BTYPE=stored\n header[1] = length & 0xff;\n header[2] = (length >>> 8) & 0xff;\n header[3] = ~length & 0xff;\n header[4] = (~length >>> 8) & 0xff;\n parts.push(header, raw.subarray(start, start + length));\n }\n const checksum = new Uint8Array(4);\n new DataView(checksum.buffer).setUint32(0, adler32(raw));\n parts.push(checksum);\n return concat(parts);\n}\n\n// Encodes RGBA8 pixels (top-to-bottom, no premultiply) into a PNG image.\nexport function encodePngRgba(rgba, width, height) {\n if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) {\n throw new TypeError('PNG dimensions must be positive integers');\n }\n if (rgba.length !== width * height * 4) {\n throw new TypeError(`RGBA buffer must contain ${width * height * 4} bytes`);\n }\n const stride = width * 4;\n const raw = new Uint8Array(height * (stride + 1));\n for (let y = 0; y < height; y++) {\n raw[y * (stride + 1)] = 0; // filter type: none\n raw.set(rgba.subarray(y * stride, (y + 1) * stride), y * (stride + 1) + 1);\n }\n const ihdr = new Uint8Array(13);\n const view = new DataView(ihdr.buffer);\n view.setUint32(0, width);\n view.setUint32(4, height);\n ihdr[8] = 8; // bit depth\n ihdr[9] = 6; // color type: RGBA\n return concat([\n PNG_SIGNATURE,\n pngChunk('IHDR', ihdr),\n pngChunk('IDAT', zlibStored(raw)),\n pngChunk('IEND', new Uint8Array(0))\n ]);\n}\n\n","import { encodePngRgba } from '../../../foundation/PngRgba.js';\nimport { proceduralTextureSchema, PROCEDURAL_TEXTURE_PALETTES } from '../model/ProceduralTextureContract.js';\n\nconst TAU=2*Math.PI;\nconst clamp=v=>Math.max(0,Math.min(1,v));\nconst lerp=(a,b,t)=>a+(b-a)*t;\nconst smooth=t=>t*t*(3-2*t);\nconst wrap=(n,p)=>(n%p+p)%p;\nconst rgb=hex=>[1,3,5].map(i=>parseInt(hex.slice(i,i+2),16));\n\nfunction hash(x,y,seed){\n let n=(Math.imul(x+1,0x9e3779b1)^Math.imul(y+1,0x85ebca6b)^seed)>>>0;\n n=Math.imul(n^(n>>>16),0x7feb352d);\n n=Math.imul(n^(n>>>15),0x846ca68b);\n return ((n^(n>>>16))>>>0)/4294967295;\n}\n\n// Periodic lattice noise: UV coordinates wrap without a discontinuity.\nfunction noise(u,v,px,py,seed){\n const x=u*px,y=v*py,ix=Math.floor(x),iy=Math.floor(y);\n const tx=smooth(x-ix),ty=smooth(y-iy);\n const sample=(a,b)=>hash(wrap(a,px),wrap(b,py),seed);\n return lerp(lerp(sample(ix,iy),sample(ix+1,iy),tx),lerp(sample(ix,iy+1),sample(ix+1,iy+1),tx),ty);\n}\n\nfunction samplePattern({pattern,seed,frequency:f},u,v){\n const n=(x,y,s=0)=>noise(u,v,x*f,y*f,(seed+s)>>>0);\n if(pattern==='wood'){\n const distortion=n(3,2,17);\n const grain=.5+.5*Math.sin(TAU*(u*9*f+distortion*.8+n(12,3,31)*.13));\n return clamp(.48*grain+.38*n(20,3)+.14*n(45,5,5));\n }\n if(pattern==='stone')return clamp(.5*n(5,5)+.3*n(13,13,13)+.2*n(37,37,23));\n if(pattern==='fabric'){\n const a=Math.sin(TAU*u*8*f),b=Math.sin(TAU*v*8*f);\n const weave=.5+.5*a*b;\n return clamp(.72*weave+.28*n(23,23,11));\n }\n return clamp(.72*n(42,3)+.2*n(18,2,19)+.08*n(12,12,7));\n}\n\n/** Pure, bounded, reproducible UV texture generation. No renderer or network. */\nexport function generateProceduralTexture(input){\n const spec=proceduralTextureSchema.parse(input),size=spec.resolution;\n const palette=PROCEDURAL_TEXTURE_PALETTES[spec.pattern];\n const dark=rgb(spec.darkColor??palette[0]),light=rgb(spec.lightColor??palette[1]);\n const height=new Float32Array(size*size);\n const base=new Uint8Array(size*size*4);\n const normal=spec.normalStrength?new Uint8Array(base.length):null;\n for(let y=0;y<size;y++)for(let x=0;x<size;x++){\n const i=y*size+x,t=samplePattern(spec,(x+.5)/size,(y+.5)/size);\n height[i]=t;\n const shade=lerp(.5,t,spec.contrast);\n for(let c=0;c<3;c++)base[i*4+c]=Math.round(lerp(dark[c],light[c],shade));\n base[i*4+3]=255;\n }\n if(normal){\n const at=(x,y)=>height[wrap(y,size)*size+wrap(x,size)];\n for(let y=0;y<size;y++)for(let x=0;x<size;x++){\n const i=(y*size+x)*4;\n const nx=-(at(x+1,y)-at(x-1,y))*spec.normalStrength*4;\n const ny=(at(x,y+1)-at(x,y-1))*spec.normalStrength*4;\n const len=Math.hypot(nx,ny,1);\n normal.set([Math.round((nx/len*.5+.5)*255),Math.round((ny/len*.5+.5)*255),Math.round((1/len*.5+.5)*255),255],i);\n }\n }\n return {size,baseColor:encodePngRgba(base,size,size),\n normal:normal?encodePngRgba(normal,size,size):null};\n}\n\n/** Cache only within a single compile; the GLB owns the generated bytes. */\nexport function attachProceduralTexture(document,material,spec,cache){\n const key=JSON.stringify(spec);\n let textures=cache.get(key);\n if(!textures){\n const {baseColor,normal}=generateProceduralTexture(spec);\n textures={\n base:document.createTexture(spec.pattern+'-color').setMimeType('image/png').setImage(baseColor),\n normal:normal?document.createTexture(spec.pattern+'-normal').setMimeType('image/png').setImage(normal):null\n };\n cache.set(key,textures);\n }\n material.setBaseColorTexture(textures.base);\n if(textures.normal)material.setNormalTexture(textures.normal);\n}\n","import { Document } from '@gltf-transform/core';\nimport { KHRMaterialsClearcoat, KHRMaterialsTransmission, KHRMaterialsIOR, KHRMaterialsEmissiveStrength } from '@gltf-transform/extensions';\nimport { BoxGeometry, SphereGeometry, CylinderGeometry, Shape, Path, ExtrudeGeometry, Color, Vector3, Quaternion } from 'three';\nimport { createAssetGLTFIO } from './compiler/gltfIO.js';\nimport { attachProceduralTexture } from './ProceduralTexture.js';\nimport { recipeSchema } from '../model/AssetInputContracts.js';\n\nfunction createPartGeometry(spec) {\n if (spec.type === 'box') return new BoxGeometry(...spec.size);\n if (spec.type === 'perforated-box') {\n const [width,height,depth]=spec.size;\n const shape=new Shape();\n shape.moveTo(-width/2,-depth/2);\n shape.lineTo(width/2,-depth/2);\n shape.lineTo(width/2,depth/2);\n shape.lineTo(-width/2,depth/2);\n shape.closePath();\n for(const {center:[x,z],radius} of spec.holes){\n const hole=new Path();\n hole.absarc(x,-z,radius,0,2*Math.PI,true);\n shape.holes.push(hole);\n }\n // Extrusion provides both caps and actual interior walls, not a decal\n // or transparent spot. Rotate local extrusion Z onto the plate's Y axis.\n return new ExtrudeGeometry(shape,{depth:height,bevelEnabled:false,steps:1,curveSegments:12})\n .rotateX(-Math.PI/2).translate(0,-height/2,0);\n }\n if (spec.type === 'sphere') return new SphereGeometry(spec.radius, 16, 12);\n if (spec.type === 'ellipsoid') return new SphereGeometry(1, 20, 14).scale(...spec.radii);\n if (spec.type === 'cylinder') return new CylinderGeometry(spec.radius, spec.radius, spec.height, 16);\n if (spec.type === 'tapered-cylinder') return new CylinderGeometry(spec.radiusTop, spec.radiusBottom, spec.height, 16);\n // Slanted tapered shapes by endpoints: branches, rails and pipes.\n const from = new Vector3(...spec.from), to = new Vector3(...spec.to);\n const direction = to.clone().sub(from);\n const geometry = new CylinderGeometry(spec.radiusEnd, spec.radiusStart, direction.length(), 12);\n geometry.applyQuaternion(new Quaternion().setFromUnitVectors(new Vector3(0, 1, 0), direction.normalize()));\n geometry.translate(...from.add(to).multiplyScalar(0.5).toArray());\n return geometry;\n}\n\n/** Trusted compiler implementation for a bounded declarative language. */\nexport async function compileRecipeGeometry(input) {\n const recipe = recipeSchema.parse(input);\n const document = new Document(), buffer = document.createBuffer();\n const scene = document.createScene('Recipe'); document.getRoot().setDefaultScene(scene);\n const nodes = new Map(), textures=new Map();\n for (const part of recipe.parts) {\n const node = document.createNode(part.id).setTranslation(part.position).setRotation(part.quaternion).setScale([part.scale, part.scale, part.scale]);\n nodes.set(part.id, node);\n if (!part.geometry) continue;\n const spec = part.geometry;\n const geometry = createPartGeometry(spec);\n try {\n const primitive = document.createPrimitive();\n for (const [attribute, semantic] of [['position', 'POSITION'], ['normal', 'NORMAL'], ['uv', 'TEXCOORD_0']]) {\n const data = geometry.getAttribute(attribute);\n if (data) primitive.setAttribute(semantic, document.createAccessor().setType(data.itemSize === 2 ? 'VEC2' : 'VEC3').setArray(data.array.slice()).setBuffer(buffer));\n }\n if (geometry.index) primitive.setIndices(document.createAccessor().setType('SCALAR').setArray(geometry.index.array.slice()).setBuffer(buffer));\n const color = new Color(part.material?.color || '#aaaaaa');\n const opacity = part.material?.opacity ?? 1;\n const material = document.createMaterial().setBaseColorFactor([color.r, color.g, color.b, opacity])\n .setRoughnessFactor(part.material?.roughness ?? 0.7).setMetallicFactor(part.material?.metalness ?? 0);\n if (opacity < 1) material.setAlphaMode('BLEND');\n if (part.material?.emissive) material.setEmissiveFactor(new Color(part.material.emissive).toArray());\n if (part.material?.doubleSided) material.setDoubleSided(true);\n const surface=part.material;\n if(surface?.clearcoat!==undefined||surface?.clearcoatRoughness!==undefined){\n const ext=document.createExtension(KHRMaterialsClearcoat);\n material.setExtension(ext.extensionName,ext.createClearcoat().setClearcoatFactor(surface.clearcoat??0).setClearcoatRoughnessFactor(surface.clearcoatRoughness??0));\n }\n if(surface?.transmission!==undefined){\n const ext=document.createExtension(KHRMaterialsTransmission);\n material.setExtension(ext.extensionName,ext.createTransmission().setTransmissionFactor(surface.transmission));\n }\n if(surface?.ior!==undefined){\n const ext=document.createExtension(KHRMaterialsIOR);\n material.setExtension(ext.extensionName,ext.createIOR().setIOR(surface.ior));\n }\n if(surface?.emissiveIntensity!==undefined){\n const ext=document.createExtension(KHRMaterialsEmissiveStrength);\n material.setExtension(ext.extensionName,ext.createEmissiveStrength().setEmissiveStrength(surface.emissiveIntensity));\n }\n if(surface?.texture)attachProceduralTexture(document,material,surface.texture,textures);\n primitive.setMaterial(material);\n node.setMesh(document.createMesh(part.id).addPrimitive(primitive));\n } finally { geometry.dispose(); }\n }\n for (const part of recipe.parts) (part.parent ? nodes.get(part.parent) : scene).addChild(nodes.get(part.id));\n return { recipe, bytes: await createAssetGLTFIO().writeBinary(document) };\n}\n"],"mappings":";;;;;;AACA,MAAM,gBAAgB,IAAI,WAAW;CAAC;CAAM;CAAM;CAAM;CAAM;CAAM;CAAM;CAAM;AAAI,CAAC;AACrF,MAAM,cAAc,IAAI,WAAW,CAAC,KAAM,CAAI,CAAC;AAC/C,MAAM,mBAAmB;AAEzB,MAAM,mBAAmB;CACvB,MAAM,wBAAQ,IAAI,YAAY,GAAG;CACjC,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,KAAK;EAC5B,IAAI,IAAI;EACR,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KAA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