@agent-native/dispatch 0.43.0-nightly-20261120212328 → 0.43.7

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 (296) hide show
  1. package/CHANGELOG.md +194 -174
  2. package/dist/actions/ask_app.d.ts +3 -0
  3. package/dist/actions/ask_app.js +7 -2
  4. package/dist/actions/ask_app.js.map +1 -1
  5. package/dist/actions/ask_app_status.d.ts +3 -0
  6. package/dist/actions/ask_app_status.js +5 -1
  7. package/dist/actions/ask_app_status.js.map +1 -1
  8. package/dist/actions/call_app_action.d.ts +1 -0
  9. package/dist/actions/call_app_action.js +21 -5
  10. package/dist/actions/call_app_action.js.map +1 -1
  11. package/dist/actions/create_embed_session.d.ts +3 -2
  12. package/dist/actions/create_embed_session.js +4 -2
  13. package/dist/actions/create_embed_session.js.map +1 -1
  14. package/dist/actions/create_workspace_app_embed_session.d.ts +3 -2
  15. package/dist/actions/create_workspace_app_embed_session.js +3 -1
  16. package/dist/actions/create_workspace_app_embed_session.js.map +1 -1
  17. package/dist/actions/delete-destination.d.ts +12 -12
  18. package/dist/actions/execute-action-suggestion.d.ts +44 -0
  19. package/dist/actions/execute-action-suggestion.d.ts.map +1 -0
  20. package/dist/actions/execute-action-suggestion.js +148 -0
  21. package/dist/actions/execute-action-suggestion.js.map +1 -0
  22. package/dist/actions/import-agent.d.ts +13 -13
  23. package/dist/actions/index.d.ts.map +1 -1
  24. package/dist/actions/index.js +5 -1
  25. package/dist/actions/index.js.map +1 -1
  26. package/dist/actions/list-connected-agents.js +3 -2
  27. package/dist/actions/list-connected-agents.js.map +1 -1
  28. package/dist/actions/list-workspace-connections.d.ts +1 -0
  29. package/dist/actions/list-workspace-connections.d.ts.map +1 -1
  30. package/dist/actions/list_app_actions.js +1 -1
  31. package/dist/actions/list_app_actions.js.map +1 -1
  32. package/dist/actions/list_apps.d.ts +2 -0
  33. package/dist/actions/list_apps.js +11 -3
  34. package/dist/actions/list_apps.js.map +1 -1
  35. package/dist/actions/navigate.js +1 -0
  36. package/dist/actions/navigate.js.map +1 -1
  37. package/dist/actions/open_app.d.ts +4 -0
  38. package/dist/actions/open_app.js +14 -6
  39. package/dist/actions/open_app.js.map +1 -1
  40. package/dist/actions/propose-action-suggestions.d.ts +45 -0
  41. package/dist/actions/propose-action-suggestions.d.ts.map +1 -0
  42. package/dist/actions/propose-action-suggestions.js +32 -0
  43. package/dist/actions/propose-action-suggestions.js.map +1 -0
  44. package/dist/actions/provider-api-register.d.ts +12 -12
  45. package/dist/actions/read_view.js +1 -1
  46. package/dist/actions/read_view.js.map +1 -1
  47. package/dist/actions/remember-pointer.js +1 -1
  48. package/dist/actions/remember-pointer.js.map +1 -1
  49. package/dist/actions/resolve-pointer.js +1 -1
  50. package/dist/actions/resolve-pointer.js.map +1 -1
  51. package/dist/actions/route-app-intent.d.ts +6 -0
  52. package/dist/actions/route-app-intent.js +79 -5
  53. package/dist/actions/route-app-intent.js.map +1 -1
  54. package/dist/actions/send-code-agent-remote-command.js +4 -0
  55. package/dist/actions/send-code-agent-remote-command.js.map +1 -1
  56. package/dist/actions/start-workspace-app-creation.js +1 -1
  57. package/dist/actions/start-workspace-app-creation.js.map +1 -1
  58. package/dist/actions/upsert-destination.d.ts +12 -12
  59. package/dist/actions/view-screen.d.ts +12 -1
  60. package/dist/actions/view-screen.js +53 -5
  61. package/dist/actions/view-screen.js.map +1 -1
  62. package/dist/components/chat-action-suggestions.d.ts +8 -0
  63. package/dist/components/chat-action-suggestions.d.ts.map +1 -0
  64. package/dist/components/chat-action-suggestions.js +191 -0
  65. package/dist/components/chat-action-suggestions.js.map +1 -0
  66. package/dist/components/chat-home-apps.d.ts.map +1 -1
  67. package/dist/components/chat-home-apps.js +1 -1
  68. package/dist/components/chat-home-apps.js.map +1 -1
  69. package/dist/components/google-broker-settings-group.d.ts +2 -0
  70. package/dist/components/google-broker-settings-group.d.ts.map +1 -0
  71. package/dist/components/google-broker-settings-group.js +53 -0
  72. package/dist/components/google-broker-settings-group.js.map +1 -0
  73. package/dist/components/layout/Layout.d.ts +4 -1
  74. package/dist/components/layout/Layout.d.ts.map +1 -1
  75. package/dist/components/layout/Layout.js +246 -69
  76. package/dist/components/layout/Layout.js.map +1 -1
  77. package/dist/components/messaging-setup-panel.d.ts.map +1 -1
  78. package/dist/components/messaging-setup-panel.js +47 -15
  79. package/dist/components/messaging-setup-panel.js.map +1 -1
  80. package/dist/components/workspace-app-host.d.ts +27 -4
  81. package/dist/components/workspace-app-host.d.ts.map +1 -1
  82. package/dist/components/workspace-app-host.js +355 -74
  83. package/dist/components/workspace-app-host.js.map +1 -1
  84. package/dist/config.d.ts +5 -0
  85. package/dist/config.d.ts.map +1 -1
  86. package/dist/config.js.map +1 -1
  87. package/dist/db/google-broker-admission.d.ts +36 -0
  88. package/dist/db/google-broker-admission.d.ts.map +1 -0
  89. package/dist/db/google-broker-admission.js +129 -0
  90. package/dist/db/google-broker-admission.js.map +1 -0
  91. package/dist/db/migrations.d.ts +1 -1
  92. package/dist/db/migrations.d.ts.map +1 -1
  93. package/dist/db/migrations.js +42 -0
  94. package/dist/db/migrations.js.map +1 -1
  95. package/dist/lib/action-suggestions.d.ts +20 -0
  96. package/dist/lib/action-suggestions.d.ts.map +1 -0
  97. package/dist/lib/action-suggestions.js +219 -0
  98. package/dist/lib/action-suggestions.js.map +1 -0
  99. package/dist/lib/chat-first-app-route.d.ts +11 -5
  100. package/dist/lib/chat-first-app-route.d.ts.map +1 -1
  101. package/dist/lib/chat-first-app-route.js +9 -5
  102. package/dist/lib/chat-first-app-route.js.map +1 -1
  103. package/dist/lib/chat-first-pane.d.ts +25 -1
  104. package/dist/lib/chat-first-pane.d.ts.map +1 -1
  105. package/dist/lib/chat-first-pane.js +67 -1
  106. package/dist/lib/chat-first-pane.js.map +1 -1
  107. package/dist/lib/data-intent.d.ts +3 -0
  108. package/dist/lib/data-intent.d.ts.map +1 -0
  109. package/dist/lib/data-intent.js +14 -0
  110. package/dist/lib/data-intent.js.map +1 -0
  111. package/dist/lib/dispatch-app-identity.d.ts +10 -0
  112. package/dist/lib/dispatch-app-identity.d.ts.map +1 -0
  113. package/dist/lib/dispatch-app-identity.js +18 -0
  114. package/dist/lib/dispatch-app-identity.js.map +1 -0
  115. package/dist/lib/other-apps.d.ts +15 -0
  116. package/dist/lib/other-apps.d.ts.map +1 -1
  117. package/dist/lib/other-apps.js +31 -0
  118. package/dist/lib/other-apps.js.map +1 -1
  119. package/dist/lib/workspace-app-frame-view.d.ts +15 -0
  120. package/dist/lib/workspace-app-frame-view.d.ts.map +1 -0
  121. package/dist/lib/workspace-app-frame-view.js +72 -0
  122. package/dist/lib/workspace-app-frame-view.js.map +1 -0
  123. package/dist/lib/workspace-apps.d.ts +5 -0
  124. package/dist/lib/workspace-apps.d.ts.map +1 -1
  125. package/dist/lib/workspace-apps.js +85 -23
  126. package/dist/lib/workspace-apps.js.map +1 -1
  127. package/dist/lib/workspace-apps.test.js +6 -0
  128. package/dist/lib/workspace-apps.test.js.map +1 -1
  129. package/dist/routes/pages/_index.d.ts +2 -2
  130. package/dist/routes/pages/chat.d.ts.map +1 -1
  131. package/dist/routes/pages/chat.js +33 -2
  132. package/dist/routes/pages/chat.js.map +1 -1
  133. package/dist/routes/pages/settings-page.d.ts +1 -1
  134. package/dist/routes/pages/settings-page.d.ts.map +1 -1
  135. package/dist/routes/pages/settings-page.js +3 -2
  136. package/dist/routes/pages/settings-page.js.map +1 -1
  137. package/dist/server/index.d.ts +4 -1
  138. package/dist/server/index.d.ts.map +1 -1
  139. package/dist/server/index.js +5 -5
  140. package/dist/server/index.js.map +1 -1
  141. package/dist/server/lib/action-suggestions.d.ts +41 -0
  142. package/dist/server/lib/action-suggestions.d.ts.map +1 -0
  143. package/dist/server/lib/action-suggestions.js +94 -0
  144. package/dist/server/lib/action-suggestions.js.map +1 -0
  145. package/dist/server/lib/app-action-result.d.ts +5 -0
  146. package/dist/server/lib/app-action-result.d.ts.map +1 -1
  147. package/dist/server/lib/app-action-result.js +7 -0
  148. package/dist/server/lib/app-action-result.js.map +1 -1
  149. package/dist/server/lib/app-creation-store.d.ts.map +1 -1
  150. package/dist/server/lib/app-creation-store.js +63 -13
  151. package/dist/server/lib/app-creation-store.js.map +1 -1
  152. package/dist/server/lib/curated-workspace-templates.d.ts.map +1 -1
  153. package/dist/server/lib/curated-workspace-templates.js +3 -0
  154. package/dist/server/lib/curated-workspace-templates.js.map +1 -1
  155. package/dist/server/lib/dispatch-config.d.ts +5 -0
  156. package/dist/server/lib/dispatch-config.d.ts.map +1 -0
  157. package/dist/server/lib/dispatch-config.js +11 -0
  158. package/dist/server/lib/dispatch-config.js.map +1 -0
  159. package/dist/server/lib/dispatch-pane-context.d.ts +11 -0
  160. package/dist/server/lib/dispatch-pane-context.d.ts.map +1 -0
  161. package/dist/server/lib/dispatch-pane-context.js +35 -0
  162. package/dist/server/lib/dispatch-pane-context.js.map +1 -0
  163. package/dist/server/lib/google-broker-provider.d.ts +41 -0
  164. package/dist/server/lib/google-broker-provider.d.ts.map +1 -0
  165. package/dist/server/lib/google-broker-provider.js +96 -0
  166. package/dist/server/lib/google-broker-provider.js.map +1 -0
  167. package/dist/server/lib/google-broker-rpc.d.ts +26 -0
  168. package/dist/server/lib/google-broker-rpc.d.ts.map +1 -0
  169. package/dist/server/lib/google-broker-rpc.js +52 -0
  170. package/dist/server/lib/google-broker-rpc.js.map +1 -0
  171. package/dist/server/lib/hosted-apps-settings.d.ts.map +1 -1
  172. package/dist/server/lib/hosted-apps-settings.js +4 -0
  173. package/dist/server/lib/hosted-apps-settings.js.map +1 -1
  174. package/dist/server/lib/mcp-app-discovery.d.ts +17 -0
  175. package/dist/server/lib/mcp-app-discovery.d.ts.map +1 -0
  176. package/dist/server/lib/mcp-app-discovery.js +231 -0
  177. package/dist/server/lib/mcp-app-discovery.js.map +1 -0
  178. package/dist/server/lib/mcp-gateway.d.ts +64 -21
  179. package/dist/server/lib/mcp-gateway.d.ts.map +1 -1
  180. package/dist/server/lib/mcp-gateway.js +730 -88
  181. package/dist/server/lib/mcp-gateway.js.map +1 -1
  182. package/dist/server/plugins/agent-chat.js +9 -7
  183. package/dist/server/plugins/agent-chat.js.map +1 -1
  184. package/dist/server/plugins/auth.d.ts.map +1 -1
  185. package/dist/server/plugins/auth.js +1 -0
  186. package/dist/server/plugins/auth.js.map +1 -1
  187. package/dist/server/plugins/db.d.ts.map +1 -1
  188. package/dist/server/plugins/db.js +0 -46
  189. package/dist/server/plugins/db.js.map +1 -1
  190. package/dist/server/plugins/integrations.d.ts.map +1 -1
  191. package/dist/server/plugins/integrations.js +4 -1
  192. package/dist/server/plugins/integrations.js.map +1 -1
  193. package/dist/shared/chat-first-pane.d.ts +24 -0
  194. package/dist/shared/chat-first-pane.d.ts.map +1 -1
  195. package/dist/shared/chat-first-pane.js +34 -0
  196. package/dist/shared/chat-first-pane.js.map +1 -1
  197. package/dist/shared/labs.d.ts +1 -0
  198. package/dist/shared/labs.d.ts.map +1 -1
  199. package/dist/shared/labs.js +7 -0
  200. package/dist/shared/labs.js.map +1 -1
  201. package/package.json +7 -6
  202. package/src/actions/action-suggestions.spec.ts +342 -0
  203. package/src/actions/app_actions.spec.ts +103 -0
  204. package/src/actions/ask_app.ts +9 -2
  205. package/src/actions/ask_app_status.ts +12 -1
  206. package/src/actions/call_app_action.ts +28 -8
  207. package/src/actions/create_embed_session.ts +8 -2
  208. package/src/actions/create_workspace_app_embed_session.ts +6 -1
  209. package/src/actions/execute-action-suggestion.ts +177 -0
  210. package/src/actions/index.spec.ts +6 -3
  211. package/src/actions/index.ts +5 -1
  212. package/src/actions/list-connected-agents.spec.ts +26 -1
  213. package/src/actions/list-connected-agents.ts +7 -4
  214. package/src/actions/list_app_actions.ts +1 -1
  215. package/src/actions/list_apps.spec.ts +58 -22
  216. package/src/actions/list_apps.ts +12 -5
  217. package/src/actions/navigate.ts +1 -0
  218. package/src/actions/open_app.spec.ts +17 -1
  219. package/src/actions/open_app.ts +21 -8
  220. package/src/actions/propose-action-suggestions.ts +42 -0
  221. package/src/actions/read_view.ts +1 -1
  222. package/src/actions/remember-pointer.ts +1 -1
  223. package/src/actions/resolve-pointer.ts +1 -1
  224. package/src/actions/route-app-intent.spec.ts +234 -5
  225. package/src/actions/route-app-intent.ts +89 -4
  226. package/src/actions/send-code-agent-remote-command.spec.ts +40 -0
  227. package/src/actions/send-code-agent-remote-command.ts +5 -0
  228. package/src/actions/start-workspace-app-creation.ts +1 -1
  229. package/src/actions/view-screen.bundle.spec.ts +15 -2
  230. package/src/actions/view-screen.spec.ts +81 -3
  231. package/src/actions/view-screen.ts +60 -4
  232. package/src/components/chat-action-suggestions.spec.tsx +362 -0
  233. package/src/components/chat-action-suggestions.tsx +432 -0
  234. package/src/components/chat-home-apps.spec.tsx +19 -0
  235. package/src/components/chat-home-apps.tsx +0 -1
  236. package/src/components/google-broker-settings-group.tsx +186 -0
  237. package/src/components/layout/Layout.spec.tsx +419 -28
  238. package/src/components/layout/Layout.tsx +304 -66
  239. package/src/components/messaging-setup-panel.spec.tsx +278 -4
  240. package/src/components/messaging-setup-panel.tsx +82 -19
  241. package/src/components/workspace-app-card.spec.tsx +79 -10
  242. package/src/components/workspace-app-chat-rail.spec.tsx +81 -3
  243. package/src/components/workspace-app-host.spec.tsx +269 -16
  244. package/src/components/workspace-app-host.tsx +464 -87
  245. package/src/config.ts +5 -0
  246. package/src/db/google-broker-admission.ts +160 -0
  247. package/src/db/migrations.spec.ts +165 -2
  248. package/src/db/migrations.ts +43 -1
  249. package/src/lib/action-suggestions.ts +267 -0
  250. package/src/lib/chat-first-app-route.spec.ts +15 -2
  251. package/src/lib/chat-first-app-route.ts +19 -7
  252. package/src/lib/chat-first-pane.spec.ts +71 -0
  253. package/src/lib/chat-first-pane.ts +101 -4
  254. package/src/lib/data-intent.spec.ts +21 -0
  255. package/src/lib/data-intent.ts +13 -0
  256. package/src/lib/dispatch-app-identity.ts +40 -0
  257. package/src/lib/other-apps.spec.ts +110 -1
  258. package/src/lib/other-apps.ts +41 -0
  259. package/src/lib/workspace-app-frame-view.spec.ts +13 -0
  260. package/src/lib/workspace-app-frame-view.ts +98 -0
  261. package/src/lib/workspace-apps.spec.ts +101 -0
  262. package/src/lib/workspace-apps.test.ts +18 -0
  263. package/src/lib/workspace-apps.ts +102 -24
  264. package/src/routes/pages/chat.spec.tsx +92 -1
  265. package/src/routes/pages/chat.tsx +41 -2
  266. package/src/routes/pages/settings-page.tsx +22 -17
  267. package/src/routes/pages/settings.spec.tsx +4 -0
  268. package/src/server/index.ts +6 -6
  269. package/src/server/lib/action-suggestions.ts +122 -0
  270. package/src/server/lib/app-action-result.ts +8 -0
  271. package/src/server/lib/app-creation-store.spec.ts +251 -0
  272. package/src/server/lib/app-creation-store.ts +72 -12
  273. package/src/server/lib/community-apps.spec.ts +19 -1
  274. package/src/server/lib/curated-workspace-templates.spec.ts +12 -0
  275. package/src/server/lib/curated-workspace-templates.ts +2 -0
  276. package/src/server/lib/dispatch-config.ts +15 -0
  277. package/src/server/lib/dispatch-pane-context.spec.ts +54 -0
  278. package/src/server/lib/dispatch-pane-context.ts +54 -0
  279. package/src/server/lib/google-broker-provider.ts +121 -0
  280. package/src/server/lib/google-broker-rpc.spec.ts +95 -0
  281. package/src/server/lib/google-broker-rpc.ts +107 -0
  282. package/src/server/lib/hosted-apps-settings.ts +4 -0
  283. package/src/server/lib/mcp-app-discovery.ts +318 -0
  284. package/src/server/lib/mcp-gateway.spec.ts +2252 -524
  285. package/src/server/lib/mcp-gateway.ts +1044 -181
  286. package/src/server/plugins/agent-chat.direct-mcp.spec.ts +84 -5
  287. package/src/server/plugins/agent-chat.ts +9 -7
  288. package/src/server/plugins/auth.spec.ts +5 -1
  289. package/src/server/plugins/auth.ts +1 -0
  290. package/src/server/plugins/db.ts +0 -51
  291. package/src/server/plugins/integrations.ts +4 -1
  292. package/src/shared/chat-first-pane.spec.ts +36 -0
  293. package/src/shared/chat-first-pane.ts +55 -0
  294. package/src/shared/labs.ts +8 -0
  295. package/src/server/plugins/agent-chat.spec.ts +0 -206
  296. package/src/server/plugins/integrations.spec.ts +0 -60
