@nebula-spatial/studio 0.0.0-stage → 0.1.0

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 (251) 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/usd-export-worker-BsGubtAE.js +1 -0
  23. package/dist/builders-BAXRR5o5.js +1854 -0
  24. package/dist/core/asset-task.d.ts +105 -0
  25. package/dist/core/context.d.ts +23 -0
  26. package/dist/core/host.d.ts +432 -0
  27. package/dist/core/persistence-controller.d.ts +58 -0
  28. package/dist/core/plugins.d.ts +139 -0
  29. package/dist/core/scene-tree.d.ts +62 -0
  30. package/dist/core/versions.d.ts +2 -0
  31. package/dist/core/when.d.ts +13 -0
  32. package/dist/core/write-policy.d.ts +29 -0
  33. package/dist/delivery/build-plan.d.ts +2 -0
  34. package/dist/delivery/contracts.d.ts +362 -0
  35. package/dist/delivery/digest.d.ts +3 -0
  36. package/dist/delivery/evidence.d.ts +10 -0
  37. package/dist/delivery/export-evidence.d.ts +3 -0
  38. package/dist/delivery/index.d.ts +9 -0
  39. package/dist/delivery/prim-name.d.ts +17 -0
  40. package/dist/delivery/profile.d.ts +4 -0
  41. package/dist/doc/builders.d.ts +99 -0
  42. package/dist/doc/command.d.ts +195 -0
  43. package/dist/doc/domain-extensions.d.ts +34 -0
  44. package/dist/doc/node-facts.d.ts +87 -0
  45. package/dist/doc/physics-facts.d.ts +74 -0
  46. package/dist/doc/placement-policy.d.ts +71 -0
  47. package/dist/doc/random-placement.d.ts +30 -0
  48. package/dist/doc/scene-graph.d.ts +80 -0
  49. package/dist/doc/scene-regions.d.ts +29 -0
  50. package/dist/doc/schema.d.ts +452 -0
  51. package/dist/doc/task.d.ts +71 -0
  52. package/dist/doc/validate.d.ts +68 -0
  53. package/dist/editor/asset-source.d.ts +15 -0
  54. package/dist/editor/editor.d.ts +246 -0
  55. package/dist/editor/index.d.ts +22 -0
  56. package/dist/editor/shortcuts.d.ts +2 -0
  57. package/dist/editor/types.d.ts +143 -0
  58. package/dist/editor/ui-plugins.d.ts +64 -0
  59. package/dist/editor.js +1755 -0
  60. package/dist/editorial-BkAFWfbg.js +83 -0
  61. package/dist/export-evidence-B_0zRmb8.js +5027 -0
  62. package/dist/generalization/domain.d.ts +10 -0
  63. package/dist/generalization/generalization.d.ts +371 -0
  64. package/dist/generalization/index.d.ts +11 -0
  65. package/dist/generalization.js +1659 -0
  66. package/dist/history/undo-stack.d.ts +74 -0
  67. package/dist/index.d.ts +91 -0
  68. package/dist/index.js +2839 -0
  69. package/dist/persist/content-addressed.d.ts +11 -0
  70. package/dist/persist/create-scene-package-from-host.d.ts +7 -0
  71. package/dist/persist/indexeddb-store.d.ts +69 -0
  72. package/dist/persist/scene-file.d.ts +52 -0
  73. package/dist/persist/scene-package.d.ts +8 -0
  74. package/dist/persist/snapshot.d.ts +5 -0
  75. package/dist/physics-facts-tfQYyNTD.js +337 -0
  76. package/dist/placement-policy-DY_FNRDu.js +405 -0
  77. package/dist/ports/asset-ingestor.d.ts +41 -0
  78. package/dist/ports/asset-source.d.ts +57 -0
  79. package/dist/ports/delivery.d.ts +13 -0
  80. package/dist/ports/persistence.d.ts +29 -0
  81. package/dist/project/asset-catalog.d.ts +21 -0
  82. package/dist/project/contracts.d.ts +272 -0
  83. package/dist/project/editorial.d.ts +16 -0
  84. package/dist/project/identity.d.ts +20 -0
  85. package/dist/project/index.d.ts +9 -0
  86. package/dist/project/scene-document.d.ts +5 -0
  87. package/dist/project/source-dependencies.d.ts +7 -0
  88. package/dist/remote-asset-resolver-Cb8cfNmw.js +136 -0
  89. package/dist/scene/index.d.ts +12 -0
  90. package/dist/scene-graph-DBLKAhxa.js +681 -0
  91. package/dist/scene-session-BV1HnxNh.js +3506 -0
  92. package/dist/scene.js +244 -0
  93. package/dist/studio/delivery-catalog.d.ts +28 -0
  94. package/dist/studio/in-memory-asset-source.d.ts +15 -0
  95. package/dist/studio/index.d.ts +31 -0
  96. package/dist/studio/indexeddb-asset-source.d.ts +32 -0
  97. package/dist/studio/indexeddb-persistence.d.ts +13 -0
  98. package/dist/studio/remote-asset-importer.d.ts +56 -0
  99. package/dist/studio/source-package.d.ts +9 -0
  100. package/dist/studio/usd-export-client.d.ts +13 -0
  101. package/dist/studio/usd-export-protocol.d.ts +98 -0
  102. package/dist/studio/usd-export-worker.d.ts +1 -0
  103. package/dist/studio/usd-zip-reader.d.ts +14 -0
  104. package/dist/studio/web-asset-ingestor.d.ts +10 -0
  105. package/dist/studio/web-host.d.ts +8 -0
  106. package/dist/studio.js +5544 -0
  107. package/dist/util/asset-facts.d.ts +3 -0
  108. package/dist/util/data.d.ts +17 -0
  109. package/dist/util/diagnostics.d.ts +38 -0
  110. package/dist/util/geometry.d.ts +11 -0
  111. package/dist/util/hash.d.ts +9 -0
  112. package/dist/util/ids.d.ts +20 -0
  113. package/dist/util/math.d.ts +47 -0
  114. package/dist/util/ply-metadata.d.ts +19 -0
  115. package/dist/util/studio-source.d.ts +23 -0
  116. package/dist/version.d.ts +5 -0
  117. package/dist/view/appearance.d.ts +13 -0
  118. package/dist/view/authoring-appearance.d.ts +25 -0
  119. package/dist/view/bounds-preview.d.ts +34 -0
  120. package/dist/view/bounds.d.ts +11 -0
  121. package/dist/view/camera-zoom.d.ts +3 -0
  122. package/dist/view/geometry-anchors.d.ts +20 -0
  123. package/dist/view/gizmo-appearance.d.ts +5 -0
  124. package/dist/view/gizmo.d.ts +81 -0
  125. package/dist/view/group-selection.d.ts +13 -0
  126. package/dist/view/node-features.d.ts +39 -0
  127. package/dist/view/picking.d.ts +49 -0
  128. package/dist/view/placement.d.ts +48 -0
  129. package/dist/view/region-editing.d.ts +25 -0
  130. package/dist/view/rotation-guide.d.ts +36 -0
  131. package/dist/view/runtime-capabilities.d.ts +22 -0
  132. package/dist/view/scene-session.d.ts +258 -0
  133. package/dist/view/screen-bounds.d.ts +17 -0
  134. package/dist/view/selection-transform.d.ts +20 -0
  135. package/node_modules/@nebula-spatial/cad-loader/CHANGELOG.md +48 -0
  136. package/node_modules/@nebula-spatial/cad-loader/README.md +108 -0
  137. package/node_modules/@nebula-spatial/cad-loader/dist/core/cad-types.d.ts +26 -0
  138. package/node_modules/@nebula-spatial/cad-loader/dist/core/errors.d.ts +5 -0
  139. package/node_modules/@nebula-spatial/cad-loader/dist/core/index.d.ts +24 -0
  140. package/node_modules/@nebula-spatial/cad-loader/dist/core/index.js +2354 -0
  141. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-group-reader.d.ts +9 -0
  142. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-parser.d.ts +78 -0
  143. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/dxbs-sidecar.d.ts +24 -0
  144. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/geometry-segments.d.ts +20 -0
  145. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/text-roundtrip.d.ts +4 -0
  146. package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/types.d.ts +81 -0
  147. package/node_modules/@nebula-spatial/cad-loader/dist/core/runtime-text-decoder.d.ts +8 -0
  148. package/node_modules/@nebula-spatial/cad-loader/dist/core/types.d.ts +153 -0
  149. package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/insert-bbox.d.ts +10 -0
  150. package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/viewport-rect.d.ts +21 -0
  151. package/node_modules/@nebula-spatial/cad-loader/dist/index.d.ts +36 -0
  152. package/node_modules/@nebula-spatial/cad-loader/dist/index.js +5829 -0
  153. package/node_modules/@nebula-spatial/cad-loader/dist/loader/geo-loader.d.ts +59 -0
  154. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/automatic-external-resources.d.ts +26 -0
  155. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/external-variant-sidecar-fetch.d.ts +13 -0
  156. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/flow-control.d.ts +29 -0
  157. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/frame-budget-scheduler.d.ts +21 -0
  158. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-compact-executor.d.ts +19 -0
  159. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-local-adapter.d.ts +2 -0
  160. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-pipeline.d.ts +92 -0
  161. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-worker-adapter.d.ts +13 -0
  162. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-builder.d.ts +34 -0
  163. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-load-sink.d.ts +28 -0
  164. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node.d.ts +304 -0
  165. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare-worker-types.d.ts +94 -0
  166. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.d.ts +38 -0
  167. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.worker.d.ts +1 -0
  168. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-model-builder.d.ts +10 -0
  169. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-runtime-geometry.d.ts +15 -0
  170. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-canonical.d.ts +37 -0
  171. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-quality.d.ts +9 -0
  172. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/prepare-credit-gate.d.ts +20 -0
  173. package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/transport.d.ts +2 -0
  174. package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/cad-render-node.d.ts +80 -0
  175. package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/geo-node-cad-render-node.d.ts +12 -0
  176. package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-geometry.d.ts +28 -0
  177. package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-material.d.ts +18 -0
  178. package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/block-geometry-registry.d.ts +35 -0
  179. package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/insert-instance-table.d.ts +23 -0
  180. package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/viewport-instance-presenter.d.ts +66 -0
  181. package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-insert-selection.d.ts +35 -0
  182. package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-text-selection.d.ts +31 -0
  183. package/node_modules/@nebula-spatial/cad-loader/dist/session/annotation-idle-gate.d.ts +14 -0
  184. package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-document-session.d.ts +187 -0
  185. package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-font-runtime.d.ts +11 -0
  186. package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-insert-id.d.ts +6 -0
  187. package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-text-warmup.d.ts +38 -0
  188. package/node_modules/@nebula-spatial/cad-loader/dist/session/create-cad-document-session.d.ts +5 -0
  189. package/node_modules/@nebula-spatial/cad-loader/dist/session/load-session.d.ts +90 -0
  190. package/node_modules/@nebula-spatial/cad-loader/dist/session/viewport-coverage.d.ts +32 -0
  191. package/node_modules/@nebula-spatial/cad-loader/dist/shared/abort.d.ts +3 -0
  192. package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-display-color.d.ts +55 -0
  193. package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-load-source.d.ts +8 -0
  194. package/node_modules/@nebula-spatial/cad-loader/dist/shared/color-buffer.d.ts +6 -0
  195. package/node_modules/@nebula-spatial/cad-loader/dist/shared/constants.d.ts +11 -0
  196. package/node_modules/@nebula-spatial/cad-loader/dist/shared/display-color-buffer.d.ts +27 -0
  197. package/node_modules/@nebula-spatial/cad-loader/dist/shared/errors.d.ts +2 -0
  198. package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-builder.d.ts +25 -0
  199. package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-font.d.ts +12 -0
  200. package/node_modules/@nebula-spatial/cad-loader/dist/shared/types.d.ts +57 -0
  201. package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/insert-bbox.d.ts +1 -0
  202. package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/timing.d.ts +2 -0
  203. package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/viewport-rect.d.ts +1 -0
  204. package/node_modules/@nebula-spatial/cad-loader/dist/shared/viewer-theme.d.ts +2 -0
  205. package/node_modules/@nebula-spatial/cad-loader/dist/workers/geo-prepare.worker.js +2264 -0
  206. package/node_modules/@nebula-spatial/cad-loader/package.json +62 -0
  207. package/node_modules/@nebula-spatial/viewer/CHANGELOG.md +426 -0
  208. package/node_modules/@nebula-spatial/viewer/FBX-MATERIAL-CONVERSION.md +97 -0
  209. package/node_modules/@nebula-spatial/viewer/README.md +1056 -0
  210. package/node_modules/@nebula-spatial/viewer/USD-VISUAL-MATERIAL-SUPPORT.md +89 -0
  211. package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.js +19 -0
  212. package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.wasm +0 -0
  213. package/node_modules/@nebula-spatial/viewer/dist/asset-ir-DEOK9SqE.js +382 -0
  214. package/node_modules/@nebula-spatial/viewer/dist/assets/ground-grid.d.ts +6 -0
  215. package/node_modules/@nebula-spatial/viewer/dist/assets/source-types.d.ts +19 -0
  216. package/node_modules/@nebula-spatial/viewer/dist/assets/types.d.ts +393 -0
  217. package/node_modules/@nebula-spatial/viewer/dist/assets/usd-worker-Bom5cjz3.js +1392 -0
  218. package/node_modules/@nebula-spatial/viewer/dist/cad/text.d.ts +2 -0
  219. package/node_modules/@nebula-spatial/viewer/dist/cad/types.d.ts +368 -0
  220. package/node_modules/@nebula-spatial/viewer/dist/index-ByBlfVc0.js +12132 -0
  221. package/node_modules/@nebula-spatial/viewer/dist/index.d.ts +32 -0
  222. package/node_modules/@nebula-spatial/viewer/dist/index.js +26 -0
  223. package/node_modules/@nebula-spatial/viewer/dist/inspection/types.d.ts +112 -0
  224. package/node_modules/@nebula-spatial/viewer/dist/mjcf-visual-DVRa0w90.js +72 -0
  225. package/node_modules/@nebula-spatial/viewer/dist/mujoco-runtime-Dhx6Ua2u.js +463 -0
  226. package/node_modules/@nebula-spatial/viewer/dist/plugins.d.ts +179 -0
  227. package/node_modules/@nebula-spatial/viewer/dist/scene/instances.d.ts +36 -0
  228. package/node_modules/@nebula-spatial/viewer/dist/scene/types.d.ts +258 -0
  229. package/node_modules/@nebula-spatial/viewer/dist/session-B-j6KdA-.js +389 -0
  230. package/node_modules/@nebula-spatial/viewer/dist/session-B4AICTeJ.js +963 -0
  231. package/node_modules/@nebula-spatial/viewer/dist/session-BAG5cDYe.js +9153 -0
  232. package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-runtime.d.ts +118 -0
  233. package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-wasm-module.d.ts +11 -0
  234. package/node_modules/@nebula-spatial/viewer/dist/simulation/openusd-wasm-module.d.ts +10 -0
  235. package/node_modules/@nebula-spatial/viewer/dist/simulation/physics-runtime-state.d.ts +75 -0
  236. package/node_modules/@nebula-spatial/viewer/dist/simulation/types.d.ts +129 -0
  237. package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-inspection.d.ts +66 -0
  238. package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-query.d.ts +50 -0
  239. package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-resource-policy.d.ts +28 -0
  240. package/node_modules/@nebula-spatial/viewer/dist/types.d.ts +278 -0
  241. package/node_modules/@nebula-spatial/viewer/dist/ui/types.d.ts +48 -0
  242. package/node_modules/@nebula-spatial/viewer/dist/urdf-session-kemAnBn8.js +3231 -0
  243. package/node_modules/@nebula-spatial/viewer/dist/usd-session-QtwGKI7v.js +6771 -0
  244. package/node_modules/@nebula-spatial/viewer/dist/version.d.ts +5 -0
  245. package/node_modules/@nebula-spatial/viewer/dist/viewer.d.ts +2 -0
  246. package/node_modules/@nebula-spatial/viewer/dist/xacro-CYTPS7mh.js +1537 -0
  247. package/node_modules/@nebula-spatial/viewer/openusd/openusd-runtime-manifest.json +15 -0
  248. package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.js +14 -0
  249. package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.wasm +0 -0
  250. package/node_modules/@nebula-spatial/viewer/package.json +66 -0
  251. package/package.json +87 -6
