@fleetless/contracts 13.2.0 → 14.0.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 (100) hide show
  1. package/CHANGELOG.md +169 -0
  2. package/artifacts/openapi.json +2092 -787
  3. package/artifacts/routes.json +229 -230
  4. package/artifacts/schema/access-warning.schema.json +51 -0
  5. package/artifacts/schema/action-config.schema.json +35 -0
  6. package/artifacts/schema/app-access-response.schema.json +136 -0
  7. package/artifacts/schema/app-access.schema.json +80 -0
  8. package/artifacts/schema/app-auth-config.schema.json +15 -0
  9. package/artifacts/schema/app-deletion-summary.schema.json +0 -7
  10. package/artifacts/schema/app-invitation-list-response.schema.json +13 -6
  11. package/artifacts/schema/app-invitation.schema.json +5 -5
  12. package/artifacts/schema/app-list-response.schema.json +6 -6
  13. package/artifacts/schema/app-lock.schema.json +30 -0
  14. package/artifacts/schema/app-user-list-response.schema.json +13 -6
  15. package/artifacts/schema/app-user.schema.json +13 -6
  16. package/artifacts/schema/app.schema.json +6 -6
  17. package/artifacts/schema/auth-ok.schema.json +20 -6
  18. package/artifacts/schema/camera-list-response.schema.json +1 -1
  19. package/artifacts/schema/client-identity.schema.json +21 -6
  20. package/artifacts/schema/cloud-config.schema.json +359 -5
  21. package/artifacts/schema/config-draft-response.schema.json +389 -5
  22. package/artifacts/schema/config-version-response.schema.json +389 -5
  23. package/artifacts/schema/config-versions-response.schema.json +30 -0
  24. package/artifacts/schema/create-app-invitation-request.schema.json +4 -4
  25. package/artifacts/schema/create-app-user-request.schema.json +4 -4
  26. package/artifacts/schema/create-org-role-request.schema.json +33 -0
  27. package/artifacts/schema/dangling-reference.schema.json +129 -0
  28. package/artifacts/schema/datapoint-config.schema.json +35 -0
  29. package/artifacts/schema/datapoint-list-response.schema.json +1 -1
  30. package/artifacts/schema/effective-capability.schema.json +104 -0
  31. package/artifacts/schema/effective-rights-query.schema.json +19 -0
  32. package/artifacts/schema/effective-rights-response.schema.json +310 -0
  33. package/artifacts/schema/effective-robot-rights.schema.json +266 -0
  34. package/artifacts/schema/invoke-or-service-response.schema.json +1 -1
  35. package/artifacts/schema/invoke-response.schema.json +1 -1
  36. package/artifacts/schema/journal-intent-v2-body.schema.json +74 -0
  37. package/artifacts/schema/journal-intent-v2.schema.json +84 -0
  38. package/artifacts/schema/journal-replay-receipt-body.schema.json +1 -0
  39. package/artifacts/schema/journal-replay-receipt.schema.json +1 -0
  40. package/artifacts/schema/mcp-robot-datasheet.schema.json +2 -2
  41. package/artifacts/schema/org-role-list-response.schema.json +205 -0
  42. package/artifacts/schema/org-role.schema.json +59 -0
  43. package/artifacts/schema/patch-app-user-request.schema.json +4 -4
  44. package/artifacts/schema/patch-org-role-request.schema.json +38 -0
  45. package/artifacts/schema/publish-config-response.schema.json +48 -1
  46. package/artifacts/schema/publisher-config.schema.json +35 -0
  47. package/artifacts/schema/put-role-defaults-request.schema.json +127 -0
  48. package/artifacts/schema/reference-place.schema.json +111 -0
  49. package/artifacts/schema/rename-slug-response.schema.json +4 -3
  50. package/artifacts/schema/robot-config-doc.schema.json +359 -5
  51. package/artifacts/schema/role-cycle-details.schema.json +18 -0
  52. package/artifacts/schema/role-defaults-response.schema.json +59 -0
  53. package/artifacts/schema/role-rename-preview.schema.json +146 -0
  54. package/artifacts/schema/service-config.schema.json +35 -0
  55. package/artifacts/schema/slug-usage-response.schema.json +4 -3
  56. package/artifacts/schema/update-app-request.schema.json +0 -12
  57. package/dist/app-users.d.ts +30 -10
  58. package/dist/app-users.js +32 -12
  59. package/dist/apps.d.ts +242 -71
  60. package/dist/apps.js +205 -151
  61. package/dist/audit.d.ts +3 -3
  62. package/dist/billing.d.ts +10 -10
  63. package/dist/client-auth.d.ts +5 -2
  64. package/dist/client-auth.js +11 -3
  65. package/dist/client-robots.d.ts +1 -1
  66. package/dist/client-robots.js +1 -1
  67. package/dist/common.d.ts +1 -1
  68. package/dist/common.js +1 -1
  69. package/dist/config-issues.d.ts +1 -1
  70. package/dist/config-issues.js +1 -1
  71. package/dist/config.d.ts +77 -11
  72. package/dist/config.js +108 -14
  73. package/dist/errors.d.ts +14 -5
  74. package/dist/errors.js +37 -24
  75. package/dist/index.d.ts +22 -12
  76. package/dist/index.js +16 -6
  77. package/dist/journal-intents.d.ts +30 -0
  78. package/dist/journal-intents.js +3 -0
  79. package/dist/legal-acceptances.d.ts +2 -2
  80. package/dist/mcp.d.ts +5 -37
  81. package/dist/mcp.js +4 -14
  82. package/dist/org-roles.d.ts +182 -0
  83. package/dist/org-roles.js +198 -0
  84. package/dist/plans.d.ts +6 -6
  85. package/dist/protocol.d.ts +19 -1
  86. package/dist/realtime.d.ts +6 -3
  87. package/dist/realtime.js +1 -1
  88. package/dist/rest.d.ts +104 -25
  89. package/dist/rest.js +67 -29
  90. package/dist/rights.d.ts +197 -0
  91. package/dist/rights.js +396 -0
  92. package/dist/routes.js +190 -148
  93. package/package.json +1 -1
  94. package/artifacts/schema/mcp-role-preview-response.schema.json +0 -134
  95. package/artifacts/schema/role-delete-query.schema.json +0 -13
  96. package/artifacts/schema/role-in-use-details.schema.json +0 -28
  97. package/artifacts/schema/role-list-response.schema.json +0 -48
  98. package/artifacts/schema/role-permissions.schema.json +0 -61
  99. package/artifacts/schema/role-rename-request.schema.json +0 -16
  100. package/artifacts/schema/role.schema.json +0 -35
package/dist/rest.d.ts CHANGED
@@ -244,6 +244,22 @@ export declare const robotDetailResponse: z.ZodObject<{
244
244
  created_at: z.ZodISODateTime;
245
245
  }, z.core.$strip>;
246
246
  export type RobotDetailResponse = z.infer<typeof robotDetailResponse>;
247
+ /**
248
+ * **Who did it**: a console team member, by the name the team sees.
249
+ *
250
+ * `name` is the member's display name, or the local part of the member's email
251
+ * address when the member has set none. It is never an email address, so
252
+ * a response that carries authors can be shown to everyone who can read
253
+ * the configuration. `id` is the member's id, stable across renames.
254
+ *
255
+ * A member who has since been removed has no name to show, so the author is
256
+ * `null` wherever this shape is nullable.
257
+ */
258
+ export declare const configAuthor: z.ZodObject<{
259
+ id: z.ZodUUID;
260
+ name: z.ZodString;
261
+ }, z.core.$strip>;
262
+ export type ConfigAuthor = z.infer<typeof configAuthor>;
247
263
  /**
248
264
  * The editable configuration. `issues` is recomputed on every read and
249
265
  * write, so the editor never has to guess whether it may publish.
@@ -318,6 +334,7 @@ export declare const configDraftResponse: z.ZodObject<{
318
334
  name: z.ZodOptional<z.ZodString>;
319
335
  enabled: z.ZodOptional<z.ZodBoolean>;
320
336
  }, z.core.$strict>>>;
337
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
321
338
  }, z.core.$strict>>>;
322
339
  actions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
323
340
  ros_name: z.ZodString;
@@ -349,6 +366,7 @@ export declare const configDraftResponse: z.ZodObject<{
349
366
  description: z.ZodOptional<z.ZodString>;
350
367
  }, z.core.$strict>>>;
351
368
  description: z.ZodOptional<z.ZodString>;
369
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
352
370
  }, z.core.$strict>>>;
353
371
  services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
354
372
  ros_name: z.ZodString;
@@ -380,6 +398,7 @@ export declare const configDraftResponse: z.ZodObject<{
380
398
  description: z.ZodOptional<z.ZodString>;
381
399
  }, z.core.$strict>>>;
382
400
  description: z.ZodOptional<z.ZodString>;
401
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
383
402
  }, z.core.$strict>>>;
384
403
  publishers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
385
404
  topic: z.ZodString;
@@ -416,6 +435,7 @@ export declare const configDraftResponse: z.ZodObject<{
416
435
  }, z.core.$strict>;
417
436
  quiet_timeout_ms: z.ZodNumber;
418
437
  description: z.ZodOptional<z.ZodString>;
438
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
419
439
  }, z.core.$strict>>>;
420
440
  cameras: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
421
441
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -450,12 +470,26 @@ export declare const configDraftResponse: z.ZodObject<{
450
470
  bitrate_kbps: z.ZodNumber;
451
471
  snapshot_interval_seconds: z.ZodNumber;
452
472
  description: z.ZodOptional<z.ZodString>;
473
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
453
474
  }, z.core.$strict>>>;
475
+ access: z.ZodOptional<z.ZodObject<{
476
+ rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
477
+ match: z.ZodString;
478
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
479
+ read: "read";
480
+ invoke: "invoke";
481
+ publish: "publish";
482
+ }>>>;
483
+ role: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
484
+ }, z.core.$strict>>>;
485
+ assets: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
486
+ job_history: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
487
+ }, z.core.$strict>>;
454
488
  low_bandwidth: z.ZodOptional<z.ZodObject<{
455
489
  mode: z.ZodOptional<z.ZodEnum<{
456
- off: "off";
457
490
  auto: "auto";
458
491
  on: "on";
492
+ off: "off";
459
493
  }>>;
460
494
  enter_lag_ms: z.ZodOptional<z.ZodNumber>;
461
495
  enter_after_s: z.ZodOptional<z.ZodNumber>;
@@ -471,6 +505,10 @@ export declare const configDraftResponse: z.ZodObject<{
471
505
  }, z.core.$strict>>;
472
506
  source: z.ZodString;
473
507
  updated_at: z.ZodNullable<z.ZodISODateTime>;
508
+ updated_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
509
+ id: z.ZodUUID;
510
+ name: z.ZodString;
511
+ }, z.core.$strip>>>;
474
512
  issues: z.ZodArray<z.ZodObject<{
475
513
  path: z.ZodString;
476
514
  slug: z.ZodNullable<z.ZodString>;
@@ -510,12 +548,26 @@ export type PutConfigDraftRequest = z.infer<typeof putConfigDraftRequest>;
510
548
  export declare const publishConfigResponse: z.ZodObject<{
511
549
  version: z.ZodNumber;
512
550
  published_at: z.ZodISODateTime;
551
+ warnings: z.ZodArray<z.ZodObject<{
552
+ path: z.ZodString;
553
+ slug: z.ZodNullable<z.ZodString>;
554
+ code: z.ZodString;
555
+ message: z.ZodString;
556
+ severity: z.ZodEnum<{
557
+ error: "error";
558
+ warning: "warning";
559
+ }>;
560
+ }, z.core.$strip>>;
513
561
  }, z.core.$strip>;
514
562
  export type PublishConfigResponse = z.infer<typeof publishConfigResponse>;
515
563
  export declare const configVersionsResponse: z.ZodObject<{
516
564
  versions: z.ZodArray<z.ZodObject<{
517
565
  version: z.ZodNumber;
518
566
  published_at: z.ZodISODateTime;
567
+ published_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
568
+ id: z.ZodUUID;
569
+ name: z.ZodString;
570
+ }, z.core.$strip>>>;
519
571
  }, z.core.$strip>>;
520
572
  }, z.core.$strip>;
521
573
  export type ConfigVersionsResponse = z.infer<typeof configVersionsResponse>;
@@ -530,6 +582,10 @@ export type ConfigVersionsResponse = z.infer<typeof configVersionsResponse>;
530
582
  export declare const configVersionResponse: z.ZodObject<{
531
583
  version: z.ZodNumber;
532
584
  published_at: z.ZodISODateTime;
585
+ published_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
586
+ id: z.ZodUUID;
587
+ name: z.ZodString;
588
+ }, z.core.$strip>>>;
533
589
  doc: z.ZodObject<{
534
590
  fleetless: z.ZodLiteral<1>;
535
591
  messages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -572,6 +628,7 @@ export declare const configVersionResponse: z.ZodObject<{
572
628
  name: z.ZodOptional<z.ZodString>;
573
629
  enabled: z.ZodOptional<z.ZodBoolean>;
574
630
  }, z.core.$strict>>>;
631
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
575
632
  }, z.core.$strict>>>;
576
633
  actions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
577
634
  ros_name: z.ZodString;
@@ -603,6 +660,7 @@ export declare const configVersionResponse: z.ZodObject<{
603
660
  description: z.ZodOptional<z.ZodString>;
604
661
  }, z.core.$strict>>>;
605
662
  description: z.ZodOptional<z.ZodString>;
663
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
606
664
  }, z.core.$strict>>>;
607
665
  services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
608
666
  ros_name: z.ZodString;
@@ -634,6 +692,7 @@ export declare const configVersionResponse: z.ZodObject<{
634
692
  description: z.ZodOptional<z.ZodString>;
635
693
  }, z.core.$strict>>>;
636
694
  description: z.ZodOptional<z.ZodString>;
695
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
637
696
  }, z.core.$strict>>>;
638
697
  publishers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
639
698
  topic: z.ZodString;
@@ -670,6 +729,7 @@ export declare const configVersionResponse: z.ZodObject<{
670
729
  }, z.core.$strict>;
671
730
  quiet_timeout_ms: z.ZodNumber;
672
731
  description: z.ZodOptional<z.ZodString>;
732
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
673
733
  }, z.core.$strict>>>;
674
734
  cameras: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
675
735
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -704,12 +764,26 @@ export declare const configVersionResponse: z.ZodObject<{
704
764
  bitrate_kbps: z.ZodNumber;
705
765
  snapshot_interval_seconds: z.ZodNumber;
706
766
  description: z.ZodOptional<z.ZodString>;
767
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
707
768
  }, z.core.$strict>>>;
769
+ access: z.ZodOptional<z.ZodObject<{
770
+ rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
771
+ match: z.ZodString;
772
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
773
+ read: "read";
774
+ invoke: "invoke";
775
+ publish: "publish";
776
+ }>>>;
777
+ role: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
778
+ }, z.core.$strict>>>;
779
+ assets: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
780
+ job_history: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
781
+ }, z.core.$strict>>;
708
782
  low_bandwidth: z.ZodOptional<z.ZodObject<{
709
783
  mode: z.ZodOptional<z.ZodEnum<{
710
- off: "off";
711
784
  auto: "auto";
712
785
  on: "on";
786
+ off: "off";
713
787
  }>>;
714
788
  enter_lag_ms: z.ZodOptional<z.ZodNumber>;
715
789
  enter_after_s: z.ZodOptional<z.ZodNumber>;
@@ -982,7 +1056,7 @@ export type ServiceCallResponse = z.infer<typeof serviceCallResponse>;
982
1056
  * shapes.**
983
1057
  *
984
1058
  * One route serves both kinds, because a path segment naming the kind would
985
- * demand a fact a role grant does not carry. **The slug's kind decides, and
1059
+ * demand a fact the rights model does not carry. **The slug's kind decides, and
986
1060
  * nothing in the request does**: an *action* answers `202` with an
987
1061
  * `invokeResponse` the moment the job exists, a *service* answers `200` with
988
1062
  * a `serviceCallResponse` once the result is in. They differ only in what the
@@ -1179,11 +1253,12 @@ export declare const robotJobsResponse: z.ZodObject<{
1179
1253
  }, z.core.$strip>;
1180
1254
  export type RobotJobsResponse = z.infer<typeof robotJobsResponse>;
1181
1255
  /**
1182
- * Every slug of a robot that a role can be granted, **with its kind**.
1256
+ * Every slug of a robot that a role can be required to use or an app can lock,
1257
+ * **with its kind**.
1183
1258
  *
1184
- * A roles matrix built against the datapoint list alone cannot grant an
1185
- * action, a service or a publisher. One list that names every kind, with its
1186
- * kind, is what a matrix needs.
1259
+ * A rights view built against the datapoint list alone cannot show an action,
1260
+ * a service or a publisher. One list that names every kind, with its kind, is
1261
+ * what such a view needs.
1187
1262
  */
1188
1263
  export declare const exposure: z.ZodObject<{
1189
1264
  slug: z.ZodString;
@@ -1626,8 +1701,8 @@ export declare const resourceHealthState: z.ZodObject<{
1626
1701
  }>;
1627
1702
  ref: z.ZodString;
1628
1703
  facet: z.ZodEnum<{
1629
- source: "source";
1630
1704
  publish: "publish";
1705
+ source: "source";
1631
1706
  }>;
1632
1707
  state: z.ZodEnum<{
1633
1708
  unknown: "unknown";
@@ -1659,8 +1734,8 @@ export declare const resourceHealthListResponse: z.ZodObject<{
1659
1734
  }>;
1660
1735
  ref: z.ZodString;
1661
1736
  facet: z.ZodEnum<{
1662
- source: "source";
1663
1737
  publish: "publish";
1738
+ source: "source";
1664
1739
  }>;
1665
1740
  state: z.ZodEnum<{
1666
1741
  unknown: "unknown";
@@ -1788,11 +1863,12 @@ export declare const BRIDGE_LATENCY_RETENTION_DAYS = 7;
1788
1863
  * `GET /api/robots/:id/jobs/history`** — robot-scoped, one route for
1789
1864
  * developers and clients like every other robot-scoped read (`.../jobs`,
1790
1865
  * `.../assets`, `.../datapoints`), never a parallel `/api/client/…` twin. An
1791
- * end user reaches it only when their role's `capabilities.action_history`
1792
- * says so — otherwise `403 capability_required`, naming the capability — and
1793
- * sees only runs on slugs their role grants. On this route `?robot_id=` is
1794
- * not a filter: the path already names the robot, and a query naming a
1795
- * different one is refused rather than quietly answered about the path's.
1866
+ * end user reaches it only when their role satisfies the robot's
1867
+ * `job_history` requirement — otherwise `403 capability_required`, naming the
1868
+ * capability — and sees only runs on slugs their role may use. On this route
1869
+ * `?robot_id=` is not a filter: the path already names the robot, and a query
1870
+ * naming a different one is refused rather than quietly answered about the
1871
+ * path's.
1796
1872
  *
1797
1873
  * **It discloses the actor, and that is what a developer weighs before
1798
1874
  * granting the capability.** A `jobRun` names who invoked it — `jobActor`
@@ -2058,20 +2134,21 @@ export declare const patchRobotRequest: z.ZodObject<{
2058
2134
  export type PatchRobotRequest = z.infer<typeof patchRobotRequest>;
2059
2135
  /**
2060
2136
  * `POST /api/robots/:id/config/rename-slug` — atomic server-side rename:
2061
- * rewrites the **draft** config and every app-role grant carrying
2137
+ * rewrites the **draft** config and every app lock naming
2062
2138
  * `{robot_id, from}`, and moves the recorded history with the name, in one
2063
2139
  * transaction, without rewriting stored samples. Job runs and audit events
2064
2140
  * keep the old slug as historical fact. The published config is immutable,
2065
2141
  * so the caller must publish afterwards (`requires_publish`); samples the
2066
2142
  * robot sends under the old slug between the rename and the publish join the
2067
2143
  * renamed history.
2068
- * One residual remains in that same window: grants and the draft already name
2069
- * `to`, but the still-published config exposes only `from` until the
2070
- * publish lands — an end user's app has no working name for the datapoint
2071
- * at all for however long that gap lasts, since `to` isn't published yet
2072
- * and `from` no longer has a grant behind it. The console must publish
2073
- * immediately after a rename to keep this window short; nothing server-side
2074
- * closes it.
2144
+ *
2145
+ * **Locks follow the rename, and keep the old name.** A lock that lists
2146
+ * `from` lists `to` as well afterwards: until the publish lands, the
2147
+ * published config still exposes only `from`, and dropping it from the lock
2148
+ * would open the capability in that gap. Once the publish has landed, the old
2149
+ * name is an `unknown_lock_slug` warning in the app's access and is removed
2150
+ * with its next `PUT`. A rename that would push a lock past the most slugs
2151
+ * one lock can hold is refused and writes nothing.
2075
2152
  * This schema only enforces slug *shape*; whether `to` is reserved or
2076
2153
  * already in use on this robot is checked once, behind the cloud's
2077
2154
  * `validation.ts` door — one door, not a second copy of that rule here.
@@ -2082,7 +2159,7 @@ export declare const renameSlugRequest: z.ZodObject<{
2082
2159
  }, z.core.$strict>;
2083
2160
  export type RenameSlugRequest = z.infer<typeof renameSlugRequest>;
2084
2161
  export declare const renameSlugResponse: z.ZodObject<{
2085
- rewritten_grants: z.ZodNumber;
2162
+ rewritten_locks: z.ZodNumber;
2086
2163
  history_moved: z.ZodBoolean;
2087
2164
  requires_publish: z.ZodLiteral<true>;
2088
2165
  }, z.core.$strip>;
@@ -2091,13 +2168,15 @@ export type RenameSlugResponse = z.infer<typeof renameSlugResponse>;
2091
2168
  * `GET /api/robots/:id/config/slug-usage/:slug` — what a rename would touch;
2092
2169
  * feeds the console's confirm dialog.
2093
2170
  *
2094
- * `alert_count` is part of the atomic rename transaction alongside grants and
2171
+ * `alert_count` is part of the atomic rename transaction alongside locks and
2095
2172
  * history: alerts are keyed by `(robot_id, slug)` too, and a rename that
2096
2173
  * silently moved the alert row while the usage preview stayed silent about it
2097
2174
  * would show a developer a smaller blast radius than the rename actually has.
2175
+ * `lock_count` is the same promise for the locks: it counts every lock the
2176
+ * rename would rewrite.
2098
2177
  */
2099
2178
  export declare const slugUsageResponse: z.ZodObject<{
2100
- grant_count: z.ZodNumber;
2179
+ lock_count: z.ZodNumber;
2101
2180
  app_identifiers: z.ZodArray<z.ZodString>;
2102
2181
  has_recorded_history: z.ZodBoolean;
2103
2182
  alert_count: z.ZodNumber;
package/dist/rest.js CHANGED
@@ -174,6 +174,23 @@ export const robotDetailResponse = z.object({
174
174
  .nullable(),
175
175
  config: configState,
176
176
  });
177
+ /**
178
+ * **Who did it**: a console team member, by the name the team sees.
179
+ *
180
+ * `name` is the member's display name, or the local part of the member's email
181
+ * address when the member has set none. It is never an email address, so
182
+ * a response that carries authors can be shown to everyone who can read
183
+ * the configuration. `id` is the member's id, stable across renames.
184
+ *
185
+ * A member who has since been removed has no name to show, so the author is
186
+ * `null` wherever this shape is nullable.
187
+ */
188
+ export const configAuthor = z.object({
189
+ id: z.uuid().meta({ description: 'The team member\'s id.' }),
190
+ name: z.string().min(1).max(200).meta({
191
+ description: 'The member\'s display name, or the local part of the email address when the member has none. Never a full email address.',
192
+ }),
193
+ });
177
194
  /**
178
195
  * The editable configuration. `issues` is recomputed on every read and
179
196
  * write, so the editor never has to guess whether it may publish.
@@ -209,6 +226,9 @@ export const configDraftResponse = z.object({
209
226
  doc: robotConfigDoc.nullable(),
210
227
  source: z.string(),
211
228
  updated_at: z.iso.datetime().nullable(),
229
+ updated_by: configAuthor.nullable().optional().meta({
230
+ description: 'Who saved the draft last. `null` when nobody has saved it yet, when the cloud itself rewrote it (a slug rename), when the member has since been removed, or when the draft is older than this field. Absent when the server predates this field: read an absent field as unknown, the same as `null`. The cloud always sends it.',
231
+ }),
212
232
  issues: z.array(validationIssue),
213
233
  });
214
234
  /**
@@ -235,11 +255,17 @@ export const putConfigDraftRequest = z.object({ source: z.string().max(1_000_000
235
255
  export const publishConfigResponse = z.object({
236
256
  version: z.number().int().positive(),
237
257
  published_at: z.iso.datetime(),
258
+ warnings: z.array(validationIssue).meta({
259
+ description: 'Every `warning` of the published document — an unknown topic, a role key that names no role of the organization, a rule that fits nothing. A warning never blocks a publish; it is here so the author does not have to go looking for it. `[]` for a document with none.',
260
+ }),
238
261
  });
239
262
  export const configVersionsResponse = z.object({
240
263
  versions: z.array(z.object({
241
264
  version: z.number().int().positive(),
242
265
  published_at: z.iso.datetime(),
266
+ published_by: configAuthor.nullable().optional().meta({
267
+ description: 'Who published the version. `null` when the member has since been removed, or when the version is older than this field. Absent when the server predates this field: read an absent field as unknown, the same as `null`. The cloud always sends it.',
268
+ }),
243
269
  })),
244
270
  });
245
271
  /**
@@ -253,6 +279,9 @@ export const configVersionsResponse = z.object({
253
279
  export const configVersionResponse = z.object({
254
280
  version: z.number().int().positive(),
255
281
  published_at: z.iso.datetime(),
282
+ published_by: configAuthor.nullable().optional().meta({
283
+ description: 'Who published the version. `null` when the member has since been removed, or when the version is older than this field. Absent when the server predates this field: read an absent field as unknown, the same as `null`. The cloud always sends it.',
284
+ }),
256
285
  doc: robotConfigDoc,
257
286
  source: z.string(),
258
287
  });
@@ -307,7 +336,7 @@ export const datapointDescriptor = z.object({
307
336
  });
308
337
  export const datapointListResponse = z.object({
309
338
  datapoints: z.array(datapointDescriptor).meta({
310
- description: 'Everything a client may read on this robot: the two built-ins, plus every datapoint the published configuration exposes and the caller\'s role grants.',
339
+ description: 'Everything a client may read on this robot: the two built-ins, plus every datapoint the published configuration exposes and the caller\'s role may read.',
311
340
  }),
312
341
  });
313
342
  /**
@@ -323,7 +352,7 @@ export const putRobotDetailsResponse = z.object({
323
352
  });
324
353
  export const putRobotDetailsRequest = z.object({ details: robotDetailsDoc });
325
354
  /* ------------------------------------------------------------------------
326
- * The command surface, and what a role may be granted.
355
+ * The command surface, and what a role may be required to use.
327
356
  *
328
357
  * The routes, written down because cloud, console and SDK each need them and
329
358
  * a body schema does not imply a path:
@@ -338,9 +367,9 @@ export const putRobotDetailsRequest = z.object({ details: robotDetailsDoc });
338
367
  * | `GET /api/robots/:id/exposures` | — | `exposureListResponse` |
339
368
  *
340
369
  * **Commands are addressed by slug, never by kind.** Slugs are one namespace
341
- * across all kinds and a role grant is `{robot, slug}` with no kind in
342
- * it — so a path segment naming the kind would demand a fact the permission
343
- * model deliberately does not carry. The cloud already knows from the
370
+ * across all kinds, and a requirement, a rule and a lock all name a slug
371
+ * with no kind in it — so a path segment naming the kind would demand a fact
372
+ * the rights model deliberately does not carry. The cloud already knows from the
344
373
  * published configuration whether a slug is an action or a service; a caller
345
374
  * who wants to know asks `/exposures`.
346
375
  *
@@ -462,7 +491,7 @@ export const invokeResponse = z.object({
462
491
  }),
463
492
  /** The slug's kind — see `commandResult.kind` for why the caller needs it. */
464
493
  kind: z.enum(['action', 'service']).meta({
465
- description: 'Always `action` in this shape. A caller sends the same request for both kinds and cannot tell from a role grant which it invoked, so the answer says which it was rather than leaving it to be inferred from the shape.',
494
+ description: 'Always `action` in this shape. A caller sends the same request for both kinds and cannot tell from the slug alone which it invoked, so the answer says which it was rather than leaving it to be inferred from the shape.',
466
495
  }),
467
496
  });
468
497
  /** A service call answers with its result directly — no job to observe. */
@@ -476,7 +505,7 @@ export const serviceCallResponse = z.object({
476
505
  * shapes.**
477
506
  *
478
507
  * One route serves both kinds, because a path segment naming the kind would
479
- * demand a fact a role grant does not carry. **The slug's kind decides, and
508
+ * demand a fact the rights model does not carry. **The slug's kind decides, and
480
509
  * nothing in the request does**: an *action* answers `202` with an
481
510
  * `invokeResponse` the moment the job exists, a *service* answers `200` with
482
511
  * a `serviceCallResponse` once the result is in. They differ only in what the
@@ -655,7 +684,7 @@ export const jobResponse = z.object({
655
684
  * audience the asset store exists for.
656
685
  *
657
686
  * So: a developer reaches the robot because it belongs to their org; an end
658
- * user reaches it when their role grants `assets`.
687
+ * user reaches it when their role satisfies the robot's `assets` requirement.
659
688
  *
660
689
  * **The rewritten mesh URIs in a served URDF are absolute, not
661
690
  * root-relative.** A relative URL resolves against *the consumer's* origin,
@@ -763,11 +792,12 @@ export const robotJobsResponse = z.object({
763
792
  }),
764
793
  });
765
794
  /**
766
- * Every slug of a robot that a role can be granted, **with its kind**.
795
+ * Every slug of a robot that a role can be required to use or an app can lock,
796
+ * **with its kind**.
767
797
  *
768
- * A roles matrix built against the datapoint list alone cannot grant an
769
- * action, a service or a publisher. One list that names every kind, with its
770
- * kind, is what a matrix needs.
798
+ * A rights view built against the datapoint list alone cannot show an action,
799
+ * a service or a publisher. One list that names every kind, with its kind, is
800
+ * what such a view needs.
771
801
  */
772
802
  export const exposure = z.object({
773
803
  slug,
@@ -904,7 +934,7 @@ export const cameraDescriptor = z.object({
904
934
  });
905
935
  export const cameraListResponse = z.object({
906
936
  cameras: z.array(cameraDescriptor).meta({
907
- description: 'Every camera the published configuration exposes on this robot **and** the caller\'s role grants. A developer sees all of them; an end user sees what their role allows.',
937
+ description: 'Every camera the published configuration exposes on this robot **and** the caller\'s role may use. A developer sees all of them; an end user sees what their role allows.',
908
938
  }),
909
939
  });
910
940
  /**
@@ -1593,11 +1623,12 @@ export const BRIDGE_LATENCY_RETENTION_DAYS = 7;
1593
1623
  * `GET /api/robots/:id/jobs/history`** — robot-scoped, one route for
1594
1624
  * developers and clients like every other robot-scoped read (`.../jobs`,
1595
1625
  * `.../assets`, `.../datapoints`), never a parallel `/api/client/…` twin. An
1596
- * end user reaches it only when their role's `capabilities.action_history`
1597
- * says so — otherwise `403 capability_required`, naming the capability — and
1598
- * sees only runs on slugs their role grants. On this route `?robot_id=` is
1599
- * not a filter: the path already names the robot, and a query naming a
1600
- * different one is refused rather than quietly answered about the path's.
1626
+ * end user reaches it only when their role satisfies the robot's
1627
+ * `job_history` requirement — otherwise `403 capability_required`, naming the
1628
+ * capability — and sees only runs on slugs their role may use. On this route
1629
+ * `?robot_id=` is not a filter: the path already names the robot, and a query
1630
+ * naming a different one is refused rather than quietly answered about the
1631
+ * path's.
1601
1632
  *
1602
1633
  * **It discloses the actor, and that is what a developer weighs before
1603
1634
  * granting the capability.** A `jobRun` names who invoked it — `jobActor`
@@ -1867,27 +1898,30 @@ export const orgUsageResponse = z.object({
1867
1898
  export const patchRobotRequest = z.object({ name: z.string().min(1).max(63) }).strict();
1868
1899
  /**
1869
1900
  * `POST /api/robots/:id/config/rename-slug` — atomic server-side rename:
1870
- * rewrites the **draft** config and every app-role grant carrying
1901
+ * rewrites the **draft** config and every app lock naming
1871
1902
  * `{robot_id, from}`, and moves the recorded history with the name, in one
1872
1903
  * transaction, without rewriting stored samples. Job runs and audit events
1873
1904
  * keep the old slug as historical fact. The published config is immutable,
1874
1905
  * so the caller must publish afterwards (`requires_publish`); samples the
1875
1906
  * robot sends under the old slug between the rename and the publish join the
1876
1907
  * renamed history.
1877
- * One residual remains in that same window: grants and the draft already name
1878
- * `to`, but the still-published config exposes only `from` until the
1879
- * publish lands — an end user's app has no working name for the datapoint
1880
- * at all for however long that gap lasts, since `to` isn't published yet
1881
- * and `from` no longer has a grant behind it. The console must publish
1882
- * immediately after a rename to keep this window short; nothing server-side
1883
- * closes it.
1908
+ *
1909
+ * **Locks follow the rename, and keep the old name.** A lock that lists
1910
+ * `from` lists `to` as well afterwards: until the publish lands, the
1911
+ * published config still exposes only `from`, and dropping it from the lock
1912
+ * would open the capability in that gap. Once the publish has landed, the old
1913
+ * name is an `unknown_lock_slug` warning in the app's access and is removed
1914
+ * with its next `PUT`. A rename that would push a lock past the most slugs
1915
+ * one lock can hold is refused and writes nothing.
1884
1916
  * This schema only enforces slug *shape*; whether `to` is reserved or
1885
1917
  * already in use on this robot is checked once, behind the cloud's
1886
1918
  * `validation.ts` door — one door, not a second copy of that rule here.
1887
1919
  */
1888
1920
  export const renameSlugRequest = z.object({ from: slug, to: slug }).strict();
1889
1921
  export const renameSlugResponse = z.object({
1890
- rewritten_grants: z.number().int().nonnegative(),
1922
+ rewritten_locks: z.number().int().nonnegative().meta({
1923
+ description: 'The app locks that listed the old slug and now list the new one as well. Locks follow a rename, in every app of the organization, so a renamed capability stays locked.',
1924
+ }),
1891
1925
  history_moved: z.boolean(),
1892
1926
  requires_publish: z.literal(true)
1893
1927
  });
@@ -1895,13 +1929,17 @@ export const renameSlugResponse = z.object({
1895
1929
  * `GET /api/robots/:id/config/slug-usage/:slug` — what a rename would touch;
1896
1930
  * feeds the console's confirm dialog.
1897
1931
  *
1898
- * `alert_count` is part of the atomic rename transaction alongside grants and
1932
+ * `alert_count` is part of the atomic rename transaction alongside locks and
1899
1933
  * history: alerts are keyed by `(robot_id, slug)` too, and a rename that
1900
1934
  * silently moved the alert row while the usage preview stayed silent about it
1901
1935
  * would show a developer a smaller blast radius than the rename actually has.
1936
+ * `lock_count` is the same promise for the locks: it counts every lock the
1937
+ * rename would rewrite.
1902
1938
  */
1903
1939
  export const slugUsageResponse = z.object({
1904
- grant_count: z.number().int().nonnegative(),
1940
+ lock_count: z.number().int().nonnegative().meta({
1941
+ description: 'The app locks that list this slug, which a rename would extend with the new name. The count is what the rename rewrites, in every app of the organization.',
1942
+ }),
1905
1943
  app_identifiers: z.array(z.string()),
1906
1944
  has_recorded_history: z.boolean(),
1907
1945
  alert_count: z.number().int().nonnegative(),