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.
Files changed (386) hide show
  1. package/README.md +23 -48
  2. package/dist/core.d.ts +68 -0
  3. package/dist/core.js +209 -0
  4. package/dist/core.js.map +1 -0
  5. package/dist/index.d.ts +10 -229
  6. package/dist/index.js +192 -15462
  7. package/dist/index.js.map +1 -1
  8. package/package.json +11 -40
  9. package/cli.mjs +0 -27
  10. package/dist/AssetCompiler-CDFiElji.js +0 -2451
  11. package/dist/AssetCompiler-CDFiElji.js.map +0 -1
  12. package/dist/AssetInputContracts-Dy8iU4eT.js +0 -228
  13. package/dist/AssetInputContracts-Dy8iU4eT.js.map +0 -1
  14. package/dist/AssetRecipe-DmFpzxr-.js +0 -55
  15. package/dist/AssetRecipe-DmFpzxr-.js.map +0 -1
  16. package/dist/BrowserCodeWorker.js +0 -53615
  17. package/dist/KinematicHypothesisScreen-D-z6qgMB.js +0 -242
  18. package/dist/KinematicHypothesisScreen-D-z6qgMB.js.map +0 -1
  19. package/dist/SceneSerializer-DPVOyeRk.js +0 -353
  20. package/dist/SceneSerializer-DPVOyeRk.js.map +0 -1
  21. package/dist/StylePack-DNrdLeGI.js +0 -6314
  22. package/dist/StylePack-DNrdLeGI.js.map +0 -1
  23. package/dist/WorldArchive-pSBIGxLa.js +0 -420
  24. package/dist/WorldArchive-pSBIGxLa.js.map +0 -1
  25. package/dist/WorldIO-wsDfZGM4.js +0 -150
  26. package/dist/WorldIO-wsDfZGM4.js.map +0 -1
  27. package/dist/blankWorld-CBWbwJGj.js +0 -76
  28. package/dist/blankWorld-CBWbwJGj.js.map +0 -1
  29. package/dist/disposeObject3D-BQ9TyVC_.js +0 -54
  30. package/dist/disposeObject3D-BQ9TyVC_.js.map +0 -1
  31. package/dist/environments-DgH66NqV.js +0 -4220
  32. package/dist/environments-DgH66NqV.js.map +0 -1
  33. package/dist/gltfIO-B87nJaat.js +0 -10
  34. package/dist/gltfIO-B87nJaat.js.map +0 -1
  35. package/dist/grandUrbanBlock-Ob9pN-CB.js +0 -516
  36. package/dist/grandUrbanBlock-Ob9pN-CB.js.map +0 -1
  37. package/dist/magicCabin-D64fD1E2.js +0 -11024
  38. package/dist/magicCabin-D64fD1E2.js.map +0 -1
  39. package/dist/mcp.d.ts +0 -2
  40. package/dist/mcp.js +0 -1
  41. package/dist/monumentHall-BKbs0UOQ.js +0 -404
  42. package/dist/monumentHall-BKbs0UOQ.js.map +0 -1
  43. package/dist/node.d.ts +0 -16
  44. package/dist/node.js +0 -25
  45. package/dist/ruinedCourtyard-BoZxHldu.js +0 -697
  46. package/dist/ruinedCourtyard-BoZxHldu.js.map +0 -1
  47. package/dist/runtime/application/AgentTools.js +0 -25
  48. package/dist/runtime/application/README.md +0 -14
  49. package/dist/runtime/application/buildTaskObservation.js +0 -117
  50. package/dist/runtime/application/code-execution/AuthoringSandboxEntry.js +0 -46
  51. package/dist/runtime/application/code-execution/BrowserCodeExecutor.js +0 -35
  52. package/dist/runtime/application/code-execution/BrowserCodeWorker.js +0 -17
  53. package/dist/runtime/application/code-execution/RemoteAuthoringDocument.js +0 -72
  54. package/dist/runtime/application/createSession.js +0 -66
  55. package/dist/runtime/application/createWorldAuthoringContext.js +0 -400
  56. package/dist/runtime/application/generation/GenerationOrchestrator.js +0 -629
  57. package/dist/runtime/application/generation/GenerationRuntime.js +0 -214
  58. package/dist/runtime/application/generation/PromptHybridWorldOrchestrator.js +0 -285
  59. package/dist/runtime/application/native-scene/CodeProject.js +0 -119
  60. package/dist/runtime/application/native-scene/CodeProjectModules.js +0 -128
  61. package/dist/runtime/application/native-scene/NativeEnvironmentGeometry.js +0 -62
  62. package/dist/runtime/application/native-scene/NativeOverlayCheckpoint.js +0 -127
  63. package/dist/runtime/application/native-scene/NativeRenderDiscovery.js +0 -51
  64. package/dist/runtime/application/native-scene/NativeSceneHost.js +0 -164
  65. package/dist/runtime/application/native-scene/NativeSceneOverlay.js +0 -116
  66. package/dist/runtime/application/native-scene/NativeThreeModule.js +0 -16
  67. package/dist/runtime/application/object-forge/SceneObjectForge.js +0 -232
  68. package/dist/runtime/application/programmatic-assets/ProgrammaticAssetBuilder.js +0 -54
  69. package/dist/runtime/application/programmatic-assets/ProgrammaticAssetContract.js +0 -22
  70. package/dist/runtime/application/programmatic-assets/ThreeCodeAsset.js +0 -40
  71. package/dist/runtime/application/scene/CapabilityResolver.js +0 -79
  72. package/dist/runtime/application/scene/RequestWindow.js +0 -54
  73. package/dist/runtime/application/scene/SceneAgentTools.js +0 -21
  74. package/dist/runtime/application/scene/SceneContracts.js +0 -45
  75. package/dist/runtime/application/scene/SceneEditService.js +0 -144
  76. package/dist/runtime/application/scene/SceneFacade.js +0 -267
  77. package/dist/runtime/application/scene/SceneInteractionAdapters.js +0 -40
  78. package/dist/runtime/application/scene/SceneJobController.js +0 -229
  79. package/dist/runtime/application/scene/ScenePackage.js +0 -162
  80. package/dist/runtime/application/scene/ScenePersistence.js +0 -50
  81. package/dist/runtime/application/scene/SceneProject.js +0 -95
  82. package/dist/runtime/application/scene/SceneSkillNames.js +0 -5
  83. package/dist/runtime/application/scene/StarterScene.js +0 -56
  84. package/dist/runtime/application/scene/WorldArchive.js +0 -87
  85. package/dist/runtime/application/scene/WorldDirectory.js +0 -20
  86. package/dist/runtime/application/scene/WorldDocument.js +0 -74
  87. package/dist/runtime/application/scene/WorldIO.js +0 -103
  88. package/dist/runtime/application/scene/WorldStorage.js +0 -137
  89. package/dist/runtime/application/skills/SkillRegistry.js +0 -163
  90. package/dist/runtime/application/skills/packs/acceptanceSkills.js +0 -32
  91. package/dist/runtime/application/skills/packs/affordanceSkills.js +0 -36
  92. package/dist/runtime/application/skills/packs/assetSkills.js +0 -46
  93. package/dist/runtime/application/skills/packs/authoringSkills.js +0 -16
  94. package/dist/runtime/application/skills/packs/batchSkills.js +0 -22
  95. package/dist/runtime/application/skills/packs/codeSkills.js +0 -106
  96. package/dist/runtime/application/skills/packs/generationSkills.js +0 -45
  97. package/dist/runtime/application/skills/packs/interactionSkills.js +0 -46
  98. package/dist/runtime/application/skills/packs/recoverySkills.js +0 -80
  99. package/dist/runtime/application/skills/packs/sceneSkills.js +0 -24
  100. package/dist/runtime/application/skills/packs/spatialSkills.js +0 -35
  101. package/dist/runtime/application/skills/packs/verificationSkills.js +0 -14
  102. package/dist/runtime/application/skills/packs/worldSkills.js +0 -45
  103. package/dist/runtime/application/skills/registerCoreSkills.js +0 -31
  104. package/dist/runtime/application/skills/skillPrimitives.js +0 -4
  105. package/dist/runtime/application/tasks/CabinetCupTask.js +0 -76
  106. package/dist/runtime/application/tasks.jsonl +0 -67
  107. package/dist/runtime/application/world-authoring/AuthoringAssetProducer.js +0 -42
  108. package/dist/runtime/application/world-authoring/AuthoringDiff.js +0 -149
  109. package/dist/runtime/application/world-authoring/AuthoringDocument.js +0 -825
  110. package/dist/runtime/application/world-authoring/AuthoringExecutionHost.js +0 -109
  111. package/dist/runtime/application/world-authoring/AuthoringIdentity.js +0 -17
  112. package/dist/runtime/application/world-authoring/AuthoringModelResolver.js +0 -29
  113. package/dist/runtime/application/world-authoring/AuthoringPatch.js +0 -118
  114. package/dist/runtime/application/world-authoring/AuthoringPromotionController.js +0 -334
  115. package/dist/runtime/application/world-authoring/AuthoringPromotionSource.js +0 -126
  116. package/dist/runtime/application/world-authoring/AuthoringRevisionHistory.js +0 -144
  117. package/dist/runtime/application/world-authoring/HeadlessImageExport.js +0 -174
  118. package/dist/runtime/application/world-authoring/ModelRef.js +0 -62
  119. package/dist/runtime/apps/mcp-server/AUTHORING.md +0 -71
  120. package/dist/runtime/apps/mcp-server/AuthoringSandboxEntry.js +0 -1
  121. package/dist/runtime/apps/mcp-server/AuthoringSandboxWorker.mjs +0 -30
  122. package/dist/runtime/apps/mcp-server/BuildEnvironment.js +0 -17
  123. package/dist/runtime/apps/mcp-server/CodeExecutor.js +0 -71
  124. package/dist/runtime/apps/mcp-server/DEPLOYMENT-PC2.md +0 -42
  125. package/dist/runtime/apps/mcp-server/DockerBuildRunner.js +0 -66
  126. package/dist/runtime/apps/mcp-server/FileAssetRepository.js +0 -159
  127. package/dist/runtime/apps/mcp-server/HeadlessAssetIO.js +0 -8
  128. package/dist/runtime/apps/mcp-server/HeadlessGLTFLoader.js +0 -47
  129. package/dist/runtime/apps/mcp-server/HeadlessWorldHost.js +0 -132
  130. package/dist/runtime/apps/mcp-server/IsolatedAuthoringExecutor.js +0 -6
  131. package/dist/runtime/apps/mcp-server/PROGRAMMATIC-ASSETS.md +0 -116
  132. package/dist/runtime/apps/mcp-server/ProgrammaticAssets.js +0 -60
  133. package/dist/runtime/apps/mcp-server/README.md +0 -150
  134. package/dist/runtime/apps/mcp-server/RemoteAuthoringDocument.js +0 -1
  135. package/dist/runtime/apps/mcp-server/SandboxBundle.js +0 -13
  136. package/dist/runtime/apps/mcp-server/SessionManager.js +0 -80
  137. package/dist/runtime/apps/mcp-server/StudioBridgeHttp.js +0 -58
  138. package/dist/runtime/apps/mcp-server/StudioLiveBridge.js +0 -190
  139. package/dist/runtime/apps/mcp-server/TrustedAuthoringWorker.mjs +0 -16
  140. package/dist/runtime/apps/mcp-server/VALIDATION.md +0 -45
  141. package/dist/runtime/apps/mcp-server/acceptance-evidence.json +0 -332
  142. package/dist/runtime/apps/mcp-server/errorDiagnostics.js +0 -32
  143. package/dist/runtime/apps/mcp-server/examples/code-house.js +0 -24
  144. package/dist/runtime/apps/mcp-server/examples/procedural-assets.js +0 -37
  145. package/dist/runtime/apps/mcp-server/main.mjs +0 -56
  146. package/dist/runtime/apps/mcp-server/registerTools.js +0 -215
  147. package/dist/runtime/apps/mcp-server/sandbox/run.mjs +0 -23
  148. package/dist/runtime/apps/mcp-server/security.js +0 -21
  149. package/dist/runtime/apps/mcp-server/tasks.jsonl +0 -9
  150. package/dist/runtime/apps/server/CapabilityAdapterRegistry.js +0 -157
  151. package/dist/runtime/apps/server/README.md +0 -7
  152. package/dist/runtime/apps/server/WorldDiskStorage.js +0 -51
  153. package/dist/runtime/apps/server/openai-compatible-agent-gateway.mjs +0 -278
  154. package/dist/runtime/apps/server/tasks.jsonl +0 -10
  155. package/dist/runtime/foundation/EventBus.js +0 -18
  156. package/dist/runtime/foundation/JsonGateway.js +0 -47
  157. package/dist/runtime/foundation/PolicyEngine.js +0 -21
  158. package/dist/runtime/foundation/README.md +0 -7
  159. package/dist/runtime/foundation/TraceRecorder.js +0 -76
  160. package/dist/runtime/foundation/errors.js +0 -8
  161. package/dist/runtime/foundation/simulation/SimulationProfile.js +0 -143
  162. package/dist/runtime/foundation/version.js +0 -2
  163. package/dist/runtime/modules/agent/README.md +0 -11
  164. package/dist/runtime/modules/agent/ToolCallingAgent.js +0 -19
  165. package/dist/runtime/modules/agent/bootstrapWorld.js +0 -10
  166. package/dist/runtime/modules/agent/buildRecoveryProposals.js +0 -533
  167. package/dist/runtime/modules/agent/execution/AgentExecutionRules.js +0 -127
  168. package/dist/runtime/modules/agent/execution/AgentRunResults.js +0 -55
  169. package/dist/runtime/modules/agent/execution/AgentRunSession.js +0 -390
  170. package/dist/runtime/modules/agent/execution/AgentToolInvoker.js +0 -39
  171. package/dist/runtime/modules/agent/gateway/HttpLLMGateway.js +0 -19
  172. package/dist/runtime/modules/agent/prompt/index.js +0 -46
  173. package/dist/runtime/modules/agent/tasks.jsonl +0 -94
  174. package/dist/runtime/modules/artifact/ArtifactContentGate.js +0 -144
  175. package/dist/runtime/modules/artifact/ArtifactDescriptor.js +0 -280
  176. package/dist/runtime/modules/artifact/ArtifactImporter.js +0 -185
  177. package/dist/runtime/modules/artifact/ArtifactModule.js +0 -111
  178. package/dist/runtime/modules/artifact/ArtifactRegistry.js +0 -197
  179. package/dist/runtime/modules/artifact/IncrementalSha256.js +0 -129
  180. package/dist/runtime/modules/artifact/MemoryArtifactByteStore.js +0 -115
  181. package/dist/runtime/modules/artifact/README.md +0 -7
  182. package/dist/runtime/modules/artifact/storage/IndexedDbArtifactStore.js +0 -67
  183. package/dist/runtime/modules/artifact/tasks.jsonl +0 -31
  184. package/dist/runtime/modules/asset/AssetModule.js +0 -399
  185. package/dist/runtime/modules/asset/README.md +0 -54
  186. package/dist/runtime/modules/asset/loading/AssetLoader.js +0 -157
  187. package/dist/runtime/modules/asset/loading/GltfAssetLoader.js +0 -61
  188. package/dist/runtime/modules/asset/loading/builtins/BuiltinAssets.js +0 -95
  189. package/dist/runtime/modules/asset/loading/builtins/HouseDoor.js +0 -33
  190. package/dist/runtime/modules/asset/loading/builtins/IndustrialCabinet.js +0 -103
  191. package/dist/runtime/modules/asset/model/AssetInputContracts.js +0 -95
  192. package/dist/runtime/modules/asset/model/AssetRef.js +0 -12
  193. package/dist/runtime/modules/asset/model/MechanicalAssetDraft.js +0 -172
  194. package/dist/runtime/modules/asset/model/admission.js +0 -117
  195. package/dist/runtime/modules/asset/model/errors.js +0 -6
  196. package/dist/runtime/modules/asset/model/parts.js +0 -27
  197. package/dist/runtime/modules/asset/model/resourceBudget.js +0 -10
  198. package/dist/runtime/modules/asset/model/schema.js +0 -150
  199. package/dist/runtime/modules/asset/persistence/AssetManifestStore.js +0 -78
  200. package/dist/runtime/modules/asset/persistence/CompiledAssetStore.js +0 -84
  201. package/dist/runtime/modules/asset/persistence/LocalAssetLibrary.js +0 -86
  202. package/dist/runtime/modules/asset/persistence/LocalAssetLibraryStore.js +0 -81
  203. package/dist/runtime/modules/asset/production/AssetProductionPipeline.js +0 -272
  204. package/dist/runtime/modules/asset/production/AssetRecipe.js +0 -32
  205. package/dist/runtime/modules/asset/production/adapters/EmbodiedGenAdapter.js +0 -45
  206. package/dist/runtime/modules/asset/production/adapters/EmbodiedGenBundleAdapter.js +0 -590
  207. package/dist/runtime/modules/asset/production/compiler/AssetCompiler.js +0 -173
  208. package/dist/runtime/modules/asset/production/compiler/evidence/AnimationMotionEvidence.js +0 -124
  209. package/dist/runtime/modules/asset/production/compiler/evidence/StaticPanelEvidence.js +0 -56
  210. package/dist/runtime/modules/asset/production/compiler/gltfIO.js +0 -6
  211. package/dist/runtime/modules/asset/production/compiler/partGeometry.js +0 -74
  212. package/dist/runtime/modules/asset/production/compiler/passes/ArticulatedCollisionPass.js +0 -63
  213. package/dist/runtime/modules/asset/production/compiler/passes/ArticulationCandidatePass.js +0 -48
  214. package/dist/runtime/modules/asset/production/compiler/passes/AuthoringIntentPass.js +0 -16
  215. package/dist/runtime/modules/asset/production/compiler/passes/ColliderFallbackPass.js +0 -30
  216. package/dist/runtime/modules/asset/production/compiler/passes/CompileQualityPass.js +0 -75
  217. package/dist/runtime/modules/asset/production/compiler/passes/ExplicitDefinitionPass.js +0 -20
  218. package/dist/runtime/modules/asset/production/compiler/passes/GLTFInspectPass.js +0 -34
  219. package/dist/runtime/modules/asset/production/compiler/passes/GeometryPass.js +0 -32
  220. package/dist/runtime/modules/asset/production/compiler/passes/JointFramePass.js +0 -116
  221. package/dist/runtime/modules/asset/production/compiler/passes/KinematicEvidencePass.js +0 -84
  222. package/dist/runtime/modules/asset/production/compiler/passes/ManifestPass.js +0 -63
  223. package/dist/runtime/modules/asset/production/compiler/passes/NormalizeTransformPass.js +0 -16
  224. package/dist/runtime/modules/asset/production/compiler/passes/OptimizeGLBPass.js +0 -23
  225. package/dist/runtime/modules/asset/production/compiler/passes/PartColliderPass.js +0 -50
  226. package/dist/runtime/modules/asset/production/compiler/passes/PartGeometryEnrichmentPass.js +0 -60
  227. package/dist/runtime/modules/asset/production/compiler/passes/PartProposalPass.js +0 -93
  228. package/dist/runtime/modules/asset/production/compiler/passes/RemoteEnrichmentPass.js +0 -32
  229. package/dist/runtime/modules/asset/production/compiler/passes/ResourceBudgetPass.js +0 -55
  230. package/dist/runtime/modules/asset/production/compiler/passes/SegmentMaterializePass.js +0 -203
  231. package/dist/runtime/modules/asset/production/compiler/passes/SegmentationEvidencePass.js +0 -43
  232. package/dist/runtime/modules/asset/production/compiler/passes/SemanticHeuristicPass.js +0 -33
  233. package/dist/runtime/modules/asset/production/compiler/passes/StructurePass.js +0 -60
  234. package/dist/runtime/modules/asset/production/compiler/providers/HttpCompilerProvider.js +0 -23
  235. package/dist/runtime/modules/asset/production/verification/KinematicHypothesisScreen.js +0 -198
  236. package/dist/runtime/modules/asset/registry/AssetCatalog.js +0 -72
  237. package/dist/runtime/modules/asset/registry/AssetRegistry.js +0 -51
  238. package/dist/runtime/modules/asset/registry/manifests/index.js +0 -173
  239. package/dist/runtime/modules/asset/tasks.jsonl +0 -87
  240. package/dist/runtime/modules/generation/README.md +0 -9
  241. package/dist/runtime/modules/generation/connector/ConnectorArtifactClient.js +0 -45
  242. package/dist/runtime/modules/generation/connector/ConnectorCapabilityAdapter.js +0 -169
  243. package/dist/runtime/modules/generation/connector/ConnectorClient.js +0 -192
  244. package/dist/runtime/modules/generation/connector/ConnectorJobClient.js +0 -167
  245. package/dist/runtime/modules/generation/connector/ConnectorJobEventClient.js +0 -179
  246. package/dist/runtime/modules/generation/connector/ConnectorSession.js +0 -202
  247. package/dist/runtime/modules/generation/jobs/GenerationJobProjection.js +0 -239
  248. package/dist/runtime/modules/generation/jobs/GenerationJobReconciler.js +0 -99
  249. package/dist/runtime/modules/generation/jobs/GenerationJobStore.js +0 -91
  250. package/dist/runtime/modules/generation/jobs/GenerationJobTransportOverlay.js +0 -50
  251. package/dist/runtime/modules/generation/providers/ProviderRegistry.js +0 -304
  252. package/dist/runtime/modules/generation/tasks.jsonl +0 -35
  253. package/dist/runtime/modules/navigation/NavigationBackend.js +0 -17
  254. package/dist/runtime/modules/navigation/RecastNavigationBackend.js +0 -245
  255. package/dist/runtime/modules/physics/JoltPhysicsBackend.js +0 -850
  256. package/dist/runtime/modules/physics/PhysicsApiSurface.js +0 -651
  257. package/dist/runtime/modules/physics/PhysicsBackend.js +0 -88
  258. package/dist/runtime/modules/physics/RapierPhysicsBackend.js +0 -410
  259. package/dist/runtime/modules/rendering/README.md +0 -7
  260. package/dist/runtime/modules/rendering/RendererProbe.js +0 -153
  261. package/dist/runtime/modules/rendering/WebGpuPostFxPipeline.js +0 -140
  262. package/dist/runtime/modules/rendering/createRenderer.js +0 -76
  263. package/dist/runtime/modules/rendering/disposeObject3D.js +0 -34
  264. package/dist/runtime/modules/rendering/loadGaussianSplatVisual.js +0 -74
  265. package/dist/runtime/modules/rendering/style/StylePack.js +0 -34
  266. package/dist/runtime/modules/rendering/style/StyleSystem.js +0 -173
  267. package/dist/runtime/modules/rendering/tasks.jsonl +0 -7
  268. package/dist/runtime/modules/world/README.md +0 -13
  269. package/dist/runtime/modules/world/build/WorldBuilder.js +0 -170
  270. package/dist/runtime/modules/world/compiler/PipelineEngine.js +0 -32
  271. package/dist/runtime/modules/world/compiler/WorldAdmission.js +0 -43
  272. package/dist/runtime/modules/world/compiler/WorldBehaviorCompiler.js +0 -68
  273. package/dist/runtime/modules/world/compiler/WorldCompilation.js +0 -157
  274. package/dist/runtime/modules/world/compiler/WorldComposer.js +0 -201
  275. package/dist/runtime/modules/world/compiler/WorldPhysicsAdmission.js +0 -76
  276. package/dist/runtime/modules/world/compiler/WorldRecompiler.js +0 -356
  277. package/dist/runtime/modules/world/compiler/WorldRetry.js +0 -75
  278. package/dist/runtime/modules/world/compiler/createWorldPipeline.js +0 -379
  279. package/dist/runtime/modules/world/content/blankWorld.js +0 -35
  280. package/dist/runtime/modules/world/content/environments.js +0 -84
  281. package/dist/runtime/modules/world/content/grandUrbanBlock.js +0 -189
  282. package/dist/runtime/modules/world/content/magic-cabin/README.md +0 -28
  283. package/dist/runtime/modules/world/content/magic-cabin/affordances.js +0 -64
  284. package/dist/runtime/modules/world/content/magic-cabin/cabinContents.js +0 -7078
  285. package/dist/runtime/modules/world/content/magic-cabin/lighting.js +0 -26
  286. package/dist/runtime/modules/world/content/magic-cabin/materials.js +0 -20
  287. package/dist/runtime/modules/world/content/magicCabin.js +0 -190
  288. package/dist/runtime/modules/world/content/monumentHall.js +0 -154
  289. package/dist/runtime/modules/world/content/ruinedCourtyard.js +0 -196
  290. package/dist/runtime/modules/world/content/suzhouGarden/README.md +0 -141
  291. package/dist/runtime/modules/world/content/suzhouGarden/index.js +0 -137
  292. package/dist/runtime/modules/world/content/suzhouGarden/src/arch.js +0 -491
  293. package/dist/runtime/modules/world/content/suzhouGarden/src/buildings.js +0 -670
  294. package/dist/runtime/modules/world/content/suzhouGarden/src/core.js +0 -578
  295. package/dist/runtime/modules/world/content/suzhouGarden/src/lod.js +0 -127
  296. package/dist/runtime/modules/world/content/suzhouGarden/src/main.js +0 -642
  297. package/dist/runtime/modules/world/content/suzhouGarden/src/nature.js +0 -650
  298. package/dist/runtime/modules/world/content/suzhouGarden/src/rockery.js +0 -280
  299. package/dist/runtime/modules/world/content/suzhouGarden/src/sky.js +0 -242
  300. package/dist/runtime/modules/world/content/suzhouGarden/src/water.js +0 -215
  301. package/dist/runtime/modules/world/content/woodlandWorkshop.js +0 -192
  302. package/dist/runtime/modules/world/content/yuanmingyuan/README.md +0 -36
  303. package/dist/runtime/modules/world/content/yuanmingyuan/arch.js +0 -351
  304. package/dist/runtime/modules/world/content/yuanmingyuan/buildings.js +0 -490
  305. package/dist/runtime/modules/world/content/yuanmingyuan/core.js +0 -505
  306. package/dist/runtime/modules/world/content/yuanmingyuan/index.js +0 -101
  307. package/dist/runtime/modules/world/content/yuanmingyuan/nature.js +0 -435
  308. package/dist/runtime/modules/world/content/yuanmingyuan/sky.js +0 -169
  309. package/dist/runtime/modules/world/content/yuanmingyuan/water.js +0 -245
  310. package/dist/runtime/modules/world/errors.js +0 -9
  311. package/dist/runtime/modules/world/generated/GeneratedWorldCoordinates.js +0 -50
  312. package/dist/runtime/modules/world/generated/GeneratedWorldLoader.js +0 -297
  313. package/dist/runtime/modules/world/runtime/CommandHistory.js +0 -80
  314. package/dist/runtime/modules/world/runtime/ObjectStore.js +0 -31
  315. package/dist/runtime/modules/world/runtime/ObjectTransform.js +0 -62
  316. package/dist/runtime/modules/world/runtime/ObservedEntity.js +0 -37
  317. package/dist/runtime/modules/world/runtime/ProjectCapabilities.js +0 -207
  318. package/dist/runtime/modules/world/runtime/SceneSerializer.js +0 -246
  319. package/dist/runtime/modules/world/runtime/WorldAuthority.js +0 -41
  320. package/dist/runtime/modules/world/runtime/WorldCollisionSignature.js +0 -14
  321. package/dist/runtime/modules/world/runtime/WorldCommands.js +0 -502
  322. package/dist/runtime/modules/world/runtime/WorldObservation.js +0 -71
  323. package/dist/runtime/modules/world/runtime/WorldQueries.js +0 -340
  324. package/dist/runtime/modules/world/runtime/WorldRecovery.js +0 -78
  325. package/dist/runtime/modules/world/runtime/WorldRuntime.js +0 -649
  326. package/dist/runtime/modules/world/runtime/affordance/ObjectAffordances.js +0 -107
  327. package/dist/runtime/modules/world/runtime/affordance/WorldAffordances.js +0 -130
  328. package/dist/runtime/modules/world/runtime/behavior/BehaviorCompiler.js +0 -79
  329. package/dist/runtime/modules/world/runtime/behavior/ProjectStateMachine.js +0 -195
  330. package/dist/runtime/modules/world/runtime/behavior/RuleGraph.js +0 -70
  331. package/dist/runtime/modules/world/runtime/behavior/RuleRuntime.js +0 -115
  332. package/dist/runtime/modules/world/runtime/graph/SceneGraph.js +0 -216
  333. package/dist/runtime/modules/world/runtime/interaction/ArticulationRuntime.js +0 -214
  334. package/dist/runtime/modules/world/runtime/interaction/CarryCapability.js +0 -65
  335. package/dist/runtime/modules/world/runtime/interaction/CarryRuntime.js +0 -222
  336. package/dist/runtime/modules/world/runtime/interaction/InteractionApproach.js +0 -130
  337. package/dist/runtime/modules/world/runtime/interaction/InteractionContract.js +0 -57
  338. package/dist/runtime/modules/world/runtime/interaction/RecoveryRuntime.js +0 -123
  339. package/dist/runtime/modules/world/runtime/interaction/SettleRuntime.js +0 -120
  340. package/dist/runtime/modules/world/runtime/semantic/SemanticWorldView.js +0 -102
  341. package/dist/runtime/modules/world/runtime/simulation/SimulationClock.js +0 -89
  342. package/dist/runtime/modules/world/runtime/simulation/SimulationSession.js +0 -99
  343. package/dist/runtime/modules/world/runtime/simulation/ThermalSystem.js +0 -269
  344. package/dist/runtime/modules/world/runtime/spatial/SpatialSnapshot.js +0 -56
  345. package/dist/runtime/modules/world/runtime/spatial/ThreeBvhRuntime.js +0 -36
  346. package/dist/runtime/modules/world/runtime/systems/InteractionSystem.js +0 -728
  347. package/dist/runtime/modules/world/runtime/systems/LocomotionSystem.js +0 -269
  348. package/dist/runtime/modules/world/runtime/systems/NavigationSystem.js +0 -469
  349. package/dist/runtime/modules/world/runtime/systems/PhysicsSystem.js +0 -1657
  350. package/dist/runtime/modules/world/runtime/systems/RenderingSystem.js +0 -457
  351. package/dist/runtime/modules/world/runtime/systems/SpatialSystem.js +0 -284
  352. package/dist/runtime/modules/world/spec/WorldIR.js +0 -165
  353. package/dist/runtime/modules/world/spec/WorldIRToolSchema.js +0 -86
  354. package/dist/runtime/modules/world/spec/WorldPlannerProposal.js +0 -51
  355. package/dist/runtime/modules/world/spec/WorldRevision.js +0 -231
  356. package/dist/runtime/modules/world/spec/WorldSpec.js +0 -86
  357. package/dist/runtime/modules/world/tasks.jsonl +0 -530
  358. package/dist/runtime/modules/world/verification/ArticulationVerifier.js +0 -254
  359. package/dist/runtime/modules/world/verification/Finding.js +0 -105
  360. package/dist/runtime/modules/world/verification/InteractionEvidence.js +0 -69
  361. package/dist/runtime/modules/world/verification/RepairEngine.js +0 -49
  362. package/dist/runtime/modules/world/verification/WorldAcceptance.js +0 -158
  363. package/dist/runtime/modules/world/verification/WorldValidator.js +0 -65
  364. package/dist/runtime/package-lock.json +0 -6245
  365. package/dist/runtime/package.json +0 -91
  366. package/dist/runtime/public/assets/cabinet.glb +0 -0
  367. package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_diff_1k.jpg +0 -0
  368. package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_nor_gl_1k.jpg +0 -0
  369. package/dist/runtime/public/assets/grand-urban-block/concrete_pavement_diff_1k.jpg +0 -0
  370. package/dist/runtime/public/assets/grand-urban-block/urban_street_01_1k.hdr +0 -0
  371. package/dist/runtime/public/assets/monument-hall/marble_diff_1k.jpg +0 -0
  372. package/dist/runtime/public/assets/monument-hall/marble_nor_gl_1k.jpg +0 -0
  373. package/dist/runtime/public/assets/monument-hall/marble_rough_1k.jpg +0 -0
  374. package/dist/runtime/public/assets/monument-hall/solitude_interior_1k.hdr +0 -0
  375. package/dist/runtime/public/assets/ruined-courtyard/courtyard_1k.hdr +0 -0
  376. package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_diff_1k.jpg +0 -0
  377. package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_nor_gl_1k.jpg +0 -0
  378. package/dist/runtime/public/assets/ruined-courtyard/mossy_sandstone_diff_1k.jpg +0 -0
  379. package/dist/schema-Dudvovhu.js +0 -364
  380. package/dist/schema-Dudvovhu.js.map +0 -1
  381. package/dist/suzhouGarden-BCx_JeV5.js +0 -6159
  382. package/dist/suzhouGarden-BCx_JeV5.js.map +0 -1
  383. package/dist/woodlandWorkshop-BGNWPNdK.js +0 -484
  384. package/dist/woodlandWorkshop-BGNWPNdK.js.map +0 -1
  385. package/dist/yuanmingyuan-DAIb1msO.js +0 -4962
  386. package/dist/yuanmingyuan-DAIb1msO.js.map +0 -1