@@ -0,0 +1,444 @@
1
+ import { k as p, s as b, g as _ } from "./builders-BAXRR5o5.js";
2
+ const I = "application/octet-stream", C = {
3
+ ".usda": "model/vnd.usda",
4
+ ".usd": "model/vnd.usda",
5
+ ".usdc": "model/vnd.usdc",
6
+ ".usdz": "model/vnd.usdz+zip",
7
+ ".glb": "model/gltf-binary",
8
+ ".gltf": "model/gltf+json",
9
+ ".ply": "application/x-ply",
10
+ ".spz": "application/x-spz",
11
+ ".splat": "application/x-gaussian-splat",
12
+ ".ksplat": "application/x-ksplat",
13
+ ".rad": "application/x-rad",
14
+ ".zip": "application/zip",
15
+ ".json": "application/json",
16
+ ".png": "image/png",
17
+ ".jpg": "image/jpeg",
18
+ ".jpeg": "image/jpeg",
19
+ ".webp": "image/webp",
20
+ ".ktx2": "image/ktx2",
21
+ ".exr": "image/x-exr",
22
+ ".mdl": "text/plain"
23
+ }, O = /* @__PURE__ */ new Set([
24
+ I,
25
+ "binary/octet-stream"
26
+ ]);
27
+ function $(t) {
28
+ return C[M(t)] ?? null;
29
+ }
30
+ function H(t) {
31
+ return $(t) ?? I;
32
+ }
33
+ function z(t, ...e) {
34
+ for (const o of e) {
35
+ const n = F(o);
36
+ if (n) return n;
37
+ }
38
+ return $(t);
39
+ }
40
+ function M(t) {
41
+ const e = t.replaceAll("\\", "/"), o = e.slice(e.lastIndexOf("/") + 1).toLowerCase(), n = o.lastIndexOf(".");
42
+ return n >= 0 ? o.slice(n) : "";
43
+ }
44
+ function F(t) {
45
+ const e = t == null ? void 0 : t.trim();
46
+ return !e || O.has(e.toLowerCase()) ? null : e;
47
+ }
48
+ const w = "ASSET_SOURCE_INVALID_LOCATOR";
49
+ function m(t) {
50
+ if (!t || t.startsWith("/") || t.includes("\\"))
51
+ throw new p(
52
+ w,
53
+ `Package resource path must be a non-empty forward-slash relative path: ${t}.`
54
+ );
55
+ const e = [];
56
+ for (const n of t.split("/"))
57
+ if (!(!n || n === ".")) {
58
+ if (n === "..") {
59
+ if (e.length === 0)
60
+ throw new p(
61
+ w,
62
+ `Package resource path escapes its logical root: ${t}.`
63
+ );
64
+ e.pop();
65
+ continue;
66
+ }
67
+ e.push(n);
68
+ }
69
+ const o = e.join("/");
70
+ if (!o)
71
+ throw new p(
72
+ w,
73
+ `Package resource path normalizes to an empty value: ${t}.`
74
+ );
75
+ return o;
76
+ }
77
+ function S(t) {
78
+ const e = new URL(t);
79
+ if (e.protocol !== "http:" && e.protocol !== "https:" || e.username || e.password || e.hash)
80
+ throw new p(
81
+ w,
82
+ `Remote resource URL must be an absolute HTTP(S) URL without credentials or fragment: ${t}.`
83
+ );
84
+ return `${e.origin}${e.pathname}`;
85
+ }
86
+ function k(t) {
87
+ return t.kind === "package-path" ? { kind: "package-path", path: m(t.path) } : { kind: "remote-url", url: S(t.url) };
88
+ }
89
+ function l(t) {
90
+ const e = k(t);
91
+ return e.kind === "package-path" ? `package:${e.path}` : `remote:${e.url}`;
92
+ }
93
+ function j(t, e) {
94
+ return `res_${b(`${l(t)}\0${e}`).slice(0, 32)}`;
95
+ }
96
+ function Y(t) {
97
+ return t.kind === "package-path" ? m(t.path) : null;
98
+ }
99
+ function G(t) {
100
+ return t.kind === "remote-url" ? S(t.url) : null;
101
+ }
102
+ function K(t) {
103
+ const e = k(t);
104
+ if (e.kind === "package-path") return e.path;
105
+ const o = new URL(e.url), n = o.pathname.split("/").filter(Boolean), s = n.length === 0 ? "r-root" : [
106
+ `p-${encodeURIComponent(n[0])}`,
107
+ ...n.slice(1)
108
+ ].join("/");
109
+ return m(
110
+ `remote-assets/${encodeURIComponent(o.origin)}/${s}`
111
+ );
112
+ }
113
+ function X(t, e, o = []) {
114
+ const n = e.trim();
115
+ if (!n) return null;
116
+ const s = k(t), u = new Set(o.map(l));
117
+ if (s.kind === "remote-url")
118
+ try {
119
+ const c = new URL(n, s.url);
120
+ return {
121
+ kind: "remote-url",
122
+ url: S(c.href)
123
+ };
124
+ } catch {
125
+ return null;
126
+ }
127
+ if (/^[a-z][a-z\d+.-]*:/i.test(n)) return null;
128
+ if (n.startsWith("/"))
129
+ try {
130
+ return { kind: "package-path", path: m(n.slice(1)) };
131
+ } catch {
132
+ return null;
133
+ }
134
+ const r = s.path.split("/");
135
+ r.pop();
136
+ let a = null;
137
+ for (let c = r.length; c >= 0; c -= 1) {
138
+ const i = r.slice(0, c).join("/");
139
+ try {
140
+ const d = {
141
+ kind: "package-path",
142
+ path: m(i ? `${i}/${n}` : n)
143
+ };
144
+ if (a ?? (a = d), u.size === 0 || u.has(l(d)))
145
+ return d;
146
+ } catch {
147
+ }
148
+ }
149
+ return a;
150
+ }
151
+ const f = {
152
+ unavailable: "ASSET_SOURCE_UNAVAILABLE",
153
+ conflict: "SOURCE_REVISION_CONFLICT",
154
+ unverifiable: "SOURCE_FACTS_UNVERIFIABLE",
155
+ factsMismatch: "ASSET_SOURCE_FACTS_MISMATCH",
156
+ invalidLocator: "ASSET_SOURCE_INVALID_LOCATOR"
157
+ };
158
+ function U(t) {
159
+ const e = new URL(t.entryUrl);
160
+ if (e.protocol !== "http:" && e.protocol !== "https:" || e.username || e.password || e.hash)
161
+ throw new p(
162
+ f.invalidLocator,
163
+ `Remote asset entry URL must be an absolute HTTP(S) URL without credentials or fragment: ${t.entryUrl}.`
164
+ );
165
+ const o = t.allowedScopes ? t.allowedScopes.map(R) : void 0, n = {
166
+ kind: "remote-entry",
167
+ revisionId: t.revisionId,
168
+ entryUrl: e.href,
169
+ ...t.request ? { request: t.request } : {},
170
+ ...o ? { allowedScopes: o } : {}
171
+ };
172
+ if (!A(n, e))
173
+ throw new p(
174
+ f.invalidLocator,
175
+ `Remote asset entry URL is outside its allowed scopes: ${e.href}.`
176
+ );
177
+ return n;
178
+ }
179
+ function v(t) {
180
+ if (!t.allowedScopes) return [];
181
+ const e = /* @__PURE__ */ new Map();
182
+ for (const o of t.allowedScopes) {
183
+ const n = R(o);
184
+ e.set(`${n.origin}\0${n.pathPrefix}`, n);
185
+ }
186
+ return [...e.values()].sort((o, n) => o.origin.localeCompare(n.origin) || o.pathPrefix.localeCompare(n.pathPrefix));
187
+ }
188
+ function A(t, e) {
189
+ return t.allowedScopes ? v(t).some((o) => N(e, o)) : e.protocol === "http:" || e.protocol === "https:";
190
+ }
191
+ function D(t, e) {
192
+ const o = E(t), n = T(e), s = o.endsWith("/") ? o : `${o}/`;
193
+ return n === "/" || s === n || o.startsWith(n);
194
+ }
195
+ function N(t, e) {
196
+ const o = R(e);
197
+ return t.origin === o.origin && D(t.pathname, o.pathPrefix);
198
+ }
199
+ function P(t) {
200
+ return S(t.entryUrl);
201
+ }
202
+ function R(t) {
203
+ const e = new URL(t.origin);
204
+ if (e.protocol !== "http:" && e.protocol !== "https:" || e.username || e.password || e.pathname !== "/" || e.search || e.hash)
205
+ throw new p(
206
+ f.invalidLocator,
207
+ `Asset scope origin must be a canonical HTTP(S) origin: ${t.origin}.`
208
+ );
209
+ return {
210
+ origin: e.origin,
211
+ pathPrefix: T(t.pathPrefix)
212
+ };
213
+ }
214
+ function T(t) {
215
+ if (!t.startsWith("/"))
216
+ throw new p(
217
+ f.invalidLocator,
218
+ `Asset scope pathPrefix must be absolute: ${t}.`
219
+ );
220
+ const e = E(t);
221
+ return e.endsWith("/") ? e : `${e}/`;
222
+ }
223
+ function E(t) {
224
+ const e = new URL(t, "https://scope.invalid");
225
+ let o;
226
+ try {
227
+ o = decodeURIComponent(e.pathname);
228
+ } catch {
229
+ throw new p(
230
+ f.invalidLocator,
231
+ `Asset resource path contains invalid URL escaping: ${t}.`
232
+ );
233
+ }
234
+ const n = [];
235
+ for (const s of o.split("/"))
236
+ !s || s === "." || (s === ".." ? n.pop() : n.push(s));
237
+ return `/${n.join("/")}${o.endsWith("/") && n.length ? "/" : ""}`;
238
+ }
239
+ function q(t) {
240
+ return "visualRevisionId" in t ? t.visualRevisionId : t.revisionId;
241
+ }
242
+ function J(t) {
243
+ return t.kind === "local-package" ? {
244
+ kind: "local-package",
245
+ revisionId: t.revisionId,
246
+ entryPath: t.entryPath,
247
+ files: t.files.map((e) => ({ locator: e.locator, blob: e.blob }))
248
+ } : {
249
+ kind: "remote-entry",
250
+ revisionId: t.revisionId,
251
+ entryUrl: t.entryUrl,
252
+ ...t.request ? { request: t.request } : {},
253
+ ...t.allowedScopes ? { allowedScopes: t.allowedScopes.map((e) => ({ ...e })) } : {}
254
+ };
255
+ }
256
+ async function W(t, e = {}) {
257
+ var r, a, c;
258
+ if ((r = e.signal) == null || r.throwIfAborted(), t.kind === "remote-entry") {
259
+ const i = U(t);
260
+ return {
261
+ source: i,
262
+ facts: [],
263
+ fingerprint: L(i)
264
+ };
265
+ }
266
+ const o = [];
267
+ for (const i of t.files) {
268
+ (a = e.signal) == null || a.throwIfAborted();
269
+ const d = k(i.locator);
270
+ if (d.kind !== "package-path")
271
+ throw new p(
272
+ f.invalidLocator,
273
+ `Local asset sources cannot contain remote resources: ${d.url}.`
274
+ );
275
+ const g = m(d.path), y = new Uint8Array(await i.blob.arrayBuffer());
276
+ (c = e.signal) == null || c.throwIfAborted(), o.push({
277
+ locator: { kind: "package-path", path: g },
278
+ blob: i.blob,
279
+ resourceId: j(
280
+ { kind: "package-path", path: g },
281
+ b(y)
282
+ ),
283
+ sha256: b(y),
284
+ byteSize: y.byteLength,
285
+ mediaType: z(g, i.blob.type) ?? I
286
+ });
287
+ }
288
+ o.sort((i, d) => i.resourceId.localeCompare(d.resourceId));
289
+ const n = m(t.entryPath);
290
+ if (!o.some((i) => i.locator.kind === "package-path" && i.locator.path === n))
291
+ throw new p(
292
+ f.unverifiable,
293
+ `Local asset source is missing its entry: ${t.entryPath}.`
294
+ );
295
+ const s = {
296
+ kind: "local-package",
297
+ revisionId: t.revisionId,
298
+ entryPath: n,
299
+ files: o.map((i) => ({ locator: i.locator, blob: i.blob }))
300
+ }, u = o.map(({ resourceId: i, locator: d, sha256: g, byteSize: y, mediaType: x }) => ({
301
+ resourceId: i,
302
+ locator: d,
303
+ sha256: g,
304
+ byteSize: y,
305
+ mediaType: x
306
+ }));
307
+ return {
308
+ source: s,
309
+ facts: u,
310
+ fingerprint: L(s, u)
311
+ };
312
+ }
313
+ function B(t, e) {
314
+ const o = q(e);
315
+ if (t.revisionId !== o)
316
+ throw h(
317
+ `Asset source revision ${t.revisionId} does not match requested revision ${o}.`
318
+ );
319
+ const n = e.resources.find((r) => r.resourceId === e.entryResourceId);
320
+ if (!n)
321
+ throw h(
322
+ `Asset source entry does not match revision facts for ${o}.`
323
+ );
324
+ if (t.kind === "remote-entry") {
325
+ if (U(t), n.locator.kind !== "remote-url" || n.locator.url !== P(t))
326
+ throw h(
327
+ `Remote asset source entry does not match revision facts for ${o}.`
328
+ );
329
+ for (const r of e.resources) {
330
+ if (r.locator.kind !== "remote-url")
331
+ throw h(
332
+ `Remote asset source does not authorize revision resource ${l(r.locator)}.`
333
+ );
334
+ const a = new URL(r.locator.url);
335
+ if (!A(t, a))
336
+ throw h(
337
+ `Remote asset source does not authorize revision resource ${l(r.locator)}.`
338
+ );
339
+ }
340
+ return;
341
+ }
342
+ if (n.locator.kind !== "package-path" || n.locator.path !== t.entryPath)
343
+ throw h(
344
+ `Local asset source entry does not match revision facts for ${o}.`
345
+ );
346
+ const s = new Map(e.resources.map((r) => [
347
+ l(r.locator),
348
+ r
349
+ ])), u = new Map(t.files.map((r) => [
350
+ l(r.locator),
351
+ r
352
+ ]));
353
+ if (s.size !== u.size)
354
+ throw h(`Local asset source path set does not match ${o}.`);
355
+ for (const [r, a] of u) {
356
+ const c = s.get(r);
357
+ if (!c || a.blob.size !== c.byteSize)
358
+ throw h(`Local asset source facts do not match ${o}/${r}.`);
359
+ }
360
+ }
361
+ async function Q(t, e, o = {}) {
362
+ var r;
363
+ if (B(t, e), t.kind === "remote-entry") return;
364
+ const n = await W(t, o), s = new Map(e.resources.map((a) => [
365
+ l(a.locator),
366
+ a
367
+ ])), u = new Map(t.files.map((a) => [
368
+ l(a.locator),
369
+ a.blob
370
+ ]));
371
+ for (const a of n.facts) {
372
+ const c = s.get(l(a.locator));
373
+ if (!c || c.sha256 !== a.sha256 || c.byteSize !== a.byteSize)
374
+ throw h(`Local asset source bytes do not match ${t.revisionId}/${l(a.locator)}.`);
375
+ const i = z(
376
+ a.locator.kind === "package-path" ? a.locator.path : a.locator.url,
377
+ (r = u.get(l(a.locator))) == null ? void 0 : r.type
378
+ );
379
+ if (i && i !== c.mediaType)
380
+ throw h(
381
+ `Local asset source mediaType does not match ${t.revisionId}/${l(a.locator)}.`
382
+ );
383
+ }
384
+ }
385
+ function L(t, e = []) {
386
+ return _(
387
+ t.kind === "local-package" ? {
388
+ kind: t.kind,
389
+ revisionId: t.revisionId,
390
+ entryPath: t.entryPath,
391
+ facts: e.map((o) => ({
392
+ locator: o.locator,
393
+ sha256: o.sha256,
394
+ byteSize: o.byteSize,
395
+ mediaType: o.mediaType
396
+ })).sort((o, n) => l(o.locator).localeCompare(
397
+ l(n.locator)
398
+ ))
399
+ } : {
400
+ kind: t.kind,
401
+ revisionId: t.revisionId,
402
+ entryUrl: P(t),
403
+ scopePolicy: t.allowedScopes === void 0 ? "unrestricted-http" : "explicit",
404
+ scopes: v(t).map((o) => `${o.origin}${o.pathPrefix}`)
405
+ }
406
+ );
407
+ }
408
+ function Z(t) {
409
+ return {
410
+ assetId: t.revisionId,
411
+ entryLocator: { kind: "package-path", path: t.entryPath },
412
+ files: t.files.map((e) => ({ locator: e.locator, blob: e.blob }))
413
+ };
414
+ }
415
+ function h(t) {
416
+ return new p(f.factsMismatch, t);
417
+ }
418
+ export {
419
+ I as D,
420
+ f as S,
421
+ l as a,
422
+ X as b,
423
+ S as c,
424
+ B as d,
425
+ P as e,
426
+ J as f,
427
+ m as g,
428
+ U as h,
429
+ v as i,
430
+ D as j,
431
+ W as k,
432
+ G as l,
433
+ H as m,
434
+ k as n,
435
+ q as o,
436
+ Y as p,
437
+ L as q,
438
+ z as r,
439
+ Z as s,
440
+ K as t,
441
+ j as u,
442
+ Q as v,
443
+ A as w
444
+ };
@@ -0,0 +1 @@
1
+ (function(){"use strict";function c(t){if(t instanceof Error){const e=t;return{name:e.name,message:e.message,...typeof e.code=="string"?{code:e.code}:{},...typeof e.stage=="string"?{stage:e.stage}:{},...e.detail&&typeof e.detail=="object"?{detail:e.detail}:{}}}return{name:"Error",message:String(t)}}const l=globalThis;let u=null,d="",i=null;function s(t,e=[]){l.postMessage(t,e)}function a(t,e,r){if(!u)throw new Error("OpenUSD exporter runtime is not initialized.");const n=u.ccall(t,"string",r,e);if(typeof n!="string")throw new Error(`${t} did not return JSON.`);const o=JSON.parse(n);if(o.ok===!1)throw Object.assign(new Error(String(o.message??`${t} failed.`)),{code:typeof o.code=="string"?o.code:`${t.toUpperCase()}_FAILED`,stage:typeof o.stage=="string"?o.stage:"worker",detail:o});return o}async function p(t){u=await(await import(t.moduleUrl)).default({locateFile:n=>n.endsWith(".wasm")?t.wasmUrl:n});const r=u._usd_exporter_api_version();if(r!==t.apiVersion)throw Object.assign(new Error(`OpenUSD exporter API ${r} does not match expected ${t.apiVersion}.`),{code:"EXPORT_RUNTIME_API_MISMATCH",stage:"worker-load"});d=t.runtimeId,s({type:"ready",apiVersion:r,runtimeId:d})}function f(t,e){const r=a("usd_export_begin",[JSON.stringify(t),JSON.stringify(e)],["string","string"]),n=Number(r.handle);if(!Number.isInteger(n)||n<=0)throw Object.assign(new Error("Exporter returned an invalid session handle."),{code:"EXPORT_HANDLE_INVALID",stage:"stage-build"});return i=n,{handle:n,planDigest:String(r.planDigest??"")}}function b(t,e){if(!u||i===null)throw new Error("Exporter session is not initialized.");const r=new Uint8Array(e),n=u._malloc(Math.max(1,r.byteLength));if(!n)throw new Error(`Unable to allocate ${r.byteLength} bytes for ${t}.`);try{u.HEAPU8.set(r,n),a("usd_export_write_resource",[i,t,n,r.byteLength],["number","string","number","number"])}finally{u._free(n)}}function _(t){if(!u||i===null)throw new Error("Exporter session is not initialized.");const e=a("usd_export_output_info",[i,t],["number","string"]),r=Number(u.ccall("usd_export_output_size","number",["number","string"],[i,t]));if(!Number.isInteger(r)||r<0||r!==e.byteSize)throw Object.assign(new Error(`Invalid exporter output size for ${t}.`),{code:"EXPORT_OUTPUT_SIZE_INVALID",stage:"final-validate"});const n=Number(u.ccall("usd_export_output_data","number",["number","string"],[i,t]));if(r>0&&!n)throw new Error(`Exporter output pointer is null for ${t}.`);const o=u.HEAPU8.slice(n,n+r);return o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength)}async function y(t){switch(t.type){case"init":await p(t.runtime);return;case"begin":s({type:"result",id:t.id,value:f(t.plan,t.options)});return;case"write-resource":b(t.path,t.bytes),s({type:"result",id:t.id,value:{path:t.path}});return;case"build-stage":s({type:"result",id:t.id,value:a("usd_export_build_stage",[i],["number"])});return;case"write-output":s({type:"result",id:t.id,value:a("usd_export_write_layer",[i,t.encoding,t.path],["number","string","string"])});return;case"package-usdz":s({type:"result",id:t.id,value:a("usd_export_package_usdz",[i,t.entryPath,t.outputPath],["number","string","string"])});return;case"validate":s({type:"result",id:t.id,value:a("usd_export_validate",[i,JSON.stringify(t.expectation)],["number","string"])});return;case"read-output":{const e=_(t.path);s({type:"output",id:t.id,path:t.path,bytes:e},[e]);return}case"release":i!==null?(s({type:"result",id:t.id,value:a("usd_export_release",[i],["number"])}),i=null):s({type:"result",id:t.id,value:{ok:!0}})}}l.onmessage=t=>{const e=t.data;y(e).catch(r=>{s({type:"error",..."id"in e?{id:e.id}:{},error:c(r)})})}})();