@thatopen/services 0.3.0 → 0.3.2

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 (42) hide show
  1. package/README.md +3 -0
  2. package/dist/built-in/index.d.ts +22 -2
  3. package/dist/cli.js +3 -3
  4. package/docs/ai-quickstart.md +86 -0
  5. package/docs/cli/create.md +4 -3
  6. package/package.json +3 -3
  7. package/src/built-in/index.ts +669 -649
  8. package/src/cli/templates/app/package.json +31 -31
  9. package/src/cli/templates/app/src/app.ts +37 -37
  10. package/src/cli/templates/app/src/assets/tool-placeholder.ts +50 -50
  11. package/src/cli/templates/app/src/main.ts +223 -340
  12. package/src/cli/templates/app/src/setups/camera-tools.ts +63 -63
  13. package/src/cli/templates/app/src/setups/clipper-tool.ts +20 -1
  14. package/src/cli/templates/app/src/setups/clipper.ts +75 -75
  15. package/src/cli/templates/app/src/setups/index.ts +23 -33
  16. package/src/cli/templates/app/src/setups/inspection.ts +136 -136
  17. package/src/cli/templates/app/src/setups/measurement-tool.ts +19 -1
  18. package/src/cli/templates/app/src/setups/measurements.ts +133 -133
  19. package/src/cli/templates/app/src/setups/reality-capture/lib/hidden-tiles-plugin.ts +88 -88
  20. package/src/cli/templates/app/src/setups/reality-capture/lib/point-tile-plugin.ts +166 -166
  21. package/src/cli/templates/app/src/setups/reality-capture/lib/render-frame.ts +31 -31
  22. package/src/cli/templates/app/src/setups/reality-capture/lib/splat-tile-plugin.ts +51 -51
  23. package/src/cli/templates/app/src/setups/reality-capture-viewer.ts +1383 -1383
  24. package/src/cli/templates/app/src/setups/right-sidebar.ts +178 -178
  25. package/src/cli/templates/app/src/setups/styles-panel.ts +110 -110
  26. package/src/cli/templates/app/src/setups/tool-mode-manager.ts +15 -9
  27. package/src/cli/templates/app/src/setups/tool-mode.ts +23 -23
  28. package/src/cli/templates/app/src/setups/active-tool-hud.ts +0 -69
  29. package/src/cli/templates/app/src/setups/clipper-panel.ts +0 -167
  30. package/src/cli/templates/app/src/setups/commands-panel.ts +0 -239
  31. package/src/cli/templates/app/src/setups/data-table-panel.ts +0 -2224
  32. package/src/cli/templates/app/src/setups/file-format-icons.ts +0 -95
  33. package/src/cli/templates/app/src/setups/files-panel.ts +0 -1503
  34. package/src/cli/templates/app/src/setups/fps-indicator.ts +0 -63
  35. package/src/cli/templates/app/src/setups/graphics-panel.ts +0 -490
  36. package/src/cli/templates/app/src/setups/measurement-settings-panel.ts +0 -161
  37. package/src/cli/templates/app/src/setups/model-tree.ts +0 -797
  38. package/src/cli/templates/app/src/setups/objects-panel.ts +0 -127
  39. package/src/cli/templates/app/src/setups/properties-panel.ts +0 -1048
  40. package/src/cli/templates/app/src/setups/settings-panel.ts +0 -94
  41. package/src/cli/templates/app/src/setups/visibility-toolbar.ts +0 -498
  42. package/src/cli/templates/app/src/setups/walkthrough.ts +0 -528
