@agent-native/core 0.14.8 → 0.15.1

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 (544) hide show
  1. package/README.md +1 -1
  2. package/dist/agent/engine/builder-engine.d.ts.map +1 -1
  3. package/dist/agent/engine/builder-engine.js +30 -9
  4. package/dist/agent/engine/builder-engine.js.map +1 -1
  5. package/dist/agent/engine/registry.d.ts.map +1 -1
  6. package/dist/agent/engine/registry.js +14 -4
  7. package/dist/agent/engine/registry.js.map +1 -1
  8. package/dist/agent/production-agent.d.ts.map +1 -1
  9. package/dist/agent/production-agent.js +71 -4
  10. package/dist/agent/production-agent.js.map +1 -1
  11. package/dist/agent/types.d.ts +9 -0
  12. package/dist/agent/types.d.ts.map +1 -1
  13. package/dist/agent/types.js.map +1 -1
  14. package/dist/appearance/actions/change-appearance.d.ts +3 -0
  15. package/dist/appearance/actions/change-appearance.d.ts.map +1 -0
  16. package/dist/appearance/actions/change-appearance.js +29 -0
  17. package/dist/appearance/actions/change-appearance.js.map +1 -0
  18. package/dist/chat-threads/store.d.ts +53 -2
  19. package/dist/chat-threads/store.d.ts.map +1 -1
  20. package/dist/chat-threads/store.js +172 -12
  21. package/dist/chat-threads/store.js.map +1 -1
  22. package/dist/cli/create.d.ts.map +1 -1
  23. package/dist/cli/create.js +114 -37
  24. package/dist/cli/create.js.map +1 -1
  25. package/dist/cli/index.js +30 -4
  26. package/dist/cli/index.js.map +1 -1
  27. package/dist/cli/workspace-dev.d.ts +25 -1
  28. package/dist/cli/workspace-dev.d.ts.map +1 -1
  29. package/dist/cli/workspace-dev.js +275 -49
  30. package/dist/cli/workspace-dev.js.map +1 -1
  31. package/dist/client/AgentPanel.d.ts +23 -4
  32. package/dist/client/AgentPanel.d.ts.map +1 -1
  33. package/dist/client/AgentPanel.js +276 -53
  34. package/dist/client/AgentPanel.js.map +1 -1
  35. package/dist/client/AppearancePicker.d.ts +11 -0
  36. package/dist/client/AppearancePicker.d.ts.map +1 -0
  37. package/dist/client/AppearancePicker.js +16 -0
  38. package/dist/client/AppearancePicker.js.map +1 -0
  39. package/dist/client/AssistantChat.d.ts +35 -0
  40. package/dist/client/AssistantChat.d.ts.map +1 -1
  41. package/dist/client/AssistantChat.js +315 -32
  42. package/dist/client/AssistantChat.js.map +1 -1
  43. package/dist/client/ConnectBuilderCard.d.ts.map +1 -1
  44. package/dist/client/ConnectBuilderCard.js +5 -2
  45. package/dist/client/ConnectBuilderCard.js.map +1 -1
  46. package/dist/client/ErrorBoundary.d.ts.map +1 -1
  47. package/dist/client/ErrorBoundary.js +8 -10
  48. package/dist/client/ErrorBoundary.js.map +1 -1
  49. package/dist/client/FeedbackButton.d.ts.map +1 -1
  50. package/dist/client/FeedbackButton.js +1 -1
  51. package/dist/client/FeedbackButton.js.map +1 -1
  52. package/dist/client/MultiTabAssistantChat.d.ts +13 -1
  53. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  54. package/dist/client/MultiTabAssistantChat.js +217 -38
  55. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  56. package/dist/client/NewWorkspaceAppFlow.d.ts.map +1 -1
  57. package/dist/client/NewWorkspaceAppFlow.js +37 -14
  58. package/dist/client/NewWorkspaceAppFlow.js.map +1 -1
  59. package/dist/client/agent-chat-adapter.d.ts +5 -0
  60. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  61. package/dist/client/agent-chat-adapter.js +4 -0
  62. package/dist/client/agent-chat-adapter.js.map +1 -1
  63. package/dist/client/agent-sidebar-state.d.ts +12 -0
  64. package/dist/client/agent-sidebar-state.d.ts.map +1 -1
  65. package/dist/client/agent-sidebar-state.js +8 -0
  66. package/dist/client/agent-sidebar-state.js.map +1 -1
  67. package/dist/client/analytics.d.ts.map +1 -1
  68. package/dist/client/analytics.js +175 -3
  69. package/dist/client/analytics.js.map +1 -1
  70. package/dist/client/appearance.d.ts +40 -0
  71. package/dist/client/appearance.d.ts.map +1 -0
  72. package/dist/client/appearance.js +114 -0
  73. package/dist/client/appearance.js.map +1 -0
  74. package/dist/client/builder-frame.d.ts +1 -0
  75. package/dist/client/builder-frame.d.ts.map +1 -1
  76. package/dist/client/builder-frame.js +19 -9
  77. package/dist/client/builder-frame.js.map +1 -1
  78. package/dist/client/components/CodeRequiredDialog.d.ts.map +1 -1
  79. package/dist/client/components/CodeRequiredDialog.js +10 -2
  80. package/dist/client/components/CodeRequiredDialog.js.map +1 -1
  81. package/dist/client/components/ui/dropdown-menu.js +2 -2
  82. package/dist/client/components/ui/dropdown-menu.js.map +1 -1
  83. package/dist/client/components/ui/hover-card.js +1 -1
  84. package/dist/client/components/ui/hover-card.js.map +1 -1
  85. package/dist/client/components/ui/popover.js +1 -1
  86. package/dist/client/components/ui/popover.js.map +1 -1
  87. package/dist/client/composer/PromptComposer.d.ts +7 -0
  88. package/dist/client/composer/PromptComposer.d.ts.map +1 -1
  89. package/dist/client/composer/PromptComposer.js +63 -32
  90. package/dist/client/composer/PromptComposer.js.map +1 -1
  91. package/dist/client/composer/TiptapComposer.d.ts +5 -0
  92. package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
  93. package/dist/client/composer/TiptapComposer.js +36 -6
  94. package/dist/client/composer/TiptapComposer.js.map +1 -1
  95. package/dist/client/composer/useVoiceDictation.d.ts.map +1 -1
  96. package/dist/client/composer/useVoiceDictation.js +13 -1
  97. package/dist/client/composer/useVoiceDictation.js.map +1 -1
  98. package/dist/client/dev-mode.d.ts +14 -0
  99. package/dist/client/dev-mode.d.ts.map +1 -0
  100. package/dist/client/dev-mode.js +14 -0
  101. package/dist/client/dev-mode.js.map +1 -0
  102. package/dist/client/error-format.d.ts +3 -2
  103. package/dist/client/error-format.d.ts.map +1 -1
  104. package/dist/client/error-format.js +9 -2
  105. package/dist/client/error-format.js.map +1 -1
  106. package/dist/client/extensions/EmbeddedTool.d.ts +20 -0
  107. package/dist/client/extensions/EmbeddedTool.d.ts.map +1 -0
  108. package/dist/client/extensions/EmbeddedTool.js +199 -0
  109. package/dist/client/extensions/EmbeddedTool.js.map +1 -0
  110. package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
  111. package/dist/client/extensions/ExtensionViewer.js +24 -2
  112. package/dist/client/extensions/ExtensionViewer.js.map +1 -1
  113. package/dist/client/extensions/ToolEditor.d.ts +5 -0
  114. package/dist/client/extensions/ToolEditor.d.ts.map +1 -0
  115. package/dist/client/extensions/ToolEditor.js +129 -0
  116. package/dist/client/extensions/ToolEditor.js.map +1 -0
  117. package/dist/client/extensions/ToolViewer.d.ts +5 -0
  118. package/dist/client/extensions/ToolViewer.d.ts.map +1 -0
  119. package/dist/client/extensions/ToolViewer.js +400 -0
  120. package/dist/client/extensions/ToolViewer.js.map +1 -0
  121. package/dist/client/extensions/ToolViewerPage.d.ts +2 -0
  122. package/dist/client/extensions/ToolViewerPage.d.ts.map +1 -0
  123. package/dist/client/extensions/ToolViewerPage.js +24 -0
  124. package/dist/client/extensions/ToolViewerPage.js.map +1 -0
  125. package/dist/client/extensions/ToolsListPage.d.ts +2 -0
  126. package/dist/client/extensions/ToolsListPage.d.ts.map +1 -0
  127. package/dist/client/extensions/ToolsListPage.js +67 -0
  128. package/dist/client/extensions/ToolsListPage.js.map +1 -0
  129. package/dist/client/extensions/ToolsSidebarSection.d.ts +2 -0
  130. package/dist/client/extensions/ToolsSidebarSection.d.ts.map +1 -0
  131. package/dist/client/extensions/ToolsSidebarSection.js +236 -0
  132. package/dist/client/extensions/ToolsSidebarSection.js.map +1 -0
  133. package/dist/client/extensions/tool-order.d.ts +7 -0
  134. package/dist/client/extensions/tool-order.d.ts.map +1 -0
  135. package/dist/client/extensions/tool-order.js +47 -0
  136. package/dist/client/extensions/tool-order.js.map +1 -0
  137. package/dist/client/index.d.ts +8 -1
  138. package/dist/client/index.d.ts.map +1 -1
  139. package/dist/client/index.js +7 -0
  140. package/dist/client/index.js.map +1 -1
  141. package/dist/client/onboarding/OnboardingPanel.js +1 -0
  142. package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
  143. package/dist/client/org/InvitationBanner.d.ts.map +1 -1
  144. package/dist/client/org/InvitationBanner.js +23 -2
  145. package/dist/client/org/InvitationBanner.js.map +1 -1
  146. package/dist/client/org/OrgSwitcher.d.ts +5 -4
  147. package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
  148. package/dist/client/org/OrgSwitcher.js +57 -9
  149. package/dist/client/org/OrgSwitcher.js.map +1 -1
  150. package/dist/client/org/hooks.d.ts.map +1 -1
  151. package/dist/client/org/hooks.js +10 -6
  152. package/dist/client/org/hooks.js.map +1 -1
  153. package/dist/client/org/workspace-app-links.d.ts +31 -0
  154. package/dist/client/org/workspace-app-links.d.ts.map +1 -0
  155. package/dist/client/org/workspace-app-links.js +268 -0
  156. package/dist/client/org/workspace-app-links.js.map +1 -0
  157. package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
  158. package/dist/client/resources/ResourcesPanel.js +18 -5
  159. package/dist/client/resources/ResourcesPanel.js.map +1 -1
  160. package/dist/client/resources/use-resources.d.ts +18 -13
  161. package/dist/client/resources/use-resources.d.ts.map +1 -1
  162. package/dist/client/resources/use-resources.js +24 -6
  163. package/dist/client/resources/use-resources.js.map +1 -1
  164. package/dist/client/settings/BackgroundAgentSection.d.ts.map +1 -1
  165. package/dist/client/settings/BackgroundAgentSection.js +9 -1
  166. package/dist/client/settings/BackgroundAgentSection.js.map +1 -1
  167. package/dist/client/settings/BrowserSection.d.ts.map +1 -1
  168. package/dist/client/settings/BrowserSection.js +16 -1
  169. package/dist/client/settings/BrowserSection.js.map +1 -1
  170. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  171. package/dist/client/settings/SettingsPanel.js +4 -1
  172. package/dist/client/settings/SettingsPanel.js.map +1 -1
  173. package/dist/client/settings/VoiceTranscriptionSection.d.ts.map +1 -1
  174. package/dist/client/settings/VoiceTranscriptionSection.js +5 -5
  175. package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
  176. package/dist/client/settings/useBuilderStatus.d.ts +8 -0
  177. package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
  178. package/dist/client/settings/useBuilderStatus.js +50 -13
  179. package/dist/client/settings/useBuilderStatus.js.map +1 -1
  180. package/dist/client/settings/useBuilderStatus.spec.d.ts +2 -0
  181. package/dist/client/settings/useBuilderStatus.spec.d.ts.map +1 -0
  182. package/dist/client/settings/useBuilderStatus.spec.js +64 -0
  183. package/dist/client/settings/useBuilderStatus.spec.js.map +1 -0
  184. package/dist/client/sharing/ShareButton.d.ts +5 -0
  185. package/dist/client/sharing/ShareButton.d.ts.map +1 -1
  186. package/dist/client/sharing/ShareButton.js +60 -6
  187. package/dist/client/sharing/ShareButton.js.map +1 -1
  188. package/dist/client/theme.js +1 -1
  189. package/dist/client/theme.js.map +1 -1
  190. package/dist/client/tools/EmbeddedTool.d.ts +20 -0
  191. package/dist/client/tools/EmbeddedTool.d.ts.map +1 -0
  192. package/dist/client/tools/EmbeddedTool.js +199 -0
  193. package/dist/client/tools/EmbeddedTool.js.map +1 -0
  194. package/dist/client/tools/ExtensionSlot.d.ts +27 -0
  195. package/dist/client/tools/ExtensionSlot.d.ts.map +1 -0
  196. package/dist/client/tools/ExtensionSlot.js +96 -0
  197. package/dist/client/tools/ExtensionSlot.js.map +1 -0
  198. package/dist/client/tools/ToolEditor.d.ts +5 -0
  199. package/dist/client/tools/ToolEditor.d.ts.map +1 -0
  200. package/dist/client/tools/ToolEditor.js +129 -0
  201. package/dist/client/tools/ToolEditor.js.map +1 -0
  202. package/dist/client/tools/ToolViewer.d.ts +5 -0
  203. package/dist/client/tools/ToolViewer.d.ts.map +1 -0
  204. package/dist/client/tools/ToolViewer.js +400 -0
  205. package/dist/client/tools/ToolViewer.js.map +1 -0
  206. package/dist/client/tools/ToolViewerPage.d.ts +2 -0
  207. package/dist/client/tools/ToolViewerPage.d.ts.map +1 -0
  208. package/dist/client/tools/ToolViewerPage.js +24 -0
  209. package/dist/client/tools/ToolViewerPage.js.map +1 -0
  210. package/dist/client/tools/ToolsListPage.d.ts +2 -0
  211. package/dist/client/tools/ToolsListPage.d.ts.map +1 -0
  212. package/dist/client/tools/ToolsListPage.js +67 -0
  213. package/dist/client/tools/ToolsListPage.js.map +1 -0
  214. package/dist/client/tools/ToolsSidebarSection.d.ts +2 -0
  215. package/dist/client/tools/ToolsSidebarSection.d.ts.map +1 -0
  216. package/dist/client/tools/ToolsSidebarSection.js +236 -0
  217. package/dist/client/tools/ToolsSidebarSection.js.map +1 -0
  218. package/dist/client/tools/iframe-bridge.d.ts +38 -0
  219. package/dist/client/tools/iframe-bridge.d.ts.map +1 -0
  220. package/dist/client/tools/iframe-bridge.js +207 -0
  221. package/dist/client/tools/iframe-bridge.js.map +1 -0
  222. package/dist/client/tools/index.d.ts +8 -0
  223. package/dist/client/tools/index.d.ts.map +1 -0
  224. package/dist/client/tools/index.js +8 -0
  225. package/dist/client/tools/index.js.map +1 -0
  226. package/dist/client/tools/tool-order.d.ts +7 -0
  227. package/dist/client/tools/tool-order.d.ts.map +1 -0
  228. package/dist/client/tools/tool-order.js +47 -0
  229. package/dist/client/tools/tool-order.js.map +1 -0
  230. package/dist/client/transcription/BuilderTranscriptionCta.d.ts.map +1 -1
  231. package/dist/client/transcription/BuilderTranscriptionCta.js +2 -3
  232. package/dist/client/transcription/BuilderTranscriptionCta.js.map +1 -1
  233. package/dist/client/use-change-version.d.ts +46 -0
  234. package/dist/client/use-change-version.d.ts.map +1 -0
  235. package/dist/client/use-change-version.js +135 -0
  236. package/dist/client/use-change-version.js.map +1 -0
  237. package/dist/client/use-chat-threads.d.ts +16 -2
  238. package/dist/client/use-chat-threads.d.ts.map +1 -1
  239. package/dist/client/use-chat-threads.js +87 -12
  240. package/dist/client/use-chat-threads.js.map +1 -1
  241. package/dist/client/use-chat-threads.spec.d.ts +2 -0
  242. package/dist/client/use-chat-threads.spec.d.ts.map +1 -0
  243. package/dist/client/use-chat-threads.spec.js +85 -0
  244. package/dist/client/use-chat-threads.spec.js.map +1 -0
  245. package/dist/client/use-db-sync.d.ts +5 -2
  246. package/dist/client/use-db-sync.d.ts.map +1 -1
  247. package/dist/client/use-db-sync.js +41 -16
  248. package/dist/client/use-db-sync.js.map +1 -1
  249. package/dist/client/use-pinch-zoom.d.ts +35 -0
  250. package/dist/client/use-pinch-zoom.d.ts.map +1 -0
  251. package/dist/client/use-pinch-zoom.js +105 -0
  252. package/dist/client/use-pinch-zoom.js.map +1 -0
  253. package/dist/deploy/workspace-deploy.d.ts.map +1 -1
  254. package/dist/deploy/workspace-deploy.js +99 -5
  255. package/dist/deploy/workspace-deploy.js.map +1 -1
  256. package/dist/extensions/actions.d.ts.map +1 -1
  257. package/dist/extensions/actions.js +3 -0
  258. package/dist/extensions/actions.js.map +1 -1
  259. package/dist/extensions/store.d.ts +5 -0
  260. package/dist/extensions/store.d.ts.map +1 -1
  261. package/dist/extensions/store.js +16 -1
  262. package/dist/extensions/store.js.map +1 -1
  263. package/dist/file-upload/actions/upload-image.d.ts +3 -0
  264. package/dist/file-upload/actions/upload-image.d.ts.map +1 -0
  265. package/dist/file-upload/actions/upload-image.js +145 -0
  266. package/dist/file-upload/actions/upload-image.js.map +1 -0
  267. package/dist/file-upload/builder.d.ts.map +1 -1
  268. package/dist/file-upload/builder.js +31 -11
  269. package/dist/file-upload/builder.js.map +1 -1
  270. package/dist/file-upload/index.d.ts +1 -0
  271. package/dist/file-upload/index.d.ts.map +1 -1
  272. package/dist/file-upload/index.js +1 -0
  273. package/dist/file-upload/index.js.map +1 -1
  274. package/dist/file-upload/pre-upload-attachments.d.ts +39 -0
  275. package/dist/file-upload/pre-upload-attachments.d.ts.map +1 -0
  276. package/dist/file-upload/pre-upload-attachments.js +110 -0
  277. package/dist/file-upload/pre-upload-attachments.js.map +1 -0
  278. package/dist/file-upload/registry.d.ts.map +1 -1
  279. package/dist/file-upload/registry.js +8 -7
  280. package/dist/file-upload/registry.js.map +1 -1
  281. package/dist/onboarding/default-steps.js +1 -1
  282. package/dist/onboarding/default-steps.js.map +1 -1
  283. package/dist/org/context.d.ts +15 -1
  284. package/dist/org/context.d.ts.map +1 -1
  285. package/dist/org/context.js +25 -0
  286. package/dist/org/context.js.map +1 -1
  287. package/dist/org/handlers.d.ts +2 -2
  288. package/dist/org/handlers.d.ts.map +1 -1
  289. package/dist/org/handlers.js +3 -17
  290. package/dist/org/handlers.js.map +1 -1
  291. package/dist/org/index.d.ts +1 -1
  292. package/dist/org/index.d.ts.map +1 -1
  293. package/dist/org/index.js +1 -1
  294. package/dist/org/index.js.map +1 -1
  295. package/dist/resources/handlers.d.ts +6 -0
  296. package/dist/resources/handlers.d.ts.map +1 -1
  297. package/dist/resources/handlers.js +30 -6
  298. package/dist/resources/handlers.js.map +1 -1
  299. package/dist/resources/script-helpers.d.ts +11 -2
  300. package/dist/resources/script-helpers.d.ts.map +1 -1
  301. package/dist/resources/script-helpers.js +20 -3
  302. package/dist/resources/script-helpers.js.map +1 -1
  303. package/dist/resources/store.d.ts +28 -3
  304. package/dist/resources/store.d.ts.map +1 -1
  305. package/dist/resources/store.js +170 -20
  306. package/dist/resources/store.js.map +1 -1
  307. package/dist/scripts/resources/list.d.ts +1 -1
  308. package/dist/scripts/resources/list.d.ts.map +1 -1
  309. package/dist/scripts/resources/list.js +16 -4
  310. package/dist/scripts/resources/list.js.map +1 -1
  311. package/dist/scripts/resources/write.d.ts +1 -1
  312. package/dist/scripts/resources/write.d.ts.map +1 -1
  313. package/dist/scripts/resources/write.js +47 -3
  314. package/dist/scripts/resources/write.js.map +1 -1
  315. package/dist/server/action-discovery.d.ts.map +1 -1
  316. package/dist/server/action-discovery.js +8 -3
  317. package/dist/server/action-discovery.js.map +1 -1
  318. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  319. package/dist/server/agent-chat-plugin.js +214 -25
  320. package/dist/server/agent-chat-plugin.js.map +1 -1
  321. package/dist/server/agent-discovery.d.ts +35 -0
  322. package/dist/server/agent-discovery.d.ts.map +1 -1
  323. package/dist/server/agent-discovery.js +139 -8
  324. package/dist/server/agent-discovery.js.map +1 -1
  325. package/dist/server/app-url.d.ts +12 -6
  326. package/dist/server/app-url.d.ts.map +1 -1
  327. package/dist/server/app-url.js +58 -11
  328. package/dist/server/app-url.js.map +1 -1
  329. package/dist/server/auth.d.ts +22 -0
  330. package/dist/server/auth.d.ts.map +1 -1
  331. package/dist/server/auth.js +316 -65
  332. package/dist/server/auth.js.map +1 -1
  333. package/dist/server/better-auth-instance.d.ts +0 -4
  334. package/dist/server/better-auth-instance.d.ts.map +1 -1
  335. package/dist/server/better-auth-instance.js +0 -3
  336. package/dist/server/better-auth-instance.js.map +1 -1
  337. package/dist/server/builder-browser.d.ts.map +1 -1
  338. package/dist/server/builder-browser.js +23 -0
  339. package/dist/server/builder-browser.js.map +1 -1
  340. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  341. package/dist/server/core-routes-plugin.js +29 -14
  342. package/dist/server/core-routes-plugin.js.map +1 -1
  343. package/dist/server/credential-provider.d.ts +14 -0
  344. package/dist/server/credential-provider.d.ts.map +1 -1
  345. package/dist/server/credential-provider.js +88 -11
  346. package/dist/server/credential-provider.js.map +1 -1
  347. package/dist/server/google-auth-plugin.d.ts.map +1 -1
  348. package/dist/server/google-auth-plugin.js +65 -17
  349. package/dist/server/google-auth-plugin.js.map +1 -1
  350. package/dist/server/google-oauth.d.ts.map +1 -1
  351. package/dist/server/google-oauth.js +47 -17
  352. package/dist/server/google-oauth.js.map +1 -1
  353. package/dist/server/index.d.ts +1 -1
  354. package/dist/server/index.d.ts.map +1 -1
  355. package/dist/server/index.js +1 -1
  356. package/dist/server/index.js.map +1 -1
  357. package/dist/server/local-migration.d.ts +41 -0
  358. package/dist/server/local-migration.d.ts.map +1 -0
  359. package/dist/server/local-migration.js +235 -0
  360. package/dist/server/local-migration.js.map +1 -0
  361. package/dist/server/oauth-public-origin.d.ts.map +1 -1
  362. package/dist/server/oauth-public-origin.js +19 -1
  363. package/dist/server/oauth-public-origin.js.map +1 -1
  364. package/dist/server/onboarding-html.d.ts.map +1 -1
  365. package/dist/server/onboarding-html.js +74 -19
  366. package/dist/server/onboarding-html.js.map +1 -1
  367. package/dist/server/poll.d.ts.map +1 -1
  368. package/dist/server/poll.js +20 -5
  369. package/dist/server/poll.js.map +1 -1
  370. package/dist/server/request-context.d.ts +8 -0
  371. package/dist/server/request-context.d.ts.map +1 -1
  372. package/dist/server/request-context.js.map +1 -1
  373. package/dist/shared/index.d.ts +2 -0
  374. package/dist/shared/index.d.ts.map +1 -1
  375. package/dist/shared/index.js +2 -0
  376. package/dist/shared/index.js.map +1 -1
  377. package/dist/shared/llm-connection.d.ts +10 -0
  378. package/dist/shared/llm-connection.d.ts.map +1 -0
  379. package/dist/shared/llm-connection.js +29 -0
  380. package/dist/shared/llm-connection.js.map +1 -0
  381. package/dist/shared/workspace-app-audience.d.ts +25 -0
  382. package/dist/shared/workspace-app-audience.d.ts.map +1 -0
  383. package/dist/shared/workspace-app-audience.js +126 -0
  384. package/dist/shared/workspace-app-audience.js.map +1 -0
  385. package/dist/shared/workspace-app-id.d.ts +1 -1
  386. package/dist/shared/workspace-app-id.d.ts.map +1 -1
  387. package/dist/shared/workspace-app-id.js +1 -0
  388. package/dist/shared/workspace-app-id.js.map +1 -1
  389. package/dist/sharing/access.d.ts.map +1 -1
  390. package/dist/sharing/access.js +46 -5
  391. package/dist/sharing/access.js.map +1 -1
  392. package/dist/sharing/actions/list-resource-shares.d.ts.map +1 -1
  393. package/dist/sharing/actions/list-resource-shares.js +8 -1
  394. package/dist/sharing/actions/list-resource-shares.js.map +1 -1
  395. package/dist/sharing/actions/set-resource-visibility.d.ts.map +1 -1
  396. package/dist/sharing/actions/set-resource-visibility.js +12 -3
  397. package/dist/sharing/actions/set-resource-visibility.js.map +1 -1
  398. package/dist/sharing/actions/share-resource.d.ts.map +1 -1
  399. package/dist/sharing/actions/share-resource.js +50 -1
  400. package/dist/sharing/actions/share-resource.js.map +1 -1
  401. package/dist/sharing/registry.d.ts +26 -0
  402. package/dist/sharing/registry.d.ts.map +1 -1
  403. package/dist/sharing/registry.js.map +1 -1
  404. package/dist/styles/agent-native.css +91 -0
  405. package/dist/templates/default/.agents/skills/adding-a-feature/SKILL.md +72 -0
  406. package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +60 -37
  407. package/dist/templates/default/.agents/skills/real-time-sync/SKILL.md +28 -17
  408. package/dist/templates/default/.agents/skills/shadcn-ui/SKILL.md +79 -0
  409. package/dist/templates/default/AGENTS.md +22 -19
  410. package/dist/templates/default/actions/navigate.ts +3 -0
  411. package/dist/templates/default/app/hooks/use-navigation-state.ts +29 -5
  412. package/dist/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +251 -0
  413. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +264 -0
  414. package/dist/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +130 -0
  415. package/dist/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +112 -0
  416. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +88 -0
  417. package/dist/templates/workspace-core/.agents/skills/automations/SKILL.md +191 -0
  418. package/dist/templates/workspace-core/.agents/skills/capture-learnings/SKILL.md +74 -0
  419. package/dist/templates/workspace-core/.agents/skills/client-side-routing/SKILL.md +75 -0
  420. package/dist/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +190 -0
  421. package/dist/templates/workspace-core/.agents/skills/create-skill/SKILL.md +168 -0
  422. package/dist/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +163 -0
  423. package/dist/templates/workspace-core/.agents/skills/extension-points/SKILL.md +205 -0
  424. package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +720 -0
  425. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +92 -0
  426. package/dist/templates/workspace-core/.agents/skills/integration-webhooks/SKILL.md +285 -0
  427. package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +192 -0
  428. package/dist/templates/workspace-core/.agents/skills/onboarding/SKILL.md +43 -0
  429. package/dist/templates/workspace-core/.agents/skills/portability/SKILL.md +84 -0
  430. package/dist/templates/workspace-core/.agents/skills/qa/SKILL.md +313 -0
  431. package/dist/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +112 -0
  432. package/dist/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +165 -0
  433. package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +41 -0
  434. package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +239 -0
  435. package/dist/templates/workspace-core/.agents/skills/security/SKILL.md +191 -0
  436. package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +79 -0
  437. package/dist/templates/workspace-core/.agents/skills/server-plugins/SKILL.md +73 -0
  438. package/dist/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +79 -0
  439. package/dist/templates/workspace-core/.agents/skills/sharing/SKILL.md +217 -0
  440. package/dist/templates/workspace-core/.agents/skills/storing-data/SKILL.md +132 -0
  441. package/dist/templates/workspace-core/.agents/skills/tracking/SKILL.md +150 -0
  442. package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +124 -0
  443. package/dist/templates/workspace-core/AGENTS.md +16 -1
  444. package/dist/templates/workspace-root/AGENTS.md +35 -0
  445. package/dist/templates/workspace-root/README.md +7 -0
  446. package/dist/tools/actions.d.ts +3 -0
  447. package/dist/tools/actions.d.ts.map +1 -0
  448. package/dist/tools/actions.js +272 -0
  449. package/dist/tools/actions.js.map +1 -0
  450. package/dist/tools/fetch-tool.d.ts +23 -0
  451. package/dist/tools/fetch-tool.d.ts.map +1 -0
  452. package/dist/tools/fetch-tool.js +178 -0
  453. package/dist/tools/fetch-tool.js.map +1 -0
  454. package/dist/tools/html-shell.d.ts +45 -0
  455. package/dist/tools/html-shell.d.ts.map +1 -0
  456. package/dist/tools/html-shell.js +514 -0
  457. package/dist/tools/html-shell.js.map +1 -0
  458. package/dist/tools/proxy-security.d.ts +12 -0
  459. package/dist/tools/proxy-security.d.ts.map +1 -0
  460. package/dist/tools/proxy-security.js +158 -0
  461. package/dist/tools/proxy-security.js.map +1 -0
  462. package/dist/tools/routes.d.ts +2 -0
  463. package/dist/tools/routes.d.ts.map +1 -0
  464. package/dist/tools/routes.js +627 -0
  465. package/dist/tools/routes.js.map +1 -0
  466. package/dist/tools/schema.d.ts +664 -0
  467. package/dist/tools/schema.d.ts.map +1 -0
  468. package/dist/tools/schema.js +146 -0
  469. package/dist/tools/schema.js.map +1 -0
  470. package/dist/tools/slots/routes.d.ts +15 -0
  471. package/dist/tools/slots/routes.d.ts.map +1 -0
  472. package/dist/tools/slots/routes.js +94 -0
  473. package/dist/tools/slots/routes.js.map +1 -0
  474. package/dist/tools/slots/schema.d.ts +303 -0
  475. package/dist/tools/slots/schema.d.ts.map +1 -0
  476. package/dist/tools/slots/schema.js +76 -0
  477. package/dist/tools/slots/schema.js.map +1 -0
  478. package/dist/tools/slots/store.d.ts +66 -0
  479. package/dist/tools/slots/store.d.ts.map +1 -0
  480. package/dist/tools/slots/store.js +227 -0
  481. package/dist/tools/slots/store.js.map +1 -0
  482. package/dist/tools/store.d.ts +40 -0
  483. package/dist/tools/store.d.ts.map +1 -0
  484. package/dist/tools/store.js +193 -0
  485. package/dist/tools/store.js.map +1 -0
  486. package/dist/tools/theme.d.ts +2 -0
  487. package/dist/tools/theme.d.ts.map +1 -0
  488. package/dist/tools/theme.js +67 -0
  489. package/dist/tools/theme.js.map +1 -0
  490. package/dist/tools/url-safety.d.ts +24 -0
  491. package/dist/tools/url-safety.d.ts.map +1 -0
  492. package/dist/tools/url-safety.js +224 -0
  493. package/dist/tools/url-safety.js.map +1 -0
  494. package/dist/vite/action-types-plugin.d.ts.map +1 -1
  495. package/dist/vite/action-types-plugin.js +4 -0
  496. package/dist/vite/action-types-plugin.js.map +1 -1
  497. package/docs/content/authentication.md +36 -0
  498. package/docs/content/creating-templates.md +15 -0
  499. package/docs/content/dispatch.md +3 -3
  500. package/docs/content/multi-app-workspace.md +5 -0
  501. package/docs/content/tracking.md +12 -0
  502. package/docs/content/workspace-management.md +39 -4
  503. package/package.json +15 -12
  504. package/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +72 -0
  505. package/src/templates/default/.agents/skills/frontend-design/SKILL.md +60 -37
  506. package/src/templates/default/.agents/skills/real-time-sync/SKILL.md +28 -17
  507. package/src/templates/default/.agents/skills/shadcn-ui/SKILL.md +79 -0
  508. package/src/templates/default/AGENTS.md +22 -19
  509. package/src/templates/default/actions/navigate.ts +3 -0
  510. package/src/templates/default/app/hooks/use-navigation-state.ts +29 -5
  511. package/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +251 -0
  512. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +264 -0
  513. package/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +130 -0
  514. package/src/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +112 -0
  515. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +88 -0
  516. package/src/templates/workspace-core/.agents/skills/automations/SKILL.md +191 -0
  517. package/src/templates/workspace-core/.agents/skills/capture-learnings/SKILL.md +74 -0
  518. package/src/templates/workspace-core/.agents/skills/client-side-routing/SKILL.md +75 -0
  519. package/src/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +190 -0
  520. package/src/templates/workspace-core/.agents/skills/create-skill/SKILL.md +168 -0
  521. package/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +163 -0
  522. package/src/templates/workspace-core/.agents/skills/extension-points/SKILL.md +205 -0
  523. package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +720 -0
  524. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +92 -0
  525. package/src/templates/workspace-core/.agents/skills/integration-webhooks/SKILL.md +285 -0
  526. package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +192 -0
  527. package/src/templates/workspace-core/.agents/skills/onboarding/SKILL.md +43 -0
  528. package/src/templates/workspace-core/.agents/skills/portability/SKILL.md +84 -0
  529. package/src/templates/workspace-core/.agents/skills/qa/SKILL.md +313 -0
  530. package/src/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +112 -0
  531. package/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +165 -0
  532. package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +41 -0
  533. package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +239 -0
  534. package/src/templates/workspace-core/.agents/skills/security/SKILL.md +191 -0
  535. package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +79 -0
  536. package/src/templates/workspace-core/.agents/skills/server-plugins/SKILL.md +73 -0
  537. package/src/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +79 -0
  538. package/src/templates/workspace-core/.agents/skills/sharing/SKILL.md +217 -0
  539. package/src/templates/workspace-core/.agents/skills/storing-data/SKILL.md +132 -0
  540. package/src/templates/workspace-core/.agents/skills/tracking/SKILL.md +150 -0
  541. package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +124 -0
  542. package/src/templates/workspace-core/AGENTS.md +16 -1
  543. package/src/templates/workspace-root/AGENTS.md +35 -0
  544. package/src/templates/workspace-root/README.md +7 -0
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: voice-transcription
3
+ description: >-
4
+ Framework-wide voice dictation in the agent sidebar composer. Use when
5
+ changing composer microphone UX, the transcribe-voice route, or the
6
+ Voice Transcription settings section. Covers transcription-source routing,
7
+ cleanup routing, Google realtime gating, and the voice transcription
8
+ application-state keys.
9
+ ---
10
+
11
+ # Voice Transcription
12
+
13
+ Click-to-toggle microphone inside the sidebar composer turns speech into
14
+ text. Users configure live transcription separately from AI cleanup in
15
+ Settings → Voice Transcription. The feature is available in every template
16
+ that renders `TiptapComposer`.
17
+
18
+ ## UX rules
19
+
20
+ - **Always show the mic alongside the send button.** Cursor replaces send
21
+ with mic when the composer is empty; their users complain. We keep both
22
+ visible — Lovable does the same.
23
+ - **Click-to-toggle, not push-to-talk.** More forgiving in a sidebar, avoids
24
+ host-app hotkey clashes. Keyboard shortcut is `Cmd/Ctrl+Shift+M` and
25
+ `Escape` cancels mid-recording.
26
+ - **Transcript lands in the composer, editable, never auto-sent.** Insert at
27
+ the caret via `editor.chain().focus().insertContent(text).run()`.
28
+ - **No CSS transitions for the recording state.** Framework rule; use static
29
+ brand color (`#625DF5`) instead of pulses.
30
+ - **Icon:** Tabler `IconMicrophone` (idle) / `IconPlayerStopFilled` (recording).
31
+ Never use a sparkle or robot icon.
32
+ - **Errors via inline alert or toast, never `window.alert`.**
33
+
34
+ ## Source And Cleanup
35
+
36
+ Settings must keep these as separate choices:
37
+
38
+ - **Live transcription source**: `mac-native`, `google-realtime`, or `batch`.
39
+ - **AI cleanup**: independent off/on toggle. Cleanup uses Builder Gemini first
40
+ when hosted Gemini is configured, then BYOK Gemini (`GEMINI_API_KEY`).
41
+ Gemini cleanup/title/summary generation is not a live STT source.
42
+
43
+ `application_state["voice-transcription-prefs"]` stores
44
+ `{ transcriptionMode, provider, instructions }`. The legacy `provider` field
45
+ is still written for old clients and batch provider preferences:
46
+
47
+ | Value | Meaning | Needs key |
48
+ | ----------------- | -------------------------------------------------------------- | ---------------------------- |
49
+ | `mac-native` | Native macOS/Tauri speech path; web clients normalize to browser-native where needed | No |
50
+ | `google-realtime` | Dedicated WebSocket → Google Speech-to-Text gRPC `StreamingRecognize` path | `GOOGLE_APPLICATION_CREDENTIALS` |
51
+ | `batch` | Upload audio after stop through the existing batch route | Builder/Gemini/Groq/OpenAI depending on fallback |
52
+ | `auto` provider | Existing batch fallback chain | Any configured batch provider |
53
+ | `builder-gemini` | Builder Gemini Flash-Lite batch/cleanup preference | hosted Gemini provider connected |
54
+ | `gemini` | Direct Google Gemini BYOK batch/cleanup preference | `GEMINI_API_KEY` |
55
+ | `groq` | Groq Whisper batch preference | `GROQ_API_KEY` |
56
+ | `openai` | OpenAI Whisper batch preference | `OPENAI_API_KEY` |
57
+ | `browser` | Legacy native/browser live speech preference | No |
58
+
59
+ Default behavior:
60
+
61
+ - The shared web settings/composer default to Batch / `auto`.
62
+ - Dedicated macOS Tauri-native surfaces may save `mac-native`, but do not
63
+ assume the shared React settings default to it.
64
+ - Old stored `builder` values are treated as `builder-gemini`.
65
+ - Old stored `browser` values are treated as `mac-native`.
66
+ - Saved `google-realtime` preferences must never hit `/_agent-native/transcribe-voice`. They go through the dedicated session bridge `POST /_agent-native/transcribe-stream/session`, which mints an opaque ai-services websocket session and keeps the Google service-account JSON off the client.
67
+ - In the current bridge, the Google option is only actually ready when both the user's `GOOGLE_APPLICATION_CREDENTIALS` secret exists and Builder is connected, because the framework mints the managed ai-services session with Builder auth before streaming begins.
68
+
69
+ ## Where the pieces live
70
+
71
+ | File | Purpose |
72
+ | --------------------------------------------------------------------- | --------------------------------------------------- |
73
+ | `packages/core/src/client/composer/useVoiceDictation.ts` | Provider-routing hook (MediaRecorder / Web Speech) |
74
+ | `packages/core/src/client/composer/VoiceButton.tsx` | Mic button + live amplitude + cancel overlay |
75
+ | `packages/core/src/client/composer/TiptapComposer.tsx` | Wires the hook, insertion, and keyboard shortcut |
76
+ | `packages/core/src/client/settings/VoiceTranscriptionSection.tsx` | Live source + cleanup controls in sidebar settings |
77
+ | `packages/core/src/client/transcription/BuilderTranscriptionCta.tsx` | CTA shown when Builder account isn't connected |
78
+ | `packages/core/src/client/transcription/use-live-transcription.ts` | Web Speech live-transcription hook for recordings |
79
+ | `packages/core/src/server/transcribe-voice.ts` | Route handler (routes to Builder/Gemini/Groq/Whisper) |
80
+ | `packages/core/src/transcription/builder-transcription.ts` | Builder proxy transcription client |
81
+ | `packages/core/src/secrets/register-framework-secrets.ts` | Framework-level provider key registration |
82
+
83
+ ## Key resolution (server)
84
+
85
+ `transcribe-voice.ts` is batch-only. Do not add realtime streaming to this
86
+ route. Google Speech-to-Text realtime uses a dedicated audio-frame protocol:
87
+ client audio frames → `/_agent-native/transcribe-stream/session` →
88
+ ai-services WebSocket → Google gRPC `StreamingRecognize` → partial / final
89
+ transcript events. Use the canonical docs URL:
90
+ https://cloud.google.com/speech-to-text/v2/docs/streaming-recognize
91
+
92
+ Batch routing is based on the user's provider preference:
93
+
94
+ 1. If `builder-gemini` and `resolveHasBuilderPrivateKey()` → calls `transcribeWithBuilder({ model: "gemini-3-1-flash-lite" })` via Builder proxy, or uses Builder Gemini Flash-Lite to clean up a live native/browser transcript when the desktop client sends text instead of audio.
95
+ 2. If `builder` and `resolveHasBuilderPrivateKey()` → legacy alias; prefer `builder-gemini`.
96
+ 3. If `gemini` → resolves `GEMINI_API_KEY` and calls the direct Google Gemini path.
97
+ 4. If `groq` → resolves `GROQ_API_KEY` and calls Groq's Whisper-compatible endpoint.
98
+ 5. If `openai` → resolves `OPENAI_API_KEY`:
99
+ - `readAppSecret({ key: "OPENAI_API_KEY", scope: "user", scopeId: session.email })` — user's encrypted secret.
100
+ - `resolveCredential("OPENAI_API_KEY")` — env var + SQL settings fallback.
101
+
102
+ In auto mode / no preference, the route tries Builder Gemini Flash-Lite first
103
+ when Builder is connected, then Gemini BYOK, Groq, and OpenAI.
104
+ When a request includes `instructions`, pass them through to the selected LLM
105
+ provider. Gemini uses them in the transcription prompt, Builder receives them
106
+ as transcription/cleanup instructions, and Whisper-compatible providers receive
107
+ them as provider prompt/context.
108
+
109
+ Never hardcode a shared key. Never log the value. Never echo it back to the
110
+ client.
111
+
112
+ ## Overriding per-template
113
+
114
+ Templates can:
115
+ - **Disable the mic**: pass `voiceEnabled={false}` to `TiptapComposer`.
116
+ - **Replace the button**: wrap `TiptapComposer` and render your own `extraActionButton` (the framework mic sits between `extraActionButton` and the send button).
117
+ - **Pre-register provider keys as `required: true`**: call `registerRequiredSecret(...)` from your own server plugin when a template needs a specific BYOK provider in onboarding.
118
+
119
+ ## Don'ts
120
+
121
+ - Don't call transcription providers from the client — go through `/_agent-native/transcribe-voice` so the user's secret stays server-side.
122
+ - Don't remove the cancel affordance — mic permission abuse paranoia is real.
123
+ - Don't auto-submit the transcript — users always edit before sending.
124
+ - Don't copy Cursor's "hide send when empty" pattern — it confuses users.
@@ -11,12 +11,22 @@ agent should know.
11
11
 
