@fleetless/contracts 5.1.0-next.2 → 5.2.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 CHANGED
@@ -9,6 +9,8 @@ version.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [5.2.0] — 2026-09-30
13
+
12
14
  ### Added
13
15
 
14
16
  - **A cancel can be limited to the bridge's own job.** `cancel`
@@ -22,6 +24,19 @@ version.
22
24
  never sets it. `LATEST_BRIDGE_VERSION` is `6.1.0`, the first bridge that
23
25
  honours it. The protocol stays 5.
24
26
 
27
+ ## [5.1.0] — 2026-09-30
28
+
29
+ ### Added
30
+
31
+ - **`cancelRejectedDetails`** (`CancelRejectedDetails`): the `details` of a
32
+ `cancel_rejected` refusal, `{ goals }` with at least one `{ job_id,
33
+ goal_id, return_code }` — every goal the cancel reached, accepted ones
34
+ included, with its `CancelGoal` return code (`CANCEL_RETURN_CODES`, or
35
+ `null` when that goal's server did not answer). A consumer parses the
36
+ refusal instead of reading its shape from prose. Published as the
37
+ artifact `cancel-rejected-details`. The wire does not change: the cloud
38
+ already sends this shape.
39
+
25
40
  ## [5.0.0] — 2026-09-30
26
41
 
27
42
  ### Added
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "goals": {
6
+ "minItems": 1,
7
+ "type": "array",
8
+ "items": {
9
+ "type": "object",
10
+ "properties": {
11
+ "job_id": {
12
+ "type": "string",
13
+ "format": "uuid",
14
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
15
+ },
16
+ "goal_id": {
17
+ "type": "string",
18
+ "minLength": 1
19
+ },
20
+ "return_code": {
21
+ "anyOf": [
22
+ {
23
+ "type": "integer",
24
+ "minimum": 0,
25
+ "maximum": 3
26
+ },
27
+ {
28
+ "type": "null"
29
+ }
30
+ ]
31
+ }
32
+ },
33
+ "required": [
34
+ "job_id",
35
+ "goal_id",
36
+ "return_code"
37
+ ],
38
+ "additionalProperties": false
39
+ }
40
+ }
41
+ },
42
+ "required": [
43
+ "goals"
44
+ ],
45
+ "additionalProperties": false
46
+ }
package/dist/errors.d.ts CHANGED
@@ -44,6 +44,25 @@ export declare const parameterInvalidDetails: z.ZodObject<{
44
44
  }, z.core.$strip>>;
45
45
  }, z.core.$strip>;
46
46
  export type ParameterInvalidDetails = z.infer<typeof parameterInvalidDetails>;
