@agent-native/dispatch 0.6.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/README.md +38 -1
  2. package/dist/actions/apply-dream-proposal.d.ts +3 -0
  3. package/dist/actions/apply-dream-proposal.d.ts.map +1 -0
  4. package/dist/actions/apply-dream-proposal.js +11 -0
  5. package/dist/actions/apply-dream-proposal.js.map +1 -0
  6. package/dist/actions/create-dream-report.d.ts +3 -0
  7. package/dist/actions/create-dream-report.d.ts.map +1 -0
  8. package/dist/actions/create-dream-report.js +67 -0
  9. package/dist/actions/create-dream-report.js.map +1 -0
  10. package/dist/actions/create-pylon-ticket.d.ts +3 -0
  11. package/dist/actions/create-pylon-ticket.d.ts.map +1 -0
  12. package/dist/actions/create-pylon-ticket.js +94 -0
  13. package/dist/actions/create-pylon-ticket.js.map +1 -0
  14. package/dist/actions/create-vault-grant.js +1 -1
  15. package/dist/actions/create-vault-grant.js.map +1 -1
  16. package/dist/actions/create-vault-secret.d.ts.map +1 -1
  17. package/dist/actions/create-vault-secret.js +4 -3
  18. package/dist/actions/create-vault-secret.js.map +1 -1
  19. package/dist/actions/create-workspace-resource.js +3 -3
  20. package/dist/actions/create-workspace-resource.js.map +1 -1
  21. package/dist/actions/delete-workspace-resource.js +1 -1
  22. package/dist/actions/delete-workspace-resource.js.map +1 -1
  23. package/dist/actions/ensure-dream-job.d.ts +3 -0
  24. package/dist/actions/ensure-dream-job.d.ts.map +1 -0
  25. package/dist/actions/ensure-dream-job.js +73 -0
  26. package/dist/actions/ensure-dream-job.js.map +1 -0
  27. package/dist/actions/get-dream-settings.d.ts +3 -0
  28. package/dist/actions/get-dream-settings.d.ts.map +1 -0
  29. package/dist/actions/get-dream-settings.js +11 -0
  30. package/dist/actions/get-dream-settings.js.map +1 -0
  31. package/dist/actions/get-dream.d.ts +3 -0
  32. package/dist/actions/get-dream.d.ts.map +1 -0
  33. package/dist/actions/get-dream.js +13 -0
  34. package/dist/actions/get-dream.js.map +1 -0
  35. package/dist/actions/get-vault-access-settings.d.ts +3 -0
  36. package/dist/actions/get-vault-access-settings.d.ts.map +1 -0
  37. package/dist/actions/get-vault-access-settings.js +10 -0
  38. package/dist/actions/get-vault-access-settings.js.map +1 -0
  39. package/dist/actions/get-workspace-resource-effective-context.d.ts +3 -0
  40. package/dist/actions/get-workspace-resource-effective-context.d.ts.map +1 -0
  41. package/dist/actions/get-workspace-resource-effective-context.js +27 -0
  42. package/dist/actions/get-workspace-resource-effective-context.js.map +1 -0
  43. package/dist/actions/grant-vault-secrets-to-app.js +1 -1
  44. package/dist/actions/grant-vault-secrets-to-app.js.map +1 -1
  45. package/dist/actions/index.d.ts.map +1 -1
  46. package/dist/actions/index.js +38 -4
  47. package/dist/actions/index.js.map +1 -1
  48. package/dist/actions/list-dream-candidates.d.ts +3 -0
  49. package/dist/actions/list-dream-candidates.d.ts.map +1 -0
  50. package/dist/actions/list-dream-candidates.js +68 -0
  51. package/dist/actions/list-dream-candidates.js.map +1 -0
  52. package/dist/actions/list-dreams.d.ts +3 -0
  53. package/dist/actions/list-dreams.d.ts.map +1 -0
  54. package/dist/actions/list-dreams.js +17 -0
  55. package/dist/actions/list-dreams.js.map +1 -0
  56. package/dist/actions/list-integrations-catalog.js +1 -1
  57. package/dist/actions/list-integrations-catalog.js.map +1 -1
  58. package/dist/actions/list-vault-grants.js +1 -1
  59. package/dist/actions/list-vault-grants.js.map +1 -1
  60. package/dist/actions/list-workspace-apps.d.ts.map +1 -1
  61. package/dist/actions/list-workspace-apps.js +5 -1
  62. package/dist/actions/list-workspace-apps.js.map +1 -1
  63. package/dist/actions/list-workspace-resources-for-app.d.ts +3 -0
  64. package/dist/actions/list-workspace-resources-for-app.d.ts.map +1 -0
  65. package/dist/actions/list-workspace-resources-for-app.js +12 -0
  66. package/dist/actions/list-workspace-resources-for-app.js.map +1 -0
  67. package/dist/actions/list-workspace-resources.js +1 -1
  68. package/dist/actions/list-workspace-resources.js.map +1 -1
  69. package/dist/actions/navigate.d.ts +1 -0
  70. package/dist/actions/navigate.d.ts.map +1 -1
  71. package/dist/actions/navigate.js +2 -1
  72. package/dist/actions/navigate.js.map +1 -1
  73. package/dist/actions/preview-dream-proposal.d.ts +3 -0
  74. package/dist/actions/preview-dream-proposal.d.ts.map +1 -0
  75. package/dist/actions/preview-dream-proposal.js +13 -0
  76. package/dist/actions/preview-dream-proposal.js.map +1 -0
  77. package/dist/actions/preview-workspace-resource-change.d.ts +3 -0
  78. package/dist/actions/preview-workspace-resource-change.d.ts.map +1 -0
  79. package/dist/actions/preview-workspace-resource-change.js +24 -0
  80. package/dist/actions/preview-workspace-resource-change.js.map +1 -0
  81. package/dist/actions/reject-dream-proposal.d.ts +3 -0
  82. package/dist/actions/reject-dream-proposal.d.ts.map +1 -0
  83. package/dist/actions/reject-dream-proposal.js +12 -0
  84. package/dist/actions/reject-dream-proposal.js.map +1 -0
  85. package/dist/actions/restore-starter-workspace-resources.d.ts +3 -0
  86. package/dist/actions/restore-starter-workspace-resources.d.ts.map +1 -0
  87. package/dist/actions/restore-starter-workspace-resources.js +14 -0
  88. package/dist/actions/restore-starter-workspace-resources.js.map +1 -0
  89. package/dist/actions/send-code-agent-remote-command.d.ts +3 -0
  90. package/dist/actions/send-code-agent-remote-command.d.ts.map +1 -0
  91. package/dist/actions/send-code-agent-remote-command.js +53 -0
  92. package/dist/actions/send-code-agent-remote-command.js.map +1 -0
  93. package/dist/actions/set-dream-settings.d.ts +3 -0
  94. package/dist/actions/set-dream-settings.d.ts.map +1 -0
  95. package/dist/actions/set-dream-settings.js +41 -0
  96. package/dist/actions/set-dream-settings.js.map +1 -0
  97. package/dist/actions/set-vault-access-settings.d.ts +3 -0
  98. package/dist/actions/set-vault-access-settings.d.ts.map +1 -0
  99. package/dist/actions/set-vault-access-settings.js +13 -0
  100. package/dist/actions/set-vault-access-settings.js.map +1 -0
  101. package/dist/actions/start-workspace-app-creation.d.ts.map +1 -1
  102. package/dist/actions/start-workspace-app-creation.js +6 -0
  103. package/dist/actions/start-workspace-app-creation.js.map +1 -1
  104. package/dist/actions/sync-vault-to-app.js +1 -1
  105. package/dist/actions/sync-vault-to-app.js.map +1 -1
  106. package/dist/actions/update-workspace-app-metadata.d.ts +3 -0
  107. package/dist/actions/update-workspace-app-metadata.d.ts.map +1 -0
  108. package/dist/actions/update-workspace-app-metadata.js +30 -0
  109. package/dist/actions/update-workspace-app-metadata.js.map +1 -0
  110. package/dist/actions/update-workspace-resource.js +1 -1
  111. package/dist/actions/update-workspace-resource.js.map +1 -1
  112. package/dist/actions/view-screen.d.ts.map +1 -1
  113. package/dist/actions/view-screen.js +77 -4
  114. package/dist/actions/view-screen.js.map +1 -1
  115. package/dist/components/app-keys-popover.js +16 -5
  116. package/dist/components/app-keys-popover.js.map +1 -1
  117. package/dist/components/approval-value-block.d.ts +7 -0
  118. package/dist/components/approval-value-block.d.ts.map +1 -0
  119. package/dist/components/approval-value-block.js +22 -0
  120. package/dist/components/approval-value-block.js.map +1 -0
  121. package/dist/components/create-app-popover.d.ts.map +1 -1
  122. package/dist/components/create-app-popover.js +41 -16
  123. package/dist/components/create-app-popover.js.map +1 -1
  124. package/dist/components/dispatch-shell.d.ts +4 -4
  125. package/dist/components/dispatch-shell.d.ts.map +1 -1
  126. package/dist/components/dispatch-shell.js +6 -6
  127. package/dist/components/dispatch-shell.js.map +1 -1
  128. package/dist/components/layout/Layout.d.ts.map +1 -1
  129. package/dist/components/layout/Layout.js +18 -4
  130. package/dist/components/layout/Layout.js.map +1 -1
  131. package/dist/components/messaging-setup-panel.d.ts.map +1 -1
  132. package/dist/components/messaging-setup-panel.js +2 -2
  133. package/dist/components/messaging-setup-panel.js.map +1 -1
  134. package/dist/components/ui/chart.d.ts +1 -1
  135. package/dist/components/workspace-app-card.d.ts.map +1 -1
  136. package/dist/components/workspace-app-card.js +63 -3
  137. package/dist/components/workspace-app-card.js.map +1 -1
  138. package/dist/components/workspace-resource-effective-stack.d.ts +11 -0
  139. package/dist/components/workspace-resource-effective-stack.d.ts.map +1 -0
  140. package/dist/components/workspace-resource-effective-stack.js +59 -0
  141. package/dist/components/workspace-resource-effective-stack.js.map +1 -0
  142. package/dist/components/workspace-resource-impact-preview.d.ts +9 -0
  143. package/dist/components/workspace-resource-impact-preview.d.ts.map +1 -0
  144. package/dist/components/workspace-resource-impact-preview.js +39 -0
  145. package/dist/components/workspace-resource-impact-preview.js.map +1 -0
  146. package/dist/db/migrations.d.ts.map +1 -1
  147. package/dist/db/migrations.js +59 -0
  148. package/dist/db/migrations.js.map +1 -1
  149. package/dist/db/schema.d.ts +714 -0
  150. package/dist/db/schema.d.ts.map +1 -1
  151. package/dist/db/schema.js +44 -2
  152. package/dist/db/schema.js.map +1 -1
  153. package/dist/hooks/use-navigation-state.d.ts +3 -0
  154. package/dist/hooks/use-navigation-state.d.ts.map +1 -1
  155. package/dist/hooks/use-navigation-state.js +35 -8
  156. package/dist/hooks/use-navigation-state.js.map +1 -1
  157. package/dist/lib/catch-all-target.d.ts +2 -0
  158. package/dist/lib/catch-all-target.d.ts.map +1 -0
  159. package/dist/lib/catch-all-target.js +95 -0
  160. package/dist/lib/catch-all-target.js.map +1 -0
  161. package/dist/lib/utils.d.ts +2 -1
  162. package/dist/lib/utils.d.ts.map +1 -1
  163. package/dist/lib/utils.js +5 -1
  164. package/dist/lib/utils.js.map +1 -1
  165. package/dist/lib/workspace-apps.d.ts +9 -0
  166. package/dist/lib/workspace-apps.d.ts.map +1 -1
  167. package/dist/lib/workspace-apps.js.map +1 -1
  168. package/dist/routes/index.d.ts.map +1 -1
  169. package/dist/routes/index.js +1 -0
  170. package/dist/routes/index.js.map +1 -1
  171. package/dist/routes/pages/$appId.d.ts +2 -2
  172. package/dist/routes/pages/$appId.d.ts.map +1 -1
  173. package/dist/routes/pages/$appId.js +17 -8
  174. package/dist/routes/pages/$appId.js.map +1 -1
  175. package/dist/routes/pages/approval.d.ts.map +1 -1
  176. package/dist/routes/pages/approval.js +4 -1
  177. package/dist/routes/pages/approval.js.map +1 -1
  178. package/dist/routes/pages/approvals.js +1 -1
  179. package/dist/routes/pages/approvals.js.map +1 -1
  180. package/dist/routes/pages/dream-settings.d.ts +34 -0
  181. package/dist/routes/pages/dream-settings.d.ts.map +1 -0
  182. package/dist/routes/pages/dream-settings.js +68 -0
  183. package/dist/routes/pages/dream-settings.js.map +1 -0
  184. package/dist/routes/pages/dreams.d.ts +5 -0
  185. package/dist/routes/pages/dreams.d.ts.map +1 -0
  186. package/dist/routes/pages/dreams.js +435 -0
  187. package/dist/routes/pages/dreams.js.map +1 -0
  188. package/dist/routes/pages/integrations.d.ts.map +1 -1
  189. package/dist/routes/pages/integrations.js +20 -15
  190. package/dist/routes/pages/integrations.js.map +1 -1
  191. package/dist/routes/pages/new-app.js +1 -1
  192. package/dist/routes/pages/new-app.js.map +1 -1
  193. package/dist/routes/pages/overview.d.ts.map +1 -1
  194. package/dist/routes/pages/overview.js +5 -1
  195. package/dist/routes/pages/overview.js.map +1 -1
  196. package/dist/routes/pages/vault.d.ts.map +1 -1
  197. package/dist/routes/pages/vault.js +23 -5
  198. package/dist/routes/pages/vault.js.map +1 -1
  199. package/dist/routes/pages/workspace.d.ts.map +1 -1
  200. package/dist/routes/pages/workspace.js +187 -35
  201. package/dist/routes/pages/workspace.js.map +1 -1
  202. package/dist/server/lib/app-creation-store.d.ts +13 -0
  203. package/dist/server/lib/app-creation-store.d.ts.map +1 -1
  204. package/dist/server/lib/app-creation-store.js +298 -11
  205. package/dist/server/lib/app-creation-store.js.map +1 -1
  206. package/dist/server/lib/dispatch-integrations.d.ts +1 -1
  207. package/dist/server/lib/dispatch-integrations.d.ts.map +1 -1
  208. package/dist/server/lib/dispatch-integrations.js +9 -4
  209. package/dist/server/lib/dispatch-integrations.js.map +1 -1
  210. package/dist/server/lib/dispatch-remote-commands.d.ts +83 -0
  211. package/dist/server/lib/dispatch-remote-commands.d.ts.map +1 -0
  212. package/dist/server/lib/dispatch-remote-commands.js +256 -0
  213. package/dist/server/lib/dispatch-remote-commands.js.map +1 -0
  214. package/dist/server/lib/dispatch-store.d.ts +26 -0
  215. package/dist/server/lib/dispatch-store.d.ts.map +1 -1
  216. package/dist/server/lib/dispatch-store.js +17 -1
  217. package/dist/server/lib/dispatch-store.js.map +1 -1
  218. package/dist/server/lib/dreams-store.d.ts +398 -0
  219. package/dist/server/lib/dreams-store.d.ts.map +1 -0
  220. package/dist/server/lib/dreams-store.js +2330 -0
  221. package/dist/server/lib/dreams-store.js.map +1 -0
  222. package/dist/server/lib/env-config.d.ts.map +1 -1
  223. package/dist/server/lib/env-config.js +5 -0
  224. package/dist/server/lib/env-config.js.map +1 -1
  225. package/dist/server/lib/onboarding-steps.d.ts +12 -0
  226. package/dist/server/lib/onboarding-steps.d.ts.map +1 -0
  227. package/dist/server/lib/onboarding-steps.js +47 -0
  228. package/dist/server/lib/onboarding-steps.js.map +1 -0
  229. package/dist/server/lib/thread-debug-store.d.ts +2 -2
  230. package/dist/server/lib/vault-store.d.ts +55 -0
  231. package/dist/server/lib/vault-store.d.ts.map +1 -1
  232. package/dist/server/lib/vault-store.js +210 -41
  233. package/dist/server/lib/vault-store.js.map +1 -1
  234. package/dist/server/lib/workspace-resources-store.d.ts +181 -17
  235. package/dist/server/lib/workspace-resources-store.d.ts.map +1 -1
  236. package/dist/server/lib/workspace-resources-store.js +737 -108
  237. package/dist/server/lib/workspace-resources-store.js.map +1 -1
  238. package/dist/server/plugins/agent-chat.d.ts.map +1 -1
  239. package/dist/server/plugins/agent-chat.js +2 -1
  240. package/dist/server/plugins/agent-chat.js.map +1 -1
  241. package/dist/server/plugins/core-routes.d.ts.map +1 -1
  242. package/dist/server/plugins/core-routes.js +4 -0
  243. package/dist/server/plugins/core-routes.js.map +1 -1
  244. package/dist/server/plugins/integrations.js +2 -2
  245. package/dist/server/plugins/integrations.js.map +1 -1
  246. package/package.json +15 -11
  247. package/src/actions/apply-dream-proposal.ts +12 -0
  248. package/src/actions/create-dream-report.ts +76 -0
  249. package/src/actions/create-pylon-ticket.ts +109 -0
  250. package/src/actions/create-vault-grant.ts +1 -1
  251. package/src/actions/create-vault-secret.ts +4 -3
  252. package/src/actions/create-workspace-resource.ts +3 -3
  253. package/src/actions/delete-workspace-resource.ts +1 -1
  254. package/src/actions/ensure-dream-job.ts +76 -0
  255. package/src/actions/get-dream-settings.ts +12 -0
  256. package/src/actions/get-dream.ts +14 -0
  257. package/src/actions/get-vault-access-settings.ts +11 -0
  258. package/src/actions/get-workspace-resource-effective-context.ts +34 -0
  259. package/src/actions/grant-vault-secrets-to-app.ts +1 -1
  260. package/src/actions/index.spec.ts +26 -0
  261. package/src/actions/index.ts +39 -4
  262. package/src/actions/list-dream-candidates.ts +77 -0
  263. package/src/actions/list-dreams.ts +17 -0
  264. package/src/actions/list-integrations-catalog.ts +1 -1
  265. package/src/actions/list-vault-grants.ts +1 -1
  266. package/src/actions/list-workspace-apps.ts +5 -1
  267. package/src/actions/list-workspace-resources-for-app.ts +13 -0
  268. package/src/actions/list-workspace-resources.ts +1 -1
  269. package/src/actions/navigate.ts +2 -1
  270. package/src/actions/preview-dream-proposal.ts +14 -0
  271. package/src/actions/preview-workspace-resource-change.ts +25 -0
  272. package/src/actions/reject-dream-proposal.ts +12 -0
  273. package/src/actions/restore-starter-workspace-resources.ts +17 -0
  274. package/src/actions/send-code-agent-remote-command.ts +59 -0
  275. package/src/actions/set-dream-settings.spec.ts +81 -0
  276. package/src/actions/set-dream-settings.ts +44 -0
  277. package/src/actions/set-vault-access-settings.ts +16 -0
  278. package/src/actions/start-workspace-app-creation.ts +8 -0
  279. package/src/actions/sync-vault-to-app.ts +1 -1
  280. package/src/actions/update-workspace-app-metadata.ts +32 -0
  281. package/src/actions/update-workspace-resource.ts +1 -1
  282. package/src/actions/view-screen.ts +94 -3
  283. package/src/components/app-keys-popover.tsx +23 -7
  284. package/src/components/approval-value-block.spec.tsx +59 -0
  285. package/src/components/approval-value-block.tsx +33 -0
  286. package/src/components/create-app-popover.tsx +50 -16
  287. package/src/components/dispatch-shell.tsx +16 -15
  288. package/src/components/layout/Layout.tsx +19 -5
  289. package/src/components/messaging-setup-panel.tsx +54 -39
  290. package/src/components/workspace-app-card.tsx +268 -1
  291. package/src/components/workspace-resource-effective-stack.spec.tsx +125 -0
  292. package/src/components/workspace-resource-effective-stack.tsx +141 -0
  293. package/src/components/workspace-resource-impact-preview.spec.tsx +147 -0
  294. package/src/components/workspace-resource-impact-preview.tsx +116 -0
  295. package/src/db/migrations.ts +59 -0
  296. package/src/db/schema.ts +46 -2
  297. package/src/hooks/use-navigation-state.ts +34 -9
  298. package/src/lib/catch-all-target.spec.ts +218 -0
  299. package/src/lib/catch-all-target.ts +99 -0
  300. package/src/lib/utils.ts +6 -1
  301. package/src/lib/workspace-apps.ts +9 -0
  302. package/src/routes/index.ts +1 -0
  303. package/src/routes/pages/$appId.tsx +21 -8
  304. package/src/routes/pages/approval.tsx +14 -1
  305. package/src/routes/pages/approvals.tsx +1 -1
  306. package/src/routes/pages/dream-settings.spec.ts +130 -0
  307. package/src/routes/pages/dream-settings.ts +103 -0
  308. package/src/routes/pages/dreams.tsx +1828 -0
  309. package/src/routes/pages/integrations.tsx +57 -18
  310. package/src/routes/pages/new-app.tsx +1 -1
  311. package/src/routes/pages/overview.tsx +11 -3
  312. package/src/routes/pages/vault.tsx +76 -9
  313. package/src/routes/pages/workspace.tsx +577 -97
  314. package/src/server/lib/app-creation-store.spec.ts +61 -2
  315. package/src/server/lib/app-creation-store.ts +389 -13
  316. package/src/server/lib/dispatch-integrations.ts +10 -3
  317. package/src/server/lib/dispatch-remote-commands.spec.ts +167 -0
  318. package/src/server/lib/dispatch-remote-commands.ts +375 -0
  319. package/src/server/lib/dispatch-store.ts +37 -1
  320. package/src/server/lib/dreams-store.spec.ts +1492 -0
  321. package/src/server/lib/dreams-store.ts +3168 -0
  322. package/src/server/lib/env-config.ts +5 -0
  323. package/src/server/lib/onboarding-steps.ts +49 -0
  324. package/src/server/lib/vault-store.spec.ts +69 -0
  325. package/src/server/lib/vault-store.ts +266 -49
  326. package/src/server/lib/workspace-resource-approval-lifecycle.spec.ts +236 -0
  327. package/src/server/lib/workspace-resources-store.spec.ts +1106 -0
  328. package/src/server/lib/workspace-resources-store.ts +1001 -134
  329. package/src/server/plugins/agent-chat.ts +2 -1
  330. package/src/server/plugins/core-routes.ts +5 -0
  331. package/src/server/plugins/integrations.ts +2 -2
  332. package/dist/actions/sync-workspace-resources-to-all.d.ts +0 -3
  333. package/dist/actions/sync-workspace-resources-to-all.d.ts.map +0 -1
  334. package/dist/actions/sync-workspace-resources-to-all.js +0 -9
  335. package/dist/actions/sync-workspace-resources-to-all.js.map +0 -1
  336. package/dist/actions/sync-workspace-resources-to-app.d.ts +0 -3
  337. package/dist/actions/sync-workspace-resources-to-app.d.ts.map +0 -1
  338. package/dist/actions/sync-workspace-resources-to-app.js +0 -11
  339. package/dist/actions/sync-workspace-resources-to-app.js.map +0 -1
  340. package/src/actions/sync-workspace-resources-to-all.ts +0 -10
  341. package/src/actions/sync-workspace-resources-to-app.ts +0 -12
