@fleetless/sdk 4.6.0 → 5.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.
- package/CHANGELOG.md +45 -0
- package/README.md +2 -0
- package/dist/index.cjs +4905 -3320
- package/dist/index.d.cts +65 -31
- package/dist/index.d.ts +65 -31
- package/dist/index.js +4905 -3320
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -3,8 +3,8 @@ import { z } from 'zod';
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* One exposure of a robot, as `robots.describe` and
|
|
7
|
-
*
|
|
6
|
+
* One exposure of a robot, as `robots.describe` and `GET /api/robots/:id/datasheet`
|
|
7
|
+
* list it. Every exposure the caller's role grants is listed —
|
|
8
8
|
* a missing `description` is shown as `null`, never used to hide the entry.
|
|
9
9
|
*
|
|
10
10
|
* `input_schema` is a JSON Schema document generated from an action's,
|
|
@@ -27,9 +27,9 @@ declare const mcpExposure: z.ZodObject<{
|
|
|
27
27
|
input_schema: z.ZodNullable<z.ZodUnknown>;
|
|
28
28
|
}, z.core.$strip>;
|
|
29
29
|
type McpExposure$1 = z.infer<typeof mcpExposure>;
|
|
30
|
-
/** The two
|
|
30
|
+
/** The two capabilities of a robot as a whole that a tool can need beyond a slug: its past jobs and its asset files. */
|
|
31
31
|
declare const mcpCapabilities: z.ZodObject<{
|
|
32
|
-
|
|
32
|
+
job_history: z.ZodBoolean;
|
|
33
33
|
assets: z.ZodBoolean;
|
|
34
34
|
}, z.core.$strip>;
|
|
35
35
|
type McpCapabilities$1 = z.infer<typeof mcpCapabilities>;
|
|
@@ -43,7 +43,7 @@ declare const mcpRobotDatasheet: z.ZodObject<{
|
|
|
43
43
|
robot_id: z.ZodUUID;
|
|
44
44
|
robot_name: z.ZodString;
|
|
45
45
|
capabilities: z.ZodObject<{
|
|
46
|
-
|
|
46
|
+
job_history: z.ZodBoolean;
|
|
47
47
|
assets: z.ZodBoolean;
|
|
48
48
|
}, z.core.$strip>;
|
|
49
49
|
exposures: z.ZodArray<z.ZodObject<{
|
|
@@ -608,7 +608,7 @@ type McpConsentGrant = z.infer<typeof mcpConsentGrant>;
|
|
|
608
608
|
* client API and appears in the audit as the developer, and the console's own
|
|
609
609
|
* live views subscribe on `/realtime` as one. A developer is **org-scoped, not
|
|
610
610
|
* app-scoped** — they own the configuration of every robot in their org — so
|
|
611
|
-
* `app_id` and `
|
|
611
|
+
* `app_id` and `role` are null for them, and roles do not filter what they
|
|
612
612
|
* see. `kind` states this explicitly rather than leaving it to be inferred from
|
|
613
613
|
* which id happens to be set.
|
|
614
614
|
*
|
|
@@ -635,7 +635,10 @@ declare const clientIdentity: z.ZodObject<{
|
|
|
635
635
|
app_user_id: z.ZodNullable<z.ZodUUID>;
|
|
636
636
|
server_key_id: z.ZodNullable<z.ZodUUID>;
|
|
637
637
|
app_id: z.ZodNullable<z.ZodUUID>;
|
|
638
|
-
|
|
638
|
+
role: z.ZodNullable<z.ZodObject<{
|
|
639
|
+
key: z.ZodString;
|
|
640
|
+
name: z.ZodString;
|
|
641
|
+
}, z.core.$strip>>;
|
|
639
642
|
email: z.ZodNullable<z.ZodEmail>;
|
|
640
643
|
two_factor_enabled: z.ZodNullable<z.ZodBoolean>;
|
|
641
644
|
}, z.core.$strip>;
|
|
@@ -649,7 +652,7 @@ type ClientIdentity = z.infer<typeof clientIdentity>;
|
|
|
649
652
|
*
|
|
650
653
|
* Deliberately not `robotListItem`: that one carries `exposes`, the per-kind
|
|
651
654
|
* counts a developer's list shows, which are a configuration fact rather than
|
|
652
|
-
* something an app user's role
|
|
655
|
+
* something an app user's role decides. What an app user is entitled to is the
|
|
653
656
|
* robot, its bridge state, and whether anything is published on it yet.
|
|
654
657
|
*/
|
|
655
658
|
declare const clientRobotListItem: z.ZodObject<{
|
|
@@ -737,6 +740,10 @@ declare const assetSyncStatus: z.ZodObject<{
|
|
|
737
740
|
used_bytes: z.ZodNumber;
|
|
738
741
|
size_bytes: z.ZodNumber;
|
|
739
742
|
}, z.core.$strip>>>;
|
|
743
|
+
file_limit: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
744
|
+
max_bytes: z.ZodNumber;
|
|
745
|
+
size_bytes: z.ZodNullable<z.ZodNumber>;
|
|
746
|
+
}, z.core.$strip>>>;
|
|
740
747
|
}, z.core.$strip>>;
|
|
741
748
|
reason: z.ZodNullable<z.ZodString>;
|
|
742
749
|
stored: z.ZodNullable<z.ZodNumber>;
|
|
@@ -782,6 +789,10 @@ declare const assetListResponse: z.ZodObject<{
|
|
|
782
789
|
used_bytes: z.ZodNumber;
|
|
783
790
|
size_bytes: z.ZodNumber;
|
|
784
791
|
}, z.core.$strip>>>;
|
|
792
|
+
file_limit: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
793
|
+
max_bytes: z.ZodNumber;
|
|
794
|
+
size_bytes: z.ZodNullable<z.ZodNumber>;
|
|
795
|
+
}, z.core.$strip>>>;
|
|
785
796
|
}, z.core.$strip>>;
|
|
786
797
|
reason: z.ZodNullable<z.ZodString>;
|
|
787
798
|
stored: z.ZodNullable<z.ZodNumber>;
|
|
@@ -867,7 +878,7 @@ type CancelRejectedDetails = z.infer<typeof cancelRejectedDetails>;
|
|
|
867
878
|
* list is the shared vocabulary, not a closed set, so a new refusal never
|
|
868
879
|
* needs a contracts release before it can be reported honestly.
|
|
869
880
|
*/
|
|
870
|
-
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", "
|
|
881
|
+
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"];
|
|
871
882
|
type ErrorCode = (typeof ERROR_CODES)[number];
|
|
872
883
|
|
|
873
884
|
/**
|
|
@@ -890,12 +901,13 @@ type ErrorCode = (typeof ERROR_CODES)[number];
|
|
|
890
901
|
* to wait forever for that.
|
|
891
902
|
* - `command_outcome_unknown`: worse than a timeout, and told apart from it
|
|
892
903
|
* on purpose — the connection that carried the command was replaced by a
|
|
893
|
-
* new one (a reconnect)
|
|
894
|
-
*
|
|
895
|
-
*
|
|
896
|
-
*
|
|
897
|
-
*
|
|
898
|
-
*
|
|
904
|
+
* new one (a reconnect), or ended because its credential is no longer
|
|
905
|
+
* valid, before any reply arrived. The server, if it answered at all,
|
|
906
|
+
* answered a socket that no longer exists, so the command may or may not
|
|
907
|
+
* have run. Never retried automatically — that could run an action
|
|
908
|
+
* twice — the caller recovers by reading the job (e.g.
|
|
909
|
+
* `actions.subscribe`), since state is observed by slug regardless of which
|
|
910
|
+
* connection asked for it.
|
|
899
911
|
* - `unexpected_response`: the server answered `ok:true` but left out
|
|
900
912
|
* something the command is defined to always return (e.g. no `job` on a
|
|
901
913
|
* successful `invoke`) — a contract violation the SDK noticed, not a
|
|
@@ -1713,8 +1725,18 @@ interface SignInMethods {
|
|
|
1713
1725
|
password: boolean;
|
|
1714
1726
|
/** Whether `requestLoginCode`/`verifyLoginCode` is on for this app. */
|
|
1715
1727
|
emailCode: boolean;
|
|
1716
|
-
/**
|
|
1717
|
-
|
|
1728
|
+
/**
|
|
1729
|
+
* The app's two-factor policy — `'off'`, `'optional'` or `'required'` —
|
|
1730
|
+
* not the signed-in person's enrollment state.
|
|
1731
|
+
*
|
|
1732
|
+
* **`null` when the cloud answered no policy this SDK recognises**: a cloud
|
|
1733
|
+
* that predates the field, or a value outside those three. Treat `null` as
|
|
1734
|
+
* a failed policy read — offer no two-factor action, let the person retry —
|
|
1735
|
+
* and never as `'off'`: the SDK does not guess a policy, and the cloud
|
|
1736
|
+
* still enforces the real one at sign-in. `password` and `emailCode` are
|
|
1737
|
+
* read either way, so a login screen keeps working against such a cloud.
|
|
1738
|
+
*/
|
|
1739
|
+
twoFactor: 'off' | 'optional' | 'required' | null;
|
|
1718
1740
|
}
|
|
1719
1741
|
/** One sign-in button on the app's own login screen, as `listProviders()` lists it. */
|
|
1720
1742
|
interface ProviderButton {
|
|
@@ -1916,6 +1938,11 @@ interface AuthApi {
|
|
|
1916
1938
|
* Who the caller turned out to be, without decoding a token client-side —
|
|
1917
1939
|
* which is how apps end up trusting claims nobody verified.
|
|
1918
1940
|
*
|
|
1941
|
+
* `role` is `{ key, name }` of the organization role the caller holds, and
|
|
1942
|
+
* `null` when there is none to name: a developer, a server key, and an app
|
|
1943
|
+
* user whose role has since been deleted, who can still sign in but reaches
|
|
1944
|
+
* nothing. Show `name`; compare `key`.
|
|
1945
|
+
*
|
|
1919
1946
|
* Throws the SDK's own `no_session` **before any request is sent** when
|
|
1920
1947
|
* nothing is stored — which is exactly the state a sign-in step leaves a
|
|
1921
1948
|
* caller in while a second factor is still pending (see `SignInResult`):
|
|
@@ -2027,6 +2054,10 @@ interface AuthApi {
|
|
|
2027
2054
|
* (`GET /api/client/providers`) — each call is its own request, picking a
|
|
2028
2055
|
* different field out of the same response; call both if your login
|
|
2029
2056
|
* screen needs both.
|
|
2057
|
+
*
|
|
2058
|
+
* `twoFactor` is `null` when the cloud's answer carries no policy this SDK
|
|
2059
|
+
* recognises (an older cloud, or an unknown value) — a failed policy read,
|
|
2060
|
+
* not `'off'`. `password` and `emailCode` are answered either way.
|
|
2030
2061
|
*/
|
|
2031
2062
|
signInMethods(): Promise<SignInMethods>;
|
|
2032
2063
|
/**
|
|
@@ -2456,10 +2487,10 @@ interface JobsApi {
|
|
|
2456
2487
|
*
|
|
2457
2488
|
* At most one entry per slug: the current job there, same as a per-slug
|
|
2458
2489
|
* read would answer. Not a history endpoint — that is `history` below.
|
|
2459
|
-
* Grant-filtered same as `cameras.list`/`datapoints` — an end user
|
|
2460
|
-
*
|
|
2461
|
-
* session
|
|
2462
|
-
* a robot doing nothing resolves `[]`.
|
|
2490
|
+
* Grant-filtered same as `cameras.list`/`datapoints` — an end user sees
|
|
2491
|
+
* only jobs on slugs their role grants, a server key every job on slugs its
|
|
2492
|
+
* app does not lock, a developer session every job on the robot. Never
|
|
2493
|
+
* empty-vs-missing ambiguity: a robot doing nothing resolves `[]`.
|
|
2463
2494
|
*
|
|
2464
2495
|
* **Ordered newest first by `started_at`, with `job.seq` as the
|
|
2465
2496
|
* tiebreaker** (`started_at` alone is not a total order — two jobs minted
|
|
@@ -2477,7 +2508,7 @@ interface JobsApi {
|
|
|
2477
2508
|
* durable `seq`, with its actor, its outcome and its `duration_ms`, kept
|
|
2478
2509
|
* for 90 days. The durable counterpart of `list`.
|
|
2479
2510
|
*
|
|
2480
|
-
* **Needs the `
|
|
2511
|
+
* **Needs the `job_history` capability** for the caller's role, or it
|
|
2481
2512
|
* rejects `capability_required`. An app user sees only runs on the slugs
|
|
2482
2513
|
* their role grants; a developer session sees the whole robot.
|
|
2483
2514
|
*
|
|
@@ -2529,9 +2560,11 @@ interface PublishersApi {
|
|
|
2529
2560
|
*/
|
|
2530
2561
|
type McpExposure = McpExposure$1;
|
|
2531
2562
|
/**
|
|
2532
|
-
* The two
|
|
2533
|
-
* (may `jobs.history` be read) and `assets` (may the URDF
|
|
2534
|
-
*
|
|
2563
|
+
* The two capabilities of a robot as a whole that a datasheet names beyond
|
|
2564
|
+
* slugs: `job_history` (may `jobs.history` be read) and `assets` (may the URDF
|
|
2565
|
+
* and meshes be read). The robot's `access` section decides which roles hold
|
|
2566
|
+
* them, else the organization's defaults, less what the app locks. The wire
|
|
2567
|
+
* shape is contracts' `mcpCapabilities`.
|
|
2535
2568
|
*/
|
|
2536
2569
|
type McpCapabilities = McpCapabilities$1;
|
|
2537
2570
|
/**
|
|
@@ -2549,18 +2582,19 @@ interface RobotsApi {
|
|
|
2549
2582
|
* The robots this caller reaches, in name order with the id as the tiebreak.
|
|
2550
2583
|
*
|
|
2551
2584
|
* An app user reaches the robots their app attaches on which their role
|
|
2552
|
-
*
|
|
2553
|
-
*
|
|
2554
|
-
*
|
|
2555
|
-
*
|
|
2556
|
-
*
|
|
2585
|
+
* holds at least one slug or capability once the app's locks are taken off;
|
|
2586
|
+
* a server key reaches every robot its app attaches that the locks leave
|
|
2587
|
+
* something on. A robot nothing is granted on is absent rather than listed
|
|
2588
|
+
* empty — reach is a grant, not an attachment — so an app user whose role
|
|
2589
|
+
* holds nothing resolves `[]`, which is the robots' access rules talking, not
|
|
2590
|
+
* a broken login.
|
|
2557
2591
|
*/
|
|
2558
2592
|
list(): Promise<ClientRobotListItem[]>;
|
|
2559
2593
|
/**
|
|
2560
2594
|
* Everything the caller's role lets them do on one robot: every granted
|
|
2561
2595
|
* datapoint (with `unit` and `decimals`), action, service and publisher
|
|
2562
2596
|
* (with the parameter JSON Schema under `input_schema`) and camera, plus
|
|
2563
|
-
* the two capabilities that gate whole features, `
|
|
2597
|
+
* the two capabilities that gate whole features, `job_history` and
|
|
2564
2598
|
* `assets`. A robot with nothing published resolves an empty `exposures`
|
|
2565
2599
|
* list. One the caller does not reach rejects `not_found`, exactly as a
|
|
2566
2600
|
* robot that does not exist — never `forbidden`, which would say it exists.
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { z } from 'zod';
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* One exposure of a robot, as `robots.describe` and
|
|
7
|
-
*
|
|
6
|
+
* One exposure of a robot, as `robots.describe` and `GET /api/robots/:id/datasheet`
|
|
7
|
+
* list it. Every exposure the caller's role grants is listed —
|
|
8
8
|
* a missing `description` is shown as `null`, never used to hide the entry.
|
|
9
9
|
*
|
|
10
10
|
* `input_schema` is a JSON Schema document generated from an action's,
|
|
@@ -27,9 +27,9 @@ declare const mcpExposure: z.ZodObject<{
|
|
|
27
27
|
input_schema: z.ZodNullable<z.ZodUnknown>;
|
|
28
28
|
}, z.core.$strip>;
|
|
29
29
|
type McpExposure$1 = z.infer<typeof mcpExposure>;
|
|
30
|
-
/** The two
|
|
30
|
+
/** The two capabilities of a robot as a whole that a tool can need beyond a slug: its past jobs and its asset files. */
|
|
31
31
|
declare const mcpCapabilities: z.ZodObject<{
|
|
32
|
-
|
|
32
|
+
job_history: z.ZodBoolean;
|
|
33
33
|
assets: z.ZodBoolean;
|
|
34
34
|
}, z.core.$strip>;
|
|
35
35
|
type McpCapabilities$1 = z.infer<typeof mcpCapabilities>;
|
|
@@ -43,7 +43,7 @@ declare const mcpRobotDatasheet: z.ZodObject<{
|
|
|
43
43
|
robot_id: z.ZodUUID;
|
|
44
44
|
robot_name: z.ZodString;
|
|
45
45
|
capabilities: z.ZodObject<{
|
|
46
|
-
|
|
46
|
+
job_history: z.ZodBoolean;
|
|
47
47
|
assets: z.ZodBoolean;
|
|
48
48
|
}, z.core.$strip>;
|
|
49
49
|
exposures: z.ZodArray<z.ZodObject<{
|
|
@@ -608,7 +608,7 @@ type McpConsentGrant = z.infer<typeof mcpConsentGrant>;
|
|
|
608
608
|
* client API and appears in the audit as the developer, and the console's own
|
|
609
609
|
* live views subscribe on `/realtime` as one. A developer is **org-scoped, not
|
|
610
610
|
* app-scoped** — they own the configuration of every robot in their org — so
|
|
611
|
-
* `app_id` and `
|
|
611
|
+
* `app_id` and `role` are null for them, and roles do not filter what they
|
|
612
612
|
* see. `kind` states this explicitly rather than leaving it to be inferred from
|
|
613
613
|
* which id happens to be set.
|
|
614
614
|
*
|
|
@@ -635,7 +635,10 @@ declare const clientIdentity: z.ZodObject<{
|
|
|
635
635
|
app_user_id: z.ZodNullable<z.ZodUUID>;
|
|
636
636
|
server_key_id: z.ZodNullable<z.ZodUUID>;
|
|
637
637
|
app_id: z.ZodNullable<z.ZodUUID>;
|
|
638
|
-
|
|
638
|
+
role: z.ZodNullable<z.ZodObject<{
|
|
639
|
+
key: z.ZodString;
|
|
640
|
+
name: z.ZodString;
|
|
641
|
+
}, z.core.$strip>>;
|
|
639
642
|
email: z.ZodNullable<z.ZodEmail>;
|
|
640
643
|
two_factor_enabled: z.ZodNullable<z.ZodBoolean>;
|
|
641
644
|
}, z.core.$strip>;
|
|
@@ -649,7 +652,7 @@ type ClientIdentity = z.infer<typeof clientIdentity>;
|
|
|
649
652
|
*
|
|
650
653
|
* Deliberately not `robotListItem`: that one carries `exposes`, the per-kind
|
|
651
654
|
* counts a developer's list shows, which are a configuration fact rather than
|
|
652
|
-
* something an app user's role
|
|
655
|
+
* something an app user's role decides. What an app user is entitled to is the
|
|
653
656
|
* robot, its bridge state, and whether anything is published on it yet.
|
|
654
657
|
*/
|
|
655
658
|
declare const clientRobotListItem: z.ZodObject<{
|
|
@@ -737,6 +740,10 @@ declare const assetSyncStatus: z.ZodObject<{
|
|
|
737
740
|
used_bytes: z.ZodNumber;
|
|
738
741
|
size_bytes: z.ZodNumber;
|
|
739
742
|
}, z.core.$strip>>>;
|
|
743
|
+
file_limit: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
744
|
+
max_bytes: z.ZodNumber;
|
|
745
|
+
size_bytes: z.ZodNullable<z.ZodNumber>;
|
|
746
|
+
}, z.core.$strip>>>;
|
|
740
747
|
}, z.core.$strip>>;
|
|
741
748
|
reason: z.ZodNullable<z.ZodString>;
|
|
742
749
|
stored: z.ZodNullable<z.ZodNumber>;
|
|
@@ -782,6 +789,10 @@ declare const assetListResponse: z.ZodObject<{
|
|
|
782
789
|
used_bytes: z.ZodNumber;
|
|
783
790
|
size_bytes: z.ZodNumber;
|
|
784
791
|
}, z.core.$strip>>>;
|
|
792
|
+
file_limit: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
793
|
+
max_bytes: z.ZodNumber;
|
|
794
|
+
size_bytes: z.ZodNullable<z.ZodNumber>;
|
|
795
|
+
}, z.core.$strip>>>;
|
|
785
796
|
}, z.core.$strip>>;
|
|
786
797
|
reason: z.ZodNullable<z.ZodString>;
|
|
787
798
|
stored: z.ZodNullable<z.ZodNumber>;
|
|
@@ -867,7 +878,7 @@ type CancelRejectedDetails = z.infer<typeof cancelRejectedDetails>;
|
|
|
867
878
|
* list is the shared vocabulary, not a closed set, so a new refusal never
|
|
868
879
|
* needs a contracts release before it can be reported honestly.
|
|
869
880
|
*/
|
|
870
|
-
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", "
|
|
881
|
+
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"];
|
|
871
882
|
type ErrorCode = (typeof ERROR_CODES)[number];
|
|
872
883
|
|
|
873
884
|
/**
|
|
@@ -890,12 +901,13 @@ type ErrorCode = (typeof ERROR_CODES)[number];
|
|
|
890
901
|
* to wait forever for that.
|
|
891
902
|
* - `command_outcome_unknown`: worse than a timeout, and told apart from it
|
|
892
903
|
* on purpose — the connection that carried the command was replaced by a
|
|
893
|
-
* new one (a reconnect)
|
|
894
|
-
*
|
|
895
|
-
*
|
|
896
|
-
*
|
|
897
|
-
*
|
|
898
|
-
*
|
|
904
|
+
* new one (a reconnect), or ended because its credential is no longer
|
|
905
|
+
* valid, before any reply arrived. The server, if it answered at all,
|
|
906
|
+
* answered a socket that no longer exists, so the command may or may not
|
|
907
|
+
* have run. Never retried automatically — that could run an action
|
|
908
|
+
* twice — the caller recovers by reading the job (e.g.
|
|
909
|
+
* `actions.subscribe`), since state is observed by slug regardless of which
|
|
910
|
+
* connection asked for it.
|
|
899
911
|
* - `unexpected_response`: the server answered `ok:true` but left out
|
|
900
912
|
* something the command is defined to always return (e.g. no `job` on a
|
|
901
913
|
* successful `invoke`) — a contract violation the SDK noticed, not a
|
|
@@ -1713,8 +1725,18 @@ interface SignInMethods {
|
|
|
1713
1725
|
password: boolean;
|
|
1714
1726
|
/** Whether `requestLoginCode`/`verifyLoginCode` is on for this app. */
|
|
1715
1727
|
emailCode: boolean;
|
|
1716
|
-
/**
|
|
1717
|
-
|
|
1728
|
+
/**
|
|
1729
|
+
* The app's two-factor policy — `'off'`, `'optional'` or `'required'` —
|
|
1730
|
+
* not the signed-in person's enrollment state.
|
|
1731
|
+
*
|
|
1732
|
+
* **`null` when the cloud answered no policy this SDK recognises**: a cloud
|
|
1733
|
+
* that predates the field, or a value outside those three. Treat `null` as
|
|
1734
|
+
* a failed policy read — offer no two-factor action, let the person retry —
|
|
1735
|
+
* and never as `'off'`: the SDK does not guess a policy, and the cloud
|
|
1736
|
+
* still enforces the real one at sign-in. `password` and `emailCode` are
|
|
1737
|
+
* read either way, so a login screen keeps working against such a cloud.
|
|
1738
|
+
*/
|
|
1739
|
+
twoFactor: 'off' | 'optional' | 'required' | null;
|
|
1718
1740
|
}
|
|
1719
1741
|
/** One sign-in button on the app's own login screen, as `listProviders()` lists it. */
|
|
1720
1742
|
interface ProviderButton {
|
|
@@ -1916,6 +1938,11 @@ interface AuthApi {
|
|
|
1916
1938
|
* Who the caller turned out to be, without decoding a token client-side —
|
|
1917
1939
|
* which is how apps end up trusting claims nobody verified.
|
|
1918
1940
|
*
|
|
1941
|
+
* `role` is `{ key, name }` of the organization role the caller holds, and
|
|
1942
|
+
* `null` when there is none to name: a developer, a server key, and an app
|
|
1943
|
+
* user whose role has since been deleted, who can still sign in but reaches
|
|
1944
|
+
* nothing. Show `name`; compare `key`.
|
|
1945
|
+
*
|
|
1919
1946
|
* Throws the SDK's own `no_session` **before any request is sent** when
|
|
1920
1947
|
* nothing is stored — which is exactly the state a sign-in step leaves a
|
|
1921
1948
|
* caller in while a second factor is still pending (see `SignInResult`):
|
|
@@ -2027,6 +2054,10 @@ interface AuthApi {
|
|
|
2027
2054
|
* (`GET /api/client/providers`) — each call is its own request, picking a
|
|
2028
2055
|
* different field out of the same response; call both if your login
|
|
2029
2056
|
* screen needs both.
|
|
2057
|
+
*
|
|
2058
|
+
* `twoFactor` is `null` when the cloud's answer carries no policy this SDK
|
|
2059
|
+
* recognises (an older cloud, or an unknown value) — a failed policy read,
|
|
2060
|
+
* not `'off'`. `password` and `emailCode` are answered either way.
|
|
2030
2061
|
*/
|
|
2031
2062
|
signInMethods(): Promise<SignInMethods>;
|
|
2032
2063
|
/**
|
|
@@ -2456,10 +2487,10 @@ interface JobsApi {
|
|
|
2456
2487
|
*
|
|
2457
2488
|
* At most one entry per slug: the current job there, same as a per-slug
|
|
2458
2489
|
* read would answer. Not a history endpoint — that is `history` below.
|
|
2459
|
-
* Grant-filtered same as `cameras.list`/`datapoints` — an end user
|
|
2460
|
-
*
|
|
2461
|
-
* session
|
|
2462
|
-
* a robot doing nothing resolves `[]`.
|
|
2490
|
+
* Grant-filtered same as `cameras.list`/`datapoints` — an end user sees
|
|
2491
|
+
* only jobs on slugs their role grants, a server key every job on slugs its
|
|
2492
|
+
* app does not lock, a developer session every job on the robot. Never
|
|
2493
|
+
* empty-vs-missing ambiguity: a robot doing nothing resolves `[]`.
|
|
2463
2494
|
*
|
|
2464
2495
|
* **Ordered newest first by `started_at`, with `job.seq` as the
|
|
2465
2496
|
* tiebreaker** (`started_at` alone is not a total order — two jobs minted
|
|
@@ -2477,7 +2508,7 @@ interface JobsApi {
|
|
|
2477
2508
|
* durable `seq`, with its actor, its outcome and its `duration_ms`, kept
|
|
2478
2509
|
* for 90 days. The durable counterpart of `list`.
|
|
2479
2510
|
*
|
|
2480
|
-
* **Needs the `
|
|
2511
|
+
* **Needs the `job_history` capability** for the caller's role, or it
|
|
2481
2512
|
* rejects `capability_required`. An app user sees only runs on the slugs
|
|
2482
2513
|
* their role grants; a developer session sees the whole robot.
|
|
2483
2514
|
*
|
|
@@ -2529,9 +2560,11 @@ interface PublishersApi {
|
|
|
2529
2560
|
*/
|
|
2530
2561
|
type McpExposure = McpExposure$1;
|
|
2531
2562
|
/**
|
|
2532
|
-
* The two
|
|
2533
|
-
* (may `jobs.history` be read) and `assets` (may the URDF
|
|
2534
|
-
*
|
|
2563
|
+
* The two capabilities of a robot as a whole that a datasheet names beyond
|
|
2564
|
+
* slugs: `job_history` (may `jobs.history` be read) and `assets` (may the URDF
|
|
2565
|
+
* and meshes be read). The robot's `access` section decides which roles hold
|
|
2566
|
+
* them, else the organization's defaults, less what the app locks. The wire
|
|
2567
|
+
* shape is contracts' `mcpCapabilities`.
|
|
2535
2568
|
*/
|
|
2536
2569
|
type McpCapabilities = McpCapabilities$1;
|
|
2537
2570
|
/**
|
|
@@ -2549,18 +2582,19 @@ interface RobotsApi {
|
|
|
2549
2582
|
* The robots this caller reaches, in name order with the id as the tiebreak.
|
|
2550
2583
|
*
|
|
2551
2584
|
* An app user reaches the robots their app attaches on which their role
|
|
2552
|
-
*
|
|
2553
|
-
*
|
|
2554
|
-
*
|
|
2555
|
-
*
|
|
2556
|
-
*
|
|
2585
|
+
* holds at least one slug or capability once the app's locks are taken off;
|
|
2586
|
+
* a server key reaches every robot its app attaches that the locks leave
|
|
2587
|
+
* something on. A robot nothing is granted on is absent rather than listed
|
|
2588
|
+
* empty — reach is a grant, not an attachment — so an app user whose role
|
|
2589
|
+
* holds nothing resolves `[]`, which is the robots' access rules talking, not
|
|
2590
|
+
* a broken login.
|
|
2557
2591
|
*/
|
|
2558
2592
|
list(): Promise<ClientRobotListItem[]>;
|
|
2559
2593
|
/**
|
|
2560
2594
|
* Everything the caller's role lets them do on one robot: every granted
|
|
2561
2595
|
* datapoint (with `unit` and `decimals`), action, service and publisher
|
|
2562
2596
|
* (with the parameter JSON Schema under `input_schema`) and camera, plus
|
|
2563
|
-
* the two capabilities that gate whole features, `
|
|
2597
|
+
* the two capabilities that gate whole features, `job_history` and
|
|
2564
2598
|
* `assets`. A robot with nothing published resolves an empty `exposures`
|
|
2565
2599
|
* list. One the caller does not reach rejects `not_found`, exactly as a
|
|
2566
2600
|
* robot that does not exist — never `forbidden`, which would say it exists.
|