@agent-native/core 0.22.18 → 0.22.20
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/client/agent-chat.d.ts.map +1 -1
- package/dist/client/agent-chat.js +19 -6
- package/dist/client/agent-chat.js.map +1 -1
- package/dist/client/embed-auth.d.ts +5 -0
- package/dist/client/embed-auth.d.ts.map +1 -1
- package/dist/client/embed-auth.js +181 -12
- package/dist/client/embed-auth.js.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/mcp-app-host.d.ts +5 -0
- package/dist/client/mcp-app-host.d.ts.map +1 -1
- package/dist/client/mcp-app-host.js +267 -2
- package/dist/client/mcp-app-host.js.map +1 -1
- package/dist/client/mcp-apps/McpAppRenderer.d.ts +3 -0
- package/dist/client/mcp-apps/McpAppRenderer.d.ts.map +1 -1
- package/dist/client/mcp-apps/McpAppRenderer.js +86 -9
- package/dist/client/mcp-apps/McpAppRenderer.js.map +1 -1
- package/dist/client/theme.js +1 -1
- package/dist/client/theme.js.map +1 -1
- package/dist/client/vite-dev-recovery-script.d.ts.map +1 -1
- package/dist/client/vite-dev-recovery-script.js +9 -0
- package/dist/client/vite-dev-recovery-script.js.map +1 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +73 -5
- package/dist/deploy/build.js.map +1 -1
- package/dist/index.browser.d.ts +1 -1
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/mcp/build-server.d.ts.map +1 -1
- package/dist/mcp/build-server.js +73 -8
- package/dist/mcp/build-server.js.map +1 -1
- package/dist/mcp/builtin-tools.d.ts.map +1 -1
- package/dist/mcp/builtin-tools.js +6 -3
- package/dist/mcp/builtin-tools.js.map +1 -1
- package/dist/mcp/embed-app.d.ts +2 -2
- package/dist/mcp/embed-app.d.ts.map +1 -1
- package/dist/mcp/embed-app.js +426 -23
- package/dist/mcp/embed-app.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +37 -10
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/create-server.d.ts.map +1 -1
- package/dist/server/create-server.js +21 -7
- package/dist/server/create-server.js.map +1 -1
- package/dist/server/embed-route.d.ts.map +1 -1
- package/dist/server/embed-route.js +62 -21
- package/dist/server/embed-route.js.map +1 -1
- package/dist/server/open-route.d.ts.map +1 -1
- package/dist/server/open-route.js +7 -2
- package/dist/server/open-route.js.map +1 -1
- package/dist/server/security-headers.d.ts.map +1 -1
- package/dist/server/security-headers.js +9 -1
- package/dist/server/security-headers.js.map +1 -1
- package/dist/server/ssr-handler.d.ts +2 -0
- package/dist/server/ssr-handler.d.ts.map +1 -1
- package/dist/server/ssr-handler.js +66 -11
- package/dist/server/ssr-handler.js.map +1 -1
- package/dist/shared/mcp-embed-headers.d.ts +12 -0
- package/dist/shared/mcp-embed-headers.d.ts.map +1 -0
- package/dist/shared/mcp-embed-headers.js +51 -0
- package/dist/shared/mcp-embed-headers.js.map +1 -0
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +23 -0
- package/dist/vite/client.js.map +1 -1
- package/docs/content/actions.md +15 -5
- package/docs/content/client.md +6 -3
- package/docs/content/external-agents.md +61 -41
- package/docs/content/mcp-protocol.md +42 -7
- package/package.json +1 -1
|
@@ -78,13 +78,39 @@ If an action declares `mcpApp`, the server also advertises the official MCP Apps
|
|
|
78
78
|
|
|
79
79
|
`embedApp()` is the low-level URL-first MCP App helper. It reads the action
|
|
80
80
|
result's open link, asks the app-only `create_embed_session` tool to mint a
|
|
81
|
-
route-scoped session, then
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
route-scoped session, then launches the resulting app route. ChatGPT and hosts
|
|
82
|
+
that allow direct route hydration launch the same signed app URL, but ChatGPT
|
|
83
|
+
keeps it in a controlled route iframe to avoid a web-sandbox auto-height
|
|
84
|
+
feedback loop. Claude web currently proxies MCP App content under
|
|
85
|
+
`claudemcpcontent.com`; direct route navigation can fetch app HTML there
|
|
86
|
+
without reliably running the framework bootstrap, and a second nested iframe is
|
|
87
|
+
easy for the host to block. For Claude, `embedApp()` fetches the signed app
|
|
88
|
+
HTML and mounts the real route document into the existing MCP resource frame,
|
|
89
|
+
with app-origin requests routed back to the original app using the embed token.
|
|
90
|
+
For normal action authoring, use `embedRoute()` when the action's
|
|
91
|
+
`link` and `mcpApp` should come from the same pure route builder. The route
|
|
92
|
+
itself should derive state from the URL and normal app data fetching.
|
|
93
|
+
|
|
94
|
+
The outer MCP resource reports a bounded inline height to the host and the app
|
|
95
|
+
route scrolls internally. Do not rely on host auto-resize measuring the full
|
|
96
|
+
document; in ChatGPT and Claude this can make a normal full-app route appear as
|
|
97
|
+
a huge chat artifact. Host conversations also keep already-rendered iframes, so
|
|
98
|
+
after changing the resource shell or `ui://` version, test a fresh tool call
|
|
99
|
+
rather than re-measuring an old frame.
|
|
100
|
+
|
|
101
|
+
Default direct embeds talk to the MCP Apps host through standard `ui/*`
|
|
102
|
+
JSON-RPC messages:
|
|
103
|
+
|
|
104
|
+
| Type | Payload shape |
|
|
105
|
+
| ------------------------- | ---------------------------------- |
|
|
106
|
+
| `ui/update-model-context` | `{ content?, structuredContent? }` |
|
|
107
|
+
| `ui/message` | `{ role: "user", content }` |
|
|
108
|
+
| `ui/open-link` | `{ url }` |
|
|
109
|
+
| `ui/request-display-mode` | `{ mode }` |
|
|
110
|
+
|
|
111
|
+
The ChatGPT controlled-frame path and any explicit `embedMode: "iframe"` /
|
|
112
|
+
`renderMode: "iframe"` diagnostic path use the wrapper-to-route postMessage
|
|
113
|
+
relay:
|
|
88
114
|
|
|
89
115
|
| Direction | Type | Payload shape |
|
|
90
116
|
| --------------- | ---------------------------------------- | --------------------------------------------- |
|
|
@@ -94,8 +120,17 @@ postMessage types:
|
|
|
94
120
|
| route → wrapper | `agentNative.mcpHost.requestDisplayMode` | `{ requestId, mode }` |
|
|
95
121
|
| wrapper → route | `agentNative.mcpHost.response` | `{ requestId, ok, result?, error? }` |
|
|
96
122
|
|
|
123
|
+
`embedApp()` includes the MCP request origin in the resource CSP so the
|
|
124
|
+
launcher can fetch and, when explicitly requested, frame the signed first-party
|
|
125
|
+
route. Pass additional `frameDomains` only for custom third-party frames.
|
|
126
|
+
|
|
97
127
|
Host-mediated open links keep the iframe from choosing its own browser target.
|
|
98
128
|
Model context updates are opt-in and hidden from the user-facing transcript.
|
|
129
|
+
`ui/message` is the portable way for an embedded app button to ask the host to
|
|
130
|
+
post a visible user message and continue the chat. In agent-native routes,
|
|
131
|
+
`sendToAgentChat()` uses `ui/update-model-context` plus `ui/message` when
|
|
132
|
+
called from a submitted MCP App embed, while `submit: false` remains an
|
|
133
|
+
in-route draft/prefill path.
|
|
99
134
|
Display mode requests are best-effort: a host can honor, ignore, or reject the
|
|
100
135
|
request. Embedded routes must remain functional in the default inline mode.
|
|
101
136
|
|
package/package.json
CHANGED