@thatopen/services 0.3.16 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +62 -62
  2. package/dist/cli/commands/rhino.d.ts +11 -0
  3. package/dist/cli/lib/plugin-install.d.ts +24 -0
  4. package/dist/cli.js +124 -1
  5. package/dist/core/client.d.ts +1 -0
  6. package/dist/core/platform-client.d.ts +7 -0
  7. package/dist/index.cjs.js +2 -2
  8. package/dist/index.es.js +382 -370
  9. package/dist/vite-env.d.ts +1 -1
  10. package/docs/ai-quickstart.md +130 -130
  11. package/docs/cli/create.md +29 -29
  12. package/docs/cli/local-server.md +38 -38
  13. package/docs/cli/login.md +32 -32
  14. package/docs/cli/publish.md +31 -31
  15. package/docs/cli/run.md +26 -26
  16. package/docs/cli/serve.md +43 -43
  17. package/docs/cli/swap.md +30 -30
  18. package/docs/cloud/GaussianSplatConverter.md +43 -43
  19. package/docs/cloud/PointCloudConverter.md +53 -53
  20. package/docs/revit-collab-quickstart.md +256 -256
  21. package/package.json +95 -95
  22. package/resources/AGENTS.md +40 -40
  23. package/src/built-in/CDEManager/example.ts +214 -214
  24. package/src/built-in/CDEManager/examples/FileEditing/example.ts +226 -226
  25. package/src/built-in/CDEManager/examples/FileMoves/example.ts +186 -186
  26. package/src/built-in/CDEManager/examples/FileOperations/example.ts +295 -295
  27. package/src/built-in/CDEManager/examples/FileTransfers/example.ts +210 -210
  28. package/src/built-in/CDEManager/examples/FolderManagement/example.ts +230 -230
  29. package/src/built-in/CDEManager/examples/MetadataSchema/example.ts +230 -230
  30. package/src/built-in/CDEManager/examples/MetadataViews/example.ts +166 -166
  31. package/src/built-in/CDEManager/examples/ProjectConfig/example.ts +177 -177
  32. package/src/built-in/ClashesManager/example.ts +283 -283
  33. package/src/built-in/UIManager/src/app/example.ts +97 -97
  34. package/src/built-in/UIManager/src/app/examples/AppState/example.ts +140 -140
  35. package/src/built-in/UIManager/src/app/examples/Banner/example.ts +159 -159
  36. package/src/built-in/UIManager/src/app/examples/Contexts/example.ts +123 -123
  37. package/src/built-in/UIManager/src/app/examples/FileDrop/example.ts +124 -124
  38. package/src/built-in/UIManager/src/app/examples/FloatingLayout/example.ts +90 -90
  39. package/src/built-in/UIManager/src/app/examples/Modal/example.ts +163 -163
  40. package/src/built-in/UIManager/src/app/examples/Notifications/example.ts +133 -133
  41. package/src/built-in/UIManager/src/app/examples/Sidebar/example.ts +102 -102
  42. package/src/cli/templates/app/README.md +217 -217
  43. package/src/cli/templates/app/index.html +35 -35
  44. package/src/cli/templates/app/package.json +32 -32
  45. package/src/cli/templates/app/src/app.ts +37 -37
  46. package/src/cli/templates/app/src/assets/tool-placeholder.ts +50 -50
  47. package/src/cli/templates/app/src/bim-components/CloudRunner/index.ts +95 -95
  48. package/src/cli/templates/app/src/bim-components/CloudRunner/src/index.ts +1 -1
  49. package/src/cli/templates/app/src/bim-components/CloudRunner/src/types.ts +5 -5
  50. package/src/cli/templates/app/src/bim-components/index.ts +1 -1
  51. package/src/cli/templates/app/src/globals.ts +1 -1
  52. package/src/cli/templates/app/src/main.ts +199 -199
  53. package/src/cli/templates/app/src/setups/reality-capture/lib/hidden-tiles-plugin.ts +88 -88
  54. package/src/cli/templates/app/src/setups/reality-capture/lib/point-tile-plugin.ts +166 -166
  55. package/src/cli/templates/app/src/setups/reality-capture/lib/render-frame.ts +31 -31
  56. package/src/cli/templates/app/src/setups/reality-capture/lib/splat-tile-plugin.ts +51 -51
  57. package/src/cli/templates/app/src/setups/reality-capture-viewer.ts +1383 -1383
  58. package/src/cli/templates/app/src/ui-components/app-info-section/index.ts +26 -26
  59. package/src/cli/templates/app/src/ui-components/app-info-section/src/index.ts +1 -1
  60. package/src/cli/templates/app/src/ui-components/app-info-section/src/types.ts +15 -15
  61. package/src/cli/templates/app/src/ui-components/cloud-runner-section/index.ts +37 -37
  62. package/src/cli/templates/app/src/ui-components/cloud-runner-section/src/index.ts +1 -1
  63. package/src/cli/templates/app/src/ui-components/cloud-runner-section/src/types.ts +14 -14
  64. package/src/cli/templates/app/src/ui-components/index.ts +2 -2
  65. package/src/cli/templates/app/tsconfig.json +16 -16
  66. package/src/cli/templates/app/vite.config.js +57 -57
  67. package/src/cli/templates/cloud-component/README.md +205 -205
  68. package/src/cli/templates/cloud-component/_thatopen +5 -5
  69. package/src/cli/templates/cloud-component/declarations.json +4 -4
  70. package/src/cli/templates/cloud-component/package.json +21 -21
  71. package/src/cli/templates/cloud-component/src/main.ts +70 -70
  72. package/src/cli/templates/cloud-component/tsconfig.json +16 -16
  73. package/src/cli/templates/cloud-component/vite.config.js +46 -46
  74. package/src/cli/templates/shared/AGENTS.md +8 -8
  75. package/src/cli/templates/shared/CLAUDE.md +1 -1
  76. package/src/cli/templates/shared/_gitignore +5 -5