12
12
  ## Shared Conventions
13
13
 
14
+ - All AI/LLM behavior goes through the app's agent chat. UI and server code
15
+ must not call model providers, AI SDK `generateText()` / `streamText()`, or
16
+ other inline LLM APIs directly. Use `sendToAgentChat()` for local app-agent
17
+ work, and read `.agents/skills/delegate-to-agent/SKILL.md` before building
18
+ agent-driven UI or "AI" features.
14
19
  - Put shared code in `packages/shared` only when multiple apps need it.
15
20
  - Keep app-specific screens, actions, state, and skills inside `apps/<app>`.
16
21
  - Store shared runtime configuration in the workspace root `.env`; use
17
22
  `apps/<app>/.env` only for app-specific overrides.
18
23
  - Prefer framework defaults until the workspace has a real custom rule,
19
24
  component, plugin, action, or skill to share.
25
+ - Keep the Workspace files view for user-authored or user-requested resources.
26
+ Agents may create hidden `agent_scratch` resources for temporary working
27
+ notes, scripts, task plans, or intermediate outputs, but should promote them
28
+ to normal workspace visibility only when the user explicitly asks to keep or
29
+ manage the file.
20
30
 
21
31
  ## Adding Apps
22
32
 
@@ -33,6 +43,10 @@ Do not implement a new app by adding a route, page, component, or file to
33
43
  `apps/starter` or another existing app unless the user explicitly asks to modify
