@fleetless/contracts 13.3.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 (98) hide show
  1. package/CHANGELOG.md +141 -0
  2. package/artifacts/openapi.json +1983 -784
  3. package/artifacts/routes.json +224 -208
  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-deletion-summary.schema.json +0 -7
  9. package/artifacts/schema/app-invitation-list-response.schema.json +13 -6
  10. package/artifacts/schema/app-invitation.schema.json +5 -5
  11. package/artifacts/schema/app-list-response.schema.json +6 -6
  12. package/artifacts/schema/app-lock.schema.json +30 -0
  13. package/artifacts/schema/app-user-list-response.schema.json +13 -6
  14. package/artifacts/schema/app-user.schema.json +13 -6
  15. package/artifacts/schema/app.schema.json +6 -6
  16. package/artifacts/schema/auth-ok.schema.json +20 -6
  17. package/artifacts/schema/camera-list-response.schema.json +1 -1
  18. package/artifacts/schema/client-identity.schema.json +21 -6
  19. package/artifacts/schema/cloud-config.schema.json +359 -5
  20. package/artifacts/schema/config-draft-response.schema.json +359 -5
  21. package/artifacts/schema/config-version-response.schema.json +359 -5
  22. package/artifacts/schema/create-app-invitation-request.schema.json +4 -4
  23. package/artifacts/schema/create-app-user-request.schema.json +4 -4
  24. package/artifacts/schema/create-org-role-request.schema.json +33 -0
  25. package/artifacts/schema/dangling-reference.schema.json +129 -0
  26. package/artifacts/schema/datapoint-config.schema.json +35 -0
  27. package/artifacts/schema/datapoint-list-response.schema.json +1 -1
  28. package/artifacts/schema/effective-capability.schema.json +104 -0
  29. package/artifacts/schema/effective-rights-query.schema.json +19 -0
  30. package/artifacts/schema/effective-rights-response.schema.json +310 -0
  31. package/artifacts/schema/effective-robot-rights.schema.json +266 -0
  32. package/artifacts/schema/invoke-or-service-response.schema.json +1 -1
  33. package/artifacts/schema/invoke-response.schema.json +1 -1
  34. package/artifacts/schema/journal-intent-v2-body.schema.json +74 -0
  35. package/artifacts/schema/journal-intent-v2.schema.json +84 -0
  36. package/artifacts/schema/journal-replay-receipt-body.schema.json +1 -0
  37. package/artifacts/schema/journal-replay-receipt.schema.json +1 -0
  38. package/artifacts/schema/mcp-robot-datasheet.schema.json +2 -2
  39. package/artifacts/schema/org-role-list-response.schema.json +205 -0
  40. package/artifacts/schema/org-role.schema.json +59 -0
  41. package/artifacts/schema/patch-app-user-request.schema.json +4 -4
  42. package/artifacts/schema/patch-org-role-request.schema.json +38 -0
  43. package/artifacts/schema/publish-config-response.schema.json +48 -1
  44. package/artifacts/schema/publisher-config.schema.json +35 -0
  45. package/artifacts/schema/put-role-defaults-request.schema.json +127 -0
  46. package/artifacts/schema/reference-place.schema.json +111 -0
  47. package/artifacts/schema/rename-slug-response.schema.json +4 -3
  48. package/artifacts/schema/robot-config-doc.schema.json +359 -5
  49. package/artifacts/schema/role-cycle-details.schema.json +18 -0
  50. package/artifacts/schema/role-defaults-response.schema.json +59 -0
  51. package/artifacts/schema/role-rename-preview.schema.json +146 -0
  52. package/artifacts/schema/service-config.schema.json +35 -0
  53. package/artifacts/schema/slug-usage-response.schema.json +4 -3
  54. package/artifacts/schema/update-app-request.schema.json +0 -12
  55. package/dist/app-users.d.ts +11 -8
  56. package/dist/app-users.js +18 -10
  57. package/dist/apps.d.ts +242 -71
  58. package/dist/apps.js +205 -151
  59. package/dist/audit.d.ts +3 -3
  60. package/dist/billing.d.ts +10 -10
  61. package/dist/client-auth.d.ts +5 -2
  62. package/dist/client-auth.js +11 -3
  63. package/dist/client-robots.d.ts +1 -1
  64. package/dist/client-robots.js +1 -1
  65. package/dist/common.d.ts +1 -1
  66. package/dist/common.js +1 -1
  67. package/dist/config-issues.d.ts +1 -1
  68. package/dist/config-issues.js +1 -1
  69. package/dist/config.d.ts +77 -11
  70. package/dist/config.js +108 -14
  71. package/dist/errors.d.ts +14 -5
  72. package/dist/errors.js +37 -24
  73. package/dist/index.d.ts +18 -8
  74. package/dist/index.js +14 -4
  75. package/dist/journal-intents.d.ts +30 -0
  76. package/dist/journal-intents.js +3 -0
  77. package/dist/legal-acceptances.d.ts +2 -2
  78. package/dist/mcp.d.ts +5 -37
  79. package/dist/mcp.js +4 -14
  80. package/dist/org-roles.d.ts +182 -0
  81. package/dist/org-roles.js +198 -0
  82. package/dist/plans.d.ts +6 -6
  83. package/dist/protocol.d.ts +19 -1
  84. package/dist/realtime.d.ts +6 -3
  85. package/dist/realtime.js +1 -1
  86. package/dist/rest.d.ts +76 -25
  87. package/dist/rest.js +41 -29
  88. package/dist/rights.d.ts +197 -0
  89. package/dist/rights.js +396 -0
  90. package/dist/routes.js +185 -134
  91. package/package.json +1 -1
  92. package/artifacts/schema/mcp-role-preview-response.schema.json +0 -134
  93. package/artifacts/schema/role-delete-query.schema.json +0 -13
  94. package/artifacts/schema/role-in-use-details.schema.json +0 -28
  95. package/artifacts/schema/role-list-response.schema.json +0 -48
  96. package/artifacts/schema/role-permissions.schema.json +0 -61
  97. package/artifacts/schema/role-rename-request.schema.json +0 -16
  98. package/artifacts/schema/role.schema.json +0 -35