47
+ /**
48
+ * The `details` of a `cancel_rejected` refusal: every goal the cancel reached,
49
+ * accepted ones included, each with the `CancelGoal` return code its action
50
+ * server answered — compare `return_code` against `CANCEL_RETURN_CODES`
51
+ * (`none`, `rejected`, `unknown_goal_id`, `goal_terminated`); it is `null`
52
+ * when that goal's server did not answer within the bridge's bound. Always at
53
+ * least one goal: the cloud refuses a cancel only because a goal's server
54
+ * answered `ERROR_REJECTED`. Pinned here for the reason
55
+ * `parameterInvalidDetails` is: a caller parses it instead of reading the
56
+ * shape from prose.
57
+ */
58
+ export declare const cancelRejectedDetails: z.ZodObject<{
59
+ goals: z.ZodArray<z.ZodObject<{
60
+ job_id: z.ZodUUID;
61
+ goal_id: z.ZodString;
62
+ return_code: z.ZodNullable<z.ZodNumber>;
63
+ }, z.core.$strip>>;
64
+ }, z.core.$strip>;
65
+ export type CancelRejectedDetails = z.infer<typeof cancelRejectedDetails>;
47
66
  /**
48
67
  * The codes in use today. The wire deliberately allows any string — this
49
68
  * list is the shared vocabulary, not a closed set, so a new refusal never
package/dist/errors.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  import { z } from 'zod';
3
+ import { bridgeCancelResultEntry } from './protocol.js';
3
4
  /**
4
5
  * The one error shape of the REST and realtime APIs: a stable
5
6
  * machine-readable code plus a human message; validation errors name the
@@ -38,6 +39,20 @@ export const parameterViolation = z.object({
38
39
  export const parameterInvalidDetails = z.object({
39
40
  violations: z.array(parameterViolation).min(1),
40
41
  });
42
+ /**
43
+ * The `details` of a `cancel_rejected` refusal: every goal the cancel reached,
44
+ * accepted ones included, each with the `CancelGoal` return code its action
45
+ * server answered — compare `return_code` against `CANCEL_RETURN_CODES`
46
+ * (`none`, `rejected`, `unknown_goal_id`, `goal_terminated`); it is `null`
47
+ * when that goal's server did not answer within the bridge's bound. Always at
48
+ * least one goal: the cloud refuses a cancel only because a goal's server
49
+ * answered `ERROR_REJECTED`. Pinned here for the reason
50
+ * `parameterInvalidDetails` is: a caller parses it instead of reading the
51
+ * shape from prose.
52
+ */
53
+ export const cancelRejectedDetails = z.object({
54
+ goals: z.array(bridgeCancelResultEntry).min(1),
55
+ });
41
56
  /**
42
57
  * The codes in use today. The wire deliberately allows any string — this
43
58
  * list is the shared vocabulary, not a closed set, so a new refusal never
package/dist/index.d.ts CHANGED
@@ -45,8 +45,8 @@ export { auditActor, auditEvent, auditQuery, auditListResponse, AUDIT_CSV_COLUMN
45
45
  export type { AuditActor, AuditEvent, AuditQuery, AuditListResponse } from './audit.js';
46
46
  export { alertRowCondition, alertSeverity, alertState, datapointAlertRow, alertListResponse, orgFiringAlertsResponse, orgAlertsQuery, datapointDisplay, putDatapointDisplayRequest, } from './alerts.js';
47
47
  export type { AlertRowCondition, AlertSeverity, AlertState, DatapointAlertRow, AlertListResponse, OrgFiringAlertsResponse, OrgAlertsQuery, DatapointDisplay, PutDatapointDisplayRequest, } from './alerts.js';
48
- export { apiError, parameterViolation, parameterInvalidDetails, ERROR_CODES } from './errors.js';
49
- export type { ApiError, ParameterViolation, ParameterInvalidDetails, ErrorCode } from './errors.js';
48
+ export { apiError, parameterViolation, parameterInvalidDetails, cancelRejectedDetails, ERROR_CODES } from './errors.js';
49
+ export type { ApiError, ParameterViolation, ParameterInvalidDetails, CancelRejectedDetails, ErrorCode } from './errors.js';
50
50
  export { oauthErrorCode, oauthError, oauthRedirectResponse, oauthCodeTokenRequest, oauthRefreshTokenRequest, oauthTokenRequest, oauthTokenResponse, redirectUri, codeChallengeMethod, oauthAuthorizeQuery, dynamicClientRegistrationRequest, MCP_DCR_MAX_REDIRECT_URIS, dynamicClientRegistrationResponse, authorizationServerMetadata, protectedResourceMetadata, } from './oauth.js';
51
51
  export type { OauthErrorCode, OauthError, OauthRedirectResponse, OauthCodeTokenRequest, OauthRefreshTokenRequest, OauthTokenRequest, OauthTokenResponse, RedirectUri, OauthAuthorizeQuery, DynamicClientRegistrationRequest, DynamicClientRegistrationResponse, AuthorizationServerMetadata, ProtectedResourceMetadata, } from './oauth.js';
52
52
  export { ROUTES, ROUTE_SECTIONS, IN_HANDLER_ROUTES } from './routes.js';
package/dist/index.js CHANGED
@@ -46,6 +46,6 @@ export { APP_USER_DISPLAY_NAME_MAX, APP_URL_PLACEHOLDERS, MAIL_TEMPLATE_VARIABLE
46
46
  export { assetKind, URDF_ASSET_NAME, asset, urdfCompleteness, assetListResponse, assetsClearResponse, missingAssetQuery, assetSyncRequest, assetSyncResponse, assetSyncState, assetSyncStatus, assetFailure, assetFailureKind, assetStoreRefusedDetails, assetSyncBusyDetails, ROBOT_ASSET_STORE_BYTES, } from './assets.js';
47
47
  export { auditActor, auditEvent, auditQuery, auditListResponse, AUDIT_CSV_COLUMNS, AUDIT_RETENTION_DAYS } from './audit.js';
48
48
  export { alertRowCondition, alertSeverity, alertState, datapointAlertRow, alertListResponse, orgFiringAlertsResponse, orgAlertsQuery, datapointDisplay, putDatapointDisplayRequest, } from './alerts.js';
49
- export { apiError, parameterViolation, parameterInvalidDetails, ERROR_CODES } from './errors.js';
49
+ export { apiError, parameterViolation, parameterInvalidDetails, cancelRejectedDetails, ERROR_CODES } from './errors.js';
50
50
  export { oauthErrorCode, oauthError, oauthRedirectResponse, oauthCodeTokenRequest, oauthRefreshTokenRequest, oauthTokenRequest, oauthTokenResponse, redirectUri, codeChallengeMethod, oauthAuthorizeQuery, dynamicClientRegistrationRequest, MCP_DCR_MAX_REDIRECT_URIS, dynamicClientRegistrationResponse, authorizationServerMetadata, protectedResourceMetadata, } from './oauth.js';
51
51
  export { ROUTES, ROUTE_SECTIONS, IN_HANDLER_ROUTES } from './routes.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleetless/contracts",
3
- "version": "5.1.0-next.2",
3
+ "version": "5.2.0",
4
4
  "description": "Fleetless wire contracts: the bridge-cloud protocol, the REST API schemas and the error codes, as zod schemas with generated JSON Schema and OpenAPI artifacts.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Dehne Robotik GmbH",