@ggui-ai/protocol 0.2.0-alpha.3 → 0.3.0-rc.0

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.
Files changed (199) hide show
  1. package/README.md +16 -16
  2. package/dist/envelope-adapters.d.ts +6 -5
  3. package/dist/envelope-adapters.d.ts.map +1 -1
  4. package/dist/envelope-adapters.js +3 -3
  5. package/dist/envelopes/builders.d.ts +6 -32
  6. package/dist/envelopes/builders.d.ts.map +1 -1
  7. package/dist/envelopes/builders.js +3 -25
  8. package/dist/errors/version-mismatch.d.ts +1 -1
  9. package/dist/errors/version-mismatch.js +1 -1
  10. package/dist/gadgets/resolve-app-gadgets.d.ts +10 -0
  11. package/dist/gadgets/resolve-app-gadgets.d.ts.map +1 -0
  12. package/dist/gadgets/resolve-app-gadgets.js +19 -0
  13. package/dist/gadgets/resolve-contract-gadgets.d.ts +6 -6
  14. package/dist/gadgets/resolve-contract-gadgets.js +5 -5
  15. package/dist/gadgets/stdlib-gadgets.d.ts +1 -1
  16. package/dist/gadgets/stdlib-gadgets.d.ts.map +1 -1
  17. package/dist/gadgets/stdlib-gadgets.js +43 -22
  18. package/dist/iframe-bridge.d.ts +4 -43
  19. package/dist/iframe-bridge.d.ts.map +1 -1
  20. package/dist/iframe-bridge.js +4 -141
  21. package/dist/index.d.ts +60 -62
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +66 -61
  24. package/dist/integrations/mcp-apps.d.ts +83 -38
  25. package/dist/integrations/mcp-apps.d.ts.map +1 -1
  26. package/dist/integrations/mcp-apps.js +98 -52
  27. package/dist/recommended-prompts.d.ts +1 -1
  28. package/dist/recommended-prompts.js +1 -1
  29. package/dist/registry/blueprint-key.d.ts +3 -0
  30. package/dist/registry/blueprint-key.d.ts.map +1 -1
  31. package/dist/registry/blueprint-key.js +9 -0
  32. package/dist/registry/blueprint-stamp.d.ts +12 -0
  33. package/dist/registry/blueprint-stamp.d.ts.map +1 -0
  34. package/dist/registry/blueprint-stamp.js +12 -0
  35. package/dist/registry/canonicalize-contract.d.ts +31 -2
  36. package/dist/registry/canonicalize-contract.d.ts.map +1 -1
  37. package/dist/registry/canonicalize-contract.js +125 -13
  38. package/dist/registry/portable-blueprint.d.ts +64 -0
  39. package/dist/registry/portable-blueprint.d.ts.map +1 -0
  40. package/dist/registry/portable-blueprint.js +103 -0
  41. package/dist/registry/summarize-contract.d.ts +7 -2
  42. package/dist/registry/summarize-contract.d.ts.map +1 -1
  43. package/dist/registry/summarize-contract.js +12 -3
  44. package/dist/registry/variant-key.d.ts +17 -0
  45. package/dist/registry/variant-key.d.ts.map +1 -0
  46. package/dist/registry/variant-key.js +22 -0
  47. package/dist/schema-learning/derive-contract.d.ts +2 -2
  48. package/dist/schema-learning/derive-contract.js +2 -2
  49. package/dist/schema-learning/merge.d.ts.map +1 -1
  50. package/dist/schema-learning/merge.js +3 -2
  51. package/dist/schemas/app-theme.d.ts +38 -0
  52. package/dist/schemas/app-theme.d.ts.map +1 -0
  53. package/dist/schemas/app-theme.js +43 -0
  54. package/dist/schemas/blueprint.d.ts +30 -11
  55. package/dist/schemas/blueprint.d.ts.map +1 -1
  56. package/dist/schemas/blueprint.js +62 -26
  57. package/dist/schemas/data-contract.d.ts +28 -30
  58. package/dist/schemas/data-contract.d.ts.map +1 -1
  59. package/dist/schemas/data-contract.js +26 -26
  60. package/dist/schemas/handshake-suggestion.d.ts +2 -4
  61. package/dist/schemas/handshake-suggestion.d.ts.map +1 -1
  62. package/dist/schemas/handshake-suggestion.js +5 -14
  63. package/dist/schemas/mcp.d.ts +240 -58
  64. package/dist/schemas/mcp.d.ts.map +1 -1
  65. package/dist/schemas/mcp.js +285 -93
  66. package/dist/schemas/ops-blueprint.d.ts +12 -12
  67. package/dist/schemas/ops-blueprint.d.ts.map +1 -1
  68. package/dist/schemas/ops-blueprint.js +14 -24
  69. package/dist/screen-blueprints/define.d.ts +2 -2
  70. package/dist/screen-blueprints/match.d.ts +12 -7
  71. package/dist/screen-blueprints/match.d.ts.map +1 -1
  72. package/dist/screen-blueprints/match.js +7 -5
  73. package/dist/screen-blueprints/types.d.ts +14 -18
  74. package/dist/screen-blueprints/types.d.ts.map +1 -1
  75. package/dist/transport/websocket.d.ts +5 -26
  76. package/dist/transport/websocket.d.ts.map +1 -1
  77. package/dist/types/app-config.d.ts +0 -1
  78. package/dist/types/app-config.d.ts.map +1 -1
  79. package/dist/types/auth.d.ts +1 -46
  80. package/dist/types/auth.d.ts.map +1 -1
  81. package/dist/types/blueprint-source.d.ts +123 -0
  82. package/dist/types/blueprint-source.d.ts.map +1 -0
  83. package/dist/types/blueprint-source.js +126 -0
  84. package/dist/types/blueprint.d.ts +25 -18
  85. package/dist/types/blueprint.d.ts.map +1 -1
  86. package/dist/types/contract-inference.d.ts +2 -43
  87. package/dist/types/contract-inference.d.ts.map +1 -1
  88. package/dist/types/data-contract.d.ts +59 -344
  89. package/dist/types/data-contract.d.ts.map +1 -1
  90. package/dist/types/data-contract.js +5 -12
  91. package/dist/types/events.d.ts +31 -69
  92. package/dist/types/events.d.ts.map +1 -1
  93. package/dist/types/{render-event.d.ts → ggui-session-event.d.ts} +15 -15
  94. package/dist/types/ggui-session-event.d.ts.map +1 -0
  95. package/dist/types/{render-event.js → ggui-session-event.js} +5 -5
  96. package/dist/types/handshake-suggestion.d.ts +60 -40
  97. package/dist/types/handshake-suggestion.d.ts.map +1 -1
  98. package/dist/types/host-context.d.ts +8 -8
  99. package/dist/types/host-context.d.ts.map +1 -1
  100. package/dist/types/host-context.js +5 -5
  101. package/dist/types/invoke.d.ts +1 -13
  102. package/dist/types/invoke.d.ts.map +1 -1
  103. package/dist/types/{canvas-lifecycle.d.ts → lifecycle.d.ts} +35 -37
  104. package/dist/types/lifecycle.d.ts.map +1 -0
  105. package/dist/types/{canvas-lifecycle.js → lifecycle.js} +12 -14
  106. package/dist/types/live-channel.d.ts +48 -104
  107. package/dist/types/live-channel.d.ts.map +1 -1
  108. package/dist/types/llm.d.ts +13 -24
  109. package/dist/types/llm.d.ts.map +1 -1
  110. package/dist/types/llm.js +23 -53
  111. package/dist/types/mcp.d.ts +55 -176
  112. package/dist/types/mcp.d.ts.map +1 -1
  113. package/dist/types/mcp.js +2 -2
  114. package/dist/types/oauth-user-id.d.ts +12 -0
  115. package/dist/types/oauth-user-id.d.ts.map +1 -0
  116. package/dist/types/oauth-user-id.js +10 -0
  117. package/dist/types/portable-blueprint.d.ts +53 -0
  118. package/dist/types/portable-blueprint.d.ts.map +1 -0
  119. package/dist/types/portable-blueprint.js +8 -0
  120. package/dist/types/{session.d.ts → render.d.ts} +51 -53
  121. package/dist/types/render.d.ts.map +1 -0
  122. package/dist/types/thread.d.ts.map +1 -1
  123. package/dist/types/thread.js +3 -3
  124. package/dist/types/ui-generator.d.ts +5 -46
  125. package/dist/types/ui-generator.d.ts.map +1 -1
  126. package/dist/types/ui-generator.js +1 -53
  127. package/dist/validation/ajv-runtime.d.ts +3 -3
  128. package/dist/validation/ajv-runtime.d.ts.map +1 -1
  129. package/dist/validation/ajv-runtime.js +6 -5
  130. package/dist/validation/contract-validator.d.ts +23 -22
  131. package/dist/validation/contract-validator.d.ts.map +1 -1
  132. package/dist/validation/contract-validator.js +28 -26
  133. package/dist/validation/cross-references.d.ts +3 -3
  134. package/dist/validation/cross-references.js +3 -3
  135. package/dist/validation/hygiene-rules.d.ts +13 -10
  136. package/dist/validation/hygiene-rules.d.ts.map +1 -1
  137. package/dist/validation/hygiene-rules.js +20 -14
  138. package/dist/validation/is-record.d.ts +17 -0
  139. package/dist/validation/is-record.d.ts.map +1 -0
  140. package/dist/validation/is-record.js +18 -0
  141. package/dist/validation/lint-contract.d.ts +9 -8
  142. package/dist/validation/lint-contract.d.ts.map +1 -1
  143. package/dist/validation/lint-contract.js +89 -26
  144. package/dist/validation/name-invariants.d.ts +4 -4
  145. package/dist/validation/name-invariants.js +4 -4
  146. package/dist/validation/reserved-channels.d.ts +43 -46
  147. package/dist/validation/reserved-channels.d.ts.map +1 -1
  148. package/dist/validation/reserved-channels.js +14 -177
  149. package/dist/validation/resolve-stream-channel.d.ts +3 -9
  150. package/dist/validation/resolve-stream-channel.d.ts.map +1 -1
  151. package/dist/validation/resolve-stream-channel.js +3 -4
  152. package/dist/validation/sanitize-error.d.ts +10 -9
  153. package/dist/validation/sanitize-error.d.ts.map +1 -1
  154. package/dist/validation/sanitize-error.js +19 -18
  155. package/dist/validation/schema-compat-invariants.d.ts +1 -1
  156. package/dist/validation/schema-compat-invariants.js +3 -3
  157. package/dist/validation/schema-meta-validation.d.ts +21 -8
  158. package/dist/validation/schema-meta-validation.d.ts.map +1 -1
  159. package/dist/validation/schema-meta-validation.js +28 -14
  160. package/dist/validation/schema-subset.d.ts +9 -8
  161. package/dist/validation/schema-subset.d.ts.map +1 -1
  162. package/dist/validation/ui-security.d.ts +0 -17
  163. package/dist/validation/ui-security.d.ts.map +1 -1
  164. package/dist/validation/ui-security.js +17 -22
  165. package/dist/validation/zod-to-json-schema.d.ts +1 -1
  166. package/dist/validation/zod-to-json-schema.d.ts.map +1 -1
  167. package/dist/validation/zod-to-json-schema.js +4 -3
  168. package/dist/version.d.ts +783 -9
  169. package/dist/version.d.ts.map +1 -1
  170. package/dist/version.js +782 -8
  171. package/package.json +2 -2
  172. package/dist/bridge/invoke-agent.d.ts +0 -65
  173. package/dist/bridge/invoke-agent.d.ts.map +0 -1
  174. package/dist/bridge/invoke-agent.js +0 -113
  175. package/dist/stream/stream-parser.d.ts +0 -62
  176. package/dist/stream/stream-parser.d.ts.map +0 -1
  177. package/dist/stream/stream-parser.js +0 -199
  178. package/dist/types/canvas-lifecycle.d.ts.map +0 -1
  179. package/dist/types/credential.d.ts +0 -41
  180. package/dist/types/credential.d.ts.map +0 -1
  181. package/dist/types/credential.js +0 -32
  182. package/dist/types/data-bindings.d.ts +0 -322
  183. package/dist/types/data-bindings.d.ts.map +0 -1
  184. package/dist/types/data-bindings.js +0 -29
  185. package/dist/types/feedback.d.ts +0 -22
  186. package/dist/types/feedback.d.ts.map +0 -1
  187. package/dist/types/feedback.js +0 -7
  188. package/dist/types/mcp-proxy.d.ts +0 -67
  189. package/dist/types/mcp-proxy.d.ts.map +0 -1
  190. package/dist/types/mcp-proxy.js +0 -46
  191. package/dist/types/openrouter-models.d.ts +0 -23
  192. package/dist/types/openrouter-models.d.ts.map +0 -1
  193. package/dist/types/openrouter-models.js +0 -4843
  194. package/dist/types/region.d.ts +0 -26
  195. package/dist/types/region.d.ts.map +0 -1
  196. package/dist/types/region.js +0 -36
  197. package/dist/types/render-event.d.ts.map +0 -1
  198. package/dist/types/session.d.ts.map +0 -1
  199. /package/dist/types/{session.js → render.js} +0 -0