@@ -3,6 +3,7 @@ import { z } from 'zod';
3
3
  import { appIdentifier } from './apps.js';
4
4
  import { APP_USER_DISPLAY_NAME_MAX, appSignInMethods, appTwoFactorPolicy, providerSlug } from './app-users.js';
5
5
  import { loginCode, password, recoveryCode, recoveryCodesList, sessionTokens, totpCode } from './identity.js';
6
+ import { roleKey } from './rights.js';
6
7
  /**
7
8
  * **The client auth API: the whole of what an app user's browser talks to.**
8
9
  *
@@ -565,7 +566,7 @@ export const mcpConsentGrantListResponse = z.object({
565
566
  * client API and appears in the audit as the developer, and the console's own
566
567
  * live views subscribe on `/realtime` as one. A developer is **org-scoped, not
567
568
  * app-scoped** — they own the configuration of every robot in their org — so
568
- * `app_id` and `role_id` are null for them, and roles do not filter what they
569
+ * `app_id` and `role` are null for them, and roles do not filter what they
569
570
  * see. `kind` states this explicitly rather than leaving it to be inferred from
570
571
  * which id happens to be set.
571
572
  *
@@ -598,8 +599,15 @@ export const clientIdentity = z.object({
598
599
  app_id: z.uuid().nullable().meta({
599
600
  description: 'The app this session belongs to, and `null` for a developer — a developer is organisation-scoped and owns the configuration of every robot in the organisation rather than reaching one through an app.',
600
601
  }),
601
- role_id: z.uuid().nullable().meta({
602
- description: 'The role that decides what this caller may reach, and `null` for a developer. Roles are the only visibility filter: what a role does not grant does not exist for that user.',
602
+ role: z.object({
603
+ key: roleKey.meta({
604
+ description: 'The role\'s key, the same string `fleetless.yaml` and the organization\'s role list write.',
605
+ }),
606
+ name: z.string().meta({
607
+ description: 'The role\'s display name, for showing the caller what they hold. Changing it changes nothing about rights.',
608
+ }),
609
+ }).nullable().meta({
610
+ description: 'The organization role that decides what this caller may reach: its key and display name. `null` when there is no role to name: for a developer and for a server key, which are not filtered by a role, and for an app user whose key names no role (the role was deleted), who then reaches nothing.',
603
611
  }),
604
612
  email: z.email().nullable().meta({
605
613
  description: 'The address of the Fleetless user or app user behind this session, and `null` for a server key, which is not a person.',
@@ -7,7 +7,7 @@ import { z } from 'zod';
7
7
  *
8
8
  * Deliberately not `robotListItem`: that one carries `exposes`, the per-kind
9
9
  * counts a developer's list shows, which are a configuration fact rather than
10
- * something an app user's role grants. What an app user is entitled to is the
10
+ * something an app user's role decides. What an app user is entitled to is the
11
11
  * robot, its bridge state, and whether anything is published on it yet.
12
12
  */
