@openclaw/gateway-protocol 2026.9.1 → 2026.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client-info.mjs +3 -6
- package/dist/connect-error-details.d.mts +1 -11
- package/dist/connect-error-details.mjs +44 -39
- package/dist/frame-guards.d.mts +1 -1
- package/dist/frame-guards.mjs +1 -1
- package/dist/{frames-DNdJEs4Y.d.mts → frames-8A7sw44F.d.mts} +2 -0
- package/dist/{gateway-error-details-GvUeus2z.d.mts → gateway-error-details-DVeCF9AS.d.mts} +11 -2
- package/dist/gateway-error-details.d.mts +2 -2
- package/dist/gateway-error-details.mjs +13 -2
- package/dist/index.d.mts +788 -52
- package/dist/index.mjs +54 -18
- package/dist/protocol-value-normalization-DfM01tqg.mjs +7 -0
- package/dist/restart-unavailable.d.mts +2 -0
- package/dist/restart-unavailable.mjs +10 -3
- package/dist/{schema-modules-Id_e1MtF.d.mts → schema-modules-BWvk5LhI.d.mts} +4121 -2675
- package/dist/schema.d.mts +3226 -1909
- package/dist/schema.mjs +102 -49
- package/dist/string-coerce-BJ6bjzdv.mjs +21 -0
- package/dist/{worktrees-brAvxYC8.mjs → worktrees-CO9Ru3Wl.mjs} +3085 -2107
- package/package.json +2 -2
- package/protocol.schema.json +24578 -17039
- package/dist/protocol-value-normalization-DcAoxLUs.mjs +0 -12
package/dist/client-info.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as normalizeOptionalLowercaseString } from "./string-coerce-BJ6bjzdv.mjs";
|
|
2
2
|
//#region src/client-info.ts
|
|
3
3
|
/**
|
|
4
4
|
* Shared gateway client identity contract.
|
|
@@ -6,9 +6,6 @@ import { n as normalizeOptionalProtocolString } from "./protocol-value-normaliza
|
|
|
6
6
|
* These values cross the WebSocket handshake boundary, so additions must stay
|
|
7
7
|
* aligned with protocol schemas and server policy checks.
|
|
8
8
|
*/
|
|
9
|
-
function normalizeOptionalProtocolLowercaseString(raw) {
|
|
10
|
-
return normalizeOptionalProtocolString(raw)?.toLowerCase();
|
|
11
|
-
}
|
|
12
9
|
/** Canonical client ids accepted in gateway hello/connect payloads. */
|
|
13
10
|
const GATEWAY_CLIENT_IDS = {
|
|
14
11
|
WEBCHAT_UI: "webchat-ui",
|
|
@@ -61,7 +58,7 @@ const GATEWAY_CLIENT_ID_SET = new Set(Object.values(GATEWAY_CLIENT_IDS));
|
|
|
61
58
|
const GATEWAY_CLIENT_MODE_SET = new Set(Object.values(GATEWAY_CLIENT_MODES));
|
|
62
59
|
/** Normalizes untrusted client ids and rejects unknown values. */
|
|
63
60
|
function normalizeGatewayClientId(raw) {
|
|
64
|
-
const normalized =
|
|
61
|
+
const normalized = normalizeOptionalLowercaseString(raw);
|
|
65
62
|
if (!normalized) return;
|
|
66
63
|
return GATEWAY_CLIENT_ID_SET.has(normalized) ? normalized : void 0;
|
|
67
64
|
}
|
|
@@ -71,7 +68,7 @@ function normalizeGatewayClientName(raw) {
|
|
|
71
68
|
}
|
|
72
69
|
/** Normalizes untrusted client modes and rejects unknown values. */
|
|
73
70
|
function normalizeGatewayClientMode(raw) {
|
|
74
|
-
const normalized =
|
|
71
|
+
const normalized = normalizeOptionalLowercaseString(raw);
|
|
75
72
|
if (!normalized) return;
|
|
76
73
|
return GATEWAY_CLIENT_MODE_SET.has(normalized) ? normalized : void 0;
|
|
77
74
|
}
|
|
@@ -87,18 +87,8 @@ export declare function buildPairingConnectErrorMessage(reason: ConnectPairingRe
|
|
|
87
87
|
/** Short user-facing recovery title for pairing-required connect failures. */
|
|
88
88
|
export declare function buildPairingConnectRecoveryTitle(reason: ConnectPairingRequiredReason | undefined): string;
|
|
89
89
|
/** Builds sanitized structured details for a pairing-required connect failure. */
|
|
90
|
-
export declare function buildPairingConnectErrorDetails(params: {
|
|
90
|
+
export declare function buildPairingConnectErrorDetails(params: Omit<PairingConnectErrorDetails, "code" | "reason"> & {
|
|
91
91
|
reason: ConnectPairingRequiredReason | undefined;
|
|
92
|
-
requestId?: string;
|
|
93
|
-
remediationHint?: string;
|
|
94
|
-
recommendedNextStep?: ConnectRecoveryNextStep;
|
|
95
|
-
retryable?: boolean;
|
|
96
|
-
pauseReconnect?: boolean;
|
|
97
|
-
deviceId?: string;
|
|
98
|
-
requestedRole?: string;
|
|
99
|
-
requestedScopes?: string[];
|
|
100
|
-
approvedRoles?: string[];
|
|
101
|
-
approvedScopes?: string[];
|
|
102
92
|
}): PairingConnectErrorDetails;
|
|
103
93
|
/** Builds a sanitized close reason string for WebSocket pairing rejections. */
|
|
104
94
|
export declare function buildPairingConnectCloseReason(params: {
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { r as isRecord } from "./record-coerce-BVp8Dr-B.mjs";
|
|
2
|
-
import { n as
|
|
2
|
+
import { n as normalizeOptionalString } from "./string-coerce-BJ6bjzdv.mjs";
|
|
3
|
+
//#region ../normalization-core/src/string-normalization.ts
|
|
4
|
+
/** Normalizes array-backed string lists and rejects non-array input as empty. */
|
|
5
|
+
function normalizeTrimmedStringList(value) {
|
|
6
|
+
if (!Array.isArray(value)) return [];
|
|
7
|
+
return value.flatMap((entry) => {
|
|
8
|
+
const normalized = normalizeOptionalString(entry);
|
|
9
|
+
return normalized ? [normalized] : [];
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
/** Returns undefined instead of an empty normalized array-backed string list. */
|
|
13
|
+
function normalizeOptionalTrimmedStringList(value) {
|
|
14
|
+
const normalized = normalizeTrimmedStringList(value);
|
|
15
|
+
return normalized.length > 0 ? normalized : void 0;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
3
18
|
//#region src/connect-error-details.ts
|
|
4
19
|
/**
|
|
5
20
|
* Shared gateway connect-error detail helpers.
|
|
@@ -7,11 +22,6 @@ import { n as normalizeOptionalProtocolString } from "./protocol-value-normaliza
|
|
|
7
22
|
* These details cross client/server boundaries, so readers normalize untrusted
|
|
8
23
|
* payloads before using them in reconnect decisions or user-facing messages.
|
|
9
24
|
*/
|
|
10
|
-
function normalizeOptionalConnectDetailStringList(value) {
|
|
11
|
-
if (!Array.isArray(value)) return;
|
|
12
|
-
const values = value.map((entry) => normalizeOptionalProtocolString(entry)).filter((entry) => Boolean(entry));
|
|
13
|
-
return values.length > 0 ? values : void 0;
|
|
14
|
-
}
|
|
15
25
|
/** Structured connect-error codes carried in gateway error `details.code`. */
|
|
16
26
|
const ConnectErrorDetailCodes = {
|
|
17
27
|
AUTH_REQUIRED: "AUTH_REQUIRED",
|
|
@@ -142,33 +152,29 @@ function readControlUiBuildMismatchId(details) {
|
|
|
142
152
|
const code = readConnectErrorDetailCode(details);
|
|
143
153
|
if (code !== ConnectErrorDetailCodes.PROTOCOL_MISMATCH && code !== ConnectErrorDetailCodes.CONTROL_UI_BUILD_MISMATCH) return null;
|
|
144
154
|
const raw = details;
|
|
145
|
-
const gatewayBuildId =
|
|
155
|
+
const gatewayBuildId = normalizeOptionalString(raw.gatewayBuildId);
|
|
146
156
|
if (!gatewayBuildId || gatewayBuildId.length > 96 || raw.reloadRequired !== true) return null;
|
|
147
157
|
return gatewayBuildId;
|
|
148
158
|
}
|
|
149
159
|
/** Extracts normalized retry advice from untrusted connect-error details. */
|
|
150
160
|
function readConnectErrorRecoveryAdvice(details) {
|
|
151
161
|
if (!isRecord(details)) return {};
|
|
152
|
-
const
|
|
153
|
-
const
|
|
154
|
-
const normalizedNextStep = normalizeOptionalProtocolString(raw.recommendedNextStep) ?? "";
|
|
162
|
+
const canRetryWithDeviceToken = typeof details.canRetryWithDeviceToken === "boolean" ? details.canRetryWithDeviceToken : void 0;
|
|
163
|
+
const normalizedNextStep = normalizeOptionalString(details.recommendedNextStep) ?? "";
|
|
155
164
|
return {
|
|
156
165
|
canRetryWithDeviceToken,
|
|
157
166
|
recommendedNextStep: CONNECT_RECOVERY_NEXT_STEP_VALUES.has(normalizedNextStep) ? normalizedNextStep : void 0
|
|
158
167
|
};
|
|
159
168
|
}
|
|
160
169
|
function normalizePairingConnectReason(value) {
|
|
161
|
-
const normalized =
|
|
170
|
+
const normalized = normalizeOptionalString(value) ?? "";
|
|
162
171
|
return CONNECT_PAIRING_REQUIRED_REASON_VALUES.has(normalized) ? normalized : void 0;
|
|
163
172
|
}
|
|
164
173
|
/** Normalizes pairing request ids before echoing them in close reasons or UI text. */
|
|
165
174
|
function normalizePairingConnectRequestId(value) {
|
|
166
|
-
const normalized =
|
|
175
|
+
const normalized = normalizeOptionalString(value);
|
|
167
176
|
return normalized && PAIRING_CONNECT_REQUEST_ID_PATTERN.test(normalized) ? normalized : void 0;
|
|
168
177
|
}
|
|
169
|
-
function normalizeStringArray(value) {
|
|
170
|
-
return normalizeOptionalConnectDetailStringList(value);
|
|
171
|
-
}
|
|
172
178
|
function createPairingConnectErrorDetails(params) {
|
|
173
179
|
return {
|
|
174
180
|
code: ConnectErrorDetailCodes.PAIRING_REQUIRED,
|
|
@@ -203,12 +209,12 @@ function buildPairingConnectRecoveryTitle(reason) {
|
|
|
203
209
|
/** Builds sanitized structured details for a pairing-required connect failure. */
|
|
204
210
|
function buildPairingConnectErrorDetails(params) {
|
|
205
211
|
const requestId = normalizePairingConnectRequestId(params.requestId);
|
|
206
|
-
const remediationHint =
|
|
207
|
-
const deviceId =
|
|
208
|
-
const requestedRole =
|
|
209
|
-
const requestedScopes =
|
|
210
|
-
const approvedRoles =
|
|
211
|
-
const approvedScopes =
|
|
212
|
+
const remediationHint = normalizeOptionalString(params.remediationHint) ?? buildPairingConnectRemediationHint(params.reason);
|
|
213
|
+
const deviceId = normalizeOptionalString(params.deviceId);
|
|
214
|
+
const requestedRole = normalizeOptionalString(params.requestedRole);
|
|
215
|
+
const requestedScopes = normalizeOptionalTrimmedStringList(params.requestedScopes);
|
|
216
|
+
const approvedRoles = normalizeOptionalTrimmedStringList(params.approvedRoles);
|
|
217
|
+
const approvedScopes = normalizeOptionalTrimmedStringList(params.approvedScopes);
|
|
212
218
|
return createPairingConnectErrorDetails({
|
|
213
219
|
reason: params.reason,
|
|
214
220
|
requestId,
|
|
@@ -233,24 +239,23 @@ function buildPairingConnectCloseReason(params) {
|
|
|
233
239
|
function readPairingConnectErrorDetails(details) {
|
|
234
240
|
if (readConnectErrorDetailCode(details) !== ConnectErrorDetailCodes.PAIRING_REQUIRED) return null;
|
|
235
241
|
if (!isRecord(details)) return null;
|
|
236
|
-
const
|
|
237
|
-
const
|
|
238
|
-
const
|
|
239
|
-
const
|
|
240
|
-
const normalizedNextStep = normalizeOptionalProtocolString(raw.recommendedNextStep) ?? "";
|
|
242
|
+
const reason = normalizePairingConnectReason(details.reason);
|
|
243
|
+
const requestId = normalizePairingConnectRequestId(details.requestId);
|
|
244
|
+
const remediationHint = normalizeOptionalString(details.remediationHint) ?? buildPairingConnectRemediationHint(reason);
|
|
245
|
+
const normalizedNextStep = normalizeOptionalString(details.recommendedNextStep) ?? "";
|
|
241
246
|
const recommendedNextStep = CONNECT_RECOVERY_NEXT_STEP_VALUES.has(normalizedNextStep) ? normalizedNextStep : void 0;
|
|
242
|
-
const deviceId =
|
|
243
|
-
const requestedRole =
|
|
244
|
-
const requestedScopes =
|
|
245
|
-
const approvedRoles =
|
|
246
|
-
const approvedScopes =
|
|
247
|
+
const deviceId = normalizeOptionalString(details.deviceId);
|
|
248
|
+
const requestedRole = normalizeOptionalString(details.requestedRole);
|
|
249
|
+
const requestedScopes = normalizeOptionalTrimmedStringList(details.requestedScopes);
|
|
250
|
+
const approvedRoles = normalizeOptionalTrimmedStringList(details.approvedRoles);
|
|
251
|
+
const approvedScopes = normalizeOptionalTrimmedStringList(details.approvedScopes);
|
|
247
252
|
return createPairingConnectErrorDetails({
|
|
248
253
|
reason,
|
|
249
254
|
requestId,
|
|
250
255
|
remediationHint,
|
|
251
256
|
recommendedNextStep,
|
|
252
|
-
retryable: typeof
|
|
253
|
-
pauseReconnect: typeof
|
|
257
|
+
retryable: typeof details.retryable === "boolean" ? details.retryable : void 0,
|
|
258
|
+
pauseReconnect: typeof details.pauseReconnect === "boolean" ? details.pauseReconnect : void 0,
|
|
254
259
|
deviceId,
|
|
255
260
|
requestedRole,
|
|
256
261
|
requestedScopes,
|
|
@@ -260,7 +265,7 @@ function readPairingConnectErrorDetails(details) {
|
|
|
260
265
|
}
|
|
261
266
|
/** Parses legacy/string-only pairing-required messages into structured details. */
|
|
262
267
|
function readConnectPairingRequiredMessage(message) {
|
|
263
|
-
const normalizedMessage =
|
|
268
|
+
const normalizedMessage = normalizeOptionalString(message);
|
|
264
269
|
if (!normalizedMessage) return null;
|
|
265
270
|
const normalized = normalizedMessage.trim().toLowerCase();
|
|
266
271
|
let reason;
|
|
@@ -296,7 +301,7 @@ const GATEWAY_CLOSED_MESSAGE_PATTERN = /\bgateway closed \(\d+\):/i;
|
|
|
296
301
|
function readIdentityProxyRejection(details) {
|
|
297
302
|
if (!isRecord(details)) return null;
|
|
298
303
|
if (details.reason !== "websocket-upgrade-rejected" || typeof details.httpStatus !== "number" || !IDENTITY_PROXY_HTTP_STATUSES.has(details.httpStatus)) return null;
|
|
299
|
-
const location =
|
|
304
|
+
const location = normalizeOptionalString(details.location);
|
|
300
305
|
if (!location) return { cloudflareAccess: false };
|
|
301
306
|
try {
|
|
302
307
|
return { cloudflareAccess: new URL(location).hostname.toLowerCase().replace(/\.+$/u, "").endsWith(".cloudflareaccess.com") };
|
|
@@ -307,8 +312,8 @@ function readIdentityProxyRejection(details) {
|
|
|
307
312
|
/** Classifies Gateway connect failures from structured details, with one legacy text fallback. */
|
|
308
313
|
function classifyGatewayConnectFailure(input) {
|
|
309
314
|
const code = readConnectErrorDetailCode(input.details);
|
|
310
|
-
const message =
|
|
311
|
-
const reason =
|
|
315
|
+
const message = normalizeOptionalString(input.message);
|
|
316
|
+
const reason = normalizeOptionalString(input.reason);
|
|
312
317
|
const userMessage = message ?? reason;
|
|
313
318
|
const classificationText = [message, reason].filter((value) => Boolean(value)).join("\n");
|
|
314
319
|
const normalized = classificationText.toLowerCase();
|
|
@@ -348,7 +353,7 @@ function formatConnectPairingRequiredMessage(details) {
|
|
|
348
353
|
function formatConnectErrorMessage(params) {
|
|
349
354
|
if (readConnectErrorDetailCode(params.details) === ConnectErrorDetailCodes.PAIRING_REQUIRED) return formatConnectPairingRequiredMessage(params.details);
|
|
350
355
|
if (readConnectErrorDetailCode(params.details) === ConnectErrorDetailCodes.PROTOCOL_MISMATCH) return formatProtocolMismatchMessage(params.message, params.details);
|
|
351
|
-
return
|
|
356
|
+
return normalizeOptionalString(params.message) ?? "gateway request failed";
|
|
352
357
|
}
|
|
353
358
|
function formatProtocolMismatchMessage(message, details) {
|
|
354
359
|
const raw = details;
|
|
@@ -360,7 +365,7 @@ function formatProtocolMismatchMessage(message, details) {
|
|
|
360
365
|
if (clientMin !== void 0 && clientMax !== void 0) parts.push(clientMin === clientMax ? `Control UI v${clientMin}` : `Control UI v${clientMin}-v${clientMax}`);
|
|
361
366
|
if (expected !== void 0) parts.push(`Gateway v${expected}`);
|
|
362
367
|
if (probeMin !== void 0) parts.push(`probe min v${probeMin}`);
|
|
363
|
-
const normalized =
|
|
368
|
+
const normalized = normalizeOptionalString(message) ?? "protocol mismatch";
|
|
364
369
|
return parts.length > 0 ? `${normalized}: ${parts.join(", ")}` : normalized;
|
|
365
370
|
}
|
|
366
371
|
function normalizeProtocolNumber(value) {
|
package/dist/frame-guards.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as EventFrame, d as RequestFrame, l as HelloOk, p as ResponseFrame, r as ErrorShape, s as GatewayFrame, t as ConnectParams } from "./frames-
|
|
1
|
+
import { a as EventFrame, d as RequestFrame, l as HelloOk, p as ResponseFrame, r as ErrorShape, s as GatewayFrame, t as ConnectParams } from "./frames-8A7sw44F.mjs";
|
|
2
2
|
//#region src/frame-guards.d.ts
|
|
3
3
|
export declare function isGatewayEventFrame(value: unknown): value is EventFrame;
|
|
4
4
|
export declare function isGatewayResponseFrame(value: unknown): value is ResponseFrame;
|
package/dist/frame-guards.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as isRecord } from "./record-coerce-BVp8Dr-B.mjs";
|
|
2
|
-
import { t as isNonEmptyProtocolString } from "./protocol-value-normalization-
|
|
2
|
+
import { t as isNonEmptyProtocolString } from "./protocol-value-normalization-DfM01tqg.mjs";
|
|
3
3
|
//#region src/frame-guards.ts
|
|
4
4
|
function isNonNegativeInteger(value) {
|
|
5
5
|
return typeof value === "number" && Number.isInteger(value) && value >= 0;
|
|
@@ -253,6 +253,7 @@ declare const HelloOkSchema: Type.TObject<{
|
|
|
253
253
|
mainSessionKey: Type.TString;
|
|
254
254
|
scope: Type.TOptional<Type.TString>;
|
|
255
255
|
}>>;
|
|
256
|
+
controlUiIdentityUrl: Type.TOptional<Type.TString>;
|
|
256
257
|
authMode: Type.TOptional<Type.TUnion<[Type.TLiteral<"none">, Type.TLiteral<"token">, Type.TLiteral<"password">, Type.TLiteral<"trusted-proxy">]>>;
|
|
257
258
|
updateAvailable: Type.TOptional<Type.TObject<{
|
|
258
259
|
currentVersion: Type.TString;
|
|
@@ -324,6 +325,7 @@ declare const HelloOkSchema: Type.TObject<{
|
|
|
324
325
|
}>>;
|
|
325
326
|
}>>;
|
|
326
327
|
}>;
|
|
328
|
+
controlUiUrl: Type.TOptional<Type.TString>;
|
|
327
329
|
controlUiTabs: Type.TOptional<Type.TArray<Type.TObject<{
|
|
328
330
|
pluginId: Type.TString;
|
|
329
331
|
id: Type.TString;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
//#region src/gateway-error-details.d.ts
|
|
2
|
+
/** Display projection for an assistant failure without visible reply content. */
|
|
3
|
+
declare const GATEWAY_ASSISTANT_ERROR_FALLBACK_TEXT = "The agent run failed before producing a reply.";
|
|
2
4
|
/** Gateway JSON-RPC style error codes shared by clients and server handlers. */
|
|
3
5
|
declare const ErrorCodes: {
|
|
4
6
|
/** @deprecated Retained for source compatibility; no current server emitter. */
|
|
@@ -31,6 +33,7 @@ declare const GatewayErrorDetailCodes: {
|
|
|
31
33
|
readonly UNKNOWN_AGENT_ID: "UNKNOWN_AGENT_ID";
|
|
32
34
|
readonly WIZARD_NOT_FOUND: "WIZARD_NOT_FOUND";
|
|
33
35
|
readonly SETUP_ADMISSION_BUSY: "SETUP_ADMISSION_BUSY";
|
|
36
|
+
readonly GITHUB_PUBLICATION_SELECTION_REJECTED: "GITHUB_PUBLICATION_SELECTION_REJECTED";
|
|
34
37
|
};
|
|
35
38
|
/** Missing cron automation identified by its exact store key. */
|
|
36
39
|
type CronJobNotFoundErrorDetails = {
|
|
@@ -64,6 +67,11 @@ type UnknownAgentIdErrorDetails = {
|
|
|
64
67
|
type SetupAdmissionBusyErrorDetails = {
|
|
65
68
|
code: typeof GatewayErrorDetailCodes.SETUP_ADMISSION_BUSY;
|
|
66
69
|
};
|
|
70
|
+
/** This invocation rejected its selection before admission; earlier calls may still be pending. */
|
|
71
|
+
type GitHubPublicationSelectionRejectedErrorDetails = {
|
|
72
|
+
code: typeof GatewayErrorDetailCodes.GITHUB_PUBLICATION_SELECTION_REJECTED;
|
|
73
|
+
idempotencyKey: string;
|
|
74
|
+
};
|
|
67
75
|
/** Missing or expired process-local setup wizard session. */
|
|
68
76
|
type WizardNotFoundErrorDetails = {
|
|
69
77
|
code: typeof GatewayErrorDetailCodes.WIZARD_NOT_FOUND;
|
|
@@ -80,7 +88,8 @@ type SkillProposalRevisionChangedErrorDetails = {
|
|
|
80
88
|
currentRevisionHash: string;
|
|
81
89
|
};
|
|
82
90
|
/** Structured details emitted by method-level failures. */
|
|
83
|
-
type GatewayErrorDetails = CronJobNotFoundErrorDetails | MissingScopeErrorDetails | McpAppViewExpiredErrorDetails | OutboundDeliveryQueuedErrorDetails | UserPrefsLimitExceededErrorDetails | SkillProposalRevisionChangedErrorDetails | ProjectCloneErrorDetails | UnknownAgentIdErrorDetails | WizardNotFoundErrorDetails | SetupAdmissionBusyErrorDetails;
|
|
91
|
+
type GatewayErrorDetails = CronJobNotFoundErrorDetails | MissingScopeErrorDetails | McpAppViewExpiredErrorDetails | OutboundDeliveryQueuedErrorDetails | UserPrefsLimitExceededErrorDetails | SkillProposalRevisionChangedErrorDetails | ProjectCloneErrorDetails | UnknownAgentIdErrorDetails | WizardNotFoundErrorDetails | SetupAdmissionBusyErrorDetails | GitHubPublicationSelectionRejectedErrorDetails;
|
|
92
|
+
declare function readGitHubPublicationSelectionRejectedError(error: unknown): GitHubPublicationSelectionRejectedErrorDetails | null;
|
|
84
93
|
/** Reads a typed cron lookup miss without parsing operator-facing prose. */
|
|
85
94
|
declare function readCronJobNotFoundError(error: unknown): CronJobNotFoundErrorDetails | null;
|
|
86
95
|
/** Builds the canonical stale-draft details shared by Skill Workshop RPCs. */
|
|
@@ -99,4 +108,4 @@ declare function isMcpAppViewExpiredError(error: unknown): boolean;
|
|
|
99
108
|
*/
|
|
100
109
|
declare function readMissingScopeError(error: unknown): MissingScopeErrorDetails | null;
|
|
101
110
|
//#endregion
|
|
102
|
-
export {
|
|
111
|
+
export { readMissingScopeErrorDetails as C, readMissingScopeError as S, WizardNotFoundErrorDetails as _, GatewayErrorDetailCodes as a, readCronJobNotFoundError as b, McpAppViewExpiredErrorDetails as c, ProjectCloneErrorDetails as d, ProjectCloneFailureCause as f, UserPrefsLimitExceededErrorDetails as g, UnknownAgentIdErrorDetails as h, GATEWAY_ASSISTANT_ERROR_FALLBACK_TEXT as i, MissingScopeErrorDetails as l, SkillProposalRevisionChangedErrorDetails as m, ErrorCode as n, GatewayErrorDetails as o, SetupAdmissionBusyErrorDetails as p, ErrorCodes as r, GitHubPublicationSelectionRejectedErrorDetails as s, CronJobNotFoundErrorDetails as t, OutboundDeliveryQueuedErrorDetails as u, buildSkillProposalRevisionChangedErrorDetails as v, readSkillProposalRevisionChangedError as w, readGitHubPublicationSelectionRejectedError as x, isMcpAppViewExpiredError as y };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
export { CronJobNotFoundErrorDetails, ErrorCode, ErrorCodes, GatewayErrorDetailCodes, GatewayErrorDetails, McpAppViewExpiredErrorDetails, MissingScopeErrorDetails, OutboundDeliveryQueuedErrorDetails, ProjectCloneErrorDetails, ProjectCloneFailureCause, SetupAdmissionBusyErrorDetails, SkillProposalRevisionChangedErrorDetails, UnknownAgentIdErrorDetails, UserPrefsLimitExceededErrorDetails, WizardNotFoundErrorDetails, buildSkillProposalRevisionChangedErrorDetails, isMcpAppViewExpiredError, readCronJobNotFoundError, readMissingScopeError, readMissingScopeErrorDetails, readSkillProposalRevisionChangedError };
|
|
1
|
+
import { C as readMissingScopeErrorDetails, S as readMissingScopeError, _ as WizardNotFoundErrorDetails, a as GatewayErrorDetailCodes, b as readCronJobNotFoundError, c as McpAppViewExpiredErrorDetails, d as ProjectCloneErrorDetails, f as ProjectCloneFailureCause, g as UserPrefsLimitExceededErrorDetails, h as UnknownAgentIdErrorDetails, i as GATEWAY_ASSISTANT_ERROR_FALLBACK_TEXT, l as MissingScopeErrorDetails, m as SkillProposalRevisionChangedErrorDetails, n as ErrorCode, o as GatewayErrorDetails, p as SetupAdmissionBusyErrorDetails, r as ErrorCodes, s as GitHubPublicationSelectionRejectedErrorDetails, t as CronJobNotFoundErrorDetails, u as OutboundDeliveryQueuedErrorDetails, v as buildSkillProposalRevisionChangedErrorDetails, w as readSkillProposalRevisionChangedError, x as readGitHubPublicationSelectionRejectedError, y as isMcpAppViewExpiredError } from "./gateway-error-details-DVeCF9AS.mjs";
|
|
2
|
+
export { CronJobNotFoundErrorDetails, ErrorCode, ErrorCodes, GATEWAY_ASSISTANT_ERROR_FALLBACK_TEXT, GatewayErrorDetailCodes, GatewayErrorDetails, GitHubPublicationSelectionRejectedErrorDetails, McpAppViewExpiredErrorDetails, MissingScopeErrorDetails, OutboundDeliveryQueuedErrorDetails, ProjectCloneErrorDetails, ProjectCloneFailureCause, SetupAdmissionBusyErrorDetails, SkillProposalRevisionChangedErrorDetails, UnknownAgentIdErrorDetails, UserPrefsLimitExceededErrorDetails, WizardNotFoundErrorDetails, buildSkillProposalRevisionChangedErrorDetails, isMcpAppViewExpiredError, readCronJobNotFoundError, readGitHubPublicationSelectionRejectedError, readMissingScopeError, readMissingScopeErrorDetails, readSkillProposalRevisionChangedError };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { t as asNullableRecord } from "./record-coerce-BVp8Dr-B.mjs";
|
|
2
2
|
//#region src/gateway-error-details.ts
|
|
3
|
+
/** Display projection for an assistant failure without visible reply content. */
|
|
4
|
+
const GATEWAY_ASSISTANT_ERROR_FALLBACK_TEXT = "The agent run failed before producing a reply.";
|
|
3
5
|
/** Gateway JSON-RPC style error codes shared by clients and server handlers. */
|
|
4
6
|
const ErrorCodes = {
|
|
5
7
|
/** @deprecated Retained for source compatibility; no current server emitter. */
|
|
@@ -29,10 +31,19 @@ const GatewayErrorDetailCodes = {
|
|
|
29
31
|
PROJECT_CLONE_FAILED: "PROJECT_CLONE_FAILED",
|
|
30
32
|
UNKNOWN_AGENT_ID: "UNKNOWN_AGENT_ID",
|
|
31
33
|
WIZARD_NOT_FOUND: "WIZARD_NOT_FOUND",
|
|
32
|
-
SETUP_ADMISSION_BUSY: "SETUP_ADMISSION_BUSY"
|
|
34
|
+
SETUP_ADMISSION_BUSY: "SETUP_ADMISSION_BUSY",
|
|
35
|
+
GITHUB_PUBLICATION_SELECTION_REJECTED: "GITHUB_PUBLICATION_SELECTION_REJECTED"
|
|
33
36
|
};
|
|
34
37
|
const LEGACY_MISSING_SCOPE_PATTERN = /\bmissing scope:\s*([a-z0-9._-]+)/i;
|
|
35
38
|
const SHA256_PATTERN = /^[a-fA-F0-9]{64}$/;
|
|
39
|
+
function readGitHubPublicationSelectionRejectedError(error) {
|
|
40
|
+
const record = asNullableRecord(error);
|
|
41
|
+
const details = asNullableRecord(record?.details);
|
|
42
|
+
return record?.code === ErrorCodes.UNAVAILABLE && details?.code === GatewayErrorDetailCodes.GITHUB_PUBLICATION_SELECTION_REJECTED && Object.keys(details).length === 2 && typeof details.idempotencyKey === "string" && details.idempotencyKey.length > 0 ? {
|
|
43
|
+
code: details.code,
|
|
44
|
+
idempotencyKey: details.idempotencyKey
|
|
45
|
+
} : null;
|
|
46
|
+
}
|
|
36
47
|
/** Reads a typed cron lookup miss without parsing operator-facing prose. */
|
|
37
48
|
function readCronJobNotFoundError(error) {
|
|
38
49
|
const record = asNullableRecord(error);
|
|
@@ -102,4 +113,4 @@ function readMissingScopeError(error) {
|
|
|
102
113
|
} : null;
|
|
103
114
|
}
|
|
104
115
|
//#endregion
|
|
105
|
-
export { ErrorCodes, GatewayErrorDetailCodes, buildSkillProposalRevisionChangedErrorDetails, isMcpAppViewExpiredError, readCronJobNotFoundError, readMissingScopeError, readMissingScopeErrorDetails, readSkillProposalRevisionChangedError };
|
|
116
|
+
export { ErrorCodes, GATEWAY_ASSISTANT_ERROR_FALLBACK_TEXT, GatewayErrorDetailCodes, buildSkillProposalRevisionChangedErrorDetails, isMcpAppViewExpiredError, readCronJobNotFoundError, readGitHubPublicationSelectionRejectedError, readMissingScopeError, readMissingScopeErrorDetails, readSkillProposalRevisionChangedError };
|