package/dist/types/llm.js CHANGED
@@ -32,32 +32,23 @@
32
32
  * https://ai.google.dev/gemini-api/docs/pricing
33
33
  */
34
34
  // =============================================================================
35
- // Provider display metadata
36
- // =============================================================================
37
- /**
38
- * Display metadata keyed by `LlmProvider`. The `bedrock` entry is
39
- * synthesized for UI continuity — operators picking a bedrock route
40
- * still see a label. Pricing/key-prefix conventions for bedrock are
41
- * AWS-IAM driven and don't follow the API-key prefix shape.
42
- */
43
- export const PROVIDER_INFO = {
44
- anthropic: { displayName: "Anthropic", keyPrefix: "sk-ant-" },
45
- google: { displayName: "Google AI", keyPrefix: "AIza" },
46
- openai: { displayName: "OpenAI", keyPrefix: "sk-" },
47
- openrouter: { displayName: "OpenRouter", keyPrefix: "sk-or-" },
48
- bedrock: { displayName: "AWS Bedrock", keyPrefix: "" },
49
- };
50
- // =============================================================================
51
35
  // Model Registry — verified pricing March 2026
52
36
  // =============================================================================
53
37
  export const MODEL_REGISTRY = {
54
38
  // ── Anthropic Claude ──────────────────────────────────────────────
39
+ // Default generation model (ui-gen's default engine; see
40
+ // DEFAULT_MODEL below). Hosted pools default here too.
55
41
  "anthropic/claude-haiku-4-5": {
56
42
  id: "anthropic/claude-haiku-4-5",
57
43
  provider: "anthropic",
58
44
  displayName: "Claude Haiku 4.5",
59
45
  tier: "fast",
60
- costs: { inputPer1M: 1.0, outputPer1M: 5.0 },
46
+ costs: {
47
+ inputPer1M: 1.0,
48
+ outputPer1M: 5.0,
49
+ cacheWritePer1M: 1.25,
50
+ cacheReadPer1M: 0.1,
51
+ },
61
52
  maxTokens: 200000,
62
53
  supportsTools: true,
63
54
  },
@@ -66,7 +57,12 @@ export const MODEL_REGISTRY = {
66
57
  provider: "anthropic",
67
58
  displayName: "Claude Sonnet 4.6",
68
59
  tier: "balanced",
69
- costs: { inputPer1M: 3.0, outputPer1M: 15.0 },
60
+ costs: {
61
+ inputPer1M: 3.0,
62
+ outputPer1M: 15.0,
63
+ cacheWritePer1M: 3.75,
64
+ cacheReadPer1M: 0.3,
65
+ },
70
66
  maxTokens: 200000,
71
67
  supportsTools: true,
72
68
  },
@@ -75,12 +71,16 @@ export const MODEL_REGISTRY = {
75
71
  provider: "anthropic",
76
72
  displayName: "Claude Opus 4.6",
77
73
  tier: "premium",
78
- costs: { inputPer1M: 5.0, outputPer1M: 25.0 },
74
+ costs: {
75
+ inputPer1M: 5.0,
76
+ outputPer1M: 25.0,
77
+ cacheWritePer1M: 6.25,
78
+ cacheReadPer1M: 0.5,
79
+ },
79
80
  maxTokens: 1000000,
80
81
  supportsTools: true,
81
82
  },
82
83
  // ── Google Gemini (API requires "-preview" suffix for previews) ──
83
- // Default generation model.
84
84
  // Pricing values mirror LiteLLM upstream
85
85
  // (https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json);
86
86
  // host-side consumers may apply a more authoritative price table
@@ -95,8 +95,9 @@ export const MODEL_REGISTRY = {
95
95
  supportsTools: true,
96
96
  supportsCaching: true,
97
97
  },
98
- "gemini/gemini-3.1-flash-lite-preview": {
99
- id: "gemini/gemini-3.1-flash-lite-preview",
98
+ // Google-lane reference model (cost-per-token floor).
99
+ "gemini/gemini-3.1-flash-lite": {
100
+ id: "gemini/gemini-3.1-flash-lite",
100
101
  provider: "google",
101
102
  displayName: "Gemini 3.1 Flash Lite",
102
103
  tier: "fast",
@@ -164,34 +165,3 @@ export const MODEL_REGISTRY = {
164
165
  * Default model for generation
165
166
  */
166
167
  export const DEFAULT_MODEL = "anthropic/claude-haiku-4-5";
167
- // =============================================================================
168
- // Helper Functions
169
- // =============================================================================
170
- export function isValidModelId(id) {
171
- return id in MODEL_REGISTRY;
172
- }
173
- /**
174
- * Get all model IDs for a given provider.
175
- */
176
- export function getModelsForProvider(provider) {
177
- return Object.values(MODEL_REGISTRY)
178
- .filter((m) => m.provider === provider)
179
- .map((m) => m.id);
180
- }
181
- /**
182
- * Get all model IDs for a given tier.
183
- */
184
- export function getModelsForTier(tier) {
185
- return Object.values(MODEL_REGISTRY)
186
- .filter((m) => m.tier === tier)
187
- .map((m) => m.id);
188
- }
189
- /**
190
- * Select the default model for a given tier.
191
- */
192
- export function selectModelByTier(tier) {
193
- const models = getModelsForTier(tier);
194
- // Prefer Anthropic models as default
195
- const anthropic = models.find((m) => m.startsWith("anthropic/"));
196
- return anthropic ?? models[0] ?? DEFAULT_MODEL;
197
- }
@@ -1,8 +1,8 @@
1
1
  import type { z } from 'zod';
2
- import type { DataContract, JsonObject, JsonSchema, JsonValue } from './data-contract';
3
- import type { Render, RenderStatus } from './session';
4
- import type { handshakeInputSchema, handshakeOutputSchema, renderInputSchema, renderOutputSchema, updateInputSchema, updateOutputSchema } from '../schemas/mcp';
5
- export type { RenderStatus } from './session';
2
+ import type { JsonObject, JsonSchema, JsonValue } from './data-contract';
3
+ import type { GguiSession, GguiSessionStatus } from './render';
4
+ import type { consumeInputSchema, getSessionInputSchema, handshakeInputSchema, handshakeOutputSchema, renderBlueprintInputSchema, renderCacheMarkerSchema, renderInputSchema, renderOutputSchema, requestCredentialInputSchema, searchBlueprintsInputSchema, updateInputSchema, updateOutputSchema, declareToolCatalogOutputSchema } from '../schemas/mcp';
5
+ export type { GguiSessionStatus } from './render';
6
6
  /** Target screen size category for responsive layout */
7
7
  export type Screen = 'mobile' | 'tablet' | 'desktop' | 'universal';
8
8
  /**
@@ -12,9 +12,9 @@ export type Screen = 'mobile' | 'tablet' | 'desktop' | 'universal';
12
12
  * is the render-scoped monotonic assigned at ingestion; it sits on the
13
13
  * row wrapper so consumers can detect gaps without parsing the payload.
14
14
  *
15
- * **Storage note**: the envelope is stored as either a JSON object
16
- * (direct DDB writes) or a JSON-stringified object (AppSync `a.json()`
17
- * semantics). Consume readers MUST accept both — see
15
+ * **Storage note**: the envelope is stored as either a JSON object or
16
+ * a JSON-stringified object, depending on how the deployment's storage
17
+ * layer serializes rows. Consume readers MUST accept both — see
18
18
  * {@link parsePendingEnvelope}.
19
19
  */
20
20
  export interface PendingEvent {
@@ -27,8 +27,8 @@ export interface PendingEvent {
27
27
  */
28
28
  envelope: ConsumeEventEntry | string;
29
29
  /**
30
- * Render-scoped monotonic sequence assigned at ingestion. Mirrors
31
- * `Render.eventSequence` at the moment this row was appended so
30
+ * GguiSession-scoped monotonic sequence assigned at ingestion. Mirrors
31
+ * `GguiSession.eventSequence` at the moment this row was appended so
32
32
  * consumers can detect gaps without reading render state.
33
33
  */
34
34
  sequence: number;
@@ -39,8 +39,8 @@ export interface PendingEvent {
39
39
  * Input for ggui_consume tool — long-poll for buffered events on a
40
40
  * specific render.
41
41
  *
42
- * Keyed by `renderId`. The agent gets `renderId` from
43
- * `renderOutput.renderId`.
42
+ * Keyed by `sessionId`. The agent gets `sessionId` from
43
+ * `renderOutput.sessionId`.
44
44
  *
45
45
  * Default semantic: long-poll, return on first event or server-default
46
46
  * timeout. Agent loops by re-calling. There is no `until` parameter —
@@ -51,23 +51,12 @@ export interface PendingEvent {
51
51
  * captured at gesture time on the iframe; the top-level
52
52
  * `contextSnapshot` is intentionally absent from the output (see
53
53
  * {@link GguiConsumeOutput} / {@link ConsumeEventEntry}).
54
+ *
55
+ * Derived from `consumeInputSchema` — the schema (SPEC §7.3 timeout
56
+ * bound: integer seconds in `[0, 25]`, default 0 = immediate) is the
57
+ * source of truth.
54
58
  */
55
- export interface GguiConsumeInput {
56
- /**
57
- * Render to consume events from. Globally unique (UUID).
58
- * Cross-tenant access surfaces uniformly as `render_not_found`.
59
- */
60
- renderId: string;
61
- /**
62
- * Timeout in seconds for long-poll. Server-side wall-clock cap.
63
- * - 0: immediate return (no waiting)
64
- * - 1-25: synchronous long-poll (HTTP API, capped by 30s gateway limit)
65
- * - 26-900: SSE streaming via server-sent events (up to 15 min)
66
- * The MCP client SDK routes to the appropriate endpoint automatically.
67
- * Default: 0 (immediate).
68
- */
69
- timeout?: number;
70
- }
59
+ export type GguiConsumeInput = z.infer<typeof consumeInputSchema>;
71
60
  /**
72
61
  * Input for `ggui_emit` — emit a new delivery on a declared channel of the
73
62
  * render's `streamSpec`.
@@ -77,7 +66,7 @@ export interface GguiConsumeInput {
77
66
  *
78
67
  * Fields the agent MUST NOT supply:
79
68
  * - `mode` — derived from `streamSpec[channel].mode` (default `'append'`).
80
- * - `seq` — server-assigned via `RenderStreamBuffer`.
69
+ * - `seq` — server-assigned via `GguiSessionStreamBuffer`.
81
70
  * - `timestamp` — server clock.
82
71
  * - `connectionId` / transport details — fan-out plumbing.
83
72
  *
@@ -85,8 +74,8 @@ export interface GguiConsumeInput {
85
74
  * guarded by `types.test.ts`.
86
75
  */
87
76
  export interface GguiEmitInput<TPayload = JsonValue> {
88
- /** Render to stream to. Server enforces app-ownership. */
89
- renderId: string;
77
+ /** GguiSession to stream to. Server enforces app-ownership. */
78
+ sessionId: string;
90
79
  /**
91
80
  * Channel name. MUST be declared on the resolved render's
92
81
  * `streamSpec`. Undeclared channels are rejected at call time.
@@ -120,52 +109,22 @@ export interface GguiEmitOutput {
120
109
  /** True when the server accepted the delivery at the boundary. */
121
110
  accepted: boolean;
122
111
  /**
123
- * Render-scoped monotonic outbound sequence assigned to this
112
+ * GguiSession-scoped monotonic outbound sequence assigned to this
124
113
  * delivery. Omitted on implementations without a
125
- * `RenderStreamBuffer` (hosted cloud today); required on OSS
114
+ * `GguiSessionStreamBuffer` (hosted cloud today); required on OSS
126
115
  * `@ggui-ai/mcp-server`.
127
116
  */
128
117
  seq?: number;
129
118
  }
130
119
  /**
131
- * Input for ggui_get_render tool - retrieves render state
120
+ * Input for ggui_get_session tool — retrieves render state.
121
+ * Derived from `getSessionInputSchema`.
132
122
  */
133
- export interface GguiGetRenderInput {
134
- /** Render ID to get state for */
135
- renderId: string;
136
- }
123
+ export type GguiGetSessionInput = z.infer<typeof getSessionInputSchema>;
137
124
  /**
138
- * Output from ggui_get_render tool — full render snapshot.
125
+ * Output from ggui_get_session tool — full render snapshot.
139
126
  */
140
- export type GguiGetRenderOutput = Render;
141
- /** Negotiator's decision on what UI to show. */
142
- export interface NegotiatorDecision {
143
- /** What to do with the render. */
144
- action: 'create' | 'update' | 'compose' | 'replace';
145
- /** Why — visible to the agent. */
146
- reasoning: string;
147
- /** Matched blueprint (if any). */
148
- blueprintId?: string;
149
- /** The agreed data contract. */
150
- contract: DataContract;
151
- /** For update/compose/replace — which render to target. */
152
- targetRenderId?: string;
153
- /** UI adaptations based on user context. */
154
- adaptations?: {
155
- fontSize?: 'compact' | 'default' | 'large';
156
- density?: 'dense' | 'default' | 'spacious';
157
- complexity?: 'simplified' | 'default' | 'detailed';
158
- };
159
- }
160
- /** Alternative option (shown in suggestive/passive modes). */
161
- export interface NegotiatorAlternative {
162
- id: string;
163
- type: 'blueprint' | 'brainstorm';
164
- description: string;
165
- blueprintId?: string;
166
- contract?: DataContract;
167
- renderTime: 'instant' | 'standard';
168
- }
127
+ export type GguiGetSessionOutput = GguiSession;
169
128
  /**
170
129
  * Per-event entry returned by `ggui_consume`. The shape written by
171
130
  * `ggui_runtime_submit_action`'s `kind:'dispatch'` handler onto the
@@ -179,15 +138,15 @@ export interface NegotiatorAlternative {
179
138
  * have mutated by the time consume returns.
180
139
  *
181
140
  * Distinct from the inbound live-channel `ActionEnvelope` (which has
182
- * `{renderId, type, payload?, ...}` and lives on the WebSocket inbound
141
+ * `{sessionId, type, payload?, ...}` and lives on the WebSocket inbound
183
142
  * seam) — consume reads from a separate render-scoped pipe whose entries
184
143
  * originate at `submit_action`.
185
144
  */
186
145
  export interface ConsumeEventEntry {
187
146
  /** Stable discriminator — always the literal `'action'`. */
188
147
  readonly type: 'action';
189
- /** Render the gesture targeted. */
190
- readonly renderId: string;
148
+ /** GguiSession the gesture targeted. */
149
+ readonly sessionId: string;
191
150
  /** Which `actionSpec[*]` entry the iframe dispatched against. */
192
151
  readonly intent: string;
193
152
  /**
@@ -221,9 +180,9 @@ export interface ConsumeEventEntry {
221
180
  export interface GguiConsumeOutput {
222
181
  /** Buffered consume-entries (cleared after return). */
223
182
  events: ConsumeEventEntry[];
224
- /** Render status — `'expired'` means the render's TTL elapsed and
183
+ /** GguiSession status — `'expired'` means the GguiSession's TTL elapsed and
225
184
  * no more events will arrive; the agent's long-poll loop terminates. */
226
- status: RenderStatus;
185
+ status: GguiSessionStatus;
227
186
  /**
228
187
  * Client-side observations echoed back to the agent. Same shape
229
188
  * `ggui_handshake` exposes. Lets the agent pick up mid-render
@@ -236,54 +195,10 @@ export interface GguiConsumeOutput {
236
195
  };
237
196
  }
238
197
  /**
239
- * Input for ggui_list_featured_blueprints tool - discovers available UI blueprints
198
+ * Input for ggui_search_blueprints tool — semantic search over
199
+ * blueprints. Derived from `searchBlueprintsInputSchema`.
240
200
  */
241
- export interface GguiListFeaturedBlueprintsInput {
242
- /** Filter by component level. Canonical four-level hierarchy:
243
- * `primitive` (Button) → `component` (SearchField) → `composite`
244
- * (LoginForm, Modal) → `template` (ListDetail, Dashboard page). */
245
- level?: 'primitive' | 'component' | 'composite' | 'template';
246
- /** Filter by category */
247
- category?: string;
248
- /** Filter by tags (any match) */
249
- tags?: string[];
250
- /** Max results (default: 50) */
251
- limit?: number;
252
- }
253
- /**
254
- * Output from ggui_list_featured_blueprints tool
255
- */
256
- export interface GguiListFeaturedBlueprintsOutput {
257
- /** List of matching blueprints */
258
- blueprints: Array<{
259
- id: string;
260
- name: string;
261
- source: 'predefined' | 'cached';
262
- description: string;
263
- category: string;
264
- level: string;
265
- props: Array<{
266
- name: string;
267
- type: string;
268
- required: boolean;
269
- description: string;
270
- }>;
271
- examples: string[];
272
- tags: string[];
273
- usageCount?: number;
274
- }>;
275
- /** Total number of matching blueprints */
276
- total: number;
277
- }
278
- /**
279
- * Input for ggui_search_blueprints tool - semantic search over blueprints
280
- */
281
- export interface GguiSearchBlueprintsInput {
282
- /** Natural language description of the UI you're looking for */
283
- query: string;
284
- /** Max results (default: 10) */
285
- limit?: number;
286
- }
201
+ export type GguiSearchBlueprintsInput = z.infer<typeof searchBlueprintsInputSchema>;
287
202
  /**
288
203
  * Output from ggui_search_blueprints tool
289
204
  */
@@ -301,7 +216,7 @@ export interface GguiSearchBlueprintsOutput {
301
216
  description: string;
302
217
  }>;
303
218
  callbacks: string[];
304
- /** Whether this is a featured/predefined blueprint (curated by the app developer) */
219
+ /** Whether this is a featured blueprint (curated by the app developer) */
305
220
  featured: boolean;
306
221
  relevance: 'match';
307
222
  /** Cosine similarity score (0-1). Higher = better match. Agents can use this
@@ -314,15 +229,10 @@ export interface GguiSearchBlueprintsOutput {
314
229
  query: string;
315
230
  }
316
231
  /**
317
- * Input for ggui_render_blueprint tool - renders a specific blueprint.
318
- * Generic `TProps` defaults to {@link JsonObject} for blueprint props.
232
+ * Input for ggui_render_blueprint tool — renders a specific blueprint.
233
+ * Derived from `renderBlueprintInputSchema`.
319
234
  */
320
- export interface GguiRenderBlueprintInput<TProps = JsonObject> {
321
- /** Blueprint ID to render */
322
- blueprintId: string;
323
- /** Props to pass to the blueprint */
324
- props?: TProps;
325
- }
235
+ export type GguiRenderBlueprintInput = z.infer<typeof renderBlueprintInputSchema>;
326
236
  /**
327
237
  * Output from ggui_render_blueprint tool.
328
238
  *
@@ -349,56 +259,12 @@ export interface GguiRenderBlueprintOutput {
349
259
  */
350
260
  contentType: string;
351
261
  }
352
- /**
353
- * Input for ggui_discover tool - discovers platform capabilities
354
- */
355
- export interface GguiDiscoverInput {
356
- }
357
- /**
358
- * Output from ggui_discover tool - platform capabilities and app configuration
359
- */
360
- export interface GguiDiscoverOutput {
361
- /** Protocol version (e.g., 'draft-2026-04-19'). Prelaunch drafts use
362
- * `draft-YYYY-MM-DD`; the first frozen release will be `1.0.0`. */
363
- protocolVersion: string;
364
- /** Supported content types (e.g., 'application/javascript+react') */
365
- contentTypes: string[];
366
- /** Available shell types (e.g., 'chat', 'fullscreen', 'spatial') */
367
- shellTypes: string[];
368
- /**
369
- * Available component capabilities — informational catalog string list
370
- * surfaced for discovery clients. The load-bearing per-app permission
371
- * grant flows via `DataContract.clientCapabilities.gadgets[*].permission`
372
- * (projected onto the bootstrap as `Permissions-Policy`); this field is
373
- * not consulted at boot or dispatch time.
374
- */
375
- componentCapabilities: string[];
376
- /** App-specific configuration (present when the app is found in the database) */
377
- app?: {
378
- /** Adapters enabled for this app */
379
- enabledAdapters: string[];
380
- /** Component capabilities granted to this app */
381
- grantedCapabilities: string[];
382
- /** Default shell type for new renders */
383
- defaultShellType: string;
384
- /** Authentication mode for end users */
385
- authMode: string;
386
- /** Rate limit in requests per minute (0 = unlimited) */
387
- rateLimitPerMinute: number;
388
- };
389
- }
390
262
  /**
391
263
  * Input for ggui_request_credential — request OAuth consent from the user.
392
264
  * Called by agents when MCP proxy returns 401 (credential_required).
265
+ * Derived from `requestCredentialInputSchema`.
393
266
  */
394
- export interface GguiRequestCredentialInput {
395
- /** OAuth service ID (e.g., "bashdoor", "ubot") */
396
- serviceId: string;
397
- /** Why the agent needs this credential (shown to user) */
398
- reason?: string;
399
- /** Existing render to push consent UI into */
400
- renderId?: string;
401
- }
267
+ export type GguiRequestCredentialInput = z.infer<typeof requestCredentialInputSchema>;
402
268
  /**
403
269
  * Output from ggui_request_credential — consent result.
404
270
  */
@@ -516,8 +382,21 @@ export interface ServerCapabilities {
516
382
  }
517
383
  export type GguiRenderInput = z.infer<typeof renderInputSchema>;
518
384
  export type GguiRenderOutput = z.infer<typeof renderOutputSchema>;
385
+ /**
386
+ * Reuse outcome surfaced on a single `ggui_render`. Derived from
387
+ * {@link renderCacheMarkerSchema} — the schema is the source of truth.
388
+ */
389
+ export type RenderCacheMarker = z.infer<typeof renderCacheMarkerSchema>;
519
390
  export type GguiUpdateInput = z.infer<typeof updateInputSchema>;
520
391
  export type GguiUpdateOutput = z.infer<typeof updateOutputSchema>;
392
+ /**
393
+ * `ggui_runtime_declare_tool_catalog` output. Derived from
394
+ * {@link declareToolCatalogOutputSchema} — the schema is the source of
395
+ * truth. See `declareToolCatalogInputSchema` for the
396
+ * canonical-tool-identity rationale (handlers consume that schema
397
+ * directly; no separate Input type alias is published).
398
+ */
399
+ export type DeclareToolCatalogOutput = z.infer<typeof declareToolCatalogOutputSchema>;
521
400
  /**
522
401
  * Core protocol error codes (per spec Section 7.9)
523
402
  */
@@ -528,7 +407,7 @@ export declare const MCP_ERROR_CODES: {
528
407
  readonly INVALID_PARAMS: -32602;
529
408
  readonly INTERNAL_ERROR: -32603;
530
409
  readonly UNAUTHORIZED: -32001;
531
- readonly RENDER_NOT_FOUND: -32002;
410
+ readonly SESSION_NOT_FOUND: -32002;
532
411
  readonly APP_NOT_FOUND: -32003;
533
412
  readonly PRODUCTION_FAILED: -32004;
534
413
  readonly CAPABILITY_DENIED: -32005;
@@ -540,7 +419,7 @@ export declare const MCP_ERROR_CODES: {
540
419
  export declare const PLATFORM_ERROR_CODES: {
541
420
  readonly GENERATION_QUOTA_EXCEEDED: -32010;
542
421
  readonly APP_LIMIT_EXCEEDED: -32011;
543
- readonly CONCURRENT_RENDER_LIMIT: -32012;
422
+ readonly CONCURRENT_SESSION_LIMIT: -32012;
544
423
  readonly RATE_LIMIT_EXCEEDED: -32013;
545
424
  readonly CONTRACT_VIOLATION: -32020;
546
425
  };
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/types/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE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,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE;QACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;KACtB,CAAC;IACF;;;;;OAKG;IACH,QAAQ,CAAC,yBAAyB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACxD;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAElE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAMtF;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;CAYlB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;CAMvB,CAAC"}
package/dist/types/mcp.js CHANGED
@@ -12,7 +12,7 @@ export const MCP_ERROR_CODES = {
12
12
  INTERNAL_ERROR: -32603,
13
13
  // Protocol-specific error codes
14
14
  UNAUTHORIZED: -32001,
15
- RENDER_NOT_FOUND: -32002,
15
+ SESSION_NOT_FOUND: -32002,
16
16
  APP_NOT_FOUND: -32003,
17
17
  PRODUCTION_FAILED: -32004,
18
18
  CAPABILITY_DENIED: -32005,
@@ -24,7 +24,7 @@ export const MCP_ERROR_CODES = {
24
24
  export const PLATFORM_ERROR_CODES = {
25
25
  GENERATION_QUOTA_EXCEEDED: -32010,
26
26
  APP_LIMIT_EXCEEDED: -32011,
27
- CONCURRENT_RENDER_LIMIT: -32012,
27
+ CONCURRENT_SESSION_LIMIT: -32012,
28
28
  RATE_LIMIT_EXCEEDED: -32013,
29
29
  CONTRACT_VIOLATION: -32020,
30
30
  };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Canonical user-id namespace for an externally-issued identity:
3
+ * `'<providerId>:<providerSubject>'`. One definition shared by the
4
+ * OAuth-login routes and the OIDC verify adapter so every consumer
5
+ * computes the same id. Collision-safe vs raw provider subjects that
6
+ * carry no `:` prefix.
7
+ */
8
+ export declare function composeOAuthUserId(input: {
9
+ readonly providerId: string;
10
+ readonly providerSubject: string;
11
+ }): string;
12
+ //# sourceMappingURL=oauth-user-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-user-id.d.ts","sourceRoot":"","sources":["../../src/types/oauth-user-id.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC,GAAG,MAAM,CAET"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Canonical user-id namespace for an externally-issued identity:
3
+ * `'<providerId>:<providerSubject>'`. One definition shared by the
4
+ * OAuth-login routes and the OIDC verify adapter so every consumer
5
+ * computes the same id. Collision-safe vs raw provider subjects that
6
+ * carry no `:` prefix.
7
+ */
8
+ export function composeOAuthUserId(input) {
9
+ return `${input.providerId}:${input.providerSubject}`;
10
+ }
@@ -0,0 +1,53 @@
1
+ import type { DataContract } from "./data-contract.js";
2
+ import type { BlueprintVariance } from "./blueprint.js";
3
+ import type { BlueprintSource } from "./blueprint-source.js";
4
+ /**
5
+ * Current `PortableBlueprint` record schema version. v2 (2026-06) made
6
+ * provenance non-negotiable: `source` + `generatorProtocolVersion` are
7
+ * required. v1 records are REJECTED by importers — a rejected seed
8
+ * entry is just a cold-gen, so the fix is to re-export the pool, never
9
+ * to coerce.
10
+ */
11
+ export declare const PORTABLE_BLUEPRINT_SCHEMA_VERSION = 2;
12
+ /**
13
+ * One self-contained, JSON-serializable blueprint record in a
14
+ * distributable shared-pool artifact. A blueprint is a COMPLETED
15
+ * TEMPLATE (a whole generated UI keyed by a contract) — not a
16
+ * component — so there is no `kind`/atomic-taxonomy field; that
17
+ * taxonomy belongs to the separate component library. Carries the
18
+ * component code inline (the stored Blueprint references code by hash;
19
+ * the artifact must travel with the bytes). `contractHash` /
20
+ * `variantKey` are shipped for diagnostics + integrity and are
21
+ * recomputed on load.
22
+ */
23
+ export interface PortableBlueprint {
24
+ readonly schemaVersion: typeof PORTABLE_BLUEPRINT_SCHEMA_VERSION;
25
+ readonly contract: DataContract;
26
+ readonly componentCode: string;
27
+ readonly variance: BlueprintVariance;
28
+ readonly contractHash: string;
29
+ readonly variantKey: string;
30
+ /**
31
+ * Provenance of the component code. Required — an artifact that
32
+ * cannot say where its code came from is rejected at import, not
33
+ * tolerated as "unlabeled".
34
+ */
35
+ readonly source: BlueprintSource;
36
+ /**
37
+ * Generator era at export time (`PROTOCOL_VERSION`). Required —
38
+ * importers reject blueprints whose generator era is incompatible
39
+ * with theirs rather than serve code generated against a different
40
+ * protocol shape.
41
+ */
42
+ readonly generatorProtocolVersion: string;
43
+ /**
44
+ * SHA256(16) of the tool-identity catalog used to canonicalize
45
+ * `contract` at export. Importers re-canonicalize against their own
46
+ * catalog and recompute the key; a divergence means the same intent
47
+ * would mis-key and silently cold-gen — so it is rejected. Optional
48
+ * because the catalog is a runtime artifact built from live MCP
49
+ * handshakes — an offline pool export has no catalog to hash.
50
+ */
51
+ readonly toolIdentityCatalogHash?: string;
52
+ }
53
+ //# sourceMappingURL=portable-blueprint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portable-blueprint.d.ts","sourceRoot":"","sources":["../../src/types/portable-blueprint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC,IAAI,CAAC;AAEnD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,aAAa,EAAE,OAAO,iCAAiC,CAAC;IACjE,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAC;IAC1C;;;;;;;OAOG;IACH,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAC3C"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Current `PortableBlueprint` record schema version. v2 (2026-06) made
3
+ * provenance non-negotiable: `source` + `generatorProtocolVersion` are
4
+ * required. v1 records are REJECTED by importers — a rejected seed
5
+ * entry is just a cold-gen, so the fix is to re-export the pool, never
6
+ * to coerce.
7
+ */
8
+ export const PORTABLE_BLUEPRINT_SCHEMA_VERSION = 2;