13
13
  export declare const clientRobotListItem: z.ZodObject<{
@@ -10,7 +10,7 @@ import { robot } from './rest.js';
10
10
  *
11
11
  * Deliberately not `robotListItem`: that one carries `exposes`, the per-kind
12
12
  * counts a developer's list shows, which are a configuration fact rather than
13
- * something an app user's role grants. What an app user is entitled to is the
13
+ * something an app user's role decides. What an app user is entitled to is the
14
14
  * robot, its bridge state, and whether anything is published on it yet.
15
15
  */
16
16
  export const clientRobotListItem = z.object({
package/dist/common.d.ts CHANGED
@@ -47,7 +47,7 @@ export declare const SLUG_RULE = "A name is lower-case: it starts with a letter,
47
47
  *
48
48
  * Names are stable and decoupled from ROS names — renaming a
49
49
  * topic on the robot must never break a client app. The reverse also holds
50
- * and costs more: changing a name breaks every client, role grant and MCP
50
+ * and costs more: changing a name breaks every client, role rule, app lock and MCP
51
51
  * tool name that uses it.
52
52
  */
53
53
  export declare const slug: z.ZodString;
package/dist/common.js CHANGED
@@ -47,7 +47,7 @@ export const SLUG_RULE = 'A name is lower-case: it starts with a letter, continu
47
47
  *
48
48
  * Names are stable and decoupled from ROS names — renaming a
49
49
  * topic on the robot must never break a client app. The reverse also holds
50
- * and costs more: changing a name breaks every client, role grant and MCP
50
+ * and costs more: changing a name breaks every client, role rule, app lock and MCP
51
51
  * tool name that uses it.
52
52
  */
53
53
  export const slug = z
@@ -36,7 +36,7 @@ export type SchemaIssue = z.core.$ZodIssue;
36
36
  export declare const DOCUMENT_ROOT_PATH = "(document)";
37
37
  /**
38
38
  * The five sections whose keys are slugs — one namespace across all of them,
39
- * which is what lets a role grant say `{robot, slug}` without naming a kind.
39
+ * which is what lets an app lock name `{robot, slug}` without naming a kind.
40
40
  * `messages:` is deliberately not among them: its names are their own
41
41
  * namespace.
42
42
  *
@@ -3,7 +3,7 @@
3
3
  export const DOCUMENT_ROOT_PATH = '(document)';
4
4
  /**
5
5
  * The five sections whose keys are slugs — one namespace across all of them,
6
- * which is what lets a role grant say `{robot, slug}` without naming a kind.
6
+ * which is what lets an app lock name `{robot, slug}` without naming a kind.
7
7
  * `messages:` is deliberately not among them: its names are their own
8
8
  * namespace.
9
9
  *
package/dist/config.d.ts CHANGED
@@ -133,14 +133,18 @@ export declare const parameterMap: z.ZodRecord<z.ZodString, z.ZodObject<{
133
133
  * sections at once** — slugs are one namespace, so a name reserved here is
134
134
  * reserved everywhere.
135
135
  *
136
- * The first three are built-ins: the cloud or the bridge already publishes
136
+ * The first two are built-ins: the cloud or the bridge already publishes
137
137
  * something under them, so a configured entry would be a second producer for
138
- * one name. `history` is reserved for a different reason and is not a built-in
139
- * — nothing publishes it. `GET /api/robots/:id/jobs/history` is a **literal
140
- * sibling** of `GET /api/robots/:id/jobs/:slug`, so an action or service named
141
- * `history` would have a job route no caller could ever reach. Reserving the
142
- * name is the honest half of that: the alternative is a slug the format
143
- * accepts and one route silently cannot address.
138
+ * one name. The other three are reserved for a different reason and are not
139
+ * built-ins — nothing publishes them. `assets` and `job_history` are the
140
+ * robot-level capabilities a role can be required for and an app can lock; an
141
+ * entry of the same name would leave a capability's `name` ambiguous between
142
+ * an exposure and the robot as a whole. `history` is reserved because
143
+ * `GET /api/robots/:id/jobs/history` is a **literal sibling** of
144
+ * `GET /api/robots/:id/jobs/:slug`, so an action or service named `history`
145
+ * would have a job route no caller could ever reach. Reserving the name is the
146
+ * honest half of that: the alternative is a slug the format accepts and one
147
+ * route silently cannot address.
144
148
  *
145
149
  * **This constant is the only list.** The cloud builds its set from it and
146
150
  * emits `reserved_slug`; the rename path reads it for the target; an editor
@@ -157,7 +161,7 @@ export declare const parameterMap: z.ZodRecord<z.ZodString, z.ZodObject<{
157
161
  * ships those sentences to readers who have only the JSON Schema, and
158
162
  * "here" would have promised them a refusal this parse does not make.
159
163
  */
160
- export declare const RESERVED_SLUGS: readonly ["bridge_state", "robot_details", "history"];
164
+ export declare const RESERVED_SLUGS: readonly ["bridge_state", "robot_details", "history", "assets", "job_history"];
161
165
  /**
162
166
  * When an alert fires and when it is ok again. There is no discriminator:
163
167
  * `resolve_at` absent means equality, present means a threshold whose
@@ -305,6 +309,7 @@ export declare const datapointConfig: z.ZodObject<{
305
309
  name: z.ZodOptional<z.ZodString>;
306
310
  enabled: z.ZodOptional<z.ZodBoolean>;
307
311
  }, z.core.$strict>>>;
312
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
308
313
  }, z.core.$strict>;
309
314
  export type DatapointConfig = z.infer<typeof datapointConfig>;
310
315
  /**
@@ -418,6 +423,7 @@ export declare const actionConfig: z.ZodObject<{
418
423
  description: z.ZodOptional<z.ZodString>;
419
424
  }, z.core.$strict>>>;
420
425
  description: z.ZodOptional<z.ZodString>;
426
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
421
427
  }, z.core.$strict>;
422
428
  export type ActionConfig = z.infer<typeof actionConfig>;
423
429
  /** A ROS service call with validated parameters. */
@@ -451,6 +457,7 @@ export declare const serviceConfig: z.ZodObject<{
451
457
  description: z.ZodOptional<z.ZodString>;
452
458
  }, z.core.$strict>>>;
453
459
  description: z.ZodOptional<z.ZodString>;
460
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
454
461
  }, z.core.$strict>;
455
462
  export type ServiceConfig = z.infer<typeof serviceConfig>;
456
463
  /**
@@ -509,6 +516,7 @@ export declare const publisherConfig: z.ZodObject<{
509
516
  }, z.core.$strict>;
510
517
  quiet_timeout_ms: z.ZodNumber;
511
518
  description: z.ZodOptional<z.ZodString>;
519
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
512
520
  }, z.core.$strict>;
513
521
  export type PublisherConfig = z.infer<typeof publisherConfig>;
514
522
  /**
@@ -614,6 +622,7 @@ export declare const cameraConfig: z.ZodObject<{
614
622
  bitrate_kbps: z.ZodNumber;
615
623
  snapshot_interval_seconds: z.ZodNumber;
616
624
  description: z.ZodOptional<z.ZodString>;
625
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
617
626
  }, z.core.$strict>;
618
627
  export type CameraConfig = z.infer<typeof cameraConfig>;
619
628
  /**
@@ -648,9 +657,9 @@ export declare const LOW_BANDWIDTH_DEFAULTS: {
648
657
  */
649
658
  export declare const lowBandwidthSection: z.ZodObject<{
650
659
  mode: z.ZodOptional<z.ZodEnum<{
651
- off: "off";
652
660
  auto: "auto";
653
661
  on: "on";
662
+ off: "off";
654
663
  }>>;
655
664
  enter_lag_ms: z.ZodOptional<z.ZodNumber>;
656
665
  enter_after_s: z.ZodOptional<z.ZodNumber>;
@@ -670,6 +679,45 @@ export type LowBandwidthSection = z.infer<typeof lowBandwidthSection>;
670
679
  * numbers called version would be the likeliest confusion in the format.
671
680
  */
672
681
  export declare const FLEETLESS_FORMAT_VERSION = 1;
682
+ /**
683
+ * One rule of `access.rules`: a role for every entry whose ROS name fits.
684
+ *
685
+ * Rules are ordered and the first one that fits an entry decides, so a narrow
686
+ * rule goes above a wide one. An entry's own `role` is not consulted against
687
+ * rules at all — it wins outright — and a rule never touches `assets` or
688
+ * `job_history`, which are the robot's and say so under `access`.
689
+ */
690
+ export declare const accessRule: z.ZodObject<{
691
+ match: z.ZodString;
692
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
693
+ read: "read";
694
+ invoke: "invoke";
695
+ publish: "publish";
696
+ }>>>;
697
+ role: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
698
+ }, z.core.$strict>;
699
+ export type AccessRule = z.infer<typeof accessRule>;
700
+ /**
701
+ * The rights a robot's document sets beyond the `role` of single entries.
702
+ *
703
+ * `assets` and `job_history` are the robot's own capabilities and have no ROS
704
+ * name, so rules cannot reach them; they are named here, one role or a list
705
+ * each, and without them the organization's default applies.
706
+ */
707
+ export declare const accessSection: z.ZodObject<{
708
+ rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
709
+ match: z.ZodString;
710
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
711
+ read: "read";
712
+ invoke: "invoke";
713
+ publish: "publish";
714
+ }>>>;
715
+ role: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
716
+ }, z.core.$strict>>>;
717
+ assets: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
718
+ job_history: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
719
+ }, z.core.$strict>;
720
+ export type AccessSection = z.infer<typeof accessSection>;
673
721
  /**
674
722
  * A whole robot configuration — everything configurable about one robot.
675
723
  *
@@ -678,7 +726,7 @@ export declare const FLEETLESS_FORMAT_VERSION = 1;
678
726
  * rule somebody has to write, and the name reads as the entry's heading.
679
727
  *
680
728
  * Slugs remain ONE namespace across all five exposure sections, which
681
- * is what lets a role grant say `{robot, slug}` without naming a kind. That
729
+ * is what lets an app lock name `{robot, slug}` without naming a kind. That
682
730
  * check spans sections and therefore lives in the cloud, not here.
683
731
  */