34
44
  that existing app.
35
45
 
46
+ Dispatch vault access is workspace-wide by default: every saved vault key is
47
+ available to every workspace app. Only create or request per-app vault grants
48
+ when Dispatch's vault access setting is switched to manual mode.
49
+
36
50
  Workspace apps are discovered from `apps/<app-name>/package.json`. There is no
37
51
  separate workspace app registry to edit for Dispatch to list the app. Use
38
52
  relative workspace links like `/<app-name>` and never hardcode `localhost`,
@@ -42,7 +56,8 @@ port. React Router apps must preserve `APP_BASE_PATH` / `VITE_APP_BASE_PATH` in
42
56
  `app/entry.client.tsx` via `appBasePath()` so the app hydrates correctly when
43
57
  mounted at `/<app-name>`. Use the framework/template UI stack for standard UI:
44
58
  shadcn/ui components and `@tabler/icons-react`. Do not add `lucide-react` or
45
- another icon library.
59
+ another icon library. Read `.agents/skills/shadcn-ui/SKILL.md` before adding,
60
+ updating, or debugging shadcn components.
46
61
 
47
62
  In local development, run
48
63
  `pnpm exec agent-native create <app-name> --template=<template>` from the
@@ -3,6 +3,27 @@
3
3
  These instructions apply at the workspace root. App-specific behavior belongs
