@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/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,51 @@ All notable changes to `@fleetless/sdk`. The format follows Keep a Changelog; th
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [5.0.0] — 2026-11-06
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **Breaking: `ClientIdentity.role_id` is replaced by `role: { key, name } | null`.** It is what `auth.me()` resolves and what the realtime channel holds after authentication. `key` is the organization role's key, the one `fleetless.yaml` and the organization's role list write; `name` is its display name. `role` is `null` where there is no role to name: for a developer, for a server key, and for an app user whose role has since been deleted, who can still sign in and reaches nothing. Code that read `role_id` reads `role?.key` now.
|
|
12
|
+
- **Breaking: the datasheet's capabilities say `job_history` where they said `action_history`,** without an alias. `robots.describe()` resolves `capabilities: { job_history, assets }`; `job_history` is what `jobs.history()` needs, and a `capability_required` refusal names it. The doc comments say which roles hold a capability: the robot's `access` section, otherwise the organization's defaults, less what the app locks.
|
|
13
|
+
- **Breaking: `FleetlessErrorCode` loses `role_name_taken`, `role_in_use` and `last_role` and gains `role_cycle`, `role_key_taken` and `confirmation_required`** through `ErrorCode`. The six belong to the role management of the console; only `capability_required` reaches an app through this SDK. An exhaustive `switch` over `ErrorCode` changes its cases.
|
|
14
|
+
- Built against `@fleetless/contracts` 14.0.0.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **A short outage on the cloud's side no longer ends the realtime channel.** An `auth_error` of `internal_error` (the cloud could not check the credential) used to end the channel for good and was reported to every subscription through `onError`. It is now retried with backoff like a dropped connection, as is a close with code 1011 (the cloud could not re-check the connection's rights and asks for a new authentication). The wait grows from one failed attempt to the next and a retry never comes at once.
|
|
19
|
+
- **A connection the cloud ends with close code 4003 stops and says so.** The code means the credential behind an authenticated connection is no longer valid: the account was removed or blocked, the key was rotated, the session was ended. The channel used to reconnect with that credential first and end only when the cloud refused it. It now reports `token_revoked` to the subscriptions' `onError` at once and does not reconnect; the next `subscribe` or command opens a new connection with whatever credential the client holds by then. A command already sent when the connection ends fails with `command_outcome_unknown`, not `token_revoked`: its reply is lost with the connection and it may or may not have run, so read the job by slug (for example `actions.subscribe`) rather than retrying. A command still waiting for the connection to authenticate was never sent and fails with the authentication error itself.
|
|
20
|
+
|
|
21
|
+
### Also from contracts 12.0.0 to 14.0.0
|
|
22
|
+
|
|
23
|
+
4.6.1 was built against `@fleetless/contracts` 12.0.0; the jump also brought the changes of the 12.1 and 13.x releases. For code using this SDK:
|
|
24
|
+
|
|
25
|
+
- **`AssetSyncStatus`**, as `assets.syncStatus()` resolves it, gains an optional `file_limit` on a `refused` failure: the per-file limit that was exceeded and the file's size where known. It is exclusive with the store-full `details`; the failure kinds are unchanged.
|
|
26
|
+
- **`FleetlessErrorCode` gains `legal_offer_unavailable`** through `ErrorCode`. It refuses an organization's Terms offer in the console; an app user's session or a server key does not receive it.
|
|
27
|
+
- Doc comments of the datapoint, camera and invoke responses say what a role "may read" or "may use" where they said it "grants". No shape changed.
|
|
28
|
+
|
|
29
|
+
Nothing else this SDK re-exports or parses at runtime changed.
|
|
30
|
+
|
|
31
|
+
### Compatibility
|
|
32
|
+
|
|
33
|
+
- Against a cloud older than this release, `identity.role` and `capabilities.job_history` read `undefined`, and the old `role_id` and `action_history` are no longer typed.
|
|
34
|
+
|
|
35
|
+
## [4.6.1] — 2026-11-03
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- **`auth.signInMethods()` checks `twoFactor` instead of passing the wire value through.** A cloud that predates the policy field sends none, and a value outside `off | optional | required` was handed on unchecked under a type that promised one of the three. Both now come back as `twoFactor: null`, and the type is `'off' | 'optional' | 'required' | null`; the SDK never substitutes a default. Treat `null` as a failed policy read — offer no two-factor action and let the person retry, never read it as `'off'`; the cloud still enforces its own policy at sign-in. `password` and `emailCode` are mapped as before, so a login screen keeps working against an older cloud, and `listProviders()` is unchanged. Code that assigns `twoFactor` to the three-value union now has to handle `null`.
|
|
40
|
+
|
|
41
|
+
### Also in 4.6.0
|
|
42
|
+
|
|
43
|
+
4.6.0 moved the bundled `@fleetless/contracts` from 6.2.0 to 12.0.0 and named only `twoFactor`. For code using this SDK, the jump also brought:
|
|
44
|
+
|
|
45
|
+
- **`FleetlessErrorCode` gains eight codes through `ErrorCode`:** `operator_verified_stopped`, `job_state_conflict`, `billing_unavailable`, `payment_provider_unavailable`, `history_migrating`, `billing_documents_unavailable`, `support_read_only` and `support_forbidden`. Only `operator_verified_stopped` reaches an app through this SDK: it is the `error.code` of a final `lost` job that an org Owner released after verifying that the robot is physically stopped. The other seven refuse org billing, slug renames, held-job recovery and console support sessions; an app user's session or a server key does not receive them. An exhaustive `switch` over `ErrorCode` gains the cases.
|
|
46
|
+
- **`ClientRobotListItem.bridge_state`**, as `robots.list()` resolves it, gains an optional, nullable `health_reason`; its one value, `'job_query_unanswered'`, means the cloud saw the bridge leave a job query unanswered. Older clouds omit it.
|
|
47
|
+
- **`job_lost` is defined more precisely:** a final `lost` job whose terminal goal result could not be recovered within the bounded wait, or a loss with no more specific cause; `error.message` says which. `action_server_lost` and `job_unknown_to_bridge` keep their meaning. No code or shape changed.
|
|
48
|
+
- Doc comments name the MCP actions `robots.list` and `robots.describe` instead of the former tool names. No shape changed.
|
|
49
|
+
|
|
50
|
+
Nothing else this SDK re-exports or parses at runtime changed.
|
|
51
|
+
|
|
7
52
|
## [4.6.0] — 2026-11-03
|
|
8
53
|
|
|
9
54
|
### Added
|
package/README.md
CHANGED
|
@@ -96,6 +96,8 @@ Before drawing your app's sign-in screen, read its public policy:
|
|
|
96
96
|
```ts
|
|
97
97
|
const { password, emailCode, twoFactor } = await client.auth.signInMethods()
|
|
98
98
|
// twoFactor is 'off', 'optional' or 'required'; it is app policy, not enrollment.
|
|
99
|
+
// It is null when the cloud sends no policy the SDK recognises (an older cloud):
|
|
100
|
+
// treat that as a failed read and offer no two-factor action, never as 'off'.
|
|
99
101
|
// listProviders() separately returns only federated sign-in buttons.
|
|
100
102
|
```
|
|
101
103
|
|