@ggui-ai/protocol 0.6.3 → 0.8.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 (35) hide show
  1. package/dist/errors/resource-read.d.ts +105 -0
  2. package/dist/errors/resource-read.d.ts.map +1 -0
  3. package/dist/errors/resource-read.js +107 -0
  4. package/dist/gadgets/resolve-app-gadgets.d.ts +12 -6
  5. package/dist/gadgets/resolve-app-gadgets.d.ts.map +1 -1
  6. package/dist/gadgets/resolve-app-gadgets.js +19 -8
  7. package/dist/gadgets/stdlib-gadgets.d.ts +1 -1
  8. package/dist/gadgets/stdlib-gadgets.js +1 -1
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +3 -0
  12. package/dist/integrations/mcp-apps.d.ts +50 -4
  13. package/dist/integrations/mcp-apps.d.ts.map +1 -1
  14. package/dist/integrations/mcp-apps.js +44 -5
  15. package/dist/schemas/data-contract.d.ts +30 -22
  16. package/dist/schemas/data-contract.d.ts.map +1 -1
  17. package/dist/schemas/data-contract.js +35 -26
  18. package/dist/schemas/mcp.d.ts +62 -16
  19. package/dist/schemas/mcp.d.ts.map +1 -1
  20. package/dist/schemas/mcp.js +72 -12
  21. package/dist/transport/websocket.d.ts +2 -5
  22. package/dist/transport/websocket.d.ts.map +1 -1
  23. package/dist/types/data-contract.d.ts +6 -2
  24. package/dist/types/data-contract.d.ts.map +1 -1
  25. package/dist/types/live-channel.d.ts +14 -37
  26. package/dist/types/live-channel.d.ts.map +1 -1
  27. package/dist/types/mcp.d.ts +56 -25
  28. package/dist/types/mcp.d.ts.map +1 -1
  29. package/dist/types/mcp.js +19 -2
  30. package/dist/validation/hygiene-rules.d.ts +2 -2
  31. package/dist/validation/hygiene-rules.js +2 -2
  32. package/dist/version.d.ts +272 -0
  33. package/dist/version.d.ts.map +1 -1
  34. package/dist/version.js +272 -0
  35. package/package.json +1 -1
package/dist/version.js CHANGED
@@ -6,6 +6,278 @@
6
6
  * schema change; the most recent change anchors {@link PROTOCOL_VERSION}.
7
7
  *
8
8
  * --------------------------------------------------------------------