package/docs/cli/serve.md CHANGED
@@ -1,43 +1,43 @@
1
- ---
2
- description: "Start a local dev server for a browser app. Uses esbuild in watch mode and serves the IIFE bundle on port 4000 with SSE live reload. To connect: open the project on platform.thatopen.com, click the Local App icon, then Get Started."
3
- ---
4
-
5
- ## thatopen serve
6
-
7
- Builds the app in watch mode and serves the IIFE bundle locally. On every save, esbuild rebuilds and the platform reloads the bundle automatically via SSE.
8
-
9
- Does **not** open a browser tab — the app runs inside the platform iframe. Open your project on the platform, then click the debug button to connect it to the local server.
10
-
11
- **Usage:**
12
- ```bash
13
- thatopen serve [flags]
14
- ```
15
-
16
- **Flags:**
17
-
18
- - `--port <port>` — Port to serve the bundle on. Default: `4000`.
19
-
20
- **Endpoints served:**
21
-
22
- - `GET /bundle.js` — The compiled IIFE bundle.
23
- - `GET /bundle.js.map` — Source map.
24
- - `GET /events` — SSE stream for live reload.
25
-
26
- **Example:**
27
- ```bash
28
- thatopen serve
29
- thatopen serve --port 4321
30
- ```
31
-
32
- **Connecting the platform to your local server:**
33
-
34
- 1. Go to [https://platform.thatopen.com](https://platform.thatopen.com) and open a project (create one first if needed).
35
- 2. In the top right corner, click the **Local App** icon.
36
- 3. Click **Get Started**.
37
-
38
- The platform loads the bundle from port 4000 and renders the app inside the project context, with full access to its models, data, and users. The dev server must be running before opening this URL — if nothing is served on port 4000, the platform will fail to load the app.
39
-
40
- The resulting URL follows this pattern:
41
- ```
42
- https://platform.thatopen.com/dashboard/projects/{projectId}/apps/local-app
43
- ```
1
+ ---
2
+ description: "Start a local dev server for a browser app. Uses esbuild in watch mode and serves the IIFE bundle on port 4000 with SSE live reload. To connect: open the project on platform.thatopen.com, click the Local App icon, then Get Started."
3
+ ---
4
+
5
+ ## thatopen serve
6
+
7
+ Builds the app in watch mode and serves the IIFE bundle locally. On every save, esbuild rebuilds and the platform reloads the bundle automatically via SSE.
8
+
9
+ Does **not** open a browser tab — the app runs inside the platform iframe. Open your project on the platform, then click the debug button to connect it to the local server.
10
+
11
+ **Usage:**
12
+ ```bash
13
+ thatopen serve [flags]
14
+ ```
15
+
16
+ **Flags:**
17
+
18
+ - `--port <port>` — Port to serve the bundle on. Default: `4000`.
19
+
20
+ **Endpoints served:**
21
+
22
+ - `GET /bundle.js` — The compiled IIFE bundle.
23
+ - `GET /bundle.js.map` — Source map.
24
+ - `GET /events` — SSE stream for live reload.
25
+
26
+ **Example:**
27
+ ```bash
28
+ thatopen serve
29
+ thatopen serve --port 4321
30
+ ```
31
+
32
+ **Connecting the platform to your local server:**
33
+
34
+ 1. Go to [https://platform.thatopen.com](https://platform.thatopen.com) and open a project (create one first if needed).
35
+ 2. In the top right corner, click the **Local App** icon.
36
+ 3. Click **Get Started**.
37
+
38
+ The platform loads the bundle from port 4000 and renders the app inside the project context, with full access to its models, data, and users. The dev server must be running before opening this URL — if nothing is served on port 4000, the platform will fail to load the app.
39
+
40
+ The resulting URL follows this pattern:
41
+ ```
42
+ https://platform.thatopen.com/dashboard/projects/{projectId}/apps/local-app
43
+ ```
package/docs/cli/swap.md CHANGED
@@ -1,30 +1,30 @@
1
- ---
2
- description: "Toggle or explicitly set the engine library mode between stable public packages (@thatopen/*) and private beta packages (@thatopen-platform/*-beta). Updates package.json and .thatopen, then runs npm install. Source code never changes — aliases handle resolution."
3
- ---
4
-
5
- ## thatopen swap
6
-
7
- Switches the project between stable and beta engine libraries. Without flags, it toggles from the current state. Updates `package.json` dependencies and sets `beta` in `.thatopen` so `thatopen serve`, `thatopen local-server`, and `vite build` all pick up the change automatically.
8
-
9
- Source code stays unchanged — `@thatopen/components` imports resolve to the correct package via esbuild/vite aliases based on the `beta` flag in `.thatopen`.
10
-
11
- **Usage:**
12
- ```bash
13
- thatopen swap # toggle: stable → beta or beta → stable
14
- thatopen swap --beta # force beta
15
- thatopen swap --stable # force stable
16
- ```
17
-
18
- **Flags:**
19
-
20
- - `--beta` — Switch to beta libraries (`@thatopen-platform/*-beta`).
21
- - `--stable` — Switch back to stable public libraries (`@thatopen/*`).
22
-
23
- **Examples:**
24
- ```bash
25
- thatopen swap
26
- thatopen swap --beta
27
- thatopen swap --stable
28
- ```
29
-
30
- > Beta packages are private and the access must be explicitly granted by That Open Company.
1
+ ---
2
+ description: "Toggle or explicitly set the engine library mode between stable public packages (@thatopen/*) and private beta packages (@thatopen-platform/*-beta). Updates package.json and .thatopen, then runs npm install. Source code never changes — aliases handle resolution."
3
+ ---
4
+
5
+ ## thatopen swap
6
+
7
+ Switches the project between stable and beta engine libraries. Without flags, it toggles from the current state. Updates `package.json` dependencies and sets `beta` in `.thatopen` so `thatopen serve`, `thatopen local-server`, and `vite build` all pick up the change automatically.
8
+
9
+ Source code stays unchanged — `@thatopen/components` imports resolve to the correct package via esbuild/vite aliases based on the `beta` flag in `.thatopen`.
10
+
11
+ **Usage:**
12
+ ```bash
13
+ thatopen swap # toggle: stable → beta or beta → stable
14
+ thatopen swap --beta # force beta
15
+ thatopen swap --stable # force stable
16
+ ```
17
+
18
+ **Flags:**
19
+
20
+ - `--beta` — Switch to beta libraries (`@thatopen-platform/*-beta`).
21
+ - `--stable` — Switch back to stable public libraries (`@thatopen/*`).
22
+
23
+ **Examples:**
24
+ ```bash
25
+ thatopen swap
26
+ thatopen swap --beta
27
+ thatopen swap --stable
28
+ ```
29
+
30
+ > Beta packages are private and the access must be explicitly granted by That Open Company.
@@ -1,43 +1,43 @@
1
- # GaussianSplatConverter
2
-
3
- Convert a 3D Gaussian Splat PLY into a streamable FQ LOD tree.
4
-
5
- Reads an uploaded .ply (plain INRIA 3DGS, or a PlayCanvas compressed.ply) and builds an octree of flat-quant (FQ) LOD nodes, published as one visible `.splat` entry whose hidden files hold the streamed nodes. The viewer fetches only the nodes it needs at the LOD it needs.
6
-
7
- Pure CPU: no GPU, no WebGPU, no WebP, no k-means — which is what lets it run in a cloud worker at all (the splat-transform toolchain it replaces requires WebGPU). The codec and converter live in @thatopen-platform/components-beta (realityCapture); this component is only the platform I/O around it.
8
-
9
- - **Accepts:** `.ply`
10
- - **Produces:** `.splat`
11
- - **Result:** the execution's `resultMessage` contains `[splatFileId=<id>]`
12
-
13
- ## Actions
14
-
15
- | action | what it does | params |
16
- |---|---|---|
17
- | `default` | Convert the splat in one execution. | `fileId`, `gaussianScale` |
18
-
19
- ## Params
20
-
21
- | id | type | label |
22
- |---|---|---|
23
- | `fileId` | string | Gaussian-Splat PLY File ID |
24
- | `gaussianScale` | string | Gaussian scale (metric calibration, default 1) |
25
-
26
- ## Notes
27
-
28
- - gaussianScale is a METRIC CALIBRATION, not a quality knob: reality-capture splats are non-metric, so this scales them to real-world metres. It is PER-CAPTURE (alcardete calibrates to ~70) — default 1, and recalibrate in the viewer.
29
- - Spherical harmonics (view-dependent colour) are NOT carried: the FQ codec stores a flat RGBA per splat, and the renderer evaluates no SH. A capture therefore renders matte compared to its source. This is a known fidelity gap, not a bug.
30
-
31
- ## Usage
32
-
33
- ```ts
34
- import { SplatToFq } from "@thatopen/services";
35
-
36
- const { executionId } = await client.executeComponent(componentId, {
37
- projectId,
38
- fileId,
39
- });
40
-
41
- const exec = await client.getExecution(executionId);
42
- const producedFileId = SplatToFq.parseResult(exec.resultMessage);
43
- ```
1
+ # GaussianSplatConverter
2
+
3
+ Convert a 3D Gaussian Splat PLY into a streamable FQ LOD tree.
4
+
5
+ Reads an uploaded .ply (plain INRIA 3DGS, or a PlayCanvas compressed.ply) and builds an octree of flat-quant (FQ) LOD nodes, published as one visible `.splat` entry whose hidden files hold the streamed nodes. The viewer fetches only the nodes it needs at the LOD it needs.
6
+
7
+ Pure CPU: no GPU, no WebGPU, no WebP, no k-means — which is what lets it run in a cloud worker at all (the splat-transform toolchain it replaces requires WebGPU). The codec and converter live in @thatopen-platform/components-beta (realityCapture); this component is only the platform I/O around it.
8
+
9
+ - **Accepts:** `.ply`
10
+ - **Produces:** `.splat`
11
+ - **Result:** the execution's `resultMessage` contains `[splatFileId=<id>]`
12
+
13
+ ## Actions
14
+
15
+ | action | what it does | params |
16
+ |---|---|---|
17
+ | `default` | Convert the splat in one execution. | `fileId`, `gaussianScale` |
18
+
19
+ ## Params
20
+
21
+ | id | type | label |
22
+ |---|---|---|
23
+ | `fileId` | string | Gaussian-Splat PLY File ID |
24
+ | `gaussianScale` | string | Gaussian scale (metric calibration, default 1) |
25
+
26
+ ## Notes
27
+
28
+ - gaussianScale is a METRIC CALIBRATION, not a quality knob: reality-capture splats are non-metric, so this scales them to real-world metres. It is PER-CAPTURE (alcardete calibrates to ~70) — default 1, and recalibrate in the viewer.
29
+ - Spherical harmonics (view-dependent colour) are NOT carried: the FQ codec stores a flat RGBA per splat, and the renderer evaluates no SH. A capture therefore renders matte compared to its source. This is a known fidelity gap, not a bug.
30
+
31
+ ## Usage
32
+
33
+ ```ts
34
+ import { SplatToFq } from "@thatopen/services";
35
+
36
+ const { executionId } = await client.executeComponent(componentId, {
37
+ projectId,
38
+ fileId,
39
+ });
40
+
41
+ const exec = await client.getExecution(executionId);
42
+ const producedFileId = SplatToFq.parseResult(exec.resultMessage);
43
+ ```
@@ -1,53 +1,53 @@
1
- # PointCloudConverter
2
-
3
- Convert a LAS point cloud into a streamable Potree 2.0 octree.
4
-
5
- Reads an uploaded .las and builds a Potree 2.0 octree (metadata.json + hierarchy.bin + chopped octree pieces), published as one visible `.potree` entry whose hidden files hold the streamed chunks. The viewer byte-ranges those chunks, so a cloud opens without downloading it whole.
6
-
7
- The conversion itself lives in @thatopen-platform/components-beta (realityCapture); this component is only the platform I/O around it.
8
-
9
- - **Accepts:** `.las`
10
- - **Produces:** `.potree`
11
- - **Result:** the execution's `resultMessage` contains `[potreeFileId=<id>]`
12
-
13
- ## Actions
14
-
15
- | action | what it does | params |
16
- |---|---|---|
17
- | `SIMPLE` | Build the whole cloud in ONE execution. The default, and what you almost always want. | `fileId` |
18
- | `PLAN` | For clouds too big for SIMPLE: stream the source once and return an adaptive set of tiles that each fit a worker. | `fileId`, `K` |
19
- | `BUILD` | Build ONE tile of a PLAN as an aligned subtree of the global octree. Fired once per tile. | `grid`, `cell`, `entryId`, `shards` |
20
- | `MERGE` | Graft the built tiles into one global octree and publish the `.potree` entry. The tiles' bytes are referenced, never copied. | `grid`, `tiles`, `entryId` |
21
-
22
- ## Params
23
-
24
- | id | type | label |
25
- |---|---|---|
26
- | `action` | string | Action (SIMPLE|PLAN|BUILD|MERGE) |
27
- | `fileId` | string | LAS Point Cloud File ID |
28
- | `K` | number | Split level (PLAN) |
29
- | `grid` | string | Global grid JSON (BUILD/MERGE) |
30
- | `cell` | string | Cell name (BUILD) |
31
- | `tiles` | string | Tile descriptors JSON (MERGE) |
32
- | `entryId` | string | Shared entry item id (BUILD/MERGE) |
33
- | `shards` | string | Cell LAS shard hidden-file ids JSON (BUILD cell-file mode) |
34
-
35
- ## Notes
36
-
37
- - PLAN/BUILD/MERGE is a MEMORY workaround, not a speed feature — a billion-point cloud cannot fit in one worker. It needs many chained executions, and the platform's file API is whole-file-only (it ignores HTTP Range) at ~7 MB/s, so a 50GB / 2B-point cloud would spend ~9 hours just moving bytes, most of it network. Convert those OFFLINE and upload the .potree directly.
38
- - LAZ is not supported (it is compressed; the LASF signature check rejects it).
39
-
40
- ## Usage
41
-
42
- ```ts
43
- import { LasToPotree } from "@thatopen/services";
44
-
45
- const { executionId } = await client.executeComponent(componentId, {
46
- projectId,
47
- fileId,
48
- action: "SIMPLE",
49
- });
50
-
51
- const exec = await client.getExecution(executionId);
52
- const producedFileId = LasToPotree.parseResult(exec.resultMessage);
53
- ```
1
+ # PointCloudConverter
2
+
3
+ Convert a LAS point cloud into a streamable Potree 2.0 octree.
4
+
5
+ Reads an uploaded .las and builds a Potree 2.0 octree (metadata.json + hierarchy.bin + chopped octree pieces), published as one visible `.potree` entry whose hidden files hold the streamed chunks. The viewer byte-ranges those chunks, so a cloud opens without downloading it whole.
6
+
7
+ The conversion itself lives in @thatopen-platform/components-beta (realityCapture); this component is only the platform I/O around it.
8
+
9
+ - **Accepts:** `.las`
10
+ - **Produces:** `.potree`
11
+ - **Result:** the execution's `resultMessage` contains `[potreeFileId=<id>]`
12
+
13
+ ## Actions
14
+
15
+ | action | what it does | params |
16
+ |---|---|---|
17
+ | `SIMPLE` | Build the whole cloud in ONE execution. The default, and what you almost always want. | `fileId` |
18
+ | `PLAN` | For clouds too big for SIMPLE: stream the source once and return an adaptive set of tiles that each fit a worker. | `fileId`, `K` |
19
+ | `BUILD` | Build ONE tile of a PLAN as an aligned subtree of the global octree. Fired once per tile. | `grid`, `cell`, `entryId`, `shards` |
20
+ | `MERGE` | Graft the built tiles into one global octree and publish the `.potree` entry. The tiles' bytes are referenced, never copied. | `grid`, `tiles`, `entryId` |
21
+
22
+ ## Params
23
+
24
+ | id | type | label |
25
+ |---|---|---|
26
+ | `action` | string | Action (SIMPLE|PLAN|BUILD|MERGE) |
27
+ | `fileId` | string | LAS Point Cloud File ID |
28
+ | `K` | number | Split level (PLAN) |
29
+ | `grid` | string | Global grid JSON (BUILD/MERGE) |
30
+ | `cell` | string | Cell name (BUILD) |
31
+ | `tiles` | string | Tile descriptors JSON (MERGE) |
32
+ | `entryId` | string | Shared entry item id (BUILD/MERGE) |
33
+ | `shards` | string | Cell LAS shard hidden-file ids JSON (BUILD cell-file mode) |
34
+
35
+ ## Notes
36
+
37
+ - PLAN/BUILD/MERGE is a MEMORY workaround, not a speed feature — a billion-point cloud cannot fit in one worker. It needs many chained executions, and the platform's file API is whole-file-only (it ignores HTTP Range) at ~7 MB/s, so a 50GB / 2B-point cloud would spend ~9 hours just moving bytes, most of it network. Convert those OFFLINE and upload the .potree directly.
38
+ - LAZ is not supported (it is compressed; the LASF signature check rejects it).
39
+
40
+ ## Usage
41
+
42
+ ```ts
43
+ import { LasToPotree } from "@thatopen/services";
44
+
45
+ const { executionId } = await client.executeComponent(componentId, {
46
+ projectId,
47
+ fileId,
48
+ action: "SIMPLE",
49
+ });
50
+
51
+ const exec = await client.getExecution(executionId);
52
+ const producedFileId = LasToPotree.parseResult(exec.resultMessage);
53
+ ```