@ggui-ai/mcp-apps-react-native 0.13.0 → 0.15.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/mcp-apps-react-native",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "description": "React Native SDK for ggui — components and hooks for embedding agent-generated UIs in mobile apps.",
5
5
  "keywords": [
6
6
  "ggui",
@@ -58,9 +58,9 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@modelcontextprotocol/ext-apps": "^1.7.2",
61
- "@ggui-ai/design": "0.13.0",
62
- "@ggui-ai/protocol": "0.13.0",
63
- "@ggui-ai/iframe-runtime": "0.13.0"
61
+ "@ggui-ai/design": "0.15.0",
62
+ "@ggui-ai/iframe-runtime": "0.15.0",
63
+ "@ggui-ai/protocol": "0.15.0"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@modelcontextprotocol/sdk": "^1.27.0",
@@ -76,7 +76,7 @@
76
76
  "url": "https://github.com/ggui-ai/ggui/issues"
77
77
  },
78
78
  "engines": {
79
- "node": ">=20.0.0"
79
+ "node": ">=22.0.0"
80
80
  },
81
81
  "author": "ggui contributors <hello@ggui.ai>",
82
82
  "scripts": {
@@ -202,10 +202,19 @@ export async function dispatchHostBridgeRequest(
202
202
  }
203
203
  case 'tools/call': {
204
204
  if (ctx.onToolCall === undefined) {
205
+ // In-band method refusal, spec shape (-32601 naming the
206
+ // method — the #600 catalog's H3 grade). Was -32000
207
+ // 'no-tool-handler'; retired (ggui#599 cycle-2) because
208
+ // -32000 collides with the MCP SDK's ErrorCode.ConnectionClosed
209
+ // and could never be classified as a confirmed refusal by the
210
+ // runtime's latch.
205
211
  return {
206
212
  jsonrpc: '2.0',
207
213
  id,
208
- error: { code: -32000, message: 'no-tool-handler' },
214
+ error: {
215
+ code: -32601,
216
+ message: 'tools/call not supported: no tool handler wired',
217
+ },
209
218
  };
210
219
  }
211
220
  const tool = paramString(req.params, 'name');
@@ -61,7 +61,7 @@ export interface McpAppIframePermissions {
61
61
  * - `ui/initialize` replies carry ONLY `{theme, containerDimensions,
62
62
  * locale}` — adapter-boundary rule.
63
63
  * - `tools/call` forwards to `onToolCall`; absent handler → reject
64
- * `no-tool-handler`.
64
+ * an in-band `-32601` naming `tools/call` (was `no-tool-handler`; ggui#599 cycle-2).
65
65
  * - `ui/open-link` with `https?://` → delegates to `Linking.openURL`;
66
66
  * other schemes → reject `unsupported-scheme`.
67
67
  * - Unknown method → `method_not_supported`.
@@ -166,7 +166,7 @@ export interface McpAppIframeProps {
166
166
  * iframe. The host forwards `(toolName, args)` and awaits; the
167
167
  * resolved value becomes the JSON-RPC `result`, rejections become
168
168
  * `-32000` errors. Absent handler = every `tools/call` is rejected
169
- * with `no-tool-handler`.
169
+ * with an in-band `-32601` naming `tools/call` (was `no-tool-handler`; ggui#599 cycle-2).
170
170
  */
171
171
  readonly onToolCall?: (
172
172
  toolName: string,
@@ -1,4 +1,4 @@
1
- import type { ContentBlock, InvokeTurn } from '@ggui-ai/protocol';
1
+ import type { ContentBlock, InvokeTurn } from '@ggui-ai/protocol/wire';
2
2
  import type { ConversationMessage } from '../invoke/useInvoke';
3
3
  import { extractRenderFromToolResult } from './render';
4
4
 
@@ -1,4 +1,4 @@
1
- import type { ContentBlock } from '@ggui-ai/protocol';
1
+ import type { ContentBlock } from '@ggui-ai/protocol/wire';
2
2
 
3
3
  /**
4
4
  * Pull a durable render payload out of a `tool_result` block's
@@ -24,8 +24,8 @@
24
24
  */
25
25
  import { useState, useCallback, useEffect, useMemo, type ReactNode } from 'react';
26
26
  import { Dimensions, PixelRatio } from 'react-native';
27
- import type { AdapterPermissions, PermissionStatus, InterfaceContext, EndUserIdentity, AppDisplayConfig } from '@ggui-ai/protocol';
28
- import { KNOWN_PERMISSION_NAMES, UnknownPermissionNameError } from '@ggui-ai/protocol';
27
+ import type { AdapterPermissions, PermissionStatus, InterfaceContext, EndUserIdentity, AppDisplayConfig } from '@ggui-ai/protocol/wire';
28
+ import { KNOWN_PERMISSION_NAMES, UnknownPermissionNameError } from '@ggui-ai/protocol/wire';
29
29
  import { GguiContext, type AdapterRegistry, type GguiContextValue } from '../context/GguiContext';
30
30
 
31
31
  const KNOWN_PERMISSION_NAMES_SET: ReadonlySet<string> = new Set(KNOWN_PERMISSION_NAMES);
@@ -1,5 +1,5 @@
1
1
  import { createContext, useContext } from 'react';
2
- import type { AdapterPermissions, PermissionStatus, InterfaceContext, EndUserIdentity, AppDisplayConfig } from '@ggui-ai/protocol';
2
+ import type { AdapterPermissions, PermissionStatus, InterfaceContext, EndUserIdentity, AppDisplayConfig } from '@ggui-ai/protocol/wire';
3
3
 
4
4
  /**
5
5
  * Open interface — host runtime registry of **client/device adapter
package/src/index.ts CHANGED
@@ -61,8 +61,8 @@ export type {
61
61
  InterfaceContext,
62
62
  DeviceCategory,
63
63
  EndUserIdentity,
64
- } from '@ggui-ai/protocol';
65
- export { BRIDGE_EVENTS, detectInterfaceContext, getDeviceCategory } from '@ggui-ai/protocol';
64
+ } from '@ggui-ai/protocol/wire';
65
+ export { BRIDGE_EVENTS, detectInterfaceContext, getDeviceCategory } from '@ggui-ai/protocol/wire';
66
66
 
67
67
  // Invoke protocol message block types — re-exported at root so facade
68
68
  // consumers can pull them from the same import path as useInvoke.
@@ -73,7 +73,7 @@ export type {
73
73
  ToolUseBlock,
74
74
  ToolResultBlock,
75
75
  InvokeTurn,
76
- } from '@ggui-ai/protocol';
76
+ } from '@ggui-ai/protocol/wire';
77
77
 
78
78
  // ProtocolError typed union — the canonical shape for every failure
79
79
  // the renderer classifies outward. `<McpAppIframe onError>` surfaces
@@ -11,7 +11,7 @@
11
11
  * and Expo SDK 50+ polyfills it for older runtimes. If consumers target an
12
12
  * older setup they must polyfill `TextDecoder` in their entry file.
13
13
  */
14
- import { invokeEventSchema, type InvokeEvent } from '@ggui-ai/protocol';
14
+ import { invokeEventSchema, type InvokeEvent } from '@ggui-ai/protocol/wire';
15
15
 
16
16
  const DECODER = new TextDecoder();
17
17
  const FRAME_SEP = '\n\n';
@@ -57,7 +57,7 @@ import type {
57
57
  InvokeErrorCode,
58
58
  InvokeTurn,
59
59
  ToolUseBlock,
60
- } from '@ggui-ai/protocol';
60
+ } from '@ggui-ai/protocol/wire';
61
61
  import { useGguiContext } from '../components/GguiProvider';
62
62
  import { parseSseStream } from './sse-parse';
63
63