4
4
  in `apps/<app>/AGENTS.md`; shared cross-app behavior belongs in
5
5
  `packages/shared/AGENTS.md` or `packages/shared/.agents/skills/`.
6
+ The root `.agents/skills` path points at the shared package's skills so local
7
+ coding agents can discover the same workspace-wide guidance from the root.
8
+
9
+ ## Core Agent Rule
10
+
11
+ - All AI/LLM behavior goes through the app's agent chat. UI and server code
12
+ must not call model providers, AI SDK `generateText()` / `streamText()`, or
13
+ other inline LLM APIs directly. Use `sendToAgentChat()` for local app-agent
14
+ work, and read `packages/shared/.agents/skills/delegate-to-agent/SKILL.md`
15
+ before building agent-driven UI or "AI" features.
16
+
17
+ ## Workspace Resources
18
+
19
+ - The Workspace files view is for user-authored or user-requested resources
20
+ they intentionally add, edit, or manage.
21
+ - Agents may use hidden `agent_scratch` resources for temporary working notes,
22
+ scripts, task plans, or intermediate outputs. Keep those scratch files hidden
23
+ by default and promote them only when the user explicitly asks to keep or
24
+ manage the file.
25
+ - Durable instructions, skills, jobs, memories, custom agents, and files the
26
+ user explicitly asked to save belong in normal workspace visibility.
6
27
 
