@openclaw/gateway-protocol 2026.9.4 → 2026.9.5

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,111 +0,0 @@
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.";
4
- /** Gateway JSON-RPC style error codes shared by clients and server handlers. */
5
- declare const ErrorCodes: {
6
- /** @deprecated Retained for source compatibility; no current server emitter. */
7
- readonly NOT_LINKED: "NOT_LINKED";
8
- /** Device exists but still needs an explicit pairing approval. */
9
- readonly NOT_PAIRED: "NOT_PAIRED";
10
- /** @deprecated Retained for source compatibility; no current server emitter. */
11
- readonly AGENT_TIMEOUT: "AGENT_TIMEOUT";
12
- /** Request payload failed protocol validation or method preconditions. */
13
- readonly INVALID_REQUEST: "INVALID_REQUEST";
14
- /** Authenticated caller lacks permission for the requested operation. */
15
- readonly FORBIDDEN: "FORBIDDEN";
16
- /** Approval resolution referenced a missing or expired approval request. */
17
- readonly APPROVAL_NOT_FOUND: "APPROVAL_NOT_FOUND";
18
- /** Gateway service or required backend is temporarily unavailable. */
19
- readonly UNAVAILABLE: "UNAVAILABLE";
20
- };
21
- /** Closed set of canonical gateway error code strings. */
22
- type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];
23
- /** Stable discriminants for structured method-level failures. */
24
- declare const GatewayErrorDetailCodes: {
25
- readonly CRON_JOB_NOT_FOUND: "CRON_JOB_NOT_FOUND";
26
- readonly MISSING_SCOPE: "MISSING_SCOPE";
27
- readonly MCP_APP_VIEW_EXPIRED: "MCP_APP_VIEW_EXPIRED";
28
- readonly OUTBOUND_DELIVERY_QUEUED: "OUTBOUND_DELIVERY_QUEUED";
29
- readonly USER_PREFS_LIMIT_EXCEEDED: "USER_PREFS_LIMIT_EXCEEDED";
30
- readonly SESSION_COMPANION_BUSY: "SESSION_COMPANION_BUSY";
31
- readonly SKILL_PROPOSAL_REVISION_CHANGED: "SKILL_PROPOSAL_REVISION_CHANGED";
32
- readonly PROJECT_CLONE_FAILED: "PROJECT_CLONE_FAILED";
33
- readonly UNKNOWN_AGENT_ID: "UNKNOWN_AGENT_ID";
34
- readonly WIZARD_NOT_FOUND: "WIZARD_NOT_FOUND";
35
- readonly SETUP_ADMISSION_BUSY: "SETUP_ADMISSION_BUSY";
36
- readonly GITHUB_PUBLICATION_SELECTION_REJECTED: "GITHUB_PUBLICATION_SELECTION_REJECTED";
37
- };
38
- /** Missing cron automation identified by its exact store key. */
39
- type CronJobNotFoundErrorDetails = {
40
- code: typeof GatewayErrorDetailCodes.CRON_JOB_NOT_FOUND;
41
- jobId: string;
42
- };
43
- /** Missing operator-scope details shared by WebSocket and HTTP responses. */
44
- type MissingScopeErrorDetails = {
45
- code: typeof GatewayErrorDetailCodes.MISSING_SCOPE;
46
- missingScope: string;
47
- requiredScopes: string[];
48
- };
49
- type McpAppViewExpiredErrorDetails = {
50
- code: typeof GatewayErrorDetailCodes.MCP_APP_VIEW_EXPIRED;
51
- };
52
- type OutboundDeliveryQueuedErrorDetails = {
53
- code: typeof GatewayErrorDetailCodes.OUTBOUND_DELIVERY_QUEUED;
54
- };
55
- /** Per-profile preference quota details returned by users.prefs.set. */
56
- type UserPrefsLimitExceededErrorDetails = {
57
- code: typeof GatewayErrorDetailCodes.USER_PREFS_LIMIT_EXCEEDED;
58
- limit: number;
59
- currentCount: number;
60
- };
61
- /** Unknown agent details carried by agent-scoped method validation failures. */
62
- type UnknownAgentIdErrorDetails = {
63
- code: typeof GatewayErrorDetailCodes.UNKNOWN_AGENT_ID;
64
- agentId: string;
65
- };
66
- /** Setup rejected before its task or wizard session was admitted. */
67
- type SetupAdmissionBusyErrorDetails = {
68
- code: typeof GatewayErrorDetailCodes.SETUP_ADMISSION_BUSY;
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
- };
75
- /** Missing or expired process-local setup wizard session. */
76
- type WizardNotFoundErrorDetails = {
77
- code: typeof GatewayErrorDetailCodes.WIZARD_NOT_FOUND;
78
- };
79
- type ProjectCloneFailureCause = "invalid_url" | "auth_required" | "not_found" | "network" | "target_exists" | "clone_failed";
80
- type ProjectCloneErrorDetails = {
81
- code: typeof GatewayErrorDetailCodes.PROJECT_CLONE_FAILED;
82
- cause: ProjectCloneFailureCause;
83
- };
84
- /** Optimistic-concurrency mismatch for an operator-reviewed Skill Workshop draft. */
85
- type SkillProposalRevisionChangedErrorDetails = {
86
- code: typeof GatewayErrorDetailCodes.SKILL_PROPOSAL_REVISION_CHANGED;
87
- expectedRevisionHash: string;
88
- currentRevisionHash: string;
89
- };
90
- /** Structured details emitted by method-level failures. */
91
- type GatewayErrorDetails = CronJobNotFoundErrorDetails | MissingScopeErrorDetails | McpAppViewExpiredErrorDetails | OutboundDeliveryQueuedErrorDetails | UserPrefsLimitExceededErrorDetails | SkillProposalRevisionChangedErrorDetails | ProjectCloneErrorDetails | UnknownAgentIdErrorDetails | WizardNotFoundErrorDetails | SetupAdmissionBusyErrorDetails | GitHubPublicationSelectionRejectedErrorDetails;
92
- declare function readGitHubPublicationSelectionRejectedError(error: unknown): GitHubPublicationSelectionRejectedErrorDetails | null;
93
- /** Reads a typed cron lookup miss without parsing operator-facing prose. */
94
- declare function readCronJobNotFoundError(error: unknown): CronJobNotFoundErrorDetails | null;
95
- /** Builds the canonical stale-draft details shared by Skill Workshop RPCs. */
96
- declare function buildSkillProposalRevisionChangedErrorDetails(params: {
97
- expectedRevisionHash: string;
98
- currentRevisionHash: string;
99
- }): SkillProposalRevisionChangedErrorDetails;
100
- /** Reads a stale Skill Workshop decision without parsing operator-facing prose. */
101
- declare function readSkillProposalRevisionChangedError(error: unknown): SkillProposalRevisionChangedErrorDetails | null;
102
- /** Reads validated missing-scope details from an untrusted protocol payload. */
103
- declare function readMissingScopeErrorDetails(details: unknown): MissingScopeErrorDetails | null;
104
- declare function isMcpAppViewExpiredError(error: unknown): boolean;
105
- /**
106
- * Reads a method-level missing-scope failure, preferring structured details.
107
- * The message fallback keeps clients compatible with gateways predating structured details.
108
- */
109
- declare function readMissingScopeError(error: unknown): MissingScopeErrorDetails | null;
110
- //#endregion
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 };