package/CHANGELOG.md CHANGED
@@ -1,6 +1,165 @@
1
1
  # @agent-native/dispatch
2
2
 
3
- ## 0.43.0-nightly-20261120212328
3
+ ## 0.43.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Release all public npm packages with a patch version bump.
8
+ - Updated dependencies [b3da817]
9
+ - Updated dependencies
10
+ - @agent-native/toolkit@0.237.1
11
+ - @agent-native/agentkit@0.237.1
12
+
13
+ ## 0.43.6
14
+
15
+ ### Patch Changes
16
+
17
+ - cb47fca: Guide workspace app builders to scope user data and safely manage synthetic samples in the shared database.
18
+ - Release all public npm packages with a patch version bump.
19
+ - 28528c9: A Slack bot token that comes from the server's environment, on a deployment that isn't a trusted self-hosted one, now counts as shared. When Slack rejects a shared token, the Slack status no longer counts it as this workspace's: the channel isn't configured unless a managed Slack workspace is connected, `details.botTokenShared` is set, and the error says the server's token was rejected and how to connect instead. Dispatch's Messaging page then shows the ordinary unfinished setup ("Not configured", "Finish setup to connect") instead of "Token rejected" and advice to reinstall an app the workspace never installed, and the legacy token row shows the token as not set. The note points to Add to Slack, since a hosted deployment verifies inbound Slack messages with its owner's credentials. The panel also rereads the channel status after a managed Slack workspace is tested or disconnected, so it no longer shows "Connected" for a workspace it just disconnected. "Connected" now needs the channel both enabled and configured, so a channel enabled for the whole deployment without credentials that work here no longer shows "Connected" or "Messages are flowing".
20
+ - Updated dependencies [146f471]
21
+ - Updated dependencies [9cfb56a]
22
+ - Updated dependencies [c78129f]
23
+ - Updated dependencies [c770674]
24
+ - Updated dependencies [6ad3f7a]
25
+ - Updated dependencies [ea5b112]
26
+ - Updated dependencies [a026ff7]
27
+ - Updated dependencies
28
+ - Updated dependencies [b36a38c]
29
+ - Updated dependencies [0de29d0]
30
+ - Updated dependencies [45c40e2]
31
+ - Updated dependencies [4465d33]
32
+ - Updated dependencies [532732b]
33
+ - Updated dependencies [2214716]
34
+ - Updated dependencies [24227f2]
35
+ - @agent-native/toolkit@0.237.0
36
+ - @agent-native/agentkit@0.237.0
37
+
38
+ ## 0.43.5
39
+
40
+ ### Patch Changes
41
+
42
+ - c874ba0: Ensure Dispatch's "Open in new tab" always opens the standalone app URL (never Dispatch's `/apps/<id>` iframe host), add "Open in new tab" to the sidebar app context menu, and auto-detect iframes and embedded desktop/chat browsers (Electron, T3 Code, ChatGPT/Codex, Claude Desktop, Cursor, Windsurf, Tauri) so opening an app navigates directly to the standalone app at its root URL instead of loading inside Dispatch's iframe.
43
+ - Release all public npm packages with a patch version bump.
44
+ - d92bb25: Slack's channel status now asks Slack whether the saved bot token still works. It asks at most once every five minutes per token, or 30 seconds after a check that couldn't reach Slack. When Slack refuses the token (`invalid_auth`, `token_revoked`, `token_expired` or `account_inactive`), the status reports the token as rejected with Slack's reason. Dispatch's Messaging page then shows "Token rejected" with what to do, instead of "Connected" and "Messages are flowing". When a managed Slack workspace is connected, its status stands and only the legacy token row shows "Rejected".
45
+ - 6599a26: Let Dispatch issue and securely deliver revocable app grants for Google services behind the Cross-app Google access Lab.
46
+ - Updated dependencies [1094e57]
47
+ - Updated dependencies [4916392]
48
+ - Updated dependencies [6c84762]
49
+ - Updated dependencies [d1b2511]
50
+ - Updated dependencies [086321b]
51
+ - Updated dependencies [c874ba0]
52
+ - Updated dependencies [f8ad67d]
53
+ - Updated dependencies [3812bcb]
54
+ - Updated dependencies [a1af52d]
55
+ - Updated dependencies [21d839a]
56
+ - Updated dependencies
57
+ - Updated dependencies [040332c]
58
+ - Updated dependencies [d6190e4]
59
+ - Updated dependencies [0d32852]
60
+ - Updated dependencies [004a270]
61
+ - Updated dependencies [b1e9f0e]
62
+ - @agent-native/toolkit@0.236.0
63
+ - @agent-native/agentkit@0.236.0
64
+
65
+ ## 0.43.4
66
+
67
+ ### Patch Changes
68
+
69
+ - Release all public npm packages with a patch version bump.
70
+ - d70dc40: Switch workspace and `agent-native typecheck` CLI typechecking to native `tsgo` when available, falling back to `tsc`.
71
+ - 52757ad: Upgrade Vitest and `@vitest/*` packages to `5.1.2` and align workspace packages onto the pnpm catalog.
72
+ - Updated dependencies [409e04a]
73
+ - Updated dependencies
74
+ - Updated dependencies [d70dc40]
75
+ - Updated dependencies [1f5e3fe]
76
+ - Updated dependencies [52757ad]
77
+ - @agent-native/toolkit@0.235.1
78
+ - @agent-native/agentkit@0.235.1
79
+
80
+ ## 0.43.3
81
+
82
+ ### Patch Changes
83
+
84
+ - Release all public npm packages with a patch version bump.
85
+ - Updated dependencies [8959acb]
86
+ - Updated dependencies [3cf91b8]
87
+ - Updated dependencies [6409765]
88
+ - Updated dependencies [3b2114d]
89
+ - Updated dependencies
90
+ - Updated dependencies [415f03e]
91
+ - Updated dependencies [a37f935]
92
+ - Updated dependencies [4827e48]
93
+ - Updated dependencies [4827e48]
94
+ - Updated dependencies [4827e48]
95
+ - Updated dependencies [0a08ec4]
96
+ - Updated dependencies [3e81b56]
97
+ - @agent-native/toolkit@0.235.0
98
+ - @agent-native/agentkit@0.235.0
99
+
100
+ ## 0.43.2
101
+
102
+ ### Patch Changes
103
+
104
+ - 4a34f01: The `an` skill now describes when a live app view helps, carries the user's selection into follow-ups, updates the same view after a change and reads back what was saved. Dispatch's MCP server serves the skill through the MCP Skills extension, so hosts that support Skills over MCP get it with the connector.
105
+ - f3976d7: Starting an app branch for an email Builder does not recognize now retries with the connected account's user id whatever status Builder answers with. When there is no account to fall back to, the failure says the email is not a member of the connected Builder space instead of calling it temporary.
106
+ - feadc42: An app pane in ChatGPT now tells the host it is ready as soon as ChatGPT's bridge is read, instead of after a five second wait for the host handshake, so the pane stays open. The open-app tool description now asks the model to open the pane for show, open, draft, chart, calendar, and dashboard requests.
107
+ - 969463c: Hosted apps on the Dispatch chat home open in place and no longer show an external-link arrow on the Open button.
108
+ - Release all public npm packages with a patch version bump.
109
+ - 7f630e8: Rewrite Dispatch and core cross-app MCP tool descriptions as neutral, factual capability descriptions so hosts like ChatGPT do not flag prescriptive cross-tool instructions as suspicious.
110
+ - ccf8c31: Restore the last app pane after a reload when its saved state is valid. The pane read no longer gets dropped when the first mount is discarded, and a saved pane that is malformed is reported as unreadable instead of being treated as never saved.
111
+ - 11f193e: Route requests about GitHub issues and pull requests to Tasks even when they mention messages, while email and inbox requests still go to Mail.
112
+ - 343d243: Fix email change in multi-app workspaces: Dispatch's identity policies now ship in core, so any app sharing the database can rekey. Workspace apps no longer answer 503 `org-domain-missing` for an org without an allowed domain; the registry token names the org by id instead. Add `setupDispatch({ hostedCatalog: false })` to hide Builder-hosted apps from Dispatch lists.
113
+ - aecb9db: Show suggested actions as a labeled summary, and open the existing target instead of failing when it already exists.
114
+ - Updated dependencies [0f7bf06]
115
+ - Updated dependencies [e466d90]
116
+ - Updated dependencies
117
+ - Updated dependencies [459726e]
118
+ - Updated dependencies [0315ffa]
119
+ - Updated dependencies [124141d]
120
+ - Updated dependencies [4ad86d5]
121
+ - Updated dependencies [f037abc]
122
+ - Updated dependencies [971ad70]
123
+ - Updated dependencies [631ee7c]
124
+ - @agent-native/toolkit@0.234.0
125
+ - @agent-native/agentkit@0.234.0
126
+
127
+ ## 0.43.1
128
+
129
+ ### Patch Changes
130
+
131
+ - 969523d: Show readable suggested action details and open an existing workspace app when creation finds it.
132
+ - 88e0754: Take the sidebar toggle from the visible workspace app after another app was kept alive, so a retained app's hidden frame no longer shadows the one on screen.
133
+ - 7188162: Make an embedded app's chat rail on `/dispatch/apps/:appId` send the app frame's own browser tab id instead of Dispatch's, so asking the app chat to open something navigates the app frame instead of bouncing Dispatch to its overview.
134
+ - f3ff142: Fix workspace app chat session routing for cross-origin mounted apps.
135
+ - 98cd62f: Use a caller's scoped remote MCP OAuth connection for app actions and provide an authorization link when a target requires a connection.
136
+ - 6cd1113: Allow embedded workspace apps and browser pages to request fullscreen.
137
+ - df6374d: Route email and message requests to Mail before matching service pointers, while routing GitHub issues and pull requests to Tasks.
138
+ - Release all public npm packages with a patch version bump.
139
+ - b1197d4: Fix A2A browser tab and viewport mode propagation, add turn-scoped foreground viewport lock and early open_app pane commit, upgrade AppCapabilityManifest to v2 with route template validation, and add rendered screen verification receipts.
140
+ - Updated dependencies [6f4b56e]
141
+ - Updated dependencies [a57a58f]
142
+ - Updated dependencies [c71955a]
143
+ - Updated dependencies [a57a58f]
144
+ - Updated dependencies [a57a58f]
145
+ - Updated dependencies [7c866e8]
146
+ - Updated dependencies [6f84c01]
147
+ - Updated dependencies [a57a58f]
148
+ - Updated dependencies [a57a58f]
149
+ - Updated dependencies [c541b37]
150
+ - Updated dependencies
151
+ - Updated dependencies [a57a58f]
152
+ - Updated dependencies [c3bcccd]
153
+ - Updated dependencies [bb20dd7]
154
+ - Updated dependencies [2a7cf8c]
155
+ - Updated dependencies [4b68858]
156
+ - Updated dependencies [b755252]
157
+ - Updated dependencies [87dfdb6]
158
+ - Updated dependencies [a57a58f]
159
+ - @agent-native/toolkit@0.233.0
160
+ - @agent-native/agentkit@0.233.0
161
+
162
+ ## 0.43.0
4
163
 
