@fleetless/sdk 4.0.0 → 4.1.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 +17 -1
- package/CONTRIBUTING.md +3 -2
- package/dist/index.cjs +208 -55
- package/dist/index.d.cts +76 -9
- package/dist/index.d.ts +76 -9
- package/dist/index.js +208 -55
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
All notable changes to `@fleetless/sdk`. The format follows Keep a Changelog; the versions follow semver.
|
|
3
|
+
All notable changes to `@fleetless/sdk`. The format follows Keep a Changelog; the versions follow semver. A pull request that changes what a consumer sees adds its entry under `## [Unreleased]`; the release renames that heading to the version.
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [4.1.0] — 2026-09-30
|
|
8
|
+
|
|
9
|
+
Built against `@fleetless/contracts` 5.0.0. Two changes to `Job` a consumer's code sees, so the next release is a major.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **`JobOrigin`** is re-exported: the type of `Job.origin`.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **`Job.origin` is required**: `fleetless` for a job the cloud minted from an invocation, `external` for a goal the bridge found running on a published action without having sent it — started by anything else on the robot's ROS graph, or its own goal after the bridge lost the mapping. An external job has no parameters and no starter, and never appears in `jobs.history`. A hand-built `Job` (a test fixture, a mock) now needs the field.
|
|
18
|
+
- **`actions.cancel` is answered by the robot's action server.** It resolves once the server accepted the cancel, with the job usually still `running` — the end arrives as the job's own update. It rejects `cancel_rejected` when the server refused (`ERROR_REJECTED`), with `error.details.goals` listing each goal the cancel reached as `{ job_id, goal_id, return_code }` (`0`–`3`, or `null` when that goal's server did not answer); `bridge_timeout` when the bridge did not answer in time; and with the bridge's own code (e.g. `action_server_lost`) when it could not ask at all. Code that treated a resolved cancel as a stopped goal, or every rejection as "nothing was cancelled", needs to read these apart. Cancelling an `unknown` job cancels every `external` goal on its action.
|
|
19
|
+
- **`JobState` gains `unknown`**: the cloud cannot currently say whether the job is still running — the robot went offline, or its bridge did not report in time. Not terminal: only the robot's bridge moves the job on, to `running` or to how it ended. `lost` is now final. An exhaustive `switch` over `JobState` needs the new case; `services.call` keeps waiting through `unknown`, and `jobs.history` takes `state: 'unknown'`.
|
|
4
20
|
|
|
5
21
|
## [4.0.0] — 2026-09-22
|
|
6
22
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -93,8 +93,9 @@ tell you what else has to move with it.
|
|
|
93
93
|
|
|
94
94
|
**CI runs on GitHub Actions**, in this repository
|
|
95
95
|
(`.github/workflows/verify.yml`) — the suite, on every push and every pull
|
|
96
|
-
request. `release.yml`
|
|
97
|
-
|
|
96
|
+
request. `release.yml` (the **Release** button) calls that same file on the
|
|
97
|
+
commit it publishes, so a release is never checked by a different pipeline
|
|
98
|
+
than a push.
|
|
98
99
|
|
|
99
100
|
**Your pull request is verified, a fork's included** — the same suite, the
|
|
100
101
|
same file. GitHub holds a first-time contributor's first run until a
|
package/dist/index.cjs
CHANGED
|
@@ -440,7 +440,7 @@ function createAssetsApi(http) {
|
|
|
440
440
|
};
|
|
441
441
|
}
|
|
442
442
|
|
|
443
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
443
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/common.js
|
|
444
444
|
var import_zod = require("zod");
|
|
445
445
|
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.";
|
|
446
446
|
var slug = import_zod.z.string().min(2).max(63).regex(/^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/, SLUG_RULE);
|
|
@@ -471,7 +471,7 @@ var applyError = import_zod.z.object({
|
|
|
471
471
|
details: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional()
|
|
472
472
|
});
|
|
473
473
|
|
|
474
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
474
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/mcp.js
|
|
475
475
|
var import_zod2 = require("zod");
|
|
476
476
|
function mcpAppEndpointPath(appIdentifier2) {
|
|
477
477
|
return `/mcp/${appIdentifier2}`;
|
|
@@ -520,10 +520,10 @@ var mcpRolePreviewResponse = import_zod2.z.object({
|
|
|
520
520
|
});
|
|
521
521
|
var MCP_ASSET_LINK_TTL_MS = 15 * 60 * 1e3;
|
|
522
522
|
|
|
523
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
523
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/protocol.js
|
|
524
524
|
var import_zod8 = require("zod");
|
|
525
525
|
|
|
526
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
526
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/assets.js
|
|
527
527
|
var import_zod3 = require("zod");
|
|
528
528
|
var assetKind = import_zod3.z.enum(["urdf", "mesh", "texture"]);
|
|
529
529
|
var asset = import_zod3.z.object({
|
|
@@ -843,10 +843,10 @@ var assetSyncBusyDetails = import_zod3.z.object({
|
|
|
843
843
|
started_at_ms: import_zod3.z.number().int().nonnegative()
|
|
844
844
|
});
|
|
845
845
|
|
|
846
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
846
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/config.js
|
|
847
847
|
var import_zod5 = require("zod");
|
|
848
848
|
|
|
849
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
849
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/alerts.js
|
|
850
850
|
var import_zod4 = require("zod");
|
|
851
851
|
var alertRowCondition = import_zod4.z.discriminatedUnion("kind", [
|
|
852
852
|
import_zod4.z.strictObject({
|
|
@@ -916,7 +916,7 @@ var putDatapointDisplayRequest = import_zod4.z.object({
|
|
|
916
916
|
y_max: import_zod4.z.number().finite().nullable()
|
|
917
917
|
}).strict();
|
|
918
918
|
|
|
919
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
919
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/config.js
|
|
920
920
|
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:`.";
|
|
921
921
|
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:`.";
|
|
922
922
|
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.";
|
|
@@ -2008,7 +2008,7 @@ var configState = import_zod5.z.object({
|
|
|
2008
2008
|
applied_errors: import_zod5.z.array(applyError).nullable()
|
|
2009
2009
|
});
|
|
2010
2010
|
|
|
2011
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2011
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/introspection.js
|
|
2012
2012
|
var import_zod6 = require("zod");
|
|
2013
2013
|
var rosGraphEntry = import_zod6.z.object({
|
|
2014
2014
|
name: rosName,
|
|
@@ -2047,9 +2047,11 @@ var typeDefinition = import_zod6.z.discriminatedUnion("kind", [
|
|
|
2047
2047
|
})
|
|
2048
2048
|
]);
|
|
2049
2049
|
|
|
2050
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2050
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/jobs.js
|
|
2051
2051
|
var import_zod7 = require("zod");
|
|
2052
|
-
var jobState = import_zod7.z.enum(["running", "succeeded", "failed", "cancelled", "lost"]);
|
|
2052
|
+
var jobState = import_zod7.z.enum(["running", "unknown", "succeeded", "failed", "cancelled", "lost"]);
|
|
2053
|
+
var reportedJobState = jobState.exclude(["unknown"]);
|
|
2054
|
+
var jobOrigin = import_zod7.z.enum(["fleetless", "external"]);
|
|
2053
2055
|
var job = import_zod7.z.object({
|
|
2054
2056
|
id: import_zod7.z.uuid().meta({
|
|
2055
2057
|
description: "The job's id, minted by the cloud when the invocation is accepted. Informative \u2014 state is observed by slug; a cancel names this id to stop one specific job rather than whatever is running."
|
|
@@ -2059,7 +2061,10 @@ var job = import_zod7.z.object({
|
|
|
2059
2061
|
description: "The action or service this job is running, as the published configuration exposes it. One slug carries one job at a time, so every observer of that slug sees the same one."
|
|
2060
2062
|
}),
|
|
2061
2063
|
state: jobState.meta({
|
|
2062
|
-
description: "Where the job stands: `running`, `succeeded`, `failed`, `cancelled` or `lost`. `
|
|
2064
|
+
description: "Where the job stands: `running`, `unknown`, `succeeded`, `failed`, `cancelled` or `lost`. `unknown` is not an outcome \u2014 the robot went offline or silent and the cloud does not know yet; the slug stays occupied and the bridge's next statement resolves it, `error` naming why the cloud lost sight of it. `lost` is final: the bridge stated it does not know the job and nothing else runs on its action, or the action server vanished mid-goal."
|
|
2065
|
+
}),
|
|
2066
|
+
origin: jobOrigin.meta({
|
|
2067
|
+
description: "Who started this job. `fleetless` for everything minted by the cloud; `external` for a goal the bridge found active on a published action without having sent it \u2014 no parameters, no starter, never written to `job_runs`."
|
|
2063
2068
|
}),
|
|
2064
2069
|
started_at: import_zod7.z.iso.datetime().meta({
|
|
2065
2070
|
description: "When the cloud minted this job, as an ISO 8601 timestamp. For a job adopted from a reconnecting bridge, this is **adoption time**, not the real start \u2014 the cloud never minted it."
|
|
@@ -2078,7 +2083,7 @@ var job = import_zod7.z.object({
|
|
|
2078
2083
|
* exists for the same reason on the audit log.
|
|
2079
2084
|
*
|
|
2080
2085
|
* **Scoped honestly: per cloud process, per run.** Job state lives in memory
|
|
2081
|
-
* — that is why `lost`
|
|
2086
|
+
* — that is why `unknown` and `lost` exist at all — so this counter restarts when
|
|
2082
2087
|
* the cloud does, alongside the jobs it orders. Sound, because it only ever
|
|
2083
2088
|
* orders jobs that coexist in one registry — and stated, because a reader
|
|
2084
2089
|
* who assumed `auditEvent.seq`'s durable semantics would be wrong.
|
|
@@ -2113,7 +2118,7 @@ var job = import_zod7.z.object({
|
|
|
2113
2118
|
description: "The structured payload belonging to `code`, for the codes that document one \u2014 `job_queue_full` carries its `limit` and its `queued` count here. Absent for a failure with nothing structured to add, which is most of them."
|
|
2114
2119
|
})
|
|
2115
2120
|
}).nullable().meta({
|
|
2116
|
-
description: "Why the job failed: a human `message`, a `code` where one exists, and `details` for the codes that carry a documented payload. `
|
|
2121
|
+
description: "Why the job failed, or why the cloud does not know how it stands: a human `message`, a `code` where one exists, and `details` for the codes that carry a documented payload. Set on `failed` and `lost`, and on `unknown` \u2014 where `code` is `bridge_disconnected` or `bridge_timeout`, the cloud's own reason for not knowing, cleared when the bridge reports the job running again."
|
|
2117
2122
|
})
|
|
2118
2123
|
});
|
|
2119
2124
|
var jobEvent = import_zod7.z.object({
|
|
@@ -2172,16 +2177,16 @@ var jobRun = import_zod7.z.object({
|
|
|
2172
2177
|
description: "Whether the slug was an `action` or a `service`."
|
|
2173
2178
|
}),
|
|
2174
2179
|
state: jobState.meta({
|
|
2175
|
-
description: "How the run ended, or `running` while it is still going. `lost`
|
|
2180
|
+
description: "How the run ended, or `running` while it is still going. `unknown` while the robot has not accounted for it \u2014 offline or silent \u2014 and updated once the bridge says how it stands. `lost` is final: the bridge did not know the run and nothing else ran on its action, so the outcome is unknowable rather than unknown."
|
|
2176
2181
|
}),
|
|
2177
2182
|
started_at: import_zod7.z.iso.datetime().meta({
|
|
2178
2183
|
description: "When the run started, as an ISO 8601 timestamp. Runs are listed and filtered by this instant."
|
|
2179
2184
|
}),
|
|
2180
2185
|
ended_at: import_zod7.z.iso.datetime().nullable().meta({
|
|
2181
|
-
description: "When the run finished, as an ISO 8601 timestamp. `null` while it is still `running` \u2014 a run has an end only once it has one."
|
|
2186
|
+
description: "When the run finished, as an ISO 8601 timestamp. `null` while it is still `running` or `unknown` \u2014 a run has an end only once it has one."
|
|
2182
2187
|
}),
|
|
2183
2188
|
duration_ms: import_zod7.z.number().int().nonnegative().nullable().meta({
|
|
2184
|
-
description: 'How long the run took, in milliseconds. `null` while it is still `running`, never `0` standing in for "nothing so far".'
|
|
2189
|
+
description: 'How long the run took, in milliseconds. `null` while it is still `running` or `unknown`, never `0` standing in for "nothing so far".'
|
|
2185
2190
|
}),
|
|
2186
2191
|
result: import_zod7.z.unknown().nullable().meta({
|
|
2187
2192
|
description: "What the action or service returned once it succeeded, shaped by ROS itself. `null` otherwise."
|
|
@@ -2231,7 +2236,7 @@ var jobRunQuery = import_zod7.z.object({
|
|
|
2231
2236
|
description: "Only runs of this action or service."
|
|
2232
2237
|
}),
|
|
2233
2238
|
state: jobState.optional().meta({
|
|
2234
|
-
description: "Only runs in this state \u2014 `running`, `succeeded`, `failed`, `cancelled` or `lost`."
|
|
2239
|
+
description: "Only runs in this state \u2014 `running`, `unknown`, `succeeded`, `failed`, `cancelled` or `lost`."
|
|
2235
2240
|
}),
|
|
2236
2241
|
kind: jobRunKind.optional().meta({
|
|
2237
2242
|
description: "Only `action` runs, or only `service` runs."
|
|
@@ -2265,14 +2270,14 @@ var jobRunSummary = import_zod7.z.object({
|
|
|
2265
2270
|
since_ms: import_zod7.z.number().int().nonnegative()
|
|
2266
2271
|
});
|
|
2267
2272
|
|
|
2268
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2273
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/protocol.js
|
|
2269
2274
|
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
2270
2275
|
var MAX_PATIENCE_MS = 12e4;
|
|
2271
2276
|
var MIN_PATIENCE_MS = 1e3;
|
|
2272
2277
|
var activeJob = import_zod8.z.object({
|
|
2273
2278
|
job_id: import_zod8.z.uuid(),
|
|
2274
2279
|
slug,
|
|
2275
|
-
state:
|
|
2280
|
+
state: reportedJobState
|
|
2276
2281
|
});
|
|
2277
2282
|
var bridgeHello = import_zod8.z.object({
|
|
2278
2283
|
type: import_zod8.z.literal("hello"),
|
|
@@ -2283,16 +2288,14 @@ var bridgeHello = import_zod8.z.object({
|
|
|
2283
2288
|
* Every job this bridge still knows about, right now.
|
|
2284
2289
|
*
|
|
2285
2290
|
* A reconnect and a restart look **identical** on the wire — same token,
|
|
2286
|
-
* same version, same frame —
|
|
2287
|
-
*
|
|
2288
|
-
*
|
|
2289
|
-
*
|
|
2290
|
-
*
|
|
2291
|
-
*
|
|
2292
|
-
*
|
|
2293
|
-
*
|
|
2294
|
-
* the cloud needs. A breadcrumb file would only add a window in which the
|
|
2295
|
-
* crash beat the write.
|
|
2291
|
+
* same version, same frame — so the bridge enumerates what it still has:
|
|
2292
|
+
* its live jobs, and after a restart every job whose goal it recognised
|
|
2293
|
+
* again from its persisted job-to-goal mapping. A job the cloud holds
|
|
2294
|
+
* `running` or `unknown` that is *not* named here is "not known to the
|
|
2295
|
+
* bridge"; it becomes `lost` (`job_unknown_to_bridge`) only once the
|
|
2296
|
+
* bridge's goal reports show its action free of goals it cannot
|
|
2297
|
+
* attribute — one of those may be that very job — and at once for a
|
|
2298
|
+
* service job, which has no goals to look at.
|
|
2296
2299
|
*
|
|
2297
2300
|
* Defaulted, so a bridge that sends no such field still parses; no jobs
|
|
2298
2301
|
* and no report both mean the same thing to the cloud: nothing to keep
|
|
@@ -2398,9 +2401,27 @@ var cloudInvoke = import_zod8.z.object({
|
|
|
2398
2401
|
});
|
|
2399
2402
|
var cloudCancel = import_zod8.z.object({
|
|
2400
2403
|
type: import_zod8.z.literal("cancel"),
|
|
2404
|
+
request_id: import_zod8.z.string().min(1).max(64),
|
|
2401
2405
|
slug,
|
|
2402
2406
|
job_id: import_zod8.z.uuid().nullable()
|
|
2403
2407
|
});
|
|
2408
|
+
var cancelReturnCode = import_zod8.z.number().int().min(0).max(3);
|
|
2409
|
+
var bridgeCancelResultEntry = import_zod8.z.object({
|
|
2410
|
+
/** The job the goal belongs to — the bridge's own, or an external goal's derived id. */
|
|
2411
|
+
job_id: import_zod8.z.uuid(),
|
|
2412
|
+
/** The ROS 2 goal id the cancel was sent for. */
|
|
2413
|
+
goal_id: import_zod8.z.string().min(1),
|
|
2414
|
+
/** `null` when the action server did not answer the cancel request within the bridge's own bound. */
|
|
2415
|
+
return_code: cancelReturnCode.nullable()
|
|
2416
|
+
});
|
|
2417
|
+
var bridgeCancelResult = import_zod8.z.object({
|
|
2418
|
+
type: import_zod8.z.literal("cancel_result"),
|
|
2419
|
+
request_id: import_zod8.z.string().min(1).max(64),
|
|
2420
|
+
slug,
|
|
2421
|
+
goals: import_zod8.z.array(bridgeCancelResultEntry),
|
|
2422
|
+
/** Set when the bridge could not send the cancel at all (no such slug, a service, the server gone). */
|
|
2423
|
+
error: import_zod8.z.object({ code: import_zod8.z.string().min(1), message: import_zod8.z.string().min(1) }).nullable()
|
|
2424
|
+
});
|
|
2404
2425
|
var cloudPublish = import_zod8.z.object({
|
|
2405
2426
|
type: import_zod8.z.literal("publish"),
|
|
2406
2427
|
slug,
|
|
@@ -2420,7 +2441,11 @@ var bridgeJobUpdate = import_zod8.z.object({
|
|
|
2420
2441
|
type: import_zod8.z.literal("job_update"),
|
|
2421
2442
|
job_id: import_zod8.z.uuid(),
|
|
2422
2443
|
slug,
|
|
2423
|
-
|
|
2444
|
+
/** Never `unknown`: that is the cloud's word for not having heard. */
|
|
2445
|
+
state: reportedJobState,
|
|
2446
|
+
origin: jobOrigin,
|
|
2447
|
+
/** The ROS 2 goal id; `null` for a service job, which has no goal. */
|
|
2448
|
+
goal_id: import_zod8.z.string().min(1).nullable(),
|
|
2424
2449
|
feedback: import_zod8.z.unknown().nullable(),
|
|
2425
2450
|
progress: import_zod8.z.number().min(0).max(1).nullable(),
|
|
2426
2451
|
result: import_zod8.z.unknown().nullable(),
|
|
@@ -2430,7 +2455,29 @@ var bridgeJobUpdate = import_zod8.z.object({
|
|
|
2430
2455
|
});
|
|
2431
2456
|
var bridgeJobLost = import_zod8.z.object({
|
|
2432
2457
|
type: import_zod8.z.literal("job_lost"),
|
|
2433
|
-
job_ids: import_zod8.z.array(import_zod8.z.uuid())
|
|
2458
|
+
job_ids: import_zod8.z.array(import_zod8.z.uuid()),
|
|
2459
|
+
error: import_zod8.z.object({ code: import_zod8.z.string().min(1), message: import_zod8.z.string().min(1) }).optional()
|
|
2460
|
+
});
|
|
2461
|
+
var cloudJobQuery = import_zod8.z.object({
|
|
2462
|
+
type: import_zod8.z.literal("job_query"),
|
|
2463
|
+
request_id: import_zod8.z.string().min(1).max(64),
|
|
2464
|
+
job_ids: import_zod8.z.array(import_zod8.z.uuid()).min(1)
|
|
2465
|
+
});
|
|
2466
|
+
var bridgeJobStatusEntry = import_zod8.z.object({
|
|
2467
|
+
job_id: import_zod8.z.uuid(),
|
|
2468
|
+
/** Never `unknown` — the bridge only ever states a definite fact about a job it recognises. */
|
|
2469
|
+
state: reportedJobState,
|
|
2470
|
+
feedback: import_zod8.z.unknown().nullable(),
|
|
2471
|
+
progress: import_zod8.z.number().min(0).max(1).nullable(),
|
|
2472
|
+
result: import_zod8.z.unknown().nullable(),
|
|
2473
|
+
/** Same shape as `job.error`, `details` included — see `jobs.ts`. */
|
|
2474
|
+
error: import_zod8.z.object({ code: import_zod8.z.string().min(1), message: import_zod8.z.string().min(1), details: import_zod8.z.unknown().optional() }).nullable()
|
|
2475
|
+
});
|
|
2476
|
+
var bridgeJobStatus = import_zod8.z.object({
|
|
2477
|
+
type: import_zod8.z.literal("job_status"),
|
|
2478
|
+
request_id: import_zod8.z.string().min(1).max(64),
|
|
2479
|
+
jobs: import_zod8.z.array(bridgeJobStatusEntry),
|
|
2480
|
+
unknown_job_ids: import_zod8.z.array(import_zod8.z.uuid())
|
|
2434
2481
|
});
|
|
2435
2482
|
var cloudIntrospectRequest = import_zod8.z.object({
|
|
2436
2483
|
type: import_zod8.z.literal("introspect_request"),
|
|
@@ -2619,11 +2666,11 @@ var bridgeCameraState = import_zod8.z.object({
|
|
|
2619
2666
|
request_id: import_zod8.z.string().min(1).max(64).nullable()
|
|
2620
2667
|
});
|
|
2621
2668
|
|
|
2622
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2669
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/config-issues.js
|
|
2623
2670
|
var EXPOSURE_SECTIONS = ["datapoints", "actions", "services", "publishers", "cameras"];
|
|
2624
2671
|
var EXPOSURE_SECTION_NAMES = new Set(EXPOSURE_SECTIONS);
|
|
2625
2672
|
|
|
2626
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
2673
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/rest.js
|
|
2627
2674
|
var import_zod9 = require("zod");
|
|
2628
2675
|
var robot = import_zod9.z.object({
|
|
2629
2676
|
id: import_zod9.z.uuid().meta({
|
|
@@ -3388,13 +3435,13 @@ var slugUsageResponse = import_zod9.z.object({
|
|
|
3388
3435
|
alert_count: import_zod9.z.number().int().nonnegative()
|
|
3389
3436
|
});
|
|
3390
3437
|
|
|
3391
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
3438
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/realtime.js
|
|
3392
3439
|
var import_zod14 = require("zod");
|
|
3393
3440
|
|
|
3394
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
3441
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/client-auth.js
|
|
3395
3442
|
var import_zod13 = require("zod");
|
|
3396
3443
|
|
|
3397
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
3444
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/apps.js
|
|
3398
3445
|
var import_zod10 = require("zod");
|
|
3399
3446
|
var appIdentifier = slug;
|
|
3400
3447
|
var app = import_zod10.z.object({
|
|
@@ -3454,6 +3501,26 @@ var appListResponse = import_zod10.z.object({
|
|
|
3454
3501
|
description: "Every app of the caller's organisation, oldest first by `created_at`. The org scope is the whole filter \u2014 there is no id to narrow by and nothing to refuse."
|
|
3455
3502
|
})
|
|
3456
3503
|
});
|
|
3504
|
+
var appDeletionSummary = import_zod10.z.object({
|
|
3505
|
+
user_count: import_zod10.z.number().int().nonnegative().meta({
|
|
3506
|
+
description: "App users deleted with the app. They are the developer's own customers, not Fleetless users, and exist in no other app."
|
|
3507
|
+
}),
|
|
3508
|
+
role_count: import_zod10.z.number().int().nonnegative().meta({
|
|
3509
|
+
description: "Roles deleted with the app, each with its per-robot slug grants."
|
|
3510
|
+
}),
|
|
3511
|
+
server_key_count: import_zod10.z.number().int().nonnegative().meta({
|
|
3512
|
+
description: "Server keys deleted with the app. A client still holding one is refused at its next request."
|
|
3513
|
+
}),
|
|
3514
|
+
invitation_count: import_zod10.z.number().int().nonnegative().meta({
|
|
3515
|
+
description: "Outstanding invitations \u2014 unspent and unexpired \u2014 that will never be accepted."
|
|
3516
|
+
}),
|
|
3517
|
+
oidc_provider_count: import_zod10.z.number().int().nonnegative().meta({
|
|
3518
|
+
description: "Identity providers configured for this app. The providers themselves are somebody else's; only this app's configuration of them goes."
|
|
3519
|
+
}),
|
|
3520
|
+
mail_template_count: import_zod10.z.number().int().nonnegative().meta({
|
|
3521
|
+
description: "Custom mail templates, of at most three. A kind using the Fleetless default text is not counted \u2014 there is no row to lose."
|
|
3522
|
+
})
|
|
3523
|
+
});
|
|
3457
3524
|
var createAppRequest = import_zod10.z.object({
|
|
3458
3525
|
name: import_zod10.z.string().min(1).max(120),
|
|
3459
3526
|
identifier: appIdentifier,
|
|
@@ -3576,10 +3643,10 @@ var rolePermissions = import_zod10.z.object({
|
|
|
3576
3643
|
})
|
|
3577
3644
|
});
|
|
3578
3645
|
|
|
3579
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
3646
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/app-users.js
|
|
3580
3647
|
var import_zod12 = require("zod");
|
|
3581
3648
|
|
|
3582
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
3649
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/identity.js
|
|
3583
3650
|
var import_zod11 = require("zod");
|
|
3584
3651
|
var password = import_zod11.z.string().min(12).max(256);
|
|
3585
3652
|
var USER_DISPLAY_NAME_MAX = 120;
|
|
@@ -3741,7 +3808,7 @@ var authMeResponse = import_zod11.z.object({ org, user: fleetlessUser });
|
|
|
3741
3808
|
var patchOrgRequest = import_zod11.z.object({ name: import_zod11.z.string().min(1).max(120) }).strict();
|
|
3742
3809
|
var patchAuthMeRequest = import_zod11.z.object({ display_name: import_zod11.z.string().min(1).max(USER_DISPLAY_NAME_MAX).nullable() }).strict();
|
|
3743
3810
|
|
|
3744
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
3811
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/app-users.js
|
|
3745
3812
|
var APP_USER_DISPLAY_NAME_MAX = 120;
|
|
3746
3813
|
var providerSlug = import_zod12.z.string().max(40).regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/, "must be lowercase and hyphen-separated, starting with a letter");
|
|
3747
3814
|
var appUserStatus = import_zod12.z.enum(["pending_verification", "active", "blocked"]);
|
|
@@ -3960,7 +4027,9 @@ var appAuthConfig = import_zod12.z.object({
|
|
|
3960
4027
|
}),
|
|
3961
4028
|
updated_at: import_zod12.z.iso.datetime().meta({ description: "When the configuration was last written, as an ISO 8601 timestamp." })
|
|
3962
4029
|
});
|
|
3963
|
-
var
|
|
4030
|
+
var putAppAuthRegistrationRequest = appAuthConfig.pick({ self_registration: true, allowed_domains: true, allowed_origins: true }).strict();
|
|
4031
|
+
var putAppAuthUrlsRequest = appAuthConfig.pick({ invite_url: true, verify_url: true, reset_url: true }).strict();
|
|
4032
|
+
var putAppAuthMcpRequest = appAuthConfig.pick({ mcp_enabled: true, mcp_login_url: true }).strict();
|
|
3964
4033
|
var mailTemplateKind = import_zod12.z.enum(["invite", "verify", "reset"]);
|
|
3965
4034
|
var appMailTemplate = import_zod12.z.object({
|
|
3966
4035
|
kind: mailTemplateKind.meta({ description: "Which of the three mails this template replaces." }),
|
|
@@ -3992,7 +4061,7 @@ var mailOutcome = import_zod12.z.object({
|
|
|
3992
4061
|
})
|
|
3993
4062
|
});
|
|
3994
4063
|
|
|
3995
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4064
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/client-auth.js
|
|
3996
4065
|
var clientLoginRequest = import_zod13.z.object({
|
|
3997
4066
|
app_identifier: appIdentifier.meta({
|
|
3998
4067
|
description: "The app being logged in to: its globally unique, lowercase, underscore-separated identifier, chosen by the developer at creation. There is no organisation context at login, so this is what decides which app the credentials are checked for."
|
|
@@ -4181,7 +4250,7 @@ var clientIdentity = import_zod13.z.object({
|
|
|
4181
4250
|
})
|
|
4182
4251
|
});
|
|
4183
4252
|
|
|
4184
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4253
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/realtime.js
|
|
4185
4254
|
var clientAuth = import_zod14.z.object({
|
|
4186
4255
|
type: import_zod14.z.literal("auth"),
|
|
4187
4256
|
token: import_zod14.z.string().min(1)
|
|
@@ -4459,7 +4528,7 @@ var orgEventDropped = import_zod14.z.object({
|
|
|
4459
4528
|
dropped: import_zod14.z.number().int().positive()
|
|
4460
4529
|
}).strict();
|
|
4461
4530
|
|
|
4462
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4531
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/client-robots.js
|
|
4463
4532
|
var import_zod15 = require("zod");
|
|
4464
4533
|
var clientRobotListItem = import_zod15.z.object({
|
|
4465
4534
|
...robot.shape,
|
|
@@ -4476,7 +4545,7 @@ var clientRobotListResponse = import_zod15.z.object({
|
|
|
4476
4545
|
})
|
|
4477
4546
|
});
|
|
4478
4547
|
|
|
4479
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4548
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/audit.js
|
|
4480
4549
|
var import_zod16 = require("zod");
|
|
4481
4550
|
var auditActor = import_zod16.z.object({
|
|
4482
4551
|
kind: import_zod16.z.enum(["developer", "end_user", "app_user", "server_key", "bridge"]),
|
|
@@ -4606,7 +4675,7 @@ var auditListResponse = import_zod16.z.object({
|
|
|
4606
4675
|
next_cursor: import_zod16.z.number().int().positive().nullable()
|
|
4607
4676
|
});
|
|
4608
4677
|
|
|
4609
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4678
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/errors.js
|
|
4610
4679
|
var import_zod17 = require("zod");
|
|
4611
4680
|
var apiError = import_zod17.z.object({
|
|
4612
4681
|
code: import_zod17.z.string().min(1),
|
|
@@ -4623,7 +4692,7 @@ var parameterInvalidDetails = import_zod17.z.object({
|
|
|
4623
4692
|
violations: import_zod17.z.array(parameterViolation).min(1)
|
|
4624
4693
|
});
|
|
4625
4694
|
|
|
4626
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4695
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/oauth.js
|
|
4627
4696
|
var import_zod18 = require("zod");
|
|
4628
4697
|
var oauthErrorCode = import_zod18.z.enum([
|
|
4629
4698
|
"invalid_request",
|
|
@@ -4863,7 +4932,7 @@ var oauthAuthorizeQuery = import_zod18.z.object({
|
|
|
4863
4932
|
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."
|
|
4864
4933
|
});
|
|
4865
4934
|
|
|
4866
|
-
// node_modules/.pnpm/@fleetless+contracts@
|
|
4935
|
+
// node_modules/.pnpm/@fleetless+contracts@5.0.0/node_modules/@fleetless/contracts/dist/routes.js
|
|
4867
4936
|
var MCP_APP = MCP_APP_PATHS(":appIdentifier");
|
|
4868
4937
|
var APP_IDENTIFIER = {
|
|
4869
4938
|
name: "appIdentifier",
|
|
@@ -5233,6 +5302,42 @@ var ROUTES = [
|
|
|
5233
5302
|
transport: "http",
|
|
5234
5303
|
notes: "A `default_role_id` naming a role of another app is refused: it is the one cross-app authorization check this shape can carry. Changing the robot set closes every live subscription the app's users hold, since a grant may no longer name a reachable robot."
|
|
5235
5304
|
},
|
|
5305
|
+
{
|
|
5306
|
+
method: "GET",
|
|
5307
|
+
path: "/api/apps/:id/deletion-preview",
|
|
5308
|
+
section: "apps",
|
|
5309
|
+
summary: "Reports what deleting the app would destroy, without destroying it.",
|
|
5310
|
+
audience: "developer",
|
|
5311
|
+
auth: "developer",
|
|
5312
|
+
rateLimited: false,
|
|
5313
|
+
ownerTier: false,
|
|
5314
|
+
status: 200,
|
|
5315
|
+
params: [{ name: "id", description: "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`." }],
|
|
5316
|
+
query: null,
|
|
5317
|
+
request: null,
|
|
5318
|
+
response: appDeletionSummary,
|
|
5319
|
+
errors: [...DEVELOPER_GUARD, "invalid_uuid", "not_found"],
|
|
5320
|
+
transport: "http",
|
|
5321
|
+
notes: "The same shape the delete's own audit event carries, computed by the same function on purpose: the confirmation dialog and the eventual receipt agree by construction, and any difference between them is real drift rather than two estimates that quietly disagree. \n\n**No `force` parameter, unlike the robot pair this is modelled on.** A robot's open live session is a single nameable state whose interruption is its own hazard, which is why that route makes the caller pass `force` explicitly. An app has no equivalent state to force past, and inventing one would be a guess wearing a guard's clothes \u2014 this preview is the guard."
|
|
5322
|
+
},
|
|
5323
|
+
{
|
|
5324
|
+
method: "DELETE",
|
|
5325
|
+
path: "/api/apps/:id",
|
|
5326
|
+
section: "apps",
|
|
5327
|
+
summary: "Deletes an app and everything it produced.",
|
|
5328
|
+
audience: "developer",
|
|
5329
|
+
auth: "developer",
|
|
5330
|
+
rateLimited: false,
|
|
5331
|
+
ownerTier: true,
|
|
5332
|
+
status: 204,
|
|
5333
|
+
params: [{ name: "id", description: "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`." }],
|
|
5334
|
+
query: null,
|
|
5335
|
+
request: null,
|
|
5336
|
+
response: null,
|
|
5337
|
+
errors: [...DEVELOPER_GUARD, "tier_required", "invalid_uuid", "not_found"],
|
|
5338
|
+
transport: "http",
|
|
5339
|
+
notes: "Owner tier, and the gate runs **after** the org-scoped lookup: a developer-tier admin therefore sees the same `404` a stranger would for an app outside their org, rather than a tier refusal that confirms the id exists. A full cascade \u2014 its users, roles, server keys, invitations, OIDC provider configuration and mail templates all go, recorded once as `app.deleted` carrying an `appDeletionSummary`. Its robots are untouched: they belong to the org, not to the app. \n\n**No `force` parameter** \u2014 see `GET /api/apps/:id/deletion-preview`."
|
|
5340
|
+
},
|
|
5236
5341
|
{
|
|
5237
5342
|
method: "POST",
|
|
5238
5343
|
path: "/api/apps/:id/roles",
|
|
@@ -5739,13 +5844,31 @@ var ROUTES = [
|
|
|
5739
5844
|
response: appAuthConfig,
|
|
5740
5845
|
errors: [...DEVELOPER_GUARD, "invalid_uuid", "not_found"],
|
|
5741
5846
|
transport: "http",
|
|
5742
|
-
notes: "One row per app, created with the app and never absent \u2014 an app that has configured nothing reads back the defaults rather than a `404`. `oidc_callback_url` is in the answer and not in the request: it is minted by the cloud from its own public base URL, is the same for every app and every provider, and is the value a developer registers at their identity provider."
|
|
5847
|
+
notes: "One row per app, created with the app and never absent \u2014 an app that has configured nothing reads back the defaults rather than a `404`. `oidc_callback_url` is in the answer and not in the request: it is minted by the cloud from its own public base URL, is the same for every app and every provider, and is the value a developer registers at their identity provider. It stays read-only on every slice write below for a second reason: a writable callback URL would let a caller point the return leg of an OIDC sign-in, which carries an authorization code, at a host they own. `updated_at` is read-only for a duller one: the server stamps it on every write, and a client-supplied value would be a lie about when the row last changed."
|
|
5743
5848
|
},
|
|
5744
5849
|
{
|
|
5745
5850
|
method: "PUT",
|
|
5746
|
-
path: "/api/apps/:id/auth-config",
|
|
5851
|
+
path: "/api/apps/:id/auth-config/registration",
|
|
5852
|
+
section: "apps",
|
|
5853
|
+
summary: "Replaces who may self-register, and from where.",
|
|
5854
|
+
audience: "developer",
|
|
5855
|
+
auth: "developer",
|
|
5856
|
+
rateLimited: false,
|
|
5857
|
+
ownerTier: false,
|
|
5858
|
+
status: 200,
|
|
5859
|
+
params: [{ name: "id", description: "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`." }],
|
|
5860
|
+
query: null,
|
|
5861
|
+
request: putAppAuthRegistrationRequest,
|
|
5862
|
+
response: appAuthConfig,
|
|
5863
|
+
errors: [...DEVELOPER_GUARD, "invalid_uuid", "validation_error", "not_found"],
|
|
5864
|
+
transport: "http",
|
|
5865
|
+
notes: "**A replace, not a merge, and `.strict()`**: `self_registration`, `allowed_domains` and `allowed_origins` all arrive or the write is refused, so a client built against an older shape cannot silently clear a setting it does not know about. `oidc_callback_url` and `updated_at` are the server's, refused in this body as in every slice's \u2014 see `GET`'s notes for why. \n\n`400 validation_error` is where the two field rules land: an entry in `allowed_domains` must be lowercase, since a capitalised one can never match a lowercased address, and an entry in `allowed_origins` must be a bare scheme-host-port with no path, since a browser sends nothing longer in its `Origin` header. Each refuses at configuration time rather than failing silently later. \n\nThe merge is server-side against the stored row, so this write never disturbs the urls or mcp slice."
|
|
5866
|
+
},
|
|
5867
|
+
{
|
|
5868
|
+
method: "PUT",
|
|
5869
|
+
path: "/api/apps/:id/auth-config/urls",
|
|
5747
5870
|
section: "apps",
|
|
5748
|
-
summary: "Replaces the
|
|
5871
|
+
summary: "Replaces the three pages Fleetless's mails point at.",
|
|
5749
5872
|
audience: "developer",
|
|
5750
5873
|
auth: "developer",
|
|
5751
5874
|
rateLimited: false,
|
|
@@ -5753,11 +5876,29 @@ var ROUTES = [
|
|
|
5753
5876
|
status: 200,
|
|
5754
5877
|
params: [{ name: "id", description: "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`." }],
|
|
5755
5878
|
query: null,
|
|
5756
|
-
request:
|
|
5879
|
+
request: putAppAuthUrlsRequest,
|
|
5757
5880
|
response: appAuthConfig,
|
|
5758
5881
|
errors: [...DEVELOPER_GUARD, "invalid_uuid", "validation_error", "not_found"],
|
|
5759
5882
|
transport: "http",
|
|
5760
|
-
notes: "**A replace, not a merge, and `.strict()`**:
|
|
5883
|
+
notes: "**A replace, not a merge, and `.strict()`**: `invite_url`, `verify_url` and `reset_url` all arrive or the write is refused, so a client built against an older shape cannot silently clear a setting it does not know about. `oidc_callback_url` and `updated_at` are the server's, refused in this body as in every slice's \u2014 see `GET`'s notes for why. \n\n`400 validation_error` is where the field rule lands: a URL template must be https (or `http` on `localhost`) and carry its placeholder exactly once \u2014 a second occurrence leaves one literal in a mailed link, refused here rather than failing silently once the mail is sent. \n\nThe merge is server-side against the stored row, so this write never disturbs the registration or mcp slice."
|
|
5884
|
+
},
|
|
5885
|
+
{
|
|
5886
|
+
method: "PUT",
|
|
5887
|
+
path: "/api/apps/:id/auth-config/mcp",
|
|
5888
|
+
section: "apps",
|
|
5889
|
+
summary: "Replaces the MCP switch and its login URL together.",
|
|
5890
|
+
audience: "developer",
|
|
5891
|
+
auth: "developer",
|
|
5892
|
+
rateLimited: false,
|
|
5893
|
+
ownerTier: false,
|
|
5894
|
+
status: 200,
|
|
5895
|
+
params: [{ name: "id", description: "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`." }],
|
|
5896
|
+
query: null,
|
|
5897
|
+
request: putAppAuthMcpRequest,
|
|
5898
|
+
response: appAuthConfig,
|
|
5899
|
+
errors: [...DEVELOPER_GUARD, "invalid_uuid", "validation_error", "not_found"],
|
|
5900
|
+
transport: "http",
|
|
5901
|
+
notes: "**A replace, not a merge, and `.strict()`**: `mcp_enabled` and `mcp_login_url` both arrive or the write is refused, so a client built against an older shape cannot silently clear a setting it does not know about. `oidc_callback_url` and `updated_at` are the server's, refused in this body as in every slice's \u2014 see `GET`'s notes for why. \n\n`mcp_login_url` answers to the same rule as the `urls` slice's three templates \u2014 https (or `http` on `localhost`), its placeholder exactly once \u2014 refused as `400 validation_error` rather than left to fail mid-OAuth, in a client's browser where no console screen is watching. \n\nThe merge is server-side against the stored row, so this write never disturbs the registration or urls slice."
|
|
5761
5902
|
},
|
|
5762
5903
|
{
|
|
5763
5904
|
method: "GET",
|
|
@@ -7550,7 +7691,7 @@ var ROUTES = [
|
|
|
7550
7691
|
"internal_error"
|
|
7551
7692
|
],
|
|
7552
7693
|
transport: "http",
|
|
7553
|
-
notes: "**One route for both kinds**, because a path segment naming the kind would demand a fact a role grant does not carry. An action answers `202` with an `invokeResponse` the moment the job exists; a service answers `200` with a `serviceCallResponse` once the result is in \u2014 two shapes, carried by one union (`invokeOrServiceResponse`) and told apart by whether `kind` or a bare `result` arrives. Parameters are checked **before** anything about the world (offline, busy): the same request must get the same verdict whether or not the robot happens to be reachable, or a developer testing against an offline robot never learns their parameters were wrong. A service the robot reports as failed answers `502` carrying **the job's own error code**, which is an open set and not one of the codes above."
|
|
7694
|
+
notes: "**One route for both kinds**, because a path segment naming the kind would demand a fact a role grant does not carry. An action answers `202` with an `invokeResponse` the moment the job exists; a service answers `200` with a `serviceCallResponse` once the result is in \u2014 two shapes, carried by one union (`invokeOrServiceResponse`) and told apart by whether `kind` or a bare `result` arrives. Parameters are checked **before** anything about the world (offline, busy): the same request must get the same verdict whether or not the robot happens to be reachable, or a developer testing against an offline robot never learns their parameters were wrong. A slug is `409 busy` while it holds a `running` job, an `unknown` one the robot has not accounted for yet, or an `external` goal someone else started; the refusal's `details.running` names that job, `state` and `origin` included. A service the robot reports as failed answers `502` carrying **the job's own error code**, which is an open set and not one of the codes above."
|
|
7554
7695
|
},
|
|
7555
7696
|
{
|
|
7556
7697
|
method: "GET",
|
|
@@ -7591,9 +7732,21 @@ var ROUTES = [
|
|
|
7591
7732
|
request: cancelRequest,
|
|
7592
7733
|
requestOptional: true,
|
|
7593
7734
|
response: jobResponse,
|
|
7594
|
-
errors: [
|
|
7735
|
+
errors: [
|
|
7736
|
+
...CLIENT_GUARD,
|
|
7737
|
+
"invalid_uuid",
|
|
7738
|
+
"not_found",
|
|
7739
|
+
"validation_error",
|
|
7740
|
+
"not_cancellable",
|
|
7741
|
+
"robot_offline",
|
|
7742
|
+
"cancel_rejected",
|
|
7743
|
+
"bridge_timeout",
|
|
7744
|
+
"unknown_slug",
|
|
7745
|
+
"action_server_lost",
|
|
7746
|
+
"internal_error"
|
|
7747
|
+
],
|
|
7595
7748
|
transport: "http",
|
|
7596
|
-
notes:
|
|
7749
|
+
notes: "The body is optional: a bodyless `POST` was every caller's shape before `job_id` existed, and absent or `job_id: null` both mean \"cancel whatever is running\". A named `job_id` that is **not** what is running cancels nothing and answers `404` \u2014 the caller named an id and thereby ruled the other one out. An `external` job is cancelled the same way, through its goal id. Cancelling an `unknown` job also cancels every external goal on its action, since one of them may be that job. A service is `422 not_cancellable`: a service call has no goal to cancel. Nothing running is a `200` with `job: null`. The answer waits for the bridge's `cancel_result`: a `200` means the action server accepted the cancel request, not that the goal has ended \u2014 the job's end arrives as its own update. Any goal answered `ERROR_REJECTED` makes it `409 cancel_rejected`, with every goal and its `return_code` in `details.goals`; no answer within `JOB_HEARTBEAT_TIMEOUT_MS` is `504 bridge_timeout`; a cancel the bridge could not send at all is `502` carrying the bridge's own code (`unknown_slug`, `action_server_lost`, `internal_error`)."
|
|
7597
7750
|
},
|
|
7598
7751
|
{
|
|
7599
7752
|
method: "POST",
|