@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.
- 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/usd-export-worker-BsGubtAE.js +1 -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-B_0zRmb8.js +5027 -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 +2839 -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-BV1HnxNh.js +3506 -0
- package/dist/scene.js +244 -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 +5544 -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/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,405 @@
|
|
|
1
|
+
import { a as X, d as R, a4 as T, _ as w, a5 as v, a6 as q, w as H, W as Z, Z as y, z as S, s as E, M as j, u as W } from "./scene-graph-DBLKAhxa.js";
|
|
2
|
+
import { t as g, f as K, h as b, e as x } from "./physics-facts-tfQYyNTD.js";
|
|
3
|
+
const h = {
|
|
4
|
+
translate: 0.05,
|
|
5
|
+
// 15 degrees.
|
|
6
|
+
rotate: Math.PI / 12,
|
|
7
|
+
scale: 0.05
|
|
8
|
+
};
|
|
9
|
+
function I(n, t) {
|
|
10
|
+
if (!Number.isFinite(t) || t <= 0) return n;
|
|
11
|
+
const e = Math.round(n / t) * t;
|
|
12
|
+
return Object.is(e, -0) ? 0 : Number(e.toFixed(9));
|
|
13
|
+
}
|
|
14
|
+
function _(n) {
|
|
15
|
+
return n === "x" ? 0 : n === "y" ? 1 : 2;
|
|
16
|
+
}
|
|
17
|
+
function J(n, t, e = h) {
|
|
18
|
+
const o = [...n.position], s = _(t.axis);
|
|
19
|
+
return o[s] = I(o[s] + t.amount, e.translate ?? h.translate), { ...n, position: o };
|
|
20
|
+
}
|
|
21
|
+
function nn(n, t, e = h) {
|
|
22
|
+
const o = I(t.amount, e.rotate ?? h.rotate);
|
|
23
|
+
if (o === 0) return n;
|
|
24
|
+
const s = o / 2, r = [0, 0, 0];
|
|
25
|
+
r[_(t.axis)] = 1;
|
|
26
|
+
const a = [
|
|
27
|
+
r[0] * Math.sin(s),
|
|
28
|
+
r[1] * Math.sin(s),
|
|
29
|
+
r[2] * Math.sin(s),
|
|
30
|
+
Math.cos(s)
|
|
31
|
+
];
|
|
32
|
+
return { ...n, rotation: $(en(a, n.rotation)) };
|
|
33
|
+
}
|
|
34
|
+
function tn(n, t, e = h) {
|
|
35
|
+
const o = _(t.axis), s = n.scale[o], r = I(s + t.amount, e.scale ?? h.scale), a = r <= 0 ? 1e-4 : r, d = [...n.scale];
|
|
36
|
+
return d[o] = a, { ...n, scale: d };
|
|
37
|
+
}
|
|
38
|
+
function Mn(n, t, e) {
|
|
39
|
+
const o = [(n.min[0] + n.max[0]) / 2, (n.min[1] + n.max[1]) / 2], s = [(n.max[0] - n.min[0]) / 2, (n.max[1] - n.min[1]) / 2];
|
|
40
|
+
let r = null;
|
|
41
|
+
for (const a of t) {
|
|
42
|
+
const d = [(a.min[0] + a.max[0]) / 2, (a.min[1] + a.max[1]) / 2], l = Math.min(n.max[1], a.max[1]) - Math.max(n.min[1], a.min[1]), p = Math.min(n.max[0], a.max[0]) - Math.max(n.min[0], a.min[0]), f = l > 0 ? o[1] : d[1], i = p > 0 ? o[0] : d[0], m = [];
|
|
43
|
+
if (l > 0 || Math.abs(o[1] - d[1]) <= e) {
|
|
44
|
+
const c = a.min[0] - s[0], u = a.max[0] + s[0];
|
|
45
|
+
m.push({ position: [c, f], dx: c - o[0], dy: f - o[1] }), m.push({ position: [u, f], dx: u - o[0], dy: f - o[1] });
|
|
46
|
+
}
|
|
47
|
+
if (p > 0 || Math.abs(o[0] - d[0]) <= e) {
|
|
48
|
+
const c = a.min[1] - s[1], u = a.max[1] + s[1];
|
|
49
|
+
m.push({ position: [i, c], dx: i - o[0], dy: c - o[1] }), m.push({ position: [i, u], dx: i - o[0], dy: u - o[1] });
|
|
50
|
+
}
|
|
51
|
+
for (const c of m) {
|
|
52
|
+
const u = Math.hypot(c.dx, c.dy);
|
|
53
|
+
u > e || (!r || u < r.distance) && (r = { targetId: a.id, position: c.position, distance: u });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return r;
|
|
57
|
+
}
|
|
58
|
+
function In(n, t = h) {
|
|
59
|
+
const e = t.translate ?? 0, o = t.rotate ?? 0, s = t.scale ?? 0, r = e > 0 ? n.position.map((l) => I(l, e)) : [...n.position], a = s > 0 ? n.scale.map((l) => Math.max(1e-4, I(l, s))) : [...n.scale], d = o > 0 ? on(n.rotation, o) : n.rotation;
|
|
60
|
+
return { position: r, rotation: d, scale: a };
|
|
61
|
+
}
|
|
62
|
+
function on(n, t) {
|
|
63
|
+
const e = Math.min(1, Math.max(-1, n[3])), o = 2 * Math.acos(e);
|
|
64
|
+
if (!Number.isFinite(o) || o < 1e-9) return [0, 0, 0, 1];
|
|
65
|
+
const s = Math.sqrt(Math.max(0, 1 - e * e));
|
|
66
|
+
if (s < 1e-9) return n;
|
|
67
|
+
const r = [n[0] / s, n[1] / s, n[2] / s], d = I(o, t) / 2;
|
|
68
|
+
return $([r[0] * Math.sin(d), r[1] * Math.sin(d), r[2] * Math.sin(d), Math.cos(d)]);
|
|
69
|
+
}
|
|
70
|
+
function xn(n, t, e, o = h) {
|
|
71
|
+
switch (n) {
|
|
72
|
+
case "translate":
|
|
73
|
+
return J(t, e, o);
|
|
74
|
+
case "rotate":
|
|
75
|
+
return nn(t, e, o);
|
|
76
|
+
case "scale":
|
|
77
|
+
return tn(t, e, o);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function en(n, t) {
|
|
81
|
+
const [e, o, s, r] = n, [a, d, l, p] = t;
|
|
82
|
+
return [
|
|
83
|
+
r * a + e * p + o * l - s * d,
|
|
84
|
+
r * d - e * l + o * p + s * a,
|
|
85
|
+
r * l + e * d - o * a + s * p,
|
|
86
|
+
r * p - e * a - o * d - s * l
|
|
87
|
+
];
|
|
88
|
+
}
|
|
89
|
+
function $(n) {
|
|
90
|
+
const t = Math.hypot(n[0], n[1], n[2], n[3]);
|
|
91
|
+
return !Number.isFinite(t) || t < 1e-12 ? [0, 0, 0, 1] : [n[0] / t, n[1] / t, n[2] / t, n[3] / t];
|
|
92
|
+
}
|
|
93
|
+
function sn(n, t, e = {}) {
|
|
94
|
+
const o = e.floorZ ?? 0, s = Math.min(t.min[2], t.max[2]);
|
|
95
|
+
if (!Number.isFinite(s)) return n;
|
|
96
|
+
const r = o - s;
|
|
97
|
+
if (Math.abs(r) < 1e-9) return n;
|
|
98
|
+
const a = [...n.position];
|
|
99
|
+
return a[2] = Number((a[2] + r).toFixed(9)), { ...n, position: a };
|
|
100
|
+
}
|
|
101
|
+
function vn(n, t, e = 0) {
|
|
102
|
+
const o = Math.min(t.min[2], t.max[2]);
|
|
103
|
+
if (!Number.isFinite(o) || o >= e - 1e-9) return n;
|
|
104
|
+
const s = [...n.position];
|
|
105
|
+
return s[2] = Number((s[2] + (e - o)).toFixed(9)), { ...n, position: s };
|
|
106
|
+
}
|
|
107
|
+
function Nn(n, t, e, o = {}) {
|
|
108
|
+
const s = o.snap ?? h.translate, r = I(e[0], s), a = I(e[1], s), d = (t.min[0] + t.max[0]) / 2, l = (t.min[1] + t.max[1]) / 2, p = [
|
|
109
|
+
Number((n.position[0] + r - d).toFixed(9)),
|
|
110
|
+
Number((n.position[1] + a - l).toFixed(9)),
|
|
111
|
+
n.position[2]
|
|
112
|
+
], f = { ...n, position: p };
|
|
113
|
+
return o.keepHeight ? f : sn(f, t, o);
|
|
114
|
+
}
|
|
115
|
+
function gn(n, t, e = 1e-6) {
|
|
116
|
+
return n.min[0] < t.max[0] - e && t.min[0] < n.max[0] - e && n.min[1] < t.max[1] - e && t.min[1] < n.max[1] - e;
|
|
117
|
+
}
|
|
118
|
+
function yn(n) {
|
|
119
|
+
if (n.length === 0) return null;
|
|
120
|
+
const t = [1 / 0, 1 / 0, 1 / 0], e = [-1 / 0, -1 / 0, -1 / 0];
|
|
121
|
+
for (const o of n)
|
|
122
|
+
for (let s = 0; s < 3; s += 1)
|
|
123
|
+
t[s] = Math.min(t[s], o.min[s], o.max[s]), e[s] = Math.max(e[s], o.min[s], o.max[s]);
|
|
124
|
+
return { min: t, max: e };
|
|
125
|
+
}
|
|
126
|
+
const D = Object.freeze({
|
|
127
|
+
gridStepM: 0,
|
|
128
|
+
adaptiveGridSnap: !1,
|
|
129
|
+
surfaceSnap: !0,
|
|
130
|
+
alignToSurface: !1,
|
|
131
|
+
preventOverlap: !0,
|
|
132
|
+
clearanceM: 0,
|
|
133
|
+
toleranceM: 1e-6
|
|
134
|
+
}), an = 0.85, rn = 1e-3;
|
|
135
|
+
function cn(n, t = D) {
|
|
136
|
+
const e = { ...t, ...n };
|
|
137
|
+
if (Object.keys(n).some((o) => !(o in D)) || ["gridStepM", "clearanceM", "toleranceM"].some(
|
|
138
|
+
(o) => !Number.isFinite(e[o]) || e[o] < 0
|
|
139
|
+
) || ["adaptiveGridSnap", "surfaceSnap", "alignToSurface", "preventOverlap"].some(
|
|
140
|
+
(o) => typeof e[o] != "boolean"
|
|
141
|
+
))
|
|
142
|
+
throw Object.assign(new Error("Invalid placement policy."), {
|
|
143
|
+
code: "PLACEMENT_POLICY_INVALID"
|
|
144
|
+
});
|
|
145
|
+
return Object.freeze(e);
|
|
146
|
+
}
|
|
147
|
+
function dn(n) {
|
|
148
|
+
const t = [
|
|
149
|
+
n.max[0] - n.min[0],
|
|
150
|
+
n.max[1] - n.min[1],
|
|
151
|
+
n.max[2] - n.min[2]
|
|
152
|
+
], e = Math.max(...t.map((l) => Math.abs(l))), o = Math.max(0.01, e / 20), r = 10 ** Math.floor(Math.log10(o)), a = o / r, d = a <= 1 ? 1 : a <= 2 ? 2 : a <= 5 ? 5 : 10;
|
|
153
|
+
return Math.max(0.01, Math.min(2, d * r));
|
|
154
|
+
}
|
|
155
|
+
function B(n, t) {
|
|
156
|
+
return t.gridStepM > 0 ? t.gridStepM : t.adaptiveGridSnap ? dn(n) : 0;
|
|
157
|
+
}
|
|
158
|
+
function ln(n) {
|
|
159
|
+
const t = Math.hypot(...n);
|
|
160
|
+
return Number.isFinite(t) && t > 1e-12 && n[2] / t >= an;
|
|
161
|
+
}
|
|
162
|
+
const A = (n, t) => [
|
|
163
|
+
n[1] * t[2] - n[2] * t[1],
|
|
164
|
+
n[2] * t[0] - n[0] * t[2],
|
|
165
|
+
n[0] * t[1] - n[1] * t[0]
|
|
166
|
+
], G = (n) => [
|
|
167
|
+
[1, 0, 0],
|
|
168
|
+
[0, 1, 0],
|
|
169
|
+
[0, 0, 1]
|
|
170
|
+
].map((t) => w(n.rotation, t));
|
|
171
|
+
function k(n, t, e = 1e-6) {
|
|
172
|
+
if (n.container && Y(n, t, e) || t.container && Y(t, n, e)) return !1;
|
|
173
|
+
const o = G(n.transform), s = G(t.transform), r = [...o, ...s, ...o.flatMap((l) => s.map((p) => A(l, p)))], a = b(n.bounds).map((l) => g(l, n.transform)), d = b(t.bounds).map((l) => g(l, t.transform));
|
|
174
|
+
for (const l of r) {
|
|
175
|
+
if (Math.hypot(...l) < 1e-10) continue;
|
|
176
|
+
const p = T(l), f = a.map((m) => v(m, p)), i = d.map((m) => v(m, p));
|
|
177
|
+
if (Math.min(Math.max(...f), Math.max(...i)) - Math.max(Math.min(...f), Math.min(...i)) <= e)
|
|
178
|
+
return !1;
|
|
179
|
+
}
|
|
180
|
+
return !0;
|
|
181
|
+
}
|
|
182
|
+
function Y(n, t, e) {
|
|
183
|
+
const [o, s, r, a] = n.transform.rotation, d = [-o, -s, -r, a], l = n.transform.scale.map((p) => Math.abs(p) > 1e-12 ? 1 / p : 0);
|
|
184
|
+
return b(t.bounds).every((p) => {
|
|
185
|
+
const i = g(p, t.transform).map(
|
|
186
|
+
(c, u) => c - n.transform.position[u]
|
|
187
|
+
);
|
|
188
|
+
return w(d, i).map(
|
|
189
|
+
(c, u) => c * l[u]
|
|
190
|
+
).every((c, u) => c >= n.bounds.min[u] - e && c <= n.bounds.max[u] + e);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
function Sn(n) {
|
|
194
|
+
const t = cn(n.policy ?? {});
|
|
195
|
+
let e = X(n.transform);
|
|
196
|
+
const o = n.surface;
|
|
197
|
+
if (t.surfaceSnap && !o)
|
|
198
|
+
return R({
|
|
199
|
+
valid: !1,
|
|
200
|
+
transform: e,
|
|
201
|
+
precision: "oriented-bounds",
|
|
202
|
+
conflicts: [],
|
|
203
|
+
supportNodeId: null,
|
|
204
|
+
supportSurfaceZ: null,
|
|
205
|
+
reason: "PLACEMENT_SURFACE_REQUIRED"
|
|
206
|
+
});
|
|
207
|
+
if (t.surfaceSnap && o) {
|
|
208
|
+
if (o.point.length !== 3 || o.normal.length !== 3 || ![...o.point, ...o.normal].every(Number.isFinite) || Math.hypot(...o.normal) < 1e-12)
|
|
209
|
+
throw Object.assign(
|
|
210
|
+
new Error("A placement surface requires a finite point and nonzero normal."),
|
|
211
|
+
{ code: "PLACEMENT_SURFACE_INVALID" }
|
|
212
|
+
);
|
|
213
|
+
const a = T(o.normal);
|
|
214
|
+
if (!ln(a))
|
|
215
|
+
return R({
|
|
216
|
+
valid: !1,
|
|
217
|
+
transform: e,
|
|
218
|
+
precision: "oriented-bounds",
|
|
219
|
+
conflicts: [],
|
|
220
|
+
supportNodeId: null,
|
|
221
|
+
supportSurfaceZ: null,
|
|
222
|
+
reason: "PLACEMENT_SURFACE_NOT_SUPPORTING"
|
|
223
|
+
});
|
|
224
|
+
if (t.alignToSurface) {
|
|
225
|
+
const i = w(e.rotation, [0, 0, 1]), m = Math.max(-1, Math.min(1, v(i, a))), c = m < -1 + 1e-10 ? [...w(e.rotation, [1, 0, 0]), 0] : [...A(i, a), 1 + m], u = Math.hypot(...c);
|
|
226
|
+
e = {
|
|
227
|
+
...e,
|
|
228
|
+
rotation: q(
|
|
229
|
+
c.map((M) => M / u),
|
|
230
|
+
e.rotation
|
|
231
|
+
)
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
let d = o.point;
|
|
235
|
+
const l = B(n.bounds, t);
|
|
236
|
+
if (l > 0) {
|
|
237
|
+
const i = Math.abs(a[2]) > 0.99 ? T(A([0, 1, 0], a)) : T(A([0, 0, 1], a)), m = A(a, i), c = l, u = Math.round(v(d, i) / c) * c, M = Math.round(v(d, m) / c) * c, L = v(d, a);
|
|
238
|
+
d = [0, 1, 2].map((N) => i[N] * u + m[N] * M + a[N] * L);
|
|
239
|
+
}
|
|
240
|
+
const p = g(K(n.bounds), e), f = Math.min(
|
|
241
|
+
...b(n.bounds).map(
|
|
242
|
+
(i) => v(
|
|
243
|
+
g(i, e).map((m, c) => m - p[c]),
|
|
244
|
+
a
|
|
245
|
+
)
|
|
246
|
+
)
|
|
247
|
+
);
|
|
248
|
+
e = {
|
|
249
|
+
...e,
|
|
250
|
+
position: e.position.map(
|
|
251
|
+
(i, m) => i + d[m] - p[m] + a[m] * (t.clearanceM - f)
|
|
252
|
+
)
|
|
253
|
+
};
|
|
254
|
+
} else {
|
|
255
|
+
const a = B(n.bounds, t);
|
|
256
|
+
a > 0 && (e = {
|
|
257
|
+
...e,
|
|
258
|
+
position: e.position.map(
|
|
259
|
+
(d) => Math.round(d / a) * a
|
|
260
|
+
)
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
const s = { nodeId: "", bounds: n.bounds, transform: e }, r = t.preventOverlap ? (n.obstacles ?? []).filter((a) => !(o != null && o.nodeId && a.nodeId === o.nodeId && C(
|
|
264
|
+
s,
|
|
265
|
+
a,
|
|
266
|
+
{
|
|
267
|
+
movedNodeId: s.nodeId,
|
|
268
|
+
supportNodeId: o.nodeId,
|
|
269
|
+
surfaceZ: o.point[2]
|
|
270
|
+
},
|
|
271
|
+
t
|
|
272
|
+
)) && k(s, a, t.toleranceM)).map((a) => a.nodeId) : [];
|
|
273
|
+
return R({
|
|
274
|
+
valid: r.length === 0,
|
|
275
|
+
transform: e,
|
|
276
|
+
precision: "oriented-bounds",
|
|
277
|
+
conflicts: r,
|
|
278
|
+
supportNodeId: (o == null ? void 0 : o.nodeId) ?? null,
|
|
279
|
+
supportSurfaceZ: (o == null ? void 0 : o.point[2]) ?? null,
|
|
280
|
+
reason: r.length ? "PLACEMENT_OVERLAP" : null
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
function C(n, t, e, o) {
|
|
284
|
+
if (n.nodeId !== e.movedNodeId || t.nodeId !== e.supportNodeId || !Number.isFinite(e.surfaceZ))
|
|
285
|
+
return !1;
|
|
286
|
+
const s = b(n.bounds).reduce(
|
|
287
|
+
(d, l) => Math.min(d, g(l, n.transform)[2]),
|
|
288
|
+
1 / 0
|
|
289
|
+
);
|
|
290
|
+
if (!Number.isFinite(s)) return !1;
|
|
291
|
+
const r = e.surfaceZ + Math.max(0, o.clearanceM), a = Math.max(o.toleranceM, rn);
|
|
292
|
+
return Math.abs(s - r) <= a;
|
|
293
|
+
}
|
|
294
|
+
function An(n, t, e, o, s = /* @__PURE__ */ new Set(), r = []) {
|
|
295
|
+
if (!e.preventOverlap) return [];
|
|
296
|
+
const a = new Map(
|
|
297
|
+
r.map((i) => [
|
|
298
|
+
Q(i.movedNodeId, i.supportNodeId),
|
|
299
|
+
i
|
|
300
|
+
])
|
|
301
|
+
), d = H(t.root).filter(
|
|
302
|
+
(i) => i.nodeType !== "group" && Z(t.root, i.nodeId, {})
|
|
303
|
+
), l = d.map((i) => ({
|
|
304
|
+
nodeId: i.nodeId,
|
|
305
|
+
bounds: (o == null ? void 0 : o(i)) ?? x(t, i),
|
|
306
|
+
transform: y(t.root, i.nodeId),
|
|
307
|
+
container: mn(t, i)
|
|
308
|
+
})), p = new Set(
|
|
309
|
+
d.filter((i) => {
|
|
310
|
+
const m = S(n.root, i.nodeId);
|
|
311
|
+
return !m || !Z(n.root, i.nodeId, {}) || !E(
|
|
312
|
+
y(n.root, i.nodeId),
|
|
313
|
+
y(t.root, i.nodeId)
|
|
314
|
+
) || !E(x(n, m), x(t, i)) || "assetRevisionId" in i && (!("assetRevisionId" in m) || m.assetRevisionId !== i.assetRevisionId) || "visualRevisionId" in i && (!("visualRevisionId" in m) || m.visualRevisionId !== i.visualRevisionId);
|
|
315
|
+
}).map((i) => i.nodeId)
|
|
316
|
+
);
|
|
317
|
+
if (!p.size) return [];
|
|
318
|
+
const f = [];
|
|
319
|
+
for (const i of l)
|
|
320
|
+
i.bounds || f.push({
|
|
321
|
+
code: "PLACEMENT_BOUNDS_UNAVAILABLE",
|
|
322
|
+
level: "error",
|
|
323
|
+
instanceId: i.nodeId,
|
|
324
|
+
message: "Overlap prevention requires known source bounds: " + i.nodeId
|
|
325
|
+
});
|
|
326
|
+
if (f.length) return f;
|
|
327
|
+
for (let i = 0; i < l.length; i++)
|
|
328
|
+
for (let m = i + 1; m < l.length; m++) {
|
|
329
|
+
const c = l[i], u = l[m];
|
|
330
|
+
if (!p.has(c.nodeId) && !p.has(u.nodeId) || s.has(c.nodeId) || s.has(u.nodeId)) continue;
|
|
331
|
+
const M = a.get(Q(c.nodeId, u.nodeId));
|
|
332
|
+
if (M ? c.nodeId === M.movedNodeId ? C(
|
|
333
|
+
{ ...c, bounds: c.bounds },
|
|
334
|
+
{ ...u, bounds: u.bounds },
|
|
335
|
+
M,
|
|
336
|
+
e
|
|
337
|
+
) : C(
|
|
338
|
+
{ ...u, bounds: u.bounds },
|
|
339
|
+
{ ...c, bounds: c.bounds },
|
|
340
|
+
M,
|
|
341
|
+
e
|
|
342
|
+
) : !1) continue;
|
|
343
|
+
const N = y(n.root, c.nodeId), z = y(n.root, u.nodeId), F = S(n.root, c.nodeId), O = S(n.root, u.nodeId), U = S(t.root, c.nodeId), V = S(t.root, u.nodeId);
|
|
344
|
+
F && O && E(x(n, F), x(t, U)) && E(x(n, O), x(t, V)) && P(F) === P(U) && P(O) === P(V) && N && z && un(
|
|
345
|
+
j(N, z),
|
|
346
|
+
j(c.transform, u.transform)
|
|
347
|
+
) || k(
|
|
348
|
+
{ ...c, bounds: c.bounds },
|
|
349
|
+
{ ...u, bounds: u.bounds },
|
|
350
|
+
e.toleranceM
|
|
351
|
+
) && f.push({
|
|
352
|
+
code: "PLACEMENT_OVERLAP",
|
|
353
|
+
level: "error",
|
|
354
|
+
instanceId: c.nodeId,
|
|
355
|
+
message: "Placement intersects " + u.nodeId,
|
|
356
|
+
detail: { otherNodeId: u.nodeId, precision: "oriented-bounds" }
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
return f;
|
|
360
|
+
}
|
|
361
|
+
function Q(n, t) {
|
|
362
|
+
return n < t ? `${n}\0${t}` : `${t}\0${n}`;
|
|
363
|
+
}
|
|
364
|
+
function un(n, t) {
|
|
365
|
+
return !!n && !!t && [...n.position, ...n.rotation, ...n.scale].every(
|
|
366
|
+
(e, o) => Math.abs(e - [...t.position, ...t.rotation, ...t.scale][o]) < 1e-9
|
|
367
|
+
);
|
|
368
|
+
}
|
|
369
|
+
function P(n) {
|
|
370
|
+
return n.nodeType === "asset" ? n.assetRevisionId : n.nodeType === "visual" ? n.visualRevisionId : null;
|
|
371
|
+
}
|
|
372
|
+
function mn(n, t) {
|
|
373
|
+
var o, s;
|
|
374
|
+
if (t.nodeType !== "asset") return !1;
|
|
375
|
+
const e = W(n, t.assetRevisionId);
|
|
376
|
+
return (e == null ? void 0 : e.category) === "container" || ((s = (o = e == null ? void 0 : e.semantic) == null ? void 0 : o.tags) == null ? void 0 : s.some((r) => /^(container|receptacle|集装箱|容器|可容纳)$/i.test(r))) === !0;
|
|
377
|
+
}
|
|
378
|
+
export {
|
|
379
|
+
D,
|
|
380
|
+
rn as S,
|
|
381
|
+
h as a,
|
|
382
|
+
dn as b,
|
|
383
|
+
xn as c,
|
|
384
|
+
nn as d,
|
|
385
|
+
tn as e,
|
|
386
|
+
J as f,
|
|
387
|
+
B as g,
|
|
388
|
+
Sn as h,
|
|
389
|
+
gn as i,
|
|
390
|
+
ln as j,
|
|
391
|
+
$ as k,
|
|
392
|
+
k as l,
|
|
393
|
+
en as m,
|
|
394
|
+
cn as n,
|
|
395
|
+
I as o,
|
|
396
|
+
Nn as p,
|
|
397
|
+
mn as q,
|
|
398
|
+
Mn as r,
|
|
399
|
+
sn as s,
|
|
400
|
+
In as t,
|
|
401
|
+
yn as u,
|
|
402
|
+
An as v,
|
|
403
|
+
vn as w,
|
|
404
|
+
C as x
|
|
405
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { AssetAnnotations } from '../asset/intake';
|
|
2
|
+
import type { AssetRevision } from '../asset/record';
|
|
3
|
+
import type { Diagnostic } from '../util/diagnostics';
|
|
4
|
+
import type { StudioAssetSource } from './asset-source';
|
|
5
|
+
export interface StudioAssetFile {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
/** Optional package-relative path; defaults to name. */
|
|
8
|
+
readonly path?: string;
|
|
9
|
+
readonly blob: Blob;
|
|
10
|
+
}
|
|
11
|
+
export interface StudioAssetInput {
|
|
12
|
+
readonly files: readonly StudioAssetFile[];
|
|
13
|
+
readonly entry?: string;
|
|
14
|
+
readonly annotations?: AssetAnnotations;
|
|
15
|
+
/** Override the generated id. Valid only when ingest yields one asset. */
|
|
16
|
+
readonly assetId?: string;
|
|
17
|
+
}
|
|
18
|
+
export type StudioAssetProgressStage = 'intake' | 'resolving' | 'preparing' | 'persisting' | 'committing' | 'complete';
|
|
19
|
+
export interface StudioAssetProgress {
|
|
20
|
+
readonly stage: StudioAssetProgressStage;
|
|
21
|
+
readonly completed: number;
|
|
22
|
+
readonly total: number;
|
|
23
|
+
/** False when the ingestor can only report coarse stages, not byte progress. */
|
|
24
|
+
readonly determinate: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface StudioAssetIngestOptions {
|
|
27
|
+
readonly taskId: string;
|
|
28
|
+
readonly signal?: AbortSignal;
|
|
29
|
+
readonly onProgress?: (progress: StudioAssetProgress) => void;
|
|
30
|
+
}
|
|
31
|
+
export interface StudioAssetIntakeResult {
|
|
32
|
+
readonly status: 'ready' | 'needs-entry' | 'blocked';
|
|
33
|
+
readonly assets: readonly AssetRevision[];
|
|
34
|
+
readonly sources: readonly StudioAssetSource[];
|
|
35
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
36
|
+
readonly entryCandidates: readonly string[];
|
|
37
|
+
}
|
|
38
|
+
/** Ingest port: the Host owns identity and registration, not file formats. */
|
|
39
|
+
export interface StudioAssetIngestor {
|
|
40
|
+
ingest(input: StudioAssetInput, options?: StudioAssetIngestOptions): Promise<StudioAssetIntakeResult>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** Revision-addressed asset source locations and immutable fact verification. */
|
|
2
|
+
import type { AssetResource, AssetRevision, VisualAssetRevision } from '../doc/schema';
|
|
3
|
+
import type { StudioSourceBundle, StudioSourceFile } from '../util/studio-source';
|
|
4
|
+
import type { StudioRemoteAssetSource } from '../asset/source-contracts';
|
|
5
|
+
export type { StudioAssetRequest, StudioAssetScope, StudioRemoteAssetSource, StudioRemoteAssetSourceInput, } from '../asset/source-contracts';
|
|
6
|
+
export { canonicalEntryUrl, normalizeRemoteSource, normalizeScopes, pathMatchesPrefix, remoteSourceAllowsUrl, STUDIO_ASSET_SOURCE_ERROR, } from '../asset/source-paths';
|
|
7
|
+
export interface StudioLocalAssetSource {
|
|
8
|
+
readonly kind: 'local-package';
|
|
9
|
+
readonly revisionId: string;
|
|
10
|
+
readonly entryPath: string;
|
|
11
|
+
readonly files: readonly StudioSourceFile[];
|
|
12
|
+
}
|
|
13
|
+
export type StudioAssetSource = StudioLocalAssetSource | StudioRemoteAssetSource;
|
|
14
|
+
export type StudioResolvableRevision = AssetRevision | VisualAssetRevision;
|
|
15
|
+
export interface StudioPreparedAsset {
|
|
16
|
+
readonly revision: AssetRevision;
|
|
17
|
+
readonly source: StudioAssetSource;
|
|
18
|
+
}
|
|
19
|
+
export interface StudioAssetRegistrationInput {
|
|
20
|
+
readonly revision: StudioResolvableRevision;
|
|
21
|
+
readonly source: StudioAssetSource;
|
|
22
|
+
}
|
|
23
|
+
export interface StudioAssetSourceResolveOptions {
|
|
24
|
+
readonly signal?: AbortSignal;
|
|
25
|
+
}
|
|
26
|
+
export interface StudioAssetSourceRegisterOptions {
|
|
27
|
+
readonly signal?: AbortSignal;
|
|
28
|
+
readonly operationId?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface StudioAssetSourceRegistration {
|
|
31
|
+
readonly revisionId: string;
|
|
32
|
+
readonly ownership: 'created' | 'reused';
|
|
33
|
+
}
|
|
34
|
+
export interface StudioAssetSourceProvider {
|
|
35
|
+
resolve(revision: StudioResolvableRevision, options?: StudioAssetSourceResolveOptions): StudioAssetSource | null | Promise<StudioAssetSource | null>;
|
|
36
|
+
register(input: StudioAssetRegistrationInput, options?: StudioAssetSourceRegisterOptions): StudioAssetSourceRegistration | Promise<StudioAssetSourceRegistration>;
|
|
37
|
+
materialize?(revision: StudioResolvableRevision, source: StudioAssetSource, options?: StudioAssetSourceResolveOptions): StudioSourceBundle | null | Promise<StudioSourceBundle | null>;
|
|
38
|
+
flush?(): Promise<void>;
|
|
39
|
+
acknowledge?(revisionId: string, operationId?: string): void | Promise<void>;
|
|
40
|
+
release?(revisionId: string): void | Promise<void>;
|
|
41
|
+
dispose?(): void | Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
export declare function sourceRevisionIdOf(revision: StudioResolvableRevision): string;
|
|
44
|
+
export declare function copyStudioAssetSource(source: StudioAssetSource): StudioAssetSource;
|
|
45
|
+
export declare function prepareStudioAssetSource(source: StudioAssetSource, options?: {
|
|
46
|
+
readonly signal?: AbortSignal;
|
|
47
|
+
}): Promise<{
|
|
48
|
+
readonly source: StudioAssetSource;
|
|
49
|
+
readonly facts: readonly AssetResource[];
|
|
50
|
+
readonly fingerprint: string;
|
|
51
|
+
}>;
|
|
52
|
+
export declare function assertStudioAssetSourceMatchesRevision(source: StudioAssetSource, revision: StudioResolvableRevision): void;
|
|
53
|
+
export declare function verifyStudioAssetSourceFacts(source: StudioAssetSource, revision: StudioResolvableRevision, options?: {
|
|
54
|
+
readonly signal?: AbortSignal;
|
|
55
|
+
}): Promise<void>;
|
|
56
|
+
export declare function studioAssetSourceFingerprint(source: StudioAssetSource, facts?: readonly Pick<AssetResource, 'locator' | 'sha256' | 'byteSize' | 'mediaType'>[]): string;
|
|
57
|
+
export declare function sourceBundleFromLocalSource(source: StudioLocalAssetSource): StudioSourceBundle;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DeliveryProfileV1 } from '../delivery/contracts';
|
|
2
|
+
import type { AssetCatalogEntryV3, DeliveryArtifactV2 } from '../project/contracts';
|
|
3
|
+
import type { StudioSourceBundle } from '../util/studio-source';
|
|
4
|
+
export interface StudioDeliveryResolutionInput {
|
|
5
|
+
readonly entry: AssetCatalogEntryV3;
|
|
6
|
+
readonly source: StudioSourceBundle;
|
|
7
|
+
readonly profile: DeliveryProfileV1;
|
|
8
|
+
}
|
|
9
|
+
export interface StudioDeliveryProvider {
|
|
10
|
+
resolve(input: StudioDeliveryResolutionInput, options?: {
|
|
11
|
+
readonly signal?: AbortSignal;
|
|
12
|
+
}): Promise<DeliveryArtifactV2 | null>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { StudioStateSnapshot } from '../persist/snapshot';
|
|
2
|
+
export interface StudioPersistenceAdapter {
|
|
3
|
+
/** Canonical scene state only. Asset bytes are resolved through the asset source port. */
|
|
4
|
+
load(): Promise<StudioStateSnapshot | null>;
|
|
5
|
+
save(snapshot: StudioStateSnapshot, options?: {
|
|
6
|
+
readonly signal?: AbortSignal;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
close?(): void | Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export interface StudioPersistenceError {
|
|
11
|
+
readonly code: string;
|
|
12
|
+
readonly message: string;
|
|
13
|
+
}
|
|
14
|
+
export interface StudioPersistenceState {
|
|
15
|
+
readonly available: boolean;
|
|
16
|
+
readonly dirty: boolean;
|
|
17
|
+
readonly saving: boolean;
|
|
18
|
+
readonly lastSavedVersion: number | null;
|
|
19
|
+
readonly lastSavedHash: string | null;
|
|
20
|
+
/** The loaded snapshot required migration and still needs a current-schema write. */
|
|
21
|
+
readonly migrationPending: boolean;
|
|
22
|
+
readonly error: StudioPersistenceError | null;
|
|
23
|
+
}
|
|
24
|
+
export interface StudioPersistenceReceipt {
|
|
25
|
+
readonly documentVersion: number;
|
|
26
|
+
readonly sceneEpoch: number;
|
|
27
|
+
readonly documentHash: string;
|
|
28
|
+
readonly savedAt: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AssetRevision, VisualAssetRevision } from '../doc/schema';
|
|
2
|
+
import type { StudioSourceBundle } from '../util/studio-source';
|
|
3
|
+
import type { AdapterIdentityV1, AssetCatalogEntryV3, AssetCatalogV3, DeliveryArtifactV2, DeliveryLockV1, NormalizationFactsV1, SourceDependencyEdgeV2, VariantPayloadIndexV1 } from './contracts';
|
|
4
|
+
export interface AssetCatalogSourceInputV3 {
|
|
5
|
+
readonly asset: AssetRevision | VisualAssetRevision;
|
|
6
|
+
readonly source: StudioSourceBundle;
|
|
7
|
+
readonly sourceFormat?: string;
|
|
8
|
+
readonly dependencies?: readonly SourceDependencyEdgeV2[];
|
|
9
|
+
readonly declaredSubresource?: string;
|
|
10
|
+
readonly adapter?: AdapterIdentityV1;
|
|
11
|
+
readonly normalization?: NormalizationFactsV1;
|
|
12
|
+
readonly variantPayloads?: VariantPayloadIndexV1;
|
|
13
|
+
readonly deliveryArtifacts?: readonly DeliveryArtifactV2[];
|
|
14
|
+
}
|
|
15
|
+
export interface CreateAssetCatalogInputV3 {
|
|
16
|
+
readonly assets: readonly AssetCatalogSourceInputV3[];
|
|
17
|
+
readonly deliveryLocks?: readonly DeliveryLockV1[];
|
|
18
|
+
}
|
|
19
|
+
export declare function createAssetCatalog(input: CreateAssetCatalogInputV3): Promise<AssetCatalogV3>;
|
|
20
|
+
export declare function assertAssetCatalogIntegrity(catalog: AssetCatalogV3): void;
|
|
21
|
+
export declare function findCatalogEntryByRuntimeRevision(catalog: AssetCatalogV3, revision: AssetRevision | VisualAssetRevision): AssetCatalogEntryV3 | null;
|