@ggui-ai/protocol 0.1.0-rc.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/LICENSE +201 -0
- package/README.md +46 -0
- package/dist/bridge/invoke-agent.d.ts +65 -0
- package/dist/bridge/invoke-agent.d.ts.map +1 -0
- package/dist/bridge/invoke-agent.js +113 -0
- package/dist/envelope-adapters.d.ts +24 -0
- package/dist/envelope-adapters.d.ts.map +1 -0
- package/dist/envelope-adapters.js +14 -0
- package/dist/envelopes/builders.d.ts +145 -0
- package/dist/envelopes/builders.d.ts.map +1 -0
- package/dist/envelopes/builders.js +113 -0
- package/dist/errors/unknown-permission-name.d.ts +12 -0
- package/dist/errors/unknown-permission-name.d.ts.map +1 -0
- package/dist/errors/unknown-permission-name.js +29 -0
- package/dist/errors/version-mismatch.d.ts +55 -0
- package/dist/errors/version-mismatch.d.ts.map +1 -0
- package/dist/errors/version-mismatch.js +52 -0
- package/dist/gadgets/resolve-contract-gadgets.d.ts +93 -0
- package/dist/gadgets/resolve-contract-gadgets.d.ts.map +1 -0
- package/dist/gadgets/resolve-contract-gadgets.js +119 -0
- package/dist/gadgets/stdlib-gadgets.d.ts +43 -0
- package/dist/gadgets/stdlib-gadgets.d.ts.map +1 -0
- package/dist/gadgets/stdlib-gadgets.js +161 -0
- package/dist/iframe-bridge.d.ts +63 -0
- package/dist/iframe-bridge.d.ts.map +1 -0
- package/dist/iframe-bridge.js +166 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +79 -0
- package/dist/integrations/mcp-apps.d.ts +1218 -0
- package/dist/integrations/mcp-apps.d.ts.map +1 -0
- package/dist/integrations/mcp-apps.js +427 -0
- package/dist/navigation/index.d.ts +3 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/index.js +1 -0
- package/dist/navigation/stack-navigation.d.ts +55 -0
- package/dist/navigation/stack-navigation.d.ts.map +1 -0
- package/dist/navigation/stack-navigation.js +80 -0
- package/dist/recommended-prompts.d.ts +56 -0
- package/dist/recommended-prompts.d.ts.map +1 -0
- package/dist/recommended-prompts.js +55 -0
- package/dist/registry/blueprint-key.d.ts +9 -0
- package/dist/registry/blueprint-key.d.ts.map +1 -0
- package/dist/registry/blueprint-key.js +28 -0
- package/dist/registry/canonicalize-contract.d.ts +35 -0
- package/dist/registry/canonicalize-contract.d.ts.map +1 -0
- package/dist/registry/canonicalize-contract.js +166 -0
- package/dist/registry/summarize-contract.d.ts +46 -0
- package/dist/registry/summarize-contract.d.ts.map +1 -0
- package/dist/registry/summarize-contract.js +63 -0
- package/dist/schema-learning/derive-contract.d.ts +67 -0
- package/dist/schema-learning/derive-contract.d.ts.map +1 -0
- package/dist/schema-learning/derive-contract.js +117 -0
- package/dist/schema-learning/merge.d.ts +32 -0
- package/dist/schema-learning/merge.d.ts.map +1 -0
- package/dist/schema-learning/merge.js +146 -0
- package/dist/schemas/blueprint.d.ts +32 -0
- package/dist/schemas/blueprint.d.ts.map +1 -0
- package/dist/schemas/blueprint.js +92 -0
- package/dist/schemas/data-contract.d.ts +750 -0
- package/dist/schemas/data-contract.d.ts.map +1 -0
- package/dist/schemas/data-contract.js +663 -0
- package/dist/schemas/gadget-name-grammar.d.ts +29 -0
- package/dist/schemas/gadget-name-grammar.d.ts.map +1 -0
- package/dist/schemas/gadget-name-grammar.js +28 -0
- package/dist/schemas/handshake-suggestion.d.ts +46 -0
- package/dist/schemas/handshake-suggestion.d.ts.map +1 -0
- package/dist/schemas/handshake-suggestion.js +107 -0
- package/dist/schemas/invoke.d.ts +337 -0
- package/dist/schemas/invoke.d.ts.map +1 -0
- package/dist/schemas/invoke.js +169 -0
- package/dist/schemas/mcp.d.ts +301 -0
- package/dist/schemas/mcp.d.ts.map +1 -0
- package/dist/schemas/mcp.js +373 -0
- package/dist/schemas/ops-blueprint.d.ts +176 -0
- package/dist/schemas/ops-blueprint.d.ts.map +1 -0
- package/dist/schemas/ops-blueprint.js +259 -0
- package/dist/schemas/sync-check.d.ts +11 -0
- package/dist/schemas/sync-check.d.ts.map +1 -0
- package/dist/schemas/sync-check.js +60 -0
- package/dist/screen-blueprints/define.d.ts +22 -0
- package/dist/screen-blueprints/define.d.ts.map +1 -0
- package/dist/screen-blueprints/define.js +3 -0
- package/dist/screen-blueprints/index.d.ts +4 -0
- package/dist/screen-blueprints/index.d.ts.map +1 -0
- package/dist/screen-blueprints/index.js +3 -0
- package/dist/screen-blueprints/match.d.ts +35 -0
- package/dist/screen-blueprints/match.d.ts.map +1 -0
- package/dist/screen-blueprints/match.js +51 -0
- package/dist/screen-blueprints/types.d.ts +164 -0
- package/dist/screen-blueprints/types.d.ts.map +1 -0
- package/dist/screen-blueprints/types.js +1 -0
- package/dist/stream/stream-parser.d.ts +62 -0
- package/dist/stream/stream-parser.d.ts.map +1 -0
- package/dist/stream/stream-parser.js +199 -0
- package/dist/transport/websocket.d.ts +178 -0
- package/dist/transport/websocket.d.ts.map +1 -0
- package/dist/transport/websocket.js +1 -0
- package/dist/types/app-config.d.ts +61 -0
- package/dist/types/app-config.d.ts.map +1 -0
- package/dist/types/app-config.js +1 -0
- package/dist/types/auth.d.ts +61 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +1 -0
- package/dist/types/blueprint.d.ts +206 -0
- package/dist/types/blueprint.d.ts.map +1 -0
- package/dist/types/blueprint.js +1 -0
- package/dist/types/canvas-lifecycle.d.ts +105 -0
- package/dist/types/canvas-lifecycle.d.ts.map +1 -0
- package/dist/types/canvas-lifecycle.js +38 -0
- package/dist/types/capabilities.d.ts +40 -0
- package/dist/types/capabilities.d.ts.map +1 -0
- package/dist/types/capabilities.js +19 -0
- package/dist/types/contract-inference.d.ts +401 -0
- package/dist/types/contract-inference.d.ts.map +1 -0
- package/dist/types/contract-inference.js +44 -0
- package/dist/types/credential.d.ts +41 -0
- package/dist/types/credential.d.ts.map +1 -0
- package/dist/types/credential.js +32 -0
- package/dist/types/data-bindings.d.ts +322 -0
- package/dist/types/data-bindings.d.ts.map +1 -0
- package/dist/types/data-bindings.js +29 -0
- package/dist/types/data-contract.d.ts +1296 -0
- package/dist/types/data-contract.d.ts.map +1 -0
- package/dist/types/data-contract.js +111 -0
- package/dist/types/events.d.ts +182 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +8 -0
- package/dist/types/feedback.d.ts +24 -0
- package/dist/types/feedback.d.ts.map +1 -0
- package/dist/types/feedback.js +7 -0
- package/dist/types/gadget.d.ts +121 -0
- package/dist/types/gadget.d.ts.map +1 -0
- package/dist/types/gadget.js +24 -0
- package/dist/types/handshake-suggestion.d.ts +264 -0
- package/dist/types/handshake-suggestion.d.ts.map +1 -0
- package/dist/types/handshake-suggestion.js +70 -0
- package/dist/types/host-context.d.ts +163 -0
- package/dist/types/host-context.d.ts.map +1 -0
- package/dist/types/host-context.js +142 -0
- package/dist/types/interface-context.d.ts +105 -0
- package/dist/types/interface-context.d.ts.map +1 -0
- package/dist/types/interface-context.js +115 -0
- package/dist/types/invoke.d.ts +28 -0
- package/dist/types/invoke.d.ts.map +1 -0
- package/dist/types/invoke.js +7 -0
- package/dist/types/live-channel.d.ts +613 -0
- package/dist/types/live-channel.d.ts.map +1 -0
- package/dist/types/live-channel.js +1 -0
- package/dist/types/llm.d.ts +61 -0
- package/dist/types/llm.d.ts.map +1 -0
- package/dist/types/llm.js +186 -0
- package/dist/types/mcp-proxy.d.ts +67 -0
- package/dist/types/mcp-proxy.d.ts.map +1 -0
- package/dist/types/mcp-proxy.js +46 -0
- package/dist/types/mcp.d.ts +637 -0
- package/dist/types/mcp.d.ts.map +1 -0
- package/dist/types/mcp.js +30 -0
- package/dist/types/openrouter-models.d.ts +22 -0
- package/dist/types/openrouter-models.d.ts.map +1 -0
- package/dist/types/openrouter-models.js +4843 -0
- package/dist/types/region.d.ts +26 -0
- package/dist/types/region.d.ts.map +1 -0
- package/dist/types/region.js +36 -0
- package/dist/types/session.d.ts +419 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/session.js +1 -0
- package/dist/types/thread.d.ts +207 -0
- package/dist/types/thread.d.ts.map +1 -0
- package/dist/types/thread.js +57 -0
- package/dist/types/ui-generator.d.ts +100 -0
- package/dist/types/ui-generator.d.ts.map +1 -0
- package/dist/types/ui-generator.js +53 -0
- package/dist/validation/ajv-runtime.d.ts +140 -0
- package/dist/validation/ajv-runtime.d.ts.map +1 -0
- package/dist/validation/ajv-runtime.js +452 -0
- package/dist/validation/content-hash.d.ts +3 -0
- package/dist/validation/content-hash.d.ts.map +1 -0
- package/dist/validation/content-hash.js +21 -0
- package/dist/validation/contract-validator.d.ts +244 -0
- package/dist/validation/contract-validator.d.ts.map +1 -0
- package/dist/validation/contract-validator.js +711 -0
- package/dist/validation/cross-references.d.ts +105 -0
- package/dist/validation/cross-references.d.ts.map +1 -0
- package/dist/validation/cross-references.js +164 -0
- package/dist/validation/hygiene-rules.d.ts +250 -0
- package/dist/validation/hygiene-rules.d.ts.map +1 -0
- package/dist/validation/hygiene-rules.js +564 -0
- package/dist/validation/lint-contract.d.ts +130 -0
- package/dist/validation/lint-contract.d.ts.map +1 -0
- package/dist/validation/lint-contract.js +225 -0
- package/dist/validation/name-invariants.d.ts +117 -0
- package/dist/validation/name-invariants.d.ts.map +1 -0
- package/dist/validation/name-invariants.js +172 -0
- package/dist/validation/reserved-channels.d.ts +156 -0
- package/dist/validation/reserved-channels.d.ts.map +1 -0
- package/dist/validation/reserved-channels.js +356 -0
- package/dist/validation/resolve-stream-channel.d.ts +78 -0
- package/dist/validation/resolve-stream-channel.d.ts.map +1 -0
- package/dist/validation/resolve-stream-channel.js +64 -0
- package/dist/validation/sanitize-error.d.ts +46 -0
- package/dist/validation/sanitize-error.d.ts.map +1 -0
- package/dist/validation/sanitize-error.js +88 -0
- package/dist/validation/schema-compat-invariants.d.ts +140 -0
- package/dist/validation/schema-compat-invariants.d.ts.map +1 -0
- package/dist/validation/schema-compat-invariants.js +220 -0
- package/dist/validation/schema-meta-validation.d.ts +60 -0
- package/dist/validation/schema-meta-validation.d.ts.map +1 -0
- package/dist/validation/schema-meta-validation.js +131 -0
- package/dist/validation/schema-subset.d.ts +165 -0
- package/dist/validation/schema-subset.d.ts.map +1 -0
- package/dist/validation/schema-subset.js +295 -0
- package/dist/validation/ui-security.d.ts +54 -0
- package/dist/validation/ui-security.d.ts.map +1 -0
- package/dist/validation/ui-security.js +138 -0
- package/dist/validation/zod-to-json-schema.d.ts +63 -0
- package/dist/validation/zod-to-json-schema.d.ts.map +1 -0
- package/dist/validation/zod-to-json-schema.js +126 -0
- package/dist/version.d.ts +1458 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +1459 -0
- package/package.json +113 -0
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { Action, SessionView } from './session';
|
|
3
|
+
import type { DataContract, JsonObject, JsonSchema, JsonValue, StreamSpec } from './data-contract';
|
|
4
|
+
import type { handshakeInputSchema, handshakeOutputSchema, newSessionInputSchema, newSessionOutputSchema, pushInputSchema, pushOutputSchema, updateInputSchema, updateOutputSchema } from '../schemas/mcp';
|
|
5
|
+
export type { Action };
|
|
6
|
+
/** Target screen size category for responsive layout */
|
|
7
|
+
export type Screen = 'mobile' | 'tablet' | 'desktop' | 'universal';
|
|
8
|
+
/**
|
|
9
|
+
* Session status for MCP consume responses
|
|
10
|
+
*/
|
|
11
|
+
export type SessionStatus = 'active' | 'completed' | 'expired';
|
|
12
|
+
/**
|
|
13
|
+
* Pending action stored server-side for agent consumption.
|
|
14
|
+
*
|
|
15
|
+
* `envelope` is the canonical {@link ConsumeEventEntry} row. `sequence`
|
|
16
|
+
* is the session-scoped monotonic assigned at ingestion; it sits on the
|
|
17
|
+
* row wrapper so consumers can detect gaps without parsing the payload.
|
|
18
|
+
*
|
|
19
|
+
* **Storage note**: the envelope is stored as either a JSON object
|
|
20
|
+
* (direct DDB writes) or a JSON-stringified object (AppSync `a.json()`
|
|
21
|
+
* semantics). Consume readers MUST accept both — see
|
|
22
|
+
* {@link parsePendingEnvelope}.
|
|
23
|
+
*/
|
|
24
|
+
export interface PendingEvent {
|
|
25
|
+
/** Stable row id — UUID assigned at ingestion. */
|
|
26
|
+
id: string;
|
|
27
|
+
/**
|
|
28
|
+
* Canonical {@link ConsumeEventEntry} row payload. JSON object or
|
|
29
|
+
* stringified JSON on the wire (both shapes round-trip through the
|
|
30
|
+
* consume helpers).
|
|
31
|
+
*/
|
|
32
|
+
envelope: ConsumeEventEntry | string;
|
|
33
|
+
/**
|
|
34
|
+
* Session-scoped monotonic sequence assigned at ingestion. Mirrors
|
|
35
|
+
* `Session.eventSequence` at the moment this row was appended so
|
|
36
|
+
* consumers can detect gaps without reading session state.
|
|
37
|
+
*/
|
|
38
|
+
sequence: number;
|
|
39
|
+
/** ISO datetime when the row was appended. */
|
|
40
|
+
createdAt: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Input for ggui_pop tool - removes top UI from stack
|
|
44
|
+
*/
|
|
45
|
+
export interface GguiPopInput {
|
|
46
|
+
/** Session ID to pop from */
|
|
47
|
+
sessionId: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Input for ggui_consume tool — long-poll for buffered events on a
|
|
51
|
+
* specific stack item.
|
|
52
|
+
*
|
|
53
|
+
* Keyed by `stackItemId`, not `sessionId`. The server resolves the
|
|
54
|
+
* owning session via its `stackItemId` secondary index and tenancy-
|
|
55
|
+
* checks via `ctx.appId`. The agent gets `stackItemId` from
|
|
56
|
+
* `pushOutput.stackItemId`.
|
|
57
|
+
*
|
|
58
|
+
* Default semantic: long-poll, return on first event or server-default
|
|
59
|
+
* timeout. Agent loops by re-calling. There is no `until` parameter —
|
|
60
|
+
* the agent's loop policy is its own concern; the server delivers one
|
|
61
|
+
* batch per call.
|
|
62
|
+
*
|
|
63
|
+
* Each drained entry on the output carries its own `uiContext` snapshot
|
|
64
|
+
* captured at gesture time on the iframe; the top-level
|
|
65
|
+
* `contextSnapshot` is intentionally absent from the output (see
|
|
66
|
+
* {@link GguiConsumeOutput} / {@link ConsumeEventEntry}).
|
|
67
|
+
*/
|
|
68
|
+
export interface GguiConsumeInput {
|
|
69
|
+
/**
|
|
70
|
+
* Stack item to consume events from. Globally unique (UUID); the
|
|
71
|
+
* server resolves the owning session via its secondary index.
|
|
72
|
+
* Cross-tenant access surfaces uniformly as `stack_item_not_found`.
|
|
73
|
+
*/
|
|
74
|
+
stackItemId: string;
|
|
75
|
+
/**
|
|
76
|
+
* Timeout in seconds for long-poll. Server-side wall-clock cap.
|
|
77
|
+
* - 0: immediate return (no waiting)
|
|
78
|
+
* - 1-25: synchronous long-poll (HTTP API, capped by 30s gateway limit)
|
|
79
|
+
* - 26-900: SSE streaming via server-sent events (up to 15 min)
|
|
80
|
+
* The MCP client SDK routes to the appropriate endpoint automatically.
|
|
81
|
+
* Default: 0 (immediate).
|
|
82
|
+
*/
|
|
83
|
+
timeout?: number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Input for `ggui_emit` — emit a new delivery on a declared channel of the
|
|
87
|
+
* active (or explicitly pinned) stack item's `streamSpec`.
|
|
88
|
+
*
|
|
89
|
+
* Canonical, post-rewrite shape. The agent describes what new data
|
|
90
|
+
* exists; the server describes how the channel behaves.
|
|
91
|
+
*
|
|
92
|
+
* Fields the agent MUST NOT supply:
|
|
93
|
+
* - `mode` — derived from `streamSpec[channel].mode` (default `'append'`).
|
|
94
|
+
* - `seq` — server-assigned via `SessionStreamBuffer`.
|
|
95
|
+
* - `timestamp` — server clock.
|
|
96
|
+
* - `connectionId` / transport details — fan-out plumbing.
|
|
97
|
+
*
|
|
98
|
+
* Any of these appearing on `GguiEmitInput` is a drift regression and
|
|
99
|
+
* guarded by `types.test.ts`.
|
|
100
|
+
*/
|
|
101
|
+
export interface GguiEmitInput<TPayload = JsonValue> {
|
|
102
|
+
/** Session to stream to. Server enforces app-ownership. */
|
|
103
|
+
sessionId: string;
|
|
104
|
+
/**
|
|
105
|
+
* Channel name. MUST be declared on the resolved stack item's
|
|
106
|
+
* `streamSpec`. Undeclared channels are rejected at call time.
|
|
107
|
+
*/
|
|
108
|
+
channel: string;
|
|
109
|
+
/**
|
|
110
|
+
* Payload for this delivery. Validated against
|
|
111
|
+
* `streamSpec[channel].schema`.
|
|
112
|
+
*/
|
|
113
|
+
payload: TPayload;
|
|
114
|
+
/**
|
|
115
|
+
* Terminal delivery marker. Only valid when the channel was declared
|
|
116
|
+
* with `complete: true` on the streamSpec. Setting it on a non-
|
|
117
|
+
* completable channel is rejected at call time.
|
|
118
|
+
*
|
|
119
|
+
* Post-complete behavior is NOT enforced server-side — producers
|
|
120
|
+
* SHOULD NOT emit further deliveries on the same channel after
|
|
121
|
+
* sending `complete: true`, but the server won't reject them.
|
|
122
|
+
*/
|
|
123
|
+
complete?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Pin this delivery to a specific stack item. Mirrors the live-channel
|
|
126
|
+
* `ActionEnvelope.stackItemId` doctrine — explicit when the agent
|
|
127
|
+
* cares, implicit `session.currentStackIndex` default otherwise.
|
|
128
|
+
*/
|
|
129
|
+
stackItemId?: string;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Output from `ggui_emit`.
|
|
133
|
+
*
|
|
134
|
+
* `accepted` — the server validated and enqueued the envelope. Fan-out
|
|
135
|
+
* to subscribers and buffered retention happen independently; whether
|
|
136
|
+
* any subscriber is currently connected is a separate concern and does
|
|
137
|
+
* NOT affect this flag. No-subscriber is not an error.
|
|
138
|
+
*/
|
|
139
|
+
export interface GguiEmitOutput {
|
|
140
|
+
/** True when the server accepted the delivery at the boundary. */
|
|
141
|
+
accepted: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Session-scoped monotonic outbound sequence assigned to this
|
|
144
|
+
* delivery. Omitted on implementations without a
|
|
145
|
+
* `SessionStreamBuffer` (hosted cloud today); required on OSS
|
|
146
|
+
* `@ggui-ai/mcp-server`.
|
|
147
|
+
*/
|
|
148
|
+
seq?: number;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Input for ggui_get_session tool - retrieves session state
|
|
152
|
+
*/
|
|
153
|
+
export interface GguiGetSessionInput {
|
|
154
|
+
/** Session ID to get state for */
|
|
155
|
+
sessionId: string;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Input for ggui_close tool - terminates session
|
|
159
|
+
*/
|
|
160
|
+
export interface GguiCloseInput {
|
|
161
|
+
/** Session ID to close */
|
|
162
|
+
sessionId: string;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Input for ggui_get_stack tool - lightweight stack navigation metadata
|
|
166
|
+
*/
|
|
167
|
+
export interface GguiGetStackInput {
|
|
168
|
+
/** Session ID to get stack info for */
|
|
169
|
+
sessionId: string;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Lightweight summary of a stack item (no componentCode)
|
|
173
|
+
*/
|
|
174
|
+
export interface StackItemSummary {
|
|
175
|
+
/** Stack item ID */
|
|
176
|
+
id: string;
|
|
177
|
+
/** Natural language prompt that generated this item */
|
|
178
|
+
prompt?: string;
|
|
179
|
+
/** Human-readable description */
|
|
180
|
+
description?: string;
|
|
181
|
+
/** Whether this item has a generation error */
|
|
182
|
+
hasError: boolean;
|
|
183
|
+
/** Stream contract — describes what data the component accepts in real-time via ggui_emit */
|
|
184
|
+
streamSpec?: StreamSpec;
|
|
185
|
+
/** Declarative actions wired into this item */
|
|
186
|
+
actions?: Action[];
|
|
187
|
+
/** ISO datetime when this item was created */
|
|
188
|
+
createdAt: string;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Output from ggui_get_stack tool
|
|
192
|
+
*/
|
|
193
|
+
export interface GguiGetStackOutput {
|
|
194
|
+
/** Session ID */
|
|
195
|
+
sessionId: string;
|
|
196
|
+
/** Number of items in the stack */
|
|
197
|
+
stackSize: number;
|
|
198
|
+
/** Currently active stack index */
|
|
199
|
+
currentIndex: number;
|
|
200
|
+
/** Lightweight item summaries (no component code) */
|
|
201
|
+
items: StackItemSummary[];
|
|
202
|
+
/** Whether back navigation is possible */
|
|
203
|
+
canGoBack: boolean;
|
|
204
|
+
/** Whether forward navigation is possible */
|
|
205
|
+
canGoForward: boolean;
|
|
206
|
+
/** Session status */
|
|
207
|
+
status: SessionStatus;
|
|
208
|
+
}
|
|
209
|
+
/** Negotiator's decision on what UI to show. */
|
|
210
|
+
export interface NegotiatorDecision {
|
|
211
|
+
/** What to do with the UI stack. */
|
|
212
|
+
action: 'create' | 'update' | 'compose' | 'replace';
|
|
213
|
+
/** Why — visible to the agent. */
|
|
214
|
+
reasoning: string;
|
|
215
|
+
/** Matched blueprint (if any). */
|
|
216
|
+
blueprintId?: string;
|
|
217
|
+
/** The agreed data contract. */
|
|
218
|
+
contract: DataContract;
|
|
219
|
+
/** For update/compose/replace — which page to target. */
|
|
220
|
+
targetStackItemId?: string;
|
|
221
|
+
/** UI adaptations based on user context. */
|
|
222
|
+
adaptations?: {
|
|
223
|
+
fontSize?: 'compact' | 'default' | 'large';
|
|
224
|
+
density?: 'dense' | 'default' | 'spacious';
|
|
225
|
+
complexity?: 'simplified' | 'default' | 'detailed';
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
/** Alternative option (shown in suggestive/passive modes). */
|
|
229
|
+
export interface NegotiatorAlternative {
|
|
230
|
+
id: string;
|
|
231
|
+
type: 'blueprint' | 'brainstorm';
|
|
232
|
+
description: string;
|
|
233
|
+
blueprintId?: string;
|
|
234
|
+
contract?: DataContract;
|
|
235
|
+
renderTime: 'instant' | 'standard';
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Output from ggui_pop tool
|
|
239
|
+
*/
|
|
240
|
+
export interface GguiPopOutput {
|
|
241
|
+
/** ID of the card that was popped */
|
|
242
|
+
poppedId: string | null;
|
|
243
|
+
/** Current stack size after pop */
|
|
244
|
+
stackSize: number;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Per-event entry returned by `ggui_consume`. The shape written by
|
|
248
|
+
* `ggui_runtime_submit_action`'s `kind:'dispatch'` handler onto the
|
|
249
|
+
* stackItem-keyed pending-events pipe and surfaced verbatim on drain.
|
|
250
|
+
*
|
|
251
|
+
* `actionData` is WHAT the user did; `uiContext` is the snapshot of the
|
|
252
|
+
* contract's `contextSpec` slot values at the moment they did it.
|
|
253
|
+
* Capturing both per-event (instead of folding a top-level
|
|
254
|
+
* `contextSnapshot` at drain time) means agents see the UI state AS IT
|
|
255
|
+
* WAS WHEN THE USER ACTED, not the post-action state that might already
|
|
256
|
+
* have mutated by the time consume returns.
|
|
257
|
+
*
|
|
258
|
+
* Distinct from the inbound live-channel `ActionEnvelope` (which has
|
|
259
|
+
* `{sessionId, type, payload?, stackIndex?, ...}` and lives on the
|
|
260
|
+
* WebSocket inbound seam) — consume reads from a separate stackItem-
|
|
261
|
+
* scoped pipe whose entries originate at `submit_action`.
|
|
262
|
+
*/
|
|
263
|
+
export interface ConsumeEventEntry {
|
|
264
|
+
/** Stable discriminator — always the literal `'action'`. */
|
|
265
|
+
readonly type: 'action';
|
|
266
|
+
/** Stack item the gesture targeted. */
|
|
267
|
+
readonly stackItemId: string;
|
|
268
|
+
/** Which `actionSpec[*]` entry the iframe dispatched against. */
|
|
269
|
+
readonly intent: string;
|
|
270
|
+
/**
|
|
271
|
+
* Typed payload satisfying `actionSpec[intent].schema`. `null` for
|
|
272
|
+
* no-payload gestures (bare button click).
|
|
273
|
+
*/
|
|
274
|
+
readonly actionData: JsonValue | null;
|
|
275
|
+
/**
|
|
276
|
+
* Snapshot of the contract's `contextSpec` slot values at the moment
|
|
277
|
+
* the user fired the gesture. Empty object `{}` when the contract
|
|
278
|
+
* has no `contextSpec` or no slots have been mirrored yet.
|
|
279
|
+
*/
|
|
280
|
+
readonly uiContext: JsonObject;
|
|
281
|
+
/**
|
|
282
|
+
* 8-hex FNV-1a correlation id of the gesture — matches the iframe-
|
|
283
|
+
* runtime's outstanding-toast key and the server's `drain_ack` frame.
|
|
284
|
+
*/
|
|
285
|
+
readonly actionId: string;
|
|
286
|
+
/** ISO 8601 UTC timestamp of the gesture (iframe-local clock). */
|
|
287
|
+
readonly firedAt: string;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Output from `ggui_consume` — buffered consume-entries.
|
|
291
|
+
*
|
|
292
|
+
* `events` is an array of {@link ConsumeEventEntry} rows in append order.
|
|
293
|
+
* The pre-2026-05-14 top-level `contextSnapshot` field was RETIRED in
|
|
294
|
+
* favor of the per-event `uiContext` on each entry. The pipe is the
|
|
295
|
+
* single source of truth — both the action and the local UI state are
|
|
296
|
+
* atomic on a single entry.
|
|
297
|
+
*/
|
|
298
|
+
export interface GguiConsumeOutput {
|
|
299
|
+
/** Buffered consume-entries (cleared after return). */
|
|
300
|
+
events: ConsumeEventEntry[];
|
|
301
|
+
/** Session status - 'completed' means no more events will arrive */
|
|
302
|
+
status: SessionStatus;
|
|
303
|
+
/**
|
|
304
|
+
* Client-side observations echoed back to the agent. Same shape
|
|
305
|
+
* `ggui_handshake` exposes. Lets the agent pick up mid-session
|
|
306
|
+
* changes (window resize, fullscreen toggle, etc.) without waiting
|
|
307
|
+
* for the next handshake. Absent ⇒ no client observations yet.
|
|
308
|
+
*
|
|
309
|
+
*/
|
|
310
|
+
client?: {
|
|
311
|
+
readonly hostContext?: import('./host-context.js').HostContextProjection;
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Output from ggui_get_session tool.
|
|
316
|
+
* Extends SessionView (spec Section 6.1) — same fields, same structure.
|
|
317
|
+
*/
|
|
318
|
+
export type GguiGetSessionOutput = SessionView;
|
|
319
|
+
/**
|
|
320
|
+
* Output from ggui_close tool
|
|
321
|
+
*/
|
|
322
|
+
export interface GguiCloseOutput {
|
|
323
|
+
/** Whether the session was successfully closed */
|
|
324
|
+
success: boolean;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Input for ggui_list_featured_blueprints tool - discovers available UI blueprints
|
|
328
|
+
*/
|
|
329
|
+
export interface GguiListFeaturedBlueprintsInput {
|
|
330
|
+
/** Filter by component level. Canonical four-level hierarchy:
|
|
331
|
+
* `primitive` (Button) → `component` (SearchField) → `composite`
|
|
332
|
+
* (LoginForm, Modal) → `template` (ListDetail, Dashboard page). */
|
|
333
|
+
level?: 'primitive' | 'component' | 'composite' | 'template';
|
|
334
|
+
/** Filter by category */
|
|
335
|
+
category?: string;
|
|
336
|
+
/** Filter by tags (any match) */
|
|
337
|
+
tags?: string[];
|
|
338
|
+
/** Max results (default: 50) */
|
|
339
|
+
limit?: number;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Output from ggui_list_featured_blueprints tool
|
|
343
|
+
*/
|
|
344
|
+
export interface GguiListFeaturedBlueprintsOutput {
|
|
345
|
+
/** List of matching blueprints */
|
|
346
|
+
blueprints: Array<{
|
|
347
|
+
id: string;
|
|
348
|
+
name: string;
|
|
349
|
+
source: 'predefined' | 'cached';
|
|
350
|
+
description: string;
|
|
351
|
+
category: string;
|
|
352
|
+
level: string;
|
|
353
|
+
props: Array<{
|
|
354
|
+
name: string;
|
|
355
|
+
type: string;
|
|
356
|
+
required: boolean;
|
|
357
|
+
description: string;
|
|
358
|
+
}>;
|
|
359
|
+
examples: string[];
|
|
360
|
+
tags: string[];
|
|
361
|
+
usageCount?: number;
|
|
362
|
+
}>;
|
|
363
|
+
/** Total number of matching blueprints */
|
|
364
|
+
total: number;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Input for ggui_search_blueprints tool - semantic search over blueprints
|
|
368
|
+
*/
|
|
369
|
+
export interface GguiSearchBlueprintsInput {
|
|
370
|
+
/** Natural language description of the UI you're looking for */
|
|
371
|
+
query: string;
|
|
372
|
+
/** Max results (default: 10) */
|
|
373
|
+
limit?: number;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Output from ggui_search_blueprints tool
|
|
377
|
+
*/
|
|
378
|
+
export interface GguiSearchBlueprintsOutput {
|
|
379
|
+
/** Matching blueprints ordered by relevance */
|
|
380
|
+
results: Array<{
|
|
381
|
+
id: string;
|
|
382
|
+
name: string;
|
|
383
|
+
description: string;
|
|
384
|
+
category: string;
|
|
385
|
+
props: Array<{
|
|
386
|
+
name: string;
|
|
387
|
+
type: string;
|
|
388
|
+
required: boolean;
|
|
389
|
+
description: string;
|
|
390
|
+
}>;
|
|
391
|
+
callbacks: string[];
|
|
392
|
+
/** Whether this is a featured/predefined blueprint (curated by the app developer) */
|
|
393
|
+
featured: boolean;
|
|
394
|
+
relevance: 'match';
|
|
395
|
+
/** Cosine similarity score (0-1). Higher = better match. Agents can use this
|
|
396
|
+
* to decide whether to use a blueprint or generate from scratch. */
|
|
397
|
+
score: number;
|
|
398
|
+
}>;
|
|
399
|
+
/** Total matches found */
|
|
400
|
+
total: number;
|
|
401
|
+
/** The query that was searched */
|
|
402
|
+
query: string;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Input for ggui_render_blueprint tool - renders a specific blueprint.
|
|
406
|
+
* Generic `TProps` defaults to {@link JsonObject} for blueprint props.
|
|
407
|
+
*/
|
|
408
|
+
export interface GguiRenderBlueprintInput<TProps = JsonObject> {
|
|
409
|
+
/** Blueprint ID to render */
|
|
410
|
+
blueprintId: string;
|
|
411
|
+
/** Props to pass to the blueprint */
|
|
412
|
+
props?: TProps;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Output from ggui_render_blueprint tool.
|
|
416
|
+
*
|
|
417
|
+
* The OSS path returns the compiled bundle inline (`code` + `contentType`)
|
|
418
|
+
* so agents + viewers can consume it without a second round-trip. When
|
|
419
|
+
* the hosted cloud re-introduces signed-URL rendering it will layer on
|
|
420
|
+
* additional optional fields; the inline shape stays the baseline contract
|
|
421
|
+
* every implementation honors.
|
|
422
|
+
*/
|
|
423
|
+
export interface GguiRenderBlueprintOutput {
|
|
424
|
+
/** Blueprint ID that was rendered. */
|
|
425
|
+
blueprintId: string;
|
|
426
|
+
/** Blueprint name for display. */
|
|
427
|
+
blueprintName: string;
|
|
428
|
+
/**
|
|
429
|
+
* Compiled JS bundle as a string. ESM `export default` producing the
|
|
430
|
+
* component that should mount. Non-empty on success.
|
|
431
|
+
*/
|
|
432
|
+
code: string;
|
|
433
|
+
/**
|
|
434
|
+
* MIME / content-type of `code`. Typically
|
|
435
|
+
* `'application/javascript+react'` — pinned on the server's compile
|
|
436
|
+
* pipeline; agents treat this as opaque.
|
|
437
|
+
*/
|
|
438
|
+
contentType: string;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Input for ggui_discover tool - discovers platform capabilities
|
|
442
|
+
*/
|
|
443
|
+
export interface GguiDiscoverInput {
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Output from ggui_discover tool - platform capabilities and app configuration
|
|
447
|
+
*/
|
|
448
|
+
export interface GguiDiscoverOutput {
|
|
449
|
+
/** Protocol version (e.g., 'draft-2026-04-19'). Prelaunch drafts use
|
|
450
|
+
* `draft-YYYY-MM-DD`; the first frozen release will be `1.0.0`. */
|
|
451
|
+
protocolVersion: string;
|
|
452
|
+
/** Supported content types (e.g., 'application/javascript+react') */
|
|
453
|
+
contentTypes: string[];
|
|
454
|
+
/** Available shell types (e.g., 'chat', 'fullscreen', 'spatial') */
|
|
455
|
+
shellTypes: string[];
|
|
456
|
+
/**
|
|
457
|
+
* Available component capabilities — informational catalog string list
|
|
458
|
+
* surfaced for discovery clients. The load-bearing per-app permission
|
|
459
|
+
* grant flows via `DataContract.clientCapabilities.gadgets[*].permission`
|
|
460
|
+
* (projected onto the bootstrap as `Permissions-Policy`); this field is
|
|
461
|
+
* not consulted at boot or dispatch time.
|
|
462
|
+
*/
|
|
463
|
+
componentCapabilities: string[];
|
|
464
|
+
/** App-specific configuration (present when the app is found in the database) */
|
|
465
|
+
app?: {
|
|
466
|
+
/** Adapters enabled for this app */
|
|
467
|
+
enabledAdapters: string[];
|
|
468
|
+
/** Component capabilities granted to this app */
|
|
469
|
+
grantedCapabilities: string[];
|
|
470
|
+
/** Default shell type for new sessions */
|
|
471
|
+
defaultShellType: string;
|
|
472
|
+
/** Authentication mode for end users */
|
|
473
|
+
authMode: string;
|
|
474
|
+
/** Rate limit in requests per minute (0 = unlimited) */
|
|
475
|
+
rateLimitPerMinute: number;
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Input for ggui_request_credential — request OAuth consent from the user.
|
|
480
|
+
* Called by agents when MCP proxy returns 401 (credential_required).
|
|
481
|
+
*/
|
|
482
|
+
export interface GguiRequestCredentialInput {
|
|
483
|
+
/** OAuth service ID (e.g., "bashdoor", "ubot") */
|
|
484
|
+
serviceId: string;
|
|
485
|
+
/** Why the agent needs this credential (shown to user) */
|
|
486
|
+
reason?: string;
|
|
487
|
+
/** Existing session to push consent UI into */
|
|
488
|
+
sessionId?: string;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Output from ggui_request_credential — consent result.
|
|
492
|
+
*/
|
|
493
|
+
export interface GguiRequestCredentialOutput {
|
|
494
|
+
/** Whether the user granted consent */
|
|
495
|
+
granted: boolean;
|
|
496
|
+
/** Grant mode (once or always) — only present when granted=true */
|
|
497
|
+
mode?: 'once' | 'always';
|
|
498
|
+
/** Service display info */
|
|
499
|
+
service?: {
|
|
500
|
+
name: string;
|
|
501
|
+
icon: string;
|
|
502
|
+
};
|
|
503
|
+
/** Reason for denial (timeout, user denied, error) */
|
|
504
|
+
reason?: string;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* MCP JSON-RPC request.
|
|
508
|
+
* Generic `TParams` defaults to {@link JsonObject} for the request parameters.
|
|
509
|
+
*/
|
|
510
|
+
export interface McpRequest<TParams = JsonObject> {
|
|
511
|
+
jsonrpc: '2.0';
|
|
512
|
+
id: string | number;
|
|
513
|
+
method: string;
|
|
514
|
+
params?: TParams;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* MCP JSON-RPC response.
|
|
518
|
+
* Generic `TResult` defaults to {@link JsonValue} to accept any JSON-safe result.
|
|
519
|
+
*/
|
|
520
|
+
export interface McpResponse<TResult = JsonValue> {
|
|
521
|
+
jsonrpc: '2.0';
|
|
522
|
+
id: string | number;
|
|
523
|
+
result?: TResult;
|
|
524
|
+
error?: McpError;
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* MCP error object.
|
|
528
|
+
* The `data` field is {@link JsonValue} to carry any JSON-safe diagnostic data.
|
|
529
|
+
*/
|
|
530
|
+
export interface McpError {
|
|
531
|
+
code: number;
|
|
532
|
+
message: string;
|
|
533
|
+
/** Additional error data. Typed as {@link JsonValue} (any JSON-safe value). */
|
|
534
|
+
data?: JsonValue;
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* MCP tool definition.
|
|
538
|
+
* Extends {@link JsonObject} for JSON serialization compatibility.
|
|
539
|
+
*/
|
|
540
|
+
export interface McpToolDefinition extends JsonObject {
|
|
541
|
+
name: string;
|
|
542
|
+
description: string;
|
|
543
|
+
inputSchema: {
|
|
544
|
+
type: 'object';
|
|
545
|
+
properties: Record<string, JsonSchema>;
|
|
546
|
+
required?: string[];
|
|
547
|
+
};
|
|
548
|
+
outputSchema?: {
|
|
549
|
+
type: 'object';
|
|
550
|
+
properties?: Record<string, JsonSchema>;
|
|
551
|
+
required?: string[];
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* MCP server info for initialize response.
|
|
556
|
+
* Extends {@link JsonObject} for JSON serialization compatibility.
|
|
557
|
+
*/
|
|
558
|
+
export interface McpServerInfo extends JsonObject {
|
|
559
|
+
name: string;
|
|
560
|
+
version: string;
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* MCP capabilities.
|
|
564
|
+
* Extends {@link JsonObject} for JSON serialization compatibility.
|
|
565
|
+
*/
|
|
566
|
+
export interface McpCapabilities extends JsonObject {
|
|
567
|
+
tools?: Record<string, never>;
|
|
568
|
+
}
|
|
569
|
+
export type GguiNewSessionInput = z.infer<typeof newSessionInputSchema>;
|
|
570
|
+
export type GguiNewSessionOutput = z.infer<typeof newSessionOutputSchema>;
|
|
571
|
+
export type GguiHandshakeInput = z.infer<typeof handshakeInputSchema>;
|
|
572
|
+
export type GguiHandshakeOutput = z.infer<typeof handshakeOutputSchema>;
|
|
573
|
+
/**
|
|
574
|
+
* Server-side stream-transport capability advertised on every successful
|
|
575
|
+
* `ggui_handshake` response (see {@link GguiHandshakeOutput.serverCapabilities}).
|
|
576
|
+
*
|
|
577
|
+
* Mirrors `handshakeOutputSchema.serverCapabilities` exactly — exported
|
|
578
|
+
* here as a named TypeScript type so server-side composition layers
|
|
579
|
+
* (the OSS `createGguiServer` resolver, the cloud pod composer) can hand
|
|
580
|
+
* one back to the handshake factory without re-deriving the shape from
|
|
581
|
+
* the schema.
|
|
582
|
+
*
|
|
583
|
+
* Semantics + transport-negotiation rules: see the inline docstring on
|
|
584
|
+
* `handshakeOutputSchema.serverCapabilities` in `schemas/mcp.ts`.
|
|
585
|
+
*
|
|
586
|
+
* Absent ⇒ universal iframe-polling fallback. Present ⇒ `@ggui-ai/wire`
|
|
587
|
+
* negotiates per channel against the allowlist.
|
|
588
|
+
*/
|
|
589
|
+
export interface ServerCapabilities {
|
|
590
|
+
/**
|
|
591
|
+
* WebSocket endpoint that fans out
|
|
592
|
+
* `streamSpec[ch].source.tool` results. Iframe opens this socket on
|
|
593
|
+
* bootstrap and sends a `channel_subscribe` frame per streamSpec entry
|
|
594
|
+
* whose `source.tool` is in {@link streamWebSocketLocalTools}.
|
|
595
|
+
*/
|
|
596
|
+
readonly streamWebSocket?: {
|
|
597
|
+
readonly url: string;
|
|
598
|
+
};
|
|
599
|
+
/**
|
|
600
|
+
* Whitelist of `source.tool` names the server can subscribe-for on
|
|
601
|
+
* {@link streamWebSocket}. Channels whose `source.tool` is in this
|
|
602
|
+
* set use the WebSocket subscribe path; channels whose source is
|
|
603
|
+
* elsewhere fall through to iframe polling.
|
|
604
|
+
*/
|
|
605
|
+
readonly streamWebSocketLocalTools?: readonly string[];
|
|
606
|
+
}
|
|
607
|
+
export type GguiPushInput = z.infer<typeof pushInputSchema>;
|
|
608
|
+
export type GguiPushOutput = z.infer<typeof pushOutputSchema>;
|
|
609
|
+
export type GguiUpdateInput = z.infer<typeof updateInputSchema>;
|
|
610
|
+
export type GguiUpdateOutput = z.infer<typeof updateOutputSchema>;
|
|
611
|
+
/**
|
|
612
|
+
* Core protocol error codes (per spec Section 7.9)
|
|
613
|
+
*/
|
|
614
|
+
export declare const MCP_ERROR_CODES: {
|
|
615
|
+
readonly PARSE_ERROR: -32700;
|
|
616
|
+
readonly INVALID_REQUEST: -32600;
|
|
617
|
+
readonly METHOD_NOT_FOUND: -32601;
|
|
618
|
+
readonly INVALID_PARAMS: -32602;
|
|
619
|
+
readonly INTERNAL_ERROR: -32603;
|
|
620
|
+
readonly UNAUTHORIZED: -32001;
|
|
621
|
+
readonly SESSION_NOT_FOUND: -32002;
|
|
622
|
+
readonly APP_NOT_FOUND: -32003;
|
|
623
|
+
readonly PRODUCTION_FAILED: -32004;
|
|
624
|
+
readonly CAPABILITY_DENIED: -32005;
|
|
625
|
+
};
|
|
626
|
+
/**
|
|
627
|
+
* Platform-specific error codes (-32010 range).
|
|
628
|
+
* These are ggui platform extensions, not part of the core protocol.
|
|
629
|
+
*/
|
|
630
|
+
export declare const PLATFORM_ERROR_CODES: {
|
|
631
|
+
readonly GENERATION_QUOTA_EXCEEDED: -32010;
|
|
632
|
+
readonly APP_LIMIT_EXCEEDED: -32011;
|
|
633
|
+
readonly CONCURRENT_SESSION_LIMIT: -32012;
|
|
634
|
+
readonly RATE_LIMIT_EXCEEDED: -32013;
|
|
635
|
+
readonly CONTRACT_VIOLATION: -32020;
|
|
636
|
+
};
|
|
637
|
+
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -0,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,OAAO,kBAAkB,CAAC,CAAC;AAMlE;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;CAYlB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;CAMvB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// MCP Error Codes
|
|
3
|
+
// =============================================================================
|
|
4
|
+
/**
|
|
5
|
+
* Core protocol error codes (per spec Section 7.9)
|
|
6
|
+
*/
|
|
7
|
+
export const MCP_ERROR_CODES = {
|
|
8
|
+
PARSE_ERROR: -32700,
|
|
9
|
+
INVALID_REQUEST: -32600,
|
|
10
|
+
METHOD_NOT_FOUND: -32601,
|
|
11
|
+
INVALID_PARAMS: -32602,
|
|
12
|
+
INTERNAL_ERROR: -32603,
|
|
13
|
+
// Protocol-specific error codes
|
|
14
|
+
UNAUTHORIZED: -32001,
|
|
15
|
+
SESSION_NOT_FOUND: -32002,
|
|
16
|
+
APP_NOT_FOUND: -32003,
|
|
17
|
+
PRODUCTION_FAILED: -32004,
|
|
18
|
+
CAPABILITY_DENIED: -32005,
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Platform-specific error codes (-32010 range).
|
|
22
|
+
* These are ggui platform extensions, not part of the core protocol.
|
|
23
|
+
*/
|
|
24
|
+
export const PLATFORM_ERROR_CODES = {
|
|
25
|
+
GENERATION_QUOTA_EXCEEDED: -32010,
|
|
26
|
+
APP_LIMIT_EXCEEDED: -32011,
|
|
27
|
+
CONCURRENT_SESSION_LIMIT: -32012,
|
|
28
|
+
RATE_LIMIT_EXCEEDED: -32013,
|
|
29
|
+
CONTRACT_VIOLATION: -32020,
|
|
30
|
+
};
|