@thatopen/services 0.35.0 → 0.36.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/dist/built-in/index.d.ts +13 -13
- package/dist/cli/lib/browser-session.d.ts +17 -0
- package/dist/cli/lib/config.d.ts +6 -0
- package/dist/cli.js +334 -38
- package/dist/cli.js.map +1 -1
- package/dist/core/browser-sign-in.d.ts +50 -0
- package/dist/core/browser-sign-in.test.d.ts +1 -0
- package/dist/core/builtin-recipes/index.d.ts +2 -2
- package/dist/core/builtin-recipes/layer-to-native.d.ts +19 -0
- package/dist/core/builtin-recipes/records-to-native.d.ts +43 -0
- package/dist/core/builtin-recipes/shapes-to-families.d.ts +9 -4
- package/dist/core/builtin-recipes/shared.d.ts +8 -11
- package/dist/core/channel.d.ts +1 -1
- package/dist/core/client.d.ts +46 -2
- package/dist/core/frag-items.d.ts +1 -1
- package/dist/core/history.d.ts +9 -9
- package/dist/core/op-builder.d.ts +2 -2
- package/dist/core/platform-client.d.ts +6 -3
- package/dist/core/project-recipes.d.ts +1 -1
- package/dist/core/recipes.d.ts +31 -5
- package/dist/index.cjs.js +23 -20
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +4284 -3455
- package/dist/index.es.js.map +1 -1
- package/docs/ai-quickstart.md +21 -21
- package/docs/builtin/paths.json +1 -1
- package/docs/cli/login.md +6 -3
- package/docs/client/paths.json +2 -2
- package/docs/flow-architecture.md +53 -53
- package/docs/flow-plugin-guide.md +13 -13
- package/docs/recipes-guide.md +24 -24
- package/docs/rhino-interop-quickstart.md +1 -1
- package/package.json +1 -1
- package/src/built-in/UIManager/src/git-history-panel/example.ts +2 -2
- package/src/built-in/index.ts +13 -13
- package/src/core/examples/channel.ts +2 -2
- package/src/core/examples/history.ts +4 -4
- package/dist/core/builtin-recipes/records-to-revit.d.ts +0 -28
- package/dist/core/builtin-recipes/rhino-to-revit.d.ts +0 -16
package/docs/ai-quickstart.md
CHANGED
|
@@ -29,22 +29,22 @@ on the [That Open Platform](https://platform.thatopen.com) from scratch, using
|
|
|
29
29
|
> Phrases that mean this: *"in the app I have open"*, *"use Planner/Coordinator to…"*, *"drive
|
|
30
30
|
> my app"*, *"make me a set of drawings"*.
|
|
31
31
|
|
|
32
|
-
> **Not building anything — here to work in
|
|
33
|
-
>
|
|
34
|
-
> their
|
|
32
|
+
> **Not building anything — here to work in the modelling tool?** If what the user actually wants is to share a
|
|
33
|
+
> native model with their team, join one a colleague uploaded, or bring an IFC or a shape model into
|
|
34
|
+
> their native model with a recipe that already exists, this is the wrong guide and nothing below
|
|
35
35
|
> applies. Go to
|
|
36
|
-
> **[
|
|
36
|
+
> **[plugin collaboration quickstart](https://raw.githubusercontent.com/ThatOpen/platform_services/main/docs/revit-collab-quickstart.md)** and follow that instead.
|
|
37
37
|
> It is the same shape as this one: ask first, then drive the CLI.
|
|
38
38
|
>
|
|
39
|
-
> Phrases that mean that guide, not this one: *"I want to collaborate on a
|
|
40
|
-
> my central"*, *"join my team's model"*, *"bring this IFC into my
|
|
39
|
+
> Phrases that mean that guide, not this one: *"I want to collaborate on a native project"*, *"share
|
|
40
|
+
> my central"*, *"join my team's model"*, *"bring this IFC into my native model"*, *"work on the
|
|
41
41
|
> same model as my colleague"*.
|
|
42
42
|
>
|
|
43
43
|
> *"Someone sent me a change to approve"* has no guide: nothing is sent into anybody's model any
|
|
44
|
-
> more, and there is nothing to approve. What exists is the person in
|
|
44
|
+
> more, and there is nothing to approve. What exists is the person in the modelling tool applying a recipe
|
|
45
45
|
> themselves (That Open > Select recipe, Update) — Step 6 of that same guide.
|
|
46
46
|
|
|
47
|
-
> **Making another application talk to this one?** If the user wants their own tool —
|
|
47
|
+
> **Making another application talk to this one?** If the user wants their own tool — the shape modeller, Blender,
|
|
48
48
|
> a script, an in-house app — to publish its data so recipes can read it, to updates in its
|
|
49
49
|
> own models, or to show a model it did not author, that is a third thing again:
|
|
50
50
|
> **[Writing a flow plugin](https://raw.githubusercontent.com/ThatOpen/platform_services/main/docs/flow-plugin-guide.md)** is the
|
|
@@ -54,10 +54,10 @@ on the [That Open Platform](https://platform.thatopen.com) from scratch, using
|
|
|
54
54
|
> Phrases that mean those: *"export my model to the platform"*, *"write a plugin for X"*, *"read a
|
|
55
55
|
> .frag in my app"*.
|
|
56
56
|
|
|
57
|
-
> **Making a recipe?** If the user wants to bring something of their project into
|
|
58
|
-
> column at every point of this layer"*, *"build this IFC's walls in
|
|
59
|
-
>
|
|
60
|
-
> It is applied from inside
|
|
57
|
+
> **Making a recipe?** If the user wants to bring something of their project into the modelling tool — *"put a
|
|
58
|
+
> column at every point of this layer"*, *"build this IFC's walls in the modelling tool"*, *"send my geometry to
|
|
59
|
+
> the modelling tool"*, *"a recipe that…"* — that is a recipe, not an app: **[Writing a recipe](https://raw.githubusercontent.com/ThatOpen/platform_services/main/docs/recipes-guide.md)**.
|
|
60
|
+
> It is applied from inside the modelling tool (That Open > Select recipe, Update) and saved in their project.
|
|
61
61
|
|
|
62
62
|
---
|
|
63
63
|
|
|
@@ -135,8 +135,8 @@ thatopen create my-app --beta
|
|
|
135
135
|
cd my-app
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
-
**[app, showing a
|
|
139
|
-
|
|
138
|
+
**[app, showing a native model's commit history]** If what they asked for is a viewer of the
|
|
139
|
+
flow history, scaffold it directly. Do not build it by hand: the wiring is four additions in
|
|
140
140
|
three places and the ORDER of them is load-bearing (see the boot order section below). This ships
|
|
141
141
|
it already correct, opening on the History layout.
|
|
142
142
|
|
|
@@ -177,7 +177,7 @@ https://platform.thatopen.com/dashboard/projects/<PROJECT_ID>/apps/local-app
|
|
|
177
177
|
|
|
178
178
|
> **If the platform shows "failed to load application" and the console says
|
|
179
179
|
> `Permission was denied for this request to access the `loopback` address space`**:
|
|
180
|
-
> current
|
|
180
|
+
> current browsers block an https page from fetching `http://localhost` until the
|
|
181
181
|
> user grants the **Local network access** permission. Tell the user: click the
|
|
182
182
|
> icon left of the URL → Site settings → **Local network access** → **Allow**,
|
|
183
183
|
> then reload. One-time, per browser profile. Verified 2026-09-22 — without the
|
|
@@ -426,13 +426,13 @@ into the folder as a view, so the document is born ready to visualize.
|
|
|
426
426
|
|
|
427
427
|
## 5d. History and recipes: versions, bringing data in
|
|
428
428
|
|
|
429
|
-
Three sentences hold the whole model. Every connected document (a
|
|
430
|
-
|
|
429
|
+
Three sentences hold the whole model. Every connected document (a native model,
|
|
430
|
+
a CAD drawing) has its version history: who synced, when, what changed,
|
|
431
431
|
and — when a recipe made it — which recipe and which source. Nobody writes in
|
|
432
432
|
somebody else's document: the person working in the native application brings
|
|
433
|
-
things in themselves. A RECIPE brings something of the project (an IFC, a
|
|
433
|
+
things in themselves. A RECIPE brings something of the project (an IFC, a shape modeller
|
|
434
434
|
layer, a .frag) into a native application; it is chosen and applied from inside
|
|
435
|
-
that application (in
|
|
435
|
+
that application (in the modelling tool: That Open > Select recipe, Update), and its
|
|
436
436
|
changes land there at once, in one undoable step.
|
|
437
437
|
|
|
438
438
|
```ts
|
|
@@ -468,8 +468,8 @@ the package needs them; in plain Node, fragments also pulls `web-ifc`).
|
|
|
468
468
|
|
|
469
469
|
BUILT-IN RECIPES ship with the SDK — proof that interoperability works
|
|
470
470
|
without writing anything, and the templates to copy:
|
|
471
|
-
`registerBuiltinRecipes(client)` registers `rhino-to-revit` (a
|
|
472
|
-
placed objects become instances of a chosen
|
|
471
|
+
`registerBuiltinRecipes(client)` registers `rhino-to-revit` (a source layer's
|
|
472
|
+
placed objects become instances of a chosen native type, reconciled on re-run),
|
|
473
473
|
`ifc-to-revit` and `frag-to-revit` (a whole building from the platform's own
|
|
474
474
|
records: levels, walls, curtain walls, floors, roofs, ceilings, stairs,
|
|
475
475
|
columns). A project's OWN recipes are saved in the project, versioned
|
package/docs/builtin/paths.json
CHANGED
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
"path": "src/built-in/UIManager/src/git-history-panel/example.ts",
|
|
104
|
-
"description": "git-history-panel — `top-git-history` is a
|
|
104
|
+
"description": "git-history-panel — `top-git-history` is a commit timeline for the **flow** feature. It lists the commits pushed by the plugin (newest first) and, when you click a commit, drives the shared 3D viewer to color that commit's changed elements — created green, modified blue, deleted red — on the loaded baseline model."
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
"path": "src/built-in/UIManager/src/map-panel/example.ts",
|
package/docs/cli/login.md
CHANGED
|
@@ -6,7 +6,9 @@ description: "Authenticate with the ThatOpen platform by validating an access to
|
|
|
6
6
|
|
|
7
7
|
Validates an access token against the platform API and saves the credentials. Run this once globally before using any other command, or per-project with `--local`.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Without a token, it signs you in through your browser, as the plugins do: it shows a code, opens the platform, and you confirm the code there. The session renews itself, and appears under **Connected apps** in your account, where you can disconnect it.
|
|
10
|
+
|
|
11
|
+
To use a token from the dashboard instead:
|
|
10
12
|
1. Go to [https://platform.thatopen.com](https://platform.thatopen.com)
|
|
11
13
|
2. In the header, click **Data**
|
|
12
14
|
3. Find the **Tokens** card and create a new token
|
|
@@ -15,17 +17,18 @@ To get a token:
|
|
|
15
17
|
|
|
16
18
|
**Usage:**
|
|
17
19
|
```bash
|
|
18
|
-
thatopen login
|
|
20
|
+
thatopen login [flags]
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
**Flags:**
|
|
22
24
|
|
|
23
|
-
- `--token <token>` — Access token from the dashboard.
|
|
25
|
+
- `--token <token>` — Access token from the dashboard. Without one, you sign in through your browser.
|
|
24
26
|
- `--api-url <url>` — Platform API URL. Default: `https://platform.thatopen.com` (production). Pass `https://dev.platform.thatopen.com` to target the dev environment.
|
|
25
27
|
- `--local` — Save credentials to `.thatopen` in the current directory instead of the global config. Use this inside a project to override the global token for that project only.
|
|
26
28
|
|
|
27
29
|
**Examples:**
|
|
28
30
|
```bash
|
|
31
|
+
thatopen login
|
|
29
32
|
thatopen login --token my-token
|
|
30
33
|
thatopen login --token my-token --local
|
|
31
34
|
npm run login -- --token my-token # from inside a scaffolded project
|
package/docs/client/paths.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"path": "src/core/examples/channel.ts",
|
|
12
|
-
"description": "Platform channel (app-side, runs inside the platform iframe) — a collaboration room with presence, and typed commands from external tools (MCP, CLI,
|
|
12
|
+
"description": "Platform channel (app-side, runs inside the platform iframe) — a collaboration room with presence, and typed commands from external tools (MCP, CLI, authoring-tool plugins, etc) with automatic replies."
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"path": "src/core/examples/components.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
"path": "src/core/examples/history.ts",
|
|
40
|
-
"description": "History and recipes — a project's connected documents (
|
|
40
|
+
"description": "History and recipes — a project's connected documents (authoring tools, CAD tools…), their version timelines, and recipes: scripts that bring a source into an app, in its native language, applied from inside that app."
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"path": "src/core/examples/icons.ts",
|
|
@@ -17,7 +17,7 @@ recording change.
|
|
|
17
17
|
The platform holds **native files** — `.rvt`, `.3dm`, whatever an application actually saves.
|
|
18
18
|
Nothing is converted on the way in.
|
|
19
19
|
|
|
20
|
-
Each **file** has its own collaboration system. Note: a file, not a format. Two
|
|
20
|
+
Each **file** has its own collaboration system. Note: a file, not a format. Two shape models in two
|
|
21
21
|
projects can be collaborated on in two different ways, by the same person, on the same day, because
|
|
22
22
|
what suits a five-person structural team does not suit somebody sketching alone.
|
|
23
23
|
|
|
@@ -29,9 +29,9 @@ That is the whole of the shared surface. Everything above it is free.
|
|
|
29
29
|
|
|
30
30
|
Two consequences, and they are the point of the design:
|
|
31
31
|
|
|
32
|
-
1. **Applications with incompatible needs coexist.**
|
|
33
|
-
system, because
|
|
34
|
-
a merge engine.
|
|
32
|
+
1. **Applications with incompatible needs coexist.** the modelling tool needs a very specific collaboration
|
|
33
|
+
system, because the modelling tool worksharing is a specific thing: a central file, element-level ownership,
|
|
34
|
+
a merge engine. the shape modeller needs none of that. Neither has to pretend to be the other.
|
|
35
35
|
2. **A project chooses.** Ownership claimed up front, or nothing locked at all, or something in
|
|
36
36
|
between. The history contract does not care which, and the platform reads all of them the same
|
|
37
37
|
way.
|
|
@@ -49,19 +49,19 @@ A history is a list of commits. Each commit says:
|
|
|
49
49
|
| `counts` | Derived totals, so a reader need not walk the changes to summarise. |
|
|
50
50
|
| `version` | Where it landed in the CDE, when there IS such a place. Data, never identity. |
|
|
51
51
|
|
|
52
|
-
Two rules about reading it, and they are what let an application unlike
|
|
52
|
+
Two rules about reading it, and they are what let an application unlike the modelling tool take part at all:
|
|
53
53
|
|
|
54
54
|
- **Order comes from the graph, not from a number.** Follow `parents`; break ties by timestamp.
|
|
55
55
|
Asking "which came first" of an integer forces every application to invent a sequence, and only
|
|
56
|
-
something like
|
|
56
|
+
something like the modelling tool's central — which serialises everybody through one line — can honestly
|
|
57
57
|
produce one.
|
|
58
58
|
- **`version` is never a name.** It is where the commit was stored, not what it is. An application
|
|
59
59
|
with no version counter simply omits it.
|
|
60
60
|
|
|
61
61
|
`parents` is a **list** because a history that can only be a line is a different thing from a graph.
|
|
62
|
-
A fork is two commits naming the same parent; a merge is one commit naming two.
|
|
62
|
+
A fork is two commits naming the same parent; a merge is one commit naming two. the modelling tool will never
|
|
63
63
|
write more than one — its central is a single line and it merges inside itself — and the list exists
|
|
64
|
-
precisely for the applications that are not
|
|
64
|
+
precisely for the applications that are not the modelling tool.
|
|
65
65
|
|
|
66
66
|
---
|
|
67
67
|
|
|
@@ -85,7 +85,7 @@ Every application on the platform publishes its data openly: readable **without
|
|
|
85
85
|
proprietary application**.
|
|
86
86
|
|
|
87
87
|
This is what makes everything in the next section possible. A translator, a script or a model runs
|
|
88
|
-
with
|
|
88
|
+
with the modelling tool closed and the shape modeller closed; if the only way to know what is in a model were to open the
|
|
89
89
|
application that wrote it, none of it could exist.
|
|
90
90
|
|
|
91
91
|
The constraint that follows is worth stating, because it decides where fixes go: **anything reading
|
|
@@ -99,13 +99,13 @@ back channel to a running application.
|
|
|
99
99
|
|
|
100
100
|
The other half is bringing things INTO a native application — as a **recipe**.
|
|
101
101
|
|
|
102
|
-
A recipe reads something of the project (an IFC, a
|
|
102
|
+
A recipe reads something of the project (an IFC, a source layer, a `.frag`, anything the platform
|
|
103
103
|
holds) and returns the changes that make the target model match it: adds, edits and removals, in
|
|
104
104
|
the target application's own vocabulary. Three things define it:
|
|
105
105
|
|
|
106
|
-
**It is chosen and applied from inside the application that receives it.** In
|
|
106
|
+
**It is chosen and applied from inside the application that receives it.** In the modelling tool: **That Open >
|
|
107
107
|
Select recipe** (the recipe, its source document from a list, its settings) and **That Open > Apply
|
|
108
|
-
recipe**. The plugin runs the recipe and writes its changes at once, in **one**
|
|
108
|
+
recipe**. The plugin runs the recipe and writes its changes at once, in **one** the modelling tool transaction:
|
|
109
109
|
Ctrl+Z undoes it whole, and closing without saving or going back in the history reverts it like any
|
|
110
110
|
other edit. Nothing is queued, uploaded or waiting for anybody.
|
|
111
111
|
|
|
@@ -125,7 +125,7 @@ its sync — so the change is theirs from the first moment, and an ordinary edit
|
|
|
125
125
|
|
|
126
126
|
When they sync, the commit says where the change came from: `kind: "recipe"` and an `origin` naming
|
|
127
127
|
the recipe, its version, a title, and the exact source document and version it read. The platform's
|
|
128
|
-
history panel shows such commits with a recipe mark and that title («IFC to
|
|
128
|
+
history panel shows such commits with a recipe mark and that title («IFC to the modelling tool: 6 level(s), 47
|
|
129
129
|
wall(s)…», «from racbasicsampleproject.ifc v1»).
|
|
130
130
|
|
|
131
131
|
Built-in recipes ship in `@thatopen/services` (`ifc-to-revit`, `frag-to-revit`, `rhino-to-revit`)
|
|
@@ -179,11 +179,11 @@ get a refusal naming it rather than a silently wrong element.
|
|
|
179
179
|
> **No plugin ever mentions another application. It publishes its own data raw, and reads a
|
|
180
180
|
> `.frag`. Everything that translates between two applications lives in the platform.**
|
|
181
181
|
|
|
182
|
-
The
|
|
183
|
-
publishes. The
|
|
184
|
-
|
|
182
|
+
The plugin has no idea shape modeller exists: it receives verbs over the modelling tool data it already
|
|
183
|
+
publishes. The shape modeller's plugin must have no idea native exists either — it exports what the shape modeller has, as
|
|
184
|
+
the shape modeller has it, and stops. The thing that reads a shape model and says what it means in a native one is
|
|
185
185
|
a third thing — a recipe — and it lives in the platform: built into `@thatopen/services`, or saved
|
|
186
|
-
in the project. The
|
|
186
|
+
in the project. The plugin runs it and applies what it returns, without knowing what it read.
|
|
187
187
|
|
|
188
188
|
The reason is arithmetic. Put translation in the plugins and every new tool has to learn about every
|
|
189
189
|
existing one: N tools, N² translators, each needing an update when either end changes. Put it in the
|
|
@@ -205,8 +205,8 @@ set names an item by its published id, writes the attributes given
|
|
|
205
205
|
remove names an item by its published id
|
|
206
206
|
```
|
|
207
207
|
|
|
208
|
-
The field names are not ours. `Family`, `Type`, `CategoryId` are what
|
|
209
|
-
what
|
|
208
|
+
The field names are not ours. `Family`, `Type`, `CategoryId` are what the modelling tool calls its own fields in
|
|
209
|
+
what the modelling tool publishes, and a translator copies them without needing to know what any of them mean.
|
|
210
210
|
The plugin that receives them is the only thing that does.
|
|
211
211
|
|
|
212
212
|
This was got wrong once and is easy to get wrong again. The first version defined `flow:family`,
|
|
@@ -235,8 +235,8 @@ The rule most likely to be undone by accident:
|
|
|
235
235
|
> **A recipe's changes are generic changes over a model. They never establish a shared identity
|
|
236
236
|
> between an element in one application and an element in another — not 1:1, not N:N, not at all.**
|
|
237
237
|
|
|
238
|
-
Each application owns its ids and nothing else knows what they mean. A
|
|
239
|
-
something in that
|
|
238
|
+
Each application owns its ids and nothing else knows what they mean. A modelling tool `UniqueId` identifies
|
|
239
|
+
something in that native model. A shape modeller object GUID identifies something in that `.3dm`. Neither is
|
|
240
240
|
ever translated into the other, and nothing is ever written into the source.
|
|
241
241
|
|
|
242
242
|
What IS recorded is much weaker, deliberately: **a recipe's own memory of what it made in one
|
|
@@ -256,8 +256,8 @@ Because it answers one question only — "what did THIS recipe make HERE?" — a
|
|
|
256
256
|
re-apply needs: an unchanged print writes nothing, a changed one is made again, a source key that is
|
|
257
257
|
gone is removed. Only what the recipe made is ever removed, never anything a person drew.
|
|
258
258
|
|
|
259
|
-
So a round trip works — create an object in
|
|
260
|
-
object in
|
|
259
|
+
So a round trip works — create an object in the shape modeller, apply the recipe in the modelling tool, then modify the same
|
|
260
|
+
object in the shape modeller and apply again — without either model holding a link to the other. Another recipe
|
|
261
261
|
reading the same source keeps its own record, and knows nothing of this one's.
|
|
262
262
|
|
|
263
263
|
### Why it matters
|
|
@@ -277,18 +277,18 @@ can live in that application instead — the way a recipe's memory lives in the
|
|
|
277
277
|
|
|
278
278
|
---
|
|
279
279
|
|
|
280
|
-
## 8.
|
|
280
|
+
## 8. the modelling tool: lean on the native system, do not rebuild it
|
|
281
281
|
|
|
282
|
-
|
|
282
|
+
the modelling tool already has worksharing, and it is good. The temptation is to build a collaboration layer on
|
|
283
283
|
top of it, because our central is not a live shared file and the native mechanisms therefore do not
|
|
284
284
|
reach across machines. The decision is the opposite: **be an efficient copier of a few files, and
|
|
285
|
-
let
|
|
285
|
+
let the modelling tool do the collaborating.** A very fast file transport can be made not to break. A layer of
|
|
286
286
|
our own logic on top of a partial API breaks in the cases nobody thought of.
|
|
287
287
|
|
|
288
|
-
What made that decision possible is a set of measurements rather than an opinion.
|
|
288
|
+
What made that decision possible is a set of measurements rather than an opinion. the modelling tool stores
|
|
289
289
|
worksharing ownership in small files NEXT TO the central, never inside the `.rvt`:
|
|
290
290
|
|
|
291
|
-
| what happens | what
|
|
291
|
+
| what happens | what the modelling tool writes to the central, immediately |
|
|
292
292
|
|---|---|
|
|
293
293
|
| somebody takes a workset | `worksetperms.dat` |
|
|
294
294
|
| somebody borrows elements by editing them | `editingperms.dat`, `editingdeltas.dat` |
|
|
@@ -301,7 +301,7 @@ feet.
|
|
|
301
301
|
|
|
302
302
|
Three more facts decide the design:
|
|
303
303
|
|
|
304
|
-
- **
|
|
304
|
+
- **the modelling tool re-reads those files.** Overwrite them behind a running the modelling tool and it reports the new
|
|
305
305
|
ownership within two to three seconds, with no reload and nothing asked of it. It polls the
|
|
306
306
|
central every five to eight seconds on its own; the read locks are visible in the worksharing log.
|
|
307
307
|
- **A borrow is a two-byte write.** `editingperms.dat` is a table of 32-byte records, one per
|
|
@@ -314,10 +314,10 @@ Three more facts decide the design:
|
|
|
314
314
|
not go through the block store, which would mint a model version per borrow.
|
|
315
315
|
|
|
316
316
|
So the shape is: a file watcher publishes ownership when it changes, everyone else pulls and merges
|
|
317
|
-
it, and
|
|
317
|
+
it, and the modelling tool believes what it reads. The platform's own registry stays as the ARBITER for the few
|
|
318
318
|
seconds before a replicated file arrives, because that race cannot be closed by transport alone.
|
|
319
319
|
|
|
320
|
-
**What still has to be our own, and why.**
|
|
320
|
+
**What still has to be our own, and why.** the modelling tool publishes ownership; it does not publish INTENT.
|
|
321
321
|
There is no event for taking a workset, none for borrowing an element, and no API to relinquish on
|
|
322
322
|
somebody else's behalf (`RelinquishOwnership` takes a document and no user; `Application.Username`
|
|
323
323
|
is read-only). So a claim cannot be vetoed before it happens, only observed after — which is why the
|
|
@@ -329,45 +329,45 @@ that machine's copy of the central and, left alone, tells the platform nothing.
|
|
|
329
329
|
publishes first, the next pull overwrites that copy and the work is gone while their local still
|
|
330
330
|
believes it was published.
|
|
331
331
|
|
|
332
|
-
That is why the add-in sits on both of
|
|
333
|
-
its own. `DocumentSynchronizingWithCentral` fires before
|
|
334
|
-
in the team queue and brings the central up to date in place, so
|
|
332
|
+
That is why the add-in sits on both of the modelling tool's sync events rather than beside them with a button of
|
|
333
|
+
its own. `DocumentSynchronizingWithCentral` fires before the modelling tool touches anything: it takes the turn
|
|
334
|
+
in the team queue and brings the central up to date in place, so the modelling tool's own merge runs against the
|
|
335
335
|
team's current file. It is cancellable, and every refusal uses it — elements held by somebody else,
|
|
336
336
|
a pull the guardrail refused, a queue the person gave up on — so a sync that cannot be published
|
|
337
|
-
safely is stopped before
|
|
337
|
+
safely is stopped before the modelling tool writes rather than left half done.
|
|
338
338
|
`DocumentSynchronizedWithCentral` then publishes what was written, and nothing else: no second
|
|
339
339
|
merge, no second SWC.
|
|
340
340
|
|
|
341
|
-
Measured while building it:
|
|
341
|
+
Measured while building it: the modelling tool reports the sync finished while it still holds a file in the
|
|
342
342
|
central's worksharing folder, so the publish retries with a growing wait. And replacing the central
|
|
343
343
|
files from inside the pre-event works with the model open — verified with the central rolled back a
|
|
344
|
-
version underneath a live session: 30 files rebuilt in the event,
|
|
344
|
+
version underneath a live session: 30 files rebuilt in the event, the modelling tool's merge on top of them.
|
|
345
345
|
|
|
346
|
-
The consequence is that the add-in has no sync button, no take button and no release button.
|
|
346
|
+
The consequence is that the add-in has no sync button, no take button and no release button. the modelling tool's
|
|
347
347
|
own worksharing UI is the interface, and ownership replication is what makes it true for everybody.
|
|
348
348
|
|
|
349
|
-
## 9.
|
|
349
|
+
## 9. the shape modeller: deliberately unanswered
|
|
350
350
|
|
|
351
|
-
|
|
351
|
+
The flow works because the modelling tool already had worksharing. flow arbitrates on top of it; it did not
|
|
352
352
|
have to invent it.
|
|
353
353
|
|
|
354
|
-
|
|
355
|
-
So "collaboration in
|
|
354
|
+
the shape modeller has none of that. A `.3dm` is one file, with no central, no per-object checkout, and no merge.
|
|
355
|
+
So "collaboration in the shape modeller" is not a thing that exists and gets wired up — it is a thing that would
|
|
356
356
|
have to be designed and written. Which is exactly what section 1 says is allowed: the contract is
|
|
357
357
|
the history, and how a file is collaborated on underneath is open.
|
|
358
358
|
|
|
359
|
-
**We are not answering it yet, on purpose.** Bringing a
|
|
360
|
-
collaboration layer at all —
|
|
361
|
-
question appears when several people want to edit one
|
|
359
|
+
**We are not answering it yet, on purpose.** Bringing a shape model into the modelling tool needs no the shape modeller
|
|
360
|
+
collaboration layer at all — the shape modeller publishes, and the modelling tool user applies `rhino-to-revit` — and the shape modeller displaying a native model needs only a `.frag` reader. The
|
|
361
|
+
question appears when several people want to edit one shape model at once, and until somebody
|
|
362
362
|
actually wants that, designing it would be guessing.
|
|
363
363
|
|
|
364
364
|
Two notes from thinking it through, so the thinking is not repeated:
|
|
365
365
|
|
|
366
|
-
- **Ownership granularity is the easy half, and layers are the natural unit.** A
|
|
367
|
-
a workset is in
|
|
366
|
+
- **Ownership granularity is the easy half, and layers are the natural unit.** A source layer is what
|
|
367
|
+
a workset is in the modelling tool: it is how teams already divide work, every object carries one, and the
|
|
368
368
|
exporter already records it. The lock registry needs no change beyond a different key prefix.
|
|
369
|
-
- **Merging is the hard half, and it is the real cost.**
|
|
370
|
-
itself.
|
|
369
|
+
- **Merging is the hard half, and it is the real cost.** the modelling tool reconciles concurrent element edits
|
|
370
|
+
itself. the shape modeller will not. A central would have to be *reconstructed* by applying per-object deltas
|
|
371
371
|
rather than being a file somebody overwrites — buildable on what already exists (stable object
|
|
372
372
|
GUIDs, regenerable definitions, per-commit deltas), but that is rebuilding worksharing, not
|
|
373
373
|
configuring it.
|
|
@@ -381,12 +381,12 @@ divide the work by file. If it is the latter, the merge may never be needed.
|
|
|
381
381
|
|
|
382
382
|
`.frag` is the transport for both layers: models, per-commit deltas, and the changes a recipe
|
|
383
383
|
returns (a geometry-less `.frag`, envelope `revitflow/op@2`). It
|
|
384
|
-
carries stable per-item global ids (
|
|
384
|
+
carries stable per-item global ids (the modelling tool `UniqueId`, the shape modeller object GUID) in its `guids` vector,
|
|
385
385
|
which is what lets anything address an element it did not create.
|
|
386
386
|
|
|
387
|
-
`.3dm` is readable and writable without a
|
|
388
|
-
and the
|
|
389
|
-
|
|
387
|
+
`.3dm` is readable and writable without a shape modeller licence, through McNeel's open-source **openNURBS**
|
|
388
|
+
and the open 3DM bindings. That covers the document and its geometry definitions but not the
|
|
389
|
+
the shape modeller kernel, so a converter can run server-side while real modelling operations still need the shape modeller.
|
|
390
390
|
|
|
391
391
|
The concrete wire formats — where each file lives on the platform, what the change envelope
|
|
392
392
|
contains, how the sync queue and the ownership registry work — are in
|
|
@@ -12,7 +12,7 @@ shaped the way it is; this says what the bytes look like.
|
|
|
12
12
|
> and the reference for what the API does underneath. Anything else touching these files directly
|
|
13
13
|
> will break when the layout moves behind the API, which is the plan.
|
|
14
14
|
|
|
15
|
-
Nothing here is aspirational. Every rule below is what the
|
|
15
|
+
Nothing here is aspirational. Every rule below is what the native tools plugins already do, and
|
|
16
16
|
was written from their implementation rather than ahead of it — which is why the awkward parts are
|
|
17
17
|
stated as plainly as the tidy ones. Where a rule exists because something broke, it says so.
|
|
18
18
|
|
|
@@ -152,7 +152,7 @@ somebody else's avatar, which is worse than showing none.
|
|
|
152
152
|
|
|
153
153
|
**In a native plug-in there is no call that answers it**, so read the `u` claim out of the API
|
|
154
154
|
key's JWT payload (base64url, no signature check, since this only decides which name to display).
|
|
155
|
-
That is what the
|
|
155
|
+
That is what the plugin does.
|
|
156
156
|
|
|
157
157
|
### The verbs
|
|
158
158
|
|
|
@@ -182,7 +182,7 @@ of the target carries it. The plugin keeps it in the target model's record of wh
|
|
|
182
182
|
(`revitflow_recipes.json`), which is the recipe's own bookkeeping and nobody else's.
|
|
183
183
|
|
|
184
184
|
**Every other attribute name belongs to the target application.** `Family`, `Type`, `CategoryId`,
|
|
185
|
-
`Level`, `Position` are what
|
|
185
|
+
`Level`, `Position` are what the modelling tool calls its own fields in what the modelling tool publishes. A recipe copies
|
|
186
186
|
them without needing to know what any of them mean; the plugin receiving them is the only thing that
|
|
187
187
|
does. Anything not in the receiving plugin's list of structural fields is treated as a parameter of
|
|
188
188
|
the element, which is what keeps the change vocabulary and the export vocabulary the same thing
|
|
@@ -241,7 +241,7 @@ Rules, restated here because they are the part an implementer gets wrong:
|
|
|
241
241
|
- **`version` is data, never a name, and nothing may sort by it.** It is where the commit landed in
|
|
242
242
|
the CDE. An application with no such number omits it entirely.
|
|
243
243
|
- **`message` is the author's own words, and is optional.** Free text, never parsed, absent when
|
|
244
|
-
nobody said anything. Take it from wherever the application already asks:
|
|
244
|
+
nobody said anything. Take it from wherever the application already asks: the modelling tool's Synchronize
|
|
245
245
|
with Central dialog has had a Comment box forever, so the add-in passes that through rather than
|
|
246
246
|
generating a sentence about element counts, which `changes` already says better.
|
|
247
247
|
- **`full`** means this commit re-exported the whole model, so the visible `.frag` shows the model
|
|
@@ -258,10 +258,10 @@ Rules, restated here because they are the part an implementer gets wrong:
|
|
|
258
258
|
|
|
259
259
|
---
|
|
260
260
|
|
|
261
|
-
## 4. Collaboration in
|
|
261
|
+
## 4. Collaboration in the modelling tool, as one worked example
|
|
262
262
|
|
|
263
263
|
None of this is required by the contract. It is what a file needs when its application works the way
|
|
264
|
-
|
|
264
|
+
the modelling tool does, and it is here because it is the hardest case: read it as an example, not as the shape
|
|
265
265
|
your application must take.
|
|
266
266
|
|
|
267
267
|
### The native model
|
|
@@ -275,7 +275,7 @@ name so a past state can be rebuilt.
|
|
|
275
275
|
### Ownership
|
|
276
276
|
|
|
277
277
|
|
|
278
|
-
|
|
278
|
+
the modelling tool already arbitrates ownership — against **that machine's copy of the central**. Since the
|
|
279
279
|
central here is a snapshot that syncs rather than a live shared file, two people on two machines can
|
|
280
280
|
both borrow the same wall and both succeed, and neither finds out until one syncs. So arbitration
|
|
281
281
|
has to happen where both machines can see it.
|
|
@@ -312,13 +312,13 @@ for good.
|
|
|
312
312
|
## 5. Applying a recipe in your plugin, end to end
|
|
313
313
|
|
|
314
314
|
The recipe code is the platform's own, in `@thatopen/services`; a plugin hosts it rather than
|
|
315
|
-
reimplementing it. (The
|
|
315
|
+
reimplementing it. (The plugin runs it in a hidden WebView2 page and applies the result in
|
|
316
316
|
C#.) The whole job, for the common case:
|
|
317
317
|
|
|
318
318
|
1. **Offer the recipes.** `client.recipes.catalog(projectId, { to: '<your app>' })` lists the
|
|
319
319
|
built-ins and the project's own; `client.recipes.choices(name, projectId)` lists the documents
|
|
320
320
|
it can read, each with its current version; the manifest's `settingsSchema` says what to ask.
|
|
321
|
-
In
|
|
321
|
+
In the modelling tool this is **That Open > Select recipe**.
|
|
322
322
|
2. **Run it.** `client.recipes.run(name, { projectId, target, input, settings, made, opId,
|
|
323
323
|
recipeVersion, progress })`, with `made` read from your model's record of what that recipe made
|
|
324
324
|
before. It answers `{ title, verb, payload, targets, ruleTallies }`, or throws `UpToDate`: say
|
|
@@ -331,7 +331,7 @@ C#.) The whole job, for the common case:
|
|
|
331
331
|
(section 3).
|
|
332
332
|
|
|
333
333
|
That is all. No lock beyond what your application already takes for an edit, no queue, nobody else
|
|
334
|
-
to wait for. In
|
|
334
|
+
to wait for. In the modelling tool, steps 2 to 4 are **That Open > Update**.
|
|
335
335
|
|
|
336
336
|
---
|
|
337
337
|
|
|
@@ -340,14 +340,14 @@ to wait for. In Revit, steps 2 to 4 are **That Open > Update**.
|
|
|
340
340
|
The contract is section 3, and nothing else. What you decide for yourself:
|
|
341
341
|
|
|
342
342
|
- **What a commit contains.** Whatever your application can honestly report as changed.
|
|
343
|
-
- **Whether ownership exists at all.**
|
|
343
|
+
- **Whether ownership exists at all.** the modelling tool's model is claimed-before-editing arbitrated centrally.
|
|
344
344
|
For an application where teams already divide work by file, no locking may be the right answer.
|
|
345
|
-
- **How concurrent edits reconcile.**
|
|
345
|
+
- **How concurrent edits reconcile.** the modelling tool has a merge engine; most applications do not, and this
|
|
346
346
|
is the expensive half. A central that is *reconstructed* from per-object deltas rather than
|
|
347
347
|
overwritten is buildable on stable object ids and per-commit deltas, but that is rebuilding
|
|
348
348
|
worksharing rather than configuring it.
|
|
349
349
|
- **Whether history branches.** The format allows it. Whether your application does is yours to
|
|
350
|
-
decide, and
|
|
350
|
+
decide, and the modelling tool's cannot: its central is a single line.
|
|
351
351
|
|
|
352
352
|
The one thing not up for grabs: **order comes from the graph, never from a counter.** Write commits
|
|
353
353
|
with guids and parents, and every reader on the platform can already show your history alongside
|