7
28
  ## Workspace Scope
8
29
 
@@ -26,6 +47,9 @@ in `apps/<app>/AGENTS.md`; shared cross-app behavior belongs in
26
47
  `/<app-id>`.
27
48
  - When a user explicitly asks for a new app or workspace app, create the
28
49
  separate workspace app.
50
+ - Dispatch vault access is workspace-wide by default: every saved vault key is
51
+ available to every workspace app. Only create or request per-app vault grants
52
+ when Dispatch's vault access setting is switched to manual mode.
29
53
  - Do not satisfy a new-app request by adding a route, page, component, or file
30
54
  to `apps/starter` or another existing app unless the user explicitly asks to
31
55
  modify that existing app.
@@ -44,6 +68,15 @@ in `apps/<app>/AGENTS.md`; shared cross-app behavior belongs in
44
68
  base template improvements continue to flow automatically.
45
69
  - Workspace apps are discovered from `apps/<app-id>/package.json`. There is no
46
70
  separate workspace app registry to edit for Dispatch to list the app.
71
+ - Always save a concise, human-readable `description` in the generated app's
72
+ `apps/<app-id>/package.json`. Dispatch lists and A2A connected-agent context
73
+ use the app name plus this description so other agents understand what the app
74
+ does. Dispatch users can later edit the displayed name/description from the
75
+ Apps page without changing source.
76
+ - All sibling workspace apps are accessible by default over A2A through
77
+ `call-agent`. Agents receive a compact list of available app names and
78
+ descriptions in prompt context; use tool search or app-specific actions only
79
+ when more detail is needed.
47
80
  - Use relative workspace links like `/<app-id>`. Never hardcode