@@ -0,0 +1,33 @@
1
+ export function parseApprovalValue(value: string | null | undefined): unknown {
2
+ if (!value) return null;
3
+ try {
4
+ return JSON.parse(value);
5
+ } catch {
6
+ return value;
7
+ }
8
+ }
9
+
10
+ export function approvalValuePreview(value: unknown): string {
11
+ if (value === null || value === undefined) return "None";
12
+ if (typeof value === "string") return value;
13
+ return JSON.stringify(value, null, 2);
14
+ }
15
+
16
+ export function ApprovalValueBlock({
17
+ label,
18
+ value,
19
+ }: {
20
+ label: string;
21
+ value: unknown;
22
+ }) {
23
+ return (
24
+ <div className="space-y-1.5">
25
+ <div className="text-[11px] font-medium uppercase text-muted-foreground">
26
+ {label}
27
+ </div>
28
+ <pre className="max-h-40 overflow-auto rounded-lg border bg-background p-2 text-[11px] leading-relaxed text-foreground">
29
+ {approvalValuePreview(value)}
30
+ </pre>
31
+ </div>
32
+ );
33
+ }
@@ -44,6 +44,8 @@ interface WorkspaceResourceOption {
44
44
  updatedAt?: number;
45
45
  }
46
46
 
47
+ type VaultAccessMode = "all-apps" | "manual";
48
+
47
49
  interface CreateAppPopoverProps {
48
50
  /**
49
51
  * Custom trigger element. Defaults to a dashed-border tile that matches the
@@ -78,11 +80,15 @@ function buildAppCreationPrompt(input: {
78
80
  prompt: string;
79
81
  selectedKeys: string[];
80
82
  selectedResources: WorkspaceResourceOption[];
83
+ vaultAccessMode: VaultAccessMode;
81
84
  }): string {
82
85
  const keyList = input.selectedKeys.join(", ");
83
- const grantRequest = keyList
84
- ? `Requested Dispatch vault key grants for this app: ${keyList}`
85
- : `Requested Dispatch vault key grants for this app: none`;
86
+ const grantRequest =
87
+ input.vaultAccessMode === "all-apps"
88
+ ? `Dispatch vault access: all saved vault keys are available to every workspace app by default. No per-app vault grants are needed.`
89
+ : keyList
90
+ ? `Requested Dispatch vault key grants for this app: ${keyList}`
91
+ : `Requested Dispatch vault key grants for this app: none`;
86
92
  const resourceList = input.selectedResources.length
87
93
  ? input.selectedResources
88
94
  .map(
@@ -98,9 +104,11 @@ function buildAppCreationPrompt(input: {
98
104
  ``,
99
105
  `Suggested app name: ${input.appId} (you may adjust the slug if it conflicts)`,
100
106
  `User prompt: ${input.prompt.trim()}`,
107
+ `Generate a concise one-sentence app description from the user prompt before coding; save it in apps/${input.appId}/package.json "description" so Dispatch and A2A can describe the app.`,
101
108
  `If the user mentions a product or company such as Granola, Loom, Superhuman, Linear, or Notion, treat it as product inspiration unless they explicitly ask to connect to that service. Do not invent or require third-party API keys like GRANOLA_API_KEY just because a product is named.`,
102
109
  grantRequest,
103
110
  `Requested Dispatch workspace resources for this app:\n${resourceList}`,
111
+ `Dispatch workspace resources with scope=all are inherited workspace context. Do not copy or sync them into the new app; every workspace app reads them at runtime and may override with app shared or personal resources.`,
104
112
  ``,
105
113
  `Pick a starter template that fits the user's prompt — analytics, calendar, content, design, dispatch, forms, mail, slides, clips, or starter when none of the others fit.`,
106
114
  `Use the workspace app layout: create it under apps/${input.appId}, mount it at /${input.appId}, keep it on the shared workspace database/hosting model, and avoid table-name collisions by namespacing any new domain tables to the app.`,
@@ -112,18 +120,20 @@ function buildAppCreationPrompt(input: {
112
120
  `Do not clone first-party templates, create wrapper apps, or scaffold child apps/routes for Mail, Calendar, Analytics, etc. inside apps/${input.appId} just so this app can access them. If the request is a cross-app dashboard or overview, build only the new dashboard/overview app and delegate to the existing apps for domain work.`,
113
121
  `Only create another first-party app copy when the user explicitly asks for a customized fork/copy of that app; otherwise keep using the hosted/shared app so improvements to the base template keep flowing to users.`,
114
122
  `Do not satisfy this by adding a route, page, component, or file inside apps/starter or another existing app unless the user explicitly asks to modify that existing app.`,
115
- keyList
116
- ? `After the app exists, grant the selected Dispatch vault keys to appId "${input.appId}" and sync them once the app server is available. Treat these as requested grants, not active grants before creation succeeds.`
117
- : `Do not grant any Dispatch vault keys unless the user asks later.`,
123
+ input.vaultAccessMode === "all-apps"
124
+ ? `Do not create per-app Dispatch vault grants unless the workspace switches vault access to manual or the user explicitly asks for manual grants.`
125
+ : keyList
126
+ ? `After the app exists, grant the selected Dispatch vault keys to appId "${input.appId}" and sync them once the app server is available. Treat these as requested grants, not active grants before creation succeeds.`
127
+ : `Do not grant any Dispatch vault keys unless the user asks later.`,
118
128
  input.selectedResources.length
119
- ? `After the app exists, grant the selected Dispatch workspace resources to appId "${input.appId}" and sync them once the app server is available. Add a short note to apps/${input.appId}/AGENTS.md telling the app agent to read relevant shared resources under context/ or the selected resource paths before doing GTM/domain work.`
120
- : `Do not grant any Dispatch workspace resources unless the user asks later.`,
129
+ ? `After the app exists, grant the selected Dispatch workspace resources to appId "${input.appId}". Do not sync All-app workspace resources; they are inherited.`
130
+ : `Do not grant any selected-only Dispatch workspace resources unless the user asks later.`,
121
131
  ``,
122
132
  `App readiness requirements before handing off:`,
123
- `- Ensure apps/${input.appId}/package.json exists; Dispatch discovers workspace apps from apps/<app-id>/package.json, not a separate app registry.`,
133
+ `- Ensure apps/${input.appId}/package.json exists with displayName/name and a concise description; Dispatch discovers workspace apps from apps/<app-id>/package.json, not a separate app registry.`,
124
134
  `- Update the app manifest/package/deploy metadata needed by the existing workspace deployment model.`,
125
135
  `- Ensure the React Router client entry preserves APP_BASE_PATH/VITE_APP_BASE_PATH via appBasePath() so /${input.appId} hydrates correctly.`,
126
- `- Verify the app's agent card/A2A metadata is ready so Dispatch can discover and delegate to the app after deployment.`,
136
+ `- Verify the app's agent card/A2A metadata is ready so Dispatch can discover and delegate to the app after deployment. Every sibling workspace app is available over A2A by default through call-agent, with names and descriptions from the workspace app registry.`,
127
137
  `When it is ready, start or update the workspace dev server and navigate the user to the absolute path /${input.appId} on the workspace origin. Do not prefix with /dispatch/, /apps/, /workspace/, or any other Dispatch tab — the new app is mounted at the workspace root, not under Dispatch. If you have a navigate tool available, pass /${input.appId} verbatim; if you only have a window.location-style escape hatch, set it to /${input.appId}.`,
128
138
  ].join("\n");
129
139
  }
@@ -170,6 +180,8 @@ export function CreateAppFlow({
170
180
  const [selectedResourceIds, setSelectedResourceIds] = useState<string[]>([]);
171
181
  const [secrets, setSecrets] = useState<VaultSecretOption[]>([]);
172
182
  const [resources, setResources] = useState<WorkspaceResourceOption[]>([]);
183
+ const [vaultAccessMode, setVaultAccessMode] =
184
+ useState<VaultAccessMode>("all-apps");
173
185
  const [secretsError, setSecretsError] = useState<string | null>(null);
174
186
  const [resourcesError, setResourcesError] = useState<string | null>(null);
175
187
  const [statusMessage, setStatusMessage] = useState<string | null>(null);
@@ -193,6 +205,15 @@ export function CreateAppFlow({
193
205
  setSecrets([]);
194
206
  setSecretsError(err?.message || "Could not load Dispatch keys");
195
207
  });
208
+ fetchJson(actionUrl(basePath, "get-vault-access-settings"))
209
+ .then((data) => {
210
+ if (cancelled) return;
211
+ setVaultAccessMode(data?.mode === "manual" ? "manual" : "all-apps");
212
+ })
213
+ .catch(() => {
214
+ if (cancelled) return;
215
+ setVaultAccessMode("manual");
216
+ });
196
217
  fetchJson(actionUrl(basePath, "list-workspace-resource-options"))
197
218
  .then((data) => {
198
219
  if (cancelled) return;
@@ -218,9 +239,11 @@ export function CreateAppFlow({
218
239
  [resources, selectedResourceIds],
219
240
  );
220
241
  const selectedSecretLabel =
221
- selectedSecretIds.length === 0
222
- ? "no keys"
223
- : `${selectedSecretIds.length} key${selectedSecretIds.length === 1 ? "" : "s"}`;
242
+ vaultAccessMode === "all-apps"
243
+ ? "all keys"
244
+ : selectedSecretIds.length === 0
245
+ ? "no keys"
246
+ : `${selectedSecretIds.length} key${selectedSecretIds.length === 1 ? "" : "s"}`;
224
247
  const selectedResourceLabel =
225
248
  selectedResourceIds.length === 0
226
249
  ? "no resources"
@@ -254,8 +277,12 @@ export function CreateAppFlow({
254
277
  const message = buildAppCreationPrompt({
255
278
  appId,
256
279
  prompt: trimmed,
257
- selectedKeys: selectedSecrets.map((s) => s.credentialKey),
280
+ selectedKeys:
281
+ vaultAccessMode === "manual"
282
+ ? selectedSecrets.map((s) => s.credentialKey)
283
+ : [],
258
284
  selectedResources,
285
+ vaultAccessMode,
259
286
  });
260
287
  setIsSubmitting(true);
261
288
  setStatusMessage(null);
@@ -279,7 +306,10 @@ export function CreateAppFlow({
279
306
  body: JSON.stringify({
280
307
  prompt: trimmed,
281
308
  appId,
282
- secretIds: selectedSecretIds.length > 0 ? selectedSecretIds : [],
309
+ secretIds:
310
+ vaultAccessMode === "manual" && selectedSecretIds.length > 0
311
+ ? selectedSecretIds
312
+ : [],
283
313
  resourceIds:
284
314
  selectedResourceIds.length > 0 ? selectedResourceIds : [],
285
315
  }),
@@ -351,7 +381,11 @@ export function CreateAppFlow({
351
381
  <IconKey size={12} />
352
382
  Dispatch keys
353
383
  </div>
354
- {secretsError ? (
384
+ {vaultAccessMode === "all-apps" ? (
385
+ <p className="rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground">
386
+ Every saved Dispatch vault key is available to new apps.
387
+ </p>
388
+ ) : secretsError ? (
355
389
  <p className="rounded-md border border-dashed border-border px-3 py-3 text-xs text-muted-foreground">
356
390
  {secretsError}
357
391
  </p>
@@ -1,17 +1,17 @@
1
1
  import { type ReactNode } from "react";
2
2
  import {
3
- Tooltip,
4
- TooltipContent,
5
- TooltipTrigger,
6
- } from "@/components/ui/tooltip";
3
+ Popover,
4
+ PopoverContent,
5
+ PopoverTrigger,
6
+ } from "@/components/ui/popover";
7
7
  import { IconInfoCircle } from "@tabler/icons-react";
8
8
  import { useSetPageTitle } from "@/components/layout/HeaderActions";
9
9
 
10
10
  /**
11
- * DispatchShell renders the per-page title (with optional description tooltip)
12
- * into the global header via the HeaderActions store. The actual chrome
13
- * (sidebar, AgentSidebar, header bar with AgentToggleButton) is provided by
14
- * `Layout` mounted in `root.tsx`.
11
+ * DispatchShell renders the per-page title (with an optional click-to-open
12
+ * description popover) into the global header via the HeaderActions store.
13
+ * The actual chrome (sidebar, AgentSidebar, header bar with AgentToggleButton)
14
+ * is provided by `Layout` mounted in `root.tsx`.
15
15
  */
16
16
  export function DispatchShell({
17
17
  title,
@@ -28,23 +28,24 @@ export function DispatchShell({
28
28
  {title}
29
29
  </h1>
30
30
  {description ? (
31
- <Tooltip>
32
- <TooltipTrigger asChild>
31
+ <Popover>
32
+ <PopoverTrigger asChild>
33
33
  <button
34
34
  type="button"
35
- className="text-muted-foreground/60 hover:text-foreground cursor-pointer"
35
+ className="inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground/70 hover:bg-accent hover:text-foreground cursor-pointer"
36
36
  aria-label={`About ${title}`}
37
37
  >
38
38
  <IconInfoCircle className="h-3.5 w-3.5" />
39
39
  </button>
40
- </TooltipTrigger>
41
- <TooltipContent
40
+ </PopoverTrigger>
41
+ <PopoverContent
42
42
  side="bottom"
43
+ align="start"
43
44
  className="max-w-72 text-xs leading-relaxed"
44
45
  >
45
46
  {description}
46
- </TooltipContent>
47
- </Tooltip>
47
+ </PopoverContent>
48
+ </Popover>
48
49
  ) : null}
49
50
  </div>,
50
51
  );
@@ -12,6 +12,7 @@ import { InvitationBanner, OrgSwitcher } from "@agent-native/core/client/org";
12
12
  import {
13
13
  IconArrowUpRight,
14
14
  IconApps,
15
+ IconBrain,
15
16
  IconChartBar,
16
17
  IconBrandTelegram,
17
18
  IconKey,
@@ -151,6 +152,13 @@ const OPERATIONS_NAV_ITEMS = [
151
152
  icon: IconHistory,
152
153
  section: "operations",
153
154
  },
155
+ {
156
+ id: "dreams",
157
+ to: "/dreams",
158
+ label: "Dreams",
159
+ icon: IconBrain,
160
+ section: "operations",
161
+ },
154
162
  {
155
163
  id: "thread-debug",
156
164
  to: "/thread-debug",
@@ -229,10 +237,16 @@ function dispatchNavLinkTarget(path: string): string {
229
237
  if (typeof window === "undefined") return path;
230
238
  const basePath = appBasePath();
231
239
  if (!basePath) return path;
232
- const context = (
233
- window as Window & { __reactRouterContext?: { basename?: string } }
234
- ).__reactRouterContext;
235
- return context?.basename === basePath ? path : appPath(path);
240
+ // Mirror the basename calculation entry.client.tsx uses to configure the
241
+ // router (basePath iff the current URL is under that mount, "" otherwise).
242
+ // Reading the live URL directly avoids races with the previous check on
243
+ // `__reactRouterContext.basename`, which could read undefined before the
244
+ // entry script set it — that race produced /dispatch/dispatch/<route>
245
+ // history entries that 404'd on back-button navigation.
246
+ const pathname = window.location.pathname;
247
+ const routerHasBasename =
248
+ pathname === basePath || pathname.startsWith(`${basePath}/`);
249
+ return routerHasBasename ? path : appPath(path);
236
250
  }
237
251
 
238
252
  export function NavContent({
@@ -424,7 +438,7 @@ export function Layout({
424
438
  <AgentSidebar
425
439
  position="right"
426
440
  defaultOpen={false}
427
- emptyStateText="Create apps, grant keys, and route work across the workspace."
441
+ emptyStateText="Create apps, manage vault keys, and route work across the workspace."
428
442
  suggestions={SIDEBAR_SUGGESTIONS}
429
443
  >
430
444
  {appContent}
@@ -449,23 +449,34 @@ export function MessagingSetupPanel() {
449
449
  </p>
450
450
  </div>
451
451
  </div>
452
- <div className="flex items-center gap-3">
453
- <a
454
- href={platform.docsUrl}
455
- className="inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground"
452
+ <div className="flex shrink-0 items-center gap-1">
453
+ <Button
454
+ asChild
455
+ variant="ghost"
456
+ size="sm"
457
+ className="h-7 px-2 text-xs text-muted-foreground"
456
458
  >
457
- Docs
458
- </a>
459
+ <a href={platform.docsUrl} target="_blank" rel="noreferrer">
460
+ Docs
461
+ <IconExternalLink className="ml-1 h-3 w-3" />
462
+ </a>
463
+ </Button>
459
464
  {platform.externalUrl ? (
460
- <a
461
- href={platform.externalUrl}
462
- target="_blank"
463
- rel="noreferrer"
464
- className="inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground"
465
+ <Button
466
+ asChild
467
+ variant="ghost"
468
+ size="sm"
469
+ className="h-7 px-2 text-xs text-muted-foreground"
465
470
  >
466
- {platform.externalLabel ?? "Open"}
467
- <IconExternalLink className="h-3.5 w-3.5" />
468
- </a>
471
+ <a
472
+ href={platform.externalUrl}
473
+ target="_blank"
474
+ rel="noreferrer"
475
+ >
476
+ {platform.externalLabel ?? "Open"}
477
+ <IconExternalLink className="ml-1 h-3 w-3" />
478
+ </a>
479
+ </Button>
469
480
  ) : null}
470
481
  </div>
471
482
  </div>
@@ -609,7 +620,7 @@ export function MessagingSetupPanel() {
609
620
  </div>
610
621
  ) : null}
611
622
 
612
- <div className="mt-5 flex flex-wrap gap-2">
623
+ <div className="mt-5 flex flex-wrap items-center justify-end gap-2 border-t border-border pt-4">
613
624
  {platform.id === "telegram" && configured ? (
614
625
  <Button
615
626
  variant="outline"
@@ -626,31 +637,35 @@ export function MessagingSetupPanel() {
626
637
  )}
627
638
  </Button>
628
639
  ) : null}
629
- <Button
630
- onClick={() => togglePlatform(platform, enabled)}
631
- disabled={
632
- togglingPlatform === platform.id || (!enabled && !canEnable)
633
- }
634
- >
635
- {togglingPlatform === platform.id ? (
636
- <>
637
- <IconLoader2 className="mr-2 h-4 w-4 animate-spin" />
638
- Saving...
639
- </>
640
- ) : enabled ? (
641
- "Disable"
642
- ) : (
643
- "Enable"
644
- )}
645
- </Button>
640
+ {!configured && !enabled ? (
641
+ <Tooltip>
642
+ <TooltipTrigger asChild>
643
+ <span tabIndex={0}>
644
+ <Button disabled>Enable</Button>
645
+ </span>
646
+ </TooltipTrigger>
647
+ <TooltipContent>
648
+ Save the required credentials first.
649
+ </TooltipContent>
650
+ </Tooltip>
651
+ ) : (
652
+ <Button
653
+ onClick={() => togglePlatform(platform, enabled)}
654
+ disabled={togglingPlatform === platform.id}
655
+ >
656
+ {togglingPlatform === platform.id ? (
657
+ <>
658
+ <IconLoader2 className="mr-2 h-4 w-4 animate-spin" />
659
+ Saving...
660
+ </>
661
+ ) : enabled ? (
662
+ "Disable"
663
+ ) : (
664
+ "Enable"
665
+ )}
666
+ </Button>
667
+ )}
646
668
  </div>
647
-
648
- {!configured ? (
649
- <p className="mt-3 text-xs text-muted-foreground">
650
- Save the required credentials before enabling {platform.label}
651
- .
652
- </p>
653
- ) : null}
654
669
  </section>
655
670
  );
656
671
  })}