@@ -1,232 +0,0 @@
1
- import { mechanicalDraftSchema } from '../../modules/asset/model/MechanicalAssetDraft.js';
2
- import { recipeSchema, threeCodeInputSchema } from '../../modules/asset/model/AssetInputContracts.js';
3
- import { prepareThreeCodeAsset } from '../programmatic-assets/ThreeCodeAsset.js';
4
-
5
- const fail = code => Object.assign(new Error(code), { code });
6
- const clone = value => structuredClone(value);
7
- const parse = source => source?.schema === 'agentscape.mechanical-draft'
8
- ? mechanicalDraftSchema.parse(source)
9
- : source?.schema === 'agentscape.asset-recipe' ? recipeSchema.parse(source)
10
- : source?.kind === 'three-code' ? threeCodeInputSchema.parse(source)
11
- : (() => { throw fail('OBJECT_DEFINITION_UNSUPPORTED'); })();
12
-
13
- function changeAt(document, { path, value }) {
14
- if (typeof path !== 'string' || path.length > 192
15
- || !/^\/(components|motions|parts|definition)\//.test(path))
16
- throw fail('OBJECT_PATCH_PATH_FORBIDDEN');
17
- const segments=path.split('/').slice(1);
18
- if (segments.length < 3 || segments.length > 8 || segments.some(p=>!p || p==='__proto__' || p==='constructor' || p==='prototype'))
19
- throw fail('OBJECT_PATCH_PATH_FORBIDDEN');
20
- let cursor=document;
21
- for (const part of segments.slice(0,-1)) {
22
- if (Array.isArray(cursor)) {
23
- const index=part.startsWith('@') ? cursor.findIndex(item=>item?.id===part.slice(1)) : /^(0|[1-9][0-9]*)$/.test(part) ? Number(part) : -1;
24
- if(index<0 || index>=cursor.length)throw fail('OBJECT_PATCH_PATH_NOT_FOUND');
25
- cursor=cursor[index];
26
- } else {
27
- if (!cursor || typeof cursor!=='object' || !Object.hasOwn(cursor,part))
28
- throw fail('OBJECT_PATCH_PATH_NOT_FOUND');
29
- cursor=cursor[part];
30
- }
31
- }
32
- const key=segments.at(-1);
33
- if (!cursor || typeof cursor!=='object' || !Object.hasOwn(cursor,key))
34
- throw fail('OBJECT_PATCH_PATH_NOT_FOUND');
35
- const previous=clone(cursor[key]);
36
- cursor[key]=clone(value);
37
- return {path,previous,next:clone(value)};
38
- }
39
-
40
- function declaredEvidence(definition) {
41
- if (definition.schema==='agentscape.mechanical-draft') {
42
- return {
43
- components:definition.components.map(node=>({
44
- id:node.id,parent:node.parent,shape:node.shape,size:node.size,
45
- position:node.position,collision:node.collision,source:'ai-declared'
46
- })),
47
- motions:definition.motions.map(motion=>({
48
- id:motion.id,node:motion.node,type:motion.type,
49
- axis:motion.axis,limits:motion.limits,source:'ai-declared',
50
- status:'candidate',physicsVerified:false
51
- }))
52
- };
53
- }
54
- if (definition.schema==='agentscape.asset-recipe') {
55
- return {
56
- components:definition.parts.map(part=>({
57
- id:part.id,parent:part.parent||null,
58
- shape:part.geometry?.type||'group',position:part.position||[0,0,0],
59
- source:'ai-declared'
60
- })),motions:[]
61
- };
62
- }
63
- return {
64
- components:Object.entries(definition.definition?.parts||{}).map(([id,part])=>({
65
- id,node:part.node,semantic:part.semantic||null,
66
- source:'ai-declared'
67
- })),
68
- motions:Object.entries(definition.definition?.parts||{}).filter(([,part])=>part.joint).map(([id,part])=>({
69
- id,node:part.node,type:part.joint.type,axis:part.joint.axis,
70
- limits:part.joint.limits,status:'candidate',physicsVerified:false,
71
- source:'ai-declared'
72
- }))
73
- };
74
- }
75
-
76
- /** Read only actual instantiated Three.js nodes. An Object3D hierarchy is not a joint. */
77
- function runtimeGeometry(object) {
78
- const nodes=[];
79
- if (!object?.traverse) return {nodes, truncated:false};
80
- object.traverse(node=>{
81
- if (nodes.length>=128) return;
82
- const bounds=node.geometry?.boundingBox;
83
- nodes.push({
84
- name:String(node.name||'').slice(0,100),
85
- type:node.type, mesh:node.isMesh===true,
86
- parent:node.parent?.name||null,
87
- position:node.position?.toArray?.()||null,
88
- geometryBounds:bounds ? {min:bounds.min.toArray(),max:bounds.max.toArray()} : null,
89
- source:'runtime-observed'
90
- });
91
- });
92
- return {nodes,truncated:nodes.length>=128};
93
- }
94
-
95
- /** A + C: observed Three.js hierarchy and declared, versioned capability intent.
96
- * Source entries are private to the session, never treated as physics truth.
97
- */
98
- export class SceneObjectForge {
99
- constructor(){this.entries=new Map();}
100
- record(id,source,assetId,world,{originAssetId=null}={}){
101
- if(!['agentscape.mechanical-draft','agentscape.asset-recipe'].includes(source?.schema)
102
- && source?.kind!=='three-code') return;
103
- const definition=parse(source);
104
- this.entries.set(id,{definition,assetId,world,originAssetId,revision:1,preview:null});
105
- }
106
- fork(world,id,source,originAssetId){
107
- if(this.entries.has(id)) throw fail('OBJECT_DEFINITION_ALREADY_TRACKED');
108
- if(!world.store.has(id) || world.store.get(id).assetId!==originAssetId
109
- || !/^pa_[a-f0-9]{64}$/.test(originAssetId))throw fail('OBJECT_DEFINITION_UNAVAILABLE');
110
- this.record(id,source,originAssetId,world,{originAssetId});
111
- return {status:'object-project-forked',id,originAssetId,revision:1,
112
- globalVersionUnchanged:true,scope:'project-instance'};
113
- }
114
- get(world,id){
115
- const entry=this.entries.get(id);
116
- if(!entry || entry.world!==world || !world.store.has(id) || world.store.get(id).assetId!==entry.assetId)
117
- throw fail('OBJECT_DEFINITION_UNAVAILABLE');
118
- return entry;
119
- }
120
- analyze(world,id,definition){
121
- const record=world.store.get(id);
122
- const declared=declaredEvidence(definition),observed=runtimeGeometry(record?.object);
123
- const known=new Set(observed.nodes.map(node=>node.name).filter(Boolean));
124
- const references=new Set([
125
- ...declared.motions.map(motion=>motion.node),
126
- ...(definition.definition?.requiredNodes||[])
127
- ].filter(Boolean));
128
- const matched=[...references].filter(name=>known.has(name));
129
- const missing=[...references].filter(name=>!known.has(name));
130
- return {declared,observed,reconciliation:{matchedNodes:matched,missingNodes:missing,
131
- status:missing.length?'needs-review':'matched',evidenceKind:'node-name-match'},
132
- interpretation:'observed-geometry-is-not-physical-articulation'};
133
- }
134
- inspect(world,id){
135
- const e=this.get(world,id);
136
- return {
137
- schema:'agentscape.object-definition',schemaVersion:1,id,
138
- revision:e.revision,assetId:e.assetId,originAssetId:e.originAssetId||null,
139
- definition:clone(e.definition),analysis:this.analyze(world,id,e.definition),
140
- provenance:{definition:'ai-declared',geometry:'runtime-observed',
141
- motions:'candidate-unless-verified-by-runtime'}
142
- };
143
- }
144
- preview(world,id,expectedRevision,changes){
145
- const e=this.get(world,id);
146
- if(expectedRevision!==e.revision) throw fail('OBJECT_REVISION_CONFLICT');
147
- if(!Array.isArray(changes)||!changes.length||changes.length>8
148
- || JSON.stringify(changes).length>32768)throw fail('OBJECT_PATCH_LIMIT');
149
- const copy=clone(e.definition),delta=changes.map(change=>changeAt(copy,change));
150
- const parsed=parse(copy),previewId=globalThis.crypto.randomUUID();
151
- e.preview={previewId,revision:e.revision,definition:parsed,changes:delta};
152
- return {status:'object-patch-preview',id,revision:e.revision,previewId,
153
- changes:delta,analysis:{declared:declaredEvidence(parsed)},
154
- verification:'not-run'};
155
- }
156
- async apply(world,scene,id,expectedRevision,previewId,{executor}={}){
157
- const e=this.get(world,id);
158
- if(expectedRevision!==e.revision)throw fail('OBJECT_REVISION_CONFLICT');
159
- const pending=e.preview;
160
- if(!pending||pending.previewId!==previewId||pending.revision!==e.revision)
161
- throw fail('OBJECT_PATCH_PREVIEW_NOT_FOUND');
162
- e.preview=null;
163
- const next=pending.definition,module=world.assetModule;
164
- const level=module.getManifest(e.assetId).capabilityLevel||'physical';
165
- let assetId,admission,replaced;
166
- if(next.kind==='three-code'){
167
- const prepared=await prepareThreeCodeAsset(module,executor,next,{
168
- gltfLoader:module.loader.gltfLoader
169
- });
170
- assetId=prepared.manifest.id;
171
- admission=prepared.validation;
172
- replaced=await prepared.install(()=>scene.replaceAsset({id,asset:prepared.asset,level}));
173
- }else{
174
- // Mechanical drafts must pass their articulation verifier before any instance swap.
175
- const imported=next.schema==='agentscape.mechanical-draft'
176
- ? await module.importMechanicalDraft(next) : await module.importRecipe(next);
177
- assetId=imported.manifest.id;
178
- admission=imported.admission;
179
- replaced=await scene.replaceAsset({id,asset:'asset://sha256/'+assetId.replace(/^asset_/,''),level});
180
- }
181
- e.definition=clone(next);
182
- e.assetId=assetId;
183
- e.revision++;
184
- return {status:'object-patch-applied',id,revision:e.revision,
185
- assetId,changes:pending.changes,
186
- verification:{status:'compiled-and-admitted',admission,
187
- runtimeActionVerification:'not-run'},replace:replaced.status};
188
- }
189
-
190
- /** Export editable source only for objects still bound to their original immutable asset. */
191
- export(world) {
192
- const entries = [];
193
- for (const [id, entry] of this.entries) {
194
- if (entry.world !== world || !world.store.has(id) || world.store.get(id).assetId !== entry.assetId) continue;
195
- entries.push({id,assetId:entry.assetId,revision:entry.revision,definition:clone(entry.definition),
196
- ...(entry.originAssetId?{originAssetId:entry.originAssetId}:{})});
197
- }
198
- return entries;
199
- }
200
- /** Validate complete source catalog before altering the live editor registry. */
201
- static validateTransfer(snapshot, input = []) {
202
- if (!Array.isArray(input) || input.length > 64 || JSON.stringify(input).length > 262144)
203
- throw fail('OBJECT_DEFINITION_TRANSFER_LIMIT');
204
- const objects = new Map(snapshot.objects.map(object => [object.id,object.assetId]));
205
- const ids = new Set();
206
- return input.map(item => {
207
- if (!item || typeof item !== 'object' || Array.isArray(item) || typeof item.id !== 'string'
208
- || !/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/.test(item.id)
209
- || !(/^(asset_|pa_)[a-f0-9]{64}$/.test(item.assetId))
210
- || !Number.isSafeInteger(item.revision) || item.revision < 1 || item.revision > 1000000
211
- || ids.has(item.id) || objects.get(item.id) !== item.assetId
212
- || (item.originAssetId != null && !/^pa_[a-f0-9]{64}$/.test(item.originAssetId)))
213
- throw fail('OBJECT_DEFINITION_TRANSFER_INVALID');
214
- ids.add(item.id);
215
- const definition=parse(item.definition);
216
- return {id:item.id,assetId:item.assetId,revision:item.revision,definition,
217
- ...(item.originAssetId?{originAssetId:item.originAssetId}:{})};
218
- });
219
- }
220
- restore(world, input) {
221
- const ready=SceneObjectForge.validateTransfer({
222
- objects:world.store.list().map(([id,record])=>({id,assetId:record.assetId}))
223
- },input);
224
- const next=new Map(ready.map(item=>[
225
- item.id,{assetId:item.assetId,definition:clone(item.definition),revision:item.revision,preview:null,world,
226
- originAssetId:item.originAssetId||null}
227
- ]));
228
- this.entries=next;
229
- return {restored:next.size};
230
- }
231
- clear(){this.entries.clear();}
232
- }
@@ -1,54 +0,0 @@
1
- import * as THREE from 'three';
2
- import { createAssetModule } from '../../modules/asset/AssetModule.js';
3
- import { createArtifactModule } from '../../modules/artifact/ArtifactModule.js';
4
- import { assetAdmission } from '../../modules/asset/model/admission.js';
5
- import { ArticulationVerifier } from '../../modules/world/verification/ArticulationVerifier.js';
6
- import { createWorldAuthoringContext } from '../createWorldAuthoringContext.js';
7
- import { createAuthoringAssetProducer } from '../world-authoring/AuthoringAssetProducer.js';
8
- import { capturePromotionSource, exportPromotionGLB } from '../world-authoring/AuthoringPromotionSource.js';
9
- import { disposeObject3D } from '../../modules/rendering/disposeObject3D.js';
10
- import { parseDefinition } from './ProgrammaticAssetContract.js';
11
-
12
- export class ProgrammaticAssetBuilder {
13
- constructor({runner,gltfLoader}) {Object.assign(this,{runner,gltfLoader});}
14
- async build({source,definition,assetId},{signal}={}) {
15
- const draft=definition == null ? null : parseDefinition(definition);
16
- const result=await this.runner.run({mode:'procedural',source},{signal});
17
- if(signal?.aborted)throw new Error('BUILD_CANCELLED');
18
- const authoring=createWorldAuthoringContext({events:{emit(){}}},{executeCode:()=>{throw Error('SOURCE_EXECUTION_FORBIDDEN');}});
19
- const assets=createAssetModule({manifests:{},manifestStore:null,libraryStore:null,gltfLoader:this.gltfLoader});
20
- const artifacts=createArtifactModule({persistentStore:null});assets.configureProduction({artifacts});
21
- assets.configureVerification({articulationVerifier:new ArticulationVerifier({assetRegistry:assets.registry,assetLoader:assets.loader})});
22
- try {
23
- authoring.load(result.document);
24
- const object=authoring.get('asset-root');
25
- const names=new Map();object.traverse(n=>{if(n.name)names.set(n.name,(names.get(n.name)||0)+1);});
26
- const required=[...(draft?.requiredNodes||[]),...Object.values(draft?.parts||{}).map(p=>p.node)];
27
- if(required.some(name=>names.get(name)!==1))throw Object.assign(new Error('PROCEDURAL_REQUIRED_NODE_INVALID'),{details:{invalidNodes:required.filter(name=>names.get(name)!==1)}});
28
- const box=new THREE.Box3().setFromObject(object),size=box.getSize(new THREE.Vector3());
29
- if(![size.x,size.y,size.z].every(v=>Number.isFinite(v)&&v>0&&v<=100))throw new Error('PROCEDURAL_DIMENSIONS_INVALID');
30
- const captured=capturePromotionSource(authoring,'asset-root');
31
- if (!draft) {
32
- const bytes=await exportPromotionGLB(captured);
33
- const output=await assets.importPackageAsset({bytes,id:assetId,definition:{capabilityLevel:'visual',label:'Code asset'}});
34
- if(signal?.aborted)throw new Error('BUILD_CANCELLED');
35
- return {bytes:(await assets.compiledStore.get(assetId)).bytes,manifest:output.manifest,environment:result.environment,security:result.security,
36
- validation:{execution:'succeeded',runtime:{status:'not-requested'}},admission:assetAdmission(output.manifest)};
37
- }
38
- const resolved={...draft,id:assetId};
39
- if(resolved.interactionContract)resolved.interactionContract={...resolved.interactionContract,entityId:assetId};
40
- const produced=await createAuthoringAssetProducer({assets,artifacts})(captured,{usage:'interactive',definition:resolved,assetId});
41
- if(produced.status==='asset-rejected')throw new Error('PROCEDURAL_ASSET_REJECTED');
42
- const runtime=await assets.verifyAndUpdateArticulation(assetId,{requireRegistration:true});
43
- if(!runtime.ok||!runtime.physicsRegistered)throw Object.assign(new Error('PROCEDURAL_RUNTIME_VERIFICATION_FAILED'),{details:runtime});
44
- const manifest=assets.getManifest(assetId);
45
- const loaded=await assets.instantiate(assetId);disposeObject3D(loaded.object);
46
- const compiled=await assets.compiledStore.get(manifest.source.key);
47
- if(!compiled?.bytes||compiled.bytes.byteLength>4194304)throw new Error('BUILD_OUTPUT_LIMIT');
48
- if(signal?.aborted)throw new Error('BUILD_CANCELLED');
49
- manifest.capabilityLevel=Object.keys(draft.parts||{}).length?'interactive':'physical';
50
- return {bytes:compiled.bytes,manifest,environment:result.environment,security:result.security,validation:{execution:'succeeded',nodes:[...names.keys()],bounds:{min:box.min.toArray(),max:box.max.toArray()},runtime},admission:assetAdmission(manifest)};
51
- } catch(error) {error.execution={status:'succeeded'};throw error;}
52
- finally {authoring.dispose();}
53
- }
54
- }
@@ -1,22 +0,0 @@
1
- import * as z from 'zod/v4';
2
- import { validateAssetManifest } from '../../modules/asset/model/schema.js';
3
-
4
- export const proceduralContract='agentscape.procedural-asset.v1';
5
- const id=z.string().regex(/^[a-zA-Z0-9_-]{1,80}$/).refine(v=>!['__proto__','constructor','prototype'].includes(v));
6
- const finite=z.number().finite().min(-100).max(100);
7
- const vec=z.tuple([finite,finite,finite]);
8
- const positive=z.number().min(.0001).max(50);
9
- const actions=z.array(z.enum(['move','pickup','drop','place','open','close'])).max(8);
10
- const collider=z.object({shape:z.enum(['box','cylinder','capsule','convexHull']),halfExtents:z.tuple([positive,positive,positive]).optional(),halfHeight:positive.optional(),radius:positive.optional(),translation:vec.optional(),rotation:z.tuple([finite,finite,finite,finite]).refine(q=>Math.abs(Math.hypot(...q)-1)<.0001).optional(),vertices:z.array(finite).max(768).optional()}).strict();
11
- const physics=z.object({body:z.enum(['fixed','dynamic','kinematic']),mass:z.number().min(.0001).max(10000).optional(),friction:z.number().min(0).max(10).optional(),restitution:z.number().min(0).max(1).optional(),linearDamping:z.number().min(0).max(100).optional(),angularDamping:z.number().min(0).max(100).optional(),navigationObstacle:z.boolean().optional(),colliders:z.array(collider).min(1).max(32)}).strict();
12
- const part=z.object({node:id,semantic:z.string().max(100).optional(),parent:id.optional(),actions,targets:z.record(z.enum(['open','close']),finite),physics,joint:z.object({type:z.enum(['revolute','prismatic','fixed']),axis:vec.optional(),limits:z.tuple([finite,finite]).optional(),parentAnchor:vec,childAnchor:vec,motor:z.object({stiffness:z.number().min(0).max(10000),damping:z.number().min(0).max(1000)}).strict().optional()}).strict()}).strict();
13
- export const definitionSchema=z.object({id,type:id,label:z.string().min(1).max(100),description:z.string().max(500).optional(),tags:z.array(z.string().max(50)).max(20).optional(),aliases:z.array(z.string().max(50)).max(20).optional(),requiredNodes:z.array(id).max(64).optional(),actions,physics,parts:z.record(id,part).refine(v=>Object.keys(v).length<=16).optional(),surfaces:z.array(z.object({id,localPosition:vec,size:z.tuple([positive,positive])}).strict()).max(16).optional(),receptacles:z.array(z.object({id,localPosition:vec,size:z.tuple([positive,positive,positive])}).strict()).max(16).optional(),interactionContract:z.record(z.string(),z.unknown()).optional()}).strict();
14
- export function parseDefinition(input) {
15
- let value;try{value=definitionSchema.parse(input);}catch{throw new Error('PROCEDURAL_MANIFEST_INVALID');}
16
- if(JSON.stringify(value).length>24576)throw new Error('PROCEDURAL_MANIFEST_LIMIT');
17
- if(new Set((value.surfaces||[]).map(s=>s.id)).size!==(value.surfaces||[]).length)throw new Error('PROCEDURAL_MANIFEST_INVALID');
18
- const safe=(v,depth=0)=>{if(depth>16)throw new Error('PROCEDURAL_MANIFEST_INVALID');if(!v||typeof v!=='object')return;for(const[k,item]of Object.entries(v)){if(['__proto__','constructor','prototype'].includes(k))throw new Error('PROCEDURAL_MANIFEST_INVALID');safe(item,depth+1);}};safe(value);
19
- try{validateAssetManifest({...value,source:{kind:'compiled',key:'pending'}});}catch{throw new Error('PROCEDURAL_MANIFEST_INVALID');}
20
- return value;
21
- }
22
- export function canonical(value) {if(value===null||typeof value!=='object')return JSON.stringify(value);if(Array.isArray(value))return `[${value.map(canonical).join(',')}]`;return `{${Object.keys(value).sort().map(k=>`${JSON.stringify(k)}:${canonical(value[k])}`).join(',')}}`;}
@@ -1,40 +0,0 @@
1
- import { ProgrammaticAssetBuilder } from './ProgrammaticAssetBuilder.js';
2
- import { assetDigest, canonicalAssetJson } from '../../modules/asset/model/AssetInputContracts.js';
3
- import { createAssetModule } from '../../modules/asset/AssetModule.js';
4
- import { ArticulationVerifier } from '../../modules/world/verification/ArticulationVerifier.js';
5
-
6
- // Published bytes cross the Studio bridge; compile and verify them locally before
7
- // the existing Scene mutation, never accept a remote physics verdict as evidence.
8
- export async function prepareEmbeddedCodeAsset(assets, input, { gltfLoader } = {}) {
9
- const asset=`asset://sha256/${input.id.replace(/^(pa_|asset_)/,'')}`;
10
- const sourceHash=await assetDigest(input.bytes);
11
- const definitionHash=await assetDigest(new TextEncoder().encode(canonicalAssetJson(input.definition)));
12
- if(assets.hasAsset(input.id)) {
13
- const existing=assets.getManifest(input.id);
14
- if(existing.provenance?.codeTransport?.sourceHash!==sourceHash || existing.provenance?.codeTransport?.definitionHash!==definitionHash)throw new Error('ASSET_ID_CONFLICT');
15
- return {asset,install:operation=>operation()};
16
- }
17
- const scratch=createAssetModule({volatile:true,manifests:{},manifestStore:null,libraryStore:null,gltfLoader});
18
- scratch.configureVerification({articulationVerifier:new ArticulationVerifier({assetRegistry:scratch.registry,assetLoader:scratch.loader})});
19
- const {manifest}=await scratch.importPackageAsset({id:input.id,bytes:input.bytes,definition:input.definition});
20
- manifest.provenance={...manifest.provenance,codeTransport:{sourceHash,definitionHash}};
21
- const bytes=(await scratch.compiledStore.get(manifest.source.key)).bytes;
22
- const expectedSourceHash=await assetDigest(bytes);
23
- return {asset,install:operation=>assets.installPreparedAssets([{manifest,bytes,expectedDefinition:manifest,expectedSourceHash}],operation)};
24
- }
25
-
26
- export async function prepareThreeCodeAsset(assets, executor, input, { signal, gltfLoader } = {}) {
27
- if (!executor) throw new Error('CODE_EXECUTION_DISABLED');
28
- const environment = await executor.environment();
29
- const version = await assetDigest(new TextEncoder().encode(canonicalAssetJson({ source: input.source, definition: input.definition || null, environment, contract: 'three-code-v1' })));
30
- const id = `asset_${version}`, asset = `asset://sha256/${version}`;
31
- if (signal?.aborted) throw new Error('BUILD_CANCELLED');
32
- if (assets.hasAsset(id)) return { asset, manifest: assets.getManifest(id), install: operation => operation() };
33
- const built = await new ProgrammaticAssetBuilder({ runner: executor, gltfLoader }).build({ ...input, assetId: id }, { signal });
34
- if (signal?.aborted) throw new Error('BUILD_CANCELLED');
35
- built.manifest.contentHash = version;
36
- const bytesHash = await assetDigest(built.bytes);
37
- return { asset, manifest: built.manifest, validation: built.validation,
38
- install: operation => assets.installPreparedAssets([{manifest:built.manifest,bytes:built.bytes,
39
- expectedDefinition:built.manifest,expectedSourceHash:bytesHash}],operation) };
40
- }
@@ -1,79 +0,0 @@
1
- import { sceneError } from './SceneContracts.js';
2
-
3
- /**
4
- * Read-only capability projection for assets, environment contracts and
5
- * executable Code Project entities. The underlying owners retain their state.
6
- */
7
- export function describeCapabilities(inspection) {
8
- return (inspection.actions || []).map(action => {
9
- const name = action.name || action.action;
10
- return {
11
- id: [inspection.id, action.partName || '$root', name].join(':'),
12
- target: inspection.id,
13
- name,
14
- action: 'invoke',
15
- source: inspection.source,
16
- executor: action.execution,
17
- ...(action.partName ? { partName: action.partName } : {}),
18
- ...(action.capabilitySource ? { capabilitySource: action.capabilitySource } : {}),
19
- ...(action.graspVerified === false ? { graspVerified:false } : {}),
20
- description: action.description || '',
21
- parameters: structuredClone(action.parameters || {}),
22
- available: action.available ?? null,
23
- ...(action.reason ? { reason: action.reason } : {}),
24
- ...(action.canApproach ? { canApproach: true } : {}),
25
- verification: action.contract?.verifierTarget?.type
26
- || action.verification || inspection.evidenceKind || 'unverified'
27
- };
28
- });
29
- }
30
-
31
- export function inspectCapabilities(world, target, { actor } = {}) {
32
- const physical = world.affordances?.inspect(target, { actorId: actor }) || null;
33
- const project = world.projectCapabilities?.has(target)
34
- ? world.projectCapabilities.inspect(target, { actor }) : null;
35
- if (!physical && !project) return null;
36
- if (!physical || !project) {
37
- const inspection = physical || project;
38
- return { ...inspection, capabilities:describeCapabilities(inspection),
39
- ...(world.thermal?.inspect?.(target)?{simulation:world.thermal.inspect(target)}:{}) };
40
- }
41
-
42
- // A single logical entity can expose independent physical and project state.
43
- // No provider state is copied back into the other provider.
44
- const stateProviders = { [physical.source]:structuredClone(physical.state || {}),
45
- project:structuredClone(project.state || {}) };
46
- const collisions = Object.keys(stateProviders.project).filter(key => Object.hasOwn(stateProviders[physical.source], key));
47
- const state = { ...stateProviders[physical.source] };
48
- for (const [key, value] of Object.entries(stateProviders.project)) {
49
- if (!Object.hasOwn(state, key)) state[key] = value;
50
- }
51
- const entries = [...describeCapabilities(physical), ...describeCapabilities(project)];
52
- const counts = new Map();
53
- for (const entry of entries) counts.set(entry.id, (counts.get(entry.id) || 0) + 1);
54
- const capabilities = entries.map(entry => ({
55
- ...entry, ...(counts.get(entry.id) > 1 ? {id:entry.id + ':' + entry.source} : {})
56
- }));
57
- return { ...physical, source:'composite', providers:[physical.source,'project'],
58
- state, stateProviders, stateConflicts:collisions,
59
- actions:[...(physical.actions || []),...(project.actions || []).map(action => ({...action,source:'project'}))],
60
- capabilities, ...(world.thermal?.inspect?.(target)?{simulation:world.thermal.inspect(target)}:{}) };
61
- }
62
-
63
- /** Resolve a registered action without ever inferring permission from its name. */
64
- export function resolveCapability(world, { target, name, actor, partName, source }) {
65
- const inspection = inspectCapabilities(world, target, { actor });
66
- if (!inspection) throw sceneError('OBJECT_NOT_FOUND');
67
- const matches = inspection.capabilities.filter(entry =>
68
- entry.name === name && (partName == null || entry.partName === partName)
69
- && (source == null || entry.source === source));
70
- if (!matches.length) throw sceneError('ACTION_UNSUPPORTED');
71
- if (matches.length !== 1) {
72
- if (new Set(matches.map(item => item.source)).size > 1) throw sceneError('ACTION_SOURCE_REQUIRED');
73
- throw sceneError('ACTION_PART_REQUIRED');
74
- }
75
- const capability = matches[0];
76
- if (!['interaction', 'world-action', 'project-action'].includes(capability.executor))
77
- throw sceneError('ACTION_NOT_INVOKABLE');
78
- return { source: capability.source, capability };
79
- }
@@ -1,54 +0,0 @@
1
- /**
2
- * Session-local bounded idempotency: replay in-flight and recently settled
3
- * requests. Oldest settled records may be evicted under pressure; never evict
4
- * a running request. Callers must check capacity before starting a mutation.
5
- */
6
- export function createRequestWindow({
7
- now = () => Date.now(), limit = 256, retentionMs = 300_000,
8
- conflictCode = 'IDEMPOTENCY_CONFLICT', limitCode = 'REQUEST_BUDGET_EXHAUSTED'
9
- } = {}) {
10
- const records = new Map();
11
- const issue = code => Object.assign(new Error(code), { code });
12
-
13
- const prune = () => {
14
- const current = now();
15
- for (const [id, entry] of records) {
16
- if (entry.settledAt !== null && current - entry.settledAt >= retentionMs)
17
- records.delete(id);
18
- }
19
- };
20
-
21
- return {
22
- get size() { return records.size; },
23
- replay(id, fingerprint) {
24
- if (!id) return null;
25
- prune();
26
- const existing = records.get(id);
27
- if (!existing) return null;
28
- if (existing.fingerprint !== fingerprint) throw issue(conflictCode);
29
- return existing.promise;
30
- },
31
- ensureCapacity() {
32
- prune();
33
- if (records.size >= limit) {
34
- for (const [id, entry] of records) {
35
- if (entry.settledAt !== null) {
36
- records.delete(id);
37
- if (records.size < limit) break;
38
- }
39
- }
40
- }
41
- if (records.size >= limit) throw issue(limitCode);
42
- },
43
- track(id, fingerprint, promise) {
44
- if (!id) return;
45
- const entry = { fingerprint, promise, settledAt: null };
46
- records.set(id, entry);
47
- const settled = () => { entry.settledAt = now(); };
48
- // The failure handler is required; tracking must not create an
49
- // unhandled rejection for an operation that the caller will catch.
50
- void promise.then(settled, settled);
51
- },
52
- clear() { records.clear(); }
53
- };
54
- }
@@ -1,21 +0,0 @@
1
- import { AgentTools } from '../AgentTools.js';
2
- import { SCENE_LEGACY_SKILLS } from './SceneSkillNames.js';
3
-
4
- const sceneSkillNames = new Set(SCENE_LEGACY_SKILLS);
5
-
6
- /**
7
- * Explicit Studio adapter for the legacy Scene skill surface.
8
- * All other tool calls retain AgentTools' registry, context and observability behavior.
9
- */
10
- export class SceneAgentTools extends AgentTools {
11
- constructor(runtime, scene, options = {}) {
12
- super(runtime, options);
13
- if (typeof scene?.executeSkill !== 'function') throw new TypeError('SceneAgentTools requires a Scene facade');
14
- this.scene = scene;
15
- }
16
-
17
- call(name, args = {}, internalContext = {}) {
18
- if (sceneSkillNames.has(name)) return this.scene.executeSkill(name, args);
19
- return super.call(name, args, internalContext);
20
- }
21
- }
@@ -1,45 +0,0 @@
1
- import * as z from 'zod/v4';
2
- import { recipeSchema } from '../../modules/asset/model/AssetInputContracts.js';
3
- import { mechanicalDraftSchema } from '../../modules/asset/model/MechanicalAssetDraft.js';
4
- import { sceneObjectIdSchema as id, sceneTransformSchema, sceneVector3Schema } from './SceneProject.js';
5
-
6
- export const sceneError = (code, message = code) => Object.assign(new Error(message), { code });
7
- export const ref = z.string().regex(/^(builtin:\/\/[a-zA-Z][a-zA-Z0-9_-]{0,63}|asset:\/\/sha256\/[a-f0-9]{64})$/);
8
- export const level = z.enum(['visual', 'physical', 'interactive']).default('physical');
9
- export const modelSchema = z.object({ id, asset: ref, level, transform: sceneTransformSchema.optional(), position: sceneVector3Schema.optional() }).strict().refine(v => !v.transform || !v.position, 'Use transform or position');
10
- export const sceneAgentModelSchema = z.object({ id, asset: z.union([ref, recipeSchema, mechanicalDraftSchema]), level: z.enum(['visual', 'physical', 'interactive']).optional(), transform: sceneTransformSchema.optional(), position: sceneVector3Schema.optional() }).strict().refine(v => !v.transform || !v.position, 'Use transform or position');
11
- export const operations = z.discriminatedUnion('type', [
12
- z.object({ type: z.literal('add'), model: modelSchema }).strict(),
13
- z.object({ type: z.literal('setTransform'), id, transform: sceneTransformSchema }).strict(),
14
- z.object({ type: z.literal('remove'), id }).strict(),
15
- z.object({ type: z.literal('replaceAsset'), id, asset: ref, level }).strict()
16
- ]);
17
- export const applySchema = z.object({ requestId: z.union([id,z.uuid()]).optional(), expectedRevision: z.number().int().nonnegative().optional(), operations: z.array(operations).min(1).max(32) }).strict();
18
- const operationVector = sceneVector3Schema.refine(value => Math.hypot(...value) > 1e-6, 'Direction must be nonzero');
19
- const affordanceTarget = z.string().regex(/^[A-Za-z][A-Za-z0-9_:-]{0,255}$/);
20
- export const sceneInteractionSchema = z.discriminatedUnion('action', [
21
- z.object({ action:z.literal('invoke'), target:z.string().min(1).max(256), name:z.string().min(1).max(256), actor:id.optional(), partName:id.optional(), source:z.enum(['asset','environment','project']).optional(), args:z.record(z.string(),z.unknown()).default({}) }).strict(),
22
- z.object({ action: z.literal('custom'), target: z.string().min(1).max(256), name: z.string().min(1).max(256), actor: id.optional(), args: z.record(z.string(), z.unknown()).default({}) }).strict(),
23
- z.object({ action: z.literal('navigate'), actor: id, position: sceneVector3Schema }).strict(),
24
- z.object({ action: z.literal('activate'), actor: id, target: affordanceTarget }).strict(),
25
- z.object({ action: z.literal('pickup'), actor: id, target: affordanceTarget }).strict(),
26
- z.object({ action: z.literal('place'), actor: id, target: affordanceTarget, surfaceId: id.optional() }).strict(),
27
- z.object({ action: z.enum(['open', 'close']), actor: id, target: affordanceTarget, partName: id.optional() }).strict(),
28
- z.object({ action: z.enum(['turn_on', 'turn_off', 'pull_out', 'return']), actor: id, target: affordanceTarget }).strict(),
29
- z.object({ action: z.literal('write'), actor: id, target: affordanceTarget, args: z.object({ text: z.string().max(100) }).strict() }).strict(),
30
- z.object({ action: z.enum(['push', 'drag']), actor: id, target: affordanceTarget, args: z.object({
31
- direction: operationVector.refine(value => Math.abs(value[1]) < 1e-6, 'Linear contact operations require a horizontal direction'),
32
- distance: z.number().positive().max(5), maxForce: z.number().positive().max(1000).default(100)
33
- }).strict() }).strict(),
34
- z.object({ action: z.literal('rotate'), actor: id, target: affordanceTarget, args: z.object({
35
- axis: operationVector, angle: z.number().finite().min(-Math.PI).max(Math.PI).refine(value => value !== 0),
36
- maxTorque: z.number().positive().max(1000).default(100)
37
- }).strict() }).strict(),
38
- z.object({ action: z.literal('slide'), actor: id, target: affordanceTarget, args: z.object({ part: id,
39
- target: z.number().finite().optional(), distance: z.number().finite().optional()
40
- }).strict().refine(value => (value.target != null) !== (value.distance != null), 'Use target or distance') }).strict(),
41
- z.object({ action: z.literal('rotateJoint'), actor: id, target: affordanceTarget, args: z.object({ part: id,
42
- target: z.number().finite().optional(), angle: z.number().finite().min(-Math.PI).max(Math.PI).optional()
43
- }).strict().refine(value => (value.target != null) !== (value.angle != null), 'Use target or angle') }).strict()
44
- ]);
45
- export const diagnostic = error => ({ code: error.code || 'INVALID_OPERATION', message: error.code || 'Operation failed', stage: 'scene', retryable: false });