@ggui-ai/iframe-runtime 0.6.3 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ggui-ai/iframe-runtime",
3
- "version": "0.6.3",
3
+ "version": "0.7.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.6.3",
39
- "@ggui-ai/gadgets": "0.6.3",
40
- "@ggui-ai/preview-a2ui": "0.6.3",
41
- "@ggui-ai/design": "0.6.3",
42
- "@ggui-ai/protocol": "0.6.3",
43
- "@ggui-ai/wire": "0.6.3"
38
+ "@ggui-ai/live-channel": "0.7.0",
39
+ "@ggui-ai/gadgets": "0.7.0",
40
+ "@ggui-ai/design": "0.7.0",
41
+ "@ggui-ai/preview-a2ui": "0.7.0",
42
+ "@ggui-ai/protocol": "0.7.0",
43
+ "@ggui-ai/wire": "0.7.0"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@modelcontextprotocol/sdk": "^1.27.0"
@@ -1,26 +0,0 @@
1
- /**
2
- * `system` channel handler — emits the `auth-required` observability
3
- * event when the server signals an OAuth consent flow.
4
- *
5
- * Absorbed from `handleObservableMessage` in `runtime.ts`. The
6
- * handler is now the sole dispatch surface for `system` frames in
7
- * the iframe runtime; other system actions (e.g.
8
- * `credential_ready`) have downstream listeners elsewhere and are
9
- * intentionally skipped at this layer.
10
- *
11
- * Skip conditions (all silent — host gets no row, which is the
12
- * correct behaviour: a system frame the host can't act on shouldn't
13
- * surface as a spurious consent overlay trigger):
14
- * - `action !== 'auth_required'` — e.g. `'credential_ready'` is a
15
- * different downstream signal.
16
- * - `consentUrl` absent — the host cannot redirect the user without
17
- * it, so there's nothing actionable to surface.
18
- * - `onObserve` absent — the observation has nowhere to go.
19
- */
20
- import type { ChannelHandler } from '@ggui-ai/live-channel';
21
- import type { SystemPayload } from '@ggui-ai/protocol';
22
- import type { ObservabilityEmitter } from '../observability.js';
23
- export interface SystemHandlerDeps {
24
- readonly onObserve?: ObservabilityEmitter;
25
- }
26
- export declare function createSystemHandler(deps: SystemHandlerDeps): ChannelHandler<SystemPayload>;
@@ -1,44 +0,0 @@
1
- /**
2
- * `system` channel handler — emits the `auth-required` observability
3
- * event when the server signals an OAuth consent flow.
4
- *
5
- * Absorbed from `handleObservableMessage` in `runtime.ts`. The
6
- * handler is now the sole dispatch surface for `system` frames in
7
- * the iframe runtime; other system actions (e.g.
8
- * `credential_ready`) have downstream listeners elsewhere and are
9
- * intentionally skipped at this layer.
10
- *
11
- * Skip conditions (all silent — host gets no row, which is the
12
- * correct behaviour: a system frame the host can't act on shouldn't
13
- * surface as a spurious consent overlay trigger):
14
- * - `action !== 'auth_required'` — e.g. `'credential_ready'` is a
15
- * different downstream signal.
16
- * - `consentUrl` absent — the host cannot redirect the user without
17
- * it, so there's nothing actionable to surface.
18
- * - `onObserve` absent — the observation has nowhere to go.
19
- */
20
- export function createSystemHandler(deps) {
21
- return {
22
- type: 'system',
23
- onMessage: (payload) => {
24
- if (deps.onObserve === undefined)
25
- return;
26
- emitAuthRequiredFromSystemFrame(payload, deps.onObserve);
27
- },
28
- };
29
- }
30
- function emitAuthRequiredFromSystemFrame(payload, emit) {
31
- if (payload.action !== 'auth_required')
32
- return;
33
- if (typeof payload.consentUrl !== 'string' || payload.consentUrl.length === 0)
34
- return;
35
- const event = {
36
- kind: 'auth-required',
37
- provider: payload.serviceId,
38
- authUrl: payload.consentUrl,
39
- ...(payload.displayName !== undefined ? { displayName: payload.displayName } : {}),
40
- ...(payload.scopes !== undefined ? { scopes: payload.scopes } : {}),
41
- ...(payload.message !== undefined ? { message: payload.message } : {}),
42
- };
43
- emit(event);
44
- }