@fleetless/sdk 3.0.1 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +101 -10
- package/CONTRIBUTING.md +76 -70
- package/README.md +65 -319
- package/SECURITY.md +11 -11
- package/dist/index.cjs +44 -45
- package/dist/index.d.cts +80 -99
- package/dist/index.d.ts +80 -99
- package/dist/index.js +44 -45
- package/package.json +7 -6
package/dist/index.cjs
CHANGED
|
@@ -144,7 +144,7 @@ var HttpClient = class {
|
|
|
144
144
|
* RequestOptionsFor<P>` would type-check by construction — the cast
|
|
145
145
|
* bypasses the very check this exists to add, which is the identical
|
|
146
146
|
* "special case that quietly exempts calls from the general rule" shape
|
|
147
|
-
* this file has already
|
|
147
|
+
* this file has already made once. Every current call site to a route
|
|
148
148
|
* with no body already passes `{}` explicitly for exactly this reason.
|
|
149
149
|
*/
|
|
150
150
|
async request(path, options) {
|
|
@@ -334,7 +334,7 @@ function createAssetsApi(http) {
|
|
|
334
334
|
finish(
|
|
335
335
|
null,
|
|
336
336
|
new Error(
|
|
337
|
-
`createMeshLoader and prepareUrdfScene were both installed on the same LoadingManager for robot ${robotId}. Use one or the other on a given manager, not both \u2014 see the
|
|
337
|
+
`createMeshLoader and prepareUrdfScene were both installed on the same LoadingManager for robot ${robotId}. Use one or the other on a given manager, not both \u2014 see the SDK reference.`
|
|
338
338
|
)
|
|
339
339
|
);
|
|
340
340
|
return;
|
|
@@ -441,7 +441,7 @@ function createAssetsApi(http) {
|
|
|
441
441
|
};
|
|
442
442
|
}
|
|
443
443
|
|
|
444
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
444
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/common.js
|
|
445
445
|
var import_zod = require("zod");
|
|
446
446
|
var SLUG_RULE = "A name is lower-case: it starts with a letter, continues with letters and digits, and joins further words with a single underscore \u2014 `battery_voltage`. Capitals, dashes, dots, spaces, a leading digit and a doubled or trailing underscore are all refused.";
|
|
447
447
|
var slug = import_zod.z.string().min(2).max(63).regex(/^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/, SLUG_RULE);
|
|
@@ -465,7 +465,7 @@ var applyError = import_zod.z.object({
|
|
|
465
465
|
details: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional()
|
|
466
466
|
});
|
|
467
467
|
|
|
468
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
468
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/mcp.js
|
|
469
469
|
var import_zod2 = require("zod");
|
|
470
470
|
function mcpAppEndpointPath(appIdentifier2) {
|
|
471
471
|
return `/mcp/${appIdentifier2}`;
|
|
@@ -514,10 +514,10 @@ var mcpRolePreviewResponse = import_zod2.z.object({
|
|
|
514
514
|
});
|
|
515
515
|
var MCP_ASSET_LINK_TTL_MS = 15 * 60 * 1e3;
|
|
516
516
|
|
|
517
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
517
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/protocol.js
|
|
518
518
|
var import_zod8 = require("zod");
|
|
519
519
|
|
|
520
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
520
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/assets.js
|
|
521
521
|
var import_zod3 = require("zod");
|
|
522
522
|
var assetKind = import_zod3.z.enum(["urdf", "mesh", "texture", "other"]);
|
|
523
523
|
var asset = import_zod3.z.object({
|
|
@@ -775,10 +775,10 @@ var assetSyncBusyDetails = import_zod3.z.object({
|
|
|
775
775
|
started_at_ms: import_zod3.z.number().int().nonnegative()
|
|
776
776
|
});
|
|
777
777
|
|
|
778
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
778
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/config.js
|
|
779
779
|
var import_zod5 = require("zod");
|
|
780
780
|
|
|
781
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
781
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/alerts.js
|
|
782
782
|
var import_zod4 = require("zod");
|
|
783
783
|
var alertRowCondition = import_zod4.z.discriminatedUnion("kind", [
|
|
784
784
|
import_zod4.z.strictObject({
|
|
@@ -848,7 +848,7 @@ var putDatapointDisplayRequest = import_zod4.z.object({
|
|
|
848
848
|
y_max: import_zod4.z.number().finite().nullable()
|
|
849
849
|
}).strict();
|
|
850
850
|
|
|
851
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
851
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/config.js
|
|
852
852
|
var RTSP_URL_RULE = "The URL has to begin with `rtsp://` or `rtsps://` \u2014 `rtsp://cam-1.plant.local/stream1`. No other scheme is accepted: the bridge opens this with a library that would equally honour `file:`.";
|
|
853
853
|
var MJPEG_URL_RULE = "The URL has to begin with `http://` or `https://` \u2014 `http://cam-1.plant.local/video.mjpg`. No other scheme is accepted: the bridge opens this with a library that would equally serve `file:`.";
|
|
854
854
|
var DEVICE_PATH_RULE = "A capture device is a path under `/dev/`, and the character straight after it is a letter or a digit \u2014 `/dev/video0`, or a stable `/dev/v4l/by-id/...` symlink. Nothing outside `/dev/` is accepted: the string reaches OpenCV, which would as happily open an ordinary file.";
|
|
@@ -1895,7 +1895,7 @@ var configState = import_zod5.z.object({
|
|
|
1895
1895
|
applied_errors: import_zod5.z.array(applyError).nullable()
|
|
1896
1896
|
});
|
|
1897
1897
|
|
|
1898
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
1898
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/introspection.js
|
|
1899
1899
|
var import_zod6 = require("zod");
|
|
1900
1900
|
var rosGraphEntry = import_zod6.z.object({
|
|
1901
1901
|
name: rosName,
|
|
@@ -1934,7 +1934,7 @@ var typeDefinition = import_zod6.z.discriminatedUnion("kind", [
|
|
|
1934
1934
|
})
|
|
1935
1935
|
]);
|
|
1936
1936
|
|
|
1937
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
1937
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/jobs.js
|
|
1938
1938
|
var import_zod7 = require("zod");
|
|
1939
1939
|
var jobState = import_zod7.z.enum(["running", "succeeded", "failed", "cancelled", "lost"]);
|
|
1940
1940
|
var job = import_zod7.z.object({
|
|
@@ -2152,7 +2152,7 @@ var jobRunSummary = import_zod7.z.object({
|
|
|
2152
2152
|
since_ms: import_zod7.z.number().int().nonnegative()
|
|
2153
2153
|
});
|
|
2154
2154
|
|
|
2155
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
2155
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/protocol.js
|
|
2156
2156
|
var MAX_PATIENCE_MS = 12e4;
|
|
2157
2157
|
var MIN_PATIENCE_MS = 1e3;
|
|
2158
2158
|
var activeJob = import_zod8.z.object({
|
|
@@ -2551,11 +2551,11 @@ var bridgeCameraState = import_zod8.z.object({
|
|
|
2551
2551
|
request_id: import_zod8.z.string().min(1).max(64).nullable()
|
|
2552
2552
|
});
|
|
2553
2553
|
|
|
2554
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
2554
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/config-issues.js
|
|
2555
2555
|
var EXPOSURE_SECTIONS = ["datapoints", "actions", "services", "publishers", "cameras"];
|
|
2556
2556
|
var EXPOSURE_SECTION_NAMES = new Set(EXPOSURE_SECTIONS);
|
|
2557
2557
|
|
|
2558
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
2558
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/rest.js
|
|
2559
2559
|
var import_zod9 = require("zod");
|
|
2560
2560
|
var robot = import_zod9.z.object({
|
|
2561
2561
|
id: import_zod9.z.uuid().meta({
|
|
@@ -3315,13 +3315,13 @@ var slugUsageResponse = import_zod9.z.object({
|
|
|
3315
3315
|
alert_count: import_zod9.z.number().int().nonnegative()
|
|
3316
3316
|
});
|
|
3317
3317
|
|
|
3318
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
3318
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/realtime.js
|
|
3319
3319
|
var import_zod14 = require("zod");
|
|
3320
3320
|
|
|
3321
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
3321
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/client-auth.js
|
|
3322
3322
|
var import_zod13 = require("zod");
|
|
3323
3323
|
|
|
3324
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
3324
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/apps.js
|
|
3325
3325
|
var import_zod10 = require("zod");
|
|
3326
3326
|
var appIdentifier = slug;
|
|
3327
3327
|
var app = import_zod10.z.object({
|
|
@@ -3503,10 +3503,10 @@ var rolePermissions = import_zod10.z.object({
|
|
|
3503
3503
|
})
|
|
3504
3504
|
});
|
|
3505
3505
|
|
|
3506
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
3506
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/app-users.js
|
|
3507
3507
|
var import_zod12 = require("zod");
|
|
3508
3508
|
|
|
3509
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
3509
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/identity.js
|
|
3510
3510
|
var import_zod11 = require("zod");
|
|
3511
3511
|
var password = import_zod11.z.string().min(12).max(256);
|
|
3512
3512
|
var USER_DISPLAY_NAME_MAX = 120;
|
|
@@ -3668,7 +3668,7 @@ var authMeResponse = import_zod11.z.object({ org, user: fleetlessUser });
|
|
|
3668
3668
|
var patchOrgRequest = import_zod11.z.object({ name: import_zod11.z.string().min(1).max(120) }).strict();
|
|
3669
3669
|
var patchAuthMeRequest = import_zod11.z.object({ display_name: import_zod11.z.string().min(1).max(USER_DISPLAY_NAME_MAX).nullable() }).strict();
|
|
3670
3670
|
|
|
3671
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
3671
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/app-users.js
|
|
3672
3672
|
var APP_USER_DISPLAY_NAME_MAX = 120;
|
|
3673
3673
|
var providerSlug = import_zod12.z.string().max(40).regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/, "a provider slug is lowercase and hyphen-separated, starting with a letter");
|
|
3674
3674
|
var appUserStatus = import_zod12.z.enum(["pending_verification", "active", "blocked"]);
|
|
@@ -3919,7 +3919,7 @@ var mailOutcome = import_zod12.z.object({
|
|
|
3919
3919
|
})
|
|
3920
3920
|
});
|
|
3921
3921
|
|
|
3922
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
3922
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/client-auth.js
|
|
3923
3923
|
var clientLoginRequest = import_zod13.z.object({
|
|
3924
3924
|
app_identifier: appIdentifier.meta({
|
|
3925
3925
|
description: "The app being logged in to, as its globally unique identifier \u2014 the lowercase, underscore-separated string the developer chose when the app was created. There is no organisation context at login, so this is what decides which app the credentials are checked for."
|
|
@@ -4108,7 +4108,7 @@ var clientIdentity = import_zod13.z.object({
|
|
|
4108
4108
|
})
|
|
4109
4109
|
});
|
|
4110
4110
|
|
|
4111
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
4111
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/realtime.js
|
|
4112
4112
|
var clientAuth = import_zod14.z.object({
|
|
4113
4113
|
type: import_zod14.z.literal("auth"),
|
|
4114
4114
|
token: import_zod14.z.string().min(1)
|
|
@@ -4386,7 +4386,7 @@ var orgEventDropped = import_zod14.z.object({
|
|
|
4386
4386
|
dropped: import_zod14.z.number().int().positive()
|
|
4387
4387
|
}).strict();
|
|
4388
4388
|
|
|
4389
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
4389
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/audit.js
|
|
4390
4390
|
var import_zod15 = require("zod");
|
|
4391
4391
|
var auditActor = import_zod15.z.object({
|
|
4392
4392
|
kind: import_zod15.z.enum(["developer", "end_user", "app_user", "server_key", "bridge"]),
|
|
@@ -4517,7 +4517,7 @@ var auditListResponse = import_zod15.z.object({
|
|
|
4517
4517
|
next_cursor: import_zod15.z.number().int().positive().nullable()
|
|
4518
4518
|
});
|
|
4519
4519
|
|
|
4520
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
4520
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/errors.js
|
|
4521
4521
|
var import_zod16 = require("zod");
|
|
4522
4522
|
var apiError = import_zod16.z.object({
|
|
4523
4523
|
code: import_zod16.z.string().min(1),
|
|
@@ -4534,7 +4534,7 @@ var parameterInvalidDetails = import_zod16.z.object({
|
|
|
4534
4534
|
violations: import_zod16.z.array(parameterViolation).min(1)
|
|
4535
4535
|
});
|
|
4536
4536
|
|
|
4537
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
4537
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/oauth.js
|
|
4538
4538
|
var import_zod17 = require("zod");
|
|
4539
4539
|
var oauthErrorCode = import_zod17.z.enum([
|
|
4540
4540
|
"invalid_request",
|
|
@@ -4755,7 +4755,7 @@ var oauthAuthorizeQuery = import_zod17.z.object({
|
|
|
4755
4755
|
description: "The authorization request an MCP client sends, per RFC 6749 \xA74.1.1 with mandatory PKCE. The handler reads it parameter by parameter rather than through one parse, because the answers differ: `client_id` and `redirect_uri` are refused flat, with no redirect, since until both are confirmed there is no trusted target to bounce a browser to, and everything after them is reported to the client's own callback as query parameters."
|
|
4756
4756
|
});
|
|
4757
4757
|
|
|
4758
|
-
// node_modules/.pnpm/@fleetless+contracts@1.0.
|
|
4758
|
+
// node_modules/.pnpm/@fleetless+contracts@1.0.5/node_modules/@fleetless/contracts/dist/routes.js
|
|
4759
4759
|
var MCP_APP = MCP_APP_PATHS(":appIdentifier");
|
|
4760
4760
|
var APP_IDENTIFIER = {
|
|
4761
4761
|
name: "appIdentifier",
|
|
@@ -6355,7 +6355,7 @@ var ROUTES = [
|
|
|
6355
6355
|
response: null,
|
|
6356
6356
|
errors: ["not_found", "unauthorized", "forbidden"],
|
|
6357
6357
|
transport: "http",
|
|
6358
|
-
notes: "MCP's Streamable HTTP gives this path three verbs: `POST` carries JSON-RPC, `GET` opens the server-initiated SSE stream, and `DELETE` ends a session. This server has no sessions \u2014 the argument is in `MCP_PROTOCOL_VERSION`'s own note, and a per-process session map is what breaks at the second cloud instance \u2014 so `GET` and `DELETE` answer `405`, which is what a client is built to fall back from. \n\n**The `405` is this cloud's own answer, not the SDK's**, and the two differ: MCP SDK 1.30.0 opens an SSE stream on `GET` (`handleGetRequest`) and answers `200` on `DELETE` (`handleDeleteRequest`), neither of which a stateless server has any business doing, so the cloud writes the `405` itself in the transport's own JSON-RPC error shape with `Allow: POST`. \n\n**The row exists so that the `405` is not a `404`.** An unregistered verb answers `404`, and at a path whose last segment is an app identifier a `404` already means *no such app* \u2014
|
|
6358
|
+
notes: "MCP's Streamable HTTP gives this path three verbs: `POST` carries JSON-RPC, `GET` opens the server-initiated SSE stream, and `DELETE` ends a session. This server has no sessions \u2014 the argument is in `MCP_PROTOCOL_VERSION`'s own note, and a per-process session map is what breaks at the second cloud instance \u2014 so `GET` and `DELETE` answer `405`, which is what a client is built to fall back from. \n\n**The `405` is this cloud's own answer, not the SDK's**, and the two differ: MCP SDK 1.30.0 opens an SSE stream on `GET` (`handleGetRequest`) and answers `200` on `DELETE` (`handleDeleteRequest`), neither of which a stateless server has any business doing, so the cloud writes the `405` itself in the transport's own JSON-RPC error shape with `Allow: POST`. \n\n**The row exists so that the `405` is not a `404`.** An unregistered verb answers `404`, and at a path whose last segment is an app identifier a `404` already means *no such app* \u2014 so an unregistered verb and an unknown app would answer identically. Registering the verb lets the endpoint say \"this app's server is here; this verb is not part of it\". The central `/mcp` registers neither verb and does not need to: its path takes no parameter, so nothing can misread its `404`. \n\n**The `405` body is the transport's JSON-RPC error object, not the `apiError` envelope.** The three codes above are the refusals that come *first* \u2014 the app, its switch, then the bearer, in the order `POST` describes \u2014 and they are `apiError` because they are answered before the transport is reached at all. If this server ever becomes stateful, this row and the `DELETE` beside it are where that lands, and the cloud's route-manifest test is what would make both repositories notice."
|
|
6359
6359
|
},
|
|
6360
6360
|
{
|
|
6361
6361
|
method: "DELETE",
|
|
@@ -7320,7 +7320,7 @@ var ROUTES = [
|
|
|
7320
7320
|
response: jobRunListResponse,
|
|
7321
7321
|
errors: [...CLIENT_GUARD, "invalid_uuid", "not_found", "capability_required", "validation_error"],
|
|
7322
7322
|
transport: "http",
|
|
7323
|
-
notes: "Needs the `action_history` capability, and **this route is what makes that switch mean something** \u2014 it was unkeepable while nothing durable recorded what had run. Two residuals worth stating rather than implying away. `history` is a syntactically valid slug and
|
|
7323
|
+
notes: "Needs the `action_history` capability, and **this route is what makes that switch mean something** \u2014 it was unkeepable while nothing durable recorded what had run. Two residuals worth stating rather than implying away. `history` is a syntactically valid slug, and a static segment matches before a parameter, so a robot with a service literally slugged `history` can no longer be **read** through `GET /api/robots/:id/jobs/:slug`; invoking, cancelling and the listing are unaffected. And a run row names its actor by email address, so an end user holding this capability learns which other people have been driving the machine. `robot_id` in the query is shared with the org-wide read; a *different* one here is refused rather than quietly answered about the robot in the path."
|
|
7324
7324
|
},
|
|
7325
7325
|
{
|
|
7326
7326
|
method: "POST",
|
|
@@ -8332,21 +8332,21 @@ function assertValidJobId(jobId) {
|
|
|
8332
8332
|
if (jobId === void 0 || jobId === null || typeof jobId === "string") return;
|
|
8333
8333
|
throw new FleetlessError(
|
|
8334
8334
|
"invalid_option",
|
|
8335
|
-
`cancel()'s third argument must be a job id (string), null, or omitted \u2014 got ${typeof jobId === "object" ? "an object" : typeof jobId}. If you are passing an options object (e.g. {timeoutMs}) as the third argument, note the signature changed in this release: cancel(robotId, slug) is unchanged, but a third positional argument is now the job id to cancel and options moved to a fourth argument \u2014 cancel(robotId, slug, jobId, options). See the
|
|
8335
|
+
`cancel()'s third argument must be a job id (string), null, or omitted \u2014 got ${typeof jobId === "object" ? "an object" : typeof jobId}. If you are passing an options object (e.g. {timeoutMs}) as the third argument, note the signature changed in this release: cancel(robotId, slug) is unchanged, but a third positional argument is now the job id to cancel and options moved to a fourth argument \u2014 cancel(robotId, slug, jobId, options). See the Actions section of the SDK reference at https://docs.fleetless.dev/reference/sdk/`
|
|
8336
8336
|
);
|
|
8337
8337
|
}
|
|
8338
8338
|
function createRealtimeCommandTransport(channel) {
|
|
8339
8339
|
return {
|
|
8340
|
-
// Declared `async` deliberately, unlike `cancel`/`publish` below: it
|
|
8340
|
+
// Declared `async` deliberately, unlike `cancel`/`publish` below: it's
|
|
8341
8341
|
// the only one of the three that can refuse *before* sending anything
|
|
8342
|
-
// (resolveLocalWaitMs's `invalid_option
|
|
8343
|
-
//
|
|
8344
|
-
//
|
|
8345
|
-
//
|
|
8346
|
-
//
|
|
8347
|
-
//
|
|
8348
|
-
//
|
|
8349
|
-
//
|
|
8342
|
+
// (`resolveLocalWaitMs`'s `invalid_option`), and every caller of this
|
|
8343
|
+
// interface — starting with this file's own `sendCommand` callers —
|
|
8344
|
+
// assumes `CommandTransport.invoke` always returns a promise, never
|
|
8345
|
+
// throws synchronously. Without `async` here, a synchronous throw from
|
|
8346
|
+
// `resolveLocalWaitMs` would escape as a thrown exception instead of a
|
|
8347
|
+
// rejection, breaking that assumption for a caller that isn't itself
|
|
8348
|
+
// inside an `async` function (e.g. a test calling this transport
|
|
8349
|
+
// directly).
|
|
8350
8350
|
async invoke(robotId, slug2, params, options) {
|
|
8351
8351
|
const timeoutMs = resolveLocalWaitMs(options ?? {}, DEFAULT_COMMAND_TIMEOUT_MS);
|
|
8352
8352
|
const frame = {
|
|
@@ -8546,12 +8546,11 @@ var RealtimeChannel = class {
|
|
|
8546
8546
|
}
|
|
8547
8547
|
/**
|
|
8548
8548
|
* Increments on every successful authentication (first connect and every
|
|
8549
|
-
* reconnect). A command sent on one
|
|
8550
|
-
*
|
|
8551
|
-
*
|
|
8552
|
-
*
|
|
8553
|
-
*
|
|
8554
|
-
* than after a timeout elapses.
|
|
8549
|
+
* reconnect). A command sent on one socket can only be answered on that
|
|
8550
|
+
* socket — comparing the epoch at send time against the current one is
|
|
8551
|
+
* how a caller (see `commands.ts`) tells "still waiting on the connection
|
|
8552
|
+
* it was sent over" from "that connection is gone and a new one has taken
|
|
8553
|
+
* its place", the moment it happens rather than after a timeout elapses.
|
|
8555
8554
|
*/
|
|
8556
8555
|
get connectionEpoch() {
|
|
8557
8556
|
return this.#connectionEpoch;
|
|
@@ -8852,7 +8851,7 @@ function createSlugSubscriptions(channel) {
|
|
|
8852
8851
|
// src/token-store.ts
|
|
8853
8852
|
var InMemoryTokenStore = class {
|
|
8854
8853
|
#session = null;
|
|
8855
|
-
/**
|
|
8854
|
+
/** Nothing is loaded from anywhere — a client built with it starts logged out. */
|
|
8856
8855
|
constructor() {
|
|
8857
8856
|
}
|
|
8858
8857
|
/** Returns the session held in memory, or `null` if there is none. */
|