684
732
  export declare const robotConfigDoc: z.ZodObject<{
@@ -723,6 +771,7 @@ export declare const robotConfigDoc: z.ZodObject<{
723
771
  name: z.ZodOptional<z.ZodString>;
724
772
  enabled: z.ZodOptional<z.ZodBoolean>;
725
773
  }, z.core.$strict>>>;
774
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
726
775
  }, z.core.$strict>>>;
727
776
  actions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
728
777
  ros_name: z.ZodString;
@@ -754,6 +803,7 @@ export declare const robotConfigDoc: z.ZodObject<{
754
803
  description: z.ZodOptional<z.ZodString>;
755
804
  }, z.core.$strict>>>;
756
805
  description: z.ZodOptional<z.ZodString>;
806
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
757
807
  }, z.core.$strict>>>;
758
808
  services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
759
809
  ros_name: z.ZodString;
@@ -785,6 +835,7 @@ export declare const robotConfigDoc: z.ZodObject<{
785
835
  description: z.ZodOptional<z.ZodString>;
786
836
  }, z.core.$strict>>>;
787
837
  description: z.ZodOptional<z.ZodString>;
838
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
788
839
  }, z.core.$strict>>>;
789
840
  publishers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
790
841
  topic: z.ZodString;
@@ -821,6 +872,7 @@ export declare const robotConfigDoc: z.ZodObject<{
821
872
  }, z.core.$strict>;
822
873
  quiet_timeout_ms: z.ZodNumber;
823
874
  description: z.ZodOptional<z.ZodString>;
875
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
824
876
  }, z.core.$strict>>>;
825
877
  cameras: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
826
878
  source: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -855,12 +907,26 @@ export declare const robotConfigDoc: z.ZodObject<{
855
907
  bitrate_kbps: z.ZodNumber;
856
908
  snapshot_interval_seconds: z.ZodNumber;
857
909
  description: z.ZodOptional<z.ZodString>;
910
+ role: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
858
911
  }, z.core.$strict>>>;
912
+ access: z.ZodOptional<z.ZodObject<{
913
+ rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
914
+ match: z.ZodString;
915
+ kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
916
+ read: "read";
917
+ invoke: "invoke";
918
+ publish: "publish";
919
+ }>>>;
920
+ role: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
921
+ }, z.core.$strict>>>;
922
+ assets: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
923
+ job_history: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
924
+ }, z.core.$strict>>;
859
925
  low_bandwidth: z.ZodOptional<z.ZodObject<{
860
926
  mode: z.ZodOptional<z.ZodEnum<{
861
- off: "off";
862
927
  auto: "auto";
863
928
  on: "on";
929
+ off: "off";
864
930
  }>>;
865
931
  enter_lag_ms: z.ZodOptional<z.ZodNumber>;
866
932
  enter_after_s: z.ZodOptional<z.ZodNumber>;
package/dist/config.js CHANGED
@@ -9,6 +9,7 @@ import { applyError, slug, rosName, rosTypeName, fieldPath, SLUG_RULE, ROS_NAME_
9
9
  * into this file once `alerts.ts` retires.
10
10
  */
11
11
  import { alertSeverity } from './alerts.js';
12
+ import { ENTRY_KINDS, roleRef } from './rights.js';
12
13
  /**
13
14
  * The exposure model: what a developer configures per robot, how a
14
15
  * configuration moves from draft to published, and how the cloud reports what
@@ -359,6 +360,16 @@ const param = (name) => `\\\${${name}}`;
359
360
  * of `a: ${2:x}` / `b: ${5:y}` visits `2` then `5`.
360
361
  */
361
362
  const underSlug = (slugKey, snippet) => ({ ...snippet, body: { [slugKey]: snippet.body } });
363
+ /**
364
+ * `role` on an exposed entry: who may use it. The same field on all five kinds,
365
+ * so one helper writes the sentence and each kind names what using it means.
366
+ *
367
+ * It is the cloud's alone: the bridge is sent the stored document and ignores
368
+ * `role` and `access` altogether.
369
+ */
370
+ const entryRole = (use, kind) => roleRef.meta({
371
+ description: `Which role may ${use}: one role key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. Without this, the first rule of \`access.rules\` that fits the entry decides, and without a fitting rule the organization's default for \`${kind}\` applies. A key that names no role of the organization is a warning when you publish, never an error, and grants nothing. The robot ignores it; the cloud enforces it.`,
372
+ });
362
373
  /**
363
374
  * What an exposed service *is*, in the developer's own words.
364
375
  *
@@ -647,14 +658,18 @@ export const parameterMap = slugKeyed(parameterSpec)
647
658
  * sections at once** — slugs are one namespace, so a name reserved here is
648
659
  * reserved everywhere.
649
660
  *
650
- * The first three are built-ins: the cloud or the bridge already publishes
661
+ * The first two are built-ins: the cloud or the bridge already publishes
651
662
  * something under them, so a configured entry would be a second producer for
652
- * one name. `history` is reserved for a different reason and is not a built-in
653
- * — nothing publishes it. `GET /api/robots/:id/jobs/history` is a **literal
654
- * sibling** of `GET /api/robots/:id/jobs/:slug`, so an action or service named
655
- * `history` would have a job route no caller could ever reach. Reserving the
656
- * name is the honest half of that: the alternative is a slug the format
657
- * accepts and one route silently cannot address.
663
+ * one name. The other three are reserved for a different reason and are not
664
+ * built-ins — nothing publishes them. `assets` and `job_history` are the
665
+ * robot-level capabilities a role can be required for and an app can lock; an
666
+ * entry of the same name would leave a capability's `name` ambiguous between
667
+ * an exposure and the robot as a whole. `history` is reserved because
668
+ * `GET /api/robots/:id/jobs/history` is a **literal sibling** of
669
+ * `GET /api/robots/:id/jobs/:slug`, so an action or service named `history`
670
+ * would have a job route no caller could ever reach. Reserving the name is the
671
+ * honest half of that: the alternative is a slug the format accepts and one
672
+ * route silently cannot address.
658
673
  *
659
674
  * **This constant is the only list.** The cloud builds its set from it and
660
675
  * emits `reserved_slug`; the rename path reads it for the target; an editor
@@ -671,7 +686,7 @@ export const parameterMap = slugKeyed(parameterSpec)
671
686
  * ships those sentences to readers who have only the JSON Schema, and
672
687
  * "here" would have promised them a refusal this parse does not make.
673
688
  */
674
- export const RESERVED_SLUGS = ['bridge_state', 'robot_details', 'history'];
689
+ export const RESERVED_SLUGS = ['bridge_state', 'robot_details', 'history', 'assets', 'job_history'];
675
690
  /**
676
691
  * When an alert fires and when it is ok again. There is no discriminator:
677
692
  * `resolve_at` absent means equality, present means a threshold whose
@@ -1107,6 +1122,7 @@ export const datapointConfig = strictObject({
1107
1122
  */
1108
1123
  defaultSnippets: [underSlug('${1:battery_low}', ALERT_SNIPPET)],
1109
1124
  }).optional(),