5
164
  ### Minor Changes
6
165
 
@@ -11,147 +170,80 @@
11
170
  - 3a066b3: Open the app pane for a new chat's first message as soon as the send names its thread, instead of waiting for the chat URL to settle. The routed app now appears at route latency rather than after the chat route's loader returns.
12
171
  - 8ed972b: Skip restoring a previous session's saved app pane on a new chat so routed prompts do not flash an old app before opening the routed pane.
13
172
  - b578994: Chat-first Dispatch asks its app route which app a sent message is about while the agent's turn starts, and opens that app's pane as soon as the route answers instead of waiting for the agent to open it. It starts the app's embed session right away. If the agent then opens the same app, that pane moves to the agent's page; if it opens a different app, that app replaces it. Nothing opens for a chat-only, failed, unconfigured or late answer. Nothing opens either when the answer arrives after a newer message, after a send was rejected, after the agent or the person changed the pane, or after the person left that chat. `@agent-native/core/client/agent-chat` exports `reportAgentChatComposerSubmit`, `withdrawAgentChatComposerSubmit`, `subscribeAgentChatComposerSubmit` and `agentChatPreviousTurnText`; the toolkit chat reports each visible send through them.
173
+ - 205f078: Open apps connected from another workspace beside the chat, the same way first-party hosted apps open.
174
+ - 6454dfb: Keep requests about the current app's data in context when choosing a workspace app, including when a saved pointer matches another app.
175
+ - 563035a: A Dispatch app action that the app refuses before running (invalid parameters, an action the app doesn't have, a call that was never sent) now reports that nothing was changed, instead of "write outcome may be unknown". One mistyped call no longer stops the rest of the turn's app actions, reads included, in every app.
14
176
  - 1faef32: Dispatch now shows the app beside the chat when the agent works in it. An app opened beside a chat is visible instead of sitting in a hidden panel, the panel keeps its width when the width utility is missing, an open requested before a new chat has an id is kept until it has one, and delegating to an app's agent opens that app. The agent is told to open the screen for show and open requests and to send follow-ups on an open app to that app's own agent.
15
177
  - 7279520: Expose enabled direct app action tools in the Dispatch MCP connector catalog.
16
178
  - 032c910: A saved Dream memory proposal is now marked applied and audited even when copying it to the shared memory directory falls behind; the delay is reported afterwards.
179
+ - 505f39c: Include verified first-party MCP claims when minting document embed sessions for canonical and SSO-registered workspace targets.
17
180
  - baf0f51: `open_app` takes an `intent` in the user's words and picks the app itself when `app` is not given. An explicit `app` still wins, and a request that routes to no app returns a clear error instead of opening anything.
181
+ - 4163448: Require confident chat-first routing and disambiguate workspace apps by installation identity.
18
182
  - b2299d0: Dispatch now prefers the workspace app that owns a domain over a connected third-party tool for the same domain, sends requests to create or draft something to the owning app's agent so the item opens beside the chat as an unsaved draft, and opens its own screens with navigate before summarizing them.
19
183
  - b2299d0: An app opened beside a Dispatch chat now fills the side panel. The app's own chat rail is only added when the app takes the main area; beside the chat it took the whole panel and left the app frame 0 pixels wide.
20
184
  - bac2e7e: Allow new Slack channel scopes to retry after temporary sender or conversation lookup failures without changing existing scope policies.
21
- - Updated dependencies [dd11f68]
22
- - Updated dependencies [43c82f1]
23
- - Updated dependencies [0f4643c]
24
- - Updated dependencies [7d73a2e]
25
- - Updated dependencies [2d3661c]
26
- - Updated dependencies [3a185b9]
27
- - Updated dependencies [4502521]
28
- - Updated dependencies [abf512f]
185
+ - f7bcd0f: Prevent a late thread snapshot save or stale thread URL sync from navigating back to `/chat/<threadId>` after the user or agent has already navigated away from `/chat` (for example to `/apps`).
186
+ - Release all public npm packages with a patch version bump.
187
+ - 862e5bf: Starting or continuing a coding run on a paired computer asks for approval each time.
188
+ - 1a0a9db: Every action core shares with all apps now decides its MCP exposure. Review comments, suggestions, version history, sharing reads, Creative Context, user groups, `upload-image`, `manage-automations`, `navigate` (in Dispatch too) and `view-screen` are served to outside agents with `mcpTool: "search"`: `tool-search` finds them and `call-tool` runs them, but they stay out of `tools/list`. Credential, account-connection, workspace-settings, staged-dataset, personal-preference and admin-review actions are `mcpTool: false`, and so is Dispatch's `view-screen`, which summarizes its run-debugging, vault and audit screens. It and the `view-screen`s of Calendar, Clips, Content and Forms now declare `readOnly: true`. Deleting someone else's review comment, deciding a suggestion or proposal, restoring a version, unsharing, Creative Context imports, purges, memberships and governance, archiving a context pack, and user-group writes now ask outside agents (MCP, HTTP, CLI, A2A and automation calls) for approval through `isOutsideAgentCall`, which `@agent-native/core/action` now re-exports. The app's UI and its own agent don't ask, though the agent calls those actions directly rather than from sandbox code or parallel batches. An action marked `"search"` stays listed where an app's `mcp.connectorCatalog` or `mcpApp.compactCatalog` already lists it.
189
+ - d799e8b: Add shared preview and interaction checks for generated workspace apps and extensions, and improve workspace app creation guidance.
190
+ - Updated dependencies [bfea22b]
29
191
  - Updated dependencies [bf07e40]
30
- - Updated dependencies [abf512f]
31
- - Updated dependencies [85b37f1]
32
- - Updated dependencies [43c82f1]
33
- - Updated dependencies [ac21d0b]
34
- - Updated dependencies [2d3661c]
35
- - Updated dependencies [43c82f1]
36
- - Updated dependencies [75c90a5]
37
- - Updated dependencies [ac21d0b]
192
+ - Updated dependencies [062955d]
193
+ - Updated dependencies [05d86d4]
38
194
  - Updated dependencies [ac21d0b]
39
195
  - Updated dependencies [5be6e23]
40
- - Updated dependencies [1314760]
41
196
  - Updated dependencies [830feff]
42
- - Updated dependencies [962e79d]
43
- - Updated dependencies [4f80390]
44
- - Updated dependencies [a6affb8]
45
- - Updated dependencies [43c82f1]
46
197
  - Updated dependencies [b578994]
47
198
  - Updated dependencies [ac21d0b]
48
- - Updated dependencies [75c90a5]
49
199
  - Updated dependencies [6facea0]
50
- - Updated dependencies [ac21d0b]
51
200
  - Updated dependencies [234a3ba]
52
201
  - Updated dependencies [ac21d0b]
53
202
  - Updated dependencies [fbab2ca]
54
- - Updated dependencies [ccb0316]
55
203
  - Updated dependencies [ac21d0b]
56
- - Updated dependencies [ba8ddd5]
57
- - Updated dependencies [43c82f1]
58
- - Updated dependencies [41c2b0e]
59
204
  - Updated dependencies [7e639f5]
60
- - Updated dependencies [cf35296]
61
- - Updated dependencies [8629141]
62
- - Updated dependencies [f67e71b]
205
+ - Updated dependencies [6d231e9]
206
+ - Updated dependencies [d4e0116]
207
+ - Updated dependencies [226913b]
208
+ - Updated dependencies [4163448]
63
209
  - Updated dependencies [1faef32]
64
- - Updated dependencies [a6d83c7]
65
- - Updated dependencies [43c82f1]
66
- - Updated dependencies [93ee658]
67
- - Updated dependencies [20cd8b7]
68
- - Updated dependencies [43c82f1]
210
+ - Updated dependencies [f7bcd0f]
69
211
  - Updated dependencies [0eeea8c]
70
- - Updated dependencies [a6c569c]
71
212
  - Updated dependencies [e0eaf3f]
72
- - Updated dependencies [43c82f1]
73
- - Updated dependencies [43c82f1]
74
- - Updated dependencies [0a90ec1]
75
- - Updated dependencies [67b4202]
76
- - Updated dependencies [43c82f1]
77
213
  - Updated dependencies [75c90a5]
78
214
  - Updated dependencies [c8d851d]
79
215
  - Updated dependencies [ac21d0b]
80
- - Updated dependencies [43c82f1]
81
- - Updated dependencies [43c82f1]
82
- - Updated dependencies [75c90a5]
83
- - Updated dependencies [43c82f1]
84
216
  - Updated dependencies [ac21d0b]
85
- - Updated dependencies [3c8b439]
86
- - Updated dependencies [3c8b439]
87
- - Updated dependencies [f63105f]
88
- - Updated dependencies [f2b5851]
89
- - Updated dependencies [efcefaa]
90
- - Updated dependencies [eff1145]
217
+ - Updated dependencies
218
+ - Updated dependencies [554a6aa]
219
+ - Updated dependencies [798b8b1]
91
220
  - Updated dependencies [75c90a5]
92
- - Updated dependencies [02a4f47]
93
- - Updated dependencies [26622ed]
94
- - Updated dependencies [bbb1fc4]
95
- - Updated dependencies [adb8282]
221
+ - Updated dependencies [ca69494]
96
222
  - Updated dependencies [2308970]
97
- - Updated dependencies [75c90a5]
98
- - Updated dependencies [91c224a]
99
- - Updated dependencies [43c82f1]
100
- - Updated dependencies [abf512f]
101
- - Updated dependencies [43c82f1]
102
- - Updated dependencies [d09e703]
103
- - Updated dependencies [658a9f5]
104
- - Updated dependencies [ac21d0b]
105
- - Updated dependencies [05e6e34]
106
- - Updated dependencies [d855c8a]
107
- - Updated dependencies [2e43eec]
108
- - Updated dependencies [8d3ea4f]
109
- - Updated dependencies [4537c00]
223
+ - Updated dependencies [56ca9e7]
110
224
  - Updated dependencies [8815d89]
111
- - Updated dependencies [a46cbdd]
112
- - Updated dependencies [4afd461]
113
225
  - Updated dependencies [786235c]
114
226
  - Updated dependencies [caec4be]
115
227
  - Updated dependencies [b879e94]
116
- - Updated dependencies [ac21d0b]
117
- - Updated dependencies [72e02ef]
118
- - Updated dependencies [abf512f]
119
- - Updated dependencies [abf512f]
120
- - Updated dependencies [4701235]
121
- - Updated dependencies [ac21d0b]
122
- - Updated dependencies [1995091]
123
- - Updated dependencies [0acd938]
124
- - Updated dependencies [708b59e]
125
- - Updated dependencies [3c2c2f1]
126
- - Updated dependencies [ac21d0b]
127
- - Updated dependencies [675a614]
128
- - Updated dependencies [032c910]
129
- - Updated dependencies [cb3d88c]
130
- - Updated dependencies [abf512f]
131
- - Updated dependencies [abf512f]
132
- - Updated dependencies [abf512f]
133
- - Updated dependencies [68cd6e5]
228
+ - Updated dependencies [626773e]
229
+ - Updated dependencies [e675278]
134
230
  - Updated dependencies [bc7c1b3]
135
- - Updated dependencies [e037d08]
231
+ - Updated dependencies [4b67d85]
232
+ - Updated dependencies [862e5bf]
136
233
  - Updated dependencies [6938e7c]
137
234
  - Updated dependencies [eb5c241]
138
235
  - Updated dependencies [66de1ad]
139
236
  - Updated dependencies [99491ba]
140
- - Updated dependencies [abf512f]
237
+ - Updated dependencies [e01adee]
141
238
  - Updated dependencies [ac21d0b]
142
- - Updated dependencies [43c82f1]
143
- - Updated dependencies [43c82f1]
144
239
  - Updated dependencies [88dad0f]
145
- - Updated dependencies [ac21d0b]
146
- - Updated dependencies [25164d9]
147
- - Updated dependencies [bbc14e5]
148
- - Updated dependencies [4ddc78e]
240
+ - Updated dependencies [3ed4a65]
241
+ - Updated dependencies [5f3dacf]
149
242
  - Updated dependencies [d7de14c]
150
- - Updated dependencies [dc0b85b]
151
- - Updated dependencies [55925c6]
152
- - Updated dependencies [0cc6bb3]
153
- - @agent-native/core@0.232.0-nightly-20261120212328
154
- - @agent-native/toolkit@0.232.0-nightly-20261120212328
243
+ - Updated dependencies [a911ca6]
244
+ - Updated dependencies [bb6eb2c]
245
+ - @agent-native/toolkit@0.232.0
246
+ - @agent-native/agentkit@0.232.0
155
247
 
156
248
  ## 0.42.10
157
249
 
@@ -1701,76 +1793,4 @@
1701
1793
  - Updated dependencies
1702
1794
  - @agent-native/toolkit@0.17.1
1703
1795
 
1704
- ## 0.31.22
1705
-
1706
- ### Patch Changes
1707
-
1708
- - Release all public npm packages with a patch version bump.
1709
- - Updated dependencies
1710
- - Updated dependencies [cf473dc]
1711
- - @agent-native/toolkit@0.17.0
1712
-
1713
- ## 0.31.21
1714
-
1715
- ### Patch Changes
1716
-
1717
- - Release all public npm packages with a patch version bump.
1718
- - Updated dependencies
1719
- - @agent-native/toolkit@0.16.16
1720
-
1721
- ## 0.31.20
1722
-
1723
- ### Patch Changes
1724
-
1725
- - Release all public npm packages with a patch version bump.
1726
- - Updated dependencies
1727
- - @agent-native/toolkit@0.16.15
1728
-
1729
- ## 0.31.19
1730
-
1731
- ### Patch Changes
1732
-
1733
- - Release all public npm packages with a patch version bump.
1734
- - Updated dependencies
1735
- - @agent-native/toolkit@0.16.14
1736
-
1737
- ## 0.31.18
1738
-
1739
- ### Patch Changes
1740
-
1741
- - Release all public npm packages with a patch version bump.
1742
- - eff9004: Include available and connected apps in Dispatch app search results.
1743
- - Updated dependencies
1744
- - @agent-native/toolkit@0.16.13
1745
-
1746
- ## 0.31.17
1747
-
1748
- ### Patch Changes
1749
-
1750
- - Release all public npm packages with a patch version bump.
1751
- - Updated dependencies
1752
- - @agent-native/toolkit@0.16.12
1753
-
1754
- ## 0.31.16
1755
-
1756
- ### Patch Changes
1757
-
1758
- - 36c79f9: Use the authenticated workspace app registry for hosted Dispatch app lists so inaccessible apps do not get an Open app action.
1759
-
1760
- ## 0.31.15
1761
-
1762
- ### Patch Changes
1763
-
1764
- - c595519: Automations page now writes the selected automation into a `?automationId=` URL param instead of untracked local state, so a selected row can be linked, reloaded, and reached with browser Back on both `/automations` and `/admin/automations`.
1765
- - c595519: Fix a workspace app opened from Dispatch chat-first mode on a narrow viewport mounting its own full-screen agent chat rail on top of the already full-screen side surface panel.
1766
- - c595519: Fix the chat-first side surface panel's close toggle being stacked beneath the panel it controls on viewports at or below 767px, which made the panel undismissable.
1767
- - d74aff9: Keep Dispatch's Feedback, Search, and Collapse controls flush with the bottom of the left sidebar.
1768
- - af1b3bb: Derive the chat model selection localStorage key through one exported helper, `chatModelSelectionStorageKey`. `useChatModels` takes the raw key while `MultiTabAssistantChat` takes only the namespace suffix, so a hero composer that passed the same string to both wrote to a different key than the chat beside it and never saw its model picks.
1769
- - Updated dependencies [6c2e431]
1770
- - Updated dependencies [af1b3bb]
1771
- - Updated dependencies [c595519]
1772
- - Updated dependencies [9735e4d]
1773
- - Updated dependencies [15b86eb]
1774
- - @agent-native/toolkit@0.16.11
1775
-
1776
1796
  For the full list of releases, see the [changelog archive](./changelog/archive/CHANGELOG.md).
@@ -1,12 +1,14 @@
1
1
  declare const _default: import("@agent-native/core/action").ActionDefinition<{
2
2
  app: string;
3
3
  message: string;
4
+ viewportMode?: "background" | "foreground" | undefined;
4
5
  async?: boolean | undefined;
5
6
  maxWaitMs?: number | undefined;
6
7
  }, {
7
8
  app: string;
8
9
  routedVia: "a2a";
9
10
  taskId: string;
11
+ taskHandle?: string;
10
12
  status: string;
11
13
  response?: string;
12
14
  receipts?: import("node_modules/@agent-native/core/dist/a2a/artifact-response.js").A2APersistedMutationReceipt[];
@@ -22,6 +24,7 @@ declare const _default: import("@agent-native/core/action").ActionDefinition<{
22
24
  arguments: {
23
25
  app: string;
24
26
  taskId: string;
27
+ taskHandle?: string;
25
28
  };
26
29
  };
27
30
  message?: string;
@@ -4,10 +4,14 @@ import { track } from "@agent-native/core/tracking";
4
4
  import { z } from "zod";
5
5
  import { askGrantedDispatchMcpApp } from "../server/lib/mcp-gateway.js";
6
6
  export default defineAction({
7
- description: "Route a natural-language request to any app granted through this existing Dispatch MCP connection; do not require a separate app MCP connection. Call list_apps first to see which apps are granted.",
7
+ description: "Send a natural-language request to an app accessible through this Dispatch connection. Accepts a granted `app` id (such as those returned by `list_apps`) and routes the message to that app's agent.",
8
8
  schema: z.object({
9
9
  app: z.string().describe("Granted app id, e.g. mail or calendar."),
10
10
  message: z.string().describe("The request to send to that app's agent."),
11
+ viewportMode: z
12
+ .enum(["foreground", "background"])
13
+ .optional()
14
+ .describe('Viewport targeting mode; "background" keeps the current foreground pane unchanged.'),
11
15
  async: z
12
16
  .boolean()
13
17
  .optional()
@@ -19,10 +23,11 @@ export default defineAction({
19
23
  .optional()
20
24
  .describe("Maximum inline wait in milliseconds."),
21
25
  }),
22
- run: async ({ app, message, async, maxWaitMs }, ctx) => {
26
+ run: async ({ app, message, viewportMode, async, maxWaitMs }, ctx) => {
23
27
  const result = await askGrantedDispatchMcpApp(app, message, {
24
28
  async,
25
29
  maxWaitMs,
30
+ ...(viewportMode ? { viewportMode } : {}),
26
31
  });
27
32
  track("a2a_delegated", {
28
33
  app_name: "dispatch",
@@ -1 +1 @@
1
- {"version":3,"file":"ask_app.js","sourceRoot":"","sources":["../../src/actions/ask_app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,sMAAsM;IACxM,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;QAClE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;QACxE,KAAK,EAAE,CAAC;aACL,OAAO,EAAE;aACT,QAAQ,EAAE;aACV,QAAQ,CAAC,4DAA4D,CAAC;QACzE,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CAAC,sCAAsC,CAAC;KACpD,CAAC;IACF,GAAG,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE;QACrD,MAAM,MAAM,GAAG,MAAM,wBAAwB,CAAC,GAAG,EAAE,OAAO,EAAE;YAC1D,KAAK;YACL,SAAS;SACV,CAAC,CAAC;QACH,KAAK,CACH,eAAe,EACf;YACE,QAAQ,EAAE,UAAU;YACpB,aAAa,EAAE,UAAU;YACzB,UAAU,EAAE,0BAA0B,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE;YACvE,QAAQ,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ;SAC9C,EACD,GAAG,CACJ,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core/action\";\nimport { normalizeTrackingDimension } from \"@agent-native/core/shared\";\nimport { track } from \"@agent-native/core/tracking\";\nimport { z } from \"zod\";\n\nimport { askGrantedDispatchMcpApp } from \"../server/lib/mcp-gateway.js\";\n\nexport default defineAction({\n description:\n \"Route a natural-language request to any app granted through this existing Dispatch MCP connection; do not require a separate app MCP connection. Call list_apps first to see which apps are granted.\",\n schema: z.object({\n app: z.string().describe(\"Granted app id, e.g. mail or calendar.\"),\n message: z.string().describe(\"The request to send to that app's agent.\"),\n async: z\n .boolean()\n .optional()\n .describe(\"Start a durable task and return immediately with a taskId.\"),\n maxWaitMs: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Maximum inline wait in milliseconds.\"),\n }),\n run: async ({ app, message, async, maxWaitMs }, ctx) => {\n const result = await askGrantedDispatchMcpApp(app, message, {\n async,\n maxWaitMs,\n });\n track(\n \"a2a_delegated\",\n {\n app_name: \"dispatch\",\n template_name: \"dispatch\",\n target_app: normalizeTrackingDimension(app) ?? app.trim().toLowerCase(),\n job_type: async === true ? \"async\" : \"inline\",\n },\n ctx,\n );\n return result;\n },\n});\n"]}
1
+ {"version":3,"file":"ask_app.js","sourceRoot":"","sources":["../../src/actions/ask_app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,uMAAuM;IACzM,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;QAClE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;QACxE,YAAY,EAAE,CAAC;aACZ,IAAI,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;aAClC,QAAQ,EAAE;aACV,QAAQ,CACP,oFAAoF,CACrF;QACH,KAAK,EAAE,CAAC;aACL,OAAO,EAAE;aACT,QAAQ,EAAE;aACV,QAAQ,CAAC,4DAA4D,CAAC;QACzE,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CAAC,sCAAsC,CAAC;KACpD,CAAC;IACF,GAAG,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE;QACnE,MAAM,MAAM,GAAG,MAAM,wBAAwB,CAAC,GAAG,EAAE,OAAO,EAAE;YAC1D,KAAK;YACL,SAAS;YACT,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1C,CAAC,CAAC;QACH,KAAK,CACH,eAAe,EACf;YACE,QAAQ,EAAE,UAAU;YACpB,aAAa,EAAE,UAAU;YACzB,UAAU,EAAE,0BAA0B,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE;YACvE,QAAQ,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ;SAC9C,EACD,GAAG,CACJ,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core/action\";\nimport { normalizeTrackingDimension } from \"@agent-native/core/shared\";\nimport { track } from \"@agent-native/core/tracking\";\nimport { z } from \"zod\";\n\nimport { askGrantedDispatchMcpApp } from \"../server/lib/mcp-gateway.js\";\n\nexport default defineAction({\n description:\n \"Send a natural-language request to an app accessible through this Dispatch connection. Accepts a granted `app` id (such as those returned by `list_apps`) and routes the message to that app's agent.\",\n schema: z.object({\n app: z.string().describe(\"Granted app id, e.g. mail or calendar.\"),\n message: z.string().describe(\"The request to send to that app's agent.\"),\n viewportMode: z\n .enum([\"foreground\", \"background\"])\n .optional()\n .describe(\n 'Viewport targeting mode; \"background\" keeps the current foreground pane unchanged.',\n ),\n async: z\n .boolean()\n .optional()\n .describe(\"Start a durable task and return immediately with a taskId.\"),\n maxWaitMs: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Maximum inline wait in milliseconds.\"),\n }),\n run: async ({ app, message, viewportMode, async, maxWaitMs }, ctx) => {\n const result = await askGrantedDispatchMcpApp(app, message, {\n async,\n maxWaitMs,\n ...(viewportMode ? { viewportMode } : {}),\n });\n track(\n \"a2a_delegated\",\n {\n app_name: \"dispatch\",\n template_name: \"dispatch\",\n target_app: normalizeTrackingDimension(app) ?? app.trim().toLowerCase(),\n job_type: async === true ? \"async\" : \"inline\",\n },\n ctx,\n );\n return result;\n },\n});\n"]}
@@ -1,10 +1,12 @@
1
1
  declare const _default: import("@agent-native/core/action").ActionDefinition<{
2
2
  app: string;
3
3
  taskId: string;
4
+ taskHandle?: string | undefined;
4
5
  }, {
5
6
  app: string;
6
7
  routedVia: "a2a";
7
8
  taskId: string;
9
+ taskHandle?: string;
8
10
  status: string;
9
11
  response?: string;
10
12
  receipts?: import("node_modules/@agent-native/core/dist/a2a/artifact-response.js").A2APersistedMutationReceipt[];
@@ -20,6 +22,7 @@ declare const _default: import("@agent-native/core/action").ActionDefinition<{
20
22
  arguments: {
21
23
  app: string;
22
24
  taskId: string;
25
+ taskHandle?: string;
23
26
  };
24
27
  };
25
28
  message?: string;
@@ -6,9 +6,13 @@ export default defineAction({
6
6
  schema: z.object({
7
7
  app: z.string().describe("Granted app id returned by ask_app."),
8
8
  taskId: z.string().describe("The durable task id returned by ask_app."),
9
+ taskHandle: z
10
+ .string()
11
+ .optional()
12
+ .describe("Opaque sealed task handle returned by ask_app. Preserves the original target route across polls."),
9
13
  }),
10
14
  readOnly: true,
11
15
  parallelSafe: true,
12
- run: async ({ app, taskId }) => getGrantedDispatchMcpAppTask(app, taskId),
16
+ run: async ({ app, taskId, taskHandle }) => getGrantedDispatchMcpAppTask(app, taskId, taskHandle !== undefined ? { taskHandle } : undefined),
13
17
  });
14
18
  //# sourceMappingURL=ask_app_status.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ask_app_status.js","sourceRoot":"","sources":["../../src/actions/ask_app_status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAE5E,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,uFAAuF;IACzF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;QAC/D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;KACxE,CAAC;IACF,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;IAClB,GAAG,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,4BAA4B,CAAC,GAAG,EAAE,MAAM,CAAC;CAC1E,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core/action\";\nimport { z } from \"zod\";\n\nimport { getGrantedDispatchMcpAppTask } from \"../server/lib/mcp-gateway.js\";\n\nexport default defineAction({\n description:\n \"Poll a durable Dispatch ask_app task and return its current status or final response.\",\n schema: z.object({\n app: z.string().describe(\"Granted app id returned by ask_app.\"),\n taskId: z.string().describe(\"The durable task id returned by ask_app.\"),\n }),\n readOnly: true,\n parallelSafe: true,\n run: async ({ app, taskId }) => getGrantedDispatchMcpAppTask(app, taskId),\n});\n"]}
1
+ {"version":3,"file":"ask_app_status.js","sourceRoot":"","sources":["../../src/actions/ask_app_status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAE5E,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,uFAAuF;IACzF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;QAC/D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;QACvE,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,kGAAkG,CACnG;KACJ,CAAC;IACF,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;IAClB,GAAG,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,CACzC,4BAA4B,CAC1B,GAAG,EACH,MAAM,EACN,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CACtD;CACJ,CAAC,CAAC","sourcesContent":["import { defineAction } from \"@agent-native/core/action\";\nimport { z } from \"zod\";\n\nimport { getGrantedDispatchMcpAppTask } from \"../server/lib/mcp-gateway.js\";\n\nexport default defineAction({\n description:\n \"Poll a durable Dispatch ask_app task and return its current status or final response.\",\n schema: z.object({\n app: z.string().describe(\"Granted app id returned by ask_app.\"),\n taskId: z.string().describe(\"The durable task id returned by ask_app.\"),\n taskHandle: z\n .string()\n .optional()\n .describe(\n \"Opaque sealed task handle returned by ask_app. Preserves the original target route across polls.\",\n ),\n }),\n readOnly: true,\n parallelSafe: true,\n run: async ({ app, taskId, taskHandle }) =>\n getGrantedDispatchMcpAppTask(\n app,\n taskId,\n taskHandle !== undefined ? { taskHandle } : undefined,\n ),\n});\n"]}
@@ -2,6 +2,7 @@ declare const _default: import("@agent-native/core/action").ActionDefinition<{
2
2
  app: string;
3
3
  action: string;
4
4
  args?: Record<string, unknown> | undefined;
5
+ viewportMode?: "background" | "foreground" | undefined;
5
6
  }, {
6
7
  isError?: boolean | undefined;
7
8
  approvalReview?: {
@@ -1,9 +1,9 @@
1
- import { defineAction, fail } from "@agent-native/core/action";
1
+ import { defineAction, fail, noteExternalWrite, NoWriteError, } from "@agent-native/core/action";
2
2
  import { z } from "zod";
3
- import { appActionErrorCode, appActionResultText, } from "../server/lib/app-action-result.js";
3
+ import { appActionErrorCode, appActionRefusedBeforeRun, appActionResultText, } from "../server/lib/app-action-result.js";
4
4
  import { callGrantedDispatchMcpAppAction } from "../server/lib/mcp-gateway.js";
5
5
  export default defineAction({
6
- description: "Run one action of a granted app as the signed-in user and return its result in about a second. Prefer this to ask_app whenever the step is a known action (list the inbox, read a thread, create a draft, list or move an event); ask_app runs the app's whole agent and takes 20 seconds or more. Call list_app_actions first for names and inputs. The app's screen updates from the same data, so call open_app once to show it beside the chat.",
6
+ description: "Run a single named action on a granted app as the signed-in user (such as listing an inbox, reading a thread, creating a draft, or listing or moving an event). Accepts an `app` id, an `action` name and input `args` (as described by `list_app_actions`), and returns the action result directly without running the app's agent.",
7
7
  schema: z.object({
8
8
  app: z.string().describe("Granted app id, e.g. mail or calendar."),
9
9
  action: z
@@ -13,6 +13,10 @@ export default defineAction({
13
13
  .record(z.string(), z.unknown())
14
14
  .optional()
15
15
  .describe("Action input matching its schema."),
16
+ viewportMode: z
17
+ .enum(["foreground", "background"])
18
+ .optional()
19
+ .describe('Viewport targeting mode; "background" keeps the current foreground pane unchanged.'),
16
20
  }),
17
21
  mcpOutputSchema: true,
18
22
  outputErrorStrategy: "strict",
@@ -25,8 +29,14 @@ export default defineAction({
25
29
  content: z.array(z.unknown()),
26
30
  }),
27
31
  mcpApp: { structuredContent: true },
28
- run: async ({ app, action, args }) => {
29
- const result = await callGrantedDispatchMcpAppAction(app, action, args ?? {});
32
+ run: async ({ app, action, args, viewportMode }) => {
33
+ noteExternalWrite("app-action");
34
+ const actionArgs = args ?? {};
35
+ const result = viewportMode
36
+ ? await callGrantedDispatchMcpAppAction(app, action, actionArgs, {
37
+ viewportMode,
38
+ })
39
+ : await callGrantedDispatchMcpAppAction(app, action, actionArgs);
30
40
  if (result.isError !== true)
31
41
  return result;
32
42
  const text = appActionResultText(result);
@@ -41,6 +51,12 @@ export default defineAction({
41
51
  const message = appCode
42
52
  ? text.replace(/(\s*\(errorCode: [a-z0-9_]+\))+\s*$/i, "")
43
53
  : text || "The app action failed.";
54
+ if (appActionRefusedBeforeRun(message)) {
55
+ throw new NoWriteError(`${message} Nothing was changed.`, {
56
+ errorCode: appCode ?? "app_action_invalid_parameters",
57
+ statusCode: 400,
58
+ });
59
+ }
44
60
  // A failed write can still have landed part of its change in the app.
45
61
  fail(`${message} Its write outcome may be unknown; inspect the app before retrying.`, { errorCode: appCode ?? "app_action_failed", statusCode: 502 });
46
62
  },
@@ -1 +1 @@
1
- {"version":3,"file":"call_app_action.js","sourceRoot":"","sources":["../../src/actions/call_app_action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAE/E,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,qbAAqb;IACvb,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;QAClE,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,QAAQ,CAAC,sDAAsD,CAAC;QACnE,IAAI,EAAE,CAAC;aACJ,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;aAC/B,QAAQ,EAAE;aACV,QAAQ,CAAC,mCAAmC,CAAC;KACjD,CAAC;IACF,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,QAAQ;IAC7B,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QAC/B,cAAc,EAAE,CAAC;aACd,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;aACxE,QAAQ,EAAE;QACb,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QACzC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;KAC9B,CAAC;IACF,MAAM,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE;IACnC,GAAG,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;QACnC,MAAM,MAAM,GAAG,MAAM,+BAA+B,CAClD,GAAG,EACH,MAAM,EACN,IAAI,IAAI,EAAE,CACX,CAAC;QACF,IAAI,MAAM,CAAC,OAAO,KAAK,IAAI;YAAE,OAAO,MAAM,CAAC;QAC3C,MAAM,IAAI,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;YAC1B,IAAI,CAAC,IAAI,EAAE;gBACT,SAAS,EAAE,mBAAmB;gBAC9B,UAAU,EAAE,GAAG;gBACf,OAAO,EAAE,EAAE,cAAc,EAAE,MAAM,CAAC,cAAc,EAAE;aACnD,CAAC,CAAC;QACL,CAAC;QACD,MAAM,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,OAAO,GAAG,OAAO;YACrB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,sCAAsC,EAAE,EAAE,CAAC;YAC1D,CAAC,CAAC,IAAI,IAAI,wBAAwB,CAAC;QACrC,sEAAsE;QACtE,IAAI,CACF,GAAG,OAAO,qEAAqE,EAC/E,EAAE,SAAS,EAAE,OAAO,IAAI,mBAAmB,EAAE,UAAU,EAAE,GAAG,EAAE,CAC/D,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { defineAction, fail } from \"@agent-native/core/action\";\nimport { z } from \"zod\";\n\nimport {\n appActionErrorCode,\n appActionResultText,\n} from \"../server/lib/app-action-result.js\";\nimport { callGrantedDispatchMcpAppAction } from \"../server/lib/mcp-gateway.js\";\n\nexport default defineAction({\n description:\n \"Run one action of a granted app as the signed-in user and return its result in about a second. Prefer this to ask_app whenever the step is a known action (list the inbox, read a thread, create a draft, list or move an event); ask_app runs the app's whole agent and takes 20 seconds or more. Call list_app_actions first for names and inputs. The app's screen updates from the same data, so call open_app once to show it beside the chat.\",\n schema: z.object({\n app: z.string().describe(\"Granted app id, e.g. mail or calendar.\"),\n action: z\n .string()\n .describe(\"Action name from list_app_actions, e.g. list-emails.\"),\n args: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\"Action input matching its schema.\"),\n }),\n mcpOutputSchema: true,\n outputErrorStrategy: \"strict\",\n outputSchema: z.object({\n isError: z.boolean().optional(),\n approvalReview: z\n .object({ url: z.string().optional(), expiresAt: z.number().optional() })\n .optional(),\n structuredContent: z.unknown().optional(),\n content: z.array(z.unknown()),\n }),\n mcpApp: { structuredContent: true },\n run: async ({ app, action, args }) => {\n const result = await callGrantedDispatchMcpAppAction(\n app,\n action,\n args ?? {},\n );\n if (result.isError !== true) return result;\n const text = appActionResultText(result);\n if (result.approvalReview) {\n fail(text, {\n errorCode: \"approval_required\",\n statusCode: 409,\n details: { approvalReview: result.approvalReview },\n });\n }\n const appCode = appActionErrorCode(text);\n const message = appCode\n ? text.replace(/(\\s*\\(errorCode: [a-z0-9_]+\\))+\\s*$/i, \"\")\n : text || \"The app action failed.\";\n // A failed write can still have landed part of its change in the app.\n fail(\n `${message} Its write outcome may be unknown; inspect the app before retrying.`,\n { errorCode: appCode ?? \"app_action_failed\", statusCode: 502 },\n );\n },\n});\n"]}
1
+ {"version":3,"file":"call_app_action.js","sourceRoot":"","sources":["../../src/actions/call_app_action.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,iBAAiB,EACjB,YAAY,GACb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAE/E,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,sUAAsU;IACxU,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;QAClE,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,QAAQ,CAAC,sDAAsD,CAAC;QACnE,IAAI,EAAE,CAAC;aACJ,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;aAC/B,QAAQ,EAAE;aACV,QAAQ,CAAC,mCAAmC,CAAC;QAChD,YAAY,EAAE,CAAC;aACZ,IAAI,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;aAClC,QAAQ,EAAE;aACV,QAAQ,CACP,oFAAoF,CACrF;KACJ,CAAC;IACF,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,QAAQ;IAC7B,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QAC/B,cAAc,EAAE,CAAC;aACd,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;aACxE,QAAQ,EAAE;QACb,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QACzC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;KAC9B,CAAC;IACF,MAAM,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE;IACnC,GAAG,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE;QACjD,iBAAiB,CAAC,YAAY,CAAC,CAAC;QAChC,MAAM,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,YAAY;YACzB,CAAC,CAAC,MAAM,+BAA+B,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE;gBAC7D,YAAY;aACb,CAAC;YACJ,CAAC,CAAC,MAAM,+BAA+B,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QACnE,IAAI,MAAM,CAAC,OAAO,KAAK,IAAI;YAAE,OAAO,MAAM,CAAC;QAC3C,MAAM,IAAI,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;YAC1B,IAAI,CAAC,IAAI,EAAE;gBACT,SAAS,EAAE,mBAAmB;gBAC9B,UAAU,EAAE,GAAG;gBACf,OAAO,EAAE,EAAE,cAAc,EAAE,MAAM,CAAC,cAAc,EAAE;aACnD,CAAC,CAAC;QACL,CAAC;QACD,MAAM,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,OAAO,GAAG,OAAO;YACrB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,sCAAsC,EAAE,EAAE,CAAC;YAC1D,CAAC,CAAC,IAAI,IAAI,wBAAwB,CAAC;QACrC,IAAI,yBAAyB,CAAC,OAAO,CAAC,EAAE,CAAC;YACvC,MAAM,IAAI,YAAY,CAAC,GAAG,OAAO,uBAAuB,EAAE;gBACxD,SAAS,EAAE,OAAO,IAAI,+BAA+B;gBACrD,UAAU,EAAE,GAAG;aAChB,CAAC,CAAC;QACL,CAAC;QACD,sEAAsE;QACtE,IAAI,CACF,GAAG,OAAO,qEAAqE,EAC/E,EAAE,SAAS,EAAE,OAAO,IAAI,mBAAmB,EAAE,UAAU,EAAE,GAAG,EAAE,CAC/D,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import {\n defineAction,\n fail,\n noteExternalWrite,\n NoWriteError,\n} from \"@agent-native/core/action\";\nimport { z } from \"zod\";\n\nimport {\n appActionErrorCode,\n appActionRefusedBeforeRun,\n appActionResultText,\n} from \"../server/lib/app-action-result.js\";\nimport { callGrantedDispatchMcpAppAction } from \"../server/lib/mcp-gateway.js\";\n\nexport default defineAction({\n description:\n \"Run a single named action on a granted app as the signed-in user (such as listing an inbox, reading a thread, creating a draft, or listing or moving an event). Accepts an `app` id, an `action` name and input `args` (as described by `list_app_actions`), and returns the action result directly without running the app's agent.\",\n schema: z.object({\n app: z.string().describe(\"Granted app id, e.g. mail or calendar.\"),\n action: z\n .string()\n .describe(\"Action name from list_app_actions, e.g. list-emails.\"),\n args: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\"Action input matching its schema.\"),\n viewportMode: z\n .enum([\"foreground\", \"background\"])\n .optional()\n .describe(\n 'Viewport targeting mode; \"background\" keeps the current foreground pane unchanged.',\n ),\n }),\n mcpOutputSchema: true,\n outputErrorStrategy: \"strict\",\n outputSchema: z.object({\n isError: z.boolean().optional(),\n approvalReview: z\n .object({ url: z.string().optional(), expiresAt: z.number().optional() })\n .optional(),\n structuredContent: z.unknown().optional(),\n content: z.array(z.unknown()),\n }),\n mcpApp: { structuredContent: true },\n run: async ({ app, action, args, viewportMode }) => {\n noteExternalWrite(\"app-action\");\n const actionArgs = args ?? {};\n const result = viewportMode\n ? await callGrantedDispatchMcpAppAction(app, action, actionArgs, {\n viewportMode,\n })\n : await callGrantedDispatchMcpAppAction(app, action, actionArgs);\n if (result.isError !== true) return result;\n const text = appActionResultText(result);\n if (result.approvalReview) {\n fail(text, {\n errorCode: \"approval_required\",\n statusCode: 409,\n details: { approvalReview: result.approvalReview },\n });\n }\n const appCode = appActionErrorCode(text);\n const message = appCode\n ? text.replace(/(\\s*\\(errorCode: [a-z0-9_]+\\))+\\s*$/i, \"\")\n : text || \"The app action failed.\";\n if (appActionRefusedBeforeRun(message)) {\n throw new NoWriteError(`${message} Nothing was changed.`, {\n errorCode: appCode ?? \"app_action_invalid_parameters\",\n statusCode: 400,\n });\n }\n // A failed write can still have landed part of its change in the app.\n fail(\n `${message} Its write outcome may be unknown; inspect the app before retrying.`,\n { errorCode: appCode ?? \"app_action_failed\", statusCode: 502 },\n );\n },\n});\n"]}