@agent-native/core 0.22.35 → 0.22.37

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.
Files changed (56) hide show
  1. package/dist/action.d.ts +10 -0
  2. package/dist/action.d.ts.map +1 -1
  3. package/dist/action.js.map +1 -1
  4. package/dist/client/AgentPanel.d.ts +5 -4
  5. package/dist/client/AgentPanel.d.ts.map +1 -1
  6. package/dist/client/AgentPanel.js.map +1 -1
  7. package/dist/client/MultiTabAssistantChat.d.ts +4 -5
  8. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  9. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  10. package/dist/client/index.d.ts +1 -1
  11. package/dist/client/index.d.ts.map +1 -1
  12. package/dist/client/index.js +1 -1
  13. package/dist/client/index.js.map +1 -1
  14. package/dist/client/mcp-app-host.d.ts.map +1 -1
  15. package/dist/client/mcp-app-host.js +9 -5
  16. package/dist/client/mcp-app-host.js.map +1 -1
  17. package/dist/client/sharing/ShareButton.d.ts +7 -0
  18. package/dist/client/sharing/ShareButton.d.ts.map +1 -1
  19. package/dist/client/sharing/ShareButton.js +261 -38
  20. package/dist/client/sharing/ShareButton.js.map +1 -1
  21. package/dist/client/sharing/ShareButton.spec.js +77 -0
  22. package/dist/client/sharing/ShareButton.spec.js.map +1 -1
  23. package/dist/client/use-chat-threads.d.ts.map +1 -1
  24. package/dist/client/use-chat-threads.js +72 -26
  25. package/dist/client/use-chat-threads.js.map +1 -1
  26. package/dist/client/use-chat-threads.spec.js +101 -0
  27. package/dist/client/use-chat-threads.spec.js.map +1 -1
  28. package/dist/index.browser.d.ts +1 -1
  29. package/dist/index.browser.d.ts.map +1 -1
  30. package/dist/index.browser.js +1 -1
  31. package/dist/index.browser.js.map +1 -1
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +1 -1
  35. package/dist/index.js.map +1 -1
  36. package/dist/mcp/build-server.d.ts +2 -0
  37. package/dist/mcp/build-server.d.ts.map +1 -1
  38. package/dist/mcp/build-server.js +62 -23
  39. package/dist/mcp/build-server.js.map +1 -1
  40. package/dist/mcp/embed-app.d.ts.map +1 -1
  41. package/dist/mcp/embed-app.js +30 -22
  42. package/dist/mcp/embed-app.js.map +1 -1
  43. package/dist/mcp/server.js +3 -3
  44. package/dist/mcp/server.js.map +1 -1
  45. package/dist/org/handlers.d.ts +2 -0
  46. package/dist/org/handlers.d.ts.map +1 -1
  47. package/dist/org/handlers.js +46 -5
  48. package/dist/org/handlers.js.map +1 -1
  49. package/dist/server/embed-session.d.ts.map +1 -1
  50. package/dist/server/embed-session.js +4 -0
  51. package/dist/server/embed-session.js.map +1 -1
  52. package/docs/content/actions.md +6 -2
  53. package/docs/content/client.md +2 -1
  54. package/docs/content/external-agents.md +16 -5
  55. package/docs/content/mcp-protocol.md +18 -6
  56. package/package.json +1 -1
@@ -201,7 +201,9 @@ This advertises the MCP Apps extension (`io.modelcontextprotocol/ui`), exposes t
201
201
  The helper launches the action's `link` target through `/_agent-native/embed/start` with a short-lived browser session, so routes such as full dashboards, filtered inboxes, drafts, and extension pages can reuse the app's React components directly.
202
202
  Same-app `open_app({ embed: true })` mints that embed-start ticket during the
203
203
  original tool call, and custom actions can return `embedStartUrl` for the same
204
- fast path; otherwise the resource falls back to the app-only
204
+ fast path. The MCP layer keeps ticket-bearing embed-start URLs in hidden
205
+ metadata and removes them from model-visible `structuredContent` and open-link
206
+ metadata; otherwise the resource falls back to the app-only
205
207
  `create_embed_session` helper.
