@guuey/mcp-apps-host 0.7.2 → 0.8.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/dist/card-mount.d.ts +2 -2
- package/dist/card-mount.js +2 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -6
- package/dist/view-host-protocol.d.ts +2 -2
- package/dist/view-host-protocol.js +2 -2
- package/package.json +1 -1
- package/src/card-mount.ts +2 -2
- package/src/index.ts +0 -17
- package/src/view-host-protocol.ts +2 -2
- package/dist/ggui-render.d.ts +0 -144
- package/dist/ggui-render.d.ts.map +0 -1
- package/dist/ggui-render.js +0 -108
- package/src/ggui-render.ts +0 -188
package/dist/card-mount.d.ts
CHANGED
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
* door answers rehydration, and ggui's `resources/read` mints the live-
|
|
26
26
|
* channel material FRESH at read time — strictly fresher than any inlined
|
|
27
27
|
* bootstrap. A ggui render is therefore just another locator producer; live
|
|
28
|
-
* == rehydrated == spec. The arm's narrowing helpers
|
|
29
|
-
* minor as `@deprecated` (`ggui-render.ts`)
|
|
28
|
+
* == rehydrated == spec. The arm's narrowing helpers were exported one
|
|
29
|
+
* minor as `@deprecated` and removed at 0.8.0 (`ggui-render.ts` deleted).
|
|
30
30
|
*
|
|
31
31
|
* ## Why the CHANNEL is returned alongside the resource
|
|
32
32
|
*
|
package/dist/card-mount.js
CHANGED
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
* door answers rehydration, and ggui's `resources/read` mints the live-
|
|
26
26
|
* channel material FRESH at read time — strictly fresher than any inlined
|
|
27
27
|
* bootstrap. A ggui render is therefore just another locator producer; live
|
|
28
|
-
* == rehydrated == spec. The arm's narrowing helpers
|
|
29
|
-
* minor as `@deprecated` (`ggui-render.ts`)
|
|
28
|
+
* == rehydrated == spec. The arm's narrowing helpers were exported one
|
|
29
|
+
* minor as `@deprecated` and removed at 0.8.0 (`ggui-render.ts` deleted).
|
|
30
30
|
*
|
|
31
31
|
* ## Why the CHANNEL is returned alongside the resource
|
|
32
32
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* the conformance map (guuey#123).
|
|
5
5
|
*/
|
|
6
6
|
export { asResourcePayload, asUiResource, blockUiResource, isJsonObject, resourceHtml, scanProviderRawForUiResource, snapshotUiResource, toolResultLocator, toolResultUiResource, uiLocator, type McpUiResourcePayload, } from "./block-ui.js";
|
|
7
|
-
export { asGguiRender, asGguiRenderBootstrap, blockGguiRender, gguiRenderResource, gguiShellHtml, toolResultGguiRender, GGUI_RENDER_META_KEY, type GguiRenderBootstrap, type GguiRenderDescriptor, type GguiShellHtmlOptions, } from "./ggui-render.js";
|
|
8
7
|
export { resolveViewMount, snapshotViewMount, toolResultViewMount, type LocatorViewMount, type ResolvedViewMount, type UiResourceReader, type ViewMount, type ViewMountChannel, } from "./card-mount.js";
|
|
9
8
|
export { createMcpUiResourceReader, uiResourceChannel, type CreateMcpUiResourceReaderDeps, type McpResourceReadResult, } from "./reader.js";
|
|
10
9
|
export { asToolCallResult, createMcpUiActionRelay, unavailableToolCallResult, UI_ACTION_TOOLS, UI_ACTION_UNAVAILABLE_TEXT, UI_SEMANTIC_ACTION_TOOLS, type CreateMcpUiActionRelayDeps, type McpToolCallContent, type McpToolCallResult, type McpToolStructuredContent, type UiActionRequest, } from "./action.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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;
|
|
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,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,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,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,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"}
|
package/dist/index.js
CHANGED
|
@@ -4,12 +4,6 @@
|
|
|
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.
|
|
12
|
-
export { asGguiRender, asGguiRenderBootstrap, blockGguiRender, gguiRenderResource, gguiShellHtml, toolResultGguiRender, GGUI_RENDER_META_KEY, } from "./ggui-render.js";
|
|
13
7
|
export { resolveViewMount, snapshotViewMount, toolResultViewMount, } from "./card-mount.js";
|
|
14
8
|
export { createMcpUiResourceReader, uiResourceChannel, } from "./reader.js";
|
|
15
9
|
export { asToolCallResult, createMcpUiActionRelay, unavailableToolCallResult, UI_ACTION_TOOLS, UI_ACTION_UNAVAILABLE_TEXT, UI_SEMANTIC_ACTION_TOOLS, } from "./action.js";
|
|
@@ -28,8 +28,8 @@
|
|
|
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
30
|
* view. (The ggui vendor arm that used to live beside it in
|
|
31
|
-
* `ggui-render.ts` retired 2026-08-16 — guuey#209;
|
|
32
|
-
* deprecated re-exports
|
|
31
|
+
* `ggui-render.ts` retired 2026-08-16 — guuey#209; the module shipped one
|
|
32
|
+
* minor as deprecated re-exports and was deleted at 0.8.0.)
|
|
33
33
|
*/
|
|
34
34
|
import { type McpUiHostCapabilities, type McpUiHostContext, type McpUiInitializeResult, type McpUiResourceCsp } from "@modelcontextprotocol/ext-apps";
|
|
35
35
|
import type { McpToolStructuredContent } from "./action.js";
|
|
@@ -28,8 +28,8 @@
|
|
|
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
30
|
* view. (The ggui vendor arm that used to live beside it in
|
|
31
|
-
* `ggui-render.ts` retired 2026-08-16 — guuey#209;
|
|
32
|
-
* deprecated re-exports
|
|
31
|
+
* `ggui-render.ts` retired 2026-08-16 — guuey#209; the module shipped one
|
|
32
|
+
* minor as deprecated re-exports and was deleted at 0.8.0.)
|
|
33
33
|
*/
|
|
34
34
|
import { INITIALIZE_METHOD, LATEST_PROTOCOL_VERSION, RESOURCE_TEARDOWN_METHOD, SIZE_CHANGED_METHOD, } from "@modelcontextprotocol/ext-apps";
|
|
35
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.
|
|
3
|
+
"version": "0.8.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
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
* door answers rehydration, and ggui's `resources/read` mints the live-
|
|
26
26
|
* channel material FRESH at read time — strictly fresher than any inlined
|
|
27
27
|
* bootstrap. A ggui render is therefore just another locator producer; live
|
|
28
|
-
* == rehydrated == spec. The arm's narrowing helpers
|
|
29
|
-
* minor as `@deprecated` (`ggui-render.ts`)
|
|
28
|
+
* == rehydrated == spec. The arm's narrowing helpers were exported one
|
|
29
|
+
* minor as `@deprecated` and removed at 0.8.0 (`ggui-render.ts` deleted).
|
|
30
30
|
*
|
|
31
31
|
* ## Why the CHANNEL is returned alongside the resource
|
|
32
32
|
*
|
package/src/index.ts
CHANGED
|
@@ -16,23 +16,6 @@ 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.
|
|
24
|
-
export {
|
|
25
|
-
asGguiRender,
|
|
26
|
-
asGguiRenderBootstrap,
|
|
27
|
-
blockGguiRender,
|
|
28
|
-
gguiRenderResource,
|
|
29
|
-
gguiShellHtml,
|
|
30
|
-
toolResultGguiRender,
|
|
31
|
-
GGUI_RENDER_META_KEY,
|
|
32
|
-
type GguiRenderBootstrap,
|
|
33
|
-
type GguiRenderDescriptor,
|
|
34
|
-
type GguiShellHtmlOptions,
|
|
35
|
-
} from "./ggui-render.js";
|
|
36
19
|
export {
|
|
37
20
|
resolveViewMount,
|
|
38
21
|
snapshotViewMount,
|
|
@@ -28,8 +28,8 @@
|
|
|
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
30
|
* view. (The ggui vendor arm that used to live beside it in
|
|
31
|
-
* `ggui-render.ts` retired 2026-08-16 — guuey#209;
|
|
32
|
-
* deprecated re-exports
|
|
31
|
+
* `ggui-render.ts` retired 2026-08-16 — guuey#209; the module shipped one
|
|
32
|
+
* minor as deprecated re-exports and was deleted at 0.8.0.)
|
|
33
33
|
*/
|
|
34
34
|
import {
|
|
35
35
|
INITIALIZE_METHOD,
|
package/dist/ggui-render.d.ts
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated — the ggui vendor arm is RETIRED (guuey#209, 2026-08-16).
|
|
3
|
-
*
|
|
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:
|
|
13
|
-
*
|
|
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.
|
|
27
|
-
*
|
|
28
|
-
* ## Why the arm existed, for the record
|
|
29
|
-
*
|
|
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.
|
|
40
|
-
*/
|
|
41
|
-
import type { AgBlock, JsonValue } from "@silverprotocol/core";
|
|
42
|
-
import { type GguiRenderBootstrap } from "@ggui-ai/protocol/integrations/mcp-apps";
|
|
43
|
-
import { type McpUiResourcePayload } from "./block-ui.js";
|
|
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";
|
|
54
|
-
/**
|
|
55
|
-
* The `_meta` key the ggui render bootstrap rides on. Alias of the
|
|
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.
|
|
62
|
-
*/
|
|
63
|
-
export declare const GGUI_RENDER_META_KEY: "ai.ggui/render";
|
|
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
|
-
*/
|
|
69
|
-
export interface GguiRenderDescriptor {
|
|
70
|
-
/** `uiData.resourceUri` — `ui://ggui/render/<sessionId>/<contractHash>`. */
|
|
71
|
-
resourceUri: string;
|
|
72
|
-
/** `uiData.sessionId`, when present. */
|
|
73
|
-
sessionId?: string;
|
|
74
|
-
/**
|
|
75
|
-
* The `_meta["ai.ggui/render"]` slice, when it reached us. Absent for a
|
|
76
|
-
* persisted history card and for any consumer folding without `fold.ts`'s
|
|
77
|
-
* `_meta` carriage — such a descriptor is recognised but NOT mountable.
|
|
78
|
-
*/
|
|
79
|
-
bootstrap?: GguiRenderBootstrap;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* A tool result's `uiData` (+ its `_meta`, when carried) → a ggui render
|
|
83
|
-
* descriptor, or `undefined` for anything that is not one.
|
|
84
|
-
*
|
|
85
|
-
* The `ui://` scheme gate is deliberate: `uiData` is a general-purpose channel
|
|
86
|
-
* (every `structuredContent` of a `_meta.ui`-stamped tool lands there), so a
|
|
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.
|
|
91
|
-
*/
|
|
92
|
-
export declare function asGguiRender(uiData: JsonValue | undefined, meta: JsonValue | undefined): GguiRenderDescriptor | undefined;
|
|
93
|
-
/**
|
|
94
|
-
* A live `tool-result` AgBlock → its ggui render descriptor, if it is one.
|
|
95
|
-
*
|
|
96
|
-
* NOTE: `@ggui-ai/protocol/integrations/mcp-apps` exports a helper of the
|
|
97
|
-
* same name that narrows a spec-canonical MCP `CallToolResult` instead. This
|
|
98
|
-
* one is the silverprotocol-side twin — the input is the FOLDED block, whose
|
|
99
|
-
* `uiData`/`_meta` carriage is `@silverprotocol/core`'s contract, not ggui's.
|
|
100
|
-
*
|
|
101
|
-
* @deprecated guuey#209 — use `toolResultLocator(block)`. Removed next minor.
|
|
102
|
-
*/
|
|
103
|
-
export declare function toolResultGguiRender(block: Extract<AgBlock, {
|
|
104
|
-
type: "tool-result";
|
|
105
|
-
}>): GguiRenderDescriptor | undefined;
|
|
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
|
-
*/
|
|
111
|
-
export declare function blockGguiRender(block: JsonValue): GguiRenderDescriptor | undefined;
|
|
112
|
-
/**
|
|
113
|
-
* A ggui render descriptor → the mountable resource the host's existing
|
|
114
|
-
* mcp-ui path already knows how to mount, or `undefined` when the descriptor
|
|
115
|
-
* carries no bootstrap (history cards, and any fold that dropped `_meta`).
|
|
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
|
-
*
|
|
122
|
-
* The `uri` is the render's REAL `resourceUri` — the shell is the payload, not
|
|
123
|
-
* a renaming of the resource.
|
|
124
|
-
*
|
|
125
|
-
* The shell is built `background: 'transparent'`: every guuey host that
|
|
126
|
-
* mounts through this adapter (widget, portal web, Studio) draws its own
|
|
127
|
-
* card chrome around the iframe, so the host page composits behind the card.
|
|
128
|
-
* The upstream default (`'surface'`) is for standalone served documents —
|
|
129
|
-
* see `GguiShellHtmlOptions` in `@ggui-ai/protocol/integrations/mcp-apps`.
|
|
130
|
-
*
|
|
131
|
-
* **On `_meta` being required to MOUNT (but never to RECOGNISE).** Recognition
|
|
132
|
-
* — "this tool result is a ggui card" — is keyed on `uiData.resourceUri` alone
|
|
133
|
-
* and never waits for anything (see {@link asGguiRender}); nothing in this
|
|
134
|
-
* package is blocked on an upstream change. Mounting is different, and the
|
|
135
|
-
* requirement is ggui's, not ours: its runtime rejects a slice without
|
|
136
|
-
* `runtimeUrl` AND without at least one mode discriminator (`wsUrl`+`wsToken`,
|
|
137
|
-
* `codeUrl`, or `kind`) as `MALFORMED_BOOTSTRAP` and renders nothing. `uiData`
|
|
138
|
-
* carries none of those fields, so a bootstrap-less descriptor could only ever
|
|
139
|
-
* produce a blank frame; returning `undefined` and letting the host show its
|
|
140
|
-
* own placeholder is the honest answer, not a deferral. `@silverprotocol/core`'s
|
|
141
|
-
* `Reducer` is what puts `_meta` on the block for a live turn, in-repo, today.
|
|
142
|
-
*/
|
|
143
|
-
export declare function gguiRenderResource(render: GguiRenderDescriptor): McpUiResourcePayload | undefined;
|
|
144
|
-
//# sourceMappingURL=ggui-render.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ggui-render.d.ts","sourceRoot":"","sources":["../src/ggui-render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAgB,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAExE,OAAO;AACL,yGAAyG;AACzG,qBAAqB;AACrB,yGAAyG;AACzG,aAAa,GACd,MAAM,yCAAyC,CAAC;AACjD,YAAY;AACV,yGAAyG;AACzG,mBAAmB;AACnB,yGAAyG;AACzG,oBAAoB,GACrB,MAAM,yCAAyC,CAAC;AAEjD;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,kBAAkC,CAAC;AAKpE;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,mBAAmB,CAAC;CACjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,SAAS,GAAG,SAAS,EAC7B,IAAI,EAAE,SAAS,GAAG,SAAS,GAC1B,oBAAoB,GAAG,SAAS,CAUlC;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC,GAC/C,oBAAoB,GAAG,SAAS,CAElC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,oBAAoB,GAAG,SAAS,CAIlF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,oBAAoB,GAC3B,oBAAoB,GAAG,SAAS,CAOlC"}
|
package/dist/ggui-render.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { asGguiRenderBootstrap, gguiShellHtml, MCP_APP_AI_GGUI_RENDER_META_KEY, } from "@ggui-ai/protocol/integrations/mcp-apps";
|
|
2
|
-
import { isJsonObject } from "./block-ui.js";
|
|
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";
|
|
8
|
-
/**
|
|
9
|
-
* The `_meta` key the ggui render bootstrap rides on. Alias of the
|
|
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.
|
|
16
|
-
*/
|
|
17
|
-
export const GGUI_RENDER_META_KEY = MCP_APP_AI_GGUI_RENDER_META_KEY;
|
|
18
|
-
/** The `ui://` scheme prefix every ggui render resource uri carries. */
|
|
19
|
-
const UI_SCHEME = "ui://";
|
|
20
|
-
/**
|
|
21
|
-
* A tool result's `uiData` (+ its `_meta`, when carried) → a ggui render
|
|
22
|
-
* descriptor, or `undefined` for anything that is not one.
|
|
23
|
-
*
|
|
24
|
-
* The `ui://` scheme gate is deliberate: `uiData` is a general-purpose channel
|
|
25
|
-
* (every `structuredContent` of a `_meta.ui`-stamped tool lands there), so a
|
|
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.
|
|
30
|
-
*/
|
|
31
|
-
export function asGguiRender(uiData, meta) {
|
|
32
|
-
if (!isJsonObject(uiData))
|
|
33
|
-
return undefined;
|
|
34
|
-
const resourceUri = uiData.resourceUri;
|
|
35
|
-
if (typeof resourceUri !== "string" || !resourceUri.startsWith(UI_SCHEME))
|
|
36
|
-
return undefined;
|
|
37
|
-
const bootstrap = asGguiRenderBootstrap(meta);
|
|
38
|
-
return {
|
|
39
|
-
resourceUri,
|
|
40
|
-
...(typeof uiData.sessionId === "string" ? { sessionId: uiData.sessionId } : {}),
|
|
41
|
-
...(bootstrap ? { bootstrap } : {}),
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* A live `tool-result` AgBlock → its ggui render descriptor, if it is one.
|
|
46
|
-
*
|
|
47
|
-
* NOTE: `@ggui-ai/protocol/integrations/mcp-apps` exports a helper of the
|
|
48
|
-
* same name that narrows a spec-canonical MCP `CallToolResult` instead. This
|
|
49
|
-
* one is the silverprotocol-side twin — the input is the FOLDED block, whose
|
|
50
|
-
* `uiData`/`_meta` carriage is `@silverprotocol/core`'s contract, not ggui's.
|
|
51
|
-
*
|
|
52
|
-
* @deprecated guuey#209 — use `toolResultLocator(block)`. Removed next minor.
|
|
53
|
-
*/
|
|
54
|
-
export function toolResultGguiRender(block) {
|
|
55
|
-
return asGguiRender(block.uiData, block._meta);
|
|
56
|
-
}
|
|
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
|
-
*/
|
|
62
|
-
export function blockGguiRender(block) {
|
|
63
|
-
if (!isJsonObject(block))
|
|
64
|
-
return undefined;
|
|
65
|
-
if (block.type !== "tool-result")
|
|
66
|
-
return undefined;
|
|
67
|
-
return asGguiRender(block.uiData, block._meta);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* A ggui render descriptor → the mountable resource the host's existing
|
|
71
|
-
* mcp-ui path already knows how to mount, or `undefined` when the descriptor
|
|
72
|
-
* carries no bootstrap (history cards, and any fold that dropped `_meta`).
|
|
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
|
-
*
|
|
79
|
-
* The `uri` is the render's REAL `resourceUri` — the shell is the payload, not
|
|
80
|
-
* a renaming of the resource.
|
|
81
|
-
*
|
|
82
|
-
* The shell is built `background: 'transparent'`: every guuey host that
|
|
83
|
-
* mounts through this adapter (widget, portal web, Studio) draws its own
|
|
84
|
-
* card chrome around the iframe, so the host page composits behind the card.
|
|
85
|
-
* The upstream default (`'surface'`) is for standalone served documents —
|
|
86
|
-
* see `GguiShellHtmlOptions` in `@ggui-ai/protocol/integrations/mcp-apps`.
|
|
87
|
-
*
|
|
88
|
-
* **On `_meta` being required to MOUNT (but never to RECOGNISE).** Recognition
|
|
89
|
-
* — "this tool result is a ggui card" — is keyed on `uiData.resourceUri` alone
|
|
90
|
-
* and never waits for anything (see {@link asGguiRender}); nothing in this
|
|
91
|
-
* package is blocked on an upstream change. Mounting is different, and the
|
|
92
|
-
* requirement is ggui's, not ours: its runtime rejects a slice without
|
|
93
|
-
* `runtimeUrl` AND without at least one mode discriminator (`wsUrl`+`wsToken`,
|
|
94
|
-
* `codeUrl`, or `kind`) as `MALFORMED_BOOTSTRAP` and renders nothing. `uiData`
|
|
95
|
-
* carries none of those fields, so a bootstrap-less descriptor could only ever
|
|
96
|
-
* produce a blank frame; returning `undefined` and letting the host show its
|
|
97
|
-
* own placeholder is the honest answer, not a deferral. `@silverprotocol/core`'s
|
|
98
|
-
* `Reducer` is what puts `_meta` on the block for a live turn, in-repo, today.
|
|
99
|
-
*/
|
|
100
|
-
export function gguiRenderResource(render) {
|
|
101
|
-
if (!render.bootstrap)
|
|
102
|
-
return undefined;
|
|
103
|
-
return {
|
|
104
|
-
uri: render.resourceUri,
|
|
105
|
-
mimeType: "text/html",
|
|
106
|
-
text: gguiShellHtml(render.bootstrap, { background: "transparent" }),
|
|
107
|
-
};
|
|
108
|
-
}
|
package/src/ggui-render.ts
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated — the ggui vendor arm is RETIRED (guuey#209, 2026-08-16).
|
|
3
|
-
*
|
|
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:
|
|
13
|
-
*
|
|
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.
|
|
27
|
-
*
|
|
28
|
-
* ## Why the arm existed, for the record
|
|
29
|
-
*
|
|
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.
|
|
40
|
-
*/
|
|
41
|
-
import type { AgBlock, JsonValue } from "@silverprotocol/core";
|
|
42
|
-
import {
|
|
43
|
-
asGguiRenderBootstrap,
|
|
44
|
-
gguiShellHtml,
|
|
45
|
-
MCP_APP_AI_GGUI_RENDER_META_KEY,
|
|
46
|
-
type GguiRenderBootstrap,
|
|
47
|
-
} from "@ggui-ai/protocol/integrations/mcp-apps";
|
|
48
|
-
import { isJsonObject, type McpUiResourcePayload } from "./block-ui.js";
|
|
49
|
-
|
|
50
|
-
export {
|
|
51
|
-
/** @deprecated import from `@ggui-ai/protocol/integrations/mcp-apps` (guuey#209; removed next minor). */
|
|
52
|
-
asGguiRenderBootstrap,
|
|
53
|
-
/** @deprecated import from `@ggui-ai/protocol/integrations/mcp-apps` (guuey#209; removed next minor). */
|
|
54
|
-
gguiShellHtml,
|
|
55
|
-
} from "@ggui-ai/protocol/integrations/mcp-apps";
|
|
56
|
-
export type {
|
|
57
|
-
/** @deprecated import from `@ggui-ai/protocol/integrations/mcp-apps` (guuey#209; removed next minor). */
|
|
58
|
-
GguiRenderBootstrap,
|
|
59
|
-
/** @deprecated import from `@ggui-ai/protocol/integrations/mcp-apps` (guuey#209; removed next minor). */
|
|
60
|
-
GguiShellHtmlOptions,
|
|
61
|
-
} from "@ggui-ai/protocol/integrations/mcp-apps";
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* The `_meta` key the ggui render bootstrap rides on. Alias of the
|
|
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.
|
|
71
|
-
*/
|
|
72
|
-
export const GGUI_RENDER_META_KEY = MCP_APP_AI_GGUI_RENDER_META_KEY;
|
|
73
|
-
|
|
74
|
-
/** The `ui://` scheme prefix every ggui render resource uri carries. */
|
|
75
|
-
const UI_SCHEME = "ui://";
|
|
76
|
-
|
|
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
|
-
*/
|
|
82
|
-
export interface GguiRenderDescriptor {
|
|
83
|
-
/** `uiData.resourceUri` — `ui://ggui/render/<sessionId>/<contractHash>`. */
|
|
84
|
-
resourceUri: string;
|
|
85
|
-
/** `uiData.sessionId`, when present. */
|
|
86
|
-
sessionId?: string;
|
|
87
|
-
/**
|
|
88
|
-
* The `_meta["ai.ggui/render"]` slice, when it reached us. Absent for a
|
|
89
|
-
* persisted history card and for any consumer folding without `fold.ts`'s
|
|
90
|
-
* `_meta` carriage — such a descriptor is recognised but NOT mountable.
|
|
91
|
-
*/
|
|
92
|
-
bootstrap?: GguiRenderBootstrap;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* A tool result's `uiData` (+ its `_meta`, when carried) → a ggui render
|
|
97
|
-
* descriptor, or `undefined` for anything that is not one.
|
|
98
|
-
*
|
|
99
|
-
* The `ui://` scheme gate is deliberate: `uiData` is a general-purpose channel
|
|
100
|
-
* (every `structuredContent` of a `_meta.ui`-stamped tool lands there), so a
|
|
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.
|
|
105
|
-
*/
|
|
106
|
-
export function asGguiRender(
|
|
107
|
-
uiData: JsonValue | undefined,
|
|
108
|
-
meta: JsonValue | undefined,
|
|
109
|
-
): GguiRenderDescriptor | undefined {
|
|
110
|
-
if (!isJsonObject(uiData)) return undefined;
|
|
111
|
-
const resourceUri = uiData.resourceUri;
|
|
112
|
-
if (typeof resourceUri !== "string" || !resourceUri.startsWith(UI_SCHEME)) return undefined;
|
|
113
|
-
const bootstrap = asGguiRenderBootstrap(meta);
|
|
114
|
-
return {
|
|
115
|
-
resourceUri,
|
|
116
|
-
...(typeof uiData.sessionId === "string" ? { sessionId: uiData.sessionId } : {}),
|
|
117
|
-
...(bootstrap ? { bootstrap } : {}),
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* A live `tool-result` AgBlock → its ggui render descriptor, if it is one.
|
|
123
|
-
*
|
|
124
|
-
* NOTE: `@ggui-ai/protocol/integrations/mcp-apps` exports a helper of the
|
|
125
|
-
* same name that narrows a spec-canonical MCP `CallToolResult` instead. This
|
|
126
|
-
* one is the silverprotocol-side twin — the input is the FOLDED block, whose
|
|
127
|
-
* `uiData`/`_meta` carriage is `@silverprotocol/core`'s contract, not ggui's.
|
|
128
|
-
*
|
|
129
|
-
* @deprecated guuey#209 — use `toolResultLocator(block)`. Removed next minor.
|
|
130
|
-
*/
|
|
131
|
-
export function toolResultGguiRender(
|
|
132
|
-
block: Extract<AgBlock, { type: "tool-result" }>,
|
|
133
|
-
): GguiRenderDescriptor | undefined {
|
|
134
|
-
return asGguiRender(block.uiData, block._meta);
|
|
135
|
-
}
|
|
136
|
-
|
|
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
|
-
*/
|
|
142
|
-
export function blockGguiRender(block: JsonValue): GguiRenderDescriptor | undefined {
|
|
143
|
-
if (!isJsonObject(block)) return undefined;
|
|
144
|
-
if (block.type !== "tool-result") return undefined;
|
|
145
|
-
return asGguiRender(block.uiData, block._meta);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* A ggui render descriptor → the mountable resource the host's existing
|
|
150
|
-
* mcp-ui path already knows how to mount, or `undefined` when the descriptor
|
|
151
|
-
* carries no bootstrap (history cards, and any fold that dropped `_meta`).
|
|
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
|
-
*
|
|
158
|
-
* The `uri` is the render's REAL `resourceUri` — the shell is the payload, not
|
|
159
|
-
* a renaming of the resource.
|
|
160
|
-
*
|
|
161
|
-
* The shell is built `background: 'transparent'`: every guuey host that
|
|
162
|
-
* mounts through this adapter (widget, portal web, Studio) draws its own
|
|
163
|
-
* card chrome around the iframe, so the host page composits behind the card.
|
|
164
|
-
* The upstream default (`'surface'`) is for standalone served documents —
|
|
165
|
-
* see `GguiShellHtmlOptions` in `@ggui-ai/protocol/integrations/mcp-apps`.
|
|
166
|
-
*
|
|
167
|
-
* **On `_meta` being required to MOUNT (but never to RECOGNISE).** Recognition
|
|
168
|
-
* — "this tool result is a ggui card" — is keyed on `uiData.resourceUri` alone
|
|
169
|
-
* and never waits for anything (see {@link asGguiRender}); nothing in this
|
|
170
|
-
* package is blocked on an upstream change. Mounting is different, and the
|
|
171
|
-
* requirement is ggui's, not ours: its runtime rejects a slice without
|
|
172
|
-
* `runtimeUrl` AND without at least one mode discriminator (`wsUrl`+`wsToken`,
|
|
173
|
-
* `codeUrl`, or `kind`) as `MALFORMED_BOOTSTRAP` and renders nothing. `uiData`
|
|
174
|
-
* carries none of those fields, so a bootstrap-less descriptor could only ever
|
|
175
|
-
* produce a blank frame; returning `undefined` and letting the host show its
|
|
176
|
-
* own placeholder is the honest answer, not a deferral. `@silverprotocol/core`'s
|
|
177
|
-
* `Reducer` is what puts `_meta` on the block for a live turn, in-repo, today.
|
|
178
|
-
*/
|
|
179
|
-
export function gguiRenderResource(
|
|
180
|
-
render: GguiRenderDescriptor,
|
|
181
|
-
): McpUiResourcePayload | undefined {
|
|
182
|
-
if (!render.bootstrap) return undefined;
|
|
183
|
-
return {
|
|
184
|
-
uri: render.resourceUri,
|
|
185
|
-
mimeType: "text/html",
|
|
186
|
-
text: gguiShellHtml(render.bootstrap, { background: "transparent" }),
|
|
187
|
-
};
|
|
188
|
-
}
|