@ggui-ai/protocol 0.2.0-alpha.4 → 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.
- package/README.md +16 -16
- package/dist/envelope-adapters.d.ts +6 -5
- package/dist/envelope-adapters.d.ts.map +1 -1
- package/dist/envelope-adapters.js +3 -3
- package/dist/envelopes/builders.d.ts +6 -32
- package/dist/envelopes/builders.d.ts.map +1 -1
- package/dist/envelopes/builders.js +3 -25
- package/dist/errors/version-mismatch.d.ts +1 -1
- package/dist/errors/version-mismatch.js +1 -1
- package/dist/gadgets/resolve-app-gadgets.d.ts +10 -0
- package/dist/gadgets/resolve-app-gadgets.d.ts.map +1 -0
- package/dist/gadgets/resolve-app-gadgets.js +19 -0
- package/dist/gadgets/resolve-contract-gadgets.d.ts +6 -6
- package/dist/gadgets/resolve-contract-gadgets.js +5 -5
- package/dist/gadgets/stdlib-gadgets.d.ts +1 -1
- package/dist/gadgets/stdlib-gadgets.d.ts.map +1 -1
- package/dist/gadgets/stdlib-gadgets.js +43 -22
- package/dist/iframe-bridge.d.ts +4 -43
- package/dist/iframe-bridge.d.ts.map +1 -1
- package/dist/iframe-bridge.js +4 -141
- package/dist/index.d.ts +60 -62
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +66 -61
- package/dist/integrations/mcp-apps.d.ts +83 -38
- package/dist/integrations/mcp-apps.d.ts.map +1 -1
- package/dist/integrations/mcp-apps.js +98 -52
- package/dist/recommended-prompts.d.ts +1 -1
- package/dist/recommended-prompts.js +1 -1
- package/dist/registry/blueprint-key.d.ts +3 -0
- package/dist/registry/blueprint-key.d.ts.map +1 -1
- package/dist/registry/blueprint-key.js +9 -0
- package/dist/registry/blueprint-stamp.d.ts +12 -0
- package/dist/registry/blueprint-stamp.d.ts.map +1 -0
- package/dist/registry/blueprint-stamp.js +12 -0
- package/dist/registry/canonicalize-contract.d.ts +31 -2
- package/dist/registry/canonicalize-contract.d.ts.map +1 -1
- package/dist/registry/canonicalize-contract.js +125 -13
- package/dist/registry/portable-blueprint.d.ts +64 -0
- package/dist/registry/portable-blueprint.d.ts.map +1 -0
- package/dist/registry/portable-blueprint.js +103 -0
- package/dist/registry/summarize-contract.d.ts +7 -2
- package/dist/registry/summarize-contract.d.ts.map +1 -1
- package/dist/registry/summarize-contract.js +12 -3
- package/dist/registry/variant-key.d.ts +17 -0
- package/dist/registry/variant-key.d.ts.map +1 -0
- package/dist/registry/variant-key.js +22 -0
- package/dist/schema-learning/derive-contract.d.ts +2 -2
- package/dist/schema-learning/derive-contract.js +2 -2
- package/dist/schema-learning/merge.d.ts.map +1 -1
- package/dist/schema-learning/merge.js +3 -2
- package/dist/schemas/app-theme.d.ts +38 -0
- package/dist/schemas/app-theme.d.ts.map +1 -0
- package/dist/schemas/app-theme.js +43 -0
- package/dist/schemas/blueprint.d.ts +30 -11
- package/dist/schemas/blueprint.d.ts.map +1 -1
- package/dist/schemas/blueprint.js +62 -26
- package/dist/schemas/data-contract.d.ts +28 -30
- package/dist/schemas/data-contract.d.ts.map +1 -1
- package/dist/schemas/data-contract.js +26 -26
- package/dist/schemas/handshake-suggestion.d.ts +2 -4
- package/dist/schemas/handshake-suggestion.d.ts.map +1 -1
- package/dist/schemas/handshake-suggestion.js +5 -14
- package/dist/schemas/mcp.d.ts +240 -58
- package/dist/schemas/mcp.d.ts.map +1 -1
- package/dist/schemas/mcp.js +285 -93
- package/dist/schemas/ops-blueprint.d.ts +12 -12
- package/dist/schemas/ops-blueprint.d.ts.map +1 -1
- package/dist/schemas/ops-blueprint.js +14 -24
- package/dist/screen-blueprints/define.d.ts +2 -2
- package/dist/screen-blueprints/match.d.ts +12 -7
- package/dist/screen-blueprints/match.d.ts.map +1 -1
- package/dist/screen-blueprints/match.js +7 -5
- package/dist/screen-blueprints/types.d.ts +14 -18
- package/dist/screen-blueprints/types.d.ts.map +1 -1
- package/dist/transport/websocket.d.ts +5 -26
- package/dist/transport/websocket.d.ts.map +1 -1
- package/dist/types/app-config.d.ts +0 -1
- package/dist/types/app-config.d.ts.map +1 -1
- package/dist/types/auth.d.ts +1 -46
- package/dist/types/auth.d.ts.map +1 -1
- package/dist/types/blueprint-source.d.ts +123 -0
- package/dist/types/blueprint-source.d.ts.map +1 -0
- package/dist/types/blueprint-source.js +126 -0
- package/dist/types/blueprint.d.ts +25 -18
- package/dist/types/blueprint.d.ts.map +1 -1
- package/dist/types/contract-inference.d.ts +2 -43
- package/dist/types/contract-inference.d.ts.map +1 -1
- package/dist/types/data-contract.d.ts +59 -344
- package/dist/types/data-contract.d.ts.map +1 -1
- package/dist/types/data-contract.js +5 -12
- package/dist/types/events.d.ts +31 -69
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/{render-event.d.ts → ggui-session-event.d.ts} +15 -15
- package/dist/types/ggui-session-event.d.ts.map +1 -0
- package/dist/types/{render-event.js → ggui-session-event.js} +5 -5
- package/dist/types/handshake-suggestion.d.ts +49 -35
- package/dist/types/handshake-suggestion.d.ts.map +1 -1
- package/dist/types/host-context.d.ts +8 -8
- package/dist/types/host-context.d.ts.map +1 -1
- package/dist/types/host-context.js +5 -5
- package/dist/types/invoke.d.ts +1 -13
- package/dist/types/invoke.d.ts.map +1 -1
- package/dist/types/{canvas-lifecycle.d.ts → lifecycle.d.ts} +35 -37
- package/dist/types/lifecycle.d.ts.map +1 -0
- package/dist/types/{canvas-lifecycle.js → lifecycle.js} +12 -14
- package/dist/types/live-channel.d.ts +48 -104
- package/dist/types/live-channel.d.ts.map +1 -1
- package/dist/types/llm.d.ts +13 -24
- package/dist/types/llm.d.ts.map +1 -1
- package/dist/types/llm.js +23 -53
- package/dist/types/mcp.d.ts +55 -176
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/types/mcp.js +2 -2
- package/dist/types/oauth-user-id.d.ts +12 -0
- package/dist/types/oauth-user-id.d.ts.map +1 -0
- package/dist/types/oauth-user-id.js +10 -0
- package/dist/types/portable-blueprint.d.ts +53 -0
- package/dist/types/portable-blueprint.d.ts.map +1 -0
- package/dist/types/portable-blueprint.js +8 -0
- package/dist/types/{session.d.ts → render.d.ts} +51 -53
- package/dist/types/render.d.ts.map +1 -0
- package/dist/types/thread.d.ts.map +1 -1
- package/dist/types/thread.js +3 -3
- package/dist/types/ui-generator.d.ts +5 -46
- package/dist/types/ui-generator.d.ts.map +1 -1
- package/dist/types/ui-generator.js +1 -53
- package/dist/validation/ajv-runtime.d.ts +3 -3
- package/dist/validation/ajv-runtime.d.ts.map +1 -1
- package/dist/validation/ajv-runtime.js +6 -5
- package/dist/validation/contract-validator.d.ts +23 -22
- package/dist/validation/contract-validator.d.ts.map +1 -1
- package/dist/validation/contract-validator.js +28 -26
- package/dist/validation/cross-references.d.ts +3 -3
- package/dist/validation/cross-references.js +3 -3
- package/dist/validation/hygiene-rules.d.ts +9 -9
- package/dist/validation/hygiene-rules.js +13 -13
- package/dist/validation/is-record.d.ts +17 -0
- package/dist/validation/is-record.d.ts.map +1 -0
- package/dist/validation/is-record.js +18 -0
- package/dist/validation/lint-contract.d.ts +1 -1
- package/dist/validation/lint-contract.js +3 -3
- package/dist/validation/name-invariants.d.ts +4 -4
- package/dist/validation/name-invariants.js +4 -4
- package/dist/validation/reserved-channels.d.ts +43 -46
- package/dist/validation/reserved-channels.d.ts.map +1 -1
- package/dist/validation/reserved-channels.js +14 -177
- package/dist/validation/resolve-stream-channel.d.ts +3 -9
- package/dist/validation/resolve-stream-channel.d.ts.map +1 -1
- package/dist/validation/resolve-stream-channel.js +3 -4
- package/dist/validation/sanitize-error.d.ts +10 -9
- package/dist/validation/sanitize-error.d.ts.map +1 -1
- package/dist/validation/sanitize-error.js +19 -18
- package/dist/validation/schema-compat-invariants.d.ts +1 -1
- package/dist/validation/schema-compat-invariants.js +3 -3
- package/dist/validation/schema-meta-validation.d.ts +4 -4
- package/dist/validation/schema-meta-validation.d.ts.map +1 -1
- package/dist/validation/schema-meta-validation.js +7 -9
- package/dist/validation/schema-subset.d.ts +9 -8
- package/dist/validation/schema-subset.d.ts.map +1 -1
- package/dist/validation/ui-security.d.ts +0 -17
- package/dist/validation/ui-security.d.ts.map +1 -1
- package/dist/validation/ui-security.js +17 -22
- package/dist/validation/zod-to-json-schema.d.ts +1 -1
- package/dist/validation/zod-to-json-schema.d.ts.map +1 -1
- package/dist/validation/zod-to-json-schema.js +4 -3
- package/dist/version.d.ts +783 -9
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +782 -8
- package/package.json +2 -2
- package/dist/bridge/invoke-agent.d.ts +0 -65
- package/dist/bridge/invoke-agent.d.ts.map +0 -1
- package/dist/bridge/invoke-agent.js +0 -113
- package/dist/stream/stream-parser.d.ts +0 -62
- package/dist/stream/stream-parser.d.ts.map +0 -1
- package/dist/stream/stream-parser.js +0 -199
- package/dist/types/canvas-lifecycle.d.ts.map +0 -1
- package/dist/types/credential.d.ts +0 -41
- package/dist/types/credential.d.ts.map +0 -1
- package/dist/types/credential.js +0 -32
- package/dist/types/data-bindings.d.ts +0 -322
- package/dist/types/data-bindings.d.ts.map +0 -1
- package/dist/types/data-bindings.js +0 -29
- package/dist/types/feedback.d.ts +0 -22
- package/dist/types/feedback.d.ts.map +0 -1
- package/dist/types/feedback.js +0 -7
- package/dist/types/mcp-proxy.d.ts +0 -67
- package/dist/types/mcp-proxy.d.ts.map +0 -1
- package/dist/types/mcp-proxy.js +0 -46
- package/dist/types/openrouter-models.d.ts +0 -23
- package/dist/types/openrouter-models.d.ts.map +0 -1
- package/dist/types/openrouter-models.js +0 -4843
- package/dist/types/region.d.ts +0 -26
- package/dist/types/region.d.ts.map +0 -1
- package/dist/types/region.js +0 -36
- package/dist/types/render-event.d.ts.map +0 -1
- package/dist/types/session.d.ts.map +0 -1
- /package/dist/types/{session.js → render.js} +0 -0
package/dist/schemas/mcp.d.ts
CHANGED
|
@@ -3,7 +3,25 @@
|
|
|
3
3
|
*
|
|
4
4
|
* These schemas define the validation rules for MCP tool inputs.
|
|
5
5
|
* TypeScript types in types/mcp.ts are derived from these via z.infer.
|
|
6
|
-
*
|
|
6
|
+
*
|
|
7
|
+
* Two consumption patterns, both anchored here:
|
|
8
|
+
*
|
|
9
|
+
* - **Wired raw shapes** (`*InputShape`): handlers in
|
|
10
|
+
* `@ggui-ai/mcp-server-handlers` (and the hosted pod's
|
|
11
|
+
* discover / request-credential tools) import the SHAPE directly as
|
|
12
|
+
* their `inputSchema` and validate with `z.object(shape)` — unknown
|
|
13
|
+
* keys are STRIPPED. The shape is the one authored copy of the
|
|
14
|
+
* validation rules AND the agent-facing `.describe()` strings that
|
|
15
|
+
* ship via `tools/list`.
|
|
16
|
+
*
|
|
17
|
+
* - **Lifecycle triad** (`ggui_handshake` / `ggui_update`): the
|
|
18
|
+
* handlers carry deliberate input divergences (handshake's
|
|
19
|
+
* blueprintDraft contract is loose ON PURPOSE so the negotiator can
|
|
20
|
+
* repair malformations; update's sessionId is optional for
|
|
21
|
+
* in-process dispatch), so they author their own raw shapes. The
|
|
22
|
+
* schemas here remain the canonical strict wire contract + the
|
|
23
|
+
* `z.infer` source for the published types. `ggui_render` is wired:
|
|
24
|
+
* its handler imports {@link renderInputShape}.
|
|
7
25
|
*/
|
|
8
26
|
import { z } from 'zod';
|
|
9
27
|
export declare const viewportSchema: z.ZodObject<{
|
|
@@ -42,48 +60,76 @@ export declare const interfaceContextSchema: z.ZodObject<{
|
|
|
42
60
|
}>>;
|
|
43
61
|
reducedMotion: z.ZodOptional<z.ZodBoolean>;
|
|
44
62
|
}, z.core.$loose>;
|
|
63
|
+
/**
|
|
64
|
+
* `ggui_consume` input. The long-poll bound is SPEC §7.3: integer
|
|
65
|
+
* seconds in `[0, 25]` — the cap dodges infrastructure kill windows
|
|
66
|
+
* (API-gateway 30s HTTP limits, host MCP clients that abort long tool
|
|
67
|
+
* calls). Longer waits are the agent's loop, not a server knob.
|
|
68
|
+
*/
|
|
69
|
+
export declare const consumeInputShape: {
|
|
70
|
+
readonly sessionId: z.ZodString;
|
|
71
|
+
readonly timeout: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
};
|
|
45
73
|
export declare const consumeInputSchema: z.ZodObject<{
|
|
46
|
-
|
|
74
|
+
sessionId: z.ZodString;
|
|
47
75
|
timeout: z.ZodOptional<z.ZodNumber>;
|
|
48
|
-
}, z.core.$
|
|
76
|
+
}, z.core.$strip>;
|
|
49
77
|
/**
|
|
50
|
-
*
|
|
78
|
+
* `ggui_emit` input — emit a stamped delivery on a declared
|
|
51
79
|
* `streamSpec[channel]`.
|
|
52
80
|
*/
|
|
81
|
+
export declare const emitInputShape: {
|
|
82
|
+
readonly sessionId: z.ZodString;
|
|
83
|
+
readonly channel: z.ZodString;
|
|
84
|
+
readonly payload: z.ZodUnknown;
|
|
85
|
+
readonly complete: z.ZodOptional<z.ZodBoolean>;
|
|
86
|
+
};
|
|
53
87
|
export declare const emitInputSchema: z.ZodObject<{
|
|
54
|
-
|
|
88
|
+
sessionId: z.ZodString;
|
|
55
89
|
channel: z.ZodString;
|
|
56
90
|
payload: z.ZodUnknown;
|
|
57
91
|
complete: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
-
}, z.core.$
|
|
59
|
-
export declare const
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
export declare const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, z.core.$
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
export declare const getSessionInputShape: {
|
|
94
|
+
readonly sessionId: z.ZodString;
|
|
95
|
+
};
|
|
96
|
+
export declare const getSessionInputSchema: z.ZodObject<{
|
|
97
|
+
sessionId: z.ZodString;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
/**
|
|
100
|
+
* `ggui_list_featured_blueprints` input — intentionally EMPTY. The
|
|
101
|
+
* pre-launch No-Backcompat scrub deleted the level/category/tags/limit
|
|
102
|
+
* filters (delete-until-wired); filters re-enter here when a real
|
|
103
|
+
* consumer passes them.
|
|
104
|
+
*/
|
|
105
|
+
export declare const listFeaturedBlueprintsInputShape: {};
|
|
106
|
+
export declare const listFeaturedBlueprintsInputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
107
|
+
export declare const searchBlueprintsInputShape: {
|
|
108
|
+
readonly query: z.ZodString;
|
|
109
|
+
readonly limit: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
};
|
|
73
111
|
export declare const searchBlueprintsInputSchema: z.ZodObject<{
|
|
74
112
|
query: z.ZodString;
|
|
75
113
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
76
|
-
}, z.core.$
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
export declare const renderBlueprintInputShape: {
|
|
116
|
+
readonly blueprintId: z.ZodString;
|
|
117
|
+
};
|
|
77
118
|
export declare const renderBlueprintInputSchema: z.ZodObject<{
|
|
78
119
|
blueprintId: z.ZodString;
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
export declare const discoverInputSchema: z.ZodObject<{}, z.core.$
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
export declare const discoverInputShape: {};
|
|
122
|
+
export declare const discoverInputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
123
|
+
export declare const requestCredentialInputShape: {
|
|
124
|
+
readonly serviceId: z.ZodString;
|
|
125
|
+
readonly reason: z.ZodOptional<z.ZodString>;
|
|
126
|
+
readonly sessionId: z.ZodOptional<z.ZodString>;
|
|
127
|
+
};
|
|
82
128
|
export declare const requestCredentialInputSchema: z.ZodObject<{
|
|
83
129
|
serviceId: z.ZodString;
|
|
84
130
|
reason: z.ZodOptional<z.ZodString>;
|
|
85
|
-
|
|
86
|
-
}, z.core.$
|
|
131
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
132
|
+
}, z.core.$strip>;
|
|
87
133
|
/**
|
|
88
134
|
* `ggui_handshake` — three-step suggestion protocol.
|
|
89
135
|
*
|
|
@@ -105,10 +151,10 @@ export declare const requestCredentialInputSchema: z.ZodObject<{
|
|
|
105
151
|
* - The agent is the contract authority; synth amends only when
|
|
106
152
|
* validation fails.
|
|
107
153
|
* - Post-Phase-B the handshake input carries NO `sessionId`. The
|
|
108
|
-
* server mints `
|
|
154
|
+
* server mints `sessionId` on the paired `ggui_render`; host
|
|
109
155
|
* conversation grouping flows via the host-supplied
|
|
110
156
|
* `_meta["ai.ggui/host-session"]` envelope captured at render
|
|
111
|
-
* creation (see {@link
|
|
157
|
+
* creation (see {@link GguiSessionBase.hostSession}).
|
|
112
158
|
*/
|
|
113
159
|
export declare const handshakeInputSchema: z.ZodObject<{
|
|
114
160
|
intent: z.ZodString;
|
|
@@ -123,18 +169,19 @@ export declare const handshakeInputSchema: z.ZodObject<{
|
|
|
123
169
|
*
|
|
124
170
|
* The agent reads `suggestion.origin` to branch the paired render call:
|
|
125
171
|
*
|
|
126
|
-
* - `cache` → render `{
|
|
127
|
-
* - `agent` → render `{
|
|
128
|
-
* - `synth` → render `{
|
|
172
|
+
* - `cache` → render `{handshakeId, props}` (omit `override`) for cache delivery.
|
|
173
|
+
* - `agent` → render `{handshakeId, props}` (omit `override`) to gen against the draft.
|
|
174
|
+
* - `synth` → render `{handshakeId, props}` (omit `override`) to gen against the amended contract.
|
|
129
175
|
*
|
|
130
|
-
* Any origin → render `{
|
|
131
|
-
*
|
|
132
|
-
* `
|
|
176
|
+
* Any origin → render `{handshakeId, props, override: {contract?, variance?}}`
|
|
177
|
+
* to re-aim the suggestion — `override.contract` gens against a fresh
|
|
178
|
+
* contract; `override.variance` re-aims the variant axis.
|
|
133
179
|
*
|
|
134
|
-
* Wire-output is intentionally lean. The handler carries `
|
|
135
|
-
* `
|
|
136
|
-
*
|
|
137
|
-
*
|
|
180
|
+
* Wire-output is intentionally lean. The handler carries `target`,
|
|
181
|
+
* `alternatives`, `contractHash`, `serverCapabilities` on its internal
|
|
182
|
+
* `HandshakeOutput` TS shape for telemetry / post-classify tracing —
|
|
183
|
+
* zod strips them before structuredContent serialization. `reason` IS
|
|
184
|
+
* a wire field (optional, ≤280 chars — see below).
|
|
138
185
|
*
|
|
139
186
|
* `serverCapabilities` reaches the iframe via the `ai.ggui/render`
|
|
140
187
|
* slice meta (see `slice-meta-derivation.ts`), not via this response.
|
|
@@ -164,33 +211,120 @@ export declare const handshakeOutputSchema: z.ZodObject<{
|
|
|
164
211
|
* `ggui_render` — materialises a UI emission. Step 3 of the three-step
|
|
165
212
|
* handshake protocol.
|
|
166
213
|
*
|
|
167
|
-
* The agent commits
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
214
|
+
* The agent commits relative to the prior handshake's suggestion by
|
|
215
|
+
* PRESENCE of `override` (no discriminated union): omit `override` to
|
|
216
|
+
* ACCEPT the proposal as-is, or provide `override: {contract?, variance?}`
|
|
217
|
+
* to re-aim the contract and/or the variant axis (PATCH semantics).
|
|
171
218
|
*
|
|
172
219
|
* Locked decisions:
|
|
173
220
|
*
|
|
174
|
-
* - `
|
|
175
|
-
*
|
|
176
|
-
* - `
|
|
177
|
-
*
|
|
221
|
+
* - ACCEPT (omit `override`) reuses the agreed contract + the proposed
|
|
222
|
+
* variance, resolving the proposed `(contractKey, variantKey)`.
|
|
223
|
+
* - `override.contract` re-drafts the contract (STRICT — must already
|
|
224
|
+
* conform; the server does not repair it) and cold-gens against it.
|
|
225
|
+
* - `override.variance` re-aims the variant axis while keeping the
|
|
226
|
+
* agreed contract, re-resolving the effective
|
|
227
|
+
* `(contractKey, variantKey(newVariance))`.
|
|
228
|
+
* - `props` is REQUIRED (pass `{}` when the effective contract declares
|
|
229
|
+
* no propsSpec).
|
|
178
230
|
*
|
|
179
231
|
* There is no separate `ggui_commit` — render absorbs that responsibility.
|
|
180
232
|
*
|
|
181
233
|
* Post-Phase-B rename from `ggui_push` — the tool materialises a single
|
|
182
234
|
* render (no stack of N to push onto); the new name reflects what the
|
|
183
235
|
* tool does at the protocol surface.
|
|
236
|
+
*
|
|
237
|
+
* WIRED shape — `@ggui-ai/mcp-server-handlers`'s `ggui_render` registers
|
|
238
|
+
* {@link renderInputShape} as its `inputSchema` and validates with
|
|
239
|
+
* `z.object(shape)` (unknown top-level keys strip; `infra` / `override`
|
|
240
|
+
* sub-objects stay `.strict()` so typos inside them surface as clear zod
|
|
241
|
+
* paths).
|
|
184
242
|
*/
|
|
243
|
+
export declare const renderInputShape: {
|
|
244
|
+
readonly handshakeId: z.ZodString;
|
|
245
|
+
/**
|
|
246
|
+
* Runtime prop values for THIS render. Validated against the
|
|
247
|
+
* effective contract's `propsSpec` — required-field checks + type
|
|
248
|
+
* checks per spec entry. Validation failures fail the render with a
|
|
249
|
+
* recoverable `ContractViolationError`.
|
|
250
|
+
*
|
|
251
|
+
* REQUIRED — pass `{}` when the effective contract declares no
|
|
252
|
+
* propsSpec (the field is required, the value may be empty).
|
|
253
|
+
*/
|
|
254
|
+
readonly props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
255
|
+
/**
|
|
256
|
+
* Per-render theme override. When set, lands on the committed
|
|
257
|
+
* render and takes priority over `App.defaultThemeId` at
|
|
258
|
+
* bootstrap-projection time. Use sparingly — most renders should
|
|
259
|
+
* inherit the app default.
|
|
260
|
+
*/
|
|
261
|
+
readonly themeId: z.ZodOptional<z.ZodString>;
|
|
262
|
+
/**
|
|
263
|
+
* Typed `infra` envelope. Today carries one field (`model`); future
|
|
264
|
+
* expansion (temperature, max_tokens, provider hints) lands here
|
|
265
|
+
* additively. `model` MUST be a provider-prefixed id
|
|
266
|
+
* (`provider/model-name`); a bound generator may also accept
|
|
267
|
+
* generator-specific prefixes for alternate transports.
|
|
268
|
+
*
|
|
269
|
+
* Strict — extra keys at `infra.*` are not silently dropped, so a
|
|
270
|
+
* typo (`infra.modelId`) surfaces as a clear zod path instead of a
|
|
271
|
+
* silent default-model fallback.
|
|
272
|
+
*/
|
|
273
|
+
readonly infra: z.ZodOptional<z.ZodObject<{
|
|
274
|
+
model: z.ZodOptional<z.ZodString>;
|
|
275
|
+
}, z.core.$strict>>;
|
|
276
|
+
/**
|
|
277
|
+
* Re-aim the handshake proposal (PATCH semantics). Omit to ACCEPT the
|
|
278
|
+
* proposal as-is; provide to re-draft the contract and/or re-aim the
|
|
279
|
+
* variant axis. At least one of `contract` / `variance` MUST be set —
|
|
280
|
+
* an empty `override: {}` is rejected.
|
|
281
|
+
*
|
|
282
|
+
* - `contract` — STRICT full re-draft of the contract. The server
|
|
283
|
+
* does NOT repair it; it must already conform.
|
|
284
|
+
* - `variance` — re-aim the variant axis (persona / aesthetic /
|
|
285
|
+
* context / seedPrompt) while keeping the agreed contract. A
|
|
286
|
+
* different variance resolves a distinct cached component.
|
|
287
|
+
*/
|
|
288
|
+
readonly override: z.ZodOptional<z.ZodObject<{
|
|
289
|
+
contract: z.ZodOptional<z.ZodType<import("..").DataContract, unknown, z.core.$ZodTypeInternals<import("..").DataContract, unknown>>>;
|
|
290
|
+
variance: z.ZodOptional<z.ZodType<import("..").BlueprintVariance, unknown, z.core.$ZodTypeInternals<import("..").BlueprintVariance, unknown>>>;
|
|
291
|
+
}, z.core.$strict>>;
|
|
292
|
+
};
|
|
185
293
|
export declare const renderInputSchema: z.ZodObject<{
|
|
186
294
|
handshakeId: z.ZodString;
|
|
187
|
-
props: z.
|
|
188
|
-
|
|
189
|
-
|
|
295
|
+
props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
296
|
+
themeId: z.ZodOptional<z.ZodString>;
|
|
297
|
+
infra: z.ZodOptional<z.ZodObject<{
|
|
298
|
+
model: z.ZodOptional<z.ZodString>;
|
|
299
|
+
}, z.core.$strict>>;
|
|
300
|
+
override: z.ZodOptional<z.ZodObject<{
|
|
301
|
+
contract: z.ZodOptional<z.ZodType<import("..").DataContract, unknown, z.core.$ZodTypeInternals<import("..").DataContract, unknown>>>;
|
|
302
|
+
variance: z.ZodOptional<z.ZodType<import("..").BlueprintVariance, unknown, z.core.$ZodTypeInternals<import("..").BlueprintVariance, unknown>>>;
|
|
303
|
+
}, z.core.$strict>>;
|
|
304
|
+
}, z.core.$strip>;
|
|
305
|
+
/**
|
|
306
|
+
* Reuse outcome for a single `ggui_render` — surfaced on the wire so an
|
|
307
|
+
* agent or operator can tell whether a stored component was served or a
|
|
308
|
+
* new one was generated. Counts generation calls only; it carries no
|
|
309
|
+
* cost or tier semantics.
|
|
310
|
+
*/
|
|
311
|
+
export declare const renderCacheMarkerSchema: z.ZodObject<{
|
|
312
|
+
hit: z.ZodBoolean;
|
|
313
|
+
similarity: z.ZodOptional<z.ZodNumber>;
|
|
314
|
+
cachedBlueprintId: z.ZodOptional<z.ZodString>;
|
|
315
|
+
llmCallsAvoided: z.ZodNumber;
|
|
316
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
317
|
+
"full-template": "full-template";
|
|
318
|
+
cold: "cold";
|
|
319
|
+
}>>;
|
|
320
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
321
|
+
}, z.core.$strip>;
|
|
190
322
|
/**
|
|
191
|
-
* Wire-output shape —
|
|
323
|
+
* Wire-output shape — `{sessionId, resourceUri, action, contractHash,
|
|
324
|
+
* cache, nextStep?}`. `contractHash` (data-contract identity) and `cache`
|
|
325
|
+
* (reuse outcome) are required wire fields on this schema.
|
|
192
326
|
* The handler carries `shortCode`, `codeReady`, `handshakeId`,
|
|
193
|
-
* `decision`, `contract`, `
|
|
327
|
+
* `decision`, `contract`, `codeUrl`, `codeHash`
|
|
194
328
|
* on its internal `RenderOutput` TS shape for telemetry / post-classify
|
|
195
329
|
* tracing — zod strips them before structuredContent serialization.
|
|
196
330
|
*
|
|
@@ -198,7 +332,7 @@ export declare const renderInputSchema: z.ZodObject<{
|
|
|
198
332
|
* `expiresAt`) via the single `ai.ggui/render` slice meta, not via this
|
|
199
333
|
* response. There is no clickable `url` field — post-R5 the `/r/`
|
|
200
334
|
* shortCode route was deleted (every host either resolves the
|
|
201
|
-
* `_meta.ui.resourceUri` iframe or reads `{
|
|
335
|
+
* `_meta.ui.resourceUri` iframe or reads `{sessionId}` via
|
|
202
336
|
* `render-resource/...`). Leaving a dead URL on the wire had the model
|
|
203
337
|
* hallucinating links that resolve nowhere.
|
|
204
338
|
*
|
|
@@ -206,7 +340,7 @@ export declare const renderInputSchema: z.ZodObject<{
|
|
|
206
340
|
* stack of N renders to compose against.
|
|
207
341
|
*/
|
|
208
342
|
export declare const renderOutputSchema: z.ZodObject<{
|
|
209
|
-
|
|
343
|
+
sessionId: z.ZodString;
|
|
210
344
|
resourceUri: z.ZodString;
|
|
211
345
|
action: z.ZodEnum<{
|
|
212
346
|
replace: "replace";
|
|
@@ -215,12 +349,26 @@ export declare const renderOutputSchema: z.ZodObject<{
|
|
|
215
349
|
update: "update";
|
|
216
350
|
declined: "declined";
|
|
217
351
|
}>;
|
|
352
|
+
contractHash: z.ZodString;
|
|
353
|
+
blueprintId: z.ZodString;
|
|
354
|
+
variantKey: z.ZodString;
|
|
355
|
+
cache: z.ZodObject<{
|
|
356
|
+
hit: z.ZodBoolean;
|
|
357
|
+
similarity: z.ZodOptional<z.ZodNumber>;
|
|
358
|
+
cachedBlueprintId: z.ZodOptional<z.ZodString>;
|
|
359
|
+
llmCallsAvoided: z.ZodNumber;
|
|
360
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
361
|
+
"full-template": "full-template";
|
|
362
|
+
cold: "cold";
|
|
363
|
+
}>>;
|
|
364
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
365
|
+
}, z.core.$strip>;
|
|
218
366
|
nextStep: z.ZodOptional<z.ZodObject<{
|
|
219
367
|
tool: z.ZodLiteral<"ggui_consume">;
|
|
220
368
|
description: z.ZodString;
|
|
221
369
|
example: z.ZodString;
|
|
222
370
|
args: z.ZodObject<{
|
|
223
|
-
|
|
371
|
+
sessionId: z.ZodString;
|
|
224
372
|
}, z.core.$strip>;
|
|
225
373
|
}, z.core.$strip>>;
|
|
226
374
|
}, z.core.$strip>;
|
|
@@ -252,15 +400,15 @@ export declare const renderOutputSchema: z.ZodObject<{
|
|
|
252
400
|
* partial patches that would break required fields, type-mismatch
|
|
253
401
|
* values, etc. all reject pre-persist.
|
|
254
402
|
*
|
|
255
|
-
* `
|
|
403
|
+
* `sessionId` is globally unique; the server tenancy-checks via
|
|
256
404
|
* `ctx.appId`.
|
|
257
405
|
*/
|
|
258
406
|
export declare const updateInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
259
|
-
|
|
407
|
+
sessionId: z.ZodString;
|
|
260
408
|
kind: z.ZodLiteral<"replace">;
|
|
261
409
|
props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
262
410
|
}, z.core.$strict>, z.ZodObject<{
|
|
263
|
-
|
|
411
|
+
sessionId: z.ZodString;
|
|
264
412
|
kind: z.ZodLiteral<"merge">;
|
|
265
413
|
patch: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
266
414
|
}, z.core.$strict>], "kind">;
|
|
@@ -276,7 +424,41 @@ export declare const updateInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
276
424
|
* acknowledgement.
|
|
277
425
|
*/
|
|
278
426
|
export declare const updateOutputSchema: z.ZodObject<{
|
|
279
|
-
|
|
427
|
+
sessionId: z.ZodString;
|
|
280
428
|
updated: z.ZodBoolean;
|
|
281
429
|
}, z.core.$strip>;
|
|
430
|
+
/**
|
|
431
|
+
* `ggui_runtime_declare_tool_catalog` — the host runtime declares its
|
|
432
|
+
* per-app canonical tool-identity catalog (one row per app).
|
|
433
|
+
*
|
|
434
|
+
* The map is `bare tool name → the canonical serverInfo` that the tool's
|
|
435
|
+
* MCP server announced in its `initialize` reply. ggui folds this into
|
|
436
|
+
* the handshake step (`canonicalizeToolIdentity`) so a reused blueprint's
|
|
437
|
+
* `agentCapabilities.tools[*].serverInfo` is rewritten to the canonical
|
|
438
|
+
* value regardless of whether the inbound contract authored a config-key
|
|
439
|
+
* name, fabricated one, or omitted it. That makes blueprint reuse
|
|
440
|
+
* identity-stable across runtimes.
|
|
441
|
+
*
|
|
442
|
+
* Keyed by the BARE tool name — the same key the canonicalization step
|
|
443
|
+
* matches on. `version` is OPTIONAL: it rides along as metadata; tool
|
|
444
|
+
* identity is `(name)` matched by bare name, never `(name, version)`.
|
|
445
|
+
*
|
|
446
|
+
* `appId` is NOT on the input — the handler reads it off `ctx.appId`
|
|
447
|
+
* resolved by the upstream auth adapter, so a declaration can only ever
|
|
448
|
+
* write its own app's row. The output echoes the resolved `appId` so the
|
|
449
|
+
* caller can confirm which app row it wrote.
|
|
450
|
+
*
|
|
451
|
+
* REPLACE semantics: each declaration overwrites the app's prior catalog
|
|
452
|
+
* wholesale (the host re-declares its full current toolset on connect).
|
|
453
|
+
*/
|
|
454
|
+
export declare const declareToolCatalogInputSchema: z.ZodObject<{
|
|
455
|
+
toolCatalog: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
456
|
+
name: z.ZodString;
|
|
457
|
+
version: z.ZodOptional<z.ZodString>;
|
|
458
|
+
}, z.core.$strict>>;
|
|
459
|
+
}, z.core.$strict>;
|
|
460
|
+
export declare const declareToolCatalogOutputSchema: z.ZodObject<{
|
|
461
|
+
saved: z.ZodBoolean;
|
|
462
|
+
appId: z.ZodString;
|
|
463
|
+
}, z.core.$strict>;
|
|
282
464
|
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/schemas/mcp.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/schemas/mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,cAAc;;;iBAGzB,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUnB,CAAC;AAYjB;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;CAgBpB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;iBAA8B,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;CAKjB,CAAC;AAEX,eAAO,MAAM,eAAe;;;;;iBAA2B,CAAC;AAExD,eAAO,MAAM,oBAAoB;;CAKvB,CAAC;AAEX,eAAO,MAAM,qBAAqB;;iBAAiC,CAAC;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,IAAc,CAAC;AAE5D,eAAO,MAAM,iCAAiC,gCAE7C,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;CAM7B,CAAC;AAEX,eAAO,MAAM,2BAA2B;;;iBAAuC,CAAC;AAEhF,eAAO,MAAM,yBAAyB;;CAO5B,CAAC;AAEX,eAAO,MAAM,0BAA0B;;iBAAsC,CAAC;AAE9E,eAAO,MAAM,kBAAkB,IAAc,CAAC;AAE9C,eAAO,MAAM,mBAAmB,gCAA+B,CAAC;AAEhE,eAAO,MAAM,2BAA2B;;;;CAI9B,CAAC;AAEX,eAAO,MAAM,4BAA4B;;;;iBAAwC,CAAC;AAalF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,oBAAoB;;;;kBA0BtB,CAAC;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;iBAgChC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,gBAAgB;;IAO3B;;;;;;;;OAQG;;IAEH;;;;;OAKG;;IAQH;;;;;;;;;;OAUG;;;;IAaH;;;;;;;;;;;OAWG;;;;;CAuBK,CAAC;AAEX,eAAO,MAAM,iBAAiB;;;;;;;;;;;iBAA6B,CAAC;AAE5D;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;iBAyBlC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoD7B,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;4BAa5B,CAAC;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,6BAA6B;;;;;kBAW/B,CAAC;AAEZ,eAAO,MAAM,8BAA8B;;;kBAKhC,CAAC"}
|