@fleetless/contracts 1.0.0 → 1.0.3
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/CHANGELOG.md +97 -2
- package/CODE_OF_CONDUCT.md +83 -0
- package/CONTRIBUTING.md +136 -0
- package/README.md +49 -13
- package/SECURITY.md +55 -0
- package/artifacts/openapi.json +11 -11
- package/artifacts/routes.json +12 -12
- package/artifacts/schema/create-app-oidc-provider-request.schema.json +1 -1
- package/dist/alerts.d.ts +23 -28
- package/dist/alerts.js +23 -29
- package/dist/app-users.d.ts +18 -19
- package/dist/app-users.js +18 -20
- package/dist/apps.d.ts +21 -25
- package/dist/apps.js +42 -52
- package/dist/assets.d.ts +70 -132
- package/dist/assets.js +130 -223
- package/dist/audit.d.ts +14 -15
- package/dist/audit.js +28 -55
- package/dist/client-auth.d.ts +9 -9
- package/dist/client-auth.js +8 -9
- package/dist/common.d.ts +29 -37
- package/dist/common.js +28 -37
- package/dist/config-issues.d.ts +23 -25
- package/dist/config-issues.js +17 -17
- package/dist/config.d.ts +37 -44
- package/dist/config.js +145 -187
- package/dist/errors.d.ts +4 -3
- package/dist/errors.js +83 -116
- package/dist/identity.d.ts +24 -27
- package/dist/identity.js +23 -27
- package/dist/index.d.ts +4 -4
- package/dist/index.js +14 -15
- package/dist/introspection.d.ts +7 -6
- package/dist/introspection.js +6 -6
- package/dist/jobs.d.ts +16 -16
- package/dist/jobs.js +24 -29
- package/dist/mcp.d.ts +14 -15
- package/dist/mcp.js +12 -14
- package/dist/oauth.d.ts +21 -27
- package/dist/oauth.js +33 -43
- package/dist/protocol.d.ts +51 -62
- package/dist/protocol.js +107 -139
- package/dist/realtime.d.ts +53 -68
- package/dist/realtime.js +78 -104
- package/dist/rest.d.ts +183 -244
- package/dist/rest.js +305 -399
- package/dist/routes.d.ts +4 -3
- package/dist/routes.js +33 -32
- package/package.json +12 -7
package/dist/assets.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
/**
|
|
3
|
-
* The asset store
|
|
4
|
+
* The asset store.
|
|
4
5
|
*
|
|
5
6
|
* An **asset is an immutable file belonging to a robot**. It has a uuid and is
|
|
6
7
|
* fetched by it. There are no org-level assets and no public retrieval: every
|
|
7
|
-
* read is authenticated and
|
|
8
|
+
* read is authenticated and checked against the `assets` role.
|
|
8
9
|
*
|
|
9
10
|
* **One authorization model — the `Authorization` header.** Not a signed URL,
|
|
10
11
|
* not a cookie, not a token in a query string. The reason is not ergonomics
|
|
@@ -12,7 +13,7 @@ import { z } from 'zod';
|
|
|
12
13
|
* lifetime, its own renewal, its own rotation, and in every log the question
|
|
13
14
|
* of which token that was. Directus solves the same problem with a cookie and
|
|
14
15
|
* an `access_token` query parameter, and the cookie half does not transfer —
|
|
15
|
-
* Fleetless has no interface of its own
|
|
16
|
+
* Fleetless has no end-user interface of its own, so the consumers of a robot's
|
|
16
17
|
* assets sit on other origins.
|
|
17
18
|
*
|
|
18
19
|
* **The consequence, said out loud: this is not a CDN.** A shared cache must
|
|
@@ -25,10 +26,9 @@ import { z } from 'zod';
|
|
|
25
26
|
*
|
|
26
27
|
* ---
|
|
27
28
|
*
|
|
28
|
-
* **`texture` is its own member of `assetKind` and not `other
|
|
29
|
+
* **`texture` is its own member of `assetKind` and not `other`.**
|
|
29
30
|
*
|
|
30
|
-
* Filing textures under `other`
|
|
31
|
-
* already split five times, and it costs a real capability: a client that
|
|
31
|
+
* Filing textures under `other` costs a real capability: a client that
|
|
32
32
|
* renders a robot must know, from the asset list alone and before fetching
|
|
33
33
|
* anything, which bytes it has to pre-fetch. Every load in the browser goes
|
|
34
34
|
* through the SDK with the bearer token — there is no lazy second fetch a
|
|
@@ -94,23 +94,18 @@ export type Asset = z.infer<typeof asset>;
|
|
|
94
94
|
*
|
|
95
95
|
* `missing` carries **the reference, verbatim, that no asset answers** — for
|
|
96
96
|
* a `package://` mesh the URI the bridge could not resolve in the workspace,
|
|
97
|
-
* and
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* producers, not on this field (W7a).** An entry a developer cannot make
|
|
110
|
-
* disappear by fixing what it names is a defect in whoever put it there: for
|
|
111
|
-
* a whole wave `<texture>` references were listed here and no sync would ever
|
|
112
|
-
* offer them, so the honest instruction behind the list was "fix this, it
|
|
113
|
-
* will not help".
|
|
97
|
+
* and also the absolute paths and bare relative paths a URDF may carry, which
|
|
98
|
+
* the extractor sees and the sync deliberately never offers. A developer whose
|
|
99
|
+
* URDF names `/opt/meshes/arm.stl` is entitled to be told that nothing will
|
|
100
|
+
* ever fetch it.
|
|
101
|
+
*
|
|
102
|
+
* A bare count of what is missing is a dead end: it tells a developer to go
|
|
103
|
+
* looking through a workspace by hand. The references are what they can act
|
|
104
|
+
* on, so the references travel.
|
|
105
|
+
*
|
|
106
|
+
* **Every entry must be actionable, and that is a constraint on the producers,
|
|
107
|
+
* not on this field.** An entry a developer cannot make disappear by fixing
|
|
108
|
+
* what it names is a defect in whoever put it there.
|
|
114
109
|
*/
|
|
115
110
|
export declare const urdfCompleteness: z.ZodObject<{
|
|
116
111
|
present: z.ZodBoolean;
|
|
@@ -128,21 +123,14 @@ export type UrdfCompleteness = z.infer<typeof urdfCompleteness>;
|
|
|
128
123
|
* A sync is long-running and is therefore answered with something to watch,
|
|
129
124
|
* never with a status that was true at the moment of asking.
|
|
130
125
|
*
|
|
131
|
-
* **`source` has one value, and that is deliberate.**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* differently; that is a defect this project has deliberately refused to
|
|
136
|
-
* introduce before, when an error code was proposed whose payload had moved.
|
|
137
|
-
* The zip path stays a condition rather than sitting in the wire as a
|
|
138
|
-
* promise.
|
|
126
|
+
* **`source` has one value, and that is deliberate.** A manual upload path is
|
|
127
|
+
* planned but has no body defined for the bytes yet. An enum value with no
|
|
128
|
+
* producer and no payload invites every consumer to guess a shape, and each
|
|
129
|
+
* guesses differently, so it stays out of the wire until it is real.
|
|
139
130
|
*
|
|
140
|
-
* A single-member enum rather than
|
|
131
|
+
* A single-member enum rather than no field at all: the second source is a
|
|
141
132
|
* question of when, not whether, and a caller that already names its source
|
|
142
133
|
* does not change shape when the second one arrives.
|
|
143
|
-
*
|
|
144
|
-
* Caught by Eve-W7 asking what body `'upload'` takes, rather than building
|
|
145
|
-
* against a guess.
|
|
146
134
|
*/
|
|
147
135
|
export declare const assetSyncRequest: z.ZodObject<{
|
|
148
136
|
source: z.ZodEnum<{
|
|
@@ -150,18 +138,11 @@ export declare const assetSyncRequest: z.ZodObject<{
|
|
|
150
138
|
}>;
|
|
151
139
|
}, z.core.$strict>;
|
|
152
140
|
/**
|
|
153
|
-
* **And the route
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
* comment with a type.
|
|
159
|
-
*
|
|
160
|
-
* The decision is to keep the shape and **validate it, `.strict()`**, rather
|
|
161
|
-
* than delete it. Deleting removes the record of why the enum has one member,
|
|
162
|
-
* and the zip path is a question of when. Validation is what makes the single
|
|
163
|
-
* member mean something: a caller who sends `'upload'` today learns that it
|
|
164
|
-
* does not exist yet, instead of silently getting a bridge sync.
|
|
141
|
+
* **And the route reads it.** The body is `.strict()`, so `{source:'upload'}`
|
|
142
|
+
* and `{nonsense:1}` are refusals rather than silent bridge syncs. A shape no
|
|
143
|
+
* route validates is not a contract; it is a comment with a type. Validation
|
|
144
|
+
* is what makes the single member mean something: a caller who names a source
|
|
145
|
+
* that does not exist yet learns that, instead of getting a different one.
|
|
165
146
|
*/
|
|
166
147
|
export type AssetSyncRequest = z.infer<typeof assetSyncRequest>;
|
|
167
148
|
export declare const assetSyncResponse: z.ZodObject<{
|
|
@@ -176,83 +157,43 @@ export type AssetSyncResponse = z.infer<typeof assetSyncResponse>;
|
|
|
176
157
|
* worse than one that fails outright, because the failure surfaces later, in a
|
|
177
158
|
* renderer, as a robot with missing limbs and no explanation.
|
|
178
159
|
*
|
|
179
|
-
* **`failed` carries per-reference facts and `reason` carries the sync's
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
* assume one. Read together with the old sentence *"`failed` is URIs and
|
|
196
|
-
* nothing else"*, this file told a consumer the same value was both a defect
|
|
197
|
-
* and a documented case.
|
|
198
|
-
*
|
|
199
|
-
* So the rule is: **anything that is not about one specific reference goes in
|
|
200
|
-
* `reason`** — one human-readable sentence
|
|
201
|
-
* about why the sync ended as it did, `null` when the outcome speaks for
|
|
202
|
-
* itself. It also carries the distinction `bridgeAssetProgress.state` makes
|
|
203
|
-
* and this shape could not — a sync **refused** because another was in flight
|
|
204
|
-
* is not a sync that tried and failed.
|
|
205
|
-
*
|
|
206
|
-
* **`assetSyncState` was deliberately not widened to carry that.** Consumers
|
|
207
|
-
* switch on it, a new member silently changes what every existing switch
|
|
208
|
-
* covers, and "refused" is a *reason* for a terminal outcome rather than a
|
|
209
|
-
* different one. Adding a field is additive; adding an enum member is not.
|
|
160
|
+
* **`failed` carries per-reference facts and `reason` carries the sync's
|
|
161
|
+
* own.** Anything that is not about one specific reference goes in `reason` —
|
|
162
|
+
* one human-readable sentence about why the sync ended as it did, `null` when
|
|
163
|
+
* the outcome speaks for itself. A whole-sync condition written into `failed`
|
|
164
|
+
* reaches a developer as a mesh they are told to go and find.
|
|
165
|
+
*
|
|
166
|
+
* Not every `failed` entry is a mesh URI. A URDF upload can fail like any
|
|
167
|
+
* other asset, and it appears under the name `robot_description`; see
|
|
168
|
+
* `assetFailure.reference`. A consumer must not assume every entry is a
|
|
169
|
+
* `package://` URI.
|
|
170
|
+
*
|
|
171
|
+
* **`assetSyncState` is deliberately not widened to carry the reason.**
|
|
172
|
+
* Consumers switch on it, and a new member silently changes what every
|
|
173
|
+
* existing switch covers. A sync refused because another was in flight is
|
|
174
|
+
* still a terminal outcome with a reason, not a different state. Adding a
|
|
175
|
+
* field is additive; adding an enum member is not.
|
|
210
176
|
*/
|
|
211
177
|
/**
|
|
212
|
-
* **
|
|
213
|
-
*
|
|
214
|
-
* Bis hierher hatte die Bridge eine eigene Zahl und die Cloud eine eigene, und
|
|
215
|
-
* die Registerzeile dazu nannte die der Bridge beim Namen: *„a guess … chosen
|
|
216
|
-
* as a starting number with no measurement behind it"* (DEF-127). Eine Grenze,
|
|
217
|
-
* die der Sender rät und der Empfänger durchsetzt, ist keine Grenze — sie ist
|
|
218
|
-
* zwei Zahlen, die zufällig übereinstimmen, bis eine von beiden sich ändert.
|
|
219
|
-
*
|
|
220
|
-
* Hier steht sie einmal. Die Bridge liest sie, **bevor** sie eine Datei in den
|
|
221
|
-
* Speicher liest; die Cloud setzt sie durch. Ohne das kann die Bridge gar nicht
|
|
222
|
-
* ablehnen, ohne 194 MB zu puffern — was am 2026-08-18 auf rx1 genau so passiert
|
|
223
|
-
* ist (DEF-148).
|
|
224
|
-
*
|
|
225
|
-
* **Sie gilt je Datei, nicht je Sync**, und das steht hier, weil DEF-127 es
|
|
226
|
-
* ausdrücklich verlangt hat: acht Meshes zu je 30 MiB passen durch, eine Datei
|
|
227
|
-
* zu 65 MiB nicht. Wer sie für eine Obergrenze der Übertragung hält, rechnet
|
|
228
|
-
* mit einer Schranke, die es nicht gibt — die Summe eines Syncs bindet das
|
|
229
|
-
* Speicherkontingent der Organisation, und das ist eine andere Zahl an einer
|
|
230
|
-
* anderen Stelle.
|
|
178
|
+
* **The upload ceiling both sides read.**
|
|
231
179
|
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
180
|
+
* It is stated once, here, rather than once in the producer and once in the
|
|
181
|
+
* cloud. A limit the sender guesses and the receiver enforces is not a limit;
|
|
182
|
+
* it is two numbers that agree until one of them changes.
|
|
234
183
|
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
* **laufende** `robot_description`: acht `package://`-Referenzen, zusammen
|
|
239
|
-
* 89.379.096 Bytes, die größte `RX1.dae` mit 38.229.621 — **keine über dem
|
|
240
|
-
* Deckel.**
|
|
184
|
+
* The bridge reads it **before** it reads a file into memory, and the cloud
|
|
185
|
+
* enforces it. Without a shared number a producer cannot refuse an oversized
|
|
186
|
+
* mesh without first buffering the whole of it.
|
|
241
187
|
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* gemessen wurde. Die Beobachtung von damals war korrekt und ihre Erklärung
|
|
248
|
-
* auch.
|
|
188
|
+
* **It applies per file, not per sync.** Eight meshes of 30 MiB each pass; one
|
|
189
|
+
* file of 65 MiB does not. Reading it as a ceiling on a whole transfer means
|
|
190
|
+
* planning against a bound that does not exist — the total of a sync counts
|
|
191
|
+
* against the organisation's storage quota, which is a different number in a
|
|
192
|
+
* different place.
|
|
249
193
|
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
* Übertragungszeit und Kontingente, und sie liegt bei André. Sie blockiert
|
|
254
|
-
* nichts: W9bs Gate-Schritt 6 ist gegen die heute laufende Beschreibung
|
|
255
|
-
* erreichbar, ohne dass jemand eine Zahl anfasst.
|
|
194
|
+
* A robot whose meshes exceed this is not a contract question but a question
|
|
195
|
+
* about storage, transfer time and quota, and it is answered by raising the
|
|
196
|
+
* number here, in one place, for both sides.
|
|
256
197
|
*/
|
|
257
198
|
export declare const ASSET_UPLOAD_MAX_BYTES: number;
|
|
258
199
|
export declare const assetTooLargeDetails: z.ZodObject<{
|
|
@@ -274,9 +215,9 @@ export type AssetTooLargeDetails = z.infer<typeof assetTooLargeDetails>;
|
|
|
274
215
|
* - **`upload_failed`** — the bytes exist and the transfer did not succeed.
|
|
275
216
|
* **Transient.** The asset is still wanted; a later sync will carry it.
|
|
276
217
|
* - **`refused`** — never attempted, because a producer-side ceiling was hit
|
|
277
|
-
* (
|
|
278
|
-
* report). **Transient in the same sense**: nothing is known
|
|
279
|
-
* only unexamined.
|
|
218
|
+
* (for example a `.dae` carrying more internal references than one file or
|
|
219
|
+
* one sync will report). **Transient in the same sense**: nothing is known
|
|
220
|
+
* to be missing, only unexamined.
|
|
280
221
|
*
|
|
281
222
|
* A consumer that cannot act on the distinction may still print `reference`
|
|
282
223
|
* alone and lose nothing it had before.
|
|
@@ -413,19 +354,16 @@ export type MissingAssetQuery = z.infer<typeof missingAssetQuery>;
|
|
|
413
354
|
* number leaves the caller unable to decide anything.
|
|
414
355
|
*/
|
|
415
356
|
/**
|
|
416
|
-
*
|
|
357
|
+
* What a `busy` refusal on an asset sync has to carry.
|
|
417
358
|
*
|
|
418
|
-
*
|
|
419
|
-
*
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
* id nicht aufgehoben hatte. Genau die Form, die W6b eine ganze Welle lang
|
|
423
|
-
* ausgeräumt hat: ein Abbruch ohne Job-Id, eine Freigabe ohne Session-Id.
|
|
359
|
+
* A refusal that names a **state** — "a sync is already in progress" — and not
|
|
360
|
+
* the **thing** in that state leaves the caller with nothing to look at. The
|
|
361
|
+
* running sync is observable under `GET .../assets/sync/<id>`, but only to
|
|
362
|
+
* someone who kept its id.
|
|
424
363
|
*
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
*
|
|
428
|
-
* gar nichts und braucht den laufenden Sync im ersten `GET`.
|
|
364
|
+
* These details serve the caller that presses the button again. A client that
|
|
365
|
+
* reloads instead presses nothing, which is why `active_sync` sits on the
|
|
366
|
+
* asset list as well.
|
|
429
367
|
*/
|
|
430
368
|
export declare const assetSyncBusyDetails: z.ZodObject<{
|
|
431
369
|
sync_id: z.ZodUUID;
|