@fleetless/contracts 9.0.0 → 9.2.0-next.1
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 +28 -0
- package/artifacts/openapi.json +281 -20
- package/artifacts/routes.json +65 -4
- package/artifacts/schema/action-config.schema.json +2 -2
- package/artifacts/schema/bridge-state.schema.json +14 -0
- package/artifacts/schema/client-robot-list-item.schema.json +14 -0
- package/artifacts/schema/client-robot-list-response.schema.json +14 -0
- package/artifacts/schema/cloud-config.schema.json +8 -8
- package/artifacts/schema/config-draft-response.schema.json +8 -8
- package/artifacts/schema/config-version-response.schema.json +8 -8
- package/artifacts/schema/datapoint-config.schema.json +3 -3
- package/artifacts/schema/parameter-spec.schema.json +1 -1
- package/artifacts/schema/publisher-config.schema.json +1 -1
- package/artifacts/schema/recover-held-job-request.schema.json +29 -0
- package/artifacts/schema/recover-held-job-response.schema.json +125 -0
- package/artifacts/schema/robot-config-doc.schema.json +8 -8
- package/artifacts/schema/robot-detail-response.schema.json +14 -0
- package/artifacts/schema/robot-list-item.schema.json +14 -0
- package/artifacts/schema/robot-list-response.schema.json +14 -0
- package/artifacts/schema/service-config.schema.json +1 -1
- package/artifacts/schema/support-renew-fail-refusal.schema.json +141 -0
- package/artifacts/schema/support-renew-fail-request.schema.json +28 -0
- package/dist/client-robots.d.ts +7 -1
- package/dist/client-robots.js +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +7 -7
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +31 -15
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/mcp.d.ts +13 -10
- package/dist/mcp.js +13 -10
- package/dist/protocol.d.ts +3 -0
- package/dist/protocol.js +1 -0
- package/dist/rest.d.ts +52 -0
- package/dist/rest.js +15 -0
- package/dist/routes.js +45 -7
- package/dist/support.d.ts +42 -0
- package/dist/support.js +15 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -21,20 +21,20 @@ export { DOCUMENT_ROOT_PATH, EXPOSURE_SECTIONS, schemaIssues, formatPath, splitF
|
|
|
21
21
|
export type { SchemaIssue, ExposureSection } from './config-issues.js';
|
|
22
22
|
export { rosGraphEntry, rosGraph, typeField, typeDefinition, parameterFieldsOf } from './introspection.js';
|
|
23
23
|
export type { RosGraphEntry, RosGraph, TypeField, TypeDefinition } from './introspection.js';
|
|
24
|
-
export { robot, patchRobotResponse, robotToken, createRobotRequest, createRobotResponse, robotTokenRotateResponse, jointStatePutRequest, jointStatePutResponse, exposureCounts, protocolStatusValue, robotListItem, robotListResponse, datapointValue, robotDetailResponse, configDraftResponse, putConfigDraftRequest, publishConfigResponse, configVersionsResponse, configVersionResponse, introspectionResponse, typesResponse, fetchTypesRequest, fetchTypesResponse, datapointDescriptor, datapointListResponse, robotDetailsDoc, putRobotDetailsResponse, putRobotDetailsRequest, invokeRequest, invokeResponse, cancelRequest, releaseLiveQuery, serviceCallResponse, invokeOrServiceResponse, publishRequest, jobResponse, robotJobsResponse, rateLimitDetails, exposure, exposureListResponse, SNAPSHOT_HEADERS, ASSET_UPLOAD_HEADERS, cameraDescriptor, cameraListResponse, liveSessionResponse, snapshotMetaResponse, historyQuery, historySamplesResponse, historyBucketsResponse, historyResponse, orgQuotas, orgQuotaUsage, orgQuotaUsageCounts, robotDeletionSummary, RESOURCE_HEALTH_STATES, resourceHealthState, resourceHealthListResponse, orgHealthQuery, robotDeleteQuery, patchRobotRequest, renameSlugRequest, renameSlugResponse, slugUsageResponse, } from './rest.js';
|
|
24
|
+
export { robot, patchRobotResponse, robotToken, createRobotRequest, createRobotResponse, robotTokenRotateResponse, jointStatePutRequest, jointStatePutResponse, exposureCounts, protocolStatusValue, robotListItem, robotListResponse, datapointValue, robotDetailResponse, configDraftResponse, putConfigDraftRequest, publishConfigResponse, configVersionsResponse, configVersionResponse, introspectionResponse, typesResponse, fetchTypesRequest, fetchTypesResponse, datapointDescriptor, datapointListResponse, robotDetailsDoc, putRobotDetailsResponse, putRobotDetailsRequest, invokeRequest, invokeResponse, cancelRequest, recoverHeldJobRequest, recoverHeldJobResponse, releaseLiveQuery, serviceCallResponse, invokeOrServiceResponse, publishRequest, jobResponse, robotJobsResponse, rateLimitDetails, exposure, exposureListResponse, SNAPSHOT_HEADERS, ASSET_UPLOAD_HEADERS, cameraDescriptor, cameraListResponse, liveSessionResponse, snapshotMetaResponse, historyQuery, historySamplesResponse, historyBucketsResponse, historyResponse, orgQuotas, orgQuotaUsage, orgQuotaUsageCounts, robotDeletionSummary, RESOURCE_HEALTH_STATES, resourceHealthState, resourceHealthListResponse, orgHealthQuery, robotDeleteQuery, patchRobotRequest, renameSlugRequest, renameSlugResponse, slugUsageResponse, } from './rest.js';
|
|
25
25
|
export type { HistoryQuery, HistorySamplesResponse, HistoryResponse, HistoryBucketsResponse, OrgQuotas, OrgQuotaUsage, OrgQuotaUsageCounts, RobotDeletionSummary, ResourceHealthState, ResourceHealthListResponse, OrgHealthQuery, RobotDeleteQuery, PatchRobotRequest, RenameSlugRequest, RenameSlugResponse, SlugUsageResponse, } from './rest.js';
|
|
26
26
|
export { LATENCY_BUCKET_MS, BRIDGE_LATENCY_RETENTION_DAYS, MAX_LATENCY_BUCKETS_PER_RESPONSE, latencyBucket, robotLatencySeries, orgLatencyQuery, orgLatencyResponse, USAGE_WINDOW_MAX_DAYS, usageMetric, usageDay, orgUsageQuery, usageRow, orgUsageResponse, } from './rest.js';
|
|
27
27
|
export type { LatencyBucket, RobotLatencySeries, OrgLatencyResponse } from './rest.js';
|
|
28
28
|
export type { UsageMetric, OrgUsageQuery, UsageRow, OrgUsageResponse } from './rest.js';
|
|
29
|
-
export type { Robot, PatchRobotResponse, CreateRobotRequest, CreateRobotResponse, RobotTokenRotateResponse, JointStatePutRequest, JointStatePutResponse, ExposureCounts, ProtocolStatusValue, RobotListItem, RobotListResponse, DatapointValue, RobotDetailResponse, ConfigDraftResponse, PutConfigDraftRequest, PublishConfigResponse, ConfigVersionsResponse, ConfigVersionResponse, IntrospectionResponse, TypesResponse, FetchTypesRequest, FetchTypesResponse, DatapointDescriptor, DatapointListResponse, RobotDetailsDoc, PutRobotDetailsResponse, PutRobotDetailsRequest, InvokeRequest, InvokeResponse, CancelRequest, ReleaseLiveQuery, ServiceCallResponse, InvokeOrServiceResponse, PublishRequest, JobResponse, RobotJobsResponse, RateLimitDetails, Exposure, ExposureListResponse, CameraDescriptor, CameraListResponse, LiveSessionResponse, SnapshotMetaResponse, } from './rest.js';
|
|
29
|
+
export type { Robot, PatchRobotResponse, CreateRobotRequest, CreateRobotResponse, RobotTokenRotateResponse, JointStatePutRequest, JointStatePutResponse, ExposureCounts, ProtocolStatusValue, RobotListItem, RobotListResponse, DatapointValue, RobotDetailResponse, ConfigDraftResponse, PutConfigDraftRequest, PublishConfigResponse, ConfigVersionsResponse, ConfigVersionResponse, IntrospectionResponse, TypesResponse, FetchTypesRequest, FetchTypesResponse, DatapointDescriptor, DatapointListResponse, RobotDetailsDoc, PutRobotDetailsResponse, PutRobotDetailsRequest, InvokeRequest, InvokeResponse, CancelRequest, RecoverHeldJobRequest, RecoverHeldJobResponse, ReleaseLiveQuery, ServiceCallResponse, InvokeOrServiceResponse, PublishRequest, JobResponse, RobotJobsResponse, RateLimitDetails, Exposure, ExposureListResponse, CameraDescriptor, CameraListResponse, LiveSessionResponse, SnapshotMetaResponse, } from './rest.js';
|
|
30
30
|
export { clientAuth, authOk, authError, clientInvoke, clientCancel, clientPublish, commandResult, errorFrame, clientSubscribe, clientUnsubscribe, subscribeError, datapointEvent, resourceHealthEvent, resourceHealthCleared, liveSessionEndReason, liveSessionEvent, ORG_EVENT_SAMPLE_INTERVAL_MS, ORG_EVENT_ORG_CEILING_PER_SECOND, ORG_EVENT_BUFFER_SIZE, ORG_EVENT_BUFFER_IDLE_MS, ORG_EVENT_DETAIL_MAX_BYTES, orgEventKind, orgEventSeverity, orgEvent, orgEventSubscribe, orgEventUnsubscribe, orgEventReplay, orgEventDropped, } from './realtime.js';
|
|
31
31
|
export type { ClientAuth, AuthOk, AuthError, ClientInvoke, ClientCancel, ClientPublish, CommandResult, ErrorFrame, ClientSubscribe, ClientUnsubscribe, SubscribeError, DatapointEvent, ResourceHealthEvent, ResourceHealthCleared, LiveSessionEndReason, LiveSessionEvent, OrgEventKind, OrgEventSeverity, OrgEvent, OrgEventSubscribe, OrgEventUnsubscribe, OrgEventReplay, OrgEventDropped, } from './realtime.js';
|
|
32
32
|
export { password, org, patchOrgResponse, sessionTokens, refreshRequest, WAITLIST_F1_TEXT_VERSION, waitlistRequest, USER_DISPLAY_NAME_MAX, orgAdminTier, fleetlessUser, fleetlessUserListResponse, createTeamInviteRequest, teamInvite, pendingTeamInvite, pendingTeamInviteListResponse, acceptTeamInviteRequest, patchFleetlessUserRequest, tierChangeRequest, mailStatus, tierRequiredDetails, passwordChangeRequest, idpIssuer, loginCode, totpCode, recoveryCode, recoveryCodesList, twoFactorSetupResponse, webauthnJson, webauthnOptionsResponse, developerPasskey, developerTwoFactor, createPasskeyRequest, createPasskeyResponse, renamePasskeyRequest, totpConfirmRequest, totpConfirmResponse, recoveryCodesResponse, authMeResponse, patchOrgRequest, patchAuthMeRequest, } from './identity.js';
|
|
33
33
|
export type { Org, PatchOrgResponse, SessionTokens, RefreshRequest, WaitlistRequest, OrgAdminTier, FleetlessUser, FleetlessUserListResponse, CreateTeamInviteRequest, TeamInvite, PendingTeamInvite, PendingTeamInviteListResponse, AcceptTeamInviteRequest, PatchFleetlessUserRequest, TierChangeRequest, MailStatus, TierRequiredDetails, PasswordChangeRequest, IdpIssuer, TwoFactorSetupResponse, WebauthnOptionsResponse, DeveloperPasskey, DeveloperTwoFactor, CreatePasskeyRequest, CreatePasskeyResponse, RenamePasskeyRequest, TotpConfirmRequest, TotpConfirmResponse, RecoveryCodesResponse, AuthMeResponse, PatchOrgRequest, PatchAuthMeRequest, } from './identity.js';
|
|
34
34
|
export { FEEDBACK_KINDS, FEEDBACK_MESSAGE_MAX, feedbackKind, feedbackRequest, feedbackResponse } from './feedback.js';
|
|
35
35
|
export type { FeedbackKind, FeedbackRequest, FeedbackResponse } from './feedback.js';
|
|
36
|
-
export { supportSessionInfo, supportTokenRequest, supportTokenResponse, authMeSupportResponse } from './support.js';
|
|
37
|
-
export type { SupportSessionInfo, SupportTokenRequest, SupportTokenResponse, AuthMeSupportResponse } from './support.js';
|
|
36
|
+
export { supportSessionInfo, supportTokenRequest, supportTokenResponse, supportRenewFailRequest, supportRenewFailRefusal, authMeSupportResponse } from './support.js';
|
|
37
|
+
export type { SupportSessionInfo, SupportTokenRequest, SupportTokenResponse, SupportRenewFailRequest, SupportRenewFailRefusal, AuthMeSupportResponse } from './support.js';
|
|
38
38
|
export { appIdentifier, app, appListResponse, appDeletionSummary, createAppRequest, updateAppRequest, serverKeyToken, serverKey, serverKeyListResponse, createServerKeyResponse, role, roleListResponse, rolePermissions, roleRenameRequest, roleDeleteQuery, roleInUseDetails, } from './apps.js';
|
|
39
39
|
export type { App, AppListResponse, AppDeletionSummary, CreateAppRequest, UpdateAppRequest, ServerKey, ServerKeyListResponse, CreateServerKeyResponse, Role, RoleListResponse, RolePermissions, RoleRenameRequest, RoleDeleteQuery, RoleInUseDetails, } from './apps.js';
|
|
40
40
|
export { clientLoginRequest, clientRefreshRequest, clientLogoutRequest, clientRegisterRequest, clientVerifyEmailRequest, clientResendVerificationRequest, clientPasswordResetRequest, clientPasswordResetConfirmRequest, clientAcceptInvitationRequest, CLIENT_OIDC_CALLBACK_PATH, clientProviderListQuery, clientProviderListResponse, clientOidcStartQuery, clientOidcCallbackQuery, clientOidcExchangeRequest, clientOidcErrorCode, clientMcpInteraction, clientMcpInteractionDecisionResponse, mcpConsentGrant, mcpConsentGrantListResponse, clientIdentity, clientLoginCodeRequest, clientLoginCodeVerifyRequest, twoFactorChallenge, clientSignInResult, clientTwoFactorVerifyRequest, clientTwoFactorSetupRequest, clientTwoFactorSetupConfirmRequest, clientTwoFactorSetupConfirmResponse, clientTwoFactorDisableRequest, } from './client-auth.js';
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ export { DOCUMENT_ROOT_PATH, EXPOSURE_SECTIONS, schemaIssues, formatPath, splitF
|
|
|
22
22
|
export { rosGraphEntry, rosGraph, typeField, typeDefinition, parameterFieldsOf } from './introspection.js';
|
|
23
23
|
export { robot, patchRobotResponse, robotToken, createRobotRequest, createRobotResponse, robotTokenRotateResponse, jointStatePutRequest, jointStatePutResponse, exposureCounts, protocolStatusValue, robotListItem, robotListResponse, datapointValue, robotDetailResponse, configDraftResponse, putConfigDraftRequest, publishConfigResponse, configVersionsResponse, configVersionResponse, introspectionResponse, typesResponse, fetchTypesRequest, fetchTypesResponse, datapointDescriptor, datapointListResponse, robotDetailsDoc, putRobotDetailsResponse, putRobotDetailsRequest, invokeRequest, invokeResponse,
|
|
24
24
|
// Addressing.
|
|
25
|
-
cancelRequest, releaseLiveQuery, serviceCallResponse, invokeOrServiceResponse, publishRequest, jobResponse, robotJobsResponse, rateLimitDetails, exposure, exposureListResponse, SNAPSHOT_HEADERS, ASSET_UPLOAD_HEADERS, cameraDescriptor, cameraListResponse, liveSessionResponse, snapshotMetaResponse,
|
|
25
|
+
cancelRequest, recoverHeldJobRequest, recoverHeldJobResponse, releaseLiveQuery, serviceCallResponse, invokeOrServiceResponse, publishRequest, jobResponse, robotJobsResponse, rateLimitDetails, exposure, exposureListResponse, SNAPSHOT_HEADERS, ASSET_UPLOAD_HEADERS, cameraDescriptor, cameraListResponse, liveSessionResponse, snapshotMetaResponse,
|
|
26
26
|
// Retention, history, quotas.
|
|
27
27
|
historyQuery, historySamplesResponse, historyBucketsResponse, historyResponse, orgQuotas, orgQuotaUsage, orgQuotaUsageCounts, robotDeletionSummary, RESOURCE_HEALTH_STATES, resourceHealthState, resourceHealthListResponse, orgHealthQuery, robotDeleteQuery,
|
|
28
28
|
// Robot rename, slug rename.
|
|
@@ -45,7 +45,7 @@ authMeResponse, patchOrgRequest, patchAuthMeRequest, } from './identity.js';
|
|
|
45
45
|
// 2026-09-30 — the console's feedback modal.
|
|
46
46
|
export { FEEDBACK_KINDS, FEEDBACK_MESSAGE_MAX, feedbackKind, feedbackRequest, feedbackResponse } from './feedback.js';
|
|
47
47
|
// Support sessions: an operator temporarily holding a console session for one org (internal, additive).
|
|
48
|
-
export { supportSessionInfo, supportTokenRequest, supportTokenResponse, authMeSupportResponse } from './support.js';
|
|
48
|
+
export { supportSessionInfo, supportTokenRequest, supportTokenResponse, supportRenewFailRequest, supportRenewFailRefusal, authMeSupportResponse } from './support.js';
|
|
49
49
|
export { appIdentifier, app, appListResponse, appDeletionSummary, createAppRequest, updateAppRequest, serverKeyToken, serverKey, serverKeyListResponse, createServerKeyResponse, role, roleListResponse, rolePermissions, roleRenameRequest, roleDeleteQuery, roleInUseDetails, } from './apps.js';
|
|
50
50
|
export { clientLoginRequest, clientRefreshRequest, clientLogoutRequest, clientRegisterRequest, clientVerifyEmailRequest, clientResendVerificationRequest, clientPasswordResetRequest, clientPasswordResetConfirmRequest, clientAcceptInvitationRequest, CLIENT_OIDC_CALLBACK_PATH, clientProviderListQuery, clientProviderListResponse, clientOidcStartQuery, clientOidcCallbackQuery, clientOidcExchangeRequest, clientOidcErrorCode, clientMcpInteraction, clientMcpInteractionDecisionResponse, mcpConsentGrant, mcpConsentGrantListResponse, clientIdentity, clientLoginCodeRequest, clientLoginCodeVerifyRequest, twoFactorChallenge, clientSignInResult, clientTwoFactorVerifyRequest, clientTwoFactorSetupRequest, clientTwoFactorSetupConfirmRequest, clientTwoFactorSetupConfirmResponse, clientTwoFactorDisableRequest, } from './client-auth.js';
|
|
51
51
|
export { clientRobotListItem, clientRobotListResponse } from './client-robots.js';
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
/**
|
|
4
|
-
* The MCP server: **one** remote
|
|
5
|
-
* tools
|
|
6
|
-
*
|
|
4
|
+
* The central MCP server: **one** remote endpoint for Fleetless users. Its
|
|
5
|
+
* tools use a fixed catalog; access to a robot's exposed services and
|
|
6
|
+
* datapoints is checked for each call. App users have an app-specific endpoint.
|
|
7
7
|
*
|
|
8
8
|
* **This file describes the seam, not the protocol.** The MCP messages
|
|
9
9
|
* themselves (`initialize`, `tools/list`, `tools/call`) are defined by the
|
|
@@ -123,9 +123,9 @@ export interface McpAppPaths {
|
|
|
123
123
|
}
|
|
124
124
|
export declare function MCP_APP_PATHS(appIdentifier: string): McpAppPaths;
|
|
125
125
|
/**
|
|
126
|
-
* Which exposed kind a
|
|
127
|
-
* ours, so the console can group a preview
|
|
128
|
-
*
|
|
126
|
+
* Which exposed kind a datasheet entry came from. Not the MCP protocol's
|
|
127
|
+
* vocabulary — ours, so the console can group a preview as the services
|
|
128
|
+
* editor does.
|
|
129
129
|
*/
|
|
130
130
|
export declare const mcpToolKind: z.ZodEnum<{
|
|
131
131
|
datapoint: "datapoint";
|
|
@@ -135,11 +135,14 @@ export declare const mcpToolKind: z.ZodEnum<{
|
|
|
135
135
|
camera: "camera";
|
|
136
136
|
}>;
|
|
137
137
|
export type McpToolKind = z.infer<typeof mcpToolKind>;
|
|
138
|
-
/**
|
|
138
|
+
/**
|
|
139
|
+
* MCP's bound on a tool name, and the charset safe across clients.
|
|
140
|
+
* `robots.describe` names a tool and action; only `robots` is a tool name.
|
|
141
|
+
*/
|
|
139
142
|
export declare const MCP_TOOL_NAME_MAX = 128;
|
|
140
143
|
export declare const mcpToolNamePattern: RegExp;
|
|
141
144
|
/**
|
|
142
|
-
* One exposure of a robot, as `
|
|
145
|
+
* One exposure of a robot, as `robots.describe` and the console's per-role
|
|
143
146
|
* preview list it. Every exposure the role grants is listed —
|
|
144
147
|
* a missing `description` is shown as `null`, never used to hide the entry.
|
|
145
148
|
*
|
|
@@ -170,7 +173,7 @@ export declare const mcpCapabilities: z.ZodObject<{
|
|
|
170
173
|
}, z.core.$strip>;
|
|
171
174
|
export type McpCapabilities = z.infer<typeof mcpCapabilities>;
|
|
172
175
|
/**
|
|
173
|
-
* What one caller may do on one robot — the answer to `
|
|
176
|
+
* What one caller may do on one robot — the answer to `robots.describe`, and
|
|
174
177
|
* since 1.1.0 to `GET /api/robots/:id/datasheet` as well. One schema for both
|
|
175
178
|
* surfaces on purpose: an app and an AI tool read the same description of the
|
|
176
179
|
* same grant. The `mcp` prefix is history, not scope.
|
|
@@ -232,7 +235,7 @@ export declare const mcpRolePreviewResponse: z.ZodObject<{
|
|
|
232
235
|
export type McpRolePreviewResponse = z.infer<typeof mcpRolePreviewResponse>;
|
|
233
236
|
/**
|
|
234
237
|
* Where a signed asset link is served. An MCP session token is refused on
|
|
235
|
-
* REST by design, so `
|
|
238
|
+
* REST by design, so `assets.get`/`assets.urdf` mint a bearer-free link the agent
|
|
236
239
|
* behind the client can fetch. Lifetime is fixed; the token binds robot, asset
|
|
237
240
|
* and expiry under `JWT_SECRET`.
|
|
238
241
|
*/
|
package/dist/mcp.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { slug } from './common.js';
|
|
4
4
|
/**
|
|
5
|
-
* The MCP server: **one** remote
|
|
6
|
-
* tools
|
|
7
|
-
*
|
|
5
|
+
* The central MCP server: **one** remote endpoint for Fleetless users. Its
|
|
6
|
+
* tools use a fixed catalog; access to a robot's exposed services and
|
|
7
|
+
* datapoints is checked for each call. App users have an app-specific endpoint.
|
|
8
8
|
*
|
|
9
9
|
* **This file describes the seam, not the protocol.** The MCP messages
|
|
10
10
|
* themselves (`initialize`, `tools/list`, `tools/call`) are defined by the
|
|
@@ -85,16 +85,19 @@ export function MCP_APP_PATHS(appIdentifier) {
|
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
|
-
* Which exposed kind a
|
|
89
|
-
* ours, so the console can group a preview
|
|
90
|
-
*
|
|
88
|
+
* Which exposed kind a datasheet entry came from. Not the MCP protocol's
|
|
89
|
+
* vocabulary — ours, so the console can group a preview as the services
|
|
90
|
+
* editor does.
|
|
91
91
|
*/
|
|
92
92
|
export const mcpToolKind = z.enum(['datapoint', 'service', 'action', 'publisher', 'camera']);
|
|
93
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* MCP's bound on a tool name, and the charset safe across clients.
|
|
95
|
+
* `robots.describe` names a tool and action; only `robots` is a tool name.
|
|
96
|
+
*/
|
|
94
97
|
export const MCP_TOOL_NAME_MAX = 128;
|
|
95
98
|
export const mcpToolNamePattern = /^[a-z0-9][a-z0-9_-]*$/;
|
|
96
99
|
/**
|
|
97
|
-
* One exposure of a robot, as `
|
|
100
|
+
* One exposure of a robot, as `robots.describe` and the console's per-role
|
|
98
101
|
* preview list it. Every exposure the role grants is listed —
|
|
99
102
|
* a missing `description` is shown as `null`, never used to hide the entry.
|
|
100
103
|
*
|
|
@@ -125,7 +128,7 @@ export const mcpCapabilities = z.object({
|
|
|
125
128
|
assets: z.boolean(),
|
|
126
129
|
});
|
|
127
130
|
/**
|
|
128
|
-
* What one caller may do on one robot — the answer to `
|
|
131
|
+
* What one caller may do on one robot — the answer to `robots.describe`, and
|
|
129
132
|
* since 1.1.0 to `GET /api/robots/:id/datasheet` as well. One schema for both
|
|
130
133
|
* surfaces on purpose: an app and an AI tool read the same description of the
|
|
131
134
|
* same grant. The `mcp` prefix is history, not scope.
|
|
@@ -148,7 +151,7 @@ export const mcpRolePreviewResponse = z.object({
|
|
|
148
151
|
});
|
|
149
152
|
/**
|
|
150
153
|
* Where a signed asset link is served. An MCP session token is refused on
|
|
151
|
-
* REST by design, so `
|
|
154
|
+
* REST by design, so `assets.get`/`assets.urdf` mint a bearer-free link the agent
|
|
152
155
|
* behind the client can fetch. Lifetime is fixed; the token binds robot, asset
|
|
153
156
|
* and expiry under `JWT_SECRET`.
|
|
154
157
|
*/
|
package/dist/protocol.d.ts
CHANGED
|
@@ -942,6 +942,9 @@ export declare const bridgeState: z.ZodObject<{
|
|
|
942
942
|
online: z.ZodBoolean;
|
|
943
943
|
latency_ms: z.ZodNullable<z.ZodNumber>;
|
|
944
944
|
low_bandwidth: z.ZodBoolean;
|
|
945
|
+
health_reason: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
946
|
+
job_query_unanswered: "job_query_unanswered";
|
|
947
|
+
}>>>;
|
|
945
948
|
}, z.core.$strip>;
|
|
946
949
|
export type BridgeState = z.infer<typeof bridgeState>;
|
|
947
950
|
/**
|
package/dist/protocol.js
CHANGED
|
@@ -706,6 +706,7 @@ export const bridgeState = z.object({
|
|
|
706
706
|
online: z.boolean(),
|
|
707
707
|
latency_ms: z.number().nonnegative().nullable(),
|
|
708
708
|
low_bandwidth: z.boolean().meta({ description: 'Whether the bridge is in its low-bandwidth mode: datapoints capped, cameras reduced or stopped. Bridge-reported.' }),
|
|
709
|
+
health_reason: z.enum(['job_query_unanswered']).nullable().optional().meta({ description: 'Cloud-observed connection health: `job_query_unanswered` after a bridge ignores held-job queries; `null` on an ordinary connect or disconnect. Optional for older observations.' }),
|
|
709
710
|
});
|
|
710
711
|
/* ------------------------------------------------------------------------
|
|
711
712
|
* Cameras.
|
package/dist/rest.d.ts
CHANGED
|
@@ -117,6 +117,9 @@ export declare const robotListItem: z.ZodObject<{
|
|
|
117
117
|
online: z.ZodBoolean;
|
|
118
118
|
latency_ms: z.ZodNullable<z.ZodNumber>;
|
|
119
119
|
low_bandwidth: z.ZodBoolean;
|
|
120
|
+
health_reason: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
121
|
+
job_query_unanswered: "job_query_unanswered";
|
|
122
|
+
}>>>;
|
|
120
123
|
}, z.core.$strip>;
|
|
121
124
|
exposes: z.ZodObject<{
|
|
122
125
|
datapoints: z.ZodNumber;
|
|
@@ -141,6 +144,9 @@ export declare const robotListResponse: z.ZodObject<{
|
|
|
141
144
|
online: z.ZodBoolean;
|
|
142
145
|
latency_ms: z.ZodNullable<z.ZodNumber>;
|
|
143
146
|
low_bandwidth: z.ZodBoolean;
|
|
147
|
+
health_reason: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
148
|
+
job_query_unanswered: "job_query_unanswered";
|
|
149
|
+
}>>>;
|
|
144
150
|
}, z.core.$strip>;
|
|
145
151
|
exposes: z.ZodObject<{
|
|
146
152
|
datapoints: z.ZodNumber;
|
|
@@ -217,6 +223,9 @@ export declare const robotDetailResponse: z.ZodObject<{
|
|
|
217
223
|
online: z.ZodBoolean;
|
|
218
224
|
latency_ms: z.ZodNullable<z.ZodNumber>;
|
|
219
225
|
low_bandwidth: z.ZodBoolean;
|
|
226
|
+
health_reason: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
227
|
+
job_query_unanswered: "job_query_unanswered";
|
|
228
|
+
}>>>;
|
|
220
229
|
}, z.core.$strip>;
|
|
221
230
|
exposes: z.ZodObject<{
|
|
222
231
|
datapoints: z.ZodNumber;
|
|
@@ -865,6 +874,49 @@ export declare const cancelRequest: z.ZodObject<{
|
|
|
865
874
|
job_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
866
875
|
}, z.core.$strict>;
|
|
867
876
|
export type CancelRequest = z.infer<typeof cancelRequest>;
|
|
877
|
+
/**
|
|
878
|
+
* Release one held job only after a human has physically stopped or isolated
|
|
879
|
+
* the robot and checked that it cannot move. This is an Owner operation, not
|
|
880
|
+
* an app command: a normal cancel asks the bridge to stop and cannot stand in
|
|
881
|
+
* for this assertion when the bridge is silent. The cloud cannot sense the
|
|
882
|
+
* physical stop from this field; it records the Owner's statement and reason.
|
|
883
|
+
*/
|
|
884
|
+
export declare const recoverHeldJobRequest: z.ZodObject<{
|
|
885
|
+
job_id: z.ZodUUID;
|
|
886
|
+
verified_stopped: z.ZodLiteral<true>;
|
|
887
|
+
reason: z.ZodString;
|
|
888
|
+
}, z.core.$strict>;
|
|
889
|
+
export type RecoverHeldJobRequest = z.infer<typeof recoverHeldJobRequest>;
|
|
890
|
+
/** The exact job settled to `lost` by the audited recovery. */
|
|
891
|
+
export declare const recoverHeldJobResponse: z.ZodObject<{
|
|
892
|
+
job: z.ZodObject<{
|
|
893
|
+
id: z.ZodUUID;
|
|
894
|
+
robot_id: z.ZodUUID;
|
|
895
|
+
slug: z.ZodString;
|
|
896
|
+
state: z.ZodEnum<{
|
|
897
|
+
unknown: "unknown";
|
|
898
|
+
failed: "failed";
|
|
899
|
+
running: "running";
|
|
900
|
+
succeeded: "succeeded";
|
|
901
|
+
cancelled: "cancelled";
|
|
902
|
+
lost: "lost";
|
|
903
|
+
}>;
|
|
904
|
+
origin: z.ZodEnum<{
|
|
905
|
+
fleetless: "fleetless";
|
|
906
|
+
external: "external";
|
|
907
|
+
}>;
|
|
908
|
+
started_at: z.ZodISODateTime;
|
|
909
|
+
updated_at: z.ZodISODateTime;
|
|
910
|
+
seq: z.ZodNumber;
|
|
911
|
+
result: z.ZodNullable<z.ZodUnknown>;
|
|
912
|
+
error: z.ZodNullable<z.ZodObject<{
|
|
913
|
+
code: z.ZodString;
|
|
914
|
+
message: z.ZodString;
|
|
915
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
916
|
+
}, z.core.$strip>>;
|
|
917
|
+
}, z.core.$strip>;
|
|
918
|
+
}, z.core.$strip>;
|
|
919
|
+
export type RecoverHeldJobResponse = z.infer<typeof recoverHeldJobResponse>;
|
|
868
920
|
/**
|
|
869
921
|
* The query of a live release: `DELETE .../live?session_id=<uuid>`.
|
|
870
922
|
*
|
package/dist/rest.js
CHANGED
|
@@ -333,6 +333,7 @@ export const putRobotDetailsRequest = z.object({ details: robotDetailsDoc });
|
|
|
333
333
|
* | `POST /api/robots/:id/jobs/:slug` | `invokeRequest` | `invokeResponse` (action) or `serviceCallResponse` (service) |
|
|
334
334
|
* | `GET /api/robots/:id/jobs/:slug` | — | `jobResponse` (the current job, or null) |
|
|
335
335
|
* | `POST /api/robots/:id/jobs/:slug/cancel` | `cancelRequest` | `jobResponse` |
|
|
336
|
+
* | `POST /api/robots/:id/jobs/:slug/recover` | `recoverHeldJobRequest` | `recoverHeldJobResponse` |
|
|
336
337
|
* | `POST /api/robots/:id/publishers/:slug` | `publishRequest`| 204 |
|
|
337
338
|
* | `GET /api/robots/:id/exposures` | — | `exposureListResponse` |
|
|
338
339
|
*
|
|
@@ -418,6 +419,20 @@ export const cancelRequest = z.object({
|
|
|
418
419
|
description: 'The one job to stop. Absent or `null` cancels whatever is currently running on the slug, which is what every caller written before this field existed means. Unknown keys are refused rather than stripped, so a misspelling cannot silently become the slug-wide cancel.',
|
|
419
420
|
}),
|
|
420
421
|
}).strict();
|
|
422
|
+
/**
|
|
423
|
+
* Release one held job only after a human has physically stopped or isolated
|
|
424
|
+
* the robot and checked that it cannot move. This is an Owner operation, not
|
|
425
|
+
* an app command: a normal cancel asks the bridge to stop and cannot stand in
|
|
426
|
+
* for this assertion when the bridge is silent. The cloud cannot sense the
|
|
427
|
+
* physical stop from this field; it records the Owner's statement and reason.
|
|
428
|
+
*/
|
|
429
|
+
export const recoverHeldJobRequest = z.object({
|
|
430
|
+
job_id: z.uuid().meta({ description: 'The exact held job id read from the robot job state; another job must never be released by a stale request.' }),
|
|
431
|
+
verified_stopped: z.literal(true).meta({ description: 'The Owner confirms a physical stop and safety check; this is not a cloud sensor reading.' }),
|
|
432
|
+
reason: z.string().trim().min(10).max(500).meta({ description: 'The Owner\'s reason and safety-check record, 10–500 characters after trimming; retained in the audit trail.' }),
|
|
433
|
+
}).strict();
|
|
434
|
+
/** The exact job settled to `lost` by the audited recovery. */
|
|
435
|
+
export const recoverHeldJobResponse = z.object({ job });
|
|
421
436
|
/**
|
|
422
437
|
* The query of a live release: `DELETE .../live?session_id=<uuid>`.
|
|
423
438
|
*
|
package/dist/routes.js
CHANGED
|
@@ -14,9 +14,9 @@ import { legalAcceptanceListQuery, legalAcceptanceListResponse } from './legal-a
|
|
|
14
14
|
import { MCP_APP_PATHS, mcpRobotDatasheet, mcpRolePreviewResponse } from './mcp.js';
|
|
15
15
|
import { authorizationServerMetadata, dynamicClientRegistrationRequest, dynamicClientRegistrationResponse, oauthAuthorizeQuery, oauthRedirectResponse, oauthTokenRequest, oauthTokenResponse, protectedResourceMetadata, } from './oauth.js';
|
|
16
16
|
import { adminPlanChangeRequest, orgPlan, planChangeRequest } from './plans.js';
|
|
17
|
-
import { supportTokenRequest, supportTokenResponse } from './support.js';
|
|
17
|
+
import { supportRenewFailRequest, supportTokenRequest, supportTokenResponse } from './support.js';
|
|
18
18
|
import { purchaseIntentLookupQuery, purchaseIntentConfirmRequest, purchaseIntentResponse, invoicePayRequest, billingCancelRequest, billingChangeRequest, billingChangeResponse, billingDetailsUpdate, billingDocumentDetail, billingDocumentFileQuery, billingDocumentList, billingView, chargePayRequest, checkoutRequest, checkoutResponse, checkoutStatus, paymentMethodChangeRequest, vatIdCheckRequest, vatIdCheckResponse, } from './billing.js';
|
|
19
|
-
import { cameraListResponse, cancelRequest, configDraftResponse, configVersionResponse, configVersionsResponse, createRobotRequest, createRobotResponse, datapointListResponse, datapointValue, exposureListResponse, fetchTypesRequest, fetchTypesResponse, historyQuery, historyResponse, introspectionResponse, invokeOrServiceResponse, invokeRequest, jobResponse, liveSessionResponse, orgHealthQuery, orgLatencyQuery, orgLatencyResponse, orgQuotaUsage, orgUsageQuery, orgUsageResponse, patchRobotRequest, patchRobotResponse, publishConfigResponse, publishRequest, putConfigDraftRequest, putRobotDetailsRequest, putRobotDetailsResponse, robotTokenRotateResponse, jointStatePutRequest, jointStatePutResponse, releaseLiveQuery, renameSlugRequest, renameSlugResponse, robotDeleteQuery, resourceHealthListResponse, robotDeletionSummary, robotDetailResponse, robotJobsResponse, robotListResponse, slugUsageResponse, snapshotMetaResponse, typesResponse, } from './rest.js';
|
|
19
|
+
import { cameraListResponse, cancelRequest, recoverHeldJobRequest, recoverHeldJobResponse, configDraftResponse, configVersionResponse, configVersionsResponse, createRobotRequest, createRobotResponse, datapointListResponse, datapointValue, exposureListResponse, fetchTypesRequest, fetchTypesResponse, historyQuery, historyResponse, introspectionResponse, invokeOrServiceResponse, invokeRequest, jobResponse, liveSessionResponse, orgHealthQuery, orgLatencyQuery, orgLatencyResponse, orgQuotaUsage, orgUsageQuery, orgUsageResponse, patchRobotRequest, patchRobotResponse, publishConfigResponse, publishRequest, putConfigDraftRequest, putRobotDetailsRequest, putRobotDetailsResponse, robotTokenRotateResponse, jointStatePutRequest, jointStatePutResponse, releaseLiveQuery, renameSlugRequest, renameSlugResponse, robotDeleteQuery, resourceHealthListResponse, robotDeletionSummary, robotDetailResponse, robotJobsResponse, robotListResponse, slugUsageResponse, snapshotMetaResponse, typesResponse, } from './rest.js';
|
|
20
20
|
export const ROUTE_SECTIONS = [
|
|
21
21
|
{ id: 'health', title: 'Health' },
|
|
22
22
|
{ id: 'developer-auth', title: 'Developer auth' },
|
|
@@ -54,6 +54,9 @@ const APP_IDENTIFIER = {
|
|
|
54
54
|
};
|
|
55
55
|
/** The routes that verify a credential inside the handler; `auth: 'in_handler'` is refused elsewhere. */
|
|
56
56
|
export const IN_HANDLER_ROUTES = [
|
|
57
|
+
// The old support bearer must reach the flow transaction after a newer
|
|
58
|
+
// generation wins; a generic current-generation guard would hide that race.
|
|
59
|
+
'POST /console/support/renew/fail',
|
|
57
60
|
'POST /mcp',
|
|
58
61
|
// The per-app endpoint, all three verbs: the bearer decides which app user
|
|
59
62
|
// is calling, and the path names none of that. Built from `MCP_APP` so the
|
|
@@ -634,7 +637,7 @@ export const ROUTES = [
|
|
|
634
637
|
],
|
|
635
638
|
query: null, request: null, response: mcpRolePreviewResponse,
|
|
636
639
|
errors: [...DEVELOPER_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
637
|
-
notes: 'Built by the same builder the MCP server\'s own `
|
|
640
|
+
notes: 'Built by the same builder the MCP server\'s own `robots.describe` uses, so the two cannot drift. It answers what the role *would* be ' +
|
|
638
641
|
'offered and consults nothing about any user\'s actual MCP entitlement. A robot the role grants nothing on still appears, with an empty ' +
|
|
639
642
|
'`exposures` — dropping it would read as "not attached", which is a different fact.',
|
|
640
643
|
},
|
|
@@ -1544,6 +1547,28 @@ export const ROUTES = [
|
|
|
1544
1547
|
'session that outlives its ceiling is a new grant and a new exchange, not a renewal. The session starts in `read` mode; switching one to ' +
|
|
1545
1548
|
'`edit` is the operator side\'s `support_session_edit` command, not anything this route does.',
|
|
1546
1549
|
},
|
|
1550
|
+
{
|
|
1551
|
+
method: 'POST', path: '/console/support/renew/fail', section: 'developer-auth',
|
|
1552
|
+
summary: 'Ends a current-generation support session after Console proves renewal authority failed.',
|
|
1553
|
+
audience: 'internal', auth: 'in_handler', rateLimited: false, ownerTier: false, status: 204,
|
|
1554
|
+
params: [], query: null, request: supportRenewFailRequest, response: null,
|
|
1555
|
+
errors: ['validation_error', 'unauthorized', 'not_found', 'target_state_conflict'], transport: 'http',
|
|
1556
|
+
notes: 'Internal Console-to-Cloud POST only, no CORS. Console must first verify and consume signed Operator failure evidence ' +
|
|
1557
|
+
'bound to its original browser flow, or let Cloud timeout/sweep close an uncompleted flow; browser flow_id or error alone ' +
|
|
1558
|
+
'must never trigger this call. The evidence stays at Console: this strict Cloud request has no Operator or browser field. ' +
|
|
1559
|
+
'Authorization: Bearer <original fl_support>; a valid old bearer must reach the ' +
|
|
1560
|
+
'transaction even after another flow wins its generation, so a current-generation pre-handler must not intercept it. Cloud checks ' +
|
|
1561
|
+
'signature, audience, original expiry, exact stored bearer hash, S256 verifier, and bound session, org, mode and immutable creator ' +
|
|
1562
|
+
'subject. Lock session and flow in redemption order. After proof and before mutation, compare the saved credential generation: ' +
|
|
1563
|
+
'stale_generation takes precedence and cannot touch the winner. Only a live, pending, unauthorised current-generation flow before ' +
|
|
1564
|
+
'min(flow_created_at + 120 seconds, old credential expiry) atomically records failedAt, endedAt and audit/event. Success is 204 ' +
|
|
1565
|
+
'with no body. Missing callback closes an unauthorised expired flow at the next session check or sweep under the same generation fence. ' +
|
|
1566
|
+
'No failure extends a lease or compensates a committed redemption. Every refusal is Cache-Control: no-store with ' +
|
|
1567
|
+
'supportRenewFailRefusal body: 400 validation_error/invalid_flow for malformed JSON; 401 unauthorized/invalid_authority for missing ' +
|
|
1568
|
+
'or invalid bearer or proof; 404 not_found/invalid_flow for unknown or foreign flow, or /identity_mismatch for bound identity mismatch; ' +
|
|
1569
|
+
'409 target_state_conflict/expired, /replayed, /session_inactive or /stale_generation. No failure response sets or clears fl_support. ' +
|
|
1570
|
+
'Network ambiguity is never a 204 and does not trigger an unconditional support_session.end.',
|
|
1571
|
+
},
|
|
1547
1572
|
/* --------------------------------- the Fleetless-hosted app pages */
|
|
1548
1573
|
...HOSTED_APP_ROUTES,
|
|
1549
1574
|
/* ---------------------------------------------------- mcp (the endpoint) */
|
|
@@ -1570,7 +1595,7 @@ export const ROUTES = [
|
|
|
1570
1595
|
'the refusal has to carry a `WWW-Authenticate` challenge that a guard shared with the REST surface does not send. `Origin` is checked ' +
|
|
1571
1596
|
'against the cloud\'s own, and a foreign one is the `403 forbidden` above. **Both catalogs, unconditionally**: every caller admitted ' +
|
|
1572
1597
|
'here is a Fleetless user, so the tool list has nothing left to vary with and the admin-ness check on `tools/call` is gone — a console ' +
|
|
1573
|
-
'tool that is still narrower than the catalog refuses for itself (`
|
|
1598
|
+
'tool that is still narrower than the catalog refuses for itself (`console_robots_write.delete` answers `tier_required` to a non-Owner). ' +
|
|
1574
1599
|
'`403 forbidden` is also what an `mcp_session` token whose subject is an **app user** gets: this endpoint serves the team only, and such ' +
|
|
1575
1600
|
'a token belongs to its own app\'s endpoint. The code is `forbidden` rather than `mcp_disabled` because nothing is switched off — the ' +
|
|
1576
1601
|
'caller is at the wrong server — and per-app sign-in mints exactly such tokens, so the two states must not share a word. ' +
|
|
@@ -2318,10 +2343,10 @@ export const ROUTES = [
|
|
|
2318
2343
|
audience: 'client', auth: 'developer_or_client', rateLimited: false, ownerTier: false, status: 200,
|
|
2319
2344
|
params: [], query: null, request: null, response: clientRobotListResponse,
|
|
2320
2345
|
errors: [...CLIENT_GUARD], transport: 'http',
|
|
2321
|
-
notes: '**The REST twin of the MCP
|
|
2346
|
+
notes: '**The REST twin of the MCP action `robots.list`**, and the one robot question no robot-scoped route can answer: which robots may I name ' +
|
|
2322
2347
|
'at all. An app user sees the robots their app attaches on which their role grants at least one slug or capability; a server key sees ' +
|
|
2323
2348
|
'every robot its app attaches; a developer bearer sees the organisation\'s robots. Name order, id as the tiebreak. A robot on which the ' +
|
|
2324
|
-
'role grants nothing is absent rather than listed empty — the same answer `
|
|
2349
|
+
'role grants nothing is absent rather than listed empty — the same answer `robots.list` gives, for the same reason: reach is a grant, ' +
|
|
2325
2350
|
'not an attachment. Under `/api/client/` because it names no robot; every robot-scoped read stays under `/api/robots/:id/…`.',
|
|
2326
2351
|
},
|
|
2327
2352
|
{
|
|
@@ -2331,7 +2356,7 @@ export const ROUTES = [
|
|
|
2331
2356
|
params: [{ name: 'id', description: 'The robot\'s uuid, as `GET /api/client/robots` lists it.' }],
|
|
2332
2357
|
query: null, request: null, response: mcpRobotDatasheet,
|
|
2333
2358
|
errors: [...CLIENT_GUARD, 'invalid_uuid', 'not_found'], transport: 'http',
|
|
2334
|
-
notes: '**The REST twin of the MCP
|
|
2359
|
+
notes: '**The REST twin of the MCP action `robots.describe`**: one answer per robot — every datapoint, action, service, publisher and camera the ' +
|
|
2335
2360
|
'role grants, each with its `input_schema` where it takes parameters, plus the two capabilities that gate whole features, ' +
|
|
2336
2361
|
'`action_history` and `assets`. A robot with nothing published answers an empty `exposures` list, never a refusal. A robot the caller ' +
|
|
2337
2362
|
'does not reach — not attached to their app, or attached with a role that grants nothing on it — answers `404` exactly as one that ' +
|
|
@@ -2588,6 +2613,19 @@ export const ROUTES = [
|
|
|
2588
2613
|
'`JOB_HEARTBEAT_TIMEOUT_MS` is `504 bridge_timeout`; a cancel the bridge could not send at all is `502` carrying the bridge\'s own ' +
|
|
2589
2614
|
'code (`unknown_slug`, `action_server_lost`, `internal_error`).',
|
|
2590
2615
|
},
|
|
2616
|
+
{
|
|
2617
|
+
method: 'POST', path: '/api/robots/:id/jobs/:slug/recover', section: 'commands',
|
|
2618
|
+
summary: 'Releases one held job after an Owner verifies the robot is stopped.',
|
|
2619
|
+
audience: 'developer', auth: 'developer', rateLimited: false, ownerTier: true, status: 200,
|
|
2620
|
+
params: [
|
|
2621
|
+
{ name: 'id', description: 'The robot uuid in the authenticated Owner\'s organization.' },
|
|
2622
|
+
{ name: 'slug', description: 'The action slug holding the exact job named in the body.' },
|
|
2623
|
+
],
|
|
2624
|
+
query: null, request: recoverHeldJobRequest, response: recoverHeldJobResponse,
|
|
2625
|
+
errors: [...DEVELOPER_GUARD, 'tier_required', 'support_forbidden', 'invalid_uuid', 'not_found', 'validation_error', 'job_state_conflict', 'internal_error'],
|
|
2626
|
+
transport: 'http',
|
|
2627
|
+
notes: 'Use only after physically stopping or isolating the robot and checking that it cannot move. Read the held job id, then submit that exact id with a reason and `verified_stopped: true`. The assertion is a human safety check, not a sensor reading. The cloud records the Owner and reason in the audit trail and returns the job settled to `lost`. App users, server keys, other developers and support sessions cannot use this route. A connected bridge or a changed job returns `409 job_state_conflict`; a normal cancel is not recovery and never releases an uncertain job.',
|
|
2628
|
+
},
|
|
2591
2629
|
{
|
|
2592
2630
|
method: 'POST', path: '/api/robots/:id/publishers/:slug', section: 'commands',
|
|
2593
2631
|
summary: 'Publishes one message onto a configured publisher.',
|
package/dist/support.d.ts
CHANGED
|
@@ -78,6 +78,48 @@ export declare const supportTokenResponse: z.ZodObject<{
|
|
|
78
78
|
}, z.core.$strict>;
|
|
79
79
|
}, z.core.$strict>;
|
|
80
80
|
export type SupportTokenResponse = z.infer<typeof supportTokenResponse>;
|
|
81
|
+
/** Cloud verifies Console's original bearer and server-held PKCE proof; Console first verifies signed Operator failure evidence. */
|
|
82
|
+
export declare const supportRenewFailRequest: z.ZodObject<{
|
|
83
|
+
flow_id: z.ZodUUID;
|
|
84
|
+
code_verifier: z.ZodString;
|
|
85
|
+
reason: z.ZodLiteral<"authority_failed">;
|
|
86
|
+
}, z.core.$strict>;
|
|
87
|
+
export type SupportRenewFailRequest = z.infer<typeof supportRenewFailRequest>;
|
|
88
|
+
/** Body of every non-204 renewal-failure response. HTTP status follows `code`; all refusals are no-store. */
|
|
89
|
+
export declare const supportRenewFailRefusal: z.ZodUnion<readonly [z.ZodObject<{
|
|
90
|
+
code: z.ZodLiteral<"validation_error">;
|
|
91
|
+
message: z.ZodString;
|
|
92
|
+
details: z.ZodObject<{
|
|
93
|
+
rule: z.ZodLiteral<"invalid_flow">;
|
|
94
|
+
}, z.core.$strict>;
|
|
95
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
96
|
+
code: z.ZodLiteral<"unauthorized">;
|
|
97
|
+
message: z.ZodString;
|
|
98
|
+
details: z.ZodObject<{
|
|
99
|
+
rule: z.ZodLiteral<"invalid_authority">;
|
|
100
|
+
}, z.core.$strict>;
|
|
101
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
102
|
+
code: z.ZodLiteral<"not_found">;
|
|
103
|
+
message: z.ZodString;
|
|
104
|
+
details: z.ZodObject<{
|
|
105
|
+
rule: z.ZodEnum<{
|
|
106
|
+
invalid_flow: "invalid_flow";
|
|
107
|
+
identity_mismatch: "identity_mismatch";
|
|
108
|
+
}>;
|
|
109
|
+
}, z.core.$strict>;
|
|
110
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
111
|
+
code: z.ZodLiteral<"target_state_conflict">;
|
|
112
|
+
message: z.ZodString;
|
|
113
|
+
details: z.ZodObject<{
|
|
114
|
+
rule: z.ZodEnum<{
|
|
115
|
+
expired: "expired";
|
|
116
|
+
replayed: "replayed";
|
|
117
|
+
session_inactive: "session_inactive";
|
|
118
|
+
stale_generation: "stale_generation";
|
|
119
|
+
}>;
|
|
120
|
+
}, z.core.$strict>;
|
|
121
|
+
}, z.core.$strict>]>;
|
|
122
|
+
export type SupportRenewFailRefusal = z.infer<typeof supportRenewFailRefusal>;
|
|
81
123
|
/**
|
|
82
124
|
* What `GET /api/auth/me` answers **to a support token** — `authMeResponse`
|
|
83
125
|
* with one more, optional field. The public route entry keeps `authMeResponse`
|
package/dist/support.js
CHANGED
|
@@ -93,6 +93,21 @@ export const supportTokenResponse = z
|
|
|
93
93
|
}),
|
|
94
94
|
})
|
|
95
95
|
.strict();
|
|
96
|
+
/** Cloud verifies Console's original bearer and server-held PKCE proof; Console first verifies signed Operator failure evidence. */
|
|
97
|
+
export const supportRenewFailRequest = z.object({
|
|
98
|
+
flow_id: z.uuid().meta({ description: 'The pending Cloud renewal flow created with the original support bearer.' }),
|
|
99
|
+
code_verifier: z.string().regex(/^[A-Za-z0-9._~-]{43,128}$/).meta({
|
|
100
|
+
description: 'The server-held RFC 7636 verifier matching the flow\'s S256 challenge; never sent to the browser.',
|
|
101
|
+
}),
|
|
102
|
+
reason: z.literal('authority_failed').meta({ description: 'A fixed category; browser and IdP error text is not forwarded.' }),
|
|
103
|
+
}).strict();
|
|
104
|
+
/** Body of every non-204 renewal-failure response. HTTP status follows `code`; all refusals are no-store. */
|
|
105
|
+
export const supportRenewFailRefusal = z.union([
|
|
106
|
+
z.object({ code: z.literal('validation_error'), message: z.string().min(1), details: z.object({ rule: z.literal('invalid_flow') }).strict() }).strict(),
|
|
107
|
+
z.object({ code: z.literal('unauthorized'), message: z.string().min(1), details: z.object({ rule: z.literal('invalid_authority') }).strict() }).strict(),
|
|
108
|
+
z.object({ code: z.literal('not_found'), message: z.string().min(1), details: z.object({ rule: z.enum(['invalid_flow', 'identity_mismatch']) }).strict() }).strict(),
|
|
109
|
+
z.object({ code: z.literal('target_state_conflict'), message: z.string().min(1), details: z.object({ rule: z.enum(['expired', 'replayed', 'session_inactive', 'stale_generation']) }).strict() }).strict(),
|
|
110
|
+
]);
|
|
96
111
|
/**
|
|
97
112
|
* What `GET /api/auth/me` answers **to a support token** — `authMeResponse`
|
|
98
113
|
* with one more, optional field. The public route entry keeps `authMeResponse`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleetless/contracts",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.2.0-next.1",
|
|
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",
|