@openclaw/gateway-protocol 2026.8.1-beta.2 → 2026.8.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.
@@ -1,64 +0,0 @@
1
- //#region src/gateway-error-details.d.ts
2
- /** Gateway JSON-RPC style error codes shared by clients and server handlers. */
3
- declare const ErrorCodes: {
4
- /** @deprecated Retained for source compatibility; no current server emitter. */readonly NOT_LINKED: "NOT_LINKED"; /** Device exists but still needs an explicit pairing approval. */
5
- readonly NOT_PAIRED: "NOT_PAIRED"; /** @deprecated Retained for source compatibility; no current server emitter. */
6
- readonly AGENT_TIMEOUT: "AGENT_TIMEOUT"; /** Request payload failed protocol validation or method preconditions. */
7
- readonly INVALID_REQUEST: "INVALID_REQUEST"; /** Authenticated caller lacks permission for the requested operation. */
8
- readonly FORBIDDEN: "FORBIDDEN"; /** Approval resolution referenced a missing or expired approval request. */
9
- readonly APPROVAL_NOT_FOUND: "APPROVAL_NOT_FOUND"; /** Gateway service or required backend is temporarily unavailable. */
10
- readonly UNAVAILABLE: "UNAVAILABLE";
11
- };
12
- /** Closed set of canonical gateway error code strings. */
13
- type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];
14
- /** Stable discriminants for structured method-level failures. */
15
- declare const GatewayErrorDetailCodes: {
16
- readonly MISSING_SCOPE: "MISSING_SCOPE";
17
- readonly MCP_APP_VIEW_EXPIRED: "MCP_APP_VIEW_EXPIRED";
18
- readonly USER_PREFS_LIMIT_EXCEEDED: "USER_PREFS_LIMIT_EXCEEDED";
19
- readonly SESSION_COMPANION_BUSY: "SESSION_COMPANION_BUSY";
20
- readonly PROJECT_CLONE_FAILED: "PROJECT_CLONE_FAILED";
21
- readonly UNKNOWN_AGENT_ID: "UNKNOWN_AGENT_ID";
22
- readonly WIZARD_NOT_FOUND: "WIZARD_NOT_FOUND";
23
- };
24
- /** Missing operator-scope details shared by WebSocket and HTTP responses. */
25
- type MissingScopeErrorDetails = {
26
- code: typeof GatewayErrorDetailCodes.MISSING_SCOPE;
27
- missingScope: string;
28
- requiredScopes: string[];
29
- };
30
- type McpAppViewExpiredErrorDetails = {
31
- code: typeof GatewayErrorDetailCodes.MCP_APP_VIEW_EXPIRED;
32
- };
33
- /** Per-profile preference quota details returned by users.prefs.set. */
34
- type UserPrefsLimitExceededErrorDetails = {
35
- code: typeof GatewayErrorDetailCodes.USER_PREFS_LIMIT_EXCEEDED;
36
- limit: number;
37
- currentCount: number;
38
- };
39
- /** Unknown agent details carried by agent-scoped method validation failures. */
40
- type UnknownAgentIdErrorDetails = {
41
- code: typeof GatewayErrorDetailCodes.UNKNOWN_AGENT_ID;
42
- agentId: string;
43
- };
44
- /** Missing or expired process-local setup wizard session. */
45
- type WizardNotFoundErrorDetails = {
46
- code: typeof GatewayErrorDetailCodes.WIZARD_NOT_FOUND;
47
- };
48
- type ProjectCloneFailureCause = "invalid_url" | "auth_required" | "not_found" | "network" | "target_exists" | "clone_failed";
49
- type ProjectCloneErrorDetails = {
50
- code: typeof GatewayErrorDetailCodes.PROJECT_CLONE_FAILED;
51
- cause: ProjectCloneFailureCause;
52
- };
53
- /** Structured details emitted by method-level failures. */
54
- type GatewayErrorDetails = MissingScopeErrorDetails | McpAppViewExpiredErrorDetails | UserPrefsLimitExceededErrorDetails | ProjectCloneErrorDetails | UnknownAgentIdErrorDetails | WizardNotFoundErrorDetails;
55
- /** Reads validated missing-scope details from an untrusted protocol payload. */
56
- declare function readMissingScopeErrorDetails(details: unknown): MissingScopeErrorDetails | null;
57
- declare function isMcpAppViewExpiredError(error: unknown): boolean;
58
- /**
59
- * Reads a method-level missing-scope failure, preferring structured details.
60
- * The message fallback keeps clients compatible with gateways predating structured details.
61
- */
62
- declare function readMissingScopeError(error: unknown): MissingScopeErrorDetails | null;
63
- //#endregion
64
- export { McpAppViewExpiredErrorDetails as a, ProjectCloneFailureCause as c, WizardNotFoundErrorDetails as d, isMcpAppViewExpiredError as f, GatewayErrorDetails as i, UnknownAgentIdErrorDetails as l, readMissingScopeErrorDetails as m, ErrorCodes as n, MissingScopeErrorDetails as o, readMissingScopeError as p, GatewayErrorDetailCodes as r, ProjectCloneErrorDetails as s, ErrorCode as t, UserPrefsLimitExceededErrorDetails as u };
@@ -1,20 +0,0 @@
1
- //#region src/protocol-value-normalization.ts
2
- /** Narrows untrusted protocol values to non-array records. */
3
- function isProtocolRecord(value) {
4
- return Boolean(value) && typeof value === "object" && !Array.isArray(value);
5
- }
6
- /** Converts untrusted protocol values to records without accepting arrays. */
7
- function asProtocolRecord(value) {
8
- return isProtocolRecord(value) ? value : null;
9
- }
10
- /** Checks string presence without changing wire-significant whitespace. */
11
- function isNonEmptyProtocolString(value) {
12
- return typeof value === "string" && value.length > 0;
13
- }
14
- /** Trims an optional untrusted string and rejects empty results. */
15
- function normalizeOptionalProtocolString(value) {
16
- if (typeof value !== "string") return;
17
- return value.trim() || void 0;
18
- }
19
- //#endregion
20
- export { normalizeOptionalProtocolString as i, isNonEmptyProtocolString as n, isProtocolRecord as r, asProtocolRecord as t };