206
208
  Standard hosts navigate the MCP App frame directly to that signed route.
207
209
  Claude web uses a single-frame transplant path that hydrates the signed app
@@ -217,7 +219,9 @@ and explicit diagnostic iframe path proxy `agentNative.mcpHost.*` messages
217
219
  through the launch wrapper.
218
220
  When a submitted app prompt should continue the host chat, call
219
221
  `sendToAgentChat()` from the embedded route; it sends hidden model context and
220
- then posts a visible user message through the host bridge where supported.
222
+ then posts a visible user message through the host bridge where supported. Keep
223
+ internal route/app-state instructions in the hidden context; the visible prompt
224
+ should be the user's actual request.
221
225
  Design those routes with their own scrolling, because the MCP resource reports
222
226
  a bounded inline height rather than asking the host to size itself to the full
223
227
  app document. `embedApp({ height })` defaults to a `560px` shell, clamps to
@@ -77,7 +77,8 @@ When the app route is running inside an MCP App embed created with `embedApp()`,
77
77
  auto-submitted messages (`submit` omitted or `true`) are forwarded to the MCP
78
78
  App host bridge, which asks the containing host to add hidden context and send
79
79
  the visible user turn. `context` is sent as model context before the visible
80
- message, so it stays model-visible without being posted as user-facing chat.
80
+ message, so it stays model-visible without being posted as user-facing chat or
81
+ concatenated into the host's visible prompt.
81
82
  `submit: false` keeps the local prefill/review behavior because MCP Apps do not
82
83
  define a standard draft-prefill API.
83
84
 
@@ -52,7 +52,10 @@ OAuth grants are per host and per user. The host stores the tokens and
52
52
  mediates tool/resource calls, so inline MCP App previews never receive raw
53
53
  OAuth tokens. ChatGPT can keep a reviewed or published connector's tool
54
54
  snapshot until you refresh/review it again, so rescan the connector after MCP
55
- tool or MCP App metadata changes. The scopes are:
55
+ tool or MCP App metadata changes. If you still have old per-app connectors
56
+ enabled alongside Dispatch, refresh or reconnect each stale connector; updating
57
+ Dispatch does not rewrite ChatGPT or Claude's cached Calendar/Mail/etc.
58
+ snapshots. The scopes are:
56
59
 
57
60
  | Scope | What it enables |
58
61
  | ----------- | ---------------------------------------------------- |
@@ -237,11 +240,13 @@ embedded routes so a reload with the same signed URL reconstructs the same
237
240
  view.
238
241
 
239
242
  For same-app `open_app({ embed: true })`, the framework mints the embed-start
240
- ticket during the original tool call and returns `embedStartUrl` in the hidden
241
- structured payload. Custom actions can do the same. When no `embedStartUrl` is
243
+ ticket during the original tool call and stores the signed start URL in hidden
244
+ tool metadata. Custom actions can return `embedStartUrl` for the same fast
245
+ path; the MCP layer strips that ticket-bearing URL from model-visible
246
+ `structuredContent` and normal open-link metadata. When no embed start URL is
242
247
  present, the resource falls back to the app-only `create_embed_session` helper.
243
248
  This keeps production hosts that restrict iframe-initiated tool calls on the
244
- direct route.
249
+ direct route without leaking one-time app session URLs into the transcript.
245
250
 
246
251
  ChatGPT gets a dedicated compatibility path through `window.openai`: the launch
247
252
  document reads `toolInput`, `toolOutput`, and `toolResponseMetadata` directly,
@@ -438,7 +443,9 @@ loads third-party assets.
438
443
  Inside those `embedApp()` routes, `sendToAgentChat()` is embed-aware.
439
444
  Auto-submitted prompts relay to the MCP host as `ui/update-model-context` plus
440
445
  `ui/message`, so a button in the embedded app can intentionally continue the
441
- Claude/ChatGPT conversation from the selected app state. `submit: false`
446
+ Claude/ChatGPT conversation from the selected app state. Hidden context is sent
447
+ as model context; the visible user turn stays just the app's prompt, which
448
+ avoids scary host consent around internal app-state file paths. `submit: false`
442
449
  remains local prefill/review behavior.
443
450
 
