@ggui-ai/iframe-runtime 0.15.0 → 0.17.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/dist/channel-transport.d.ts +2 -2
- package/dist/connection.d.ts +34 -12
- package/dist/connection.js +40 -12
- package/dist/events-polling.js +12 -0
- package/dist/host-context-emitter.d.ts +22 -1
- package/dist/host-context-emitter.js +37 -4
- package/dist/host-fonts.d.ts +10 -0
- package/dist/host-fonts.js +113 -0
- package/dist/host-palette-bridge.js +20 -15
- package/dist/iframe-runtime.js +69 -78
- package/dist/iframe-runtime.meta.json +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/mcp-app-iframe-host.d.ts +15 -0
- package/dist/mcp-app-iframe-host.js +5 -1
- package/dist/meta-parse.d.ts +17 -0
- package/dist/meta-parse.js +30 -2
- package/dist/observability.d.ts +73 -1
- package/dist/react-renderer.d.ts +20 -36
- package/dist/react-renderer.js +80 -96
- package/dist/render-item.d.ts +12 -13
- package/dist/render-item.js +5 -0
- package/dist/runtime.d.ts +32 -39
- package/dist/runtime.js +116 -68
- package/dist/status-dom.js +7 -0
- package/dist/system-cards/NoCredentialsCard.js +13 -13
- package/dist/system-cards/ProtocolProbeCard.js +11 -11
- package/dist/system-cards/QrCode.js +1 -1
- package/dist/system-cards/index.js +2 -2
- package/dist/wire-config.d.ts +2 -2
- package/package.json +7 -7
|
@@ -372,7 +372,7 @@ function ProbeButtonRow({ method, description, call, }) {
|
|
|
372
372
|
padding: 'var(--ggui-spacing-3, 12px)',
|
|
373
373
|
borderRadius: 'var(--ggui-shape-radius-md, 10px)',
|
|
374
374
|
border: '1px solid var(--ggui-color-neutral-200, #e4e4e7)',
|
|
375
|
-
background: 'var(--ggui-color-
|
|
375
|
+
background: 'var(--ggui-color-container, #fff)',
|
|
376
376
|
}, children: [_jsxs("div", { style: {
|
|
377
377
|
display: 'flex',
|
|
378
378
|
alignItems: 'center',
|
|
@@ -382,10 +382,10 @@ function ProbeButtonRow({ method, description, call, }) {
|
|
|
382
382
|
}, children: [_jsx("code", { style: {
|
|
383
383
|
fontFamily: 'var(--ggui-font-family-mono, ui-monospace, SFMono-Regular, Menlo, monospace)',
|
|
384
384
|
fontSize: 'var(--ggui-font-size-sm, 13px)',
|
|
385
|
-
color: 'var(--ggui-color-
|
|
385
|
+
color: 'var(--ggui-color-onContainer, #111)',
|
|
386
386
|
fontWeight: 'var(--ggui-font-weight-semibold, 600)',
|
|
387
387
|
}, children: method }), statusBadge] }), _jsx(Text, { size: "xs", style: {
|
|
388
|
-
color: 'var(--ggui-color-
|
|
388
|
+
color: 'var(--ggui-color-onSunken, #52525b)',
|
|
389
389
|
fontSize: 'var(--ggui-font-size-xs, 11px)',
|
|
390
390
|
}, children: description }), _jsx("div", { style: { display: 'flex', gap: 'var(--ggui-spacing-2, 8px)' }, children: _jsx(Button, { variant: "primary", size: "sm", onClick: onClick, disabled: outcome.state === 'pending', children: buttonLabel }) }), outcome.state === 'success' || outcome.state === 'error' ? (_jsx("pre", { style: {
|
|
391
391
|
margin: 0,
|
|
@@ -393,7 +393,7 @@ function ProbeButtonRow({ method, description, call, }) {
|
|
|
393
393
|
fontSize: 'var(--ggui-font-size-xs, 11px)',
|
|
394
394
|
color: outcome.state === 'error'
|
|
395
395
|
? 'var(--ggui-color-warning-500, #b45309)'
|
|
396
|
-
: 'var(--ggui-color-
|
|
396
|
+
: 'var(--ggui-color-onSunken, #52525b)',
|
|
397
397
|
background: 'var(--ggui-color-neutral-100, #f4f4f5)',
|
|
398
398
|
padding: 'var(--ggui-spacing-2, 8px)',
|
|
399
399
|
borderRadius: 'var(--ggui-shape-radius-sm, 6px)',
|
|
@@ -414,7 +414,7 @@ export function ProtocolProbeCard({ intent, }) {
|
|
|
414
414
|
gap: 'var(--ggui-spacing-3, 12px)',
|
|
415
415
|
flexWrap: 'wrap',
|
|
416
416
|
}, children: [_jsx(Heading, { level: 3, children: "MCP Apps protocol probe" }), _jsx(Badge, { variant: "info", children: "diagnostic" })] }), _jsxs(Text, { style: {
|
|
417
|
-
color: 'var(--ggui-color-
|
|
417
|
+
color: 'var(--ggui-color-onSunken, #52525b)',
|
|
418
418
|
lineHeight: '1.55',
|
|
419
419
|
}, children: ["One button per primary host effect emitted by the iframe runtime's gesture surfaces (submit-action bridge / native- idiom interceptors). Click each to verify which methods this host honors. The", _jsx("code", { children: "tools/call" }), " row chains the full submit-action bridge (audit + context + consent), reproducing the production ", _jsx("code", { children: "dispatchSubmitAction" }), " envelope shape verbatim. The receive log below captures every notification the host emits while this card is mounted."] })] }), _jsxs(Stack, { gap: "md", children: [_jsx(ProbeButtonRow, { method: "ui/message", description: "Submit-action bridge step 3 \u2014 consent-gated user authorization. Host pre-fills + waits for user confirm before the LLM acts on the paired pending-action context.", call: call }), _jsx(ProbeButtonRow, { method: "ui/update-model-context", description: "Submit-action bridge step 2 \u2014 silent structured `[ggui:pending-action]` context drop. LLM honors on next turn. No immediate UI.", call: call }), _jsx(ProbeButtonRow, { method: "ui/open-link", description: "Native-idiom anchor click interceptor primary effect. Opens ggui.ai in the host's browser / new tab. Real iframe code triggers via `<a href target='_blank'>` or cross-origin href.", call: call }), _jsx(ProbeButtonRow, { method: "ui/request-display-mode", description: "Native-idiom fullscreen interceptor primary effect. Request fullscreen \u2014 real iframe code calls `el.requestFullscreen()`; the runtime overrides the prototype to route through here.", call: call }), _jsx(ProbeButtonRow, { method: "tools/call", description: "Full submit-action bridge: `tools/call ggui_runtime_submit_action` (audit, kind:'dispatch') + `ui/update-model-context` + `ui/message`. Spec \u00A7401 requires `_meta.ui.visibility:['app']` on the receiving tool.", call: call })] }), _jsxs(Stack, { gap: "sm", children: [_jsxs("div", { style: {
|
|
420
420
|
display: 'flex',
|
|
@@ -422,10 +422,10 @@ export function ProtocolProbeCard({ intent, }) {
|
|
|
422
422
|
justifyContent: 'space-between',
|
|
423
423
|
gap: 'var(--ggui-spacing-3, 12px)',
|
|
424
424
|
}, children: [_jsx(Heading, { level: 4, children: "Receive log" }), _jsxs(Text, { size: "xs", style: {
|
|
425
|
-
color: 'var(--ggui-color-
|
|
425
|
+
color: 'var(--ggui-color-onSunken, #52525b)',
|
|
426
426
|
fontSize: 'var(--ggui-font-size-xs, 11px)',
|
|
427
427
|
}, children: [log.length, " ", log.length === 1 ? 'event' : 'events'] })] }), log.length === 0 ? (_jsx(Text, { size: "xs", style: {
|
|
428
|
-
color: 'var(--ggui-color-
|
|
428
|
+
color: 'var(--ggui-color-onSunken, #52525b)',
|
|
429
429
|
fontStyle: 'italic',
|
|
430
430
|
}, children: "No host notifications observed yet. Click a probe button or wait for the host to emit one." })) : (_jsx("div", { style: {
|
|
431
431
|
display: 'flex',
|
|
@@ -443,17 +443,17 @@ export function ProtocolProbeCard({ intent, }) {
|
|
|
443
443
|
}, children: [_jsxs("summary", { style: {
|
|
444
444
|
cursor: 'pointer',
|
|
445
445
|
padding: 'var(--ggui-spacing-1, 4px) 0',
|
|
446
|
-
color: 'var(--ggui-color-
|
|
446
|
+
color: 'var(--ggui-color-onContainer, #111)',
|
|
447
447
|
}, children: [_jsx("span", { style: {
|
|
448
|
-
color: 'var(--ggui-color-
|
|
448
|
+
color: 'var(--ggui-color-onSunken, #52525b)',
|
|
449
449
|
marginRight: '8px',
|
|
450
450
|
}, children: entry.tsIso.slice(11, 19) }), _jsx("span", { style: { fontWeight: 600 }, children: entry.method })] }), _jsx("pre", { style: {
|
|
451
451
|
margin: '4px 0 0 16px',
|
|
452
452
|
whiteSpace: 'pre-wrap',
|
|
453
453
|
wordBreak: 'break-word',
|
|
454
|
-
color: 'var(--ggui-color-
|
|
454
|
+
color: 'var(--ggui-color-onSunken, #52525b)',
|
|
455
455
|
}, children: JSON.stringify(entry.params, null, 2) })] }, entry.id))) }))] }), intent ? (_jsxs(Text, { size: "xs", style: {
|
|
456
|
-
color: 'var(--ggui-color-
|
|
456
|
+
color: 'var(--ggui-color-onSunken, #52525b)',
|
|
457
457
|
opacity: 0.7,
|
|
458
458
|
}, children: ["Triggered by: ", intent] })) : null] }) }));
|
|
459
459
|
}
|
|
@@ -22,7 +22,7 @@ import qrcodeFactory from 'qrcode-generator';
|
|
|
22
22
|
* fails (e.g., URL too long for any error-correction level) so the
|
|
23
23
|
* caller can render a fallback.
|
|
24
24
|
*/
|
|
25
|
-
export function QrCode({ value, size = 128, errorCorrection = 'M', foreground = 'var(--ggui-color-
|
|
25
|
+
export function QrCode({ value, size = 128, errorCorrection = 'M', foreground = 'var(--ggui-color-onContainer, #18181b)', background = 'var(--ggui-color-container, #ffffff)', ariaLabel, }) {
|
|
26
26
|
const moduleMatrix = React.useMemo(() => {
|
|
27
27
|
try {
|
|
28
28
|
// typeNumber=0 lets the encoder pick the smallest fit. The
|
|
@@ -50,8 +50,8 @@ function UnknownSystemCard({ kind, props, }) {
|
|
|
50
50
|
border: '1px solid var(--ggui-color-outlineVariant, #e4e4e7)',
|
|
51
51
|
borderRadius: 'var(--ggui-shape-radius-md, 10px)',
|
|
52
52
|
fontFamily: 'var(--ggui-font-family-sans, -apple-system, BlinkMacSystemFont, sans-serif)',
|
|
53
|
-
background: 'var(--ggui-color-
|
|
54
|
-
color: 'var(--ggui-color-
|
|
53
|
+
background: 'var(--ggui-color-sunken, #f4f4f5)',
|
|
54
|
+
color: 'var(--ggui-color-onSunken, #52525b)',
|
|
55
55
|
},
|
|
56
56
|
}, React.createElement('div', { style: { fontWeight: 600, marginBottom: 8 } }, `Unknown system card: ${kind}`), React.createElement('div', {
|
|
57
57
|
style: {
|
package/dist/wire-config.d.ts
CHANGED
|
@@ -98,8 +98,8 @@ export interface BuildRootWireConfigOptions {
|
|
|
98
98
|
* pending-events pipe. First-party `createGguiServer` bridges it
|
|
99
99
|
* ONLY when composed with DEFAULT handlers (`opts.handlers`
|
|
100
100
|
* undefined); a custom `handlers` list drains its own pipe, so the
|
|
101
|
-
* channel deliberately does not bridge —
|
|
102
|
-
* caller, and on it a WS gesture lands on the retained ledger only.
|
|
101
|
+
* channel deliberately does not bridge — a deployment composing its own
|
|
102
|
+
* `handlers` is such a caller, and on it a WS gesture lands on the retained ledger only.
|
|
103
103
|
* See `GguiSessionChannelOptions.pendingEventConsumer`. The default
|
|
104
104
|
* send remains the seam tests and direct-WS callers exercise.
|
|
105
105
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ggui-ai/iframe-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "The iframe-local ggui runtime: a self-contained ESM bundle that boots inside an MCP Apps host iframe, runs the protocol-version handshake, opens the live-channel WebSocket, and mounts the rendered UI. Bundles React, ReactDOM, and the ggui design system so generated component code has a single seam to read from.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ggui",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"react": "^19.0.0",
|
|
42
42
|
"react-dom": "^19.0.0",
|
|
43
43
|
"zod": "^4.3.6",
|
|
44
|
-
"@ggui-ai/design": "0.
|
|
45
|
-
"@ggui-ai/gadgets": "0.
|
|
46
|
-
"@ggui-ai/live-channel": "0.
|
|
47
|
-
"@ggui-ai/preview-a2ui": "0.
|
|
48
|
-
"@ggui-ai/protocol": "0.
|
|
49
|
-
"@ggui-ai/wire": "0.
|
|
44
|
+
"@ggui-ai/design": "0.17.0",
|
|
45
|
+
"@ggui-ai/gadgets": "0.17.0",
|
|
46
|
+
"@ggui-ai/live-channel": "0.17.0",
|
|
47
|
+
"@ggui-ai/preview-a2ui": "0.17.0",
|
|
48
|
+
"@ggui-ai/protocol": "0.17.0",
|
|
49
|
+
"@ggui-ai/wire": "0.17.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@modelcontextprotocol/sdk": "^1.27.0"
|