@guuey/mcp-apps-host 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/dist/action.d.ts +25 -2
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +29 -2
- package/dist/block-ui.d.ts +18 -0
- package/dist/block-ui.d.ts.map +1 -1
- package/dist/block-ui.js +17 -0
- package/dist/card-mount.d.ts +51 -30
- package/dist/card-mount.d.ts.map +1 -1
- package/dist/card-mount.js +42 -48
- package/dist/ggui-render.d.ts +69 -45
- package/dist/ggui-render.d.ts.map +1 -1
- package/dist/ggui-render.js +25 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/narrowing.d.ts +1 -1
- package/dist/narrowing.d.ts.map +1 -1
- package/dist/narrowing.js +1 -1
- package/dist/view-host-protocol.d.ts +3 -2
- package/dist/view-host-protocol.d.ts.map +1 -1
- package/dist/view-host-protocol.js +3 -2
- package/package.json +1 -1
- package/src/action.ts +30 -2
- package/src/block-ui.ts +21 -0
- package/src/card-mount.ts +54 -56
- package/src/ggui-render.ts +63 -43
- package/src/index.ts +7 -0
- package/src/narrowing.ts +1 -0
- package/src/view-host-protocol.ts +3 -2
package/dist/ggui-render.js
CHANGED
|
@@ -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 {
|
|
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
|
-
/**
|
|
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
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* narrowing, ui:// locator rehydration, sandbox-trust channels. See README +
|
|
4
4
|
* the conformance map (guuey#123).
|
|
5
5
|
*/
|
|
6
|
-
export { asResourcePayload, asUiResource, blockUiResource, isJsonObject, resourceHtml, scanProviderRawForUiResource, snapshotUiResource, toolResultUiResource, uiLocator, type McpUiResourcePayload, } from "./block-ui.js";
|
|
6
|
+
export { asResourcePayload, asUiResource, blockUiResource, isJsonObject, resourceHtml, scanProviderRawForUiResource, snapshotUiResource, toolResultLocator, toolResultUiResource, uiLocator, type McpUiResourcePayload, } from "./block-ui.js";
|
|
7
7
|
export { asGguiRender, asGguiRenderBootstrap, blockGguiRender, gguiRenderResource, gguiShellHtml, toolResultGguiRender, GGUI_RENDER_META_KEY, type GguiRenderBootstrap, type GguiRenderDescriptor, type GguiShellHtmlOptions, } from "./ggui-render.js";
|
|
8
8
|
export { resolveViewMount, snapshotViewMount, toolResultViewMount, type LocatorViewMount, type ResolvedViewMount, type UiResourceReader, type ViewMount, type ViewMountChannel, } from "./card-mount.js";
|
|
9
9
|
export { createMcpUiResourceReader, uiResourceChannel, type CreateMcpUiResourceReaderDeps, type McpResourceReadResult, } from "./reader.js";
|
|
10
|
-
export { asToolCallResult, createMcpUiActionRelay, unavailableToolCallResult, UI_ACTION_TOOLS, UI_ACTION_UNAVAILABLE_TEXT, type CreateMcpUiActionRelayDeps, type McpToolCallContent, type McpToolCallResult, type McpToolStructuredContent, type UiActionRequest, } from "./action.js";
|
|
10
|
+
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";
|
|
11
11
|
export { initializeResult, initialViewHostState, resourceReadResponse, RESOURCES_READ_METHOD, teardownMessage, toolCallResponse, TOOLS_CALL_METHOD, viewHostElapsed, viewHostReceive, type ViewHostBehavior, type ViewHostEffect, type ViewHostOutbound, type ViewHostPhase, type ViewHostInfo, type ViewHostState, type ViewHostTransition, type ViewRequestId, } from "./view-host-protocol.js";
|
|
12
12
|
export { attachViewHost, viewDocumentHtml, type AttachViewHostConfig, type ViewFrameLike, type ViewHostEvents, } from "./view-host.js";
|
|
13
13
|
export { attachSandboxPageDelivery, isSandboxProxyReady, SANDBOX_PROXY_READY_METHOD, SANDBOX_RESOURCE_READY_METHOD, type SandboxPageDeliveryConfig, } from "./sandbox-page.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,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;AAMvB,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"}
|
package/dist/index.js
CHANGED
|
@@ -3,11 +3,16 @@
|
|
|
3
3
|
* narrowing, ui:// locator rehydration, sandbox-trust channels. See README +
|
|
4
4
|
* the conformance map (guuey#123).
|
|
5
5
|
*/
|
|
6
|
-
export { asResourcePayload, asUiResource, blockUiResource, isJsonObject, resourceHtml, scanProviderRawForUiResource, snapshotUiResource, toolResultUiResource, uiLocator, } from "./block-ui.js";
|
|
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";
|
|
10
|
-
export { asToolCallResult, createMcpUiActionRelay, unavailableToolCallResult, UI_ACTION_TOOLS, UI_ACTION_UNAVAILABLE_TEXT, } from "./action.js";
|
|
15
|
+
export { asToolCallResult, createMcpUiActionRelay, unavailableToolCallResult, UI_ACTION_TOOLS, UI_ACTION_UNAVAILABLE_TEXT, UI_SEMANTIC_ACTION_TOOLS, } from "./action.js";
|
|
11
16
|
export { initializeResult, initialViewHostState, resourceReadResponse, RESOURCES_READ_METHOD, teardownMessage, toolCallResponse, TOOLS_CALL_METHOD, viewHostElapsed, viewHostReceive, } from "./view-host-protocol.js";
|
|
12
17
|
export { attachViewHost, viewDocumentHtml, } from "./view-host.js";
|
|
13
18
|
export { attachSandboxPageDelivery, isSandboxProxyReady, SANDBOX_PROXY_READY_METHOD, SANDBOX_RESOURCE_READY_METHOD, } from "./sandbox-page.js";
|
package/dist/narrowing.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* graph through the barrel (which re-exports the ggui render arm until its
|
|
6
6
|
* retirement — conformance-map step 4).
|
|
7
7
|
*/
|
|
8
|
-
export { asResourcePayload, asUiResource, blockUiResource, isJsonObject, resourceHtml, scanProviderRawForUiResource, snapshotUiResource, toolResultUiResource, uiLocator, type McpUiResourcePayload, } from "./block-ui.js";
|
|
8
|
+
export { asResourcePayload, asUiResource, blockUiResource, isJsonObject, resourceHtml, scanProviderRawForUiResource, snapshotUiResource, toolResultLocator, toolResultUiResource, uiLocator, type McpUiResourcePayload, } from "./block-ui.js";
|
|
9
9
|
//# sourceMappingURL=narrowing.d.ts.map
|
package/dist/narrowing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"narrowing.d.ts","sourceRoot":"","sources":["../src/narrowing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,4BAA4B,EAC5B,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"narrowing.d.ts","sourceRoot":"","sources":["../src/narrowing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;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"}
|
package/dist/narrowing.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* graph through the barrel (which re-exports the ggui render arm until its
|
|
6
6
|
* retirement — conformance-map step 4).
|
|
7
7
|
*/
|
|
8
|
-
export { asResourcePayload, asUiResource, blockUiResource, isJsonObject, resourceHtml, scanProviderRawForUiResource, snapshotUiResource, toolResultUiResource, uiLocator, } from "./block-ui.js";
|
|
8
|
+
export { asResourcePayload, asUiResource, blockUiResource, isJsonObject, resourceHtml, scanProviderRawForUiResource, snapshotUiResource, toolResultLocator, toolResultUiResource, uiLocator, } from "./block-ui.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
|
|
31
|
-
*
|
|
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
|
|
1
|
+
{"version":3,"file":"view-host-protocol.d.ts","sourceRoot":"","sources":["../src/view-host-protocol.ts"],"names":[],"mappings":"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"}
|
|
@@ -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
|
|
31
|
-
*
|
|
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.
|
|
3
|
+
"version": "0.7.0",
|
|
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/action.ts
CHANGED
|
@@ -47,11 +47,39 @@ export type McpToolCallResult = {
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
|
-
* The runtime
|
|
51
|
-
* of the server allowlist (defense in depth: the proxy
|
|
50
|
+
* The runtime tools a card sandbox may RELAY over `tools/call` — the
|
|
51
|
+
* client-side twin of the server allowlist (defense in depth: the proxy
|
|
52
|
+
* enforces it again). Exactly ggui's iframe-runtime surface, all declared
|
|
53
|
+
* `_meta.ui.visibility: ['app']` (never model-callable):
|
|
54
|
+
*
|
|
55
|
+
* - `ggui_runtime_submit_action` — the user's gesture (the SEMANTIC one);
|
|
56
|
+
* - `ggui_runtime_refresh_ws_token` — live-channel credential refresh
|
|
57
|
+
* (the wsToken TTL is 180 s; without the relay a view on SSE/polling
|
|
58
|
+
* dies at that mark — guuey#220);
|
|
59
|
+
* - `ggui_runtime_pull` — the host-relayed polling rung where the
|
|
60
|
+
* sandbox's own transports are blocked (bridge-pull, terminal rung).
|
|
61
|
+
*
|
|
62
|
+
* Two of these are transport plumbing whose arguments are opaque runtime
|
|
63
|
+
* state — see {@link UI_SEMANTIC_ACTION_TOOLS} for the ONLY set a host may
|
|
64
|
+
* treat as "the user did something".
|
|
52
65
|
*/
|
|
53
66
|
export const UI_ACTION_TOOLS: ReadonlySet<string> = new Set([
|
|
54
67
|
"ggui_runtime_submit_action",
|
|
68
|
+
"ggui_runtime_refresh_ws_token",
|
|
69
|
+
"ggui_runtime_pull",
|
|
70
|
+
]);
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The strict subset of {@link UI_ACTION_TOOLS} that carries a USER gesture —
|
|
74
|
+
* the only calls a host may project into user-facing affordances (composer
|
|
75
|
+
* staging, "the user selected X" copy, telemetry as intent). Every other
|
|
76
|
+
* relayed tool is runtime plumbing whose payload must NEVER reach the user
|
|
77
|
+
* verbatim (guuey#215/#218: a staged `sessionId …` was exactly that leak).
|
|
78
|
+
* A tool that is relayable is NOT thereby semantic; a host that widens
|
|
79
|
+
* this set is asserting the wire semantics of the new name.
|
|
80
|
+
*/
|
|
81
|
+
export const UI_SEMANTIC_ACTION_TOOLS: ReadonlySet<string> = new Set([
|
|
82
|
+
"ggui_runtime_submit_action",
|
|
55
83
|
]);
|
|
56
84
|
|
|
57
85
|
/** The in-band answer for anything the relay cannot (or will not) do. */
|
package/src/block-ui.ts
CHANGED
|
@@ -175,6 +175,27 @@ export function uiLocator(uiData: JsonValue | undefined): string | undefined {
|
|
|
175
175
|
return typeof uri === "string" && uri.startsWith("ui://") ? uri : undefined;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
/**
|
|
179
|
+
* The `ui://` locator a `tool-result` block carries, from EITHER channel it
|
|
180
|
+
* can arrive on — the single seam every locator reader goes through.
|
|
181
|
+
*
|
|
182
|
+
* AgJSON §2.1 routes a tool result's `structuredContent` by its `_meta.ui`
|
|
183
|
+
* sibling: WITH the sibling it is surface data and the normalizer stamps
|
|
184
|
+
* `uiData`; WITHOUT it, it is model-channel data and lands in
|
|
185
|
+
* `structuredContent`. A producer that withholds `_meta` (ggui's non-prod
|
|
186
|
+
* posture; any plain-locator MCP server) therefore delivers a locator that
|
|
187
|
+
* is byte-identical in shape but lives one field over — reading `uiData`
|
|
188
|
+
* alone renders NOTHING for it (dark, not "expired"), and the persistence
|
|
189
|
+
* projector minted no placeholder row (the read plane 404s). `uiData` wins
|
|
190
|
+
* when both carry one (guuey#209 route-A finding).
|
|
191
|
+
*/
|
|
192
|
+
export function toolResultLocator(block: {
|
|
193
|
+
uiData?: JsonValue;
|
|
194
|
+
structuredContent?: JsonValue;
|
|
195
|
+
}): string | undefined {
|
|
196
|
+
return uiLocator(block.uiData) ?? uiLocator(block.structuredContent);
|
|
197
|
+
}
|
|
198
|
+
|
|
178
199
|
export function snapshotUiResource(cardSnapshot: JsonValue): McpUiResourcePayload | undefined {
|
|
179
200
|
if (!isJsonObject(cardSnapshot)) return undefined;
|
|
180
201
|
const parts = cardSnapshot.parts;
|
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?"
|
|
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.
|
|
11
|
-
*
|
|
12
|
-
* `
|
|
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
|
-
*
|
|
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
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
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 —
|
|
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.
|
|
33
|
-
*
|
|
34
|
-
*
|
|
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
|
-
import { snapshotUiResource,
|
|
37
|
-
import { GGUI_RENDER_META_KEY, gguiRenderResource, toolResultGguiRender } from "./ggui-render.js";
|
|
43
|
+
import { snapshotUiResource, toolResultLocator, toolResultUiResource, type McpUiResourcePayload } from "./block-ui.js";
|
|
38
44
|
import type { AgBlock, JsonValue } from "@silverprotocol/core";
|
|
39
45
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
/**
|
|
@@ -56,7 +58,9 @@ export type ViewMountChannel = "inline" | "ggui" | "locator";
|
|
|
56
58
|
* `"ggui"` — a shell that boots the ggui runtime from a platform-pinned
|
|
57
59
|
* origin, and therefore needs a host page whose CSP allows that origin.
|
|
58
60
|
* `"locator"` — no mount material in hand, only the durable `ui://`
|
|
59
|
-
* identity (guuey#122)
|
|
61
|
+
* identity (guuey#122) — read from `uiData` OR, for a producer that
|
|
62
|
+
* withheld `_meta` (AgJSON §2.1 then routes it to `structuredContent`),
|
|
63
|
+
* from `structuredContent` (guuey#209): the host resolves it with a fresh, authenticated
|
|
60
64
|
* `resources/read` of the uri ({@link UiResourceReader}) — the spec-consistent
|
|
61
65
|
* template fetch, vendor-neutral. (The spec defers persistence/restoration
|
|
62
66
|
* itself; a full remount additionally owes the View `ui/notifications/tool-input`
|
|
@@ -69,6 +73,8 @@ export type ViewMount = ResolvedViewMount | LocatorViewMount;
|
|
|
69
73
|
* A view with mount material in hand — the arms a host can render directly,
|
|
70
74
|
* and the ONLY arms a `UiResourceReader` resolves (guuey#127): a read either
|
|
71
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.
|
|
72
78
|
*/
|
|
73
79
|
export interface ResolvedViewMount {
|
|
74
80
|
channel: "inline" | "ggui";
|
|
@@ -79,7 +85,7 @@ export interface ResolvedViewMount {
|
|
|
79
85
|
/** The durable-identity arm: no mount material, only the uri to re-fetch. */
|
|
80
86
|
export interface LocatorViewMount {
|
|
81
87
|
channel: "locator";
|
|
82
|
-
/** The
|
|
88
|
+
/** The durable `ui://` locator to re-fetch (`uiData.resourceUri`, else `structuredContent.resourceUri`). */
|
|
83
89
|
resourceUri: string;
|
|
84
90
|
}
|
|
85
91
|
|
|
@@ -95,41 +101,33 @@ export interface LocatorViewMount {
|
|
|
95
101
|
export type UiResourceReader = (resourceUri: string) => Promise<ViewMount | undefined>;
|
|
96
102
|
|
|
97
103
|
/**
|
|
98
|
-
* A live `tool-result` block → the card to mount,
|
|
99
|
-
* `
|
|
100
|
-
*
|
|
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.
|
|
101
112
|
*/
|
|
102
113
|
export function toolResultViewMount(
|
|
103
114
|
block: Extract<AgBlock, { type: "tool-result" }>,
|
|
104
115
|
): ViewMount | undefined {
|
|
105
116
|
const inline = toolResultUiResource(block);
|
|
106
117
|
if (inline) return { resource: inline, channel: "inline" };
|
|
107
|
-
const
|
|
108
|
-
const resource = ggui ? gguiRenderResource(ggui) : undefined;
|
|
109
|
-
if (resource) return { resource, channel: "ggui" };
|
|
110
|
-
// A live locator whose mount material didn't reach us (a fold that
|
|
111
|
-
// dropped `_meta`): re-fetch works on live turns too — the resource is
|
|
112
|
-
// freshly minted (guuey#122). One diagnostic when `_meta` DID carry the
|
|
113
|
-
// vendor key but failed validation — a producer bug would otherwise be
|
|
114
|
-
// indistinguishable from a meta-less fold (blank UI, zero errors).
|
|
115
|
-
if (ggui && !ggui.bootstrap && blockCarriesGguiMetaKey(block)) {
|
|
116
|
-
console.warn(
|
|
117
|
-
`mcp-apps-host: tool result ${block.toolCallId} carries a malformed ggui render bootstrap — degrading to the locator channel`,
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
const locator = uiLocator(block.uiData);
|
|
118
|
+
const locator = toolResultLocator(block);
|
|
121
119
|
return locator !== undefined ? { channel: "locator", resourceUri: locator } : undefined;
|
|
122
120
|
}
|
|
123
121
|
|
|
124
122
|
/**
|
|
125
123
|
* A persisted `HistoryCard`'s `cardSnapshot` → the card to mount.
|
|
126
124
|
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* 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.
|
|
133
131
|
*/
|
|
134
132
|
export function snapshotViewMount(cardSnapshot: JsonValue): ViewMount | undefined {
|
|
135
133
|
const inline = snapshotUiResource(cardSnapshot);
|
|
@@ -137,7 +135,7 @@ export function snapshotViewMount(cardSnapshot: JsonValue): ViewMount | undefine
|
|
|
137
135
|
for (const block of snapshotBlocks(cardSnapshot)) {
|
|
138
136
|
if (typeof block !== "object" || block === null || Array.isArray(block)) continue;
|
|
139
137
|
if (block.type !== "tool-result") continue;
|
|
140
|
-
const locator =
|
|
138
|
+
const locator = toolResultLocator(block);
|
|
141
139
|
if (locator !== undefined) return { channel: "locator", resourceUri: locator };
|
|
142
140
|
}
|
|
143
141
|
return undefined;
|
package/src/ggui-render.ts
CHANGED
|
@@ -1,49 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
8
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
@@ -11,10 +11,16 @@ export {
|
|
|
11
11
|
resourceHtml,
|
|
12
12
|
scanProviderRawForUiResource,
|
|
13
13
|
snapshotUiResource,
|
|
14
|
+
toolResultLocator,
|
|
14
15
|
toolResultUiResource,
|
|
15
16
|
uiLocator,
|
|
16
17
|
type McpUiResourcePayload,
|
|
17
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.
|
|
18
24
|
export {
|
|
19
25
|
asGguiRender,
|
|
20
26
|
asGguiRenderBootstrap,
|
|
@@ -49,6 +55,7 @@ export {
|
|
|
49
55
|
unavailableToolCallResult,
|
|
50
56
|
UI_ACTION_TOOLS,
|
|
51
57
|
UI_ACTION_UNAVAILABLE_TEXT,
|
|
58
|
+
UI_SEMANTIC_ACTION_TOOLS,
|
|
52
59
|
type CreateMcpUiActionRelayDeps,
|
|
53
60
|
type McpToolCallContent,
|
|
54
61
|
type McpToolCallResult,
|