9
+ * MCP tool bindings & discovery (2026-08-10, additive, pre-launch,
10
+ * ggui#259). Artifacts gain an optional MCP tool-binding list and
11
+ * registry search gains a tool dimension, connecting the two
12
+ * namespaces the registry serves: signed UI artifacts and the MCP
13
+ * tools they render. SPEC §7.7.4.1 is the normative home.
14
+ *
15
+ * tb1. **`mcpTools` on both manifest kinds**
16
+ * (`@ggui-ai/artifact-manifest`): 1–16 `{server?, tool}`
17
+ * entries, charset `/^[A-Za-z0-9_.-]{1,128}$/`,
18
+ * exact-duplicate `(server, tool)` pairs rejected with the
19
+ * existing `manifest_invalid` code. Declared wins entirely;
20
+ * a blueprint without the field derives bare `{tool}` entries
21
+ * from the union of its contract's per-prop `sourceTool` and
22
+ * `streamSpec` `source.tool` names (`resolveMcpToolBindings`,
23
+ * marked `derived`). Bindings are search metadata only — they
24
+ * never enter contract canonicalization or `blueprintKey`.
25
+ * NOTE: manifest schemas are strict-rooted, so an OLDER
26
+ * manifest parser REJECTS a manifest file carrying the field —
27
+ * the optionality guarantee below is wire-response-scoped
28
+ * (search/read), not manifest-file-scoped.
29
+ *
30
+ * tb2. **Registry wire additions** (`@ggui-ai/registry-core`),
31
+ * all optional: `SearchResultEntry` += `mcpTools?`,
32
+ * `mcpToolsSource?: 'declared' | 'derived'`,
33
+ * `scopeVerification?: 'verified' | 'unverified'`,
34
+ * `verifiedDomain?`; the single-version read response += the
35
+ * same two verification fields; search input += `tool?` /
36
+ * `server?` exact filters (AND-composed with the existing
37
+ * filters, `matchesMcpToolFilters` semantics; an invalid
38
+ * charset value is the existing `invalid_request` 400).
39
+ * Pre-existing consumers see `undefined` and behave as before.
40
+ *
41
+ * tb3. **Agent surface** (`@ggui-ai/mcp-server-handlers`):
42
+ * `ggui_search_blueprints` gains an opt-in `registry` source
43
+ * merged after the local sources; unreachable / timeout /
44
+ * unparseable-body answers degrade typed —
45
+ * `degradedSources: [{source: 'registry', reason:
46
+ * 'unreachable' | 'timeout' | 'invalid_response'}]` — never a
47
+ * tool failure, never a thrown error.
48
+ *
49
+ * Conformance-kit verdict: additive, minor-intent while `draft-`,
50
+ * so PROTOCOL_VERSION is unchanged — no WS envelope moved; the
51
+ * change is confined to the manifest, registry HTTP, and MCP
52
+ * tool-result surfaces. The new `binding-conformance` catalog in
53
+ * `@ggui-ai/protocol-conformance` (`runBindingResolutionCases` /
54
+ * `runBindingFilterCases`) arbitrates resolution precedence and
55
+ * filter semantics; search/read response optionality is pinned by
56
+ * registry-core unit tests, because the strict-rooted manifest
57
+ * schema makes a manifest-file optionality fixture false (tb1).
58
+ *
59
+ * Package version — the classification is MADE here, not deferred:
60
+ * MINOR for the `@ggui-ai/*` wave, additive under the version
61
+ * policy's minor rule (every fixture that passed against the
62
+ * current wave still passes; the delta is new surface), pre-1.0
63
+ * and pre-launch. FOUR packages carry minor-class changes into
64
+ * that wave — `@ggui-ai/artifact-manifest` (the field + resolver),
65
+ * `@ggui-ai/registry-core` (wire + filters),
66
+ * `@ggui-ai/mcp-server-handlers` (the registry source), and
67
+ * `@ggui-ai/protocol-conformance` (the catalog that decides them).
68
+ * Only the mechanical write is deferred: every `@ggui-ai/*`
69
+ * package carries ONE wave version, so the release owner takes all
70
+ * four bumps together at the next wave cut.
71
+ * --------------------------------------------------------------------
72
+ * Typed `resources/read` failures (2026-08-09, additive, pre-launch,
73
+ * ggui#430). A read of a render locator
74
+ * (`ui://ggui/render/{sessionId}/{blueprintKey}`) gains a closed failure
75
+ * union and a canonical JSON-RPC number, so the read has exactly two
76
+ * exits: a live mount, or a typed error. Before this, an unresolvable
77
+ * read returned a SUCCESS-shaped result carrying a loading shell that
78
+ * would never come alive — the same class of defect ruling B fixed for
79
+ * `ggui_render`, on the resource surface instead of the tool surface.
80
+ *
81
+ * rr1. **New closed enum `ResourceReadErrorCode`** = NOT_FOUND |
82
+ * BLUEPRINT_UNRESOLVABLE | NOT_SUPPORTED | NOT_MOUNTABLE, with
83
+ * `resourceReadErrorSchema {code, message, detail?}`. Deliberately
84
+ * NOT an extension of `renderErrorCodeSchema` (rb2): that enum
85
+ * classifies a `ggui_render` tool call that ran and failed and
86
+ * rides IN the tool result; this one classifies a resource read
87
+ * and rides ON a JSON-RPC error. Two surfaces, two closed enums,
88
+ * same UPPER_SNAKE house style.
89
+ *
90
+ * rr2. **`-32006 MOUNT_UNAVAILABLE` claimed** — the first draw from
91
+ * the `-32006` onwards range that rb4 reserved when it retired
92
+ * `-32004`. The next free canonical slot is `-32007`. It covers
93
+ * BLUEPRINT_UNRESOLVABLE / NOT_SUPPORTED / NOT_MOUNTABLE.
94
+ * Deliberately NOT `INTERNAL_ERROR`: a component that is gone, a
95
+ * server that keeps no durable record, and a render with no
96
+ * delivery channel are all deterministic outcomes of a correctly
97
+ * functioning server, and `-32603` would report a malfunction and
98
+ * invite a retry that cannot succeed. The fine-grained class rides
99
+ * on `error.data.code`.
100
+ *
101
+ * rr3. **NOT_FOUND maps to `-32002`**, which MCP uses for a missing
102
+ * resource and which this table already assigns to a missing
103
+ * session — for a locator keyed by `sessionId` those are one
104
+ * condition, not two.
105
+ *
106
+ * rr4. **NOT_FOUND carries a CONSTANT body.** The mapper substitutes
107
+ * a fixed message and drops `detail`, so a read refused by the
108
+ * authorization check and a read of a locator that never existed
109
+ * are byte-identical on the wire. Anything that varies between the
110
+ * two makes the read an existence oracle for other callers'
111
+ * renders. The mapper closes the message half; the ordering half
112
+ * is a server obligation — a branch whose outcome VARIES WITH THE
113
+ * LOCATOR MUST NOT run before the authorization check, because
114
+ * reaching one tells the caller the locator resolved for somebody.
115
+ * A deployment-global answer is not such a branch: NOT_SUPPORTED
116
+ * is identical for every locator on the server that emits it, so
117
+ * answering it early discloses nothing. (Scoped this way in the
118
+ * same slice the conformance catalog landed, which grades the
119
+ * indistinguishability the rule exists to produce and deliberately
120
+ * does not grade ordering. The unscoped form would have declared
121
+ * a correct substrate-less server non-conformant.)
122
+ *
123
+ * rr5. **A read that cannot mount is now an ERROR, not a
124
+ * success-shaped shell.** This is the observable wire change, and
125
+ * it is what rr1–rr4 exist to give a shape to. Every failure
126
+ * branch of the render-locator read used to return a result whose
127
+ * `contents` carried a loading shell — a page that waited forever
128
+ * for a render that was never coming. Those branches now throw,
129
+ * and the transport serializes them as the JSON-RPC errors above;
130
+ * the shell builder behind them is DELETED rather than left
131
+ * unreferenced, so no branch can produce one. Reads that CAN
132
+ * mount are unchanged byte for byte. A host that treated any
133
+ * successful read as mountable was right only by accident and is
134
+ * now right by construction; a host that never handled the error
135
+ * exit at all now has one to handle. The invariant this buys is
136
+ * the whole point: any successful `contents` result IS a live
137
+ * mount.
138
+ *
139
+ * Conformance-kit verdict: additive, minor-intent while `draft-`, so
140
+ * PROTOCOL_VERSION is unchanged — no WS envelope moved, and the change
141
+ * is confined to the MCP resource surface (same reasoning as rb's stamp
142
+ * adjudication).
143
+ *
144
+ * The kit arbitrates this surface now. `resource-read-conformance` in
145
+ * `@ggui-ai/protocol-conformance` binds the `resources/read` method:
146
+ * `runResourceReadConformance()` drives an adopter-supplied scenario
147
+ * driver through a 12-case catalog and grades the two numbers (rr1–rr3),
148
+ * the closed classification on `error.data.code`, NOT_FOUND's absent
149
+ * `detail` and constant message (rr4), the refused-equals-missing byte
150
+ * identity across every server shape, and rr5's invariant on a live row
151
+ * and a re-minted one alike. What it does NOT arbitrate is `tools/call`:
152
+ * no driver is bound to that method, so the `ggui_consume` and
153
+ * `ggui_emit` obligations stay kit-invisible and this entry closes
154
+ * nothing for them.
155
+ *
156
+ * Because that catalog exists and ships, the package-version decision
157
+ * below is stated outright rather than made conditional on a driver
158
+ * that has yet to arrive.
159
+ *
160
+ * Five things stay ungraded on purpose and MUST NOT be read as
161
+ * obligations: the ORDER in which a substrate-less server answers
162
+ * NOT_SUPPORTED; `detail` wording on any code; the NOT_FOUND message
163
+ * literal (its constancy is the obligation, not its prose); `-32603`
164
+ * message text; and the NUMBER a URI naming no locator receives —
165
+ * including negatively, since MCP itself assigns the resource-missing
166
+ * number to a read of a URI a server does not serve, and banning it
167
+ * would make every framework that leans on that assignment
168
+ * non-conformant. On that last one the law is classification-only:
169
+ * such a URI MUST NOT carry one of the four codes on `error.data.code`.
170
+ *
171
+ * Package version — the classification is MADE here, not deferred.
172
+ * The resource-read surface and the new canonical code are a MINOR for
173
+ * the `@ggui-ai/*` wave: additive under the version policy's minor rule
174
+ * (every fixture that passed against the current wave still passes; the
175
+ * delta is new surface), pre-1.0 and pre-launch. TWO packages carry
176
+ * minor-class changes into that wave — `@ggui-ai/protocol` (the closed
177
+ * enum, the canonical number, the projection) and
178
+ * `@ggui-ai/protocol-conformance` (the catalog that decides them).
179
+ *
180
+ * What is deferred is only the mechanical write. Every `@ggui-ai/*`
181
+ * package carries ONE wave version, and a wave cut moves all of them to
182
+ * it in a single commit — no package's number can move on its own — so
183
+ * the release owner takes both bumps together at the next cut. One
184
+ * deferral, one owner, two named packages. Nothing about what the
185
+ * change IS remains open.
186
+ *
187
+ * #457 (2026-08-10): the substrate stores' `durability` declaration —
188
+ * a MINOR surface that SHIPPED IN 0.7.0 (the wave was published from
189
+ * main after it landed; an earlier revision of this note deferred it
190
+ * to the next cut, which the publish overtook). `@ggui-ai/mcp-server-core`
191
+ * adds a required member to three published ports (pre-launch
192
+ * no-compat: every in-tree impl moved in the same slice; out-of-tree
193
+ * implementors add one literal) and `@ggui-ai/protocol-conformance`
194
+ * adds the `all-ephemeral` wiring arm + its fusion case (additive —
195
+ * the catalog's public-API additive-only rule holds; the SPEC §7.10.4
196
+ * amendment defines "durable" as declared, which was previously
197
+ * undefined, not different).
198
+ *
199
+ * On the kit's half, one thing is worth saying plainly rather than
200
+ * calling its delta "purely additive": `parseCase` rejects unknown
201
+ * keys, so a case file with a typo'd key throws instead of being
202
+ * quietly ignored. That strictness is free on a sub-module with no
203
+ * prior published version — nothing can be built against it yet — but
204
+ * extending it over the existing fixture catalog would be a MAJOR, not
205
+ * a minor, and must be adjudicated as one.
206
+ *
207
+ * #471 (2026-08-10): the fetch-free delivery surface — a MINOR for the
208
+ * `@ggui-ai/protocol` wave, deferred to the next cut under the same
209
+ * one-wave-version rule as above. Three additive pieces, one shared
210
+ * motivation (hosts whose iframe CSP forbids every URL-scheme load
211
+ * while permitting inline scripts):
212
+ *
213
+ * if1. **`McpAppAiGguiRenderMeta.codeB64`** — optional base64
214
+ * compiled component source, the fetch-free twin of `codeUrl`
215
+ * (coexists with it; exclusive with `kind`). Every envelope that
216
+ * parsed before parses identically; the parser's new rejection
217
+ * arm (`codeB64` + `kind` both set) rejects a shape no producer
218
+ * ever emitted. `hasMountModeDiscriminator` widens PERMISSIVELY
219
+ * (a codeB64-only slice becomes mountable — previously
220
+ * undefined, not different).
221
+ *
222
+ * if2. **`GguiShellHtmlOptions.runtimeInlineSource` +
223
+ * `escapeInlineScript`** — host-helper additions; the default
224
+ * (external `<script src>`) emission is byte-unchanged.
225
+ *
226
+ * if3. Consumer-side: `@ggui-ai/design` gains the inline-exec
227
+ * module (new exports only); `@ggui-ai/mcp-server` gains the
228
+ * `mcpApps.inlineRuntimeShell` opt-in (default OFF — the served
229
+ * static shell is byte-unchanged for every existing mount) and
230
+ * `registerGguiRenderResource` gains a trailing optional
231
+ * CSP-fallback parameter (existing positional calls unchanged).
232
+ *
233
+ * Conformance-kit verdict: no fixture pins the render slice's closed
234
+ * field set (the slice is verbatim-carry by design — the host-helper
235
+ * suite's "unknown future fields ride along" case is the governing
236
+ * posture), so the additive field breaks nothing. PROTOCOL_VERSION
237
+ * unchanged — no wire frame changed shape.
238
+ *
239
+ * --------------------------------------------------------------------
240
+ * Credential-broker surface retired (2026-08-08, BREAKING, pre-launch,
241
+ * ggui#436). The `system` frame's auth vocabulary and the
242
+ * `ggui_request_credential` tool leave the protocol entirely.
243
+ * Credential ceremony for an agent's own MCP tools is the AGENT HOST's
244
+ * responsibility — it owns the runtime, the user relationship, and the
245
+ * consent chrome. ggui's wire deliberately carries no auth frames.
246
+ *
247
+ * rc1. **`SystemPayload` / `SystemAction` deleted**, and `'system'`
248
+ * leaves `WebSocketMessageType` + the `WebSocketMessage` union.
249
+ * The vocabulary was `auth_required` / `credential_ready` and
250
+ * nothing else — with the broker gone there is no other action to
251
+ * carry, so the frame class dies with it rather than surviving as
252
+ * an empty discriminator.
253
+ *
254
+ * rc2. **`requestCredentialInputSchema` /
255
+ * `requestCredentialInputShape` / `GguiRequestCredentialInput` /
256
+ * `GguiRequestCredentialOutput` deleted.** The only handler that
257
+ * ever implemented the tool (the hosted pod's
258
+ * `tools/request-credential.ts`) was deleted the day before in
259
+ * the same issue: it pushed its consent overlay through an API
260
+ * Gateway WebSocket leg the pod never had, so the tool could not
261
+ * function. `ggui_request_credential` is appended to the
262
+ * mcp-server RETIRED_TOOL_NAMES regression lock.
263
+ *
264
+ * rc3. **Client lanes deleted, not stubbed.** `@ggui-ai/react`'s
265
+ * `GguiRenderProps.onSystemMessage` (+ its dispatch arm),
266
+ * `@ggui-ai/iframe-runtime`'s `channels/system.ts` handler and
267
+ * its `auth-required` `ObservabilityEvent` arm
268
+ * (`AuthRequiredEvent`), and both SDKs' `SystemPayload` /
269
+ * `SystemAction` re-exports go. The observability event was a
270
+ * projection of `SystemPayload` — with no payload to project it
271
+ * has no producer.
272
+ *
273
+ * Conformance-kit verdict: no kit fixture asserted the `system` frame
274
+ * and no first-party server ever emitted one (the pod's broker was the
275
+ * only would-be emitter and it was pre-transport dead) — same posture
276
+ * as the 2026-07-27 dead-vocabulary entry. PROTOCOL_VERSION unchanged;
277
+ * rolling it would force a lockstep UPGRADE_REQUIRED break on every
278
+ * pinned client to version a frame class that never flew.
279
+ *
280
+ * --------------------------------------------------------------------
9
281
  * Ops-tool console-parity slice (2026-07-29, BREAKING on the ops
10
282
  * surface only, pre-launch, ggui#400). Rename ledger — same treatment
11
283
  * as the `ggui_ops_register_blueprint` → `ggui_ops_save_library_blueprint`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ggui-ai/protocol",
3
- "version": "0.6.3",
3
+ "version": "0.8.0",
4
4
  "description": "ggui protocol types — events, renders, WebSocket, MCP, LLM models",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [