@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.
- package/README.md +206 -3
- package/dist/ai/contract.d.ts +73 -0
- package/dist/ai/host.d.ts +28 -0
- package/dist/asset/dependency-scan.d.ts +78 -0
- package/dist/asset/intake.d.ts +84 -0
- package/dist/asset/layout-detect.d.ts +40 -0
- package/dist/asset/media-type.d.ts +10 -0
- package/dist/asset/model-inspection.d.ts +127 -0
- package/dist/asset/record.d.ts +35 -0
- package/dist/asset/remote-asset-resolver.d.ts +36 -0
- package/dist/asset/repairs.d.ts +53 -0
- package/dist/asset/resource-locator.d.ts +15 -0
- package/dist/asset/revision-diff.d.ts +33 -0
- package/dist/asset/source-contracts.d.ts +21 -0
- package/dist/asset/source-paths.d.ts +15 -0
- package/dist/asset/usd-inspection.d.ts +39 -0
- package/dist/asset/usd-source-metadata.d.ts +142 -0
- package/dist/asset/visual-intake.d.ts +27 -0
- package/dist/asset/visual-record.d.ts +22 -0
- package/dist/asset/web-intake.d.ts +46 -0
- package/dist/asset-source-BExlEcRt.js +444 -0
- package/dist/assets/openusd_three_loader-DLiqJWUM.js +13769 -0
- package/dist/assets/usd-export-worker-BRxTLqer.js +182 -0
- package/dist/assets/usd-worker-DekqMsQv.js +1392 -0
- package/dist/builders-BAXRR5o5.js +1854 -0
- package/dist/core/asset-task.d.ts +105 -0
- package/dist/core/context.d.ts +23 -0
- package/dist/core/host.d.ts +432 -0
- package/dist/core/persistence-controller.d.ts +58 -0
- package/dist/core/plugins.d.ts +139 -0
- package/dist/core/scene-tree.d.ts +62 -0
- package/dist/core/versions.d.ts +2 -0
- package/dist/core/when.d.ts +13 -0
- package/dist/core/write-policy.d.ts +29 -0
- package/dist/delivery/build-plan.d.ts +2 -0
- package/dist/delivery/contracts.d.ts +362 -0
- package/dist/delivery/digest.d.ts +3 -0
- package/dist/delivery/evidence.d.ts +10 -0
- package/dist/delivery/export-evidence.d.ts +3 -0
- package/dist/delivery/index.d.ts +9 -0
- package/dist/delivery/prim-name.d.ts +17 -0
- package/dist/delivery/profile.d.ts +4 -0
- package/dist/doc/builders.d.ts +99 -0
- package/dist/doc/command.d.ts +195 -0
- package/dist/doc/domain-extensions.d.ts +34 -0
- package/dist/doc/node-facts.d.ts +87 -0
- package/dist/doc/physics-facts.d.ts +74 -0
- package/dist/doc/placement-policy.d.ts +71 -0
- package/dist/doc/random-placement.d.ts +30 -0
- package/dist/doc/scene-graph.d.ts +80 -0
- package/dist/doc/scene-regions.d.ts +29 -0
- package/dist/doc/schema.d.ts +452 -0
- package/dist/doc/task.d.ts +71 -0
- package/dist/doc/validate.d.ts +68 -0
- package/dist/editor/asset-source.d.ts +15 -0
- package/dist/editor/editor.d.ts +246 -0
- package/dist/editor/index.d.ts +22 -0
- package/dist/editor/shortcuts.d.ts +2 -0
- package/dist/editor/types.d.ts +143 -0
- package/dist/editor/ui-plugins.d.ts +64 -0
- package/dist/editor.js +1755 -0
- package/dist/editorial-BkAFWfbg.js +83 -0
- package/dist/export-evidence-DMNRhgL9.js +2705 -0
- package/dist/generalization/domain.d.ts +10 -0
- package/dist/generalization/generalization.d.ts +371 -0
- package/dist/generalization/index.d.ts +11 -0
- package/dist/generalization.js +1659 -0
- package/dist/history/undo-stack.d.ts +74 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.js +2840 -0
- package/dist/mjcf-visual-Bt4bUxd1.js +72 -0
- package/dist/mujoco-runtime-BYZnrvbR.js +467 -0
- package/dist/persist/content-addressed.d.ts +11 -0
- package/dist/persist/create-scene-package-from-host.d.ts +7 -0
- package/dist/persist/indexeddb-store.d.ts +69 -0
- package/dist/persist/scene-file.d.ts +52 -0
- package/dist/persist/scene-package.d.ts +8 -0
- package/dist/persist/snapshot.d.ts +5 -0
- package/dist/physics-facts-tfQYyNTD.js +337 -0
- package/dist/placement-policy-DY_FNRDu.js +405 -0
- package/dist/ports/asset-ingestor.d.ts +41 -0
- package/dist/ports/asset-source.d.ts +57 -0
- package/dist/ports/delivery.d.ts +13 -0
- package/dist/ports/persistence.d.ts +29 -0
- package/dist/project/asset-catalog.d.ts +21 -0
- package/dist/project/contracts.d.ts +272 -0
- package/dist/project/editorial.d.ts +16 -0
- package/dist/project/identity.d.ts +20 -0
- package/dist/project/index.d.ts +9 -0
- package/dist/project/scene-document.d.ts +5 -0
- package/dist/project/source-dependencies.d.ts +7 -0
- package/dist/remote-asset-resolver-Cb8cfNmw.js +136 -0
- package/dist/scene/index.d.ts +12 -0
- package/dist/scene-graph-DBLKAhxa.js +681 -0
- package/dist/scene-session-Cy6vDJ1l.js +21981 -0
- package/dist/scene.js +244 -0
- package/dist/session-BRBrCLdd.js +963 -0
- package/dist/session-DI5tPJxn.js +825 -0
- package/dist/session-q3uuG7OP.js +296 -0
- package/dist/studio/delivery-catalog.d.ts +28 -0
- package/dist/studio/in-memory-asset-source.d.ts +15 -0
- package/dist/studio/index.d.ts +31 -0
- package/dist/studio/indexeddb-asset-source.d.ts +32 -0
- package/dist/studio/indexeddb-persistence.d.ts +13 -0
- package/dist/studio/remote-asset-importer.d.ts +56 -0
- package/dist/studio/source-package.d.ts +9 -0
- package/dist/studio/usd-export-client.d.ts +13 -0
- package/dist/studio/usd-export-protocol.d.ts +98 -0
- package/dist/studio/usd-export-worker.d.ts +1 -0
- package/dist/studio/usd-zip-reader.d.ts +14 -0
- package/dist/studio/web-asset-ingestor.d.ts +10 -0
- package/dist/studio/web-host.d.ts +8 -0
- package/dist/studio.js +5545 -0
- package/dist/urdf-session-CQir2nb2.js +1230 -0
- package/dist/usd-session-DZJnEEOs.js +7385 -0
- package/dist/util/asset-facts.d.ts +3 -0
- package/dist/util/data.d.ts +17 -0
- package/dist/util/diagnostics.d.ts +38 -0
- package/dist/util/geometry.d.ts +11 -0
- package/dist/util/hash.d.ts +9 -0
- package/dist/util/ids.d.ts +20 -0
- package/dist/util/math.d.ts +47 -0
- package/dist/util/ply-metadata.d.ts +19 -0
- package/dist/util/studio-source.d.ts +23 -0
- package/dist/version.d.ts +5 -0
- package/dist/view/appearance.d.ts +13 -0
- package/dist/view/authoring-appearance.d.ts +25 -0
- package/dist/view/bounds-preview.d.ts +34 -0
- package/dist/view/bounds.d.ts +11 -0
- package/dist/view/camera-zoom.d.ts +3 -0
- package/dist/view/geometry-anchors.d.ts +20 -0
- package/dist/view/gizmo-appearance.d.ts +5 -0
- package/dist/view/gizmo.d.ts +81 -0
- package/dist/view/group-selection.d.ts +13 -0
- package/dist/view/node-features.d.ts +39 -0
- package/dist/view/picking.d.ts +49 -0
- package/dist/view/placement.d.ts +48 -0
- package/dist/view/region-editing.d.ts +25 -0
- package/dist/view/rotation-guide.d.ts +36 -0
- package/dist/view/runtime-capabilities.d.ts +22 -0
- package/dist/view/scene-session.d.ts +258 -0
- package/dist/view/screen-bounds.d.ts +17 -0
- package/dist/view/selection-transform.d.ts +20 -0
- package/dist/wasm-module-DZn2AM1W.js +13 -0
- package/dist/xacro-DLRXyk60.js +76 -0
- package/node_modules/@nebula-spatial/cad-loader/CHANGELOG.md +48 -0
- package/node_modules/@nebula-spatial/cad-loader/README.md +108 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/cad-types.d.ts +26 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/errors.d.ts +5 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/index.d.ts +24 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/index.js +2354 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-group-reader.d.ts +9 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-parser.d.ts +78 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/dxbs-sidecar.d.ts +24 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/geometry-segments.d.ts +20 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/text-roundtrip.d.ts +4 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/types.d.ts +81 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/runtime-text-decoder.d.ts +8 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/types.d.ts +153 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/insert-bbox.d.ts +10 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/viewport-rect.d.ts +21 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/index.d.ts +36 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/index.js +5829 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/geo-loader.d.ts +59 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/automatic-external-resources.d.ts +26 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/external-variant-sidecar-fetch.d.ts +13 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/flow-control.d.ts +29 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/frame-budget-scheduler.d.ts +21 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-compact-executor.d.ts +19 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-local-adapter.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-pipeline.d.ts +92 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-worker-adapter.d.ts +13 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-builder.d.ts +34 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-load-sink.d.ts +28 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node.d.ts +304 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare-worker-types.d.ts +94 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.d.ts +38 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.worker.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-model-builder.d.ts +10 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-runtime-geometry.d.ts +15 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-canonical.d.ts +37 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-quality.d.ts +9 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/prepare-credit-gate.d.ts +20 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/transport.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/cad-render-node.d.ts +80 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/geo-node-cad-render-node.d.ts +12 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-geometry.d.ts +28 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-material.d.ts +18 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/block-geometry-registry.d.ts +35 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/insert-instance-table.d.ts +23 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/viewport-instance-presenter.d.ts +66 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-insert-selection.d.ts +35 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-text-selection.d.ts +31 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/annotation-idle-gate.d.ts +14 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-document-session.d.ts +187 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-font-runtime.d.ts +11 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-insert-id.d.ts +6 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-text-warmup.d.ts +38 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/create-cad-document-session.d.ts +5 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/load-session.d.ts +90 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/viewport-coverage.d.ts +32 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/abort.d.ts +3 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-display-color.d.ts +55 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-load-source.d.ts +8 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/color-buffer.d.ts +6 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/constants.d.ts +11 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/display-color-buffer.d.ts +27 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/errors.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-builder.d.ts +25 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-font.d.ts +12 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/types.d.ts +57 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/insert-bbox.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/timing.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/viewport-rect.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/viewer-theme.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/workers/geo-prepare.worker.js +2264 -0
- package/node_modules/@nebula-spatial/cad-loader/package.json +62 -0
- package/node_modules/@nebula-spatial/viewer/CHANGELOG.md +426 -0
- package/node_modules/@nebula-spatial/viewer/FBX-MATERIAL-CONVERSION.md +97 -0
- package/node_modules/@nebula-spatial/viewer/README.md +1056 -0
- package/node_modules/@nebula-spatial/viewer/USD-VISUAL-MATERIAL-SUPPORT.md +89 -0
- package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.js +19 -0
- package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.wasm +0 -0
- package/node_modules/@nebula-spatial/viewer/dist/asset-ir-DEOK9SqE.js +382 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/ground-grid.d.ts +6 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/source-types.d.ts +19 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/types.d.ts +393 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/usd-worker-Bom5cjz3.js +1392 -0
- package/node_modules/@nebula-spatial/viewer/dist/cad/text.d.ts +2 -0
- package/node_modules/@nebula-spatial/viewer/dist/cad/types.d.ts +368 -0
- package/node_modules/@nebula-spatial/viewer/dist/index-ByBlfVc0.js +12132 -0
- package/node_modules/@nebula-spatial/viewer/dist/index.d.ts +32 -0
- package/node_modules/@nebula-spatial/viewer/dist/index.js +26 -0
- package/node_modules/@nebula-spatial/viewer/dist/inspection/types.d.ts +112 -0
- package/node_modules/@nebula-spatial/viewer/dist/mjcf-visual-DVRa0w90.js +72 -0
- package/node_modules/@nebula-spatial/viewer/dist/mujoco-runtime-Dhx6Ua2u.js +463 -0
- package/node_modules/@nebula-spatial/viewer/dist/plugins.d.ts +179 -0
- package/node_modules/@nebula-spatial/viewer/dist/scene/instances.d.ts +36 -0
- package/node_modules/@nebula-spatial/viewer/dist/scene/types.d.ts +258 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-B-j6KdA-.js +389 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-B4AICTeJ.js +963 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-BAG5cDYe.js +9153 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-runtime.d.ts +118 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-wasm-module.d.ts +11 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/openusd-wasm-module.d.ts +10 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/physics-runtime-state.d.ts +75 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/types.d.ts +129 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-inspection.d.ts +66 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-query.d.ts +50 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-resource-policy.d.ts +28 -0
- package/node_modules/@nebula-spatial/viewer/dist/types.d.ts +278 -0
- package/node_modules/@nebula-spatial/viewer/dist/ui/types.d.ts +48 -0
- package/node_modules/@nebula-spatial/viewer/dist/urdf-session-kemAnBn8.js +3231 -0
- package/node_modules/@nebula-spatial/viewer/dist/usd-session-QtwGKI7v.js +6771 -0
- package/node_modules/@nebula-spatial/viewer/dist/version.d.ts +5 -0
- package/node_modules/@nebula-spatial/viewer/dist/viewer.d.ts +2 -0
- package/node_modules/@nebula-spatial/viewer/dist/xacro-CYTPS7mh.js +1537 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd-runtime-manifest.json +15 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.js +14 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.wasm +0 -0
- package/node_modules/@nebula-spatial/viewer/package.json +66 -0
- package/package.json +87 -6
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { Group as D, MeshStandardMaterial as j, Mesh as Y, PointsMaterial as H, Points as J, Color as Q, Box3 as V, Vector3 as A, MeshBasicMaterial as X, BoxGeometry as O } from "three";
|
|
2
|
+
import { PLYLoader as ee } from "three/examples/jsm/loaders/PLYLoader.js";
|
|
3
|
+
import { SplatMesh as ne, SplatFileType as B, SparkRenderer as te } from "@sparkjsdev/spark";
|
|
4
|
+
import { a as $, D as re } from "./scene-session-Cy6vDJ1l.js";
|
|
5
|
+
const ie = /^(?:f_dc_\d+|f_rest_\d+|opacity|scale_\d+|rot_\d+|packed_(?:position|rotation|scale|color))$/i, se = /^(?:x|y|z|red|green|blue|r|g|b)$/i;
|
|
6
|
+
function ae(n) {
|
|
7
|
+
var P;
|
|
8
|
+
const e = n instanceof Uint8Array ? n : new Uint8Array(n), o = e.subarray(0, Math.min(e.byteLength, 1024 * 1024)), t = new TextDecoder("latin1").decode(o), i = t.search(/\r?\nend_header\s*(?:\r?\n|$)/i);
|
|
9
|
+
if (i < 0)
|
|
10
|
+
return { kind: "unsupported", reason: "PLY header is missing end_header." };
|
|
11
|
+
const l = t.slice(0, i + 1).split(/\r?\n/).map((d) => d.trim()).filter(Boolean);
|
|
12
|
+
if (((P = l[0]) == null ? void 0 : P.toLowerCase()) !== "ply")
|
|
13
|
+
return { kind: "unsupported", reason: "PLY magic is missing." };
|
|
14
|
+
let w = null, u = 0, g = 0, f = null;
|
|
15
|
+
const r = [], k = [];
|
|
16
|
+
for (const d of l.slice(1)) {
|
|
17
|
+
const m = d.split(/\s+/);
|
|
18
|
+
if (m[0] === "format" && (w = m[1] ?? null), m[0] === "element" && m[1] && (f = m[1].toLowerCase(), r.push(f), f === "vertex" && (u = I(m[2])), f === "face" && (g = I(m[2]))), m[0] === "property" && f === "vertex") {
|
|
19
|
+
const E = m.at(-1);
|
|
20
|
+
E && k.push(E);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const h = {
|
|
24
|
+
format: w,
|
|
25
|
+
vertexCount: u,
|
|
26
|
+
faceCount: g,
|
|
27
|
+
properties: k,
|
|
28
|
+
elements: r
|
|
29
|
+
};
|
|
30
|
+
if (u <= 0)
|
|
31
|
+
return { kind: "unsupported", reason: "PLY has no vertex data.", ply: h };
|
|
32
|
+
if (g > 0 || r.includes("face"))
|
|
33
|
+
return { kind: "ply-mesh", reason: "PLY declares a face element.", ply: h };
|
|
34
|
+
if (k.some((d) => ie.test(d)))
|
|
35
|
+
return { kind: "gaussian-ply", reason: "PLY declares Gaussian splat properties.", ply: h };
|
|
36
|
+
const L = new Set(k.map((d) => d.toLowerCase()));
|
|
37
|
+
if (!["x", "y", "z"].every((d) => L.has(d)))
|
|
38
|
+
return { kind: "unsupported", reason: "PLY point cloud is missing x/y/z fields.", ply: h };
|
|
39
|
+
const z = ["red", "green", "blue"].filter((d) => L.has(d));
|
|
40
|
+
return z.length !== 0 && z.length !== 3 ? { kind: "unsupported", reason: "PLY point cloud has an incomplete RGB field set.", ply: h } : k.some((d) => !se.test(d)) ? {
|
|
41
|
+
kind: "unsupported",
|
|
42
|
+
reason: "PLY has no faces and contains non-standard fields, but is not a recognised Gaussian layout.",
|
|
43
|
+
ply: h
|
|
44
|
+
} : { kind: "ply-point-cloud", reason: "PLY has xyz vertices, no faces and no Gaussian fields.", ply: h };
|
|
45
|
+
}
|
|
46
|
+
function oe(n, e, o) {
|
|
47
|
+
const t = (e ?? "").toLowerCase(), i = (o ?? "").toLowerCase();
|
|
48
|
+
return t.endsWith(".ply") || i === "ply" ? ae(n) : t.endsWith(".glb") || i === "glb" ? { kind: "glb", reason: "GLB extension." } : t.endsWith(".gltf") || i === "gltf" ? { kind: "gltf", reason: "glTF extension." } : t.endsWith(".spz") || i === "spz" || le(n) ? { kind: "gaussian-spz", reason: "SPZ extension or magic." } : t.endsWith(".splat") || i === "splat" ? { kind: "gaussian-splat", reason: "SPLAT extension." } : t.endsWith(".ksplat") || i === "ksplat" ? { kind: "gaussian-ksplat", reason: "KSPLAT extension." } : t.endsWith(".rad") || i === "rad" ? { kind: "gaussian-rad", reason: "RAD extension." } : t.endsWith(".sog") || t.endsWith(".sog.zip") || i === "sog" || i === "pcsogs" || i === "pcsogszip" ? { kind: "gaussian-sog", reason: "SOG extension." } : (t.endsWith(".zip") || i === "zip") && ue(n, [80, 75]) ? {
|
|
49
|
+
kind: "unsupported",
|
|
50
|
+
reason: "ZIP is not a .sog.zip package; generic ZIPs are handled by asset intake."
|
|
51
|
+
} : { kind: "unsupported", reason: "No supported visual format was detected." };
|
|
52
|
+
}
|
|
53
|
+
function le(n) {
|
|
54
|
+
if (n.length < 4) return !1;
|
|
55
|
+
const e = de(n, 0);
|
|
56
|
+
return e === 1347639818 || e === 1347635022 ? !0 : n[0] === 31 && n[1] === 139;
|
|
57
|
+
}
|
|
58
|
+
function ue(n, e) {
|
|
59
|
+
return e.every((o, t) => n[t] === o);
|
|
60
|
+
}
|
|
61
|
+
function de(n, e) {
|
|
62
|
+
return (n[e] | n[e + 1] << 8 | n[e + 2] << 16 | n[e + 3] << 24) >>> 0;
|
|
63
|
+
}
|
|
64
|
+
function I(n) {
|
|
65
|
+
const e = Number(n);
|
|
66
|
+
return Number.isInteger(e) && e >= 0 ? e : 0;
|
|
67
|
+
}
|
|
68
|
+
const M = /* @__PURE__ */ new WeakMap();
|
|
69
|
+
function Pe(n, e) {
|
|
70
|
+
let o = !1, t = null, i = null, l = null, w = null, u = null, g = null, f = null, r = null, k = "unsupported", h = null, L = null, z = null, P = "y", d;
|
|
71
|
+
const m = W(), E = () => {
|
|
72
|
+
o = !0;
|
|
73
|
+
}, F = () => {
|
|
74
|
+
!f || !g || (f.references -= 1, f.references <= 0 && (g.remove(f.renderer), f.renderer.dispose(), M.get(g) === f && M.delete(g)), f = null, g = null);
|
|
75
|
+
}, q = (s, y) => {
|
|
76
|
+
if (f && g === y) return;
|
|
77
|
+
F();
|
|
78
|
+
let p = M.get(y);
|
|
79
|
+
if (!p) {
|
|
80
|
+
const S = new te({
|
|
81
|
+
renderer: s,
|
|
82
|
+
onDirty: e.requestRender,
|
|
83
|
+
transparent: !0,
|
|
84
|
+
depthTest: !0,
|
|
85
|
+
depthWrite: !1
|
|
86
|
+
});
|
|
87
|
+
S.name = "viewer-spark-renderer", y.add(S), p = { renderer: S, references: 0 }, M.set(y, p);
|
|
88
|
+
}
|
|
89
|
+
p.references += 1, f = p, g = y;
|
|
90
|
+
}, T = (async () => {
|
|
91
|
+
var G, C, N, R, U, _;
|
|
92
|
+
const s = await pe(n);
|
|
93
|
+
if (o || e.signal.aborted) throw Z();
|
|
94
|
+
const y = n.entryPath ?? n.filename, p = oe(s, y, e.format);
|
|
95
|
+
if (p.kind === "unsupported")
|
|
96
|
+
throw new Error(`Unsupported visual asset: ${p.reason}`);
|
|
97
|
+
k = p.kind;
|
|
98
|
+
const S = new D();
|
|
99
|
+
S.name = "viewer-visual-root";
|
|
100
|
+
const x = new D();
|
|
101
|
+
if (x.name = "viewer-visual-content", p.kind === "glb" || p.kind === "gltf")
|
|
102
|
+
throw new Error("GLB/glTF is handled by the model loader.");
|
|
103
|
+
if (p.kind === "ply-mesh" || p.kind === "ply-point-cloud") {
|
|
104
|
+
const c = new ee().parse(he(s));
|
|
105
|
+
if (c.computeBoundingBox(), !c.boundingBox || c.boundingBox.isEmpty())
|
|
106
|
+
throw c.dispose(), new Error("PLY does not contain displayable vertex data.");
|
|
107
|
+
if (p.kind === "ply-mesh") {
|
|
108
|
+
const a = c.hasAttribute("color"), b = new j({
|
|
109
|
+
color: a ? 16777215 : 10135733,
|
|
110
|
+
vertexColors: a,
|
|
111
|
+
roughness: 0.82,
|
|
112
|
+
metalness: 0.04
|
|
113
|
+
}), v = new Y(c, b);
|
|
114
|
+
v.name = "viewer-visual-ply-mesh", x.add(v);
|
|
115
|
+
} else {
|
|
116
|
+
const a = c.hasAttribute("color"), b = new H({
|
|
117
|
+
color: a ? 16777215 : 10934783,
|
|
118
|
+
vertexColors: a,
|
|
119
|
+
size: Math.max(4e-3, fe(c.boundingBox) * 3e-3),
|
|
120
|
+
sizeAttenuation: !0
|
|
121
|
+
}), v = new J(c, b);
|
|
122
|
+
v.name = "viewer-visual-ply-points", x.add(v);
|
|
123
|
+
}
|
|
124
|
+
h = null;
|
|
125
|
+
} else {
|
|
126
|
+
const c = ce(p.kind), a = new ne({
|
|
127
|
+
fileBytes: s,
|
|
128
|
+
fileType: c,
|
|
129
|
+
fileName: y ?? `visual.${c}`,
|
|
130
|
+
raycastable: e.options.visualSelectionMode === "exact"
|
|
131
|
+
});
|
|
132
|
+
if (await a.initialized, o || e.signal.aborted)
|
|
133
|
+
throw a.dispose(), Z();
|
|
134
|
+
if (a.name = "viewer-visual-splat", a.position.set(0, 0, 0), (G = e.options.visualAppearance) != null && G.color && (a.recolor = new Q(...e.options.visualAppearance.color)), ((C = e.options.visualAppearance) == null ? void 0 : C.opacity) !== void 0 && (a.opacity = e.options.visualAppearance.opacity), x.add(a), l = a, h = ((N = a.packedSplats) == null ? void 0 : N.numSplats) ?? ((R = a.extSplats) == null ? void 0 : R.numSplats) ?? ((U = a.paged) == null ? void 0 : U.numSplats) ?? ((_ = a.splats) == null ? void 0 : _.getNumSplats()) ?? null, w = me(a), w.isEmpty()) throw new Error("Gaussian asset has empty bounds.");
|
|
135
|
+
}
|
|
136
|
+
if (P = e.options.upAxis ?? (p.kind.startsWith("gaussian-") ? "y-down" : "y"), $(x, P), S.add(x), x.updateMatrixWorld(!0), r = new V().setFromObject(x), l && w && (l.updateWorldMatrix(!0, !1), r.union(w.clone().applyMatrix4(l.matrixWorld))), r.isEmpty()) throw new Error("Visual asset has no displayable bounds.");
|
|
137
|
+
if (l && e.options.visualSelectionMode !== "exact") {
|
|
138
|
+
const c = r.getSize(new A()), a = new X({
|
|
139
|
+
transparent: !0,
|
|
140
|
+
// The scene picker filters fully transparent materials, while colorWrite
|
|
141
|
+
// keeps this raycastable proxy invisible in the rendered frame.
|
|
142
|
+
opacity: 1,
|
|
143
|
+
colorWrite: !1,
|
|
144
|
+
depthTest: !1,
|
|
145
|
+
depthWrite: !1
|
|
146
|
+
}), b = new Y(new O(c.x, c.y, c.z), a), v = r.getCenter(new A());
|
|
147
|
+
b.position.copy(v), b.name = "viewer-visual-bounds-proxy", b.userData.viewerVisualBoundsProxy = !0, S.add(b), u = b;
|
|
148
|
+
}
|
|
149
|
+
t = S, i = x, z = W() - m;
|
|
150
|
+
})();
|
|
151
|
+
return T.catch((s) => {
|
|
152
|
+
L = s instanceof Error ? s.message : String(s), z = W() - m;
|
|
153
|
+
}), {
|
|
154
|
+
id: `visual-${Math.random().toString(36).slice(2)}`,
|
|
155
|
+
opened: T,
|
|
156
|
+
get root() {
|
|
157
|
+
return t;
|
|
158
|
+
},
|
|
159
|
+
get fitTarget() {
|
|
160
|
+
return r;
|
|
161
|
+
},
|
|
162
|
+
getFitBounds() {
|
|
163
|
+
return r;
|
|
164
|
+
},
|
|
165
|
+
capabilities: {
|
|
166
|
+
canPlay: !1,
|
|
167
|
+
canPause: !1,
|
|
168
|
+
canReset: !1,
|
|
169
|
+
hasPhysics: !1,
|
|
170
|
+
canReorientUpAxis: !0,
|
|
171
|
+
canToggleGround: !0
|
|
172
|
+
},
|
|
173
|
+
presentation: {
|
|
174
|
+
preferredViewMode: "3d",
|
|
175
|
+
interactionMode: "object",
|
|
176
|
+
uiProfile: "model",
|
|
177
|
+
fitPolicy: "fit-on-ready"
|
|
178
|
+
},
|
|
179
|
+
getUpAxis() {
|
|
180
|
+
return i ? P : null;
|
|
181
|
+
},
|
|
182
|
+
setUpAxis(s) {
|
|
183
|
+
o || !i || $(i, s) && (P = s, i.updateMatrixWorld(!0), r = new V().setFromObject(i), K(), e.requestRender());
|
|
184
|
+
},
|
|
185
|
+
setGroundVisible() {
|
|
186
|
+
},
|
|
187
|
+
getGroundVisible() {
|
|
188
|
+
return !1;
|
|
189
|
+
},
|
|
190
|
+
getGroundGridScale() {
|
|
191
|
+
return re;
|
|
192
|
+
},
|
|
193
|
+
beforeRender(s, y) {
|
|
194
|
+
!o && l && q(s, y);
|
|
195
|
+
},
|
|
196
|
+
getVisualDiagnostics() {
|
|
197
|
+
const s = (r == null ? void 0 : r.getSize(new A())) ?? new A();
|
|
198
|
+
return {
|
|
199
|
+
schemaVersion: 1,
|
|
200
|
+
backend: l ? "spark-2.4.0" : k === "ply-point-cloud" ? "three-points" : "three-mesh",
|
|
201
|
+
kind: k,
|
|
202
|
+
splatCount: h,
|
|
203
|
+
bounds: r ? {
|
|
204
|
+
min: [r.min.x, r.min.y, r.min.z],
|
|
205
|
+
max: [r.max.x, r.max.y, r.max.z],
|
|
206
|
+
size: [s.x, s.y, s.z]
|
|
207
|
+
} : null,
|
|
208
|
+
upAxis: P,
|
|
209
|
+
loadMilliseconds: z,
|
|
210
|
+
error: L
|
|
211
|
+
};
|
|
212
|
+
},
|
|
213
|
+
beginDispose() {
|
|
214
|
+
E();
|
|
215
|
+
},
|
|
216
|
+
dispose() {
|
|
217
|
+
return E(), d ?? (d = T.catch(() => {
|
|
218
|
+
}).then(() => {
|
|
219
|
+
if (u == null || u.geometry.dispose(), u)
|
|
220
|
+
for (const s of Array.isArray(u.material) ? u.material : [u.material]) s.dispose();
|
|
221
|
+
u = null, l == null || l.dispose(), l = null, w = null, t && ge(t), t = null, i = null, F();
|
|
222
|
+
})), d;
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
function K() {
|
|
226
|
+
if (!u || !r) return;
|
|
227
|
+
const s = r.getSize(new A()), y = r.getCenter(new A());
|
|
228
|
+
u.geometry.dispose(), u.geometry = new O(s.x, s.y, s.z), u.position.copy(y);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
async function pe(n) {
|
|
232
|
+
const e = n.original;
|
|
233
|
+
if (typeof Blob < "u" && e instanceof Blob)
|
|
234
|
+
return new Uint8Array(await e.arrayBuffer());
|
|
235
|
+
if (e instanceof ArrayBuffer) return new Uint8Array(e);
|
|
236
|
+
if (typeof e == "object" && e !== null && "kind" in e) {
|
|
237
|
+
if (e.kind === "buffer") return new Uint8Array(e.buffer);
|
|
238
|
+
if (e.kind === "files") {
|
|
239
|
+
const i = n.entryPath ?? e.entry, l = e.files.find((w) => w.path === i) ?? (e.files.length === 1 ? e.files[0] : null);
|
|
240
|
+
if (l) return new Uint8Array(await l.file.arrayBuffer());
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
const o = n.url ?? await n.resolve(n.entryPath ?? ""), t = await fetch(o, { signal: n.signal });
|
|
244
|
+
if (!t.ok) throw new Error(`Visual asset request failed: ${t.status} ${t.statusText}`);
|
|
245
|
+
return new Uint8Array(await t.arrayBuffer());
|
|
246
|
+
}
|
|
247
|
+
function ce(n) {
|
|
248
|
+
switch (n) {
|
|
249
|
+
case "gaussian-ply":
|
|
250
|
+
return B.PLY;
|
|
251
|
+
case "gaussian-spz":
|
|
252
|
+
return B.SPZ;
|
|
253
|
+
case "gaussian-splat":
|
|
254
|
+
return B.SPLAT;
|
|
255
|
+
case "gaussian-ksplat":
|
|
256
|
+
return B.KSPLAT;
|
|
257
|
+
case "gaussian-sog":
|
|
258
|
+
return B.PCSOGSZIP;
|
|
259
|
+
case "gaussian-rad":
|
|
260
|
+
return B.RAD;
|
|
261
|
+
default:
|
|
262
|
+
throw new Error(`Not a Gaussian format: ${n}`);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
function fe(n) {
|
|
266
|
+
return n.getSize(new A()).length();
|
|
267
|
+
}
|
|
268
|
+
function me(n) {
|
|
269
|
+
const e = n.getBoundingBox(!0);
|
|
270
|
+
return ye(e) || (e.makeEmpty(), n.forEachSplat((o, t) => {
|
|
271
|
+
Number.isFinite(t.x) && Number.isFinite(t.y) && Number.isFinite(t.z) && e.expandByPoint(t);
|
|
272
|
+
})), e;
|
|
273
|
+
}
|
|
274
|
+
function ye(n) {
|
|
275
|
+
return !n.isEmpty() && Number.isFinite(n.min.x) && Number.isFinite(n.min.y) && Number.isFinite(n.min.z) && Number.isFinite(n.max.x) && Number.isFinite(n.max.y) && Number.isFinite(n.max.z);
|
|
276
|
+
}
|
|
277
|
+
function ge(n) {
|
|
278
|
+
n.traverse((e) => {
|
|
279
|
+
"geometry" in e && e.geometry && typeof e.geometry.dispose == "function" && e.geometry.dispose();
|
|
280
|
+
const o = "material" in e ? e.material : null;
|
|
281
|
+
for (const t of Array.isArray(o) ? o : o ? [o] : []) t.dispose();
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
function he(n) {
|
|
285
|
+
const e = new Uint8Array(n.byteLength);
|
|
286
|
+
return e.set(n), e.buffer;
|
|
287
|
+
}
|
|
288
|
+
function Z() {
|
|
289
|
+
return Object.assign(new Error("Visual asset load aborted."), { name: "AbortError", code: "E_ABORTED" });
|
|
290
|
+
}
|
|
291
|
+
function W() {
|
|
292
|
+
return typeof performance > "u" ? Date.now() : performance.now();
|
|
293
|
+
}
|
|
294
|
+
export {
|
|
295
|
+
Pe as createVisualSession
|
|
296
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SceneDocument } from '../doc/schema';
|
|
2
|
+
import type { DeliveryProfileV1 } from '../delivery/contracts';
|
|
3
|
+
import type { AssetCatalogV3, DeliveryDiagnosticV1 } from '../project/contracts';
|
|
4
|
+
import type { StudioAssetSourceProvider } from '../ports/asset-source';
|
|
5
|
+
import type { StudioDeliveryProvider } from '../ports/delivery';
|
|
6
|
+
export interface ResolveUsdDeliveryCatalogInput {
|
|
7
|
+
readonly document: SceneDocument;
|
|
8
|
+
readonly catalog: AssetCatalogV3;
|
|
9
|
+
readonly profile: DeliveryProfileV1;
|
|
10
|
+
readonly sourceProvider?: StudioAssetSourceProvider;
|
|
11
|
+
readonly deliveryProvider?: StudioDeliveryProvider;
|
|
12
|
+
readonly signal?: AbortSignal;
|
|
13
|
+
}
|
|
14
|
+
export type StudioDeliveryCatalogResolution = {
|
|
15
|
+
readonly status: 'resolved';
|
|
16
|
+
readonly catalog: AssetCatalogV3;
|
|
17
|
+
readonly diagnostics: readonly [];
|
|
18
|
+
} | {
|
|
19
|
+
readonly status: 'blocked';
|
|
20
|
+
readonly catalog: AssetCatalogV3;
|
|
21
|
+
readonly diagnostics: readonly DeliveryDiagnosticV1[];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Resolves only visual entries referenced by the document. The decision order
|
|
25
|
+
* is intentional and exclusive: exact lock, unique profile artifact, provider,
|
|
26
|
+
* blocked. A lock never falls back to another artifact or the provider.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveUsdDeliveryCatalog(input: ResolveUsdDeliveryCatalogInput): Promise<StudioDeliveryCatalogResolution>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StudioAssetRegistrationInput, StudioAssetSource, StudioAssetSourceProvider, StudioAssetSourceRegisterOptions, StudioAssetSourceRegistration, StudioAssetSourceResolveOptions, StudioResolvableRevision } from '../ports/asset-source';
|
|
2
|
+
import type { StudioSourceBundle } from '../util/studio-source';
|
|
3
|
+
/** Ephemeral browser composition provider used by reference and test hosts. */
|
|
4
|
+
export declare class InMemoryStudioAssetSourceProvider implements StudioAssetSourceProvider {
|
|
5
|
+
private readonly sources;
|
|
6
|
+
private readonly fingerprints;
|
|
7
|
+
private readonly registrationTails;
|
|
8
|
+
resolve(revision: StudioResolvableRevision, _options?: StudioAssetSourceResolveOptions): StudioAssetSource | null;
|
|
9
|
+
register(input: StudioAssetRegistrationInput, options?: StudioAssetSourceRegisterOptions): Promise<StudioAssetSourceRegistration>;
|
|
10
|
+
materialize(revision: StudioResolvableRevision, source: StudioAssetSource, options?: StudioAssetSourceResolveOptions): StudioSourceBundle | null;
|
|
11
|
+
release(revisionId: string): void;
|
|
12
|
+
dispose(): void;
|
|
13
|
+
snapshot(): readonly StudioAssetSource[];
|
|
14
|
+
private enqueueRegistration;
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { StudioHost, StudioTransactionError } from '../core/host';
|
|
2
|
+
export type { StudioEffectiveNodeState, StudioNodeCapabilities, StudioSceneTreeNode, StudioSceneTreeSnapshot, } from '../core/scene-tree';
|
|
3
|
+
export { StudioPersistenceController } from '../core/persistence-controller';
|
|
4
|
+
export type { StudioPersistenceCapture, StudioPersistenceControllerOptions, StudioPersistenceSaveResult, } from '../core/persistence-controller';
|
|
5
|
+
export type { LoadedStudioAsset, StudioAssetLoadResult, StudioBoundingBoxDimensions, StudioBoundingBoxInput, StudioActionRunOptions, StudioCommandResult, StudioHostEvent, StudioHostOptions, StudioHostSnapshot, StudioOpenResult, StudioReadOnlyHost, StudioStateSnapshot, StudioSelection, StudioReplaceModelExpected, StudioReplaceModelInput, StudioReplaceModelReplacement, StudioTransactionKind, StudioTransactionPreview, StudioTransactionRequest, StudioTransactionTargetPolicy, StudioWriteDecision, StudioWritePolicy, StudioWriteRequest, } from '../core/host';
|
|
6
|
+
export type { StudioAssetCommitOptions, StudioAssetCommitReceipt, StudioAssetCommitResult, StudioAssetCommitScope, StudioAssetPlacementIntent, StudioAssetPrepareOptions, StudioAssetTaskSnapshot, StudioAssetTaskStatus, StudioPreparedAssetBatch, StudioPreparedAssetItem, StudioPreparedAssetStatus, } from '../core/asset-task';
|
|
7
|
+
export { createStudioContext } from '../core/context';
|
|
8
|
+
export type { StudioContext, StudioContextCapabilities, } from '../core/context';
|
|
9
|
+
export { IndexedDbStudioPersistence } from './indexeddb-persistence';
|
|
10
|
+
export { IndexedDbStudioAssetSourceProvider } from './indexeddb-asset-source';
|
|
11
|
+
export { InMemoryStudioAssetSourceProvider } from './in-memory-asset-source';
|
|
12
|
+
export { resolveUsdDeliveryCatalog, } from './delivery-catalog';
|
|
13
|
+
export type { ResolveUsdDeliveryCatalogInput, StudioDeliveryCatalogResolution, } from './delivery-catalog';
|
|
14
|
+
export { exportUsd, UsdExportError } from './usd-export-client';
|
|
15
|
+
export type { UsdExportClientOptions } from './usd-export-client';
|
|
16
|
+
export { normalizeStudioSourceBundleForExport } from './source-package';
|
|
17
|
+
export type { UsdExporterBeginOptions, UsdExporterBeginResult, UsdExporterOutputInfo, UsdExporterRuntimeOptions, UsdExporterSerializedError, UsdExporterValidationResult, UsdExporterWorkerRequest, UsdExporterWorkerResponse, } from './usd-export-protocol';
|
|
18
|
+
export { WebAssetIngestor, studioAssetFileFromWebFile } from './web-asset-ingestor';
|
|
19
|
+
export { StudioRemoteAssetImporter } from './remote-asset-importer';
|
|
20
|
+
export type { PrepareRemoteAssetInput, RemoteUsdProbeRequest, RemoteUsdProbeResult, RemoteUsdVariantSet, StudioRemoteAssetImporterOptions, } from './remote-asset-importer';
|
|
21
|
+
export { createWebStudioHost } from './web-host';
|
|
22
|
+
export type { WebStudioHostOptions } from './web-host';
|
|
23
|
+
export { createContentAddressedResources, sourceBundlesFromContentStore, verifyContentAddressedResources, } from '../persist/content-addressed';
|
|
24
|
+
export type { ContentAddressedResource } from '../persist/content-addressed';
|
|
25
|
+
export { IndexedDbStudioStore } from '../persist/indexeddb-store';
|
|
26
|
+
export type { IndexedDbStudioStoreOptions, } from '../persist/indexeddb-store';
|
|
27
|
+
export { STUDIO_PLUGIN_API_VERSION, StudioPluginHost } from '../core/plugins';
|
|
28
|
+
export type { StudioActivationEvent, StudioActionContribution, StudioActionContext, StudioActionHost, StudioCheckerContribution, StudioContributionContext, StudioDisposer, StudioExporterContribution, StudioInspectorContribution, StudioInspectorInvocationContext, StudioPlugin, StudioPluginContributions, StudioPluginContext, StudioPluginDependency, StudioPluginManifest, } from '../core/plugins';
|
|
29
|
+
export { isPluginApiVersionCompatible, satisfiesVersion } from '../core/versions';
|
|
30
|
+
export { evaluateWhen } from '../core/when';
|
|
31
|
+
export type { StudioContextFacts, StudioWhen } from '../core/when';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { StudioAssetRegistrationInput, StudioAssetRequest, StudioAssetSource, StudioAssetSourceProvider, StudioAssetSourceRegistration, StudioAssetSourceResolveOptions, StudioResolvableRevision } from '../ports/asset-source';
|
|
2
|
+
import { IndexedDbStudioStore } from '../persist/indexeddb-store';
|
|
3
|
+
import type { StudioSourceBundle } from '../util/studio-source';
|
|
4
|
+
export interface IndexedDbStudioAssetSourceProviderOptions {
|
|
5
|
+
readonly store?: IndexedDbStudioStore;
|
|
6
|
+
/** Reattached after page reload; request functions are never persisted. */
|
|
7
|
+
readonly request?: StudioAssetRequest;
|
|
8
|
+
readonly materializeRemote?: (revision: StudioResolvableRevision, source: StudioAssetSource, options: StudioAssetSourceResolveOptions) => Promise<StudioSourceBundle | null>;
|
|
9
|
+
}
|
|
10
|
+
/** Browser-local implementation of the Studio asset source boundary. */
|
|
11
|
+
export declare class IndexedDbStudioAssetSourceProvider implements StudioAssetSourceProvider {
|
|
12
|
+
private readonly options;
|
|
13
|
+
private readonly store;
|
|
14
|
+
private readonly sources;
|
|
15
|
+
private readonly fingerprints;
|
|
16
|
+
private readonly registrationTails;
|
|
17
|
+
private readonly pending;
|
|
18
|
+
private readonly failures;
|
|
19
|
+
constructor(options?: IndexedDbStudioAssetSourceProviderOptions);
|
|
20
|
+
resolve(revision: StudioResolvableRevision, _options?: StudioAssetSourceResolveOptions): StudioAssetSource | null | Promise<StudioAssetSource | null>;
|
|
21
|
+
register(input: StudioAssetRegistrationInput, options?: {
|
|
22
|
+
readonly signal?: AbortSignal;
|
|
23
|
+
readonly operationId?: string;
|
|
24
|
+
}): Promise<StudioAssetSourceRegistration>;
|
|
25
|
+
materialize(revision: StudioResolvableRevision, source: StudioAssetSource, options?: StudioAssetSourceResolveOptions): Promise<StudioSourceBundle | null>;
|
|
26
|
+
flush(): Promise<void>;
|
|
27
|
+
acknowledge(revisionId: string, operationId?: string): void;
|
|
28
|
+
release(revisionId: string): Promise<void>;
|
|
29
|
+
clearErrors(): void;
|
|
30
|
+
private loadSource;
|
|
31
|
+
private enqueueRegistration;
|
|
32
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IndexedDbStudioStore } from '../persist/indexeddb-store';
|
|
2
|
+
import type { StudioPersistenceAdapter } from '../ports/persistence';
|
|
3
|
+
import type { StudioStateSnapshot } from '../persist/snapshot';
|
|
4
|
+
import { IndexedDbStudioAssetSourceProvider } from './indexeddb-asset-source';
|
|
5
|
+
/** Browser-local state adapter paired with a browser-local source provider. */
|
|
6
|
+
export declare class IndexedDbStudioPersistence implements StudioPersistenceAdapter {
|
|
7
|
+
private readonly store;
|
|
8
|
+
readonly assetSourceProvider: IndexedDbStudioAssetSourceProvider;
|
|
9
|
+
constructor(store?: IndexedDbStudioStore);
|
|
10
|
+
load(): Promise<StudioStateSnapshot | null>;
|
|
11
|
+
save(snapshot: StudioStateSnapshot): Promise<void>;
|
|
12
|
+
close(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { StudioExternalAssetRef } from '../doc/schema';
|
|
2
|
+
import type { AssetAnnotations } from '../asset/intake';
|
|
3
|
+
import type { StudioPreparedAsset, StudioRemoteAssetSourceInput } from '../ports/asset-source';
|
|
4
|
+
export interface RemoteUsdVariantSet {
|
|
5
|
+
readonly primPath: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly options: readonly string[];
|
|
8
|
+
}
|
|
9
|
+
export interface RemoteUsdProbeRequest {
|
|
10
|
+
readonly entry: Blob;
|
|
11
|
+
readonly entryPath: string;
|
|
12
|
+
readonly entryUrl: string;
|
|
13
|
+
readonly signal?: AbortSignal;
|
|
14
|
+
readonly variantSelections?: readonly {
|
|
15
|
+
readonly primPath: string;
|
|
16
|
+
readonly setName: string;
|
|
17
|
+
readonly selection: string;
|
|
18
|
+
}[];
|
|
19
|
+
readonly resolveResource: (identifier: string, url: string) => Promise<Blob>;
|
|
20
|
+
readonly onProgress?: (completed: number, identifier: string) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface RemoteUsdProbeResult {
|
|
23
|
+
readonly variantSets: readonly RemoteUsdVariantSet[];
|
|
24
|
+
readonly capability: {
|
|
25
|
+
readonly hasPhysics: boolean;
|
|
26
|
+
readonly hasArticulation: boolean;
|
|
27
|
+
readonly hasColliderGeometry: boolean;
|
|
28
|
+
readonly hasRigidBody: boolean;
|
|
29
|
+
readonly source: 'usd-authored' | 'none' | 'unknown';
|
|
30
|
+
};
|
|
31
|
+
readonly measured: {
|
|
32
|
+
readonly bounds?: {
|
|
33
|
+
readonly min: readonly [number, number, number];
|
|
34
|
+
readonly max: readonly [number, number, number];
|
|
35
|
+
};
|
|
36
|
+
readonly jointCount?: number;
|
|
37
|
+
readonly meshCount?: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface StudioRemoteAssetImporterOptions {
|
|
41
|
+
readonly probe: (request: RemoteUsdProbeRequest) => Promise<RemoteUsdProbeResult>;
|
|
42
|
+
readonly now?: () => string;
|
|
43
|
+
}
|
|
44
|
+
export interface PrepareRemoteAssetInput {
|
|
45
|
+
readonly source: StudioRemoteAssetSourceInput;
|
|
46
|
+
readonly assetId: string;
|
|
47
|
+
readonly externalRef?: StudioExternalAssetRef;
|
|
48
|
+
readonly annotations?: Omit<AssetAnnotations, 'externalRef' | 'slug'>;
|
|
49
|
+
readonly signal?: AbortSignal;
|
|
50
|
+
readonly onProgress?: (completed: number, identifier: string) => void;
|
|
51
|
+
}
|
|
52
|
+
export declare class StudioRemoteAssetImporter {
|
|
53
|
+
private readonly options;
|
|
54
|
+
constructor(options: StudioRemoteAssetImporterOptions);
|
|
55
|
+
prepareRemoteAsset(input: PrepareRemoteAssetInput): Promise<StudioPreparedAsset>;
|
|
56
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StudioSourceBundle } from '../util/studio-source';
|
|
2
|
+
/**
|
|
3
|
+
* Delivery plans reference their source entry directly. Expand an entry USDZ
|
|
4
|
+
* into the package-relative layer and texture set so relative shader assets
|
|
5
|
+
* remain resolvable after the delivery is packed into another USDZ.
|
|
6
|
+
*/
|
|
7
|
+
export declare function normalizeStudioSourceBundleForExport(bundle: StudioSourceBundle, options?: {
|
|
8
|
+
readonly signal?: AbortSignal;
|
|
9
|
+
}): Promise<StudioSourceBundle>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { UsdExportRequest, UsdExportResult } from '../delivery/contracts';
|
|
2
|
+
import { type UsdExporterRuntimeOptions } from './usd-export-protocol';
|
|
3
|
+
export interface UsdExportClientOptions {
|
|
4
|
+
readonly runtime: UsdExporterRuntimeOptions;
|
|
5
|
+
readonly createWorker?: () => Worker;
|
|
6
|
+
}
|
|
7
|
+
export declare class UsdExportError extends Error {
|
|
8
|
+
readonly code: string;
|
|
9
|
+
readonly stage: string;
|
|
10
|
+
readonly detail?: Readonly<Record<string, unknown>> | undefined;
|
|
11
|
+
constructor(message: string, code: string, stage: string, detail?: Readonly<Record<string, unknown>> | undefined);
|
|
12
|
+
}
|
|
13
|
+
export declare function exportUsd(request: UsdExportRequest, clientOptions: UsdExportClientOptions): Promise<UsdExportResult>;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { UsdDeliveryPlanV4, UsdExportEvidenceV3, UsdExportLimits, UsdExportResourceFactV1, UsdLayerEncoding } from '../delivery/contracts';
|
|
2
|
+
export interface UsdExporterRuntimeOptions {
|
|
3
|
+
readonly moduleUrl: string;
|
|
4
|
+
readonly wasmUrl: string;
|
|
5
|
+
readonly runtimeId: string;
|
|
6
|
+
readonly apiVersion: number;
|
|
7
|
+
}
|
|
8
|
+
export interface UsdExporterBeginOptions {
|
|
9
|
+
readonly layerEncoding: UsdLayerEncoding;
|
|
10
|
+
readonly packageKind: 'layer-bundle' | 'usdz';
|
|
11
|
+
readonly rootLayerPath: string;
|
|
12
|
+
readonly packageOutputPath: string;
|
|
13
|
+
readonly limits?: UsdExportLimits;
|
|
14
|
+
}
|
|
15
|
+
export type UsdExporterWorkerRequest = {
|
|
16
|
+
readonly type: 'init';
|
|
17
|
+
readonly runtime: UsdExporterRuntimeOptions;
|
|
18
|
+
} | {
|
|
19
|
+
readonly type: 'begin';
|
|
20
|
+
readonly id: number;
|
|
21
|
+
readonly plan: UsdDeliveryPlanV4;
|
|
22
|
+
readonly options: UsdExporterBeginOptions;
|
|
23
|
+
} | {
|
|
24
|
+
readonly type: 'write-resource';
|
|
25
|
+
readonly id: number;
|
|
26
|
+
readonly path: string;
|
|
27
|
+
readonly bytes: ArrayBuffer;
|
|
28
|
+
} | {
|
|
29
|
+
readonly type: 'build-stage';
|
|
30
|
+
readonly id: number;
|
|
31
|
+
} | {
|
|
32
|
+
readonly type: 'write-output';
|
|
33
|
+
readonly id: number;
|
|
34
|
+
readonly encoding: UsdLayerEncoding;
|
|
35
|
+
readonly path: string;
|
|
36
|
+
} | {
|
|
37
|
+
readonly type: 'package-usdz';
|
|
38
|
+
readonly id: number;
|
|
39
|
+
readonly entryPath: string;
|
|
40
|
+
readonly outputPath: string;
|
|
41
|
+
} | {
|
|
42
|
+
readonly type: 'validate';
|
|
43
|
+
readonly id: number;
|
|
44
|
+
readonly expectation: Readonly<Record<string, unknown>>;
|
|
45
|
+
} | {
|
|
46
|
+
readonly type: 'read-output';
|
|
47
|
+
readonly id: number;
|
|
48
|
+
readonly path: string;
|
|
49
|
+
} | {
|
|
50
|
+
readonly type: 'release';
|
|
51
|
+
readonly id: number;
|
|
52
|
+
};
|
|
53
|
+
export interface UsdExporterSerializedError {
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly message: string;
|
|
56
|
+
readonly code?: string;
|
|
57
|
+
readonly stage?: string;
|
|
58
|
+
readonly detail?: Readonly<Record<string, unknown>>;
|
|
59
|
+
}
|
|
60
|
+
export type UsdExporterWorkerResponse = {
|
|
61
|
+
readonly type: 'ready';
|
|
62
|
+
readonly apiVersion: number;
|
|
63
|
+
readonly runtimeId: string;
|
|
64
|
+
} | {
|
|
65
|
+
readonly type: 'result';
|
|
66
|
+
readonly id: number;
|
|
67
|
+
readonly value: unknown;
|
|
68
|
+
} | {
|
|
69
|
+
readonly type: 'output';
|
|
70
|
+
readonly id: number;
|
|
71
|
+
readonly path: string;
|
|
72
|
+
readonly bytes: ArrayBuffer;
|
|
73
|
+
} | {
|
|
74
|
+
readonly type: 'error';
|
|
75
|
+
readonly id?: number;
|
|
76
|
+
readonly error: UsdExporterSerializedError;
|
|
77
|
+
};
|
|
78
|
+
export interface UsdExporterBeginResult {
|
|
79
|
+
readonly handle: number;
|
|
80
|
+
readonly planDigest: string;
|
|
81
|
+
}
|
|
82
|
+
export interface UsdExporterOutputInfo {
|
|
83
|
+
readonly path: string;
|
|
84
|
+
readonly byteSize: number;
|
|
85
|
+
}
|
|
86
|
+
export interface UsdExporterResourceFactV1 extends Omit<UsdExportResourceFactV1, 'outputSha256'> {
|
|
87
|
+
}
|
|
88
|
+
type UsdExporterEvidenceV3 = Omit<UsdExportEvidenceV3, 'format' | 'schemaVersion' | 'packageDigest' | 'evidenceDigest' | 'resourceClosure'> & {
|
|
89
|
+
readonly resourceClosure: Omit<UsdExportEvidenceV3['resourceClosure'], 'resourceManifest'> & {
|
|
90
|
+
readonly resourceManifest: readonly UsdExporterResourceFactV1[];
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export interface UsdExporterValidationResult {
|
|
94
|
+
readonly evidence: UsdExporterEvidenceV3;
|
|
95
|
+
}
|
|
96
|
+
export declare function serializeUsdExportError(error: unknown): UsdExporterSerializedError;
|
|
97
|
+
export declare function deserializeUsdExportError(error: UsdExporterSerializedError): Error;
|
|
98
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ParsedStoredZipEntry {
|
|
2
|
+
readonly path: string;
|
|
3
|
+
readonly byteSize: number;
|
|
4
|
+
readonly dataOffset: number;
|
|
5
|
+
readonly localHeaderOffset: number;
|
|
6
|
+
readonly flags: number;
|
|
7
|
+
readonly utf8Flag: boolean;
|
|
8
|
+
readonly crc32: number;
|
|
9
|
+
readonly data: Uint8Array;
|
|
10
|
+
}
|
|
11
|
+
export interface ParsedStoredZip {
|
|
12
|
+
readonly entries: readonly ParsedStoredZipEntry[];
|
|
13
|
+
}
|
|
14
|
+
export declare function parseStoredZip(input: ArrayBuffer | Uint8Array): ParsedStoredZip;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StudioAssetFile, StudioAssetIngestor, StudioAssetInput, StudioAssetIntakeResult, StudioAssetIngestOptions } from '../ports/asset-ingestor';
|
|
2
|
+
/** Web adapter for package and file intake. */
|
|
3
|
+
export declare class WebAssetIngestor implements StudioAssetIngestor {
|
|
4
|
+
private readonly options;
|
|
5
|
+
constructor(options?: {
|
|
6
|
+
readonly now?: () => string;
|
|
7
|
+
});
|
|
8
|
+
ingest(input: StudioAssetInput, options?: StudioAssetIngestOptions): Promise<StudioAssetIntakeResult>;
|
|
9
|
+
}
|
|
10
|
+
export declare function studioAssetFileFromWebFile(file: File): StudioAssetFile;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StudioHostOptions } from '../core/host';
|
|
2
|
+
import { StudioHost } from '../core/host';
|
|
3
|
+
import type { StudioAssetIngestor } from '../ports/asset-ingestor';
|
|
4
|
+
export interface WebStudioHostOptions extends Omit<StudioHostOptions, 'assetIngestor'> {
|
|
5
|
+
readonly assetIngestor?: StudioAssetIngestor;
|
|
6
|
+
}
|
|
7
|
+
/** Default web composition for the runtime-independent StudioHost. */
|
|
8
|
+
export declare function createWebStudioHost(options?: WebStudioHostOptions): StudioHost;
|