@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
@@ -9,6 +9,8 @@ const INITIAL_TOOL_NAMES = [
9
9
  "list-workspace-apps",
10
10
  "update-workspace-app-metadata",
11
11
  "list-connected-agents",
12
+ "list_app_actions",
13
+ "call_app_action",
12
14
  "ask_app",
13
15
  "open_app",
14
16
  "list-workspace-resources",
@@ -25,6 +27,7 @@ const INITIAL_TOOL_NAMES = [
25
27
  "upsert-destination",
26
28
  "list-dreams",
27
29
  "start-workspace-app-creation",
30
+ "propose-action-suggestions",
28
31
  "list-dispatch-usage-metrics",
29
32
  "list-available-workspace-templates",
30
33
  "provider-api-catalog",
@@ -42,6 +45,7 @@ export default createAgentChatPlugin({
42
45
  mcp: {
43
46
  appApprovalPage: true,
44
47
  readOnlyResources: true,
48
+ servesAnSkill: true,
45
49
  taskCandidates: async ({ callableActionNames, signal }) => {
46
50
  signal.throwIfAborted();
47
51
  if (!callableActionNames.includes("open_app"))
@@ -89,7 +93,7 @@ export default createAgentChatPlugin({
89
93
 
90
94
  Default posture:
91
95
  - Treat Slack and Telegram as shared entrypoints into the workspace.
92
- - Heavily delegate domain work to specialized agents through A2A when another app owns the job.
96
+ - Prefer direct call_app_action (checking list_app_actions first when action names or inputs are unknown) for single-app reads, lookups, navigation, and simple mutations so standard turns finish in one LLM hop. Reserve ask_app for multi-step specialist sub-workflows that genuinely need the target app's own agent reasoning. Pass viewportMode: "background" on secondary cross-app lookups so they cannot hijack the visible foreground pane.
93
97
  - Keep durable memory and operating instructions in resources rather than ephemeral chat.
94
98
  - Prefer replying in the current external thread unless the user explicitly asks you to send to a saved destination.
95
99
 
@@ -109,7 +113,7 @@ Use the standard workspace primitives:
109
113
  - You receive a compact available-apps block with sibling workspace app names and descriptions. Use it to pick the right A2A target, and call list-connected-agents or tool-search only when you need fresh details.
110
114
  - Saved pointers: when the user says that something is their Y ("my todo list is this doc", "X is my Y", or gives a link and a name for it), call remember-pointer with the alias, the app that owns it and the link or object id. When a request refers to something by a personal name, call resolve-pointer first; if it matches, open that app and object, and do not default to another app (a todo list pointed at a doc opens the doc, not Tasks). Use scope org only when the user asks to share it with the organization.
111
115
  - Show the work in the app: when the user asks to see, open, find, browse, or check something an app owns (mail, events, docs, decks, designs, tasks, clips, analytics, records), the result belongs on screen beside the chat, not only in text. Delegating to that app's agent opens the app beside the chat, and when the answer is a screen (a list, thread, event, doc, deck, record, or something just created or found) also call open_app with the app and, when you know it, the view or path. Then answer in a sentence or two instead of restating what the pane shows.
112
- - Follow-ups about a screen that is already open (narrow it, filter, switch tabs, open the next one, change this item) go to that app's own agent, which navigates the open pane in place. Do not answer from memory, and do not open the same app again.
116
+ - Requests about data in the app already on screen including follow-ups that narrow or filter the view, go to that app's own agent, which navigates the open pane in place. A service mentioned in a message or notification does not make that service's records the subject: use the app holding the messages. Delegate to or open another app when the user asks for that app's own data or screen. Do not answer from memory or open the same app again.
113
117
  - Prefer the workspace app that owns a domain over a connected third-party tool for the same domain (a Notion connector for docs or meeting notes, a calendar connector for events). Use the third-party tool only when the person names that service or no workspace app covers the job.
114
118
  - Requests to create or draft something (a doc, deck, design, post, issue, event, or reply) go to the owning app's agent so the item opens beside the chat as an unsaved draft. Do not answer them as chat text or ask which app to use when one fits.
115
119
  - For Dispatch's own screens (apps, agents, integrations, connections, settings), use navigate to open the page, then summarize what it shows.
@@ -126,21 +130,19 @@ Use the standard workspace primitives:
126
130
  - For broad provider searches, joins, classification, corpus counts, or absence claims, fetch every relevant page or an explicitly bounded cohort, stage/save large responses with stageAs/saveToFile/fetchAllPages, and reduce them with query-staged-dataset or run-code. Report source, filters, row counts, pagination, truncation, failed pages, and uncovered gaps.
127
131
  - Use list-dispatch-usage-metrics only for this workspace's own members' agent/LLM usage and spend, or aggregate adoption of an accessible workspace app. For agent/LLM usage or spend, call it with scope=workspace and the requested sinceDays; it reports workspace-member usage only. For app adoption, call it with scope=app and appId; app creators can see aggregate daily/weekly active users and tracked actions for their own app, while organization owners/admins can inspect any accessible app. App scope omits individual users and prompt previews. External customer, account, or company usage, credits, activity, or product data belongs to the relevant app: use its identity in <relevant-apps> when clear, or call describe-workspace-apps with a query when ownership is unclear. Do not use this action for external customer/account/company data.
128
132
 
133
+ After answering or showing the requested work in Dispatch chat, use propose-action-suggestions only when there is a grounded, useful persistent improvement for the user to consider. Pass the installed app's exact ID and a real action with its required inputs for a filter, saved view, or automation. Use customize-app for a specific missing control. If no installed app fits a durable new workflow, offer create-app with appId="dispatch" and a short specification, even if no app was opened or called this turn. Offer at most two suggestions per turn. Only propose the improvement; wait for the user's selection to execute it.
134
+
129
135
  When a user asks for something like a digest, reminder, routing rule, or saved behavior:
130
136
  - First decide whether it should be a resource, a recurring job, a destination, or a delegated task.
131
137
  - Keep responses concise and operational.
132
138
  - Avoid inventing integrations or destinations that are not configured yet.${builderManagedAppsNote()}`,
133
139
  });
134
- /**
135
- * A Builder-linked workspace builds its apps in Builder; app-creation actions
136
- * return a link there, and the agent should offer it rather than retry.
137
- */
138
140
  function builderManagedAppsNote() {
139
141
  const url = getBuilderWorkspaceUrl();
140
142
  if (!url)
141
143
  return "";
142
144
  return `
143
145
 
144
- This workspace is managed in Builder. Never create, scaffold, remix, or install workspace apps from here. When someone asks for a new app, point them to ${url} and tell them to use New app there.`;
146
+ This workspace is managed in Builder. App creation here hands off to the configured workspace. A create-app suggestion allows the user to open that workspace. For an explicit creation request, use the normal creation action and report the handoff it returns.`;
145
147
  }
146
148
  //# sourceMappingURL=agent-chat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-chat.js","sourceRoot":"","sources":["../../../src/server/plugins/agent-chat.ts"],"names":[],"mappings":"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","sourcesContent":["import { getOrgContext } from \"@agent-native/core/org\";\nimport {\n createAgentChatPlugin,\n getBuilderWorkspaceUrl,\n registerAgentContextAgentFilter,\n} from \"@agent-native/core/server\";\n\nimport { resolveDispatchActions } from \"../../actions/index.js\";\nimport { hideHostedAppsWhenOff } from \"../lib/hosted-apps-settings.js\";\nimport { listGrantedDispatchMcpApps } from \"../lib/mcp-gateway.js\";\nimport {\n workspaceAppActionRouteAuth,\n WORKSPACE_APP_CLAIM_ACTION_PATH,\n WORKSPACE_APPS_ACTION_PATH,\n} from \"../lib/workspace-app-action-auth.js\";\n\nconst INITIAL_TOOL_NAMES = [\n \"view-screen\",\n \"list-workspace-apps\",\n \"update-workspace-app-metadata\",\n \"list-connected-agents\",\n \"ask_app\",\n \"open_app\",\n \"list-workspace-resources\",\n \"create-workspace-resource\",\n \"update-workspace-resource\",\n \"import-agent\",\n \"import-agent-pack\",\n \"list-agent-pack\",\n \"connect-external-agent\",\n \"list-vault-secrets\",\n \"request-vault-secret\",\n \"create-vault-secret\",\n \"list-destinations\",\n \"upsert-destination\",\n \"list-dreams\",\n \"start-workspace-app-creation\",\n \"list-dispatch-usage-metrics\",\n \"list-available-workspace-templates\",\n \"provider-api-catalog\",\n \"provider-api-docs\",\n \"provider-api-request\",\n \"query-staged-dataset\",\n \"navigate\",\n];\n\nregisterAgentContextAgentFilter(\"dispatch\", hideHostedAppsWhenOff);\n\nexport default createAgentChatPlugin({\n appId: \"dispatch\",\n connectApps: true,\n durableBackgroundRuns: true,\n initialToolNames: INITIAL_TOOL_NAMES,\n mcp: {\n appApprovalPage: true,\n readOnlyResources: true,\n taskCandidates: async ({ callableActionNames, signal }) => {\n signal.throwIfAborted();\n if (!callableActionNames.includes(\"open_app\")) return [];\n const apps = await listGrantedDispatchMcpApps();\n signal.throwIfAborted();\n if (\n apps.length > 128 ||\n apps.some(\n (app) =>\n app.id.length > 256 ||\n app.name.length > 256 ||\n app.description.length > 2000,\n )\n ) {\n throw new Error(\"App catalog exceeds the task discovery limit\");\n }\n return apps.map((app) => ({\n id: `app:${app.id}`,\n kind: \"app\" as const,\n name: app.name,\n description: app.description || app.name,\n use: { type: \"open_app\" as const, app: app.id, path: \"/\" },\n callable: true,\n reason: \"Available through the workspace app gateway.\",\n }));\n },\n connectorCatalog: [\n \"resources\",\n \"list_app_actions\",\n \"call_app_action\",\n \"read_view\",\n \"resolve-integration-source-context\",\n \"start-workspace-app-creation\",\n \"list-dispatch-usage-metrics\",\n ],\n },\n resolveOrgId: async (event) => {\n const ctx = await getOrgContext(event);\n return ctx.orgId;\n },\n actions: resolveDispatchActions,\n actionRouteAuth: workspaceAppActionRouteAuth,\n actionRoutePublicPaths: [\n WORKSPACE_APPS_ACTION_PATH,\n WORKSPACE_APP_CLAIM_ACTION_PATH,\n ],\n codeExecution: { production: \"sandboxed\" },\n systemPrompt: `You are the central dispatch for this workspace.\n\nDefault posture:\n- Treat Slack and Telegram as shared entrypoints into the workspace.\n- Heavily delegate domain work to specialized agents through A2A when another app owns the job.\n- Keep durable memory and operating instructions in resources rather than ephemeral chat.\n- Prefer replying in the current external thread unless the user explicitly asks you to send to a saved destination.\n\nUse the standard workspace primitives:\n- Read and update resources like AGENTS.md, LEARNINGS.md, jobs/*.md, agents/*.md, and remote-agents/*.json when appropriate.\n- Use recurring jobs for scheduled behavior.\n- Use custom agent profiles in agents/*.md for local spawned work and remote-agents/*.json for remote A2A apps.\n- For a Claude-style Markdown or JSON agent setup, use import-agent so the\n profile is normalized into agents/<slug>.md. Never import credentials, hooks,\n shell commands, or local environment settings.\n- For a folder of agent instructions, references, or skills, use\n import-agent-pack. It preserves the text files under agents/<slug>/ and\n creates the normalized profile alongside them. Use list-agent-pack to inspect\n the pack before editing or handing it off to an app.\n- For an existing HTTP/A2A endpoint, use connect-external-agent and let the\n normal A2A/MCP connection flow handle authentication.\n- You receive a compact available-apps block with sibling workspace app names and descriptions. Use it to pick the right A2A target, and call list-connected-agents or tool-search only when you need fresh details.\n- Saved pointers: when the user says that something is their Y (\"my todo list is this doc\", \"X is my Y\", or gives a link and a name for it), call remember-pointer with the alias, the app that owns it and the link or object id. When a request refers to something by a personal name, call resolve-pointer first; if it matches, open that app and object, and do not default to another app (a todo list pointed at a doc opens the doc, not Tasks). Use scope org only when the user asks to share it with the organization.\n- Show the work in the app: when the user asks to see, open, find, browse, or check something an app owns (mail, events, docs, decks, designs, tasks, clips, analytics, records), the result belongs on screen beside the chat, not only in text. Delegating to that app's agent opens the app beside the chat, and when the answer is a screen (a list, thread, event, doc, deck, record, or something just created or found) also call open_app with the app and, when you know it, the view or path. Then answer in a sentence or two instead of restating what the pane shows.\n- Follow-ups about a screen that is already open (narrow it, filter, switch tabs, open the next one, change this item) go to that app's own agent, which navigates the open pane in place. Do not answer from memory, and do not open the same app again.\n- Prefer the workspace app that owns a domain over a connected third-party tool for the same domain (a Notion connector for docs or meeting notes, a calendar connector for events). Use the third-party tool only when the person names that service or no workspace app covers the job.\n- Requests to create or draft something (a doc, deck, design, post, issue, event, or reply) go to the owning app's agent so the item opens beside the chat as an unsaved draft. Do not answer them as chat text or ask which app to use when one fits.\n- For Dispatch's own screens (apps, agents, integrations, connections, settings), use navigate to open the page, then summarize what it shows.\n- A write that creates a rich item (a reply, event, post, slide, or doc) opens as an unsaved draft in the app. Say it is waiting there for the user to review and save or send, and never claim something was sent or saved when it was not.\n- Hosted/connected A2A neighbors such as Analytics and Content come from the available-apps context or list-connected-agents. list-workspace-apps only inventories apps mounted inside this workspace deployment; never use a missing row there to conclude that a connected agent is unavailable.\n- When answering whether a mounted workspace app exposes an agent card or A2A endpoint, call list-workspace-apps with includeAgentCards=true. If you have not requested that probe, absence of agent-card fields means unchecked, not unavailable.\n- When creating a new workspace app, create a separate app under apps/<app-id> with apps/<app-id>/package.json including a concise generated description, mount it at /<app-id>, use relative /<app-id> links, never hardcode localhost or dev ports, use shadcn/ui with @tabler/icons-react rather than lucide-react, and keep the configureClientRouterBasename() call in app/entry.client.tsx so the app hydrates at /<app-id>. There is no separate workspace app registry to edit.\n- When a user asks to rename an existing workspace app or change its Dispatch title/description, call update-workspace-app-metadata with the existing appId from list-workspace-apps. This is a metadata-only edit — never call start-workspace-app-creation, which creates a new app and Builder branch.\n- When an explicit app-creation request already includes a source brief or a concrete repeatable workflow, call start-workspace-app-creation without asking non-blocking product or UX questions. Choose recommended defaults, let the Builder handoff record assumptions, and ask only for authorization, credentials, a destructive action, an ambiguous target workspace, or a genuinely missing workflow.\n- If the chat template is used, treat it as scaffolding only: the finished app must be branded as the requested app with its own home screen/navigation/package metadata/manifest, and must not leave visible \"Chat\", \"Starter\", \"Blank app\", or \"New app\" UI behind.\n- Treat the apps in the available-apps context as existing neighbors available through links and A2A. Do not create wrapper apps, child apps, nested routes, or cloned template copies just to give a new app access to them; build only the genuinely new workflow and delegate cross-app work to those existing apps.\n- Owners and admins can hide Agent-Native.com hosted apps for the organization with set-hosted-apps-settings; get-hosted-apps-settings reads it. When hidden they are left out of available-apps and list-connected-agents marks them hiddenFromLaunchers, but call-agent by name still reaches them.\n- Integration grants are not provider capability limits. For ad hoc provider inspection, querying, reporting, or troubleshooting, call provider-api-catalog/provider-api-docs, then provider-api-request against the provider's real HTTP API. Use connectionId for a specific shared grant and accountId for a specific OAuth account. Never expose secret values or silently widen app access while doing this.\n- For broad provider searches, joins, classification, corpus counts, or absence claims, fetch every relevant page or an explicitly bounded cohort, stage/save large responses with stageAs/saveToFile/fetchAllPages, and reduce them with query-staged-dataset or run-code. Report source, filters, row counts, pagination, truncation, failed pages, and uncovered gaps.\n- Use list-dispatch-usage-metrics only for this workspace's own members' agent/LLM usage and spend, or aggregate adoption of an accessible workspace app. For agent/LLM usage or spend, call it with scope=workspace and the requested sinceDays; it reports workspace-member usage only. For app adoption, call it with scope=app and appId; app creators can see aggregate daily/weekly active users and tracked actions for their own app, while organization owners/admins can inspect any accessible app. App scope omits individual users and prompt previews. External customer, account, or company usage, credits, activity, or product data belongs to the relevant app: use its identity in <relevant-apps> when clear, or call describe-workspace-apps with a query when ownership is unclear. Do not use this action for external customer/account/company data.\n\nWhen a user asks for something like a digest, reminder, routing rule, or saved behavior:\n- First decide whether it should be a resource, a recurring job, a destination, or a delegated task.\n- Keep responses concise and operational.\n- Avoid inventing integrations or destinations that are not configured yet.${builderManagedAppsNote()}`,\n});\n\n/**\n * A Builder-linked workspace builds its apps in Builder; app-creation actions\n * return a link there, and the agent should offer it rather than retry.\n */\nfunction builderManagedAppsNote(): string {\n const url = getBuilderWorkspaceUrl();\n if (!url) return \"\";\n return `\n\nThis workspace is managed in Builder. Never create, scaffold, remix, or install workspace apps from here. When someone asks for a new app, point them to ${url} and tell them to use New app there.`;\n}\n"]}
1
+ {"version":3,"file":"agent-chat.js","sourceRoot":"","sources":["../../../src/server/plugins/agent-chat.ts"],"names":[],"mappings":"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","sourcesContent":["import { getOrgContext } from \"@agent-native/core/org\";\nimport {\n createAgentChatPlugin,\n getBuilderWorkspaceUrl,\n registerAgentContextAgentFilter,\n} from \"@agent-native/core/server\";\n\nimport { resolveDispatchActions } from \"../../actions/index.js\";\nimport { hideHostedAppsWhenOff } from \"../lib/hosted-apps-settings.js\";\nimport { listGrantedDispatchMcpApps } from \"../lib/mcp-gateway.js\";\nimport {\n workspaceAppActionRouteAuth,\n WORKSPACE_APP_CLAIM_ACTION_PATH,\n WORKSPACE_APPS_ACTION_PATH,\n} from \"../lib/workspace-app-action-auth.js\";\n\nconst INITIAL_TOOL_NAMES = [\n \"view-screen\",\n \"list-workspace-apps\",\n \"update-workspace-app-metadata\",\n \"list-connected-agents\",\n \"list_app_actions\",\n \"call_app_action\",\n \"ask_app\",\n \"open_app\",\n \"list-workspace-resources\",\n \"create-workspace-resource\",\n \"update-workspace-resource\",\n \"import-agent\",\n \"import-agent-pack\",\n \"list-agent-pack\",\n \"connect-external-agent\",\n \"list-vault-secrets\",\n \"request-vault-secret\",\n \"create-vault-secret\",\n \"list-destinations\",\n \"upsert-destination\",\n \"list-dreams\",\n \"start-workspace-app-creation\",\n \"propose-action-suggestions\",\n \"list-dispatch-usage-metrics\",\n \"list-available-workspace-templates\",\n \"provider-api-catalog\",\n \"provider-api-docs\",\n \"provider-api-request\",\n \"query-staged-dataset\",\n \"navigate\",\n];\n\nregisterAgentContextAgentFilter(\"dispatch\", hideHostedAppsWhenOff);\n\nexport default createAgentChatPlugin({\n appId: \"dispatch\",\n connectApps: true,\n durableBackgroundRuns: true,\n initialToolNames: INITIAL_TOOL_NAMES,\n mcp: {\n appApprovalPage: true,\n readOnlyResources: true,\n servesAnSkill: true,\n taskCandidates: async ({ callableActionNames, signal }) => {\n signal.throwIfAborted();\n if (!callableActionNames.includes(\"open_app\")) return [];\n const apps = await listGrantedDispatchMcpApps();\n signal.throwIfAborted();\n if (\n apps.length > 128 ||\n apps.some(\n (app) =>\n app.id.length > 256 ||\n app.name.length > 256 ||\n app.description.length > 2000,\n )\n ) {\n throw new Error(\"App catalog exceeds the task discovery limit\");\n }\n return apps.map((app) => ({\n id: `app:${app.id}`,\n kind: \"app\" as const,\n name: app.name,\n description: app.description || app.name,\n use: { type: \"open_app\" as const, app: app.id, path: \"/\" },\n callable: true,\n reason: \"Available through the workspace app gateway.\",\n }));\n },\n connectorCatalog: [\n \"resources\",\n \"list_app_actions\",\n \"call_app_action\",\n \"read_view\",\n \"resolve-integration-source-context\",\n \"start-workspace-app-creation\",\n \"list-dispatch-usage-metrics\",\n ],\n },\n resolveOrgId: async (event) => {\n const ctx = await getOrgContext(event);\n return ctx.orgId;\n },\n actions: resolveDispatchActions,\n actionRouteAuth: workspaceAppActionRouteAuth,\n actionRoutePublicPaths: [\n WORKSPACE_APPS_ACTION_PATH,\n WORKSPACE_APP_CLAIM_ACTION_PATH,\n ],\n codeExecution: { production: \"sandboxed\" },\n systemPrompt: `You are the central dispatch for this workspace.\n\nDefault posture:\n- Treat Slack and Telegram as shared entrypoints into the workspace.\n- Prefer direct call_app_action (checking list_app_actions first when action names or inputs are unknown) for single-app reads, lookups, navigation, and simple mutations so standard turns finish in one LLM hop. Reserve ask_app for multi-step specialist sub-workflows that genuinely need the target app's own agent reasoning. Pass viewportMode: \"background\" on secondary cross-app lookups so they cannot hijack the visible foreground pane.\n- Keep durable memory and operating instructions in resources rather than ephemeral chat.\n- Prefer replying in the current external thread unless the user explicitly asks you to send to a saved destination.\n\nUse the standard workspace primitives:\n- Read and update resources like AGENTS.md, LEARNINGS.md, jobs/*.md, agents/*.md, and remote-agents/*.json when appropriate.\n- Use recurring jobs for scheduled behavior.\n- Use custom agent profiles in agents/*.md for local spawned work and remote-agents/*.json for remote A2A apps.\n- For a Claude-style Markdown or JSON agent setup, use import-agent so the\n profile is normalized into agents/<slug>.md. Never import credentials, hooks,\n shell commands, or local environment settings.\n- For a folder of agent instructions, references, or skills, use\n import-agent-pack. It preserves the text files under agents/<slug>/ and\n creates the normalized profile alongside them. Use list-agent-pack to inspect\n the pack before editing or handing it off to an app.\n- For an existing HTTP/A2A endpoint, use connect-external-agent and let the\n normal A2A/MCP connection flow handle authentication.\n- You receive a compact available-apps block with sibling workspace app names and descriptions. Use it to pick the right A2A target, and call list-connected-agents or tool-search only when you need fresh details.\n- Saved pointers: when the user says that something is their Y (\"my todo list is this doc\", \"X is my Y\", or gives a link and a name for it), call remember-pointer with the alias, the app that owns it and the link or object id. When a request refers to something by a personal name, call resolve-pointer first; if it matches, open that app and object, and do not default to another app (a todo list pointed at a doc opens the doc, not Tasks). Use scope org only when the user asks to share it with the organization.\n- Show the work in the app: when the user asks to see, open, find, browse, or check something an app owns (mail, events, docs, decks, designs, tasks, clips, analytics, records), the result belongs on screen beside the chat, not only in text. Delegating to that app's agent opens the app beside the chat, and when the answer is a screen (a list, thread, event, doc, deck, record, or something just created or found) also call open_app with the app and, when you know it, the view or path. Then answer in a sentence or two instead of restating what the pane shows.\n- Requests about data in the app already on screen including follow-ups that narrow or filter the view, go to that app's own agent, which navigates the open pane in place. A service mentioned in a message or notification does not make that service's records the subject: use the app holding the messages. Delegate to or open another app when the user asks for that app's own data or screen. Do not answer from memory or open the same app again.\n- Prefer the workspace app that owns a domain over a connected third-party tool for the same domain (a Notion connector for docs or meeting notes, a calendar connector for events). Use the third-party tool only when the person names that service or no workspace app covers the job.\n- Requests to create or draft something (a doc, deck, design, post, issue, event, or reply) go to the owning app's agent so the item opens beside the chat as an unsaved draft. Do not answer them as chat text or ask which app to use when one fits.\n- For Dispatch's own screens (apps, agents, integrations, connections, settings), use navigate to open the page, then summarize what it shows.\n- A write that creates a rich item (a reply, event, post, slide, or doc) opens as an unsaved draft in the app. Say it is waiting there for the user to review and save or send, and never claim something was sent or saved when it was not.\n- Hosted/connected A2A neighbors such as Analytics and Content come from the available-apps context or list-connected-agents. list-workspace-apps only inventories apps mounted inside this workspace deployment; never use a missing row there to conclude that a connected agent is unavailable.\n- When answering whether a mounted workspace app exposes an agent card or A2A endpoint, call list-workspace-apps with includeAgentCards=true. If you have not requested that probe, absence of agent-card fields means unchecked, not unavailable.\n- When creating a new workspace app, create a separate app under apps/<app-id> with apps/<app-id>/package.json including a concise generated description, mount it at /<app-id>, use relative /<app-id> links, never hardcode localhost or dev ports, use shadcn/ui with @tabler/icons-react rather than lucide-react, and keep the configureClientRouterBasename() call in app/entry.client.tsx so the app hydrates at /<app-id>. There is no separate workspace app registry to edit.\n- When a user asks to rename an existing workspace app or change its Dispatch title/description, call update-workspace-app-metadata with the existing appId from list-workspace-apps. This is a metadata-only edit — never call start-workspace-app-creation, which creates a new app and Builder branch.\n- When an explicit app-creation request already includes a source brief or a concrete repeatable workflow, call start-workspace-app-creation without asking non-blocking product or UX questions. Choose recommended defaults, let the Builder handoff record assumptions, and ask only for authorization, credentials, a destructive action, an ambiguous target workspace, or a genuinely missing workflow.\n- If the chat template is used, treat it as scaffolding only: the finished app must be branded as the requested app with its own home screen/navigation/package metadata/manifest, and must not leave visible \"Chat\", \"Starter\", \"Blank app\", or \"New app\" UI behind.\n- Treat the apps in the available-apps context as existing neighbors available through links and A2A. Do not create wrapper apps, child apps, nested routes, or cloned template copies just to give a new app access to them; build only the genuinely new workflow and delegate cross-app work to those existing apps.\n- Owners and admins can hide Agent-Native.com hosted apps for the organization with set-hosted-apps-settings; get-hosted-apps-settings reads it. When hidden they are left out of available-apps and list-connected-agents marks them hiddenFromLaunchers, but call-agent by name still reaches them.\n- Integration grants are not provider capability limits. For ad hoc provider inspection, querying, reporting, or troubleshooting, call provider-api-catalog/provider-api-docs, then provider-api-request against the provider's real HTTP API. Use connectionId for a specific shared grant and accountId for a specific OAuth account. Never expose secret values or silently widen app access while doing this.\n- For broad provider searches, joins, classification, corpus counts, or absence claims, fetch every relevant page or an explicitly bounded cohort, stage/save large responses with stageAs/saveToFile/fetchAllPages, and reduce them with query-staged-dataset or run-code. Report source, filters, row counts, pagination, truncation, failed pages, and uncovered gaps.\n- Use list-dispatch-usage-metrics only for this workspace's own members' agent/LLM usage and spend, or aggregate adoption of an accessible workspace app. For agent/LLM usage or spend, call it with scope=workspace and the requested sinceDays; it reports workspace-member usage only. For app adoption, call it with scope=app and appId; app creators can see aggregate daily/weekly active users and tracked actions for their own app, while organization owners/admins can inspect any accessible app. App scope omits individual users and prompt previews. External customer, account, or company usage, credits, activity, or product data belongs to the relevant app: use its identity in <relevant-apps> when clear, or call describe-workspace-apps with a query when ownership is unclear. Do not use this action for external customer/account/company data.\n\nAfter answering or showing the requested work in Dispatch chat, use propose-action-suggestions only when there is a grounded, useful persistent improvement for the user to consider. Pass the installed app's exact ID and a real action with its required inputs for a filter, saved view, or automation. Use customize-app for a specific missing control. If no installed app fits a durable new workflow, offer create-app with appId=\"dispatch\" and a short specification, even if no app was opened or called this turn. Offer at most two suggestions per turn. Only propose the improvement; wait for the user's selection to execute it.\n\nWhen a user asks for something like a digest, reminder, routing rule, or saved behavior:\n- First decide whether it should be a resource, a recurring job, a destination, or a delegated task.\n- Keep responses concise and operational.\n- Avoid inventing integrations or destinations that are not configured yet.${builderManagedAppsNote()}`,\n});\n\nfunction builderManagedAppsNote(): string {\n const url = getBuilderWorkspaceUrl();\n if (!url) return \"\";\n return `\n\nThis workspace is managed in Builder. App creation here hands off to the configured workspace. A create-app suggestion allows the user to open that workspace. For an explicit creation request, use the normal creation action and report the handoff it returns.`;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/server/plugins/auth.ts"],"names":[],"mappings":"AAeA,QAAA,MAAM,kBAAkB,aAAoB,GAAG,kBAkB9C,CAAC;eAEa,kBAAkB"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/server/plugins/auth.ts"],"names":[],"mappings":"AAeA,QAAA,MAAM,kBAAkB,aAAoB,GAAG,kBAmB9C,CAAC;eAEa,kBAAkB"}
@@ -24,6 +24,7 @@ const dispatchAuthPlugin = async (nitroApp) => {
24
24
  publicPaths: [
25
25
  ...(authConfig.publicPaths ?? []),
26
26
  "/_agent-native/private-icons",
27
+ "/_agent-native/a2a-google",
27
28
  ],
28
29
  });
29
30
  return plugin(nitroApp);
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/server/plugins/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,iBAAiB,GAAG;IACxB,OAAO,EAAE,UAAU;IACnB,OAAO,EACL,sGAAsG;IACxG,QAAQ,EAAE;QACR,4DAA4D;QAC5D,6DAA6D;QAC7D,oDAAoD;KACrD;CACO,CAAC;AAEX,MAAM,kBAAkB,GAAG,KAAK,EAAE,QAAa,EAAE,EAAE;IACjD,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,iBAAiB,EAAE,CAAC;IACtD,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,IAAI,KAAK,CAAC;IAClD,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS;QACpC,CAAC,CAAC,EAAE,GAAG,iBAAiB,EAAE,GAAG,UAAU,CAAC,SAAS,EAAE;QACnD,CAAC,CAAC,iBAAiB,CAAC;IACtB,MAAM,MAAM,GAAG,uBAAuB,CAAC;QACrC,UAAU;QACV,SAAS,EAAE,SAAgB;QAC3B,uBAAuB,EAAE,UAAU,CAAC,uBAAuB,IAAI,CAAC,GAAG,CAAC;QACpE,4EAA4E;QAC5E,qEAAqE;QACrE,WAAW,EAAE;YACX,GAAG,CAAC,UAAU,CAAC,WAAW,IAAI,EAAE,CAAC;YACjC,8BAA8B;SAC/B;KACF,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import { createToolkitAuthPlugin } from \"@agent-native/toolkit/app/auth/server\";\n\nimport { getDispatchConfig } from \"../index.js\";\n\nconst DEFAULT_MARKETING = {\n appName: \"Dispatch\",\n tagline:\n \"Your AI agent manages secrets, orchestrates other agents, and routes messages across your workspace.\",\n features: [\n \"Centralized vault for secrets with granular per-app grants\",\n \"Cross-agent orchestration and delegation to specialist apps\",\n \"Slack and Telegram routing with approval workflows\",\n ],\n} as const;\n\nconst dispatchAuthPlugin = async (nitroApp: any) => {\n const { auth: authConfig = {} } = getDispatchConfig();\n const googleOnly = authConfig.googleOnly ?? false;\n const marketing = authConfig.marketing\n ? { ...DEFAULT_MARKETING, ...authConfig.marketing }\n : DEFAULT_MARKETING;\n const plugin = createToolkitAuthPlugin({\n googleOnly,\n marketing: marketing as any,\n workspaceAppPublicPaths: authConfig.workspaceAppPublicPaths ?? [\"/\"],\n // This route authenticates its own audience-bound service bearer before any\n // asset lookup; the session guard cannot authenticate peer services.\n publicPaths: [\n ...(authConfig.publicPaths ?? []),\n \"/_agent-native/private-icons\",\n ],\n });\n return plugin(nitroApp);\n};\n\nexport default dispatchAuthPlugin;\n"]}
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/server/plugins/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,iBAAiB,GAAG;IACxB,OAAO,EAAE,UAAU;IACnB,OAAO,EACL,sGAAsG;IACxG,QAAQ,EAAE;QACR,4DAA4D;QAC5D,6DAA6D;QAC7D,oDAAoD;KACrD;CACO,CAAC;AAEX,MAAM,kBAAkB,GAAG,KAAK,EAAE,QAAa,EAAE,EAAE;IACjD,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,iBAAiB,EAAE,CAAC;IACtD,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,IAAI,KAAK,CAAC;IAClD,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS;QACpC,CAAC,CAAC,EAAE,GAAG,iBAAiB,EAAE,GAAG,UAAU,CAAC,SAAS,EAAE;QACnD,CAAC,CAAC,iBAAiB,CAAC;IACtB,MAAM,MAAM,GAAG,uBAAuB,CAAC;QACrC,UAAU;QACV,SAAS,EAAE,SAAgB;QAC3B,uBAAuB,EAAE,UAAU,CAAC,uBAAuB,IAAI,CAAC,GAAG,CAAC;QACpE,4EAA4E;QAC5E,qEAAqE;QACrE,WAAW,EAAE;YACX,GAAG,CAAC,UAAU,CAAC,WAAW,IAAI,EAAE,CAAC;YACjC,8BAA8B;YAC9B,2BAA2B;SAC5B;KACF,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import { createToolkitAuthPlugin } from \"@agent-native/toolkit/app/auth/server\";\n\nimport { getDispatchConfig } from \"../index.js\";\n\nconst DEFAULT_MARKETING = {\n appName: \"Dispatch\",\n tagline:\n \"Your AI agent manages secrets, orchestrates other agents, and routes messages across your workspace.\",\n features: [\n \"Centralized vault for secrets with granular per-app grants\",\n \"Cross-agent orchestration and delegation to specialist apps\",\n \"Slack and Telegram routing with approval workflows\",\n ],\n} as const;\n\nconst dispatchAuthPlugin = async (nitroApp: any) => {\n const { auth: authConfig = {} } = getDispatchConfig();\n const googleOnly = authConfig.googleOnly ?? false;\n const marketing = authConfig.marketing\n ? { ...DEFAULT_MARKETING, ...authConfig.marketing }\n : DEFAULT_MARKETING;\n const plugin = createToolkitAuthPlugin({\n googleOnly,\n marketing: marketing as any,\n workspaceAppPublicPaths: authConfig.workspaceAppPublicPaths ?? [\"/\"],\n // This route authenticates its own audience-bound service bearer before any\n // asset lookup; the session guard cannot authenticate peer services.\n publicPaths: [\n ...(authConfig.publicPaths ?? []),\n \"/_agent-native/private-icons\",\n \"/_agent-native/a2a-google\",\n ],\n });\n return plugin(nitroApp);\n};\n\nexport default dispatchAuthPlugin;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../../src/server/plugins/db.ts"],"names":[],"mappings":"AAuDA,eAAO,MAAM,qBAAqB,yCAEhC,CAAC;;0BAEmB,QAAQ,EAAE,GAAG"}
1
+ {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../../src/server/plugins/db.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,yCAEhC,CAAC;;0BAEmB,QAAQ,EAAE,GAAG"}
@@ -1,51 +1,5 @@
1
1
  import { runMigrations } from "@agent-native/core/db";
2
- import { registerIdentityColumns } from "@agent-native/core/org";
3
2
  import { dispatchMigrations } from "../../db/migrations.js";
4
- registerIdentityColumns([
5
- {
6
- table: "dispatch_identity_links",
7
- column: "owner_email",
8
- emailChange: "rekey",
9
- offboard: "delete",
10
- reason: "A linked chat identity acts as its owner; transferring it would let the departed member act as the successor.",
11
- },
12
- {
13
- table: "dispatch_link_tokens",
14
- column: "owner_email",
15
- emailChange: "rekey",
16
- offboard: "delete",
17
- reason: "An unclaimed link token binds a chat identity to its owner; the successor mints their own.",
18
- },
19
- {
20
- table: "identity_sso_authorization_code",
21
- column: "email",
22
- emailChange: "delete",
23
- offboard: "delete",
24
- reason: "Unconsumed single-use code that asserts this address to an app; the member signs in again.",
25
- },
26
- {
27
- table: "identity_sso_bootstrap",
28
- column: "email",
29
- emailChange: "delete",
30
- offboard: "delete",
31
- reason: "Unconsumed single-use sign-in bootstrap for this address; the member signs in again.",
32
- },
33
- ...[
34
- "dispatch_destinations",
35
- "dispatch_dreams",
36
- "dispatch_link_tokens",
37
- // No longer read or written. The table stays in existing databases until
38
- // it is dropped, and identity migrations refuse any column without a policy.
39
- "vault_secrets",
40
- "workspace_resources",
41
- ].map((table) => ({
42
- table,
43
- column: "created_by",
44
- emailChange: "retain",
45
- offboard: "retain",
46
- reason: "Creator attribution; ownership is owner_email.",
47
- })),
48
- ]);
49
3
  export const runDispatchMigrations = runMigrations(dispatchMigrations, {
50
4
  table: "dispatch_migrations",
51
5
  });
@@ -1 +1 @@
1
- {"version":3,"file":"db.js","sourceRoot":"","sources":["../../../src/server/plugins/db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,uBAAuB,CAAC;IACtB;QACE,KAAK,EAAE,yBAAyB;QAChC,MAAM,EAAE,aAAa;QACrB,WAAW,EAAE,OAAO;QACpB,QAAQ,EAAE,QAAQ;QAClB,MAAM,EACJ,+GAA+G;KAClH;IACD;QACE,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,aAAa;QACrB,WAAW,EAAE,OAAO;QACpB,QAAQ,EAAE,QAAQ;QAClB,MAAM,EACJ,4FAA4F;KAC/F;IACD;QACE,KAAK,EAAE,iCAAiC;QACxC,MAAM,EAAE,OAAO;QACf,WAAW,EAAE,QAAQ;QACrB,QAAQ,EAAE,QAAQ;QAClB,MAAM,EACJ,4FAA4F;KAC/F;IACD;QACE,KAAK,EAAE,wBAAwB;QAC/B,MAAM,EAAE,OAAO;QACf,WAAW,EAAE,QAAQ;QACrB,QAAQ,EAAE,QAAQ;QAClB,MAAM,EACJ,sFAAsF;KACzF;IACD,GAAG;QACD,uBAAuB;QACvB,iBAAiB;QACjB,sBAAsB;QACtB,yEAAyE;QACzE,6EAA6E;QAC7E,eAAe;QACf,qBAAqB;KACtB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAChB,KAAK;QACL,MAAM,EAAE,YAAY;QACpB,WAAW,EAAE,QAAiB;QAC9B,QAAQ,EAAE,QAAiB;QAC3B,MAAM,EAAE,gDAAgD;KACzD,CAAC,CAAC;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC,kBAAkB,EAAE;IACrE,KAAK,EAAE,qBAAqB;CAC7B,CAAC,CAAC;AAEH,eAAe,KAAK,EAAE,QAAa,EAAE,EAAE;IACrC,MAAM,qBAAqB,CAAC,QAAQ,CAAC,CAAC;AACxC,CAAC,CAAC","sourcesContent":["import { runMigrations } from \"@agent-native/core/db\";\nimport { registerIdentityColumns } from \"@agent-native/core/org\";\n\nimport { dispatchMigrations } from \"../../db/migrations.js\";\n\nregisterIdentityColumns([\n {\n table: \"dispatch_identity_links\",\n column: \"owner_email\",\n emailChange: \"rekey\",\n offboard: \"delete\",\n reason:\n \"A linked chat identity acts as its owner; transferring it would let the departed member act as the successor.\",\n },\n {\n table: \"dispatch_link_tokens\",\n column: \"owner_email\",\n emailChange: \"rekey\",\n offboard: \"delete\",\n reason:\n \"An unclaimed link token binds a chat identity to its owner; the successor mints their own.\",\n },\n {\n table: \"identity_sso_authorization_code\",\n column: \"email\",\n emailChange: \"delete\",\n offboard: \"delete\",\n reason:\n \"Unconsumed single-use code that asserts this address to an app; the member signs in again.\",\n },\n {\n table: \"identity_sso_bootstrap\",\n column: \"email\",\n emailChange: \"delete\",\n offboard: \"delete\",\n reason:\n \"Unconsumed single-use sign-in bootstrap for this address; the member signs in again.\",\n },\n ...[\n \"dispatch_destinations\",\n \"dispatch_dreams\",\n \"dispatch_link_tokens\",\n // No longer read or written. The table stays in existing databases until\n // it is dropped, and identity migrations refuse any column without a policy.\n \"vault_secrets\",\n \"workspace_resources\",\n ].map((table) => ({\n table,\n column: \"created_by\",\n emailChange: \"retain\" as const,\n offboard: \"retain\" as const,\n reason: \"Creator attribution; ownership is owner_email.\",\n })),\n]);\n\nexport const runDispatchMigrations = runMigrations(dispatchMigrations, {\n table: \"dispatch_migrations\",\n});\n\nexport default async (nitroApp: any) => {\n await runDispatchMigrations(nitroApp);\n};\n"]}
1
+ {"version":3,"file":"db.js","sourceRoot":"","sources":["../../../src/server/plugins/db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC,kBAAkB,EAAE;IACrE,KAAK,EAAE,qBAAqB;CAC7B,CAAC,CAAC;AAEH,eAAe,KAAK,EAAE,QAAa,EAAE,EAAE;IACrC,MAAM,qBAAqB,CAAC,QAAQ,CAAC,CAAC;AACxC,CAAC,CAAC","sourcesContent":["import { runMigrations } from \"@agent-native/core/db\";\n\nimport { dispatchMigrations } from \"../../db/migrations.js\";\n\nexport const runDispatchMigrations = runMigrations(dispatchMigrations, {\n table: \"dispatch_migrations\",\n});\n\nexport default async (nitroApp: any) => {\n await runDispatchMigrations(nitroApp);\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../../src/server/plugins/integrations.ts"],"names":[],"mappings":"AAgDA,QAAA,MAAM,0BAA0B,aAAoB,GAAG,kBAuBtD,CAAC;eAEa,0BAA0B"}
1
+ {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../../src/server/plugins/integrations.ts"],"names":[],"mappings":"AAmDA,QAAA,MAAM,0BAA0B,aAAoB,GAAG,kBAuBtD,CAAC;eAEa,0BAA0B"}
@@ -34,7 +34,10 @@ When a user asks for something:
34
34
  - If a user asks to rename an existing workspace app or change its Dispatch title/description, call update-workspace-app-metadata with the existing appId from list-workspace-apps. Do not call start-workspace-app-creation for a metadata-only edit because that starts a new app and Builder branch.
35
35
  - If a new-app prompt asks for access to Mail, Calendar, Analytics, Brain, Assets, or similar first-party app data/agents, keep using the existing app through A2A. Do not ask Builder to scaffold those apps as children of the new app unless the user explicitly asks for a customized app from that template.
36
36
  - If the chat template is used, treat it as scaffolding only: the finished app must be branded as the requested app with its own home screen/navigation/package metadata/manifest, and must not leave visible "Chat", "Starter", "Blank app", or "New app" UI behind.
37
- - If the user explicitly asks for a new app or workspace app, call start-workspace-app-creation with their prompt and include a concise generated description by default. Do not satisfy a new-app request by adding a route, page, component, or file inside apps/chat or another existing app unless the user explicitly asks to modify that existing app. When the prompt contains a source brief or concrete repeatable workflow, choose recommended defaults and do not ask non-blocking product or UX questions; ask only for authorization, credentials, a destructive action, an ambiguous target workspace, or a genuinely missing workflow. If the request is too vague to classify, ask one concise follow-up. If the action returns mode "builder", reply with the Builder branch URL; Builder is responsible for creating the separate workspace app under apps/<app-id>, mounting it at /<app-id>, ensuring apps/<app-id>/package.json exists with name/displayName and description so Dispatch discovers it, using relative /<app-id> links instead of hardcoded localhost/dev ports, and keeping the configureClientRouterBasename() call in app/entry.client.tsx. The new app lives at the workspace root /<app-id>, NOT under /dispatch/<app-id>, /apps/<app-id>, or any other Dispatch tab — when telling the user where to find it, link to /<app-id> only. There is no separate workspace app registry to edit. If it returns mode "local-agent", tell the user it is ready for the local code agent and include the returned app path/prompt summary. Dispatch reuses the connected workspace Builder project or provisions it through the Builder Projects API when an organization owner/admin starts the first app; members need an owner/admin to configure the project first. Do not ask the user to use Builder org/beta settings. If it returns mode "builder-unavailable", the action also returns a \`reason\` code plus a user-facing \`message\` and (for some reasons) an operator-facing \`detail\`. Relay the \`message\` to the user as-is; only surface \`detail\` when the user is clearly an operator debugging the deployment (e.g. troubleshooting a broken Builder connection for the workspace), never as routine detail for an end user. If it returns mode "app-id-taken", the app id is already in use: \`conflict\` is "registered" for a live app or "pending" for a creation in flight, and \`owner\` names who started it. Relay the \`message\` and propose a different app id; never retry the same id.
37
+ - If the user explicitly asks for a new app or workspace app, call start-workspace-app-creation with their prompt and include a concise generated description by default. Do not satisfy a new-app request by adding a route, page, component, or file inside apps/chat or another existing app unless the user explicitly asks to modify that existing app. When the prompt contains a source brief or concrete repeatable workflow, use the shared app quality workflow and do not ask non-blocking product or UX questions; ask only for authorization, credentials, a destructive action, an ambiguous target workspace, or a genuinely missing workflow. If the request is too vague to classify, ask one concise follow-up.
38
+ - If app creation returns mode "builder", give the branch link and say registration is pending. For "builder-managed", give the workspace link and direct the user to New app with the same brief. For "local-agent", give the returned instructions to the local code agent. A workspace owner or admin configures the hosted project before ordinary members can start branches.
39
+ - After creation, use list-workspace-apps to find the registered app. Verify the resolved URL, mount, and home through the workspace registry or preview gateway. Use the returned destination in replies. App-internal links use app-local routes with the framework basename. Keep the status pending until the destination serves the requested app.
40
+ - If it returns mode "builder-unavailable", the action also returns a \`reason\` code plus a user-facing \`message\` and (for some reasons) an operator-facing \`detail\`. Relay the \`message\` to the user as-is; only surface \`detail\` when the user is clearly an operator debugging the deployment (e.g. troubleshooting a broken Builder connection for the workspace), never as routine detail for an end user. If it returns mode "app-id-taken", the app id is already in use: \`conflict\` is "registered" for a live app or "pending" for a creation in flight, and \`owner\` names who started it. Relay the \`message\` and propose a different app id; never retry the same id.
38
41
  - For digests, reminders, or saved behavior, prefer recurring jobs, resources, or destinations over chat replies.
39
42
  - Keep responses concise and operational — messaging platforms have character limits.
40
43
  - Use markdown sparingly (bold and lists are fine, avoid complex formatting).
@@ -1 +1 @@
1
- {"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../../src/server/plugins/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,qBAAqB,EACrB,+BAA+B,GAChC,MAAM,iCAAiC,CAAC;AAEzC,MAAM,0BAA0B,GAAG;IACjC,GAAG,eAAe;IAClB,OAAO,EAAE;QACP,GAAG,eAAe,CAAC,OAAO;QAC1B,SAAS,EAAE,KAAK;KACjB;CACF,CAAC;AAEF,MAAM,kCAAkC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4FA6BiD,CAAC;AAE7F,MAAM,0BAA0B,GAAG,KAAK,EAAE,QAAa,EAAE,EAAE;IACzD,MAAM,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAClD,MAAM,cAAc,GAAG,YAAY,CAAC,YAAY,CAAC;IACjD,MAAM,YAAY,GAChB,OAAO,cAAc,KAAK,QAAQ;QAChC,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,OAAO,cAAc,KAAK,UAAU;YACpC,CAAC,CAAC,cAAc,CAAC,kCAAkC,CAAC;YACpD,CAAC,CAAC,kCAAkC,CAAC;IAE3C,MAAM,MAAM,GAAG,wBAAwB,CAAC;QACtC,KAAK,EAAE,UAAU;QACjB,OAAO,EAAE,0BAA0B;QACnC,uBAAuB,EAAE,+BAA+B;QACxD,aAAa,EAAE,qBAAqB;QACpC,YAAY;QACZ,wDAAwD;QACxD,yEAAyE;QACzE,+DAA+D;QAC/D,6EAA6E;KAC9E,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,eAAe,0BAA0B,CAAC","sourcesContent":["import { createIntegrationsPlugin } from \"@agent-native/core/server\";\n\nimport { dispatchActions } from \"../../actions/index.js\";\nimport { getDispatchConfig } from \"../index.js\";\nimport {\n beforeDispatchProcess,\n resolveDispatchExecutionContext,\n} from \"../lib/dispatch-integrations.js\";\n\nconst dispatchIntegrationActions = {\n ...dispatchActions,\n ask_app: {\n ...dispatchActions.ask_app,\n agentTool: false,\n },\n};\n\nconst DISPATCH_INTEGRATION_SYSTEM_PROMPT = `You are the central dispatch for this workspace, responding via a messaging platform integration (Slack, Telegram, email, etc.).\n\nDefault posture:\n- Treat Slack, Telegram, and email as shared entrypoints into the workspace.\n- Heavily delegate domain work to specialized agents through A2A (call-agent) when another app owns the job.\n- Use relevant-apps prompt profiles first, then list-connected-agents when you need fresh details. If that context is absent or does not list the needed capability, search with describe-workspace-apps query=\"<capability>\" before assuming a request must be handled locally.\n- Hosted/connected A2A neighbors such as Analytics and Content come from the relevant-apps context or list-connected-agents. If neither identifies the needed capability, use describe-workspace-apps before concluding a connected agent is unavailable. list-workspace-apps only inventories apps mounted inside this workspace deployment; never use a missing row there to conclude that a connected agent is unavailable.\n- When asked whether a mounted workspace app exposes an agent card or A2A endpoint, call list-workspace-apps with includeAgentCards=true. Without that probe, missing agent-card fields mean unchecked, not unavailable.\n- Treat the apps in the relevant-apps context as existing neighbors available through links and A2A. Do not create wrapper apps, child apps, nested routes, or cloned template copies just to give a new app access to them; build only the genuinely new workflow and delegate cross-app work to those existing apps.\n- Integration grants are not provider capability limits. For ad hoc provider inspection, querying, reporting, or troubleshooting, call provider-api-catalog/provider-api-docs, then provider-api-request against the provider's real HTTP API. Use connectionId for a specific shared grant and accountId for a specific OAuth account. Never expose secret values or silently widen app access while doing this.\n- Keep durable memory and operating instructions in resources rather than ephemeral chat.\n- Reply in the originating thread unless the user explicitly asks you to send to a saved destination.\n\nWhen a user asks for something:\n- If it belongs to analytics, content, slides, clips, assets, etc., delegate via call-agent — do not re-implement the domain logic in dispatch.\n- Synthetic uptime, health-check, and URL-availability monitors belong to Analytics, even when the monitored target is another app such as Clips. Delegate creation to Analytics and relay its exact monitor URL. Dispatch-native recurring jobs are for reminders, digests, and agent workflows, not HTTP uptime probes.\n- Route by the requested artifact type, not by organization-specific names stored in code. For structured records, databases, tables, queues, boards, and intake forms, resolve the owning app and canonical destination from loaded workspace instructions/resources plus discovered app capabilities; do not assume Content, a database ID, schema, owner, or required fields. Visual designs, mockups, wireframes, screens, and interfaces belong to Design. A trusted Required target agent hint in integration context is authoritative.\n- When delegating structured intake to the resolved owning app, preserve the exact Source thread URL and the workspace instruction context, inspect the destination's current required fields, ask only for missing values, submit once, verify the saved record, and return the exact link.\n- In messaging integrations, use call-agent for cross-app delegation; do not use ask_app.\n- After call-agent returns an answer, RELAY IT DIRECTLY to the user with at most a one-line preface — do not rephrase, summarize, or add commentary. The downstream agent already crafted the answer; your job is delivery, not editing. This minimizes round-trips and keeps the user-visible reply fast.\n- Exception: if the downstream agent reports a missing model/provider credential, do not name exact env vars, Vault keys, tokens, or secrets. Say the target app needs an LLM connection and recommend using Builder/managed LLM for that app; keep bring-your-own provider keys as a secondary option only if the user asks.\n- If the user asks to create, build, make, scaffold, or generate an \"agent\" from Dispatch chat or by tagging @agent-native in Slack, email, or Telegram, first classify the ask. If it is a simple Dispatch-native behavior like a reminder, digest, monitor, routing rule, saved instruction, or recurring workflow, create or update the recurring job/resource/destination in Dispatch. If it is a robust unique product or teammate that needs its own UI, data model, actions, integrations, or domain workflow, treat it as a new workspace app and call start-workspace-app-creation.\n- If a user asks to rename an existing workspace app or change its Dispatch title/description, call update-workspace-app-metadata with the existing appId from list-workspace-apps. Do not call start-workspace-app-creation for a metadata-only edit because that starts a new app and Builder branch.\n- If a new-app prompt asks for access to Mail, Calendar, Analytics, Brain, Assets, or similar first-party app data/agents, keep using the existing app through A2A. Do not ask Builder to scaffold those apps as children of the new app unless the user explicitly asks for a customized app from that template.\n- If the chat template is used, treat it as scaffolding only: the finished app must be branded as the requested app with its own home screen/navigation/package metadata/manifest, and must not leave visible \"Chat\", \"Starter\", \"Blank app\", or \"New app\" UI behind.\n- If the user explicitly asks for a new app or workspace app, call start-workspace-app-creation with their prompt and include a concise generated description by default. Do not satisfy a new-app request by adding a route, page, component, or file inside apps/chat or another existing app unless the user explicitly asks to modify that existing app. When the prompt contains a source brief or concrete repeatable workflow, choose recommended defaults and do not ask non-blocking product or UX questions; ask only for authorization, credentials, a destructive action, an ambiguous target workspace, or a genuinely missing workflow. If the request is too vague to classify, ask one concise follow-up. If the action returns mode \"builder\", reply with the Builder branch URL; Builder is responsible for creating the separate workspace app under apps/<app-id>, mounting it at /<app-id>, ensuring apps/<app-id>/package.json exists with name/displayName and description so Dispatch discovers it, using relative /<app-id> links instead of hardcoded localhost/dev ports, and keeping the configureClientRouterBasename() call in app/entry.client.tsx. The new app lives at the workspace root /<app-id>, NOT under /dispatch/<app-id>, /apps/<app-id>, or any other Dispatch tab — when telling the user where to find it, link to /<app-id> only. There is no separate workspace app registry to edit. If it returns mode \"local-agent\", tell the user it is ready for the local code agent and include the returned app path/prompt summary. Dispatch reuses the connected workspace Builder project or provisions it through the Builder Projects API when an organization owner/admin starts the first app; members need an owner/admin to configure the project first. Do not ask the user to use Builder org/beta settings. If it returns mode \"builder-unavailable\", the action also returns a \\`reason\\` code plus a user-facing \\`message\\` and (for some reasons) an operator-facing \\`detail\\`. Relay the \\`message\\` to the user as-is; only surface \\`detail\\` when the user is clearly an operator debugging the deployment (e.g. troubleshooting a broken Builder connection for the workspace), never as routine detail for an end user. If it returns mode \"app-id-taken\", the app id is already in use: \\`conflict\\` is \"registered\" for a live app or \"pending\" for a creation in flight, and \\`owner\\` names who started it. Relay the \\`message\\` and propose a different app id; never retry the same id.\n- For digests, reminders, or saved behavior, prefer recurring jobs, resources, or destinations over chat replies.\n- Keep responses concise and operational — messaging platforms have character limits.\n- Use markdown sparingly (bold and lists are fine, avoid complex formatting).\n- If a task requires many steps, summarize what you did rather than streaming every detail.`;\n\nconst dispatchIntegrationsPlugin = async (nitroApp: any) => {\n const { integrations = {} } = getDispatchConfig();\n const promptOverride = integrations.systemPrompt;\n const systemPrompt =\n typeof promptOverride === \"string\"\n ? promptOverride\n : typeof promptOverride === \"function\"\n ? promptOverride(DISPATCH_INTEGRATION_SYSTEM_PROMPT)\n : DISPATCH_INTEGRATION_SYSTEM_PROMPT;\n\n const plugin = createIntegrationsPlugin({\n appId: \"dispatch\",\n actions: dispatchIntegrationActions,\n resolveExecutionContext: resolveDispatchExecutionContext,\n beforeProcess: beforeDispatchProcess,\n systemPrompt,\n // Inherit the framework default (claude-sonnet-4-6 from\n // packages/core/src/integrations/plugin.ts). Haiku was tried for latency\n // but hallucinated URLs/IDs after delegated call-agent results\n // (e.g. inventing `https://slides.workspace.com/deck/builder-io-deck-2024`).\n });\n\n return plugin(nitroApp);\n};\n\nexport default dispatchIntegrationsPlugin;\n"]}
1
+ {"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../../src/server/plugins/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,qBAAqB,EACrB,+BAA+B,GAChC,MAAM,iCAAiC,CAAC;AAEzC,MAAM,0BAA0B,GAAG;IACjC,GAAG,eAAe;IAClB,OAAO,EAAE;QACP,GAAG,eAAe,CAAC,OAAO;QAC1B,SAAS,EAAE,KAAK;KACjB;CACF,CAAC;AAEF,MAAM,kCAAkC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4FAgCiD,CAAC;AAE7F,MAAM,0BAA0B,GAAG,KAAK,EAAE,QAAa,EAAE,EAAE;IACzD,MAAM,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAClD,MAAM,cAAc,GAAG,YAAY,CAAC,YAAY,CAAC;IACjD,MAAM,YAAY,GAChB,OAAO,cAAc,KAAK,QAAQ;QAChC,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,OAAO,cAAc,KAAK,UAAU;YACpC,CAAC,CAAC,cAAc,CAAC,kCAAkC,CAAC;YACpD,CAAC,CAAC,kCAAkC,CAAC;IAE3C,MAAM,MAAM,GAAG,wBAAwB,CAAC;QACtC,KAAK,EAAE,UAAU;QACjB,OAAO,EAAE,0BAA0B;QACnC,uBAAuB,EAAE,+BAA+B;QACxD,aAAa,EAAE,qBAAqB;QACpC,YAAY;QACZ,wDAAwD;QACxD,yEAAyE;QACzE,+DAA+D;QAC/D,6EAA6E;KAC9E,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,eAAe,0BAA0B,CAAC","sourcesContent":["import { createIntegrationsPlugin } from \"@agent-native/core/server\";\n\nimport { dispatchActions } from \"../../actions/index.js\";\nimport { getDispatchConfig } from \"../index.js\";\nimport {\n beforeDispatchProcess,\n resolveDispatchExecutionContext,\n} from \"../lib/dispatch-integrations.js\";\n\nconst dispatchIntegrationActions = {\n ...dispatchActions,\n ask_app: {\n ...dispatchActions.ask_app,\n agentTool: false,\n },\n};\n\nconst DISPATCH_INTEGRATION_SYSTEM_PROMPT = `You are the central dispatch for this workspace, responding via a messaging platform integration (Slack, Telegram, email, etc.).\n\nDefault posture:\n- Treat Slack, Telegram, and email as shared entrypoints into the workspace.\n- Heavily delegate domain work to specialized agents through A2A (call-agent) when another app owns the job.\n- Use relevant-apps prompt profiles first, then list-connected-agents when you need fresh details. If that context is absent or does not list the needed capability, search with describe-workspace-apps query=\"<capability>\" before assuming a request must be handled locally.\n- Hosted/connected A2A neighbors such as Analytics and Content come from the relevant-apps context or list-connected-agents. If neither identifies the needed capability, use describe-workspace-apps before concluding a connected agent is unavailable. list-workspace-apps only inventories apps mounted inside this workspace deployment; never use a missing row there to conclude that a connected agent is unavailable.\n- When asked whether a mounted workspace app exposes an agent card or A2A endpoint, call list-workspace-apps with includeAgentCards=true. Without that probe, missing agent-card fields mean unchecked, not unavailable.\n- Treat the apps in the relevant-apps context as existing neighbors available through links and A2A. Do not create wrapper apps, child apps, nested routes, or cloned template copies just to give a new app access to them; build only the genuinely new workflow and delegate cross-app work to those existing apps.\n- Integration grants are not provider capability limits. For ad hoc provider inspection, querying, reporting, or troubleshooting, call provider-api-catalog/provider-api-docs, then provider-api-request against the provider's real HTTP API. Use connectionId for a specific shared grant and accountId for a specific OAuth account. Never expose secret values or silently widen app access while doing this.\n- Keep durable memory and operating instructions in resources rather than ephemeral chat.\n- Reply in the originating thread unless the user explicitly asks you to send to a saved destination.\n\nWhen a user asks for something:\n- If it belongs to analytics, content, slides, clips, assets, etc., delegate via call-agent — do not re-implement the domain logic in dispatch.\n- Synthetic uptime, health-check, and URL-availability monitors belong to Analytics, even when the monitored target is another app such as Clips. Delegate creation to Analytics and relay its exact monitor URL. Dispatch-native recurring jobs are for reminders, digests, and agent workflows, not HTTP uptime probes.\n- Route by the requested artifact type, not by organization-specific names stored in code. For structured records, databases, tables, queues, boards, and intake forms, resolve the owning app and canonical destination from loaded workspace instructions/resources plus discovered app capabilities; do not assume Content, a database ID, schema, owner, or required fields. Visual designs, mockups, wireframes, screens, and interfaces belong to Design. A trusted Required target agent hint in integration context is authoritative.\n- When delegating structured intake to the resolved owning app, preserve the exact Source thread URL and the workspace instruction context, inspect the destination's current required fields, ask only for missing values, submit once, verify the saved record, and return the exact link.\n- In messaging integrations, use call-agent for cross-app delegation; do not use ask_app.\n- After call-agent returns an answer, RELAY IT DIRECTLY to the user with at most a one-line preface — do not rephrase, summarize, or add commentary. The downstream agent already crafted the answer; your job is delivery, not editing. This minimizes round-trips and keeps the user-visible reply fast.\n- Exception: if the downstream agent reports a missing model/provider credential, do not name exact env vars, Vault keys, tokens, or secrets. Say the target app needs an LLM connection and recommend using Builder/managed LLM for that app; keep bring-your-own provider keys as a secondary option only if the user asks.\n- If the user asks to create, build, make, scaffold, or generate an \"agent\" from Dispatch chat or by tagging @agent-native in Slack, email, or Telegram, first classify the ask. If it is a simple Dispatch-native behavior like a reminder, digest, monitor, routing rule, saved instruction, or recurring workflow, create or update the recurring job/resource/destination in Dispatch. If it is a robust unique product or teammate that needs its own UI, data model, actions, integrations, or domain workflow, treat it as a new workspace app and call start-workspace-app-creation.\n- If a user asks to rename an existing workspace app or change its Dispatch title/description, call update-workspace-app-metadata with the existing appId from list-workspace-apps. Do not call start-workspace-app-creation for a metadata-only edit because that starts a new app and Builder branch.\n- If a new-app prompt asks for access to Mail, Calendar, Analytics, Brain, Assets, or similar first-party app data/agents, keep using the existing app through A2A. Do not ask Builder to scaffold those apps as children of the new app unless the user explicitly asks for a customized app from that template.\n- If the chat template is used, treat it as scaffolding only: the finished app must be branded as the requested app with its own home screen/navigation/package metadata/manifest, and must not leave visible \"Chat\", \"Starter\", \"Blank app\", or \"New app\" UI behind.\n- If the user explicitly asks for a new app or workspace app, call start-workspace-app-creation with their prompt and include a concise generated description by default. Do not satisfy a new-app request by adding a route, page, component, or file inside apps/chat or another existing app unless the user explicitly asks to modify that existing app. When the prompt contains a source brief or concrete repeatable workflow, use the shared app quality workflow and do not ask non-blocking product or UX questions; ask only for authorization, credentials, a destructive action, an ambiguous target workspace, or a genuinely missing workflow. If the request is too vague to classify, ask one concise follow-up.\n- If app creation returns mode \"builder\", give the branch link and say registration is pending. For \"builder-managed\", give the workspace link and direct the user to New app with the same brief. For \"local-agent\", give the returned instructions to the local code agent. A workspace owner or admin configures the hosted project before ordinary members can start branches.\n- After creation, use list-workspace-apps to find the registered app. Verify the resolved URL, mount, and home through the workspace registry or preview gateway. Use the returned destination in replies. App-internal links use app-local routes with the framework basename. Keep the status pending until the destination serves the requested app.\n- If it returns mode \"builder-unavailable\", the action also returns a \\`reason\\` code plus a user-facing \\`message\\` and (for some reasons) an operator-facing \\`detail\\`. Relay the \\`message\\` to the user as-is; only surface \\`detail\\` when the user is clearly an operator debugging the deployment (e.g. troubleshooting a broken Builder connection for the workspace), never as routine detail for an end user. If it returns mode \"app-id-taken\", the app id is already in use: \\`conflict\\` is \"registered\" for a live app or \"pending\" for a creation in flight, and \\`owner\\` names who started it. Relay the \\`message\\` and propose a different app id; never retry the same id.\n- For digests, reminders, or saved behavior, prefer recurring jobs, resources, or destinations over chat replies.\n- Keep responses concise and operational — messaging platforms have character limits.\n- Use markdown sparingly (bold and lists are fine, avoid complex formatting).\n- If a task requires many steps, summarize what you did rather than streaming every detail.`;\n\nconst dispatchIntegrationsPlugin = async (nitroApp: any) => {\n const { integrations = {} } = getDispatchConfig();\n const promptOverride = integrations.systemPrompt;\n const systemPrompt =\n typeof promptOverride === \"string\"\n ? promptOverride\n : typeof promptOverride === \"function\"\n ? promptOverride(DISPATCH_INTEGRATION_SYSTEM_PROMPT)\n : DISPATCH_INTEGRATION_SYSTEM_PROMPT;\n\n const plugin = createIntegrationsPlugin({\n appId: \"dispatch\",\n actions: dispatchIntegrationActions,\n resolveExecutionContext: resolveDispatchExecutionContext,\n beforeProcess: beforeDispatchProcess,\n systemPrompt,\n // Inherit the framework default (claude-sonnet-4-6 from\n // packages/core/src/integrations/plugin.ts). Haiku was tried for latency\n // but hallucinated URLs/IDs after delegated call-agent results\n // (e.g. inventing `https://slides.workspace.com/deck/builder-io-deck-2024`).\n });\n\n return plugin(nitroApp);\n};\n\nexport default dispatchIntegrationsPlugin;\n"]}
@@ -1,2 +1,26 @@
1
1
  export declare const CHAT_FIRST_PANE_STATE_KEY = "chat-first-pane";
2
+ export declare const CHAT_FIRST_PANE_CONTEXT_STATE_KEY = "dispatch-pane-context";
3
+ export declare const CHAT_FIRST_PANE_BINDING_MAX_AGE_MS: number;
4
+ export declare function isDispatchChildBrowserTabId(value: unknown): value is string;
5
+ /** Core consumes this value when the newly linked child document starts. */
6
+ export declare const DISPATCH_CHILD_BROWSER_TAB_PARAM = "agentNativeTab";
7
+ export interface PersistedChatFirstPane {
8
+ appId: string;
9
+ placement?: "main" | "side";
10
+ path?: string;
11
+ view?: string;
12
+ }
13
+ export type PersistedChatFirstPaneState = {
14
+ status: "absent";
15
+ } | {
16
+ status: "restorable";
17
+ pane: PersistedChatFirstPane;
18
+ } | {
19
+ status: "unreadable";
20
+ };
21
+ /**
22
+ * Absent (never saved, or cleared) and unreadable (saved but malformed) are
23
+ * different outcomes: only the second should surface a failure to the user.
24
+ */
25
+ export declare function parsePersistedChatFirstPane(value: unknown): PersistedChatFirstPaneState;
2
26
  //# sourceMappingURL=chat-first-pane.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-first-pane.d.ts","sourceRoot":"","sources":["../../src/shared/chat-first-pane.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,oBAAoB,CAAC"}
1
+ {"version":3,"file":"chat-first-pane.d.ts","sourceRoot":"","sources":["../../src/shared/chat-first-pane.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,oBAAoB,CAAC;AAE3D,eAAO,MAAM,iCAAiC,0BAA0B,CAAC;AACzE,eAAO,MAAM,kCAAkC,QAAc,CAAC;AAE9D,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAO3E;AAED,4EAA4E;AAC5E,eAAO,MAAM,gCAAgC,mBAAmB,CAAC;AAEjE,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,2BAA2B,GACnC;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,GACpB;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,sBAAsB,CAAA;CAAE,GACtD;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,CAAC;AAE7B;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,GACb,2BAA2B,CAoB7B"}
@@ -1,2 +1,36 @@
1
1
  export const CHAT_FIRST_PANE_STATE_KEY = "chat-first-pane";
2
+ export const CHAT_FIRST_PANE_CONTEXT_STATE_KEY = "dispatch-pane-context";
3
+ export const CHAT_FIRST_PANE_BINDING_MAX_AGE_MS = 30 * 60_000;
4
+ export function isDispatchChildBrowserTabId(value) {
5
+ return (typeof value === "string" &&
6
+ /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value));
7
+ }
8
+ /** Core consumes this value when the newly linked child document starts. */
9
+ export const DISPATCH_CHILD_BROWSER_TAB_PARAM = "agentNativeTab";
10
+ /**
11
+ * Absent (never saved, or cleared) and unreadable (saved but malformed) are
12
+ * different outcomes: only the second should surface a failure to the user.
13
+ */
14
+ export function parsePersistedChatFirstPane(value) {
15
+ if (value === null || value === undefined)
16
+ return { status: "absent" };
17
+ if (typeof value !== "object" || Array.isArray(value)) {
18
+ return { status: "unreadable" };
19
+ }
20
+ const record = value;
21
+ if (typeof record.appId !== "string" || !record.appId.trim()) {
22
+ return { status: "unreadable" };
23
+ }
24
+ return {
25
+ status: "restorable",
26
+ pane: {
27
+ appId: record.appId,
28
+ ...(record.placement === "main" || record.placement === "side"
29
+ ? { placement: record.placement }
30
+ : {}),
31
+ ...(typeof record.path === "string" ? { path: record.path } : {}),
32
+ ...(typeof record.view === "string" ? { view: record.view } : {}),
33
+ },
34
+ };
35
+ }
2
36
  //# sourceMappingURL=chat-first-pane.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-first-pane.js","sourceRoot":"","sources":["../../src/shared/chat-first-pane.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG,iBAAiB,CAAC","sourcesContent":["export const CHAT_FIRST_PANE_STATE_KEY = \"chat-first-pane\";\n"]}
1
+ {"version":3,"file":"chat-first-pane.js","sourceRoot":"","sources":["../../src/shared/chat-first-pane.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;AAE3D,MAAM,CAAC,MAAM,iCAAiC,GAAG,uBAAuB,CAAC;AACzE,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,GAAG,MAAM,CAAC;AAE9D,MAAM,UAAU,2BAA2B,CAAC,KAAc;IACxD,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,wEAAwE,CAAC,IAAI,CAC3E,KAAK,CACN,CACF,CAAC;AACJ,CAAC;AAED,4EAA4E;AAC5E,MAAM,CAAC,MAAM,gCAAgC,GAAG,gBAAgB,CAAC;AAcjE;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CACzC,KAAc;IAEd,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IACvE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACtD,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;IAClC,CAAC;IACD,MAAM,MAAM,GAAG,KAAgC,CAAC;IAChD,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;QAC7D,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;IAClC,CAAC;IACD,OAAO;QACL,MAAM,EAAE,YAAY;QACpB,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,GAAG,CAAC,MAAM,CAAC,SAAS,KAAK,MAAM,IAAI,MAAM,CAAC,SAAS,KAAK,MAAM;gBAC5D,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE;gBACjC,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,CAAC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACjE,GAAG,CAAC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClE;KACF,CAAC;AACJ,CAAC","sourcesContent":["export const CHAT_FIRST_PANE_STATE_KEY = \"chat-first-pane\";\n\nexport const CHAT_FIRST_PANE_CONTEXT_STATE_KEY = \"dispatch-pane-context\";\nexport const CHAT_FIRST_PANE_BINDING_MAX_AGE_MS = 30 * 60_000;\n\nexport function isDispatchChildBrowserTabId(value: unknown): value is string {\n return (\n typeof value === \"string\" &&\n /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(\n value,\n )\n );\n}\n\n/** Core consumes this value when the newly linked child document starts. */\nexport const DISPATCH_CHILD_BROWSER_TAB_PARAM = \"agentNativeTab\";\n\nexport interface PersistedChatFirstPane {\n appId: string;\n placement?: \"main\" | \"side\";\n path?: string;\n view?: string;\n}\n\nexport type PersistedChatFirstPaneState =\n | { status: \"absent\" }\n | { status: \"restorable\"; pane: PersistedChatFirstPane }\n | { status: \"unreadable\" };\n\n/**\n * Absent (never saved, or cleared) and unreadable (saved but malformed) are\n * different outcomes: only the second should surface a failure to the user.\n */\nexport function parsePersistedChatFirstPane(\n value: unknown,\n): PersistedChatFirstPaneState {\n if (value === null || value === undefined) return { status: \"absent\" };\n if (typeof value !== \"object\" || Array.isArray(value)) {\n return { status: \"unreadable\" };\n }\n const record = value as Record<string, unknown>;\n if (typeof record.appId !== \"string\" || !record.appId.trim()) {\n return { status: \"unreadable\" };\n }\n return {\n status: \"restorable\",\n pane: {\n appId: record.appId,\n ...(record.placement === \"main\" || record.placement === \"side\"\n ? { placement: record.placement }\n : {}),\n ...(typeof record.path === \"string\" ? { path: record.path } : {}),\n ...(typeof record.view === \"string\" ? { view: record.view } : {}),\n },\n };\n}\n"]}
@@ -1,2 +1,3 @@
1
1
  export declare const COMMUNITY_APPS_LAB: import("@agent-native/core/labs/registry").LabDefinition;
2
+ export declare const GOOGLE_BROKER_LAB: import("@agent-native/core/labs/registry").LabDefinition;
2
3
  //# sourceMappingURL=labs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"labs.d.ts","sourceRoot":"","sources":["../../src/shared/labs.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,0DAM7B,CAAC"}
1
+ {"version":3,"file":"labs.d.ts","sourceRoot":"","sources":["../../src/shared/labs.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,0DAM7B,CAAC;AAEH,eAAO,MAAM,iBAAiB,0DAM5B,CAAC"}
@@ -5,4 +5,11 @@ export const COMMUNITY_APPS_LAB = defineLab({
5
5
  description: "Connect trusted remote agents and install reviewed, pinned community app templates.",
6
6
  keywords: "community apps templates connect install",
7
7
  });
8
+ export const GOOGLE_BROKER_LAB = defineLab({
9
+ key: "dispatch.google-broker",
10
+ defaultEnabled: false,
11
+ displayName: "Cross-app Google access",
12
+ displayNameKey: "agentChat.settingsShell.appGroup.googleBroker",
13
+ descriptionKey: "agentChat.settingsShell.appGroup.googleBrokerDescription",
14
+ });
8
15
  //# sourceMappingURL=labs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"labs.js","sourceRoot":"","sources":["../../src/shared/labs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;IAC1C,GAAG,EAAE,yBAAyB;IAC9B,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EACT,qFAAqF;IACvF,QAAQ,EAAE,0CAA0C;CACrD,CAAC,CAAC","sourcesContent":["import { defineLab } from \"@agent-native/core/labs/registry\";\n\nexport const COMMUNITY_APPS_LAB = defineLab({\n key: \"dispatch.community-apps\",\n displayName: \"Community apps\",\n description:\n \"Connect trusted remote agents and install reviewed, pinned community app templates.\",\n keywords: \"community apps templates connect install\",\n});\n"]}
1
+ {"version":3,"file":"labs.js","sourceRoot":"","sources":["../../src/shared/labs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;IAC1C,GAAG,EAAE,yBAAyB;IAC9B,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EACT,qFAAqF;IACvF,QAAQ,EAAE,0CAA0C;CACrD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAC;IACzC,GAAG,EAAE,wBAAwB;IAC7B,cAAc,EAAE,KAAK;IACrB,WAAW,EAAE,yBAAyB;IACtC,cAAc,EAAE,+CAA+C;IAC/D,cAAc,EAAE,0DAA0D;CAC3E,CAAC,CAAC","sourcesContent":["import { defineLab } from \"@agent-native/core/labs/registry\";\n\nexport const COMMUNITY_APPS_LAB = defineLab({\n key: \"dispatch.community-apps\",\n displayName: \"Community apps\",\n description:\n \"Connect trusted remote agents and install reviewed, pinned community app templates.\",\n keywords: \"community apps templates connect install\",\n});\n\nexport const GOOGLE_BROKER_LAB = defineLab({\n key: \"dispatch.google-broker\",\n defaultEnabled: false,\n displayName: \"Cross-app Google access\",\n displayNameKey: \"agentChat.settingsShell.appGroup.googleBroker\",\n descriptionKey: \"agentChat.settingsShell.appGroup.googleBrokerDescription\",\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/dispatch",
3
- "version": "0.43.0-nightly-20261120212328",
3
+ "version": "0.43.7",
4
4
  "description": "Dispatch — workspace control plane for agent-native apps. Vault, integrations, destinations, scheduled jobs, and cross-app delegation, shipped as a single drop-in package.",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {
@@ -90,7 +90,8 @@
90
90
  "tailwind-merge": "^3.5.0",
91
91
  "vaul": "^1.1.2",
92
92
  "zod": "^4.3.6",
93
- "@agent-native/toolkit": "0.232.0-nightly-20261120212328"
93
+ "@agent-native/toolkit": "0.237.1",
94
+ "@agent-native/agentkit": "0.237.1"
94
95
  },
95
96
  "devDependencies": {
96
97
  "@react-router/dev": "^8.1.0",
@@ -103,11 +104,11 @@
103
104
  "tsc-alias": "^1.8.10",
104
105
  "typescript-7": "npm:typescript@^7.0.2",
105
106
  "vite": "8.3.8",
106
- "vitest": "^4.1.5",
107
- "@agent-native/core": "0.232.0-nightly-20261120212328"
107
+ "vitest": "^5.1.2",
108
+ "@agent-native/core": "0.237.1"
108
109
  },
109
110
  "peerDependencies": {
110
- "@agent-native/core": "0.232.0-nightly-20261120212328",
111
+ "@agent-native/core": ">=0.237.1-0",
111
112
  "react": ">=19.2.7",
112
113
  "react-dom": ">=19.2.7",
113
114
  "react-router": ">=8"
@@ -115,7 +116,7 @@
115
116
  "scripts": {
116
117
  "build": "tsc && tsc-alias --resolve-full-paths",
117
118
  "dev": "tsc --watch & tsc-alias --watch --resolve-full-paths",
118
- "typecheck": "tsc --noEmit",
119
+ "typecheck": "tsgo --noEmit",
119
120
  "test": "vitest --run src --passWithNoTests"
120
121
  }
121
122
  }