444
451
  ### The `link` contract {#link-contract}
@@ -587,6 +594,10 @@ The fallback hosted `connect` flow never copies the deployment's shared secret.
587
594
  - When validating ChatGPT or Claude web, trigger a fresh tool call after shell
588
595
  changes and measure the visible iframe. Previously rendered frames in the
589
596
  same conversation may still show cached height or launch behavior.
597
+ - Keep ChatGPT/Claude app-host catalogs compact. Use Dispatch and
598
+ `open_app({ embed: true })` for full-app previews; only mark a specific
599
+ action `mcpApp.compactCatalog: true` when it must appear directly in the
600
+ compact host discovery surface.
590
601
 
591
602
  **Don't**
592
603
 
@@ -89,9 +89,10 @@ For normal action authoring, use `embedRoute()` when the action's
89
89
  `link` and `mcpApp` should come from the same pure route builder. The route
90
90
  itself should derive state from the URL and normal app data fetching.
91
91
  Same-app `open_app({ embed: true })` returns a server-minted `embedStartUrl`
92
- so the resource can launch without a second iframe-originated tool call;
93
- custom actions can return the same field when they already know the target
94
- route.
92
+ so the resource can launch without a second iframe-originated tool call. The
93
+ server moves that ticket-bearing URL into hidden metadata and strips it from
94
+ model-visible structured content and normal open-link metadata. Custom actions
95
+ can return the same field when they already know the target route.
95
96
 
96
97
  The outer MCP resource reports a bounded inline height to the host and the app
97
98
  route scrolls internally. `embedApp({ height })` defaults to a `560px` shell,
@@ -158,14 +159,25 @@ Model context updates are opt-in and hidden from the user-facing transcript.
158
159
  `ui/message` is the portable way for an embedded app button to ask the host to
159
160
  post a visible user message and continue the chat. In agent-native routes,
160
161
  `sendToAgentChat()` uses `ui/update-model-context` plus `ui/message` when
161
- called from a submitted MCP App embed, while `submit: false` remains an
162
- in-route draft/prefill path.
162
+ called from a submitted MCP App embed. Hidden context is sent through model
163
+ context, while `ui/message` contains only the visible prompt. `submit: false`
164
+ remains an in-route draft/prefill path.
163
165
  Display mode requests are best-effort: a host can honor, ignore, or reject the
164
166
  request. Embedded routes must remain functional in the default inline mode.
165
167
 
166
168
  ## Tools {#tools}
167
169
 
168
- Stdio/code developer clients can see all connected app actions as MCP tools. Chat-style app hosts, including OAuth callers that request `mcp:apps` and generic authenticated remote HTTP/static-token callers, get a compact app-host catalog: app-facing builtins (`list_apps`, `open_app`, `ask_app`, and app-only `create_embed_session`) plus rare actions marked `mcpApp.compactCatalog: true`. Their `resources/list` is compact too, normally advertising only the generic `open_app` embed resource. `publicAgent.expose` remains the opt-in for safe read/ingest tools outside that compact app catalog. This keeps ChatGPT/Claude app-host discovery small while preserving the full developer surface for local agents.
170
+ Stdio/code developer clients can see all connected app actions as MCP tools
171
+ when they explicitly request the full catalog. Chat-style app hosts, including
172
+ OAuth callers that request `mcp:apps` and generic authenticated remote
173
+ HTTP/static-token callers, get a compact app-host catalog by default:
174
+ app-facing builtins (`list_apps`, `open_app`, `ask_app`, and app-only
175
+ `create_embed_session`) plus rare actions marked `mcpApp.compactCatalog: true`.
176
+ Their `resources/list` is compact too, normally advertising only the generic
177
+ `open_app` embed resource. `publicAgent.expose` remains the opt-in for safe
178
+ read/ingest tools outside that compact app catalog. This keeps ChatGPT/Claude
179
+ app-host discovery small while preserving the full developer surface for local
180
+ agents.
169
181
 
170
182
  The mapping is direct:
171
183
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.22.35",
3
+ "version": "0.22.37",
4
4
  "type": "module",
5
5
  "description": "Framework for agent-native application development — where AI agents and UI share state via files",
6
6
  "license": "MIT",