@nebula-spatial/studio 0.0.0-stage → 0.1.1

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 (262) hide show
  1. package/README.md +206 -3
  2. package/dist/ai/contract.d.ts +73 -0
  3. package/dist/ai/host.d.ts +28 -0
  4. package/dist/asset/dependency-scan.d.ts +78 -0
  5. package/dist/asset/intake.d.ts +84 -0
  6. package/dist/asset/layout-detect.d.ts +40 -0
  7. package/dist/asset/media-type.d.ts +10 -0
  8. package/dist/asset/model-inspection.d.ts +127 -0
  9. package/dist/asset/record.d.ts +35 -0
  10. package/dist/asset/remote-asset-resolver.d.ts +36 -0
  11. package/dist/asset/repairs.d.ts +53 -0
  12. package/dist/asset/resource-locator.d.ts +15 -0
  13. package/dist/asset/revision-diff.d.ts +33 -0
  14. package/dist/asset/source-contracts.d.ts +21 -0
  15. package/dist/asset/source-paths.d.ts +15 -0
  16. package/dist/asset/usd-inspection.d.ts +39 -0
  17. package/dist/asset/usd-source-metadata.d.ts +142 -0
  18. package/dist/asset/visual-intake.d.ts +27 -0
  19. package/dist/asset/visual-record.d.ts +22 -0
  20. package/dist/asset/web-intake.d.ts +46 -0
  21. package/dist/asset-source-BExlEcRt.js +444 -0
  22. package/dist/assets/openusd_three_loader-DLiqJWUM.js +13769 -0
  23. package/dist/assets/usd-export-worker-BRxTLqer.js +182 -0
  24. package/dist/assets/usd-worker-DekqMsQv.js +1392 -0
  25. package/dist/builders-BAXRR5o5.js +1854 -0
  26. package/dist/core/asset-task.d.ts +105 -0
  27. package/dist/core/context.d.ts +23 -0
  28. package/dist/core/host.d.ts +432 -0
  29. package/dist/core/persistence-controller.d.ts +58 -0
  30. package/dist/core/plugins.d.ts +139 -0
  31. package/dist/core/scene-tree.d.ts +62 -0
  32. package/dist/core/versions.d.ts +2 -0
  33. package/dist/core/when.d.ts +13 -0
  34. package/dist/core/write-policy.d.ts +29 -0
  35. package/dist/delivery/build-plan.d.ts +2 -0
  36. package/dist/delivery/contracts.d.ts +362 -0
  37. package/dist/delivery/digest.d.ts +3 -0
  38. package/dist/delivery/evidence.d.ts +10 -0
  39. package/dist/delivery/export-evidence.d.ts +3 -0
  40. package/dist/delivery/index.d.ts +9 -0
  41. package/dist/delivery/prim-name.d.ts +17 -0
  42. package/dist/delivery/profile.d.ts +4 -0
  43. package/dist/doc/builders.d.ts +99 -0
  44. package/dist/doc/command.d.ts +195 -0
  45. package/dist/doc/domain-extensions.d.ts +34 -0
  46. package/dist/doc/node-facts.d.ts +87 -0
  47. package/dist/doc/physics-facts.d.ts +74 -0
  48. package/dist/doc/placement-policy.d.ts +71 -0
  49. package/dist/doc/random-placement.d.ts +30 -0
  50. package/dist/doc/scene-graph.d.ts +80 -0
  51. package/dist/doc/scene-regions.d.ts +29 -0
  52. package/dist/doc/schema.d.ts +452 -0
  53. package/dist/doc/task.d.ts +71 -0
  54. package/dist/doc/validate.d.ts +68 -0
  55. package/dist/editor/asset-source.d.ts +15 -0
  56. package/dist/editor/editor.d.ts +246 -0
  57. package/dist/editor/index.d.ts +22 -0
  58. package/dist/editor/shortcuts.d.ts +2 -0
  59. package/dist/editor/types.d.ts +143 -0
  60. package/dist/editor/ui-plugins.d.ts +64 -0
  61. package/dist/editor.js +1755 -0
  62. package/dist/editorial-BkAFWfbg.js +83 -0
  63. package/dist/export-evidence-DMNRhgL9.js +2705 -0
  64. package/dist/generalization/domain.d.ts +10 -0
  65. package/dist/generalization/generalization.d.ts +371 -0
  66. package/dist/generalization/index.d.ts +11 -0
  67. package/dist/generalization.js +1659 -0
  68. package/dist/history/undo-stack.d.ts +74 -0
  69. package/dist/index.d.ts +91 -0
  70. package/dist/index.js +2840 -0
  71. package/dist/mjcf-visual-Bt4bUxd1.js +72 -0
  72. package/dist/mujoco-runtime-BYZnrvbR.js +467 -0
  73. package/dist/persist/content-addressed.d.ts +11 -0
  74. package/dist/persist/create-scene-package-from-host.d.ts +7 -0
  75. package/dist/persist/indexeddb-store.d.ts +69 -0
  76. package/dist/persist/scene-file.d.ts +52 -0
  77. package/dist/persist/scene-package.d.ts +8 -0
  78. package/dist/persist/snapshot.d.ts +5 -0
  79. package/dist/physics-facts-tfQYyNTD.js +337 -0
  80. package/dist/placement-policy-DY_FNRDu.js +405 -0
  81. package/dist/ports/asset-ingestor.d.ts +41 -0
  82. package/dist/ports/asset-source.d.ts +57 -0
  83. package/dist/ports/delivery.d.ts +13 -0
  84. package/dist/ports/persistence.d.ts +29 -0
  85. package/dist/project/asset-catalog.d.ts +21 -0
  86. package/dist/project/contracts.d.ts +272 -0
  87. package/dist/project/editorial.d.ts +16 -0
  88. package/dist/project/identity.d.ts +20 -0
  89. package/dist/project/index.d.ts +9 -0
  90. package/dist/project/scene-document.d.ts +5 -0
  91. package/dist/project/source-dependencies.d.ts +7 -0
  92. package/dist/remote-asset-resolver-Cb8cfNmw.js +136 -0
  93. package/dist/scene/index.d.ts +12 -0
  94. package/dist/scene-graph-DBLKAhxa.js +681 -0
  95. package/dist/scene-session-Cy6vDJ1l.js +21981 -0
  96. package/dist/scene.js +244 -0
  97. package/dist/session-BRBrCLdd.js +963 -0
  98. package/dist/session-DI5tPJxn.js +825 -0
  99. package/dist/session-q3uuG7OP.js +296 -0
  100. package/dist/studio/delivery-catalog.d.ts +28 -0
  101. package/dist/studio/in-memory-asset-source.d.ts +15 -0
  102. package/dist/studio/index.d.ts +31 -0
  103. package/dist/studio/indexeddb-asset-source.d.ts +32 -0
  104. package/dist/studio/indexeddb-persistence.d.ts +13 -0
  105. package/dist/studio/remote-asset-importer.d.ts +56 -0
  106. package/dist/studio/source-package.d.ts +9 -0
  107. package/dist/studio/usd-export-client.d.ts +13 -0
  108. package/dist/studio/usd-export-protocol.d.ts +98 -0
  109. package/dist/studio/usd-export-worker.d.ts +1 -0
  110. package/dist/studio/usd-zip-reader.d.ts +14 -0
  111. package/dist/studio/web-asset-ingestor.d.ts +10 -0
  112. package/dist/studio/web-host.d.ts +8 -0
  113. package/dist/studio.js +5545 -0
  114. package/dist/urdf-session-CQir2nb2.js +1230 -0
  115. package/dist/usd-session-DZJnEEOs.js +7385 -0
  116. package/dist/util/asset-facts.d.ts +3 -0
  117. package/dist/util/data.d.ts +17 -0
  118. package/dist/util/diagnostics.d.ts +38 -0
  119. package/dist/util/geometry.d.ts +11 -0
  120. package/dist/util/hash.d.ts +9 -0
  121. package/dist/util/ids.d.ts +20 -0
  122. package/dist/util/math.d.ts +47 -0
  123. package/dist/util/ply-metadata.d.ts +19 -0
  124. package/dist/util/studio-source.d.ts +23 -0
  125. package/dist/version.d.ts +5 -0
  126. package/dist/view/appearance.d.ts +13 -0
  127. package/dist/view/authoring-appearance.d.ts +25 -0
  128. package/dist/view/bounds-preview.d.ts +34 -0
  129. package/dist/view/bounds.d.ts +11 -0
  130. package/dist/view/camera-zoom.d.ts +3 -0
  131. package/dist/view/geometry-anchors.d.ts +20 -0
  132. package/dist/view/gizmo-appearance.d.ts +5 -0
  133. package/dist/view/gizmo.d.ts +81 -0
  134. package/dist/view/group-selection.d.ts +13 -0
  135. package/dist/view/node-features.d.ts +39 -0
  136. package/dist/view/picking.d.ts +49 -0
  137. package/dist/view/placement.d.ts +48 -0
  138. package/dist/view/region-editing.d.ts +25 -0
  139. package/dist/view/rotation-guide.d.ts +36 -0
  140. package/dist/view/runtime-capabilities.d.ts +22 -0
  141. package/dist/view/scene-session.d.ts +258 -0
  142. package/dist/view/screen-bounds.d.ts +17 -0
  143. package/dist/view/selection-transform.d.ts +20 -0
  144. package/dist/wasm-module-DZn2AM1W.js +13 -0
  145. package/dist/xacro-DLRXyk60.js +76 -0
  146. package/node_modules/@nebula-spatial/cad-loader/CHANGELOG.md +48 -0
  147. package/node_modules/@nebula-spatial/cad-loader/README.md +108 -0
  148. package/node_modules/@nebula-spatial/cad-loader/dist/core/cad-types.d.ts +26 -0
  149. package/node_modules/@nebula-spatial/cad-loader/dist/core/errors.d.ts +5 -0
  150. package/node_modules/@nebula-spatial/cad-loader/dist/core/index.d.ts +24 -0
  151. package/node_modules/@nebula-spatial/cad-loader/dist/core/index.js +2354 -0
  152. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-group-reader.d.ts +9 -0
  153. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-parser.d.ts +78 -0
  154. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/dxbs-sidecar.d.ts +24 -0
  155. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/geometry-segments.d.ts +20 -0
  156. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/text-roundtrip.d.ts +4 -0
  157. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/types.d.ts +81 -0
  158. package/node_modules/@nebula-spatial/cad-loader/dist/core/runtime-text-decoder.d.ts +8 -0
  159. package/node_modules/@nebula-spatial/cad-loader/dist/core/types.d.ts +153 -0
  160. package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/insert-bbox.d.ts +10 -0
  161. package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/viewport-rect.d.ts +21 -0
  162. package/node_modules/@nebula-spatial/cad-loader/dist/index.d.ts +36 -0
  163. package/node_modules/@nebula-spatial/cad-loader/dist/index.js +5829 -0
  164. package/node_modules/@nebula-spatial/cad-loader/dist/loader/geo-loader.d.ts +59 -0
  165. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/automatic-external-resources.d.ts +26 -0
  166. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/external-variant-sidecar-fetch.d.ts +13 -0
  167. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/flow-control.d.ts +29 -0
  168. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/frame-budget-scheduler.d.ts +21 -0
  169. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-compact-executor.d.ts +19 -0
  170. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-local-adapter.d.ts +2 -0
  171. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-pipeline.d.ts +92 -0
  172. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-worker-adapter.d.ts +13 -0
  173. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-builder.d.ts +34 -0
  174. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-load-sink.d.ts +28 -0
  175. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node.d.ts +304 -0
  176. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare-worker-types.d.ts +94 -0
  177. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.d.ts +38 -0
  178. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.worker.d.ts +1 -0
  179. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-model-builder.d.ts +10 -0
  180. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-runtime-geometry.d.ts +15 -0
  181. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-canonical.d.ts +37 -0
  182. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-quality.d.ts +9 -0
  183. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/prepare-credit-gate.d.ts +20 -0
  184. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/transport.d.ts +2 -0
  185. package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/cad-render-node.d.ts +80 -0
  186. package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/geo-node-cad-render-node.d.ts +12 -0
  187. package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-geometry.d.ts +28 -0
  188. package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-material.d.ts +18 -0
  189. package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/block-geometry-registry.d.ts +35 -0
  190. package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/insert-instance-table.d.ts +23 -0
  191. package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/viewport-instance-presenter.d.ts +66 -0
  192. package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-insert-selection.d.ts +35 -0
  193. package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-text-selection.d.ts +31 -0
  194. package/node_modules/@nebula-spatial/cad-loader/dist/session/annotation-idle-gate.d.ts +14 -0
  195. package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-document-session.d.ts +187 -0
  196. package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-font-runtime.d.ts +11 -0
  197. package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-insert-id.d.ts +6 -0
  198. package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-text-warmup.d.ts +38 -0
  199. package/node_modules/@nebula-spatial/cad-loader/dist/session/create-cad-document-session.d.ts +5 -0
  200. package/node_modules/@nebula-spatial/cad-loader/dist/session/load-session.d.ts +90 -0
  201. package/node_modules/@nebula-spatial/cad-loader/dist/session/viewport-coverage.d.ts +32 -0
  202. package/node_modules/@nebula-spatial/cad-loader/dist/shared/abort.d.ts +3 -0
  203. package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-display-color.d.ts +55 -0
  204. package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-load-source.d.ts +8 -0
  205. package/node_modules/@nebula-spatial/cad-loader/dist/shared/color-buffer.d.ts +6 -0
  206. package/node_modules/@nebula-spatial/cad-loader/dist/shared/constants.d.ts +11 -0
  207. package/node_modules/@nebula-spatial/cad-loader/dist/shared/display-color-buffer.d.ts +27 -0
  208. package/node_modules/@nebula-spatial/cad-loader/dist/shared/errors.d.ts +2 -0
  209. package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-builder.d.ts +25 -0
  210. package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-font.d.ts +12 -0
  211. package/node_modules/@nebula-spatial/cad-loader/dist/shared/types.d.ts +57 -0
  212. package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/insert-bbox.d.ts +1 -0
  213. package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/timing.d.ts +2 -0
  214. package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/viewport-rect.d.ts +1 -0
  215. package/node_modules/@nebula-spatial/cad-loader/dist/shared/viewer-theme.d.ts +2 -0
  216. package/node_modules/@nebula-spatial/cad-loader/dist/workers/geo-prepare.worker.js +2264 -0
  217. package/node_modules/@nebula-spatial/cad-loader/package.json +62 -0
  218. package/node_modules/@nebula-spatial/viewer/CHANGELOG.md +426 -0
  219. package/node_modules/@nebula-spatial/viewer/FBX-MATERIAL-CONVERSION.md +97 -0
  220. package/node_modules/@nebula-spatial/viewer/README.md +1056 -0
  221. package/node_modules/@nebula-spatial/viewer/USD-VISUAL-MATERIAL-SUPPORT.md +89 -0
  222. package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.js +19 -0
  223. package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.wasm +0 -0
  224. package/node_modules/@nebula-spatial/viewer/dist/asset-ir-DEOK9SqE.js +382 -0
  225. package/node_modules/@nebula-spatial/viewer/dist/assets/ground-grid.d.ts +6 -0
  226. package/node_modules/@nebula-spatial/viewer/dist/assets/source-types.d.ts +19 -0
  227. package/node_modules/@nebula-spatial/viewer/dist/assets/types.d.ts +393 -0
  228. package/node_modules/@nebula-spatial/viewer/dist/assets/usd-worker-Bom5cjz3.js +1392 -0
  229. package/node_modules/@nebula-spatial/viewer/dist/cad/text.d.ts +2 -0
  230. package/node_modules/@nebula-spatial/viewer/dist/cad/types.d.ts +368 -0
  231. package/node_modules/@nebula-spatial/viewer/dist/index-ByBlfVc0.js +12132 -0
  232. package/node_modules/@nebula-spatial/viewer/dist/index.d.ts +32 -0
  233. package/node_modules/@nebula-spatial/viewer/dist/index.js +26 -0
  234. package/node_modules/@nebula-spatial/viewer/dist/inspection/types.d.ts +112 -0
  235. package/node_modules/@nebula-spatial/viewer/dist/mjcf-visual-DVRa0w90.js +72 -0
  236. package/node_modules/@nebula-spatial/viewer/dist/mujoco-runtime-Dhx6Ua2u.js +463 -0
  237. package/node_modules/@nebula-spatial/viewer/dist/plugins.d.ts +179 -0
  238. package/node_modules/@nebula-spatial/viewer/dist/scene/instances.d.ts +36 -0
  239. package/node_modules/@nebula-spatial/viewer/dist/scene/types.d.ts +258 -0
  240. package/node_modules/@nebula-spatial/viewer/dist/session-B-j6KdA-.js +389 -0
  241. package/node_modules/@nebula-spatial/viewer/dist/session-B4AICTeJ.js +963 -0
  242. package/node_modules/@nebula-spatial/viewer/dist/session-BAG5cDYe.js +9153 -0
  243. package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-runtime.d.ts +118 -0
  244. package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-wasm-module.d.ts +11 -0
  245. package/node_modules/@nebula-spatial/viewer/dist/simulation/openusd-wasm-module.d.ts +10 -0
  246. package/node_modules/@nebula-spatial/viewer/dist/simulation/physics-runtime-state.d.ts +75 -0
  247. package/node_modules/@nebula-spatial/viewer/dist/simulation/types.d.ts +129 -0
  248. package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-inspection.d.ts +66 -0
  249. package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-query.d.ts +50 -0
  250. package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-resource-policy.d.ts +28 -0
  251. package/node_modules/@nebula-spatial/viewer/dist/types.d.ts +278 -0
  252. package/node_modules/@nebula-spatial/viewer/dist/ui/types.d.ts +48 -0
  253. package/node_modules/@nebula-spatial/viewer/dist/urdf-session-kemAnBn8.js +3231 -0
  254. package/node_modules/@nebula-spatial/viewer/dist/usd-session-QtwGKI7v.js +6771 -0
  255. package/node_modules/@nebula-spatial/viewer/dist/version.d.ts +5 -0
  256. package/node_modules/@nebula-spatial/viewer/dist/viewer.d.ts +2 -0
  257. package/node_modules/@nebula-spatial/viewer/dist/xacro-CYTPS7mh.js +1537 -0
  258. package/node_modules/@nebula-spatial/viewer/openusd/openusd-runtime-manifest.json +15 -0
  259. package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.js +14 -0
  260. package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.wasm +0 -0
  261. package/node_modules/@nebula-spatial/viewer/package.json +66 -0
  262. package/package.json +87 -6
