@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/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
|
|
13
|
-
|
|
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
|
package/dist/action.d.ts
CHANGED
|
@@ -51,10 +51,33 @@ export type McpToolCallResult = {
|
|
|
51
51
|
structuredContent?: McpToolStructuredContent;
|
|
52
52
|
};
|
|
53
53
|
/**
|
|
54
|
-
* The runtime
|
|
55
|
-
* of the server allowlist (defense in depth: the proxy
|
|
54
|
+
* The runtime tools a card sandbox may RELAY over `tools/call` — the
|
|
55
|
+
* client-side twin of the server allowlist (defense in depth: the proxy
|
|
56
|
+
* enforces it again). Exactly ggui's iframe-runtime surface, all declared
|
|
57
|
+
* `_meta.ui.visibility: ['app']` (never model-callable):
|
|
58
|
+
*
|
|
59
|
+
* - `ggui_runtime_submit_action` — the user's gesture (the SEMANTIC one);
|
|
60
|
+
* - `ggui_runtime_refresh_ws_token` — live-channel credential refresh
|
|
61
|
+
* (the wsToken TTL is 180 s; without the relay a view on SSE/polling
|
|
62
|
+
* dies at that mark — guuey#220);
|
|
63
|
+
* - `ggui_runtime_pull` — the host-relayed polling rung where the
|
|
64
|
+
* sandbox's own transports are blocked (bridge-pull, terminal rung).
|
|
65
|
+
*
|
|
66
|
+
* Two of these are transport plumbing whose arguments are opaque runtime
|
|
67
|
+
* state — see {@link UI_SEMANTIC_ACTION_TOOLS} for the ONLY set a host may
|
|
68
|
+
* treat as "the user did something".
|
|
56
69
|
*/
|
|
57
70
|
export declare const UI_ACTION_TOOLS: ReadonlySet<string>;
|
|
71
|
+
/**
|
|
72
|
+
* The strict subset of {@link UI_ACTION_TOOLS} that carries a USER gesture —
|
|
73
|
+
* the only calls a host may project into user-facing affordances (composer
|
|
74
|
+
* staging, "the user selected X" copy, telemetry as intent). Every other
|
|
75
|
+
* relayed tool is runtime plumbing whose payload must NEVER reach the user
|
|
76
|
+
* verbatim (guuey#215/#218: a staged `sessionId …` was exactly that leak).
|
|
77
|
+
* A tool that is relayable is NOT thereby semantic; a host that widens
|
|
78
|
+
* this set is asserting the wire semantics of the new name.
|
|
79
|
+
*/
|
|
80
|
+
export declare const UI_SEMANTIC_ACTION_TOOLS: ReadonlySet<string>;
|
|
58
81
|
/** The in-band answer for anything the relay cannot (or will not) do. */
|
|
59
82
|
export declare const UI_ACTION_UNAVAILABLE_TEXT = "This action isn't available right now.";
|
|
60
83
|
/**
|
package/dist/action.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../src/action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,oFAAoF;AACpF,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACjD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,CAC3C;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAChB;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CACnB,CAAC;CACH,CAAC;AAEN;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,wBAAwB,CAAC;CAC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SAAS,CAgB9E;AAED,iFAAiF;AACjF,MAAM,WAAW,0BAA0B;IACzC;;;;;OAKG;IACH,QAAQ,EAAE,CACR,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,wBAAwB,GAAG,SAAS,KACvC,OAAO,CAAC,OAAO,CAAC,CAAC;CACvB;AAED,uEAAuE;AACvE,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,wBAAwB,CAAC;CACtC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,0BAA0B,GAC/B,CAAC,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAa1D"}
|
package/dist/action.js
CHANGED
|
@@ -13,11 +13,38 @@
|
|
|
13
13
|
* it crosses into the sandbox.
|
|
14
14
|
*/
|
|
15
15
|
/**
|
|
16
|
-
* The runtime
|
|
17
|
-
* of the server allowlist (defense in depth: the proxy
|
|
16
|
+
* The runtime tools a card sandbox may RELAY over `tools/call` — the
|
|
17
|
+
* client-side twin of the server allowlist (defense in depth: the proxy
|
|
18
|
+
* enforces it again). Exactly ggui's iframe-runtime surface, all declared
|
|
19
|
+
* `_meta.ui.visibility: ['app']` (never model-callable):
|
|
20
|
+
*
|
|
21
|
+
* - `ggui_runtime_submit_action` — the user's gesture (the SEMANTIC one);
|
|
22
|
+
* - `ggui_runtime_refresh_ws_token` — live-channel credential refresh
|
|
23
|
+
* (the wsToken TTL is 180 s; without the relay a view on SSE/polling
|
|
24
|
+
* dies at that mark — guuey#220);
|
|
25
|
+
* - `ggui_runtime_pull` — the host-relayed polling rung where the
|
|
26
|
+
* sandbox's own transports are blocked (bridge-pull, terminal rung).
|
|
27
|
+
*
|
|
28
|
+
* Two of these are transport plumbing whose arguments are opaque runtime
|
|
29
|
+
* state — see {@link UI_SEMANTIC_ACTION_TOOLS} for the ONLY set a host may
|
|
30
|
+
* treat as "the user did something".
|
|
18
31
|
*/
|
|
19
32
|
export const UI_ACTION_TOOLS = new Set([
|
|
20
33
|
"ggui_runtime_submit_action",
|
|
34
|
+
"ggui_runtime_refresh_ws_token",
|
|
35
|
+
"ggui_runtime_pull",
|
|
36
|
+
]);
|
|
37
|
+
/**
|
|
38
|
+
* The strict subset of {@link UI_ACTION_TOOLS} that carries a USER gesture —
|
|
39
|
+
* the only calls a host may project into user-facing affordances (composer
|
|
40
|
+
* staging, "the user selected X" copy, telemetry as intent). Every other
|
|
41
|
+
* relayed tool is runtime plumbing whose payload must NEVER reach the user
|
|
42
|
+
* verbatim (guuey#215/#218: a staged `sessionId …` was exactly that leak).
|
|
43
|
+
* A tool that is relayable is NOT thereby semantic; a host that widens
|
|
44
|
+
* this set is asserting the wire semantics of the new name.
|
|
45
|
+
*/
|
|
46
|
+
export const UI_SEMANTIC_ACTION_TOOLS = new Set([
|
|
47
|
+
"ggui_runtime_submit_action",
|
|
21
48
|
]);
|
|
22
49
|
/** The in-band answer for anything the relay cannot (or will not) do. */
|
|
23
50
|
export const UI_ACTION_UNAVAILABLE_TEXT = "This action isn't available right now.";
|
package/dist/block-ui.d.ts
CHANGED
|
@@ -104,6 +104,24 @@ export declare function toolResultUiResource(block: Extract<AgBlock, {
|
|
|
104
104
|
* are one producer of this shape.
|
|
105
105
|
*/
|
|
106
106
|
export declare function uiLocator(uiData: JsonValue | undefined): string | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* The `ui://` locator a `tool-result` block carries, from EITHER channel it
|
|
109
|
+
* can arrive on — the single seam every locator reader goes through.
|
|
110
|
+
*
|
|
111
|
+
* AgJSON §2.1 routes a tool result's `structuredContent` by its `_meta.ui`
|
|
112
|
+
* sibling: WITH the sibling it is surface data and the normalizer stamps
|
|
113
|
+
* `uiData`; WITHOUT it, it is model-channel data and lands in
|
|
114
|
+
* `structuredContent`. A producer that withholds `_meta` (ggui's non-prod
|
|
115
|
+
* posture; any plain-locator MCP server) therefore delivers a locator that
|
|
116
|
+
* is byte-identical in shape but lives one field over — reading `uiData`
|
|
117
|
+
* alone renders NOTHING for it (dark, not "expired"), and the persistence
|
|
118
|
+
* projector minted no placeholder row (the read plane 404s). `uiData` wins
|
|
119
|
+
* when both carry one (guuey#209 route-A finding).
|
|
120
|
+
*/
|
|
121
|
+
export declare function toolResultLocator(block: {
|
|
122
|
+
uiData?: JsonValue;
|
|
123
|
+
structuredContent?: JsonValue;
|
|
124
|
+
}): string | undefined;
|
|
107
125
|
export declare function snapshotUiResource(cardSnapshot: JsonValue): McpUiResourcePayload | undefined;
|
|
108
126
|
/**
|
|
109
127
|
* The resource's HTML: inline `text` wins; else base64-decode `blob`. `atob`
|
package/dist/block-ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-ui.d.ts","sourceRoot":"","sources":["../src/block-ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,CAAC,IAAI;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAExF;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,oBAAoB,GAAG,SAAS,CAU5F;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,oBAAoB,GAAG,SAAS,CAK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AC,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,oBAAoB,GAAG,SAAS,CAU5F;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,oBAAoB,GAAG,SAAS,CAK5F;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,SAAS,GAAG,SAAS,GACzB,oBAAoB,GAAG,SAAS,CAMlC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,oBAAoB,GAAG,SAAS,CAyBlF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC,GAC/C,oBAAoB,GAAG,SAAS,CAUlC;AAED;;;;;;;;;;;GAWG;AACH;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAI3E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,iBAAiB,CAAC,EAAE,SAAS,CAAC;CAC/B,GAAG,MAAM,GAAG,SAAS,CAErB;AAED,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,SAAS,GAAG,oBAAoB,GAAG,SAAS,CAU5F;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,oBAAoB,GAAG,MAAM,GAAG,SAAS,CAU/E"}
|
package/dist/block-ui.js
CHANGED
|
@@ -140,6 +140,23 @@ export function uiLocator(uiData) {
|
|
|
140
140
|
const uri = uiData.resourceUri;
|
|
141
141
|
return typeof uri === "string" && uri.startsWith("ui://") ? uri : undefined;
|
|
142
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* The `ui://` locator a `tool-result` block carries, from EITHER channel it
|
|
145
|
+
* can arrive on — the single seam every locator reader goes through.
|
|
146
|
+
*
|
|
147
|
+
* AgJSON §2.1 routes a tool result's `structuredContent` by its `_meta.ui`
|
|
148
|
+
* sibling: WITH the sibling it is surface data and the normalizer stamps
|
|
149
|
+
* `uiData`; WITHOUT it, it is model-channel data and lands in
|
|
150
|
+
* `structuredContent`. A producer that withholds `_meta` (ggui's non-prod
|
|
151
|
+
* posture; any plain-locator MCP server) therefore delivers a locator that
|
|
152
|
+
* is byte-identical in shape but lives one field over — reading `uiData`
|
|
153
|
+
* alone renders NOTHING for it (dark, not "expired"), and the persistence
|
|
154
|
+
* projector minted no placeholder row (the read plane 404s). `uiData` wins
|
|
155
|
+
* when both carry one (guuey#209 route-A finding).
|
|
156
|
+
*/
|
|
157
|
+
export function toolResultLocator(block) {
|
|
158
|
+
return uiLocator(block.uiData) ?? uiLocator(block.structuredContent);
|
|
159
|
+
}
|
|
143
160
|
export function snapshotUiResource(cardSnapshot) {
|
|
144
161
|
if (!isJsonObject(cardSnapshot))
|
|
145
162
|
return undefined;
|
package/dist/card-mount.d.ts
CHANGED
|
@@ -1,41 +1,53 @@
|
|
|
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
43
|
import { type McpUiResourcePayload } from "./block-ui.js";
|
|
37
44
|
import type { AgBlock, JsonValue } from "@silverprotocol/core";
|
|
38
|
-
/**
|
|
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.
|
|
@@ -44,7 +56,9 @@ export type ViewMountChannel = "inline" | "ggui" | "locator";
|
|
|
44
56
|
* `"ggui"` — a shell that boots the ggui runtime from a platform-pinned
|
|
45
57
|
* origin, and therefore needs a host page whose CSP allows that origin.
|
|
46
58
|
* `"locator"` — no mount material in hand, only the durable `ui://`
|
|
47
|
-
* identity (guuey#122)
|
|
59
|
+
* identity (guuey#122) — read from `uiData` OR, for a producer that
|
|
60
|
+
* withheld `_meta` (AgJSON §2.1 then routes it to `structuredContent`),
|
|
61
|
+
* from `structuredContent` (guuey#209): the host resolves it with a fresh, authenticated
|
|
48
62
|
* `resources/read` of the uri ({@link UiResourceReader}) — the spec-consistent
|
|
49
63
|
* template fetch, vendor-neutral. (The spec defers persistence/restoration
|
|
50
64
|
* itself; a full remount additionally owes the View `ui/notifications/tool-input`
|
|
@@ -56,6 +70,8 @@ export type ViewMount = ResolvedViewMount | LocatorViewMount;
|
|
|
56
70
|
* A view with mount material in hand — the arms a host can render directly,
|
|
57
71
|
* and the ONLY arms a `UiResourceReader` resolves (guuey#127): a read either
|
|
58
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.
|
|
59
75
|
*/
|
|
60
76
|
export interface ResolvedViewMount {
|
|
61
77
|
channel: "inline" | "ggui";
|
|
@@ -65,7 +81,7 @@ export interface ResolvedViewMount {
|
|
|
65
81
|
/** The durable-identity arm: no mount material, only the uri to re-fetch. */
|
|
66
82
|
export interface LocatorViewMount {
|
|
67
83
|
channel: "locator";
|
|
68
|
-
/** The
|
|
84
|
+
/** The durable `ui://` locator to re-fetch (`uiData.resourceUri`, else `structuredContent.resourceUri`). */
|
|
69
85
|
resourceUri: string;
|
|
70
86
|
}
|
|
71
87
|
/**
|
|
@@ -79,9 +95,14 @@ export interface LocatorViewMount {
|
|
|
79
95
|
*/
|
|
80
96
|
export type UiResourceReader = (resourceUri: string) => Promise<ViewMount | undefined>;
|
|
81
97
|
/**
|
|
82
|
-
* A live `tool-result` block → the card to mount,
|
|
83
|
-
* `
|
|
84
|
-
*
|
|
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.
|
|
85
106
|
*/
|
|
86
107
|
export declare function toolResultViewMount(block: Extract<AgBlock, {
|
|
87
108
|
type: "tool-result";
|
|
@@ -89,12 +110,12 @@ export declare function toolResultViewMount(block: Extract<AgBlock, {
|
|
|
89
110
|
/**
|
|
90
111
|
* A persisted `HistoryCard`'s `cardSnapshot` → the card to mount.
|
|
91
112
|
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* 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.
|
|
98
119
|
*/
|
|
99
120
|
export declare function snapshotViewMount(cardSnapshot: JsonValue): ViewMount | undefined;
|
|
100
121
|
/**
|
package/dist/card-mount.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-mount.d.ts","sourceRoot":"","sources":["../src/card-mount.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"card-mount.d.ts","sourceRoot":"","sources":["../src/card-mount.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,EAA+D,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACvH,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAE7D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,SAAS,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AAE7D;;;;;;GAMG;AACH,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"}
|
package/dist/card-mount.js
CHANGED
|
@@ -1,78 +1,72 @@
|
|
|
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";
|
|
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
|
+
import { snapshotUiResource, toolResultLocator, toolResultUiResource } from "./block-ui.js";
|
|
43
44
|
/**
|
|
44
|
-
* A live `tool-result` block → the card to mount,
|
|
45
|
-
* `
|
|
46
|
-
*
|
|
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
|
|
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`): re-fetch works on live turns too — the resource is
|
|
58
|
-
// freshly minted (guuey#122). One diagnostic when `_meta` DID carry the
|
|
59
|
-
// vendor key but failed validation — a producer bug would otherwise be
|
|
60
|
-
// indistinguishable from a meta-less fold (blank UI, zero errors).
|
|
61
|
-
if (ggui && !ggui.bootstrap && blockCarriesGguiMetaKey(block)) {
|
|
62
|
-
console.warn(`mcp-apps-host: tool result ${block.toolCallId} carries a malformed ggui render bootstrap — degrading to the locator channel`);
|
|
63
|
-
}
|
|
64
|
-
const locator = uiLocator(block.uiData);
|
|
58
|
+
const locator = toolResultLocator(block);
|
|
65
59
|
return locator !== undefined ? { channel: "locator", resourceUri: locator } : undefined;
|
|
66
60
|
}
|
|
67
61
|
/**
|
|
68
62
|
* A persisted `HistoryCard`'s `cardSnapshot` → the card to mount.
|
|
69
63
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* 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.
|
|
76
70
|
*/
|
|
77
71
|
export function snapshotViewMount(cardSnapshot) {
|
|
78
72
|
const inline = snapshotUiResource(cardSnapshot);
|
|
@@ -83,7 +77,7 @@ export function snapshotViewMount(cardSnapshot) {
|
|
|
83
77
|
continue;
|
|
84
78
|
if (block.type !== "tool-result")
|
|
85
79
|
continue;
|
|
86
|
-
const locator =
|
|
80
|
+
const locator = toolResultLocator(block);
|
|
87
81
|
if (locator !== undefined)
|
|
88
82
|
return { channel: "locator", resourceUri: locator };
|
|
89
83
|
}
|
package/dist/ggui-render.d.ts
CHANGED
|
@@ -1,61 +1,71 @@
|
|
|
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 { type GguiRenderBootstrap } from "@ggui-ai/protocol/integrations/mcp-apps";
|
|
50
43
|
import { type McpUiResourcePayload } from "./block-ui.js";
|
|
51
|
-
export {
|
|
52
|
-
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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":"","sources":["../src/ggui-render.ts"],"names":[],"mappings":"AAAA
|
|
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