package/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  Client library and CLI for building BIM apps and cloud components on [That Open Platform](https://platform.thatopen.com). Apps run inside the platform's browser environment; cloud components run server-side and can be triggered from any app.
4
4
 
5
+ > **Using an AI assistant?** Point it at this single file and it can take you from nothing to a running app:
6
+ > → [`docs/ai-quickstart.md`](https://raw.githubusercontent.com/ThatOpen/engine_services/main/docs/ai-quickstart.md)
7
+
5
8
  ## Quick Start
6
9
 
7
10
  ### 1. Install the CLI
@@ -80,8 +80,6 @@ export type CDEMachineState = {
80
80
  kind: "idle";
81
81
  } | {
82
82
  kind: "loading";
83
- } | {
84
- kind: "uploading";
85
83
  } | {
86
84
  kind: "preparing";
87
85
  files: CDEFile[];
@@ -356,6 +354,22 @@ declare class _CDEManager extends OBC.Component implements OBC.Transitionable<CD
356
354
  files?: CDEFile[];
357
355
  folder?: ItemFolder;
358
356
  }>;
357
+ readonly onUploadStarted: OBC.Event<{
358
+ count: number;
359
+ }>;
360
+ readonly onIfcConversionStarted: OBC.Event<{
361
+ file: CDEFile;
362
+ }>;
363
+ readonly onIfcConversionProgress: OBC.Event<{
364
+ file: CDEFile;
365
+ progress: number;
366
+ }>;
367
+ readonly onIfcConversionCompleted: OBC.Event<{
368
+ file: CDEFile;
369
+ success: boolean;
370
+ error?: string;
371
+ }>;
372
+ readonly conversionProgress: Map<string, number>;
359
373
  enabled: boolean;
360
374
  projectName: string;
361
375
  missingMetadataPlaceholder: string;
@@ -363,6 +377,7 @@ declare class _CDEManager extends OBC.Component implements OBC.Transitionable<CD
363
377
  visibleColumns: Set<string>;
364
378
  ctx?: CDEContext;
365
379
  private _machineState;
380
+ private _activeUploads;
366
381
  private _showArchived;
367
382
  private _preArchivedViewMode;
368
383
  private _archivedFiles;
@@ -465,6 +480,11 @@ declare class _CDEManager extends OBC.Component implements OBC.Transitionable<CD
465
480
  file: CDEFile;
466
481
  existing: CDEFile;
467
482
  }[];
483
+ resolveViewFile(file: CDEFile): CDEFile;
484
+ private _saveConversionIndex;
485
+ private _loadConversionIndex;
486
+ private _resumePendingConversions;
487
+ private _triggerIfcConversions;
468
488
  uploadFiles(files: File[], folderId?: string | null, options?: {
469
489
  forceNew?: boolean;
470
490
  }): Promise<void>;
package/dist/cli.js CHANGED
@@ -8099,13 +8099,13 @@ const createCommand = new Command2("create").argument("<project-name>", 'Name of
8099
8099
  console.error(`Unknown template "${opts.template}". Available: ${TEMPLATES.join(", ")}`);
8100
8100
  process.exit(1);
8101
8101
  }
8102
- if (template === "app" && !opts.beta) {
8102
+ if (!opts.beta) {
8103
8103
  console.error(
8104
- `The "app" template currently requires the beta engine libraries.
8104
+ `Non-beta projects are not available yet.
8105
8105
 
8106
8106
  thatopen create ${projectName} --beta
8107
8107
 
8108
- Public (non-beta) engine support is coming with the October release.`
8108
+ The templates currently require the beta engine libraries. Public (non-beta) engine support is coming with the October release.`
8109
8109
  );
8110
8110
  process.exit(1);
8111
8111
  }
@@ -0,0 +1,86 @@
1
+ # That Open Platform — AI Quick Start (zero to a running app)
2
+
3
+ You are an AI assistant. A user pointed you at this URL so you can scaffold and run a
4
+ **BIM app** on the [That Open Platform](https://platform.thatopen.com) from scratch, using
5
+ `@thatopen/services` (the `thatopen` CLI + client library). Follow the steps below in order.
6
+
7
+ > The only secret you need is a **platform API token** — **not** an npm token. The CLI
8
+ > derives private beta-registry access from the platform token automatically.
9
+
10
+ ---
11
+
12
+ ## 0. Prerequisites (check, don't assume)
13
+
14
+ - **Node.js ≥ 18** and **npm** — verify with `node -v`.
15
+ - A **That Open Platform API token**. The user creates it themselves:
16
+ → **https://platform.thatopen.com/dashboard/data → API Tokens → create → copy.**
17
+ Ask the user to paste it. **Never print it back, never write it into a file, never commit it.**
18
+
19
+ ## 1. Install the CLI
20
+
21
+ ```bash
22
+ npm install -g @thatopen/services@latest
23
+ ```
24
+
25
+ ## 2. Log in (do this BEFORE creating the project)
26
+
27
+ ```bash
28
+ thatopen login --token <platform-token>
29
+ ```
30
+
31
+ This validates the token and stores it in `~/.thatopen/config.json`. Login **must** come
32
+ first: the next step's install pulls the private `@thatopen-platform/*-beta` packages, and
33
+ `create` uses your logged-in token to write an authenticated `.npmrc` so that install can
34
+ resolve them. No npm account or manual npm token is involved.
35
+
36
+ ## 3. Scaffold a beta app
37
+
38
+ ```bash
39
+ thatopen create my-app --beta
40
+ cd my-app
41
+ ```
42
+
43
+ `--beta` is required for now: the bundled viewer uses engine APIs that currently live only
44
+ in the beta libraries (public engine support lands with the October release). `create`
45
+ configures private beta access from your platform token and runs `npm install` for you.
46
+
47
+ ## 4. Run it
48
+
49
+ ```bash
50
+ npm run dev
51
+ ```
52
+
53
+ This serves the app and opens it inside the platform. **You now have a complete, working
54
+ viewer** — model loading, spatial tree, properties, measurement, sectioning, and more.
55
+
56
+ ## 5. Then build — read the in-project agent guide
57
+
58
+ The scaffold is a real app, not a blank page. **Before changing anything**, open and follow:
59
+
60
+ ```
61
+ node_modules/@thatopen/services/resources/AGENTS.md
62
+ ```
63
+
64
+ (The scaffolded project's own `AGENTS.md` points here too.) It is the canonical guide: it
65
+ indexes every platform built-in, the client API, the CLI, and the engine / UI example sets.
66
+ Load those indexes before writing code. **All UI must be built with Lit + `@thatopen/ui`
67
+ (`BUI`)** — consult the design system before writing any UI. Run the app first, then extend
68
+ it; don't rebuild a viewer from scratch.
69
+
70
+ ## 6. Publish (when ready)
71
+
72
+ ```bash
73
+ npm run publish
74
+ ```
75
+
76
+ Builds the app, zips it (`dist/bundle.zip`), and uploads a new version to the platform.
77
+
78
+ ---
79
+
80
+ ## Rules for you, the assistant
81
+
82
+ - **Platform token only.** Never introduce, request, or store an npm token.
83
+ - **Never echo or persist the user's token.** It belongs only in `~/.thatopen/config.json` /
84
+ `.npmrc`, both of which the CLI manages and git-ignores.
85
+ - **Propose a short plan and get the user's OK** before changing files.
86
+ - The scaffold already works — **extend it, don't replace it.**
@@ -17,12 +17,13 @@ thatopen create . # scaffold into the current directory
17
17
  - `--template <template>`, `-t` — Template to use. Default: `app`.
18
18
  - `app` — Browser BIM app running inside the platform iframe.
19
19
  - `cloud-component` — Server-side component executed by the platform's cloud engine and consumed in apps and/or automations.
20
- - `--beta` — Use private beta engine libraries (`@thatopen-platform/*-beta`) instead of the public ones. Sets `beta: true` in `.thatopen` so `serve`, `local-server`, and `vite build` all resolve to beta packages automatically. Requires beta npm access configured.
20
+ - `--beta` — Use private beta engine libraries (`@thatopen-platform/*-beta`) instead of the public ones. Sets `beta: true` in `.thatopen` so `serve`, `local-server`, and `vite build` all resolve to beta packages automatically. Requires beta npm access configured (handled automatically once you `thatopen login`).
21
+
22
+ > **`--beta` is currently required.** The templates depend on engine APIs that only exist in the beta libraries, so scaffolding without `--beta` errors out for now. Public (non-beta) support is coming with the October release.
21
23
 
22
24
  **Examples:**
23
25
  ```bash
24
- thatopen create my-app
25
- thatopen create my-app -t cloud-component
26
26
  thatopen create my-app --beta
27
+ thatopen create my-app -t cloud-component --beta
27
28
  thatopen create . --beta
28
29
  ```
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "access": "public"
16
16
  },
17
17
  "private": false,
18
- "version": "0.3.0",
18
+ "version": "0.3.2",
19
19
  "main": "dist/index.cjs.js",
20
20
  "module": "dist/index.es.js",
21
21
  "types": "dist/index.d.ts",
@@ -67,7 +67,7 @@
67
67
  "globals": "^15.3.0",
68
68
  "jszip": "^3.10.1",
69
69
  "prettier": "^3.2.5",
70
- "three": "^0.182.0",
70
+ "three": ">=0.182.0",
71
71
  "tsx": "^4.16.2",
72
72
  "typescript": "^5.2.2",
73
73
  "typescript-eslint": "^7.10.0",
@@ -84,7 +84,7 @@
84
84
  "peerDependencies": {
85
85
  "@thatopen/components": "~3.4.0",
86
86
  "@thatopen/ui": "~3.4.0",
87
- "three": "^0.182.0"
87
+ "three": ">=0.182.0"
88
88
  },
89
89
  "peerDependenciesMeta": {
90
90
  "@thatopen/components": {