48
81
  `localhost`, `127.0.0.1`, `8080`, `8100`, or any dev port in app cards,
49
82
  instructions, redirects, or navigation; the active workspace gateway/browser
@@ -53,6 +86,8 @@ in `apps/<app>/AGENTS.md`; shared cross-app behavior belongs in
53
86
  when mounted at `/<app-id>`.
54
87
  - Use the framework/template UI stack for standard UI: shadcn/ui components and
55
88
  `@tabler/icons-react`. Do not add `lucide-react` or another icon library.
89
+ Read `packages/shared/.agents/skills/shadcn-ui/SKILL.md` before adding,
90
+ updating, or debugging shadcn components.
56
91
  - In local development, scaffold the app from the workspace root with
57
92
  `pnpm exec agent-native create <app-id> --template=<template>`. In production
58
93
  Dispatch posts the request to Builder branch creation; the Builder branch
@@ -33,6 +33,9 @@ Apps don't need any configuration to opt in. Discovery happens via the
33
33
  `agent-native.workspaceCore` field in this root `package.json`, which names
34
34
  the shared package (`@{{APP_NAME}}/shared`).
35
35
 
36
+ The workspace root also links `.agents/skills` to the shared package so coding
37
+ agents launched from the root can discover the same workspace-wide skills.
38
+
36
39
  ## Getting started
37
40
 
