@guuey/mcp-apps-host 0.6.1 → 0.7.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/README.md CHANGED
@@ -9,8 +9,12 @@ role's client-side narrowing and mount contract:
9
9
  - **View-mount dispatch** (`toolResultViewMount`, `snapshotViewMount`): one
10
10
  narrowing that answers "what, if anything, does this block mount?" across
11
11
  the UI channels a transcript carries — an inline `ui://` resource payload,
12
- a vendor fast-path (ggui's render shell, until its retirement per the
13
- conformance map), or a bare `ui://` **locator**.
12
+ or a bare `ui://` **locator** (from `uiData.resourceUri`, else
13
+ `structuredContent.resourceUri`). Every `ui://` producer, ggui's
14
+ `ggui_render` included, is a locator producer: the ggui vendor fast-path
15
+ retired 2026-08-16 (guuey#209) once the pod's live read door and ggui's
16
+ read-time mint made the spec's read path strictly fresher than any
17
+ inlined bootstrap. Its helpers stay exported one minor as `@deprecated`.
14
18
  - **Locator rehydration**: a persisted `ui://` locator remounts by a fresh,
15
19
  authenticated `resources/read` of the uri — the spec-consistent template
16
20
  fetch (the spec itself defers persistence/restoration; a full remount
@@ -1,41 +1,53 @@
1
1
  /**
2
2
  * The card-mount dispatcher: ONE narrowing that answers "what, if anything,
3
- * does this block mount?" across BOTH generative-UI channels a guuey pod
4
- * emits.
3
+ * does this block mount?" for every generative-UI shape a guuey pod emits.
5
4
  *
6
5
  * 1. **inline mcp-ui resource** — `{uri, text|blob}` on `uiData`, or a
7
6
  * `ui://` resource degraded into a `provider-raw` content part. Handled
8
7
  * verbatim by `block-ui.ts`; this module does not touch that path, it
9
8
  * only tries it FIRST.
10
- * 2. **ggui render** — `uiData.resourceUri` + the `_meta["ai.ggui/render"]`
11
- * bootstrap, mounted through ggui's self-contained shell. See
12
- * `ggui-render.ts`.
9
+ * 2. **`ui://` locator** — the durable identity of a view produced by ANY
10
+ * MCP server (ggui's `ggui_render` included), on `uiData.resourceUri`
11
+ * when the producer sent `_meta.ui` (AgJSON §2.1 surface routing) or on
12
+ * `structuredContent.resourceUri` when it did not. The host resolves it
13
+ * by a fresh, authenticated `resources/read` of the uri
14
+ * ({@link UiResourceReader}) — the spec-consistent template fetch, on
15
+ * the live turn (pod door) and on rehydration (persisted door) alike.
13
16
  *
14
- * Both channels land on the SAME `McpUiResourcePayload`, which is the whole
15
- * point: a host that already mounts inline resources through
16
- * `@mcp-ui/client`'s `AppRenderer` in a second-origin sandbox gains ggui cards
17
- * without a second mount mechanism, a second iframe contract, or a second
18
- * security posture to review.
17
+ * ## The ggui vendor arm is retired (guuey#209, 2026-08-16)
19
18
  *
20
- * Precedence is inline-first and deliberate: an inline resource is the
21
- * server's explicit, self-sufficient HTML. A ggui render only ever wins when
22
- * there is no inline resource to prefer, so this dispatcher can never change
23
- * what an existing inline card renders.
19
+ * This dispatcher used to carry a THIRD arm: when a `tool-result` carried the
20
+ * `_meta["ai.ggui/render"]` bootstrap it built ggui's self-contained shell
21
+ * inline and mounted it without a read a fast path that existed only
22
+ * because the pod holds the MCP connection and a live locator had no host-
23
+ * side read channel. That precondition is gone: the pod door
24
+ * (`GET <pod>/agent/ui-resource`) answers live-turn locators, the persisted
25
+ * door answers rehydration, and ggui's `resources/read` mints the live-
26
+ * channel material FRESH at read time — strictly fresher than any inlined
27
+ * bootstrap. A ggui render is therefore just another locator producer; live
28
+ * == rehydrated == spec. The arm's narrowing helpers stay exported one
29
+ * minor as `@deprecated` (`ggui-render.ts`); nothing here consumes them.
24
30
  *
25
31
  * ## Why the CHANNEL is returned alongside the resource
26
32
  *
27
- * The payload alone cannot say where it came from — a ggui shell is a string
33
+ * The payload alone cannot say where it came from — ggui's shell is a string
28
34
  * of HTML like any other. But a host has one decision that genuinely depends
29
35
  * on the origin of that HTML: WHICH sandbox host page to mount it in. A ggui
30
36
  * shell must load ggui's runtime bundle and open its WSS, so it needs a page
31
37
  * whose CSP names the ggui origins; an inline card is arbitrary tenant HTML
32
- * and must keep the self-only page it has always had. Handing back the channel
33
- * keeps that one narrowing in one place the alternative was for every host
34
- * to re-run `toolResultGguiRender` beside this call and ask again.
38
+ * and must keep the self-only page it has always had. Since the flip the
39
+ * channel is assigned at RESOLUTION time from the requested locator uri
40
+ * (`uiResourceChannel` in `reader.ts` `ui://ggui/…` `"ggui"`), never
41
+ * from the response and never from mount material a producer inlined.
35
42
  */
36
43
  import { type McpUiResourcePayload } from "./block-ui.js";
37
44
  import type { AgBlock, JsonValue } from "@silverprotocol/core";
38
- /** Which generative-UI channel produced a mount. See this module's header. */
45
+ /**
46
+ * Which sandbox-trust channel a mount rides. See this module's header.
47
+ * `"ggui"` is assigned at RESOLUTION time from the requested locator uri
48
+ * (`uiResourceChannel`) — a `toolResultViewMount` result is only ever
49
+ * `"inline"` or `"locator"`.
50
+ */
39
51
  export type ViewMountChannel = "inline" | "ggui" | "locator";
40
52
  /**
41
53
  * A mountable card, or the locator to fetch one with.
@@ -58,6 +70,8 @@ export type ViewMount = ResolvedViewMount | LocatorViewMount;
58
70
  * A view with mount material in hand — the arms a host can render directly,
59
71
  * and the ONLY arms a `UiResourceReader` resolves (guuey#127): a read either
60
72
  * yields mount material or the honest placeholder, never another locator.
73
+ * `"ggui"` here always comes from a reader (`uiResourceChannel` on the
74
+ * requested uri) — no dispatcher in this module produces it.
61
75
  */
62
76
  export interface ResolvedViewMount {
63
77
  channel: "inline" | "ggui";
@@ -81,9 +95,14 @@ export interface LocatorViewMount {
81
95
  */
82
96
  export type UiResourceReader = (resourceUri: string) => Promise<ViewMount | undefined>;
83
97
  /**
84
- * A live `tool-result` block → the card to mount, across both channels.
85
- * `undefined` when the block carries no generative UI at all (or carries a
86
- * ggui render whose bootstrap did not reach us — see `ggui-render.ts`).
98
+ * A live `tool-result` block → the card to mount: an inline resource, else the
99
+ * `ui://` locator (either channel see `toolResultLocator`), else `undefined`
100
+ * when the block carries no generative UI at all.
101
+ *
102
+ * A locator on a LIVE turn resolves through the pod door (its live-card
103
+ * ledger registers the locator the moment the result streams — guuey#209
104
+ * C1/C5); the same locator persisted resolves through the platform door.
105
+ * One authority per lifecycle phase, one dispatcher for both.
87
106
  */
88
107
  export declare function toolResultViewMount(block: Extract<AgBlock, {
89
108
  type: "tool-result";
@@ -91,12 +110,12 @@ export declare function toolResultViewMount(block: Extract<AgBlock, {
91
110
  /**
92
111
  * A persisted `HistoryCard`'s `cardSnapshot` → the card to mount.
93
112
  *
94
- * There is deliberately NO bootstrap arm here (guuey#122): persistence
95
- * strips tool-result `_meta` (see `@guuey/threads`' fold-rows), and a
96
- * foreign snapshot that still carries one holds an expired `wsToken` — a
97
- * dead mount. A persisted `ui://` locator resolves to the `"locator"`
98
- * channel instead: rehydration is a fresh `resources/read` of the uri,
99
- * the spec-consistent template fetch, vendor-neutral.
113
+ * Same two arms as the live dispatcher (since guuey#209 there is no third):
114
+ * an inline resource, else the `ui://` locator. Persistence strips
115
+ * tool-result `_meta` (see `@guuey/threads`' fold-rows), and a foreign
116
+ * snapshot that still carries a stale bootstrap is ignored — its `wsToken`
117
+ * expired minutes after the render. Rehydration is a fresh `resources/read`
118
+ * of the uri, the spec-consistent template fetch, vendor-neutral.
100
119
  */
101
120
  export declare function snapshotViewMount(cardSnapshot: JsonValue): ViewMount | undefined;
102
121
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"card-mount.d.ts","sourceRoot":"","sources":["../src/card-mount.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAA+D,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEvH,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAW/D,8EAA8E;AAC9E,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAE7D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,SAAS,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,iBAAi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H,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC3B,+EAA+E;IAC/E,QAAQ,EAAE,oBAAoB,CAAC;CAChC;AAED,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,SAAS,CAAC;IACnB,4GAA4G;IAC5G,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AAEvF;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC,GAC/C,SAAS,GAAG,SAAS,CAKvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAUhF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,SAAS,GAAG,SAAS,EAC5B,MAAM,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAKxC"}
@@ -1,80 +1,72 @@
1
1
  /**
2
2
  * The card-mount dispatcher: ONE narrowing that answers "what, if anything,
3
- * does this block mount?" across BOTH generative-UI channels a guuey pod
4
- * emits.
3
+ * does this block mount?" for every generative-UI shape a guuey pod emits.
5
4
  *
6
5
  * 1. **inline mcp-ui resource** — `{uri, text|blob}` on `uiData`, or a
7
6
  * `ui://` resource degraded into a `provider-raw` content part. Handled
8
7
  * verbatim by `block-ui.ts`; this module does not touch that path, it
9
8
  * only tries it FIRST.
10
- * 2. **ggui render** — `uiData.resourceUri` + the `_meta["ai.ggui/render"]`
11
- * bootstrap, mounted through ggui's self-contained shell. See
12
- * `ggui-render.ts`.
9
+ * 2. **`ui://` locator** — the durable identity of a view produced by ANY
10
+ * MCP server (ggui's `ggui_render` included), on `uiData.resourceUri`
11
+ * when the producer sent `_meta.ui` (AgJSON §2.1 surface routing) or on
12
+ * `structuredContent.resourceUri` when it did not. The host resolves it
13
+ * by a fresh, authenticated `resources/read` of the uri
14
+ * ({@link UiResourceReader}) — the spec-consistent template fetch, on
15
+ * the live turn (pod door) and on rehydration (persisted door) alike.
13
16
  *
14
- * Both channels land on the SAME `McpUiResourcePayload`, which is the whole
15
- * point: a host that already mounts inline resources through
16
- * `@mcp-ui/client`'s `AppRenderer` in a second-origin sandbox gains ggui cards
17
- * without a second mount mechanism, a second iframe contract, or a second
18
- * security posture to review.
17
+ * ## The ggui vendor arm is retired (guuey#209, 2026-08-16)
19
18
  *
20
- * Precedence is inline-first and deliberate: an inline resource is the
21
- * server's explicit, self-sufficient HTML. A ggui render only ever wins when
22
- * there is no inline resource to prefer, so this dispatcher can never change
23
- * what an existing inline card renders.
19
+ * This dispatcher used to carry a THIRD arm: when a `tool-result` carried the
20
+ * `_meta["ai.ggui/render"]` bootstrap it built ggui's self-contained shell
21
+ * inline and mounted it without a read a fast path that existed only
22
+ * because the pod holds the MCP connection and a live locator had no host-
23
+ * side read channel. That precondition is gone: the pod door
24
+ * (`GET <pod>/agent/ui-resource`) answers live-turn locators, the persisted
25
+ * door answers rehydration, and ggui's `resources/read` mints the live-
26
+ * channel material FRESH at read time — strictly fresher than any inlined
27
+ * bootstrap. A ggui render is therefore just another locator producer; live
28
+ * == rehydrated == spec. The arm's narrowing helpers stay exported one
29
+ * minor as `@deprecated` (`ggui-render.ts`); nothing here consumes them.
24
30
  *
25
31
  * ## Why the CHANNEL is returned alongside the resource
26
32
  *
27
- * The payload alone cannot say where it came from — a ggui shell is a string
33
+ * The payload alone cannot say where it came from — ggui's shell is a string
28
34
  * of HTML like any other. But a host has one decision that genuinely depends
29
35
  * on the origin of that HTML: WHICH sandbox host page to mount it in. A ggui
30
36
  * shell must load ggui's runtime bundle and open its WSS, so it needs a page
31
37
  * whose CSP names the ggui origins; an inline card is arbitrary tenant HTML
32
- * and must keep the self-only page it has always had. Handing back the channel
33
- * keeps that one narrowing in one place the alternative was for every host
34
- * to re-run `toolResultGguiRender` beside this call and ask again.
38
+ * and must keep the self-only page it has always had. Since the flip the
39
+ * channel is assigned at RESOLUTION time from the requested locator uri
40
+ * (`uiResourceChannel` in `reader.ts` `ui://ggui/…` `"ggui"`), never
41
+ * from the response and never from mount material a producer inlined.
35
42
  */
36
43
  import { snapshotUiResource, toolResultLocator, toolResultUiResource } from "./block-ui.js";
37
- import { GGUI_RENDER_META_KEY, gguiRenderResource, toolResultGguiRender } from "./ggui-render.js";
38
- /** Does the block's `_meta` carry the ggui render key at all (valid or not)? */
39
- function blockCarriesGguiMetaKey(block) {
40
- const meta = block._meta;
41
- return (typeof meta === "object" && meta !== null && !Array.isArray(meta) && GGUI_RENDER_META_KEY in meta);
42
- }
43
44
  /**
44
- * A live `tool-result` block → the card to mount, across both channels.
45
- * `undefined` when the block carries no generative UI at all (or carries a
46
- * ggui render whose bootstrap did not reach us — see `ggui-render.ts`).
45
+ * A live `tool-result` block → the card to mount: an inline resource, else the
46
+ * `ui://` locator (either channel see `toolResultLocator`), else `undefined`
47
+ * when the block carries no generative UI at all.
48
+ *
49
+ * A locator on a LIVE turn resolves through the pod door (its live-card
50
+ * ledger registers the locator the moment the result streams — guuey#209
51
+ * C1/C5); the same locator persisted resolves through the platform door.
52
+ * One authority per lifecycle phase, one dispatcher for both.
47
53
  */
48
54
  export function toolResultViewMount(block) {
49
55
  const inline = toolResultUiResource(block);
50
56
  if (inline)
51
57
  return { resource: inline, channel: "inline" };
52
- const ggui = toolResultGguiRender(block);
53
- const resource = ggui ? gguiRenderResource(ggui) : undefined;
54
- if (resource)
55
- return { resource, channel: "ggui" };
56
- // A live locator whose mount material didn't reach us (a fold that
57
- // dropped `_meta`, or a producer that never sent it — the locator then
58
- // rides `structuredContent`, see `toolResultLocator`): re-fetch works on
59
- // live turns too — the resource is freshly minted (guuey#122). One
60
- // diagnostic when `_meta` DID carry the
61
- // vendor key but failed validation — a producer bug would otherwise be
62
- // indistinguishable from a meta-less fold (blank UI, zero errors).
63
- if (ggui && !ggui.bootstrap && blockCarriesGguiMetaKey(block)) {
64
- console.warn(`mcp-apps-host: tool result ${block.toolCallId} carries a malformed ggui render bootstrap — degrading to the locator channel`);
65
- }
66
58
  const locator = toolResultLocator(block);
67
59
  return locator !== undefined ? { channel: "locator", resourceUri: locator } : undefined;
68
60
  }
69
61
  /**
70
62
  * A persisted `HistoryCard`'s `cardSnapshot` → the card to mount.
71
63
  *
72
- * There is deliberately NO bootstrap arm here (guuey#122): persistence
73
- * strips tool-result `_meta` (see `@guuey/threads`' fold-rows), and a
74
- * foreign snapshot that still carries one holds an expired `wsToken` — a
75
- * dead mount. A persisted `ui://` locator resolves to the `"locator"`
76
- * channel instead: rehydration is a fresh `resources/read` of the uri,
77
- * the spec-consistent template fetch, vendor-neutral.
64
+ * Same two arms as the live dispatcher (since guuey#209 there is no third):
65
+ * an inline resource, else the `ui://` locator. Persistence strips
66
+ * tool-result `_meta` (see `@guuey/threads`' fold-rows), and a foreign
67
+ * snapshot that still carries a stale bootstrap is ignored — its `wsToken`
68
+ * expired minutes after the render. Rehydration is a fresh `resources/read`
69
+ * of the uri, the spec-consistent template fetch, vendor-neutral.
78
70
  */
79
71
  export function snapshotViewMount(cardSnapshot) {
80
72
  const inline = snapshotUiResource(cardSnapshot);
@@ -1,61 +1,71 @@
1
1
  /**
2
- * The **ggui render** channel: narrowing + self-contained shell construction
3
- * for a generative-UI card produced by the ggui MCP server (`ggui_render`).
2
+ * @deprecated — the ggui vendor arm is RETIRED (guuey#209, 2026-08-16).
4
3
  *
5
- * ## Where the pieces live (guuey#108 / ggui#427)
4
+ * Everything in this module is kept exported for ONE MINOR under the
5
+ * post-launch compatibility rule and is removed in the minor after the one
6
+ * that ships this notice. Nothing in `@guuey/mcp-apps-host` calls it any
7
+ * more: `toolResultViewMount` hands a ggui render back as a `ui://`
8
+ * **locator** (`toolResultLocator`, either channel), the mount material
9
+ * comes from a `resources/read` through a `UiResourceReader` (pod door
10
+ * live, persisted door on rehydration), and the `"ggui"` sandbox-trust
11
+ * channel is assigned at resolution from the requested uri
12
+ * (`uiResourceChannel` in `reader.ts`). Migration per symbol:
6
13
  *
7
- * The two halves of this channel have different owners, and the module is
8
- * split along that line:
14
+ * - {@link asGguiRender} / {@link toolResultGguiRender} /
15
+ * {@link blockGguiRender} `toolResultLocator(block)` — the locator is
16
+ * the recognition signal; there is no descriptor to build.
17
+ * - {@link gguiRenderResource} → resolve the locator through a reader
18
+ * (`resolveViewMount(mount, reader)`); ggui's `resources/read` returns
19
+ * the shell with live-channel material minted FRESH at read time.
20
+ * - {@link GGUI_RENDER_META_KEY} → the wire key is ggui's; import
21
+ * `MCP_APP_AI_GGUI_RENDER_META_KEY` from
22
+ * `@ggui-ai/protocol/integrations/mcp-apps` if you still inspect
23
+ * `_meta` (nothing here does).
24
+ * - {@link asGguiRenderBootstrap} / {@link gguiShellHtml} and their types
25
+ * are pure re-exports of ggui's protocol package — import them from
26
+ * `@ggui-ai/protocol/integrations/mcp-apps` directly.
9
27
  *
10
- * - **ggui's wire contract** what makes a `_meta` slice a mountable
11
- * render bootstrap, and what the self-contained shell must contain — is
12
- * OWNED by ggui and imported from
13
- * `@ggui-ai/protocol/integrations/mcp-apps` ({@link asGguiRenderBootstrap},
14
- * {@link gguiShellHtml}, the `ai.ggui/render` key). This package used to
15
- * carry byte-compatible private copies (lifted upstream as ggui#427);
16
- * re-exporting the originals means a shell-contract change lands here by
17
- * bumping the pin, not by mirror-editing two repos.
18
- * - **host/silverprotocol shapes** — the `uiData`-keyed RECOGNITION signal,
19
- * the `AgBlock` tool-result narrowing, and the `McpUiResourcePayload`
20
- * adapter onto the host's existing mcp-ui mount path — are guuey-side
21
- * contracts and stay implemented here.
28
+ * ## Why the arm existed, for the record
22
29
  *
23
- * ## Why recognition and mounting are separate
24
- *
25
- * A ggui render's `tool.done` carries two distinct signals:
26
- *
27
- * 1. **`uiData.resourceUri` is the RECOGNITION signal.** It is the only part
28
- * of the render's identity that survives `@silverprotocol/core`'s fold
29
- * (the reducer copies `uiData` and, as of `@silverprotocol/core`
30
- * 0.4.1 (workspace#9), `_meta` onto the `tool-result` block).
31
- * 2. **`_meta["ai.ggui/render"]` is the MOUNT MATERIAL.** Everything needed
32
- * to boot the card which runtime bundle to load, which live-channel to
33
- * open, which props to seed — lives there and nowhere else.
34
- *
35
- * The shell {@link gguiShellHtml} builds is a string of HTML, so the ggui
36
- * card rides the host's EXISTING mcp-ui mount path unchanged: it narrows to
37
- * the same `McpUiResourcePayload` an inline resource does, so
38
- * `@mcp-ui/client`'s `AppRenderer` posts it as `srcdoc` into the
39
- * second-origin `mcp-app-sandbox.html` page — same double-iframe rule, same
40
- * sandbox origin, same opaque inner frame. No second mount mechanism.
41
- *
42
- * NOT in scope here: rehydrating a ggui card from persisted history. The
43
- * bootstrap's `wsToken` expires minutes after the render, so a stored
44
- * bootstrap is dead on arrival — a history card resolves to the `locator`
45
- * channel (`card-mount.ts`, guuey#122) and remounts by a fresh
46
- * `resources/read`, never a bootstrap replay.
30
+ * A ggui render's `tool.done` used to carry two signals: `uiData.resourceUri`
31
+ * (recognition — the only part surviving the fold) and the
32
+ * `_meta["ai.ggui/render"]` bootstrap (mount material: runtime bundle,
33
+ * live channel, seeded props). Because guuey's chat client is not an MCP
34
+ * client (the pod holds the connection), a live locator had no host-side
35
+ * read channel, so the bootstrap was inlined as a read-skipping fast path
36
+ * and this module built ggui's self-contained shell from it. The pod door
37
+ * (`GET <pod>/agent/ui-resource`, guuey#209 C1) closed that gap; ggui's
38
+ * read-time mint (C2) made the read strictly fresher than the inlined
39
+ * copy; the vendor arm's only reason to exist was gone.
47
40
  */
48
41
  import type { AgBlock, JsonValue } from "@silverprotocol/core";
49
42
  import { type GguiRenderBootstrap } from "@ggui-ai/protocol/integrations/mcp-apps";
50
43
  import { type McpUiResourcePayload } from "./block-ui.js";
51
- export { asGguiRenderBootstrap, gguiShellHtml, } from "@ggui-ai/protocol/integrations/mcp-apps";
52
- export type { GguiRenderBootstrap, GguiShellHtmlOptions, } from "@ggui-ai/protocol/integrations/mcp-apps";
44
+ export {
45
+ /** @deprecated import from `@ggui-ai/protocol/integrations/mcp-apps` (guuey#209; removed next minor). */
46
+ asGguiRenderBootstrap,
47
+ /** @deprecated import from `@ggui-ai/protocol/integrations/mcp-apps` (guuey#209; removed next minor). */
48
+ gguiShellHtml, } from "@ggui-ai/protocol/integrations/mcp-apps";
49
+ export type {
50
+ /** @deprecated import from `@ggui-ai/protocol/integrations/mcp-apps` (guuey#209; removed next minor). */
51
+ GguiRenderBootstrap,
52
+ /** @deprecated import from `@ggui-ai/protocol/integrations/mcp-apps` (guuey#209; removed next minor). */
53
+ GguiShellHtmlOptions, } from "@ggui-ai/protocol/integrations/mcp-apps";
53
54
  /**
54
55
  * The `_meta` key the ggui render bootstrap rides on. Alias of the
55
56
  * protocol package's own constant — one spelling, owned upstream.
57
+ *
58
+ * @deprecated guuey#209 — nothing in this package reads `_meta` any more.
59
+ * Import `MCP_APP_AI_GGUI_RENDER_META_KEY` from
60
+ * `@ggui-ai/protocol/integrations/mcp-apps` if you still need the key.
61
+ * Removed in the minor after the one shipping this notice.
56
62
  */
57
63
  export declare const GGUI_RENDER_META_KEY: "ai.ggui/render";
58
- /** A ggui render recognised on a tool result: its resource uri + mount material. */
64
+ /**
65
+ * A ggui render recognised on a tool result: its resource uri + mount material.
66
+ * @deprecated guuey#209 — the locator (`toolResultLocator`) is the whole
67
+ * recognition signal now; there is no descriptor to build. Removed next minor.
68
+ */
59
69
  export interface GguiRenderDescriptor {
60
70
  /** `uiData.resourceUri` — `ui://ggui/render/<sessionId>/<contractHash>`. */
61
71
  resourceUri: string;
@@ -75,6 +85,9 @@ export interface GguiRenderDescriptor {
75
85
  * The `ui://` scheme gate is deliberate: `uiData` is a general-purpose channel
76
86
  * (every `structuredContent` of a `_meta.ui`-stamped tool lands there), so a
77
87
  * bare `resourceUri` string is not on its own a claim of generative UI.
88
+ *
89
+ * @deprecated guuey#209 — use `toolResultLocator(block)`; the vendor arm is
90
+ * retired and nothing consumes the descriptor. Removed next minor.
78
91
  */
79
92
  export declare function asGguiRender(uiData: JsonValue | undefined, meta: JsonValue | undefined): GguiRenderDescriptor | undefined;
80
93
  /**
@@ -84,17 +97,28 @@ export declare function asGguiRender(uiData: JsonValue | undefined, meta: JsonVa
84
97
  * same name that narrows a spec-canonical MCP `CallToolResult` instead. This
85
98
  * one is the silverprotocol-side twin — the input is the FOLDED block, whose
86
99
  * `uiData`/`_meta` carriage is `@silverprotocol/core`'s contract, not ggui's.
100
+ *
101
+ * @deprecated guuey#209 — use `toolResultLocator(block)`. Removed next minor.
87
102
  */
88
103
  export declare function toolResultGguiRender(block: Extract<AgBlock, {
89
104
  type: "tool-result";
90
105
  }>): GguiRenderDescriptor | undefined;
91
- /** An untyped (persisted-snapshot) block → its ggui render descriptor, if it is one. */
106
+ /**
107
+ * An untyped (persisted-snapshot) block → its ggui render descriptor, if it is one.
108
+ * @deprecated guuey#209 — use `snapshotViewMount(cardSnapshot)`, whose locator
109
+ * arm is the persisted path. Removed next minor.
110
+ */
92
111
  export declare function blockGguiRender(block: JsonValue): GguiRenderDescriptor | undefined;
93
112
  /**
94
113
  * A ggui render descriptor → the mountable resource the host's existing
95
114
  * mcp-ui path already knows how to mount, or `undefined` when the descriptor
96
115
  * carries no bootstrap (history cards, and any fold that dropped `_meta`).
97
116
  *
117
+ * @deprecated guuey#209 — resolve the locator through a `UiResourceReader`
118
+ * (`resolveViewMount`); ggui's `resources/read` returns the shell with
119
+ * live-channel material minted FRESH at read time, which this inlined
120
+ * copy could never be. Removed next minor.
121
+ *
98
122
  * The `uri` is the render's REAL `resourceUri` — the shell is the payload, not
99
123
  * a renaming of the resource.
100
124
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ggui-render.d.ts","sourceRoot":"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B,GAAG,SAAS,CAOlC"}
@@ -1,9 +1,18 @@
1
1
  import { asGguiRenderBootstrap, gguiShellHtml, MCP_APP_AI_GGUI_RENDER_META_KEY, } from "@ggui-ai/protocol/integrations/mcp-apps";
2
2
  import { isJsonObject } from "./block-ui.js";
3
- export { asGguiRenderBootstrap, gguiShellHtml, } from "@ggui-ai/protocol/integrations/mcp-apps";
3
+ export {
4
+ /** @deprecated import from `@ggui-ai/protocol/integrations/mcp-apps` (guuey#209; removed next minor). */
5
+ asGguiRenderBootstrap,
6
+ /** @deprecated import from `@ggui-ai/protocol/integrations/mcp-apps` (guuey#209; removed next minor). */
7
+ gguiShellHtml, } from "@ggui-ai/protocol/integrations/mcp-apps";
4
8
  /**
5
9
  * The `_meta` key the ggui render bootstrap rides on. Alias of the
6
10
  * protocol package's own constant — one spelling, owned upstream.
11
+ *
12
+ * @deprecated guuey#209 — nothing in this package reads `_meta` any more.
13
+ * Import `MCP_APP_AI_GGUI_RENDER_META_KEY` from
14
+ * `@ggui-ai/protocol/integrations/mcp-apps` if you still need the key.
15
+ * Removed in the minor after the one shipping this notice.
7
16
  */
8
17
  export const GGUI_RENDER_META_KEY = MCP_APP_AI_GGUI_RENDER_META_KEY;
9
18
  /** The `ui://` scheme prefix every ggui render resource uri carries. */
@@ -15,6 +24,9 @@ const UI_SCHEME = "ui://";
15
24
  * The `ui://` scheme gate is deliberate: `uiData` is a general-purpose channel
16
25
  * (every `structuredContent` of a `_meta.ui`-stamped tool lands there), so a
17
26
  * bare `resourceUri` string is not on its own a claim of generative UI.
27
+ *
28
+ * @deprecated guuey#209 — use `toolResultLocator(block)`; the vendor arm is
29
+ * retired and nothing consumes the descriptor. Removed next minor.
18
30
  */
19
31
  export function asGguiRender(uiData, meta) {
20
32
  if (!isJsonObject(uiData))
@@ -36,11 +48,17 @@ export function asGguiRender(uiData, meta) {
36
48
  * same name that narrows a spec-canonical MCP `CallToolResult` instead. This
37
49
  * one is the silverprotocol-side twin — the input is the FOLDED block, whose
38
50
  * `uiData`/`_meta` carriage is `@silverprotocol/core`'s contract, not ggui's.
51
+ *
52
+ * @deprecated guuey#209 — use `toolResultLocator(block)`. Removed next minor.
39
53
  */
40
54
  export function toolResultGguiRender(block) {
41
55
  return asGguiRender(block.uiData, block._meta);
42
56
  }
43
- /** An untyped (persisted-snapshot) block → its ggui render descriptor, if it is one. */
57
+ /**
58
+ * An untyped (persisted-snapshot) block → its ggui render descriptor, if it is one.
59
+ * @deprecated guuey#209 — use `snapshotViewMount(cardSnapshot)`, whose locator
60
+ * arm is the persisted path. Removed next minor.
61
+ */
44
62
  export function blockGguiRender(block) {
45
63
  if (!isJsonObject(block))
46
64
  return undefined;
@@ -53,6 +71,11 @@ export function blockGguiRender(block) {
53
71
  * mcp-ui path already knows how to mount, or `undefined` when the descriptor
54
72
  * carries no bootstrap (history cards, and any fold that dropped `_meta`).
55
73
  *
74
+ * @deprecated guuey#209 — resolve the locator through a `UiResourceReader`
75
+ * (`resolveViewMount`); ggui's `resources/read` returns the shell with
76
+ * live-channel material minted FRESH at read time, which this inlined
77
+ * copy could never be. Removed next minor.
78
+ *
56
79
  * The `uri` is the render's REAL `resourceUri` — the shell is the payload, not
57
80
  * a renaming of the resource.
58
81
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,4BAA4B,EAC5B,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACT,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,GAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,yBAAyB,EACzB,eAAe,EACf,0BAA0B,EAC1B,wBAAwB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,aAAa,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,0BAA0B,EAC1B,6BAA6B,EAC7B,KAAK,yBAAyB,GAC/B,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,4BAA4B,EAC5B,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,EACL,yBAAyB,EACzB,mBAAmB,EACnB,0BAA0B,EAC1B,6BAA6B,EAC7B,KAAK,yBAAyB,GAC/B,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -4,6 +4,11 @@
4
4
  * the conformance map (guuey#123).
5
5
  */
6
6
  export { asResourcePayload, asUiResource, blockUiResource, isJsonObject, resourceHtml, scanProviderRawForUiResource, snapshotUiResource, toolResultLocator, toolResultUiResource, uiLocator, } from "./block-ui.js";
7
+ // The retired ggui vendor arm (guuey#209, 2026-08-16). Every symbol below
8
+ // is `@deprecated` and stays exported for ONE MINOR under the post-launch
9
+ // compat rule — removed in the minor after the one shipping this notice.
10
+ // Nothing in this package calls them; `toolResultViewMount` hands a ggui
11
+ // render back as a locator, and the reader assigns the "ggui" channel.
7
12
  export { asGguiRender, asGguiRenderBootstrap, blockGguiRender, gguiRenderResource, gguiShellHtml, toolResultGguiRender, GGUI_RENDER_META_KEY, } from "./ggui-render.js";
8
13
  export { resolveViewMount, snapshotViewMount, toolResultViewMount, } from "./card-mount.js";
9
14
  export { createMcpUiResourceReader, uiResourceChannel, } from "./reader.js";
@@ -27,8 +27,9 @@
27
27
  * Types and method names come from `@modelcontextprotocol/ext-apps` — the
28
28
  * SEP-1865 surface itself, someone else's frozen contract. Zero ggui
29
29
  * imports, deliberately (guuey#123): this host answers ANY spec-following
30
- * view; everything ggui-specific stays in `ggui-render.ts` behind ggui's
31
- * own published protocol package.
30
+ * view. (The ggui vendor arm that used to live beside it in
31
+ * `ggui-render.ts` retired 2026-08-16 — guuey#209; that module is now
32
+ * deprecated re-exports only.)
32
33
  */
33
34
  import { type McpUiHostCapabilities, type McpUiHostContext, type McpUiInitializeResult } from "@modelcontextprotocol/ext-apps";
34
35
  import type { McpToolStructuredContent } from "./action.js";
@@ -1 +1 @@
1
- {"version":3,"file":"view-host-protocol.d.ts","sourceRoot":"","sources":["../src/view-host-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;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IACjC,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B;AAiCD,iFAAiF;AACjF,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,gBAAgB,EAC1B,wBAAwB,EAAE,OAAO,GAChC,qBAAqB,CAcvB;AAED,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,aAAa,EACjB,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GACjC,gBAAgB,CAElB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,aAAa,EACjB,KAAK,EAAE,qBAAqB,GAAG,SAAS,GACvC,gBAAgB,CASlB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,gBAAgB,CAElD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,gBAAgB,EAC1B,IAAI,EAAE,OAAO,GACZ,kBAAkB,CAuFpB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,CAEnE"}
@@ -27,8 +27,9 @@
27
27
  * Types and method names come from `@modelcontextprotocol/ext-apps` — the
28
28
  * SEP-1865 surface itself, someone else's frozen contract. Zero ggui
29
29
  * imports, deliberately (guuey#123): this host answers ANY spec-following
30
- * view; everything ggui-specific stays in `ggui-render.ts` behind ggui's
31
- * own published protocol package.
30
+ * view. (The ggui vendor arm that used to live beside it in
31
+ * `ggui-render.ts` retired 2026-08-16 — guuey#209; that module is now
32
+ * deprecated re-exports only.)
32
33
  */
33
34
  import { INITIALIZE_METHOD, LATEST_PROTOCOL_VERSION, RESOURCE_TEARDOWN_METHOD, SIZE_CHANGED_METHOD, } from "@modelcontextprotocol/ext-apps";
34
35
  /** JSON-RPC `method not found` — the spec's code, not an invented one. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guuey/mcp-apps-host",
3
- "version": "0.6.1",
3
+ "version": "0.7.1",
4
4
  "description": "The MCP Apps (SEP-1865) Host role for guuey's chat surfaces — view-mount narrowing across UI channels, ui:// locator rehydration by resources/read, and the sandbox-trust channel contract. Vendor-neutral: any spec-following MCP App mounts through it.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/card-mount.ts CHANGED
@@ -1,52 +1,54 @@
1
1
  /**
2
2
  * The card-mount dispatcher: ONE narrowing that answers "what, if anything,
3
- * does this block mount?" across BOTH generative-UI channels a guuey pod
4
- * emits.
3
+ * does this block mount?" for every generative-UI shape a guuey pod emits.
5
4
  *
6
5
  * 1. **inline mcp-ui resource** — `{uri, text|blob}` on `uiData`, or a
7
6
  * `ui://` resource degraded into a `provider-raw` content part. Handled
8
7
  * verbatim by `block-ui.ts`; this module does not touch that path, it
9
8
  * only tries it FIRST.
10
- * 2. **ggui render** — `uiData.resourceUri` + the `_meta["ai.ggui/render"]`
11
- * bootstrap, mounted through ggui's self-contained shell. See
12
- * `ggui-render.ts`.
9
+ * 2. **`ui://` locator** — the durable identity of a view produced by ANY
10
+ * MCP server (ggui's `ggui_render` included), on `uiData.resourceUri`
11
+ * when the producer sent `_meta.ui` (AgJSON §2.1 surface routing) or on
12
+ * `structuredContent.resourceUri` when it did not. The host resolves it
13
+ * by a fresh, authenticated `resources/read` of the uri
14
+ * ({@link UiResourceReader}) — the spec-consistent template fetch, on
15
+ * the live turn (pod door) and on rehydration (persisted door) alike.
13
16
  *
14
- * Both channels land on the SAME `McpUiResourcePayload`, which is the whole
15
- * point: a host that already mounts inline resources through
16
- * `@mcp-ui/client`'s `AppRenderer` in a second-origin sandbox gains ggui cards
17
- * without a second mount mechanism, a second iframe contract, or a second
18
- * security posture to review.
17
+ * ## The ggui vendor arm is retired (guuey#209, 2026-08-16)
19
18
  *
20
- * Precedence is inline-first and deliberate: an inline resource is the
21
- * server's explicit, self-sufficient HTML. A ggui render only ever wins when
22
- * there is no inline resource to prefer, so this dispatcher can never change
23
- * what an existing inline card renders.
19
+ * This dispatcher used to carry a THIRD arm: when a `tool-result` carried the
20
+ * `_meta["ai.ggui/render"]` bootstrap it built ggui's self-contained shell
21
+ * inline and mounted it without a read a fast path that existed only
22
+ * because the pod holds the MCP connection and a live locator had no host-
23
+ * side read channel. That precondition is gone: the pod door
24
+ * (`GET <pod>/agent/ui-resource`) answers live-turn locators, the persisted
25
+ * door answers rehydration, and ggui's `resources/read` mints the live-
26
+ * channel material FRESH at read time — strictly fresher than any inlined
27
+ * bootstrap. A ggui render is therefore just another locator producer; live
28
+ * == rehydrated == spec. The arm's narrowing helpers stay exported one
29
+ * minor as `@deprecated` (`ggui-render.ts`); nothing here consumes them.
24
30
  *
25
31
  * ## Why the CHANNEL is returned alongside the resource
26
32
  *
27
- * The payload alone cannot say where it came from — a ggui shell is a string
33
+ * The payload alone cannot say where it came from — ggui's shell is a string
28
34
  * of HTML like any other. But a host has one decision that genuinely depends
29
35
  * on the origin of that HTML: WHICH sandbox host page to mount it in. A ggui
30
36
  * shell must load ggui's runtime bundle and open its WSS, so it needs a page
31
37
  * whose CSP names the ggui origins; an inline card is arbitrary tenant HTML
32
- * and must keep the self-only page it has always had. Handing back the channel
33
- * keeps that one narrowing in one place the alternative was for every host
34
- * to re-run `toolResultGguiRender` beside this call and ask again.
38
+ * and must keep the self-only page it has always had. Since the flip the
39
+ * channel is assigned at RESOLUTION time from the requested locator uri
40
+ * (`uiResourceChannel` in `reader.ts` `ui://ggui/…` `"ggui"`), never
41
+ * from the response and never from mount material a producer inlined.
35
42
  */
36
43
  import { snapshotUiResource, toolResultLocator, toolResultUiResource, type McpUiResourcePayload } from "./block-ui.js";
37
- import { GGUI_RENDER_META_KEY, gguiRenderResource, toolResultGguiRender } from "./ggui-render.js";
38
44
  import type { AgBlock, JsonValue } from "@silverprotocol/core";
39
45
 
40
-
41
- /** Does the block's `_meta` carry the ggui render key at all (valid or not)? */
42
- function blockCarriesGguiMetaKey(block: Extract<AgBlock, { type: "tool-result" }>): boolean {
43
- const meta = block._meta;
44
- return (
45
- typeof meta === "object" && meta !== null && !Array.isArray(meta) && GGUI_RENDER_META_KEY in meta
46
- );
47
- }
48
-
49
- /** Which generative-UI channel produced a mount. See this module's header. */
46
+ /**
47
+ * Which sandbox-trust channel a mount rides. See this module's header.
48
+ * `"ggui"` is assigned at RESOLUTION time from the requested locator uri
49
+ * (`uiResourceChannel`) — a `toolResultViewMount` result is only ever
50
+ * `"inline"` or `"locator"`.
51
+ */
50
52
  export type ViewMountChannel = "inline" | "ggui" | "locator";
51
53
 
52
54
  /**
@@ -71,6 +73,8 @@ export type ViewMount = ResolvedViewMount | LocatorViewMount;
71
73
  * A view with mount material in hand — the arms a host can render directly,
72
74
  * and the ONLY arms a `UiResourceReader` resolves (guuey#127): a read either
73
75
  * yields mount material or the honest placeholder, never another locator.
76
+ * `"ggui"` here always comes from a reader (`uiResourceChannel` on the
77
+ * requested uri) — no dispatcher in this module produces it.
74
78
  */
75
79
  export interface ResolvedViewMount {
76
80
  channel: "inline" | "ggui";
@@ -97,30 +101,20 @@ export interface LocatorViewMount {
97
101
  export type UiResourceReader = (resourceUri: string) => Promise<ViewMount | undefined>;
98
102
 
99
103
  /**
100
- * A live `tool-result` block → the card to mount, across both channels.
101
- * `undefined` when the block carries no generative UI at all (or carries a
102
- * ggui render whose bootstrap did not reach us — see `ggui-render.ts`).
104
+ * A live `tool-result` block → the card to mount: an inline resource, else the
105
+ * `ui://` locator (either channel see `toolResultLocator`), else `undefined`
106
+ * when the block carries no generative UI at all.
107
+ *
108
+ * A locator on a LIVE turn resolves through the pod door (its live-card
109
+ * ledger registers the locator the moment the result streams — guuey#209
110
+ * C1/C5); the same locator persisted resolves through the platform door.
111
+ * One authority per lifecycle phase, one dispatcher for both.
103
112
  */
104
113
  export function toolResultViewMount(
105
114
  block: Extract<AgBlock, { type: "tool-result" }>,
106
115
  ): ViewMount | undefined {
107
116
  const inline = toolResultUiResource(block);
108
117
  if (inline) return { resource: inline, channel: "inline" };
109
- const ggui = toolResultGguiRender(block);
110
- const resource = ggui ? gguiRenderResource(ggui) : undefined;
111
- if (resource) return { resource, channel: "ggui" };
112
- // A live locator whose mount material didn't reach us (a fold that
113
- // dropped `_meta`, or a producer that never sent it — the locator then
114
- // rides `structuredContent`, see `toolResultLocator`): re-fetch works on
115
- // live turns too — the resource is freshly minted (guuey#122). One
116
- // diagnostic when `_meta` DID carry the
117
- // vendor key but failed validation — a producer bug would otherwise be
118
- // indistinguishable from a meta-less fold (blank UI, zero errors).
119
- if (ggui && !ggui.bootstrap && blockCarriesGguiMetaKey(block)) {
120
- console.warn(
121
- `mcp-apps-host: tool result ${block.toolCallId} carries a malformed ggui render bootstrap — degrading to the locator channel`,
122
- );
123
- }
124
118
  const locator = toolResultLocator(block);
125
119
  return locator !== undefined ? { channel: "locator", resourceUri: locator } : undefined;
126
120
  }
@@ -128,12 +122,12 @@ export function toolResultViewMount(
128
122
  /**
129
123
  * A persisted `HistoryCard`'s `cardSnapshot` → the card to mount.
130
124
  *
131
- * There is deliberately NO bootstrap arm here (guuey#122): persistence
132
- * strips tool-result `_meta` (see `@guuey/threads`' fold-rows), and a
133
- * foreign snapshot that still carries one holds an expired `wsToken` — a
134
- * dead mount. A persisted `ui://` locator resolves to the `"locator"`
135
- * channel instead: rehydration is a fresh `resources/read` of the uri,
136
- * the spec-consistent template fetch, vendor-neutral.
125
+ * Same two arms as the live dispatcher (since guuey#209 there is no third):
126
+ * an inline resource, else the `ui://` locator. Persistence strips
127
+ * tool-result `_meta` (see `@guuey/threads`' fold-rows), and a foreign
128
+ * snapshot that still carries a stale bootstrap is ignored — its `wsToken`
129
+ * expired minutes after the render. Rehydration is a fresh `resources/read`
130
+ * of the uri, the spec-consistent template fetch, vendor-neutral.
137
131
  */
138
132
  export function snapshotViewMount(cardSnapshot: JsonValue): ViewMount | undefined {
139
133
  const inline = snapshotUiResource(cardSnapshot);
@@ -1,49 +1,42 @@
1
1
  /**
2
- * The **ggui render** channel: narrowing + self-contained shell construction
3
- * for a generative-UI card produced by the ggui MCP server (`ggui_render`).
2
+ * @deprecated — the ggui vendor arm is RETIRED (guuey#209, 2026-08-16).
4
3
  *
5
- * ## Where the pieces live (guuey#108 / ggui#427)
4
+ * Everything in this module is kept exported for ONE MINOR under the
5
+ * post-launch compatibility rule and is removed in the minor after the one
6
+ * that ships this notice. Nothing in `@guuey/mcp-apps-host` calls it any
7
+ * more: `toolResultViewMount` hands a ggui render back as a `ui://`
8
+ * **locator** (`toolResultLocator`, either channel), the mount material
9
+ * comes from a `resources/read` through a `UiResourceReader` (pod door
10
+ * live, persisted door on rehydration), and the `"ggui"` sandbox-trust
11
+ * channel is assigned at resolution from the requested uri
12
+ * (`uiResourceChannel` in `reader.ts`). Migration per symbol:
6
13
  *
7
- * The two halves of this channel have different owners, and the module is
8
- * split along that line:
14
+ * - {@link asGguiRender} / {@link toolResultGguiRender} /
15
+ * {@link blockGguiRender} `toolResultLocator(block)` — the locator is
16
+ * the recognition signal; there is no descriptor to build.
17
+ * - {@link gguiRenderResource} → resolve the locator through a reader
18
+ * (`resolveViewMount(mount, reader)`); ggui's `resources/read` returns
19
+ * the shell with live-channel material minted FRESH at read time.
20
+ * - {@link GGUI_RENDER_META_KEY} → the wire key is ggui's; import
21
+ * `MCP_APP_AI_GGUI_RENDER_META_KEY` from
22
+ * `@ggui-ai/protocol/integrations/mcp-apps` if you still inspect
23
+ * `_meta` (nothing here does).
24
+ * - {@link asGguiRenderBootstrap} / {@link gguiShellHtml} and their types
25
+ * are pure re-exports of ggui's protocol package — import them from
26
+ * `@ggui-ai/protocol/integrations/mcp-apps` directly.
9
27
  *
10
- * - **ggui's wire contract** what makes a `_meta` slice a mountable
11
- * render bootstrap, and what the self-contained shell must contain — is
12
- * OWNED by ggui and imported from
13
- * `@ggui-ai/protocol/integrations/mcp-apps` ({@link asGguiRenderBootstrap},
14
- * {@link gguiShellHtml}, the `ai.ggui/render` key). This package used to
15
- * carry byte-compatible private copies (lifted upstream as ggui#427);
16
- * re-exporting the originals means a shell-contract change lands here by
17
- * bumping the pin, not by mirror-editing two repos.
18
- * - **host/silverprotocol shapes** — the `uiData`-keyed RECOGNITION signal,
19
- * the `AgBlock` tool-result narrowing, and the `McpUiResourcePayload`
20
- * adapter onto the host's existing mcp-ui mount path — are guuey-side
21
- * contracts and stay implemented here.
28
+ * ## Why the arm existed, for the record
22
29
  *
23
- * ## Why recognition and mounting are separate
24
- *
25
- * A ggui render's `tool.done` carries two distinct signals:
26
- *
27
- * 1. **`uiData.resourceUri` is the RECOGNITION signal.** It is the only part
28
- * of the render's identity that survives `@silverprotocol/core`'s fold
29
- * (the reducer copies `uiData` and, as of `@silverprotocol/core`
30
- * 0.4.1 (workspace#9), `_meta` onto the `tool-result` block).
31
- * 2. **`_meta["ai.ggui/render"]` is the MOUNT MATERIAL.** Everything needed
32
- * to boot the card which runtime bundle to load, which live-channel to
33
- * open, which props to seed — lives there and nowhere else.
34
- *
35
- * The shell {@link gguiShellHtml} builds is a string of HTML, so the ggui
36
- * card rides the host's EXISTING mcp-ui mount path unchanged: it narrows to
37
- * the same `McpUiResourcePayload` an inline resource does, so
38
- * `@mcp-ui/client`'s `AppRenderer` posts it as `srcdoc` into the
39
- * second-origin `mcp-app-sandbox.html` page — same double-iframe rule, same
40
- * sandbox origin, same opaque inner frame. No second mount mechanism.
41
- *
42
- * NOT in scope here: rehydrating a ggui card from persisted history. The
43
- * bootstrap's `wsToken` expires minutes after the render, so a stored
44
- * bootstrap is dead on arrival — a history card resolves to the `locator`
45
- * channel (`card-mount.ts`, guuey#122) and remounts by a fresh
46
- * `resources/read`, never a bootstrap replay.
30
+ * A ggui render's `tool.done` used to carry two signals: `uiData.resourceUri`
31
+ * (recognition — the only part surviving the fold) and the
32
+ * `_meta["ai.ggui/render"]` bootstrap (mount material: runtime bundle,
33
+ * live channel, seeded props). Because guuey's chat client is not an MCP
34
+ * client (the pod holds the connection), a live locator had no host-side
35
+ * read channel, so the bootstrap was inlined as a read-skipping fast path
36
+ * and this module built ggui's self-contained shell from it. The pod door
37
+ * (`GET <pod>/agent/ui-resource`, guuey#209 C1) closed that gap; ggui's
38
+ * read-time mint (C2) made the read strictly fresher than the inlined
39
+ * copy; the vendor arm's only reason to exist was gone.
47
40
  */
48
41
  import type { AgBlock, JsonValue } from "@silverprotocol/core";
49
42
  import {
@@ -55,24 +48,37 @@ import {
55
48
  import { isJsonObject, type McpUiResourcePayload } from "./block-ui.js";
56
49
 
57
50
  export {
51
+ /** @deprecated import from `@ggui-ai/protocol/integrations/mcp-apps` (guuey#209; removed next minor). */
58
52
  asGguiRenderBootstrap,
53
+ /** @deprecated import from `@ggui-ai/protocol/integrations/mcp-apps` (guuey#209; removed next minor). */
59
54
  gguiShellHtml,
60
55
  } from "@ggui-ai/protocol/integrations/mcp-apps";
61
56
  export type {
57
+ /** @deprecated import from `@ggui-ai/protocol/integrations/mcp-apps` (guuey#209; removed next minor). */
62
58
  GguiRenderBootstrap,
59
+ /** @deprecated import from `@ggui-ai/protocol/integrations/mcp-apps` (guuey#209; removed next minor). */
63
60
  GguiShellHtmlOptions,
64
61
  } from "@ggui-ai/protocol/integrations/mcp-apps";
65
62
 
66
63
  /**
67
64
  * The `_meta` key the ggui render bootstrap rides on. Alias of the
68
65
  * protocol package's own constant — one spelling, owned upstream.
66
+ *
67
+ * @deprecated guuey#209 — nothing in this package reads `_meta` any more.
68
+ * Import `MCP_APP_AI_GGUI_RENDER_META_KEY` from
69
+ * `@ggui-ai/protocol/integrations/mcp-apps` if you still need the key.
70
+ * Removed in the minor after the one shipping this notice.
69
71
  */
70
72
  export const GGUI_RENDER_META_KEY = MCP_APP_AI_GGUI_RENDER_META_KEY;
71
73
 
72
74
  /** The `ui://` scheme prefix every ggui render resource uri carries. */
73
75
  const UI_SCHEME = "ui://";
74
76
 
75
- /** A ggui render recognised on a tool result: its resource uri + mount material. */
77
+ /**
78
+ * A ggui render recognised on a tool result: its resource uri + mount material.
79
+ * @deprecated guuey#209 — the locator (`toolResultLocator`) is the whole
80
+ * recognition signal now; there is no descriptor to build. Removed next minor.
81
+ */
76
82
  export interface GguiRenderDescriptor {
77
83
  /** `uiData.resourceUri` — `ui://ggui/render/<sessionId>/<contractHash>`. */
78
84
  resourceUri: string;
@@ -93,6 +99,9 @@ export interface GguiRenderDescriptor {
93
99
  * The `ui://` scheme gate is deliberate: `uiData` is a general-purpose channel
94
100
  * (every `structuredContent` of a `_meta.ui`-stamped tool lands there), so a
95
101
  * bare `resourceUri` string is not on its own a claim of generative UI.
102
+ *
103
+ * @deprecated guuey#209 — use `toolResultLocator(block)`; the vendor arm is
104
+ * retired and nothing consumes the descriptor. Removed next minor.
96
105
  */
97
106
  export function asGguiRender(
98
107
  uiData: JsonValue | undefined,
@@ -116,6 +125,8 @@ export function asGguiRender(
116
125
  * same name that narrows a spec-canonical MCP `CallToolResult` instead. This
117
126
  * one is the silverprotocol-side twin — the input is the FOLDED block, whose
118
127
  * `uiData`/`_meta` carriage is `@silverprotocol/core`'s contract, not ggui's.
128
+ *
129
+ * @deprecated guuey#209 — use `toolResultLocator(block)`. Removed next minor.
119
130
  */
120
131
  export function toolResultGguiRender(
121
132
  block: Extract<AgBlock, { type: "tool-result" }>,
@@ -123,7 +134,11 @@ export function toolResultGguiRender(
123
134
  return asGguiRender(block.uiData, block._meta);
124
135
  }
125
136
 
126
- /** An untyped (persisted-snapshot) block → its ggui render descriptor, if it is one. */
137
+ /**
138
+ * An untyped (persisted-snapshot) block → its ggui render descriptor, if it is one.
139
+ * @deprecated guuey#209 — use `snapshotViewMount(cardSnapshot)`, whose locator
140
+ * arm is the persisted path. Removed next minor.
141
+ */
127
142
  export function blockGguiRender(block: JsonValue): GguiRenderDescriptor | undefined {
128
143
  if (!isJsonObject(block)) return undefined;
129
144
  if (block.type !== "tool-result") return undefined;
@@ -135,6 +150,11 @@ export function blockGguiRender(block: JsonValue): GguiRenderDescriptor | undefi
135
150
  * mcp-ui path already knows how to mount, or `undefined` when the descriptor
136
151
  * carries no bootstrap (history cards, and any fold that dropped `_meta`).
137
152
  *
153
+ * @deprecated guuey#209 — resolve the locator through a `UiResourceReader`
154
+ * (`resolveViewMount`); ggui's `resources/read` returns the shell with
155
+ * live-channel material minted FRESH at read time, which this inlined
156
+ * copy could never be. Removed next minor.
157
+ *
138
158
  * The `uri` is the render's REAL `resourceUri` — the shell is the payload, not
139
159
  * a renaming of the resource.
140
160
  *
package/src/index.ts CHANGED
@@ -16,6 +16,11 @@ export {
16
16
  uiLocator,
17
17
  type McpUiResourcePayload,
18
18
  } from "./block-ui.js";
19
+ // The retired ggui vendor arm (guuey#209, 2026-08-16). Every symbol below
20
+ // is `@deprecated` and stays exported for ONE MINOR under the post-launch
21
+ // compat rule — removed in the minor after the one shipping this notice.
22
+ // Nothing in this package calls them; `toolResultViewMount` hands a ggui
23
+ // render back as a locator, and the reader assigns the "ggui" channel.
19
24
  export {
20
25
  asGguiRender,
21
26
  asGguiRenderBootstrap,
@@ -27,8 +27,9 @@
27
27
  * Types and method names come from `@modelcontextprotocol/ext-apps` — the
28
28
  * SEP-1865 surface itself, someone else's frozen contract. Zero ggui
29
29
  * imports, deliberately (guuey#123): this host answers ANY spec-following
30
- * view; everything ggui-specific stays in `ggui-render.ts` behind ggui's
31
- * own published protocol package.
30
+ * view. (The ggui vendor arm that used to live beside it in
31
+ * `ggui-render.ts` retired 2026-08-16 — guuey#209; that module is now
32
+ * deprecated re-exports only.)
32
33
  */
33
34
  import {
34
35
  INITIALIZE_METHOD,