1125
+ role: entryRole('read this datapoint', 'read').optional(),
1110
1126
  })
1111
1127
  .superRefine((d, ctx) => {
1112
1128
  if (d.field !== undefined)
@@ -1355,6 +1371,7 @@ export const actionConfig = strictObject({
1355
1371
  description: 'What this action does, in the developer\'s own words — documentation for the console and for MCP clients, which is all it is: the robot does nothing with it. It is carried verbatim into `robots.describe` and read by a model that has never seen this robot. The action is offered whenever the role grants it; without one it is offered with `description: null`, and the model has nothing but the slug.',
1356
1372
  examples: ['Drives to a target pose on the map.'],
1357
1373
  }),
1374
+ role: entryRole('start this action', 'invoke').optional(),
1358
1375
  }).meta({
1359
1376
  /** The value position of one entry — `navigate: ▮` under `actions:`. */
1360
1377
  defaultSnippets: [ACTION_SNIPPET],
@@ -1392,6 +1409,7 @@ export const serviceConfig = strictObject({
1392
1409
  description: 'What this service does, in the developer\'s own words. The robot does nothing with it — the readers are the console and MCP clients, and without one the service is still offered, with `description: null`, exactly as for an action. It sits on the configuration rather than on the app, so one wording is true for every app that reaches this robot.',
1393
1410
  examples: ['Resets odometry to the origin.'],
1394
1411
  }),
1412
+ role: entryRole('call this service', 'invoke').optional(),
1395
1413
  }).meta({
1396
1414
  /** The value position of one entry — `reset_odometry: ▮` under `services:`. */
1397
1415
  defaultSnippets: [SERVICE_SNIPPET],
@@ -1519,6 +1537,7 @@ export const publisherConfig = strictObject({
1519
1537
  description: 'What sending to this publisher does, in the developer\'s own words. It is documentation for the console and for MCP clients — the robot does nothing with it — and as for actions and services, the publisher is offered whether or not one is written, with `description: null` when it is not. A caller sends here repeatedly and continuously rather than once, which is why this kind alone carries `failsafe` and `quiet_timeout_ms`.',
1520
1538
  examples: ['Velocity command. If sending stops, the robot stops.'],
1521
1539
  }),
1540
+ role: entryRole('send to this publisher, which is what driving the robot is', 'publish').optional(),
1522
1541
  }).meta({
1523
1542
  /** The value position of one entry — `drive: ▮` under `publishers:`. */
1524
1543
  defaultSnippets: [PUBLISHER_SNIPPET],
@@ -1856,6 +1875,7 @@ export const cameraConfig = strictObject({
1856
1875
  description: 'What this camera shows, in the developer\'s own words — documentation for whoever reads the configuration, for the console and for MCP clients; the robot does nothing with it. A camera without one is still offered, with `description: null`, as for actions, services and publishers. What `camera.snapshot` serves is the latest snapshot with its age; a live session is never a tool.',
1857
1876
  examples: ['Forward-facing camera on the mast.'],
1858
1877
  }),
1878
+ role: entryRole('see this camera', 'read').optional(),
1859
1879
  }).meta({
1860
1880
  /** The value position of one entry — `front: ▮` under `cameras:`. */
1861
1881
  defaultSnippets: [CAMERA_SNIPPET],
@@ -1930,6 +1950,72 @@ export const lowBandwidthSection = strictObject({
1930
1950
  */
1931
1951
  export const FLEETLESS_FORMAT_VERSION = 1;
1932
1952
  const capped = (entry, max, what) => slugKeyed(entry).refine((m) => Object.keys(m).length <= max, { message: `at most ${max} ${what}` });
1953
+ /**
1954
+ * What a rule's `match` means, said in words. Beside its pattern, on the same
1955
+ * rule as the other grammars that exist only inside a configuration document:
1956
+ * one constant, read as the parser's message and as the JSON Schema's
1957
+ * `patternErrorMessage`.
1958
+ */
1959
+ const ROS_GLOB_RULE = 'A match pattern is an absolute ROS graph name in which `*` stands for any characters inside one segment and `**` for any number of whole segments — `/arm/**`, `/diagnostics/*`, `/joint_*`. It begins with a slash. A relative pattern, a trailing slash, a dash, a dot, or `**` mixed into a longer segment is refused.';
1960
+ /**
1961
+ * Segments of ROS-name characters and `*`; a segment of `**` stands alone. The
1962
+ * look-ahead keeps `**` out of any longer segment, and looks no further than
1963
+ * the segment it is in.
1964
+ */
1965
+ const rosGlob = z
1966
+ .string()
1967
+ .max(255)
1968
+ .regex(/^(?:\/(?:\*\*|(?![A-Za-z0-9_*]*\*\*)(?:\*|[A-Za-z_])[A-Za-z0-9_*]*))+$/, ROS_GLOB_RULE);
1969
+ const ruleKind = z.enum(ENTRY_KINDS);
1970
+ /**
1971
+ * One rule of `access.rules`: a role for every entry whose ROS name fits.
1972
+ *
1973
+ * Rules are ordered and the first one that fits an entry decides, so a narrow
1974
+ * rule goes above a wide one. An entry's own `role` is not consulted against
1975
+ * rules at all — it wins outright — and a rule never touches `assets` or
1976
+ * `job_history`, which are the robot's and say so under `access`.
1977
+ */
1978
+ export const accessRule = strictObject({
1979
+ match: rosGlob.meta({
1980
+ description: 'A glob over the ROS name an entry is exposed by: the `topic` of a datapoint or a publisher, the `ros_name` of a service or an action, the source topic of a camera that reads a ROS topic. `*` stands for one name segment, or for any characters inside one (`/joint_*`); `**` stands for any number of segments, none included, so `/arm/**` fits `/arm` and everything below it. Always absolute.',
1981
+ patternErrorMessage: ROS_GLOB_RULE,
1982
+ }),
1983
+ kinds: z.array(ruleKind.meta({
1984
+ enumDescriptions: describeValues(ruleKind.options, {
1985
+ read: 'Datapoints and cameras: seeing what the robot reports.',
1986
+ invoke: 'Services and actions: asking the robot to do something.',
1987
+ publish: 'Publishers: sending to the robot, which is what driving it is.',
1988
+ }),
1989
+ })).min(1).max(ENTRY_KINDS.length).meta({
1990
+ description: 'Narrows the rule to some kinds of access. Without it the rule fits entries of every kind.',
1991
+ }).optional(),
1992
+ role: roleRef.meta({
1993
+ description: 'The role that may use what this rule fits: one key, or a list of keys when several roles qualify. A role qualifies when it, or a role it inherits from, is named. A key that names no role of the organization is a warning when you publish and grants nothing.',
1994
+ }),
1995
+ });
1996
+ /**
1997
+ * The rights a robot's document sets beyond the `role` of single entries.
1998
+ *
1999
+ * `assets` and `job_history` are the robot's own capabilities and have no ROS
2000
+ * name, so rules cannot reach them; they are named here, one role or a list
2001
+ * each, and without them the organization's default applies.
2002
+ */
2003
+ export const accessSection = strictObject({
2004
+ rules: z.array(accessRule).max(100, 'at most 100 rules').meta({
2005
+ description: 'Ordered rules that give a role to every entry whose ROS name fits `match`, so a whole namespace is covered by one line. For an entry the order of precedence is its own `role`, then the first rule that fits it, then the organization\'s default for its kind. A rule that fits no entry of this document is a warning and changes nothing.',
2006
+ defaultSnippets: [{
2007
+ label: 'a rule over a namespace',
2008
+ description: 'Gives everything under `/arm` to one role. The first rule that fits an entry decides, so a narrower rule goes above a wider one.',
2009
+ body: [{ match: '${1:/arm/**}', role: '${2:admin}' }],
2010
+ }],
2011
+ }).optional(),
2012
+ assets: roleRef.meta({
2013
+ description: 'Who may use this robot\'s asset store — the meshes and the URDF a viewer draws it from — in place of the organization\'s default for `assets`. One role key, or a list of keys.',
2014
+ }).optional(),
2015
+ job_history: roleRef.meta({
2016
+ description: 'Who may read this robot\'s job history, in place of the organization\'s default for `job_history`. One role key, or a list of keys. A run names the person who started it, so whoever may read the history learns who else has been driving the robot.',
2017
+ }).optional(),
2018
+ });
1933
2019
  /**
1934
2020
  * A whole robot configuration — everything configurable about one robot.
1935
2021
  *
@@ -1938,7 +2024,7 @@ const capped = (entry, max, what) => slugKeyed(entry).refine((m) => Object.keys(
1938
2024
  * rule somebody has to write, and the name reads as the entry's heading.
1939
2025
  *
1940
2026
  * Slugs remain ONE namespace across all five exposure sections, which
1941
- * is what lets a role grant say `{robot, slug}` without naming a kind. That
2027
+ * is what lets an app lock name `{robot, slug}` without naming a kind. That
1942
2028
  * check spans sections and therefore lives in the cloud, not here.
1943
2029
  */
1944
2030
  export const robotConfigDoc = strictObject({
@@ -1950,28 +2036,36 @@ export const robotConfigDoc = strictObject({
1950
2036
  defaultSnippets: [underSlug('${1:drive}', SHARED_MESSAGE_SNIPPET)],
1951
2037
  }).optional(),
1952
2038
  datapoints: capped(datapointConfig, 200, 'datapoints').meta({
1953
- description: 'Values the robot publishes, each one field of one topic or a whole topic, and **never several topics**. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated.',
2039
+ description: 'Values the robot publishes, each one field of one topic or a whole topic, and **never several topics**. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated.',
1954
2040
  defaultSnippets: [
1955
2041
  underSlug('${1:battery_voltage}', DATAPOINT_SNIPPET),
1956
2042
  underSlug('${1:battery}', NUMERIC_DATAPOINT_SNIPPET),
1957
2043
  ],
1958
2044
  }).optional(),
1959
2045
  actions: capped(actionConfig, 200, 'actions').meta({
1960
- description: 'Things the robot does on request that take time, each reported as a job with progress. **At most one job runs per action slug**: a second call is refused `busy`, and every observer of that slug watches the same job. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated.',
2046
+ description: 'Things the robot does on request that take time, each reported as a job with progress. **At most one job runs per action slug**: a second call is refused `busy`, and every observer of that slug watches the same job. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated.',
1961
2047
  defaultSnippets: [underSlug('${1:navigate}', ACTION_SNIPPET)],
1962
2048
  }).optional(),
1963
2049
  services: capped(serviceConfig, 200, 'services').meta({
1964
- description: 'ROS service calls the robot answers — one request, one reply. Unlike an action a service reports **no progress** and the call returns with its result already on the job, so there is nothing left to observe; a second concurrent call is still refused `busy`, exactly as for an action. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated.',
2050
+ description: 'ROS service calls the robot answers — one request, one reply. Unlike an action a service reports **no progress** and the call returns with its result already on the job, so there is nothing left to observe; a second concurrent call is still refused `busy`, exactly as for an action. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated.',
1965
2051
  defaultSnippets: [underSlug('${1:reset_odometry}', SERVICE_SNIPPET)],
1966
2052
  }).optional(),
1967
2053
  publishers: capped(publisherConfig, 200, 'publishers').meta({
1968
- description: 'Topics clients may send to, and where the format\'s whole safety story lives. The `message` template fixes every value a caller cannot change, and **`failsafe` is required**: once a client falls silent the bridge sends the failsafe message itself, so an operator whose window closed does not leave a robot driving. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated.',
2054
+ description: 'Topics clients may send to, and where the format\'s whole safety story lives. The `message` template fixes every value a caller cannot change, and **`failsafe` is required**: once a client falls silent the bridge sends the failsafe message itself, so an operator whose window closed does not leave a robot driving. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated.',
1969
2055
  defaultSnippets: [underSlug('${1:drive}', PUBLISHER_SNIPPET)],
1970
2056
  }).optional(),
1971
2057
  cameras: capped(cameraConfig, 50, 'cameras').meta({
1972
- description: 'Video the robot streams, and the still frames the cloud serves from it. `width`, `height`, `fps` and `bitrate_kbps` are what **the bridge produces before sending**, not what the camera captures — they live in the configuration rather than in a viewer\'s request precisely so that no viewer can make a robot send more. Keys are slugs, one namespace across all five exposure sections, which is what lets a role grant say `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, and `history` is reserved because `GET …/jobs/history` would shadow an action of that name; all three are refused when the document is validated.',
2058
+ description: 'Video the robot streams, and the still frames the cloud serves from it. `width`, `height`, `fps` and `bitrate_kbps` are what **the bridge produces before sending**, not what the camera captures — they live in the configuration rather than in a viewer\'s request precisely so that no viewer can make a robot send more. Keys are slugs, one namespace across all five exposure sections, which is what lets an app lock name `{robot, slug}` without naming a kind; `bridge_state` and `robot_details` are built-in, `history` is reserved because `GET …/jobs/history` would shadow an action of that name, and `assets` and `job_history` are reserved because they name the robot-level capabilities; all five are refused when the document is validated.',
1973
2059
  defaultSnippets: [underSlug('${1:front}', CAMERA_SNIPPET)],
1974
2060
  }).optional(),
2061
+ access: accessSection.meta({
2062
+ description: 'Who may use what on this robot, beyond the `role` an entry can carry itself: ordered `rules` over ROS name patterns, and the robot-level `assets` and `job_history`. Everything in it is optional. For an entry the precedence is its own `role`, then the first rule that fits, then the organization\'s default for its kind; only the published version counts. The robot ignores this section.',
2063
+ defaultSnippets: [{
2064
+ label: 'access, with one rule',
2065
+ description: 'A rule that gives everything under `/arm` to one role; entries it does not fit keep the organization\'s defaults.',
2066
+ body: { rules: [{ match: '${1:/arm/**}', role: '${2:admin}' }] },
2067
+ }],
2068
+ }).optional(),
1975
2069
  low_bandwidth: lowBandwidthSection.optional().meta({
1976
2070
  description: 'Overrides for the bridge\'s low-bandwidth mode; see the section schema.',
1977
2071
  /**
package/dist/errors.d.ts CHANGED
@@ -90,8 +90,8 @@ export type InvalidCodeDetails = z.infer<typeof invalidCodeDetails>;
90
90
  export declare const planLimitDetails: z.ZodObject<{
91
91
  limit: z.ZodEnum<{
92
92
  apps: "apps";
93
- seats: "seats";
94
93
  robots: "robots";
94
+ seats: "seats";
95
95
  app_users: "app_users";
96
96
  live_video_ms_per_month: "live_video_ms_per_month";
97
97
  asset_bytes_per_robot: "asset_bytes_per_robot";
@@ -113,8 +113,8 @@ export declare const planLimitDetails: z.ZodObject<{
113
113
  }>>;
114
114
  addon: z.ZodNullable<z.ZodEnum<{
115
115
  apps: "apps";
116
- seats: "seats";
117
116
  robots: "robots";
117
+ seats: "seats";
118
118
  app_user_packs: "app_user_packs";
119
119
  live_video_packs: "live_video_packs";
120
120
  }>>;
@@ -144,8 +144,8 @@ export type PlanLimitDetails = z.infer<typeof planLimitDetails>;
144
144
  export declare const assetPlanLimitDetails: z.ZodObject<{
145
145
  limit: z.ZodEnum<{
146
146
  apps: "apps";
147
- seats: "seats";
148
147
  robots: "robots";
148
+ seats: "seats";
149
149
  app_users: "app_users";
150
150
  live_video_ms_per_month: "live_video_ms_per_month";
151
151
  asset_bytes_per_robot: "asset_bytes_per_robot";
@@ -167,8 +167,8 @@ export declare const assetPlanLimitDetails: z.ZodObject<{
167
167
  }>>;
168
168
  addon: z.ZodNullable<z.ZodEnum<{
169
169
  apps: "apps";
170
- seats: "seats";
171
170
  robots: "robots";
171
+ seats: "seats";
172
172
  app_user_packs: "app_user_packs";
173
173
  live_video_packs: "live_video_packs";
174
174
  }>>;
@@ -241,10 +241,19 @@ export declare const billingDocumentsUnavailableDetails: z.ZodObject<{
241
241
  }>;
242
242
  }, z.core.$strict>;
243
243
  export type BillingDocumentsUnavailableDetails = z.infer<typeof billingDocumentsUnavailableDetails>;
244
+ /**
245
+ * The `details` of a `400 role_cycle` refusal: the loop the change would have
246
+ * made, along the `inherits` edges, as `[a, b, a]` — the first key again at
247
+ * the end. A role that inherits from itself is `[a, a]`.
248
+ */
249
+ export declare const roleCycleDetails: z.ZodObject<{
250
+ cycle: z.ZodArray<z.ZodString>;
251
+ }, z.core.$strip>;
252
+ export type RoleCycleDetails = z.infer<typeof roleCycleDetails>;
244
253
  /**
245
254
  * The codes in use today. The wire deliberately allows any string — this
246
255
  * list is the shared vocabulary, not a closed set, so a new refusal never
247
256
  * needs a contracts release before it can be reported honestly.
248
257
  */
249
- export declare const ERROR_CODES: readonly ["not_found", "validation_error", "bad_request", "unknown_datapoint", "invalid_token", "protocol_mismatch", "bridge_too_old", "invalid_frame", "duplicate_slug", "reserved_slug", "unknown_slug", "unknown_field_path", "unknown_type", "unknown_topic", "invalid_rate", "invalid_range", "config_conflict", "no_data", "robot_offline", "bridge_timeout", "unauthorized", "forbidden", "invalid_credentials", "token_expired", "token_revoked", "email_taken", "identifier_taken", "weak_password", "account_blocked", "busy", "parameter_invalid", "cancel_rejected", "job_lost", "operator_verified_stopped", "job_unknown_to_bridge", "action_server_lost", "action_failed", "goal_rejected", "goal_send_failed", "result_failed", "goal_uncontrollable", "bridge_disconnected", "config_changed", "publisher_busy", "unknown_command", "not_subscribable", "camera_offline", "no_snapshot_yet", "live_unavailable", "wrong_kind", "not_recorded", "not_aggregatable", "quota_exceeded", "credential_in_use", "goal_timeout", "robot_in_use", "robot_deletion_partial", "job_queue_full", "invalid_uuid", "rate_limited", "tier_required", "token_spent", "service_timeout", "asset_missing", "dynamic_registration_disabled", "client_limit_reached", "idp_unavailable", "mcp_disabled", "tool_not_available", "capability_required", "last_owner", "role_name_taken", "role_in_use", "last_role", "target_state_conflict", "job_state_conflict", "signup_closed", "draft_not_a_document", "internal_error", "not_cancellable", "unsupported_media_type", "wrong_browser", "invalid_yaml", "unstorable_yaml", "registration_closed", "domain_not_allowed", "email_unverified", "origin_not_allowed", "template_invalid", "provider_disabled", "provider_misconfigured", "invalid_redirect_uri", "interaction_expired", "invalid_code", "method_not_allowed", "plan_limit", "plan_required", "org_locked", "file_too_large", "billing_unavailable", "legal_offer_unavailable", "payment_provider_unavailable", "history_migrating", "billing_documents_unavailable", "support_read_only", "support_forbidden"];
258
+ export declare const ERROR_CODES: readonly ["not_found", "validation_error", "bad_request", "unknown_datapoint", "invalid_token", "protocol_mismatch", "bridge_too_old", "invalid_frame", "duplicate_slug", "reserved_slug", "unknown_slug", "unknown_field_path", "unknown_type", "unknown_topic", "invalid_rate", "invalid_range", "config_conflict", "no_data", "robot_offline", "bridge_timeout", "unauthorized", "forbidden", "invalid_credentials", "token_expired", "token_revoked", "email_taken", "identifier_taken", "weak_password", "account_blocked", "busy", "parameter_invalid", "cancel_rejected", "job_lost", "operator_verified_stopped", "job_unknown_to_bridge", "action_server_lost", "action_failed", "goal_rejected", "goal_send_failed", "result_failed", "goal_uncontrollable", "bridge_disconnected", "config_changed", "publisher_busy", "unknown_command", "not_subscribable", "camera_offline", "no_snapshot_yet", "live_unavailable", "wrong_kind", "not_recorded", "not_aggregatable", "quota_exceeded", "credential_in_use", "goal_timeout", "robot_in_use", "robot_deletion_partial", "job_queue_full", "invalid_uuid", "rate_limited", "tier_required", "token_spent", "service_timeout", "asset_missing", "dynamic_registration_disabled", "client_limit_reached", "idp_unavailable", "mcp_disabled", "tool_not_available", "capability_required", "last_owner", "role_cycle", "role_key_taken", "confirmation_required", "target_state_conflict", "job_state_conflict", "signup_closed", "draft_not_a_document", "internal_error", "not_cancellable", "unsupported_media_type", "wrong_browser", "invalid_yaml", "unstorable_yaml", "registration_closed", "domain_not_allowed", "email_unverified", "origin_not_allowed", "template_invalid", "provider_disabled", "provider_misconfigured", "invalid_redirect_uri", "interaction_expired", "invalid_code", "method_not_allowed", "plan_limit", "plan_required", "org_locked", "file_too_large", "billing_unavailable", "legal_offer_unavailable", "payment_provider_unavailable", "history_migrating", "billing_documents_unavailable", "support_read_only", "support_forbidden"];
250
259
  export type ErrorCode = (typeof ERROR_CODES)[number];