@ggui-ai/iframe-runtime 0.3.0-rc.0 → 0.5.0-rc.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.
|
@@ -101,7 +101,7 @@ function UnresolvedPlaceholder() {
|
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
function UnsupportedComponentShell({ name }) {
|
|
104
|
-
return createElement(Card, { padding: 12, shadow: 'none', border: true }, createElement(Text, {
|
|
104
|
+
return createElement(Card, { padding: 12, shadow: 'none', border: true }, createElement(Text, { size: 'xs', tone: 'muted' }, `[${name}]`));
|
|
105
105
|
}
|
|
106
106
|
// Stable noop so React doesn't warn about switching onChange identity.
|
|
107
107
|
function noopOnChange() {
|
|
@@ -154,8 +154,14 @@ function renderComponent(component, all) {
|
|
|
154
154
|
const level = Number(headingMatch[1]);
|
|
155
155
|
return wrap(createElement(Heading, { level }, createElement(StreamingText, null, component.text)));
|
|
156
156
|
}
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
// A2UI 'caption' / 'label' map onto Text's size/weight/tone
|
|
158
|
+
// axes; anything else degrades to default body text.
|
|
159
|
+
const textProps = variant === 'caption'
|
|
160
|
+
? { size: 'xs', tone: 'muted' }
|
|
161
|
+
: variant === 'label'
|
|
162
|
+
? { size: 'sm', weight: 'medium' }
|
|
163
|
+
: {};
|
|
164
|
+
return wrap(createElement(Text, textProps, createElement(StreamingText, null, component.text)));
|
|
159
165
|
}
|
|
160
166
|
case 'Image':
|
|
161
167
|
return wrap(createElement(Image, { src: component.src, alt: component.alt ?? '' }));
|
package/dist/runtime.js
CHANGED
|
@@ -470,7 +470,10 @@ export async function bootSequence(opts) {
|
|
|
470
470
|
return { ok: false, mountedRender };
|
|
471
471
|
}
|
|
472
472
|
// A live trio is present — the WS ack will deliver the render.
|
|
473
|
-
// The seed was best-effort; fall through to subscribe.
|
|
473
|
+
// The seed was best-effort; fall through to subscribe. Warn so a
|
|
474
|
+
// degraded boot (slower first paint, ack-only delivery) is visible
|
|
475
|
+
// in host consoles instead of indistinguishable from the fast path.
|
|
476
|
+
console.warn(`[ggui] static seed fetch failed (${message}); falling back to the live channel for render delivery`);
|
|
474
477
|
seed = null;
|
|
475
478
|
}
|
|
476
479
|
if (seed !== null) {
|
|
@@ -147,7 +147,7 @@ export function NoCredentialsCard({ settingsUrl, intent, }) {
|
|
|
147
147
|
background: '#ffffff',
|
|
148
148
|
borderRadius: 'var(--ggui-shape-radius-sm, 6px)',
|
|
149
149
|
lineHeight: 0,
|
|
150
|
-
}, children: _jsx(QrCode, { value: settingsUrl, size: 120, foreground: "#000000", background: "#ffffff" }) }), _jsx(Text, {
|
|
150
|
+
}, children: _jsx(QrCode, { value: settingsUrl, size: 120, foreground: "#000000", background: "#ffffff" }) }), _jsx(Text, { size: "xs", style: {
|
|
151
151
|
color: 'var(--ggui-color-onSurfaceVariant, #52525b)',
|
|
152
152
|
fontSize: 'var(--ggui-font-size-xs, 11px)',
|
|
153
153
|
textAlign: 'center',
|
|
@@ -157,7 +157,7 @@ export function NoCredentialsCard({ settingsUrl, intent, }) {
|
|
|
157
157
|
gap: 'var(--ggui-spacing-2, 8px)',
|
|
158
158
|
flex: '1 1 240px',
|
|
159
159
|
minWidth: '200px',
|
|
160
|
-
}, children: [_jsx(Text, {
|
|
160
|
+
}, children: [_jsx(Text, { size: "xs", style: {
|
|
161
161
|
color: 'var(--ggui-color-onSurfaceVariant, #52525b)',
|
|
162
162
|
fontWeight: 'var(--ggui-font-weight-semibold, 600)',
|
|
163
163
|
textTransform: 'uppercase',
|
|
@@ -179,10 +179,10 @@ export function NoCredentialsCard({ settingsUrl, intent, }) {
|
|
|
179
179
|
alignItems: 'center',
|
|
180
180
|
gap: 'var(--ggui-spacing-3, 12px)',
|
|
181
181
|
flexWrap: 'wrap',
|
|
182
|
-
}, children: [_jsx(Button, { variant: "primary", size: "md", onClick: onPrimary, disabled: ctaDisabled, children: ctaLabel }), ctaState === 'idle' || ctaState === 'working' ? (_jsx(Text, {
|
|
182
|
+
}, children: [_jsx(Button, { variant: "primary", size: "md", onClick: onPrimary, disabled: ctaDisabled, children: ctaLabel }), ctaState === 'idle' || ctaState === 'working' ? (_jsx(Text, { size: "xs", style: {
|
|
183
183
|
color: 'var(--ggui-color-onSurfaceVariant, #52525b)',
|
|
184
184
|
opacity: 0.85,
|
|
185
|
-
}, children: "or tap-and-hold the URL above to copy" })) : null] })] })] }) }), intent ? (_jsxs(Text, {
|
|
185
|
+
}, children: "or tap-and-hold the URL above to copy" })) : null] })] })] }) }), intent ? (_jsxs(Text, { size: "xs", style: {
|
|
186
186
|
color: 'var(--ggui-color-onSurfaceVariant, #52525b)',
|
|
187
187
|
opacity: 0.7,
|
|
188
188
|
}, children: ["Pending prompt: ", intent] })) : null] }) }));
|
|
@@ -384,7 +384,7 @@ function ProbeButtonRow({ method, description, call, }) {
|
|
|
384
384
|
fontSize: 'var(--ggui-font-size-sm, 13px)',
|
|
385
385
|
color: 'var(--ggui-color-onSurface, #111)',
|
|
386
386
|
fontWeight: 'var(--ggui-font-weight-semibold, 600)',
|
|
387
|
-
}, children: method }), statusBadge] }), _jsx(Text, {
|
|
387
|
+
}, children: method }), statusBadge] }), _jsx(Text, { size: "xs", style: {
|
|
388
388
|
color: 'var(--ggui-color-onSurfaceVariant, #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: {
|
|
@@ -421,10 +421,10 @@ export function ProtocolProbeCard({ intent, }) {
|
|
|
421
421
|
alignItems: 'baseline',
|
|
422
422
|
justifyContent: 'space-between',
|
|
423
423
|
gap: 'var(--ggui-spacing-3, 12px)',
|
|
424
|
-
}, children: [_jsx(Heading, { level: 4, children: "Receive log" }), _jsxs(Text, {
|
|
424
|
+
}, children: [_jsx(Heading, { level: 4, children: "Receive log" }), _jsxs(Text, { size: "xs", style: {
|
|
425
425
|
color: 'var(--ggui-color-onSurfaceVariant, #52525b)',
|
|
426
426
|
fontSize: 'var(--ggui-font-size-xs, 11px)',
|
|
427
|
-
}, children: [log.length, " ", log.length === 1 ? 'event' : 'events'] })] }), log.length === 0 ? (_jsx(Text, {
|
|
427
|
+
}, children: [log.length, " ", log.length === 1 ? 'event' : 'events'] })] }), log.length === 0 ? (_jsx(Text, { size: "xs", style: {
|
|
428
428
|
color: 'var(--ggui-color-onSurfaceVariant, #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: {
|
|
@@ -452,7 +452,7 @@ export function ProtocolProbeCard({ intent, }) {
|
|
|
452
452
|
whiteSpace: 'pre-wrap',
|
|
453
453
|
wordBreak: 'break-word',
|
|
454
454
|
color: 'var(--ggui-color-onSurfaceVariant, #52525b)',
|
|
455
|
-
}, children: JSON.stringify(entry.params, null, 2) })] }, entry.id))) }))] }), intent ? (_jsxs(Text, {
|
|
455
|
+
}, children: JSON.stringify(entry.params, null, 2) })] }, entry.id))) }))] }), intent ? (_jsxs(Text, { size: "xs", style: {
|
|
456
456
|
color: 'var(--ggui-color-onSurfaceVariant, #52525b)',
|
|
457
457
|
opacity: 0.7,
|
|
458
458
|
}, children: ["Triggered by: ", intent] })) : null] }) }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ggui-ai/iframe-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-rc.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",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"qrcode-generator": "^2.0.4",
|
|
36
36
|
"react": "^19.0.0",
|
|
37
37
|
"react-dom": "^19.0.0",
|
|
38
|
-
"@ggui-ai/live-channel": "0.
|
|
39
|
-
"@ggui-ai/
|
|
40
|
-
"@ggui-ai/
|
|
41
|
-
"@ggui-ai/
|
|
42
|
-
"@ggui-ai/protocol": "0.
|
|
43
|
-
"@ggui-ai/wire": "0.
|
|
38
|
+
"@ggui-ai/live-channel": "0.5.0-rc.0",
|
|
39
|
+
"@ggui-ai/design": "0.5.0-rc.0",
|
|
40
|
+
"@ggui-ai/gadgets": "0.5.0-rc.0",
|
|
41
|
+
"@ggui-ai/preview-a2ui": "0.5.0-rc.0",
|
|
42
|
+
"@ggui-ai/protocol": "0.5.0-rc.0",
|
|
43
|
+
"@ggui-ai/wire": "0.5.0-rc.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@modelcontextprotocol/sdk": "^1.27.0"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"jsdom": "^24.0.0",
|
|
56
56
|
"tsx": "^4.21.0",
|
|
57
57
|
"typescript": "^5.0.0",
|
|
58
|
-
"vitest": "^3.
|
|
58
|
+
"vitest": "^3.2.6"
|
|
59
59
|
},
|
|
60
60
|
"repository": {
|
|
61
61
|
"type": "git",
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"scripts": {
|
|
77
77
|
"build": "rm -rf dist && node esbuild.config.mjs && tsc -p tsconfig.types.json && pnpm run check:bundle-size",
|
|
78
78
|
"check:bundle-size": "tsx scripts/check-bundle-size.ts",
|
|
79
|
+
"check:bundle-size:self-test": "tsx scripts/check-bundle-size.ts --self-test",
|
|
79
80
|
"typecheck": "tsc --noEmit",
|
|
80
81
|
"test": "vitest run",
|
|
81
82
|
"test:watch": "vitest"
|