@@ -0,0 +1,99 @@
1
+ import type { CommandRecord, CreateCommandRecordOptions, MetaPatch } from './command';
2
+ import { type AssetRevision, type CoordinateSystem, type InstanceRole, type LocalTransform, type NodePivot, type ObjectSemantic, type PhysicsOverride, type SceneAppearance, type SceneAssetNode, type SceneDocumentDomainPayload, type SceneDocument, type SceneDomainNode, type SceneEnvironment, type SceneNode, type ScenePlaceholderNode, type SceneSemantic, type SceneVisualNode, type StudioExternalAssetRef, type VisualAppearance, type VisualAssetRevision, type VisualRenderLayer, type VisualSelectionMode, type Vec3 } from './schema';
3
+ export declare const CREATE_NODE_DIAGNOSTIC: {
4
+ readonly revisionMissing: "SIM_CREATE_NODE_REVISION_MISSING";
5
+ };
6
+ export interface CreateAssetNodeIntent {
7
+ readonly revisionId: string;
8
+ readonly label: string;
9
+ readonly role: InstanceRole;
10
+ readonly localTransform?: LocalTransform;
11
+ readonly origin?: NodePivot;
12
+ readonly visible?: boolean;
13
+ readonly variantSelections?: Readonly<Record<string, string>>;
14
+ readonly appearance?: SceneAppearance;
15
+ readonly physics?: PhysicsOverride;
16
+ readonly initialPose?: Readonly<Record<string, number>>;
17
+ readonly semantic?: ObjectSemantic;
18
+ readonly nodeId?: string;
19
+ }
20
+ export declare function createAssetNodeFromRevision(revision: AssetRevision, intent: CreateAssetNodeIntent): SceneAssetNode;
21
+ export declare function defaultPhysicsForAsset(revision: AssetRevision): PhysicsOverride;
22
+ export interface CreateVisualNodeIntent {
23
+ readonly visualRevisionId: string;
24
+ readonly label: string;
25
+ readonly localTransform?: LocalTransform;
26
+ readonly origin?: NodePivot;
27
+ readonly visible?: boolean;
28
+ readonly renderLayer?: VisualRenderLayer;
29
+ readonly selectionMode?: VisualSelectionMode;
30
+ readonly appearance?: VisualAppearance;
31
+ readonly semantic?: ObjectSemantic;
32
+ readonly nodeId?: string;
33
+ }
34
+ export declare function createVisualNodeFromRevision(revision: VisualAssetRevision, intent: CreateVisualNodeIntent): SceneVisualNode;
35
+ export declare function buildAddNode(node: SceneNode, parentNodeId: string, options: CommandOptions): CommandRecord;
36
+ export declare function buildRemoveNode(document: SceneDocument, nodeId: string, options: CommandOptions): CommandRecord;
37
+ export declare function buildTransformNode(document: SceneDocument, nodeId: string, after: LocalTransform, options: CommandOptions): CommandRecord;
38
+ export declare function buildSetNodeOrigin(document: SceneDocument, nodeId: string, after: NodePivot | null, options: CommandOptions): CommandRecord;
39
+ export declare function buildReparentNode(document: SceneDocument, nodeId: string, toParentNodeId: string, options: CommandOptions): CommandRecord;
40
+ export interface GroupNodesOptions extends CommandOptions {
41
+ readonly groupId?: string;
42
+ readonly groupLabel: string;
43
+ }
44
+ /** Creates a group and world-preserving reparent commands as one atomic batch. */
45
+ export declare function buildGroupNodes(document: SceneDocument, nodeIds: readonly string[], parentNodeId: string, options: GroupNodesOptions): readonly CommandRecord[];
46
+ /** Removes a group while preserving each child's world transform. */
47
+ export declare function buildUngroupNode(document: SceneDocument, groupNodeId: string, options: CommandOptions): readonly CommandRecord[];
48
+ export declare function buildRenameNode(document: SceneDocument, nodeId: string, after: string, options: CommandOptions): CommandRecord;
49
+ export declare function buildSetRole(document: SceneDocument, nodeId: string, after: InstanceRole, options: CommandOptions): CommandRecord;
50
+ export declare function buildSetPhysics(document: SceneDocument, nodeId: string, after: PhysicsOverride, options: CommandOptions): CommandRecord;
51
+ export declare function buildSetInitialPose(document: SceneDocument, nodeId: string, after: Readonly<Record<string, number>> | null, options: CommandOptions): CommandRecord;
52
+ export declare function buildSetAppearance(document: SceneDocument, nodeId: string, after: SceneAppearance | null, options: CommandOptions): CommandRecord;
53
+ export declare function buildSetVisible(document: SceneDocument, nodeId: string, after: boolean, options: CommandOptions): CommandRecord;
54
+ export declare function buildSetPlaceholderBinding(document: SceneDocument, nodeId: string, after: string | null, options: CommandOptions): CommandRecord;
55
+ export declare function buildReplaceModel(document: SceneDocument, nodeId: string, after: SceneAssetNode | ScenePlaceholderNode, options: CommandOptions): CommandRecord;
56
+ export interface BoundingBoxDimensions {
57
+ readonly length: number;
58
+ readonly width: number;
59
+ readonly height: number;
60
+ }
61
+ export interface CreateBoundingBoxPlaceholderOptions {
62
+ readonly nodeId: string;
63
+ readonly label: string;
64
+ readonly dimensions: BoundingBoxDimensions;
65
+ readonly localUpDirection?: Vec3;
66
+ readonly position?: Vec3;
67
+ readonly role?: InstanceRole;
68
+ readonly visible?: boolean;
69
+ readonly assetRevisionId?: string;
70
+ readonly externalRef?: StudioExternalAssetRef;
71
+ readonly semantic?: ObjectSemantic;
72
+ }
73
+ export declare function createBoundingBoxPlaceholderNode(options: CreateBoundingBoxPlaceholderOptions): ScenePlaceholderNode;
74
+ export declare function buildSetVisualAppearance(document: SceneDocument, nodeId: string, after: VisualAppearance | null, options: CommandOptions): CommandRecord;
75
+ export declare function buildSetVisualSelectionMode(document: SceneDocument, nodeId: string, after: VisualSelectionMode, options: CommandOptions): CommandRecord;
76
+ export declare function buildSetVisualRenderLayer(document: SceneDocument, nodeId: string, after: VisualRenderLayer, options: CommandOptions): CommandRecord;
77
+ export declare function buildSetVariants(document: SceneDocument, nodeId: string, after: Readonly<Record<string, string>>, options: CommandOptions): CommandRecord;
78
+ export declare function buildSetNodeSemantic(document: SceneDocument, nodeId: string, after: ObjectSemantic | null, options: CommandOptions): CommandRecord;
79
+ export interface DuplicateNodeOptions extends CommandOptions {
80
+ readonly nodeId?: string;
81
+ readonly nodeLabel?: string;
82
+ }
83
+ export declare function buildDuplicateNode(document: SceneDocument, nodeId: string, parentNodeId: string, options: DuplicateNodeOptions): CommandRecord;
84
+ export declare function buildAddAsset(revision: AssetRevision, options: CommandOptions): CommandRecord;
85
+ export declare function buildAddVisualAsset(revision: VisualAssetRevision, options: CommandOptions): CommandRecord;
86
+ export declare function buildRemoveAsset(document: SceneDocument, revisionId: string, options: CommandOptions): CommandRecord;
87
+ export declare function buildRemoveVisualAsset(document: SceneDocument, visualRevisionId: string, options: CommandOptions): CommandRecord;
88
+ export declare function buildMetaUpdate(document: SceneDocument, after: MetaPatch, options: CommandOptions): CommandRecord;
89
+ export declare function buildCoordinateSystemUpdate(document: SceneDocument, after: CoordinateSystem, options: CommandOptions): CommandRecord;
90
+ export declare function buildEnvironmentUpdate(document: SceneDocument, after: SceneEnvironment, options: CommandOptions): CommandRecord;
91
+ export declare function buildSceneSemanticUpdate(document: SceneDocument, after: SceneSemantic | null, options: CommandOptions): CommandRecord;
92
+ export declare function buildDomainUpdate(document: SceneDocument, domainId: string, after: SceneDocumentDomainPayload | null, options: CommandOptions): CommandRecord;
93
+ export declare function buildSetDomainNodeData(document: SceneDocument, nodeId: string, after: Pick<SceneDomainNode, 'domainId' | 'dataVersion' | 'payload'>, options: CommandOptions): CommandRecord;
94
+ export declare function buildSetExtension(document: SceneDocument, key: string, after: unknown, options: CommandOptions): CommandRecord;
95
+ export type CommandOptions = Omit<CreateCommandRecordOptions, 'label'> & {
96
+ readonly label: string;
97
+ };
98
+ export declare function nextCopyLabel(document: SceneDocument, baseLabel: string): string;
99
+ export declare function referencedRevisionIds(document: SceneDocument): readonly string[];
@@ -0,0 +1,195 @@
1
+ import type { Diagnostic } from '../util/diagnostics';
2
+ import { type AssetRevision, type CoordinateSystem, type InstanceRole, type LocalTransform, type NodePivot, type ObjectSemantic, type PhysicsOverride, type SceneAppearance, type SceneAssetNode, type SceneDocumentDomainPayload, type SceneDocument, type SceneDomainNode, type SceneEnvironment, type SceneNode, type ScenePlaceholderNode, type SceneSemantic, type VisualAppearance, type VisualAssetRevision, type VisualRenderLayer, type VisualSelectionMode } from './schema';
3
+ export interface MetaPatch {
4
+ readonly name?: string;
5
+ readonly description?: string | null;
6
+ }
7
+ export type SceneCommand = {
8
+ readonly type: 'node.add';
9
+ readonly parentNodeId: string;
10
+ readonly node: SceneNode;
11
+ } | {
12
+ readonly type: 'node.remove';
13
+ readonly nodeId: string;
14
+ readonly parentNodeId: string;
15
+ readonly removed: SceneNode;
16
+ } | {
17
+ readonly type: 'node.duplicate';
18
+ readonly nodeId: string;
19
+ readonly parentNodeId: string;
20
+ readonly created: SceneNode;
21
+ } | {
22
+ readonly type: 'node.transform';
23
+ readonly nodeId: string;
24
+ readonly before: LocalTransform;
25
+ readonly after: LocalTransform;
26
+ } | {
27
+ readonly type: 'node.setOrigin';
28
+ readonly nodeId: string;
29
+ readonly before: NodePivot | null;
30
+ readonly after: NodePivot | null;
31
+ readonly beforeTransform: LocalTransform;
32
+ readonly afterTransform: LocalTransform;
33
+ } | {
34
+ readonly type: 'node.reparent';
35
+ readonly nodeId: string;
36
+ readonly fromParentNodeId: string;
37
+ readonly toParentNodeId: string;
38
+ readonly before: LocalTransform;
39
+ readonly after: LocalTransform;
40
+ } | {
41
+ readonly type: 'node.rename';
42
+ readonly nodeId: string;
43
+ readonly before: string;
44
+ readonly after: string;
45
+ } | {
46
+ readonly type: 'node.setRole';
47
+ readonly nodeId: string;
48
+ readonly before: InstanceRole;
49
+ readonly after: InstanceRole;
50
+ } | {
51
+ readonly type: 'node.setPhysics';
52
+ readonly nodeId: string;
53
+ readonly before: PhysicsOverride;
54
+ readonly after: PhysicsOverride;
55
+ } | {
56
+ readonly type: 'node.setInitialPose';
57
+ readonly nodeId: string;
58
+ readonly before: Readonly<Record<string, number>> | null;
59
+ readonly after: Readonly<Record<string, number>> | null;
60
+ } | {
61
+ readonly type: 'node.setAppearance';
62
+ readonly nodeId: string;
63
+ readonly before: SceneAppearance | null;
64
+ readonly after: SceneAppearance | null;
65
+ } | {
66
+ readonly type: 'node.setVisible';
67
+ readonly nodeId: string;
68
+ readonly before: boolean;
69
+ readonly after: boolean;
70
+ } | {
71
+ readonly type: 'placeholder.bind';
72
+ readonly nodeId: string;
73
+ readonly before: string | null;
74
+ readonly after: string | null;
75
+ } | {
76
+ readonly type: 'node.replaceModel';
77
+ readonly nodeId: string;
78
+ readonly parentNodeId: string;
79
+ readonly before: ScenePlaceholderNode | SceneAssetNode;
80
+ readonly after: ScenePlaceholderNode | SceneAssetNode;
81
+ } | {
82
+ readonly type: 'node.setVariants';
83
+ readonly nodeId: string;
84
+ readonly before: Readonly<Record<string, string>>;
85
+ readonly after: Readonly<Record<string, string>>;
86
+ } | {
87
+ readonly type: 'node.setSemantic';
88
+ readonly nodeId: string;
89
+ readonly before: ObjectSemantic | null;
90
+ readonly after: ObjectSemantic | null;
91
+ } | {
92
+ readonly type: 'node.setVisualAppearance';
93
+ readonly nodeId: string;
94
+ readonly before: VisualAppearance | null;
95
+ readonly after: VisualAppearance | null;
96
+ } | {
97
+ readonly type: 'node.setVisualSelectionMode';
98
+ readonly nodeId: string;
99
+ readonly before: VisualSelectionMode;
100
+ readonly after: VisualSelectionMode;
101
+ } | {
102
+ readonly type: 'node.setVisualRenderLayer';
103
+ readonly nodeId: string;
104
+ readonly before: VisualRenderLayer;
105
+ readonly after: VisualRenderLayer;
106
+ } | {
107
+ readonly type: 'node.setDomainData';
108
+ readonly nodeId: string;
109
+ readonly before: Omit<SceneDomainNode, 'nodeType' | 'nodeId' | 'label' | 'localTransform' | 'visible' | 'selectable' | 'bounds' | 'semantic'>;
110
+ readonly after: Omit<SceneDomainNode, 'nodeType' | 'nodeId' | 'label' | 'localTransform' | 'visible' | 'selectable' | 'bounds' | 'semantic'>;
111
+ } | {
112
+ readonly type: 'asset.add';
113
+ readonly revision: AssetRevision;
114
+ } | {
115
+ readonly type: 'asset.remove';
116
+ readonly revisionId: string;
117
+ readonly removed: AssetRevision;
118
+ } | {
119
+ readonly type: 'visualAsset.add';
120
+ readonly revision: VisualAssetRevision;
121
+ } | {
122
+ readonly type: 'visualAsset.remove';
123
+ readonly visualRevisionId: string;
124
+ readonly removed: VisualAssetRevision;
125
+ } | {
126
+ readonly type: 'meta.update';
127
+ readonly before: MetaPatch;
128
+ readonly after: MetaPatch;
129
+ } | {
130
+ readonly type: 'coordinateSystem.update';
131
+ readonly before: CoordinateSystem;
132
+ readonly after: CoordinateSystem;
133
+ } | {
134
+ readonly type: 'environment.update';
135
+ readonly before: SceneEnvironment;
136
+ readonly after: SceneEnvironment;
137
+ } | {
138
+ readonly type: 'semantic.update';
139
+ readonly before: SceneSemantic | null;
140
+ readonly after: SceneSemantic | null;
141
+ } | {
142
+ readonly type: 'domain.update';
143
+ readonly domainId: string;
144
+ readonly before: SceneDocumentDomainPayload | null;
145
+ readonly after: SceneDocumentDomainPayload | null;
146
+ } | {
147
+ readonly type: 'extension.set';
148
+ readonly key: string;
149
+ readonly before: unknown;
150
+ readonly after: unknown;
151
+ };
152
+ export type SceneCommandType = SceneCommand['type'];
153
+ export type CommandSource = 'human' | 'ai' | 'import';
154
+ export interface CommandRecord {
155
+ readonly id: string;
156
+ readonly batchId: string;
157
+ readonly type: SceneCommandType;
158
+ readonly payload: SceneCommand;
159
+ readonly label: string;
160
+ readonly source: CommandSource;
161
+ readonly at: string;
162
+ }
163
+ export interface ApplyResult {
164
+ readonly doc: SceneDocument;
165
+ readonly diagnostics: readonly Diagnostic[];
166
+ }
167
+ export declare const COMMAND_DIAGNOSTIC: {
168
+ readonly nodeNotFound: "SIM_COMMAND_NODE_NOT_FOUND";
169
+ readonly nodeExists: "SIM_COMMAND_NODE_EXISTS";
170
+ readonly parentNotFound: "SIM_COMMAND_PARENT_NOT_FOUND";
171
+ readonly parentNotGroup: "SIM_COMMAND_PARENT_NOT_GROUP";
172
+ readonly revisionNotFound: "SIM_COMMAND_REVISION_NOT_FOUND";
173
+ readonly revisionExists: "SIM_COMMAND_REVISION_EXISTS";
174
+ readonly revisionInUse: "SIM_COMMAND_REVISION_IN_USE";
175
+ readonly revisionHashMismatch: "SIM_COMMAND_REVISION_HASH_MISMATCH";
176
+ readonly payloadMismatch: "SIM_COMMAND_PAYLOAD_MISMATCH";
177
+ readonly invalidDomainId: "SIM_COMMAND_INVALID_DOMAIN_ID";
178
+ readonly invalidDomainData: "SIM_COMMAND_INVALID_DOMAIN_DATA";
179
+ readonly invalidResult: "SIM_COMMAND_INVALID_RESULT";
180
+ readonly emptyLabel: "SIM_COMMAND_EMPTY_LABEL";
181
+ };
182
+ export declare function applyCommand(document: SceneDocument, command: SceneCommand, now?: string): ApplyResult;
183
+ export interface CreateCommandRecordOptions {
184
+ readonly batchId: string;
185
+ readonly label: string;
186
+ readonly source?: CommandSource;
187
+ readonly now?: string;
188
+ readonly id?: string;
189
+ }
190
+ export declare function createCommandRecord(payload: SceneCommand, options: CreateCommandRecordOptions): CommandRecord;
191
+ export declare function applyCommandBatch(document: SceneDocument, records: readonly CommandRecord[], now?: string): {
192
+ doc: SceneDocument;
193
+ applied: CommandRecord[];
194
+ diagnostics: Diagnostic[];
195
+ };
@@ -0,0 +1,34 @@
1
+ import type { Diagnostic } from '../util/diagnostics';
2
+ import type { SceneDocument, SceneDocumentDomainPayload, SceneDomainNode } from './schema';
3
+ export declare const STUDIO_DOCUMENT_DOMAIN_API_VERSION = "1.0";
4
+ export interface StudioDocumentDomainManifest {
5
+ readonly id: string;
6
+ readonly version: string;
7
+ readonly apiVersion: string;
8
+ /** Version of the persisted domain payload understood by this extension. */
9
+ readonly dataVersion: number;
10
+ }
11
+ export interface StudioDocumentDomainExtension {
12
+ readonly manifest: StudioDocumentDomainManifest;
13
+ validate(document: SceneDocument, payload: SceneDocumentDomainPayload): readonly Diagnostic[];
14
+ normalize?(document: SceneDocument, payload: SceneDocumentDomainPayload): SceneDocumentDomainPayload;
15
+ validateNode?(document: SceneDocument, node: SceneDomainNode): readonly Diagnostic[];
16
+ normalizeNode?(document: SceneDocument, node: SceneDomainNode): SceneDomainNode;
17
+ }
18
+ export type StudioDocumentDomainPurpose = 'transaction' | 'export';
19
+ export declare const STUDIO_DOMAIN_DIAGNOSTIC: {
20
+ readonly duplicateId: "STUDIO_DOMAIN_DUPLICATE_ID";
21
+ readonly incompatibleApi: "STUDIO_DOMAIN_INCOMPATIBLE_API";
22
+ readonly invalidVersion: "STUDIO_DOMAIN_INVALID_VERSION";
23
+ readonly unsupportedVersion: "STUDIO_DOMAIN_UNSUPPORTED_VERSION";
24
+ readonly validationFailed: "STUDIO_DOMAIN_VALIDATION_FAILED";
25
+ readonly unregisteredPayload: "STUDIO_DOMAIN_UNREGISTERED_PAYLOAD";
26
+ readonly unregisteredNode: "STUDIO_DOMAIN_UNREGISTERED_NODE";
27
+ };
28
+ /**
29
+ * Runs version checks and domain-owned validators. Unknown domains remain in
30
+ * the document. They are warnings during transaction validation and blockers
31
+ * during export because the core cannot prove their semantics.
32
+ */
33
+ export declare function validateDocumentDomains(document: SceneDocument, extensions?: readonly StudioDocumentDomainExtension[], purpose?: StudioDocumentDomainPurpose): readonly Diagnostic[];
34
+ export declare function normalizeDocumentDomains(document: SceneDocument, extensions?: readonly StudioDocumentDomainExtension[]): SceneDocument;
@@ -0,0 +1,87 @@
1
+ import type { LocalTransform, NodePivot, SceneDocument, SceneNode, Vec3, Vec3Bounds } from './schema';
2
+ export interface StudioNodeFrame {
3
+ readonly nodeId: string;
4
+ readonly nodeType: SceneNode['nodeType'];
5
+ readonly localTransform: LocalTransform;
6
+ readonly worldTransform: LocalTransform;
7
+ /** Asset coordinates before this instance's local scale. */
8
+ readonly localBounds: Vec3Bounds | null;
9
+ readonly worldBounds: Vec3Bounds | null;
10
+ readonly boundsCenter: Vec3 | null;
11
+ readonly boundsSource: 'runtime' | 'document' | 'unknown';
12
+ readonly pivot: {
13
+ readonly value: Vec3 | null;
14
+ readonly source: 'node-origin' | 'unknown';
15
+ };
16
+ /** An instance origin is not evidence of an authored source pivot. */
17
+ readonly sourcePivot: {
18
+ readonly value: null;
19
+ readonly source: 'unknown';
20
+ };
21
+ /** Asset-local source origin. This is distinct from an authored source pivot. */
22
+ readonly sourceOrigin: {
23
+ readonly local: Vec3;
24
+ readonly world: Vec3 | null;
25
+ readonly provenance: 'asset-local';
26
+ };
27
+ /** Effective instance transform pivot in source-content coordinates. */
28
+ readonly origin: {
29
+ readonly pivot: NodePivot;
30
+ readonly local: Vec3;
31
+ readonly world: Vec3;
32
+ readonly provenance: 'default' | 'authored';
33
+ };
34
+ /** Semantic facts derived from localTransform.rotation; no orientation state is duplicated. */
35
+ readonly orientation: {
36
+ readonly localUpAxis: Vec3;
37
+ readonly parentUpDirection: Vec3;
38
+ readonly worldUpDirection: Vec3 | null;
39
+ readonly preset: '+X' | '+Y' | '+Z' | null;
40
+ };
41
+ }
42
+ export interface StudioSelectionFrame {
43
+ readonly nodeIds: readonly string[];
44
+ readonly worldBounds: Vec3Bounds | null;
45
+ readonly boundsCenter: Vec3 | null;
46
+ readonly pivot: {
47
+ readonly value: Vec3 | null;
48
+ readonly source: 'bounds-center' | 'unknown';
49
+ };
50
+ }
51
+ export interface StudioAssetDimensions {
52
+ readonly nodeId: string;
53
+ readonly revisionId: string | null;
54
+ readonly units: 'm';
55
+ /** Dimensions in the node's parent coordinate axes before rotation. */
56
+ readonly dimensions: Vec3 | null;
57
+ readonly sourceDimensions: Vec3 | null;
58
+ readonly scale: Vec3;
59
+ readonly source: 'runtime' | 'document' | 'unknown';
60
+ readonly editable: boolean;
61
+ readonly reason: 'BOUNDS_UNAVAILABLE' | 'DEGENERATE_BOUNDS' | 'GROUP_DIMENSIONS' | null;
62
+ }
63
+ export declare const DEFAULT_NODE_ORIGIN: NodePivot;
64
+ export declare function nodeOriginPivot(node: SceneNode): NodePivot;
65
+ /** Resolves the source-content-local pivot without inventing a bounds policy. */
66
+ export declare function resolveNodeOriginLocal(node: SceneNode): Pick<StudioNodeFrame['origin'], 'pivot' | 'local' | 'provenance'>;
67
+ export type NodeOriginPreset = 'source' | 'bounds-center' | 'bounds-base' | 'bounds-top' | 'bounds-min-x' | 'bounds-max-x' | 'bounds-min-y' | 'bounds-max-y' | 'bounds-long-min' | 'bounds-long-max' | 'bounds-short-min' | 'bounds-short-max' | 'bounds-long-min-base' | 'bounds-long-min-top' | 'bounds-long-max-base' | 'bounds-long-max-top' | 'bounds-short-min-base' | 'bounds-short-min-top' | 'bounds-short-max-base' | 'bounds-short-max-top' | 'geometry-median' | 'surface-center-of-mass' | 'volume-center-of-mass';
68
+ export interface NodeOriginAnchorSet {
69
+ readonly median?: Vec3 | null;
70
+ readonly surfaceCenterOfMass?: Vec3 | null;
71
+ readonly volumeCenterOfMass?: Vec3 | null;
72
+ }
73
+ export declare const NODE_ORIGIN_PRESETS: readonly NodeOriginPreset[];
74
+ /** Computes a persistent pivot point for the common UI shortcuts. */
75
+ export declare function nodeOriginPresetLocal(preset: NodeOriginPreset, localBounds: Vec3Bounds | null, anchors?: NodeOriginAnchorSet | null): Vec3;
76
+ export declare function boundsSize(bounds: Vec3Bounds): Vec3;
77
+ export declare function boundsCenter(bounds: Vec3Bounds): Vec3;
78
+ export declare function boundsCorners(bounds: Vec3Bounds): readonly Vec3[];
79
+ export declare function transformPoint(point: Vec3, transform: LocalTransform): Vec3;
80
+ export declare function transformBounds(bounds: Vec3Bounds, transform: LocalTransform): Vec3Bounds;
81
+ export declare function mergeBounds(bounds: readonly Vec3Bounds[]): Vec3Bounds | null;
82
+ export declare function nodeLocalBounds(document: SceneDocument, node: SceneNode): Vec3Bounds | null;
83
+ /** Runtime bounds are an explicit provider; unavailable values retain their document provenance. */
84
+ export declare function getStudioNodeFrame(document: SceneDocument, nodeId: string, runtimeBounds?: (nodeId: string) => Vec3Bounds | null, runtimeLocalBounds?: (nodeId: string) => Vec3Bounds | null): StudioNodeFrame | null;
85
+ export declare function selectionRoots(document: SceneDocument, nodeIds: readonly string[]): readonly string[];
86
+ export declare function getStudioSelectionFrame(document: SceneDocument, nodeIds: readonly string[], runtimeBounds?: (nodeId: string) => Vec3Bounds | null): StudioSelectionFrame;
87
+ export declare function getStudioAssetDimensions(document: SceneDocument, nodeId: string, measuredBounds?: Vec3Bounds | null): StudioAssetDimensions | null;
@@ -0,0 +1,74 @@
1
+ import type { SceneDocument, PhysicsOverride, CoordinateSystem, Vec3 } from './schema';
2
+ export interface StudioPhysicsBodyFact {
3
+ readonly id: number;
4
+ readonly name: string;
5
+ readonly sourcePath: string | null;
6
+ readonly motionType: string;
7
+ readonly massKg: number;
8
+ readonly centerOfMassM: readonly number[];
9
+ readonly centerOfMassFrame: 'world';
10
+ readonly principalInertiaKgM2: readonly number[];
11
+ readonly inertiaFrame: 'body-principal';
12
+ readonly inertiaOrientationWorld: readonly number[] | null;
13
+ }
14
+ export interface StudioPhysicsJointFact {
15
+ readonly name: string;
16
+ readonly type: string;
17
+ readonly position: number | null;
18
+ readonly velocity: number | null;
19
+ readonly range: readonly [number, number] | null;
20
+ readonly axis: Vec3 | null;
21
+ readonly axisFrame: 'world';
22
+ }
23
+ export interface StudioPhysicsFacts {
24
+ readonly nodeId: string;
25
+ readonly coordinateSystem: CoordinateSystem;
26
+ readonly authored: {
27
+ readonly physics: PhysicsOverride;
28
+ readonly initialJoints: Readonly<Record<string, number>> | null;
29
+ };
30
+ readonly colliders: readonly {
31
+ readonly path: string;
32
+ readonly geometryType: string | null;
33
+ readonly source: 'asset-inspection' | 'override';
34
+ }[] | null;
35
+ readonly bodies: readonly StudioPhysicsBodyFact[] | null;
36
+ readonly joints: readonly StudioPhysicsJointFact[] | null;
37
+ readonly runtime: {
38
+ readonly source: 'scene-unified' | 'asset-session';
39
+ readonly status: string;
40
+ readonly time: number;
41
+ readonly timestepSeconds: number;
42
+ } | null;
43
+ readonly unavailable: readonly ('colliders' | 'bodies' | 'joints')[];
44
+ }
45
+ export interface StudioPhysicsRuntimeInput {
46
+ readonly visualDiagnostics: Readonly<Record<string, unknown>> | null;
47
+ readonly physicsRuntime: {
48
+ readonly worldKind: 'scene-unified' | 'asset-session';
49
+ readonly status: string;
50
+ readonly time: number;
51
+ readonly timestep: number;
52
+ readonly bodies: readonly {
53
+ readonly id: number;
54
+ readonly name: string;
55
+ readonly instanceId: string | null;
56
+ readonly sourcePath: string | null;
57
+ readonly motionType: string;
58
+ readonly mass: number;
59
+ readonly centerOfMass: readonly number[];
60
+ readonly inertia: readonly number[];
61
+ readonly inertiaOrientationWorld?: readonly number[] | null;
62
+ }[];
63
+ readonly joints: readonly {
64
+ readonly name: string;
65
+ readonly type: string;
66
+ readonly instanceId?: string | null;
67
+ readonly axisWorld?: readonly number[] | null;
68
+ readonly position: number | null;
69
+ readonly velocity: number | null;
70
+ readonly range: readonly [number, number] | null;
71
+ }[];
72
+ } | null;
73
+ }
74
+ export declare function getStudioPhysicsFacts(document: SceneDocument, nodeId: string, input?: StudioPhysicsRuntimeInput | null): StudioPhysicsFacts | null;
@@ -0,0 +1,71 @@
1
+ /** Shared, renderer-free placement geometry and constraints. */
2
+ import type { LocalTransform, SceneDocument, SceneNode, Vec3, Vec3Bounds } from './schema';
3
+ export interface StudioPlacementPolicy {
4
+ readonly gridStepM: number;
5
+ readonly adaptiveGridSnap: boolean;
6
+ readonly surfaceSnap: boolean;
7
+ readonly alignToSurface: boolean;
8
+ readonly preventOverlap: boolean;
9
+ readonly clearanceM: number;
10
+ readonly toleranceM: number;
11
+ }
12
+ export declare const DEFAULT_PLACEMENT_POLICY: StudioPlacementPolicy;
13
+ export declare const MIN_SUPPORT_NORMAL_Z = 0.85;
14
+ /**
15
+ * Allows sub-millimetre mesh/world-transform drift while keeping visible
16
+ * penetration or a wrong support layer subject to the normal overlap check.
17
+ */
18
+ export declare const SUPPORT_CONTACT_TOLERANCE_M = 0.001;
19
+ export interface StudioPlacementSurface {
20
+ readonly nodeId: string | null;
21
+ readonly point: Vec3;
22
+ readonly normal: Vec3;
23
+ }
24
+ export interface StudioPlacementVolume {
25
+ readonly nodeId: string;
26
+ readonly bounds: Vec3Bounds;
27
+ readonly transform: LocalTransform;
28
+ /** A container may enclose another object without treating its volume as solid. */
29
+ readonly container?: boolean;
30
+ }
31
+ export interface StudioPlacementEvaluation {
32
+ readonly valid: boolean;
33
+ readonly transform: LocalTransform;
34
+ readonly precision: 'oriented-bounds';
35
+ readonly conflicts: readonly string[];
36
+ /** The surface owner whose broad phase is intentionally exempted by this contact. */
37
+ readonly supportNodeId: string | null;
38
+ readonly supportSurfaceZ: number | null;
39
+ readonly reason: 'PLACEMENT_OVERLAP' | 'PLACEMENT_SURFACE_REQUIRED' | 'PLACEMENT_SURFACE_NOT_SUPPORTING' | null;
40
+ }
41
+ /** One transaction-local permission for a moved node touching a support plane. */
42
+ export interface StudioSupportContact {
43
+ readonly movedNodeId: string;
44
+ readonly supportNodeId: string;
45
+ readonly surfaceZ: number;
46
+ }
47
+ export declare function normalizePlacementPolicy(policy: Partial<StudioPlacementPolicy>, base?: StudioPlacementPolicy): StudioPlacementPolicy;
48
+ /** Selects a stable, human-readable grid level from the object's largest dimension. */
49
+ export declare function adaptiveGridStepForBounds(bounds: Vec3Bounds): number;
50
+ export declare function effectiveGridStep(bounds: Vec3Bounds, policy: Pick<StudioPlacementPolicy, 'gridStepM' | 'adaptiveGridSnap'>): number;
51
+ export declare function isSupportSurfaceNormal(normal: Vec3): boolean;
52
+ /** Full 15-axis SAT. Face/edge contact is legal; a positive volume intersection is not. */
53
+ export declare function placementVolumesOverlap(a: StudioPlacementVolume, b: StudioPlacementVolume, tolerance?: number): boolean;
54
+ export declare function evaluatePlacement(input: {
55
+ readonly bounds: Vec3Bounds;
56
+ readonly transform: LocalTransform;
57
+ readonly surface?: StudioPlacementSurface | null;
58
+ readonly obstacles?: readonly StudioPlacementVolume[];
59
+ readonly policy?: Partial<StudioPlacementPolicy>;
60
+ }): StudioPlacementEvaluation;
61
+ /**
62
+ * A support owner may still have its coarse OBB around the object that rests on
63
+ * it, especially when the authored collision top differs from the visual hull.
64
+ * Only exempt that pair while the moved object is actually seated at its support
65
+ * plane. Deep penetration, side intrusion, and stale/general pair exemptions
66
+ * continue through the normal overlap check.
67
+ */
68
+ export declare function supportContactAllowsVolumeOverlap(moved: StudioPlacementVolume, support: StudioPlacementVolume, contact: StudioSupportContact, policy: Pick<StudioPlacementPolicy, 'clearanceM' | 'toleranceM'>): boolean;
69
+ /** Checks the complete candidate transaction, including siblings moved in the same batch. */
70
+ export declare function validatePlacementChanges(before: SceneDocument, after: SceneDocument, policy: StudioPlacementPolicy, measuredBounds?: (node: SceneNode) => Vec3Bounds | null, allowOverlapNodeIds?: ReadonlySet<string>, supportContacts?: readonly StudioSupportContact[]): readonly import('../util/diagnostics').Diagnostic[];
71
+ export declare function isContainerNode(document: SceneDocument, node: SceneNode): boolean;
@@ -0,0 +1,30 @@
1
+ import type { CommandRecord } from './command';
2
+ import { type LocalTransform, type SceneDocument, type ScenePlaceholderNode, type Vec3 } from './schema';
3
+ export interface SeededPlacementRegion {
4
+ readonly minX: number;
5
+ readonly maxX: number;
6
+ readonly minY: number;
7
+ readonly maxY: number;
8
+ readonly z: number;
9
+ }
10
+ export interface CreateSeededPlaceholdersOptions {
11
+ readonly seed: number;
12
+ readonly count: number;
13
+ readonly nodeIdPrefix: string;
14
+ readonly labelPrefix?: string;
15
+ readonly size: Vec3;
16
+ readonly region: SeededPlacementRegion;
17
+ readonly yawRangeRadians?: readonly [number, number];
18
+ }
19
+ export interface SeededPlaceholderBatch {
20
+ readonly seed: number;
21
+ /** Preview facts are exactly the transforms used by the returned commit commands. */
22
+ readonly placements: readonly LocalTransform[];
23
+ readonly nodes: readonly ScenePlaceholderNode[];
24
+ readonly records: readonly CommandRecord[];
25
+ }
26
+ /**
27
+ * Deterministic scatter for authoring previews. This deliberately performs no
28
+ * collision avoidance, packing or training-sample semantics.
29
+ */
30
+ export declare function createSeededPlaceholderBatch(document: SceneDocument, options: CreateSeededPlaceholdersOptions): SeededPlaceholderBatch;