38
41
  ```bash
@@ -49,6 +52,10 @@ watches `apps/`, so newly-created apps are detected without restarting
49
52
  links should stay relative, such as `/starter` or `/<app-id>`; do not hardcode
50
53
  localhost or dev ports because the active gateway origin owns the port.
51
54
 
55
+ Dispatch vault keys are workspace-wide by default: every saved vault key is
56
+ available to every workspace app and can be synced from Dispatch. Switch the
57
+ Vault page to manual access only when you need explicit per-app key grants.
58
+
52
59
  ## Workspace org identity
53
60
 
54
61
  Set these root `.env` values before production deploys or when repairing
@@ -0,0 +1,3 @@
1
+ import type { ActionEntry } from "../agent/production-agent.js";
2
+ export declare function createToolActionEntries(): Record<string, ActionEntry>;
3
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/tools/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAYhE,wBAAgB,uBAAuB,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAiRrE"}
@@ -0,0 +1,272 @@
1
+ import { createTool, getTool, updateTool, updateToolContent } from "./store.js";
2
+ import { addToolSlotTarget, installToolSlot, uninstallToolSlot, listToolsForSlot, listSlotsForTool, } from "./slots/store.js";
3
+ export function createToolActionEntries() {
4
+ return {
5
+ "create-tool": {
6
+ tool: {
7
+ description: "Create a sandboxed Alpine.js mini-app tool. Use this when the user asks to create, build, or make a tool/widget/dashboard/calculator. The content must be a self-contained Alpine.js HTML body snippet that can use appAction(), appFetch(), dbQuery(), dbExec(), toolFetch(), and toolData.",
8
+ parameters: {
9
+ type: "object",
10
+ properties: {
11
+ name: {
12
+ type: "string",
13
+ description: 'Short display name for the tool. Do not include "app" — e.g. name a todo app "Todos", a weather app "Weather".',
14
+ },
15
+ description: {
16
+ type: "string",
17
+ description: "One-sentence summary of what the tool does.",
18
+ },
19
+ content: {
20
+ type: "string",
21
+ description: "Self-contained Alpine.js HTML body snippet. The iframe body has no padding, so add p-4 or p-6 to the outermost element. Use semantic Tailwind colors (bg-background, text-foreground, bg-primary, etc.) for native theming. Do not include a full app build, React code, or source files.",
22
+ },
23
+ icon: {
24
+ type: "string",
25
+ description: "Optional icon name or short label.",
26
+ },
27
+ },
28
+ required: ["name", "content"],
29
+ },
30
+ },
31
+ run: async (args) => {
32
+ const name = String(args?.name ?? "").trim();
33
+ const content = String(args?.content ?? "").trim();
34
+ if (!name)
35
+ return "Error: name is required.";
36
+ if (!content)
37
+ return "Error: content is required.";
38
+ const tool = await createTool({
39
+ name,
40
+ description: String(args?.description ?? "").trim(),
41
+ content,
42
+ icon: args?.icon ? String(args.icon) : undefined,
43
+ });
44
+ return {
45
+ ok: true,
46
+ tool,
47
+ next: `Navigate to /tools/${tool.id} or use the navigate action with --view=tools --toolId=${tool.id}.`,
48
+ };
49
+ },
50
+ },
51
+ "update-tool": {
52
+ tool: {
53
+ description: "Update an existing sandboxed Alpine.js mini-app tool. Prefer patches for surgical edits; use full content replacement only when necessary.",
54
+ parameters: {
55
+ type: "object",
56
+ properties: {
57
+ id: {
58
+ type: "string",
59
+ description: "Tool id to update.",
60
+ },
61
+ name: {
62
+ type: "string",
63
+ description: "Optional new display name.",
64
+ },
65
+ description: {
66
+ type: "string",
67
+ description: "Optional new description.",
68
+ },
69
+ content: {
70
+ type: "string",
71
+ description: "Optional full replacement Alpine.js HTML body snippet.",
72
+ },
73
+ patches: {
74
+ type: "string",
75
+ description: 'Optional JSON array of { "find": "...", "replace": "..." } patches to apply to the current content.',
76
+ },
77
+ icon: {
78
+ type: "string",
79
+ description: "Optional icon name or short label.",
80
+ },
81
+ visibility: {
82
+ type: "string",
83
+ description: "Optional sharing visibility.",
84
+ enum: ["private", "org", "public"],
85
+ },
86
+ },
87
+ required: ["id"],
88
+ },
89
+ },
90
+ run: async (args) => {
91
+ const id = String(args?.id ?? "").trim();
92
+ if (!id)
93
+ return "Error: id is required.";
94
+ let result = null;
95
+ if (args?.content !== undefined || args?.patches !== undefined) {
96
+ const patches = parsePatches(args.patches);
97
+ if (args?.patches !== undefined && !patches) {
98
+ return "Error: patches must be a JSON array of { find, replace } objects.";
99
+ }
100
+ result = await updateToolContent(id, {
101
+ content: args?.content !== undefined ? String(args.content) : undefined,
102
+ patches,
103
+ });
104
+ }
105
+ const meta = {};
106
+ if (args?.name !== undefined)
107
+ meta.name = String(args.name).trim();
108
+ if (args?.description !== undefined) {
109
+ meta.description = String(args.description).trim();
110
+ }
111
+ if (args?.icon !== undefined)
112
+ meta.icon = String(args.icon);
113
+ if (args?.visibility !== undefined) {
114
+ meta.visibility = String(args.visibility);
115
+ }
116
+ if (Object.keys(meta).length > 0) {
117
+ result = await updateTool(id, meta);
118
+ }
119
+ if (!result)
120
+ result = await getTool(id);
121
+ if (!result)
122
+ return `Error: tool not found: ${id}`;
123
+ return { ok: true, tool: result };
124
+ },
125
+ },
126
+ "add-tool-slot-target": {
127
+ tool: {
128
+ description: 'Declare that a tool can render in a UI extension-point slot of an app (e.g. "mail.contact-sidebar.bottom"). Apps drop ExtensionSlot components in their UI; this action registers a tool as installable into one of those slots. Slot IDs follow the convention <app>.<area>.<position>. Caller must have editor access to the tool.',
129
+ parameters: {
130
+ type: "object",
131
+ properties: {
132
+ toolId: { type: "string", description: "Tool id." },
133
+ slotId: {
134
+ type: "string",
135
+ description: 'Slot identifier — e.g. "mail.contact-sidebar.bottom".',
136
+ },
137
+ config: {
138
+ type: "string",
139
+ description: "Optional JSON string with slot-specific config (defaults, hints, etc.).",
140
+ },
141
+ },
142
+ required: ["toolId", "slotId"],
143
+ },
144
+ },
145
+ run: async (args) => {
146
+ const toolId = String(args?.toolId ?? "").trim();
147
+ const slotId = String(args?.slotId ?? "").trim();
148
+ if (!toolId)
149
+ return "Error: toolId is required.";
150
+ if (!slotId)
151
+ return "Error: slotId is required.";
152
+ const row = await addToolSlotTarget(toolId, slotId, args?.config ? String(args.config) : undefined);
153
+ return { ok: true, slot: row };
154
+ },
155
+ },
156
+ "install-extension": {
157
+ tool: {
158
+ description: "Install a tool as a widget in an extension-point slot for the current user. The tool must already declare the slot via add-tool-slot-target. Per-user installation — only affects the calling user's view. Use after creating a tool that targets a slot, or when the user asks to add an existing widget to a slot.",
159
+ parameters: {
160
+ type: "object",
161
+ properties: {
162
+ toolId: { type: "string", description: "Tool id to install." },
163
+ slotId: {
164
+ type: "string",
165
+ description: 'Slot identifier — e.g. "mail.contact-sidebar.bottom".',
166
+ },
167
+ position: {
168
+ type: "number",
169
+ description: "Optional integer position within the slot (lower = earlier). Defaults to end.",
170
+ },
171
+ config: {
172
+ type: "string",
173
+ description: "Optional JSON string with per-install config (overrides, settings).",
174
+ },
175
+ },
176
+ required: ["toolId", "slotId"],
177
+ },
178
+ },
179
+ run: async (args) => {
180
+ const toolId = String(args?.toolId ?? "").trim();
181
+ const slotId = String(args?.slotId ?? "").trim();
182
+ if (!toolId)
183
+ return "Error: toolId is required.";
184
+ if (!slotId)
185
+ return "Error: slotId is required.";
186
+ const position = args?.position !== undefined && args.position !== null
187
+ ? Number(args.position)
188
+ : undefined;
189
+ const row = await installToolSlot(toolId, slotId, {
190
+ position: Number.isFinite(position) ? position : undefined,
191
+ config: args?.config ? String(args.config) : undefined,
192
+ });
193
+ return { ok: true, install: row };
194
+ },
195
+ },
196
+ "uninstall-extension": {
197
+ tool: {
198
+ description: "Remove a tool from an extension-point slot for the current user. Does not delete the tool itself.",
199
+ parameters: {
200
+ type: "object",
201
+ properties: {
202
+ toolId: { type: "string", description: "Tool id." },
203
+ slotId: { type: "string", description: "Slot identifier." },
204
+ },
205
+ required: ["toolId", "slotId"],
206
+ },
207
+ },
208
+ run: async (args) => {
209
+ const toolId = String(args?.toolId ?? "").trim();
210
+ const slotId = String(args?.slotId ?? "").trim();
211
+ if (!toolId)
212
+ return "Error: toolId is required.";
213
+ if (!slotId)
214
+ return "Error: slotId is required.";
215
+ await uninstallToolSlot(toolId, slotId);
216
+ return { ok: true };
217
+ },
218
+ },
219
+ "list-tools-for-slot": {
220
+ tool: {
221
+ description: "List tools the current user has access to that declare a given extension-point slot. Use to discover what's available to install into a slot the user mentioned.",
222
+ parameters: {
223
+ type: "object",
224
+ properties: {
225
+ slotId: { type: "string", description: "Slot identifier." },
226
+ },
227
+ required: ["slotId"],
228
+ },
229
+ },
230
+ run: async (args) => {
231
+ const slotId = String(args?.slotId ?? "").trim();
232
+ if (!slotId)
233
+ return "Error: slotId is required.";
234
+ return { tools: await listToolsForSlot(slotId) };
235
+ },
236
+ readOnly: true,
237
+ },
238
+ "list-tool-slots": {
239
+ tool: {
240
+ description: "List the extension-point slots a specific tool declares it can render in. Caller must have viewer access to the tool.",
241
+ parameters: {
242
+ type: "object",
243
+ properties: {
244
+ toolId: { type: "string", description: "Tool id." },
245
+ },
246
+ required: ["toolId"],
247
+ },
248
+ },
249
+ run: async (args) => {
250
+ const toolId = String(args?.toolId ?? "").trim();
251
+ if (!toolId)
252
+ return "Error: toolId is required.";
253
+ return { slots: await listSlotsForTool(toolId) };
254
+ },
255
+ readOnly: true,
256
+ },
257
+ };
258
+ }
259
+ function parsePatches(value) {
260
+ if (value === undefined)
261
+ return undefined;
262
+ const parsed = typeof value === "string" ? JSON.parse(value) : value;
263
+ if (!Array.isArray(parsed))
264
+ return undefined;
265
+ if (parsed.some((patch) => !patch ||
266
+ typeof patch.find !== "string" ||
267
+ typeof patch.replace !== "string")) {
268
+ return undefined;
269
+ }
270
+ return parsed;
271
+ }
272
+ //# sourceMappingURL=actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/tools/actions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAI1B,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,aAAa,EAAE;YACb,IAAI,EAAE;gBACJ,WAAW,EACT,8RAA8R;gBAChS,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE;4BACJ,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,gHAAgH;yBACnH;wBACD,WAAW,EAAE;4BACX,IAA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production-agent.js\";\nimport { createTool, getTool, updateTool, updateToolContent } from \"./store.js\";\nimport {\n addToolSlotTarget,\n installToolSlot,\n uninstallToolSlot,\n listToolsForSlot,\n listSlotsForTool,\n} from \"./slots/store.js\";\n\ntype ToolPatch = { find: string; replace: string };\n\nexport function createToolActionEntries(): Record<string, ActionEntry> {\n return {\n \"create-tool\": {\n tool: {\n description:\n \"Create a sandboxed Alpine.js mini-app tool. Use this when the user asks to create, build, or make a tool/widget/dashboard/calculator. The content must be a self-contained Alpine.js HTML body snippet that can use appAction(), appFetch(), dbQuery(), dbExec(), toolFetch(), and toolData.\",\n parameters: {\n type: \"object\",\n properties: {\n name: {\n type: \"string\",\n description:\n 'Short display name for the tool. Do not include \"app\" — e.g. name a todo app \"Todos\", a weather app \"Weather\".',\n },\n description: {\n type: \"string\",\n description: \"One-sentence summary of what the tool does.\",\n },\n content: {\n type: \"string\",\n description:\n \"Self-contained Alpine.js HTML body snippet. The iframe body has no padding, so add p-4 or p-6 to the outermost element. Use semantic Tailwind colors (bg-background, text-foreground, bg-primary, etc.) for native theming. Do not include a full app build, React code, or source files.\",\n },\n icon: {\n type: \"string\",\n description: \"Optional icon name or short label.\",\n },\n },\n required: [\"name\", \"content\"],\n },\n },\n run: async (args) => {\n const name = String(args?.name ?? \"\").trim();\n const content = String(args?.content ?? \"\").trim();\n if (!name) return \"Error: name is required.\";\n if (!content) return \"Error: content is required.\";\n\n const tool = await createTool({\n name,\n description: String(args?.description ?? \"\").trim(),\n content,\n icon: args?.icon ? String(args.icon) : undefined,\n });\n\n return {\n ok: true,\n tool,\n next: `Navigate to /tools/${tool.id} or use the navigate action with --view=tools --toolId=${tool.id}.`,\n };\n },\n },\n\n \"update-tool\": {\n tool: {\n description:\n \"Update an existing sandboxed Alpine.js mini-app tool. Prefer patches for surgical edits; use full content replacement only when necessary.\",\n parameters: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"Tool id to update.\",\n },\n name: {\n type: \"string\",\n description: \"Optional new display name.\",\n },\n description: {\n type: \"string\",\n description: \"Optional new description.\",\n },\n content: {\n type: \"string\",\n description:\n \"Optional full replacement Alpine.js HTML body snippet.\",\n },\n patches: {\n type: \"string\",\n description:\n 'Optional JSON array of { \"find\": \"...\", \"replace\": \"...\" } patches to apply to the current content.',\n },\n icon: {\n type: \"string\",\n description: \"Optional icon name or short label.\",\n },\n visibility: {\n type: \"string\",\n description: \"Optional sharing visibility.\",\n enum: [\"private\", \"org\", \"public\"],\n },\n },\n required: [\"id\"],\n },\n },\n run: async (args) => {\n const id = String(args?.id ?? \"\").trim();\n if (!id) return \"Error: id is required.\";\n\n let result = null;\n if (args?.content !== undefined || args?.patches !== undefined) {\n const patches = parsePatches((args as any).patches);\n if (args?.patches !== undefined && !patches) {\n return \"Error: patches must be a JSON array of { find, replace } objects.\";\n }\n result = await updateToolContent(id, {\n content:\n args?.content !== undefined ? String(args.content) : undefined,\n patches,\n });\n }\n\n const meta: Record<string, string> = {};\n if (args?.name !== undefined) meta.name = String(args.name).trim();\n if (args?.description !== undefined) {\n meta.description = String(args.description).trim();\n }\n if (args?.icon !== undefined) meta.icon = String(args.icon);\n if (args?.visibility !== undefined) {\n meta.visibility = String(args.visibility);\n }\n if (Object.keys(meta).length > 0) {\n result = await updateTool(id, meta as any);\n }\n\n if (!result) result = await getTool(id);\n if (!result) return `Error: tool not found: ${id}`;\n return { ok: true, tool: result };\n },\n },\n\n \"add-tool-slot-target\": {\n tool: {\n description:\n 'Declare that a tool can render in a UI extension-point slot of an app (e.g. \"mail.contact-sidebar.bottom\"). Apps drop ExtensionSlot components in their UI; this action registers a tool as installable into one of those slots. Slot IDs follow the convention <app>.<area>.<position>. Caller must have editor access to the tool.',\n parameters: {\n type: \"object\",\n properties: {\n toolId: { type: \"string\", description: \"Tool id.\" },\n slotId: {\n type: \"string\",\n description:\n 'Slot identifier — e.g. \"mail.contact-sidebar.bottom\".',\n },\n config: {\n type: \"string\",\n description:\n \"Optional JSON string with slot-specific config (defaults, hints, etc.).\",\n },\n },\n required: [\"toolId\", \"slotId\"],\n },\n },\n run: async (args) => {\n const toolId = String(args?.toolId ?? \"\").trim();\n const slotId = String(args?.slotId ?? \"\").trim();\n if (!toolId) return \"Error: toolId is required.\";\n if (!slotId) return \"Error: slotId is required.\";\n const row = await addToolSlotTarget(\n toolId,\n slotId,\n args?.config ? String(args.config) : undefined,\n );\n return { ok: true, slot: row };\n },\n },\n\n \"install-extension\": {\n tool: {\n description:\n \"Install a tool as a widget in an extension-point slot for the current user. The tool must already declare the slot via add-tool-slot-target. Per-user installation — only affects the calling user's view. Use after creating a tool that targets a slot, or when the user asks to add an existing widget to a slot.\",\n parameters: {\n type: \"object\",\n properties: {\n toolId: { type: \"string\", description: \"Tool id to install.\" },\n slotId: {\n type: \"string\",\n description:\n 'Slot identifier — e.g. \"mail.contact-sidebar.bottom\".',\n },\n position: {\n type: \"number\",\n description:\n \"Optional integer position within the slot (lower = earlier). Defaults to end.\",\n },\n config: {\n type: \"string\",\n description:\n \"Optional JSON string with per-install config (overrides, settings).\",\n },\n },\n required: [\"toolId\", \"slotId\"],\n },\n },\n run: async (args) => {\n const toolId = String(args?.toolId ?? \"\").trim();\n const slotId = String(args?.slotId ?? \"\").trim();\n if (!toolId) return \"Error: toolId is required.\";\n if (!slotId) return \"Error: slotId is required.\";\n const position =\n args?.position !== undefined && args.position !== null\n ? Number(args.position)\n : undefined;\n const row = await installToolSlot(toolId, slotId, {\n position: Number.isFinite(position as number) ? position : undefined,\n config: args?.config ? String(args.config) : undefined,\n });\n return { ok: true, install: row };\n },\n },\n\n \"uninstall-extension\": {\n tool: {\n description:\n \"Remove a tool from an extension-point slot for the current user. Does not delete the tool itself.\",\n parameters: {\n type: \"object\",\n properties: {\n toolId: { type: \"string\", description: \"Tool id.\" },\n slotId: { type: \"string\", description: \"Slot identifier.\" },\n },\n required: [\"toolId\", \"slotId\"],\n },\n },\n run: async (args) => {\n const toolId = String(args?.toolId ?? \"\").trim();\n const slotId = String(args?.slotId ?? \"\").trim();\n if (!toolId) return \"Error: toolId is required.\";\n if (!slotId) return \"Error: slotId is required.\";\n await uninstallToolSlot(toolId, slotId);\n return { ok: true };\n },\n },\n\n \"list-tools-for-slot\": {\n tool: {\n description:\n \"List tools the current user has access to that declare a given extension-point slot. Use to discover what's available to install into a slot the user mentioned.\",\n parameters: {\n type: \"object\",\n properties: {\n slotId: { type: \"string\", description: \"Slot identifier.\" },\n },\n required: [\"slotId\"],\n },\n },\n run: async (args) => {\n const slotId = String(args?.slotId ?? \"\").trim();\n if (!slotId) return \"Error: slotId is required.\";\n return { tools: await listToolsForSlot(slotId) };\n },\n readOnly: true,\n },\n\n \"list-tool-slots\": {\n tool: {\n description:\n \"List the extension-point slots a specific tool declares it can render in. Caller must have viewer access to the tool.\",\n parameters: {\n type: \"object\",\n properties: {\n toolId: { type: \"string\", description: \"Tool id.\" },\n },\n required: [\"toolId\"],\n },\n },\n run: async (args) => {\n const toolId = String(args?.toolId ?? \"\").trim();\n if (!toolId) return \"Error: toolId is required.\";\n return { slots: await listSlotsForTool(toolId) };\n },\n readOnly: true,\n },\n };\n}\n\nfunction parsePatches(value: unknown): ToolPatch[] | undefined {\n if (value === undefined) return undefined;\n const parsed = typeof value === \"string\" ? JSON.parse(value) : value;\n if (!Array.isArray(parsed)) return undefined;\n if (\n parsed.some(\n (patch) =>\n !patch ||\n typeof patch.find !== \"string\" ||\n typeof patch.replace !== \"string\",\n )\n ) {\n return undefined;\n }\n return parsed;\n}\n"]}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Fetch tool — outbound HTTP for automations and agent use.
3
+ *
4
+ * Supports ${keys.NAME} reference substitution in URL, headers, and body.
5
+ * Values are resolved server-side AFTER the model emits the tool call —
6
+ * the raw secret never enters the model's context.
7
+ */
8
+ import type { ActionEntry } from "../agent/production-agent.js";
9
+ export interface FetchToolOptions {
10
+ /** Resolve ${keys.NAME} references. Injected by the plugin at setup time. */
11
+ resolveKeys?: (text: string) => Promise<{
12
+ resolved: string;
13
+ usedKeys: string[];
14
+ secretValues?: string[];
15
+ }>;
16
+ /** Validate URL against per-key allowlists. */
17
+ validateUrl?: (url: string, usedKeys: string[]) => Promise<boolean>;
18
+ }
19
+ /**
20
+ * Create the fetch tool entry for the agent tool registry.
21
+ */
22
+ export declare function createFetchToolEntry(opts?: FetchToolOptions): Record<string, ActionEntry>;
23
+ //# sourceMappingURL=fetch-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-tool.d.ts","sourceRoot":"","sources":["../../src/tools/fetch-tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAchE,MAAM,WAAW,gBAAgB;IAC/B,6EAA6E;IAC7E,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;QACtC,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;KACzB,CAAC,CAAC;IACH,+CAA+C;IAC/C,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACrE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,GAAE,gBAAqB,GAC1B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAgM7B"}