@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,264 @@
1
+ ---
2
+ name: actions
3
+ description: >-
4
+ How to create and run agent actions. Actions are the single source of truth
5
+ for app operations — the agent calls them as tools, the frontend calls them
6
+ as HTTP endpoints. Use when creating a new action, adding an API integration,
7
+ or wiring up frontend data fetching.
8
+ ---
9
+
10
+ # Agent Actions
11
+
12
+ ## Rule
13
+
14
+ Actions in `actions/` are the **single source of truth** for app operations. The agent calls them as tools, and the framework auto-exposes them as HTTP endpoints at `/_agent-native/actions/:name`. The frontend calls those endpoints using React Query hooks. No duplicate `/api/` routes needed.
15
+
16
+ ## Why
17
+
18
+ Actions give the agent callable tools with structured input/output, AND they give the frontend type-safe HTTP endpoints automatically. One implementation serves both the agent and the UI. They keep the agent's chat context clean, they're reusable, and they can be tested independently.
19
+
20
+ ## How to Create an Action
21
+
22
+ Use `defineAction` with a Zod schema (required for new actions):
23
+
24
+ ```ts
25
+ // actions/list-meals.ts
26
+ import { z } from "zod";
27
+ import { defineAction } from "@agent-native/core";
28
+ import { getDb } from "../server/db/index.js";
29
+ import { meals } from "../server/db/schema.js";
30
+
31
+ export default defineAction({
32
+ description: "List all meals",
33
+ schema: z.object({
34
+ date: z.string().describe("Filter by date (YYYY-MM-DD)"),
35
+ }),
36
+ http: { method: "GET" },
37
+ run: async (args) => {
38
+ // args is fully typed: { date: string }
39
+ const db = getDb();
40
+ const rows = await db.select().from(meals);
41
+ return rows; // Return objects/arrays, NOT JSON.stringify()
42
+ },
43
+ });
44
+ ```
45
+
46
+ The `schema` field accepts a Zod schema (or any Standard Schema-compatible library). It provides runtime validation with clear error messages (400 for HTTP, error result for agent), full TypeScript type inference for `run()` args, and auto-generated JSON Schema for the agent's tool definition. `zod` is a dependency of all templates.
47
+
48
+ Tips:
49
+ - Use `.describe()` for parameter descriptions
50
+ - Use `.optional()` for optional params
51
+ - Use `z.coerce.number()` / `z.coerce.boolean()` for params that arrive as strings from HTTP
52
+ - Use `z.enum(["draft", "published"])` for constrained values
53
+
54
+ The legacy `parameters` field (plain JSON Schema object) still works as a fallback but does not provide runtime validation or type inference.
55
+
56
+ ### The `http` Option
57
+
58
+ Controls how the action is exposed as an HTTP endpoint:
59
+
60
+ | Value | Behavior | Use for |
61
+ | ------------------------- | ----------------------------------------------------------- | -------------------------------- |
62
+ | _(omitted)_ | Auto-exposed as `POST /_agent-native/actions/:name` | Write operations (default) |
63
+ | `{ method: "GET" }` | Auto-exposed as `GET /_agent-native/actions/:name` | Read-only queries |
64
+ | `{ method: "PUT" }` | Auto-exposed as `PUT /_agent-native/actions/:name` | Update operations |
65
+ | `{ method: "DELETE" }` | Auto-exposed as `DELETE /_agent-native/actions/:name` | Delete operations |
66
+ | `{ method: "GET", path: "custom" }` | Auto-exposed as `GET /_agent-native/actions/custom` | Custom route path |
67
+ | `false` | Agent-only, never exposed as HTTP | `navigate`, `view-screen`, internal actions |
68
+
69
+ ### Screen Refresh (automatic)
70
+
71
+ The framework auto-refreshes the UI after any successful mutating action. On completion of a non-`GET` action, the server emits a poll event that the client's `useDbSync` picks up and uses to invalidate `["action"]` React Query keys — so `list-*` / `get-*` hooks refetch without a full page reload.
72
+
73
+ Rules:
74
+
75
+ - `http: { method: "GET" }` → read-only, does NOT trigger a refresh (inferred automatically).
76
+ - Any other action (default `POST`, `PUT`, `DELETE`, or `http: false`) → treated as mutating, triggers a refresh on success.
77
+ - To override the inference on an unusual action (e.g. a `POST` that only reads), pass `readOnly: true` on the action definition.
78
+ - To let a mutating action run concurrently with other same-turn tool calls, pass `parallelSafe: true`. Only do this when the action is internally concurrency-safe and order-independent (for example, it uses an app-level lock or idempotent upsert semantics). Mutating actions remain serialized by default.
79
+
80
+ Agents do NOT need to call `refresh-screen` after a normal action — it's already handled. `refresh-screen` is only needed when the agent mutates data via a path the framework can't see (e.g. writing to an external system the app mirrors) or when the agent wants to pass a `scope` hint for narrower invalidation.
81
+
82
+ ### Return Values
83
+
84
+ Actions should return **structured data** (objects, arrays) — not `JSON.stringify()`. The framework serializes the response automatically. If you return a string, the framework tries to parse it as JSON for a clean response.
85
+
86
+ ```ts
87
+ // Good — return structured data
88
+ run: async (args) => {
89
+ const events = await fetchEvents(args.from, args.to);
90
+ return events;
91
+ }
92
+
93
+ // Bad — don't stringify
94
+ run: async (args) => {
95
+ const events = await fetchEvents(args.from, args.to);
96
+ return JSON.stringify(events, null, 2);
97
+ }
98
+ ```
99
+
100
+ ## Frontend Hooks
101
+
102
+ The frontend calls action endpoints using React Query hooks from `@agent-native/core/client`:
103
+
104
+ ### `useActionQuery` — for GET actions
105
+
106
+ ```ts
107
+ import { useActionQuery } from "@agent-native/core/client";
108
+
109
+ function MealList() {
110
+ // Types are auto-inferred from the action's schema + return type — no manual generic needed
111
+ const { data: meals } = useActionQuery("list-meals", {
112
+ date: "2025-01-01",
113
+ });
114
+ return <ul>{meals?.map((m) => <li key={m.id}>{m.name}</li>)}</ul>;
115
+ }
116
+ ```
117
+
118
+ ### `useActionMutation` — for POST/PUT/DELETE actions
119
+
120
+ ```ts
121
+ import { useActionMutation } from "@agent-native/core/client";
122
+
123
+ function AddMealButton() {
124
+ // Types are auto-inferred — no manual generic needed
125
+ const { mutate } = useActionMutation("log-meal");
126
+ return (
127
+ <button onClick={() => mutate({ name: "Salad", calories: 350 })}>
128
+ Log Meal
129
+ </button>
130
+ );
131
+ }
132
+ ```
133
+
134
+ **Do NOT use manual type generics** like `useActionQuery<Meal[]>(...)`. Types are inferred automatically from `.generated/action-types.d.ts`, which is auto-generated by a Vite plugin.
135
+
136
+ Mutations automatically invalidate all `["action"]` query keys on success, so GET queries refetch.
137
+
138
+ ## How to Run (Agent)
139
+
140
+ ```bash
141
+ pnpm action my-action --input data/source.json --output data/result.json
142
+ ```
143
+
144
+ ## Action Dispatcher
145
+
146
+ The default template uses core's `runScript()` in `actions/run.ts`:
147
+
148
+ ```ts
149
+ import { runScript } from "@agent-native/core";
150
+ runScript();
151
+ ```
152
+
153
+ This is the canonical approach for new apps. Action names must be lowercase with hyphens only (e.g., `my-action`).
154
+
155
+ ## When You Still Need Custom `/api/` Routes
156
+
157
+ Most operations should be actions. You only need custom routes in `server/routes/api/` for:
158
+
159
+ - **File uploads** — actions receive JSON params, not multipart form data
160
+ - **Streaming responses** — SSE or chunked responses that need direct H3 control
161
+ - **Webhooks** — external services POST to a specific URL
162
+ - **OAuth callbacks** — redirect-based flows that need specific URL patterns
163
+
164
+ If it's a standard CRUD operation or data query, use an action instead.
165
+
166
+ ## Legacy Pattern (bare export)
167
+
168
+ Older actions use a bare async function export with `parseArgs`:
169
+
170
+ ```ts
171
+ import { parseArgs, loadEnv, fail } from "@agent-native/core";
172
+
173
+ export default async function myAction(args: string[]) {
174
+ loadEnv();
175
+ const parsed = parseArgs(args);
176
+ // ...
177
+ }
178
+ ```
179
+
180
+ This still works but is not auto-exposed as HTTP. Prefer `defineAction` for all new actions.
181
+
182
+ ## Guidelines
183
+
184
+ - **One action, one job.** Keep actions focused on a single operation. The agent composes multiple action calls for complex operations.
185
+ - **Return structured data.** Return objects/arrays, not `JSON.stringify()`.
186
+ - **Use `http: { method: "GET" }`** for read-only actions. Default is POST.
187
+ - **Use `http: false`** for agent-only actions (`navigate`, `view-screen`).
188
+ - **Use `loadEnv()`** if the action needs environment variables (API keys, etc.).
189
+ - **Use `fail()`** for user-friendly error messages (exits with message, no stack trace).
190
+ - **Import from `@agent-native/core`** — Don't redefine `parseArgs()` or other utilities locally.
191
+
192
+ ## Common Patterns
193
+
194
+ **Read action (GET):**
195
+
196
+ ```ts
197
+ import { z } from "zod";
198
+ import { defineAction } from "@agent-native/core";
199
+
200
+ export default defineAction({
201
+ description: "List calendar events",
202
+ schema: z.object({
203
+ from: z.string().describe("Start date"),
204
+ to: z.string().describe("End date"),
205
+ }),
206
+ http: { method: "GET" },
207
+ run: async (args) => {
208
+ return await fetchEvents(args.from, args.to);
209
+ },
210
+ });
211
+ ```
212
+
213
+ **Write action (POST, default):**
214
+
215
+ ```ts
216
+ import { z } from "zod";
217
+ import { defineAction } from "@agent-native/core";
218
+
219
+ export default defineAction({
220
+ description: "Log a meal",
221
+ schema: z.object({
222
+ name: z.string().describe("Meal name"),
223
+ calories: z.coerce.number().describe("Calorie count"),
224
+ }),
225
+ run: async (args) => {
226
+ // args.calories is a number — z.coerce.number() handles string-to-number conversion from HTTP
227
+ const meal = await insertMeal(args);
228
+ return meal;
229
+ },
230
+ });
231
+ ```
232
+
233
+ **Agent-only action:**
234
+
235
+ ```ts
236
+ import { z } from "zod";
237
+ import { defineAction } from "@agent-native/core";
238
+
239
+ export default defineAction({
240
+ description: "Navigate the UI to a view",
241
+ schema: z.object({
242
+ view: z.string().describe("Target view"),
243
+ }),
244
+ http: false,
245
+ run: async (args) => {
246
+ await writeAppState("navigate", { command: "go", view: args.view });
247
+ return "Navigated";
248
+ },
249
+ });
250
+ ```
251
+
252
+ ## Troubleshooting
253
+
254
+ - **Action not found** — Check that the filename matches the command name exactly. `pnpm action foo-bar` looks for `actions/foo-bar.ts`.
255
+ - **Args not parsing** — Ensure args use `--key value` or `--key=value` format. Boolean flags use `--flag` (sets value to `"true"`).
256
+ - **Frontend getting 405** — The action's `http.method` doesn't match the hook. Use `useActionQuery` for GET actions, `useActionMutation` for POST/PUT/DELETE.
257
+ - **Frontend getting undefined** — Make sure the action returns structured data, not `JSON.stringify()`.
258
+
259
+ ## Related Skills
260
+
261
+ - **storing-data** — Actions read/write data in SQL
262
+ - **delegate-to-agent** — The agent invokes actions via `pnpm action <name>`
263
+ - **real-time-sync** — Database writes from actions trigger poll events to update the UI
264
+ - **adding-a-feature** — Actions are area 2 of the four-area checklist
@@ -0,0 +1,130 @@
1
+ ---
2
+ name: adding-a-feature
3
+ description: >-
4
+ The four-area checklist every new feature must complete. Use when adding any
5
+ feature, integration, or capability to ensure the agent and UI stay in parity.
6
+ ---
7
+
8
+ # Adding a Feature — The Four-Area Checklist
9
+
10
+ ## Rule
11
+
12
+ Every new feature MUST update all four areas. Skipping any one breaks the agent-native contract — the agent and UI must always be equal partners.
13
+
14
+ ## Why
15
+
16
+ Agent-native apps are defined by parity: everything the UI can do, the agent can do, and vice versa. A feature that only has UI is invisible to the agent. A feature that only has scripts is invisible to the user. A feature without app-state sync means the agent is blind to what the user is doing.
17
+
18
+ ## The Checklist
19
+
20
+ When you add a new feature, work through these four areas in order:
21
+
22
+ ### 1. UI Component
23
+
24
+ Build the user-facing interface — a page, component, dialog, or route. Use `useActionQuery` and `useActionMutation` from `@agent-native/core/client` to call actions for data fetching and mutations — you rarely need custom `/api/` routes.
25
+
26
+ **Auto-refresh on agent writes is non-negotiable** — when the agent mutates data, the UI must reflect the change without a manual refresh. There are two paths, and you must pick the right one:
27
+
28
+ - **`useActionQuery` / `useActionMutation`** — covered automatically. The framework's `useDbSync` invalidates `["action"]` on every change event, so every `useActionQuery` hook refetches on agent activity. No extra wiring required. **Prefer this path.**
29
+ - **Raw `useQuery` with custom keys** — needs explicit wiring. Fold `useChangeVersions([<source>, "action"])` from `@agent-native/core/client` into the `queryKey` and set `placeholderData: (prev) => prev`. The `action` source is the reliable signal (the agent runner emits it after every successful tool call); the resource-specific source (`"dashboards"`, `"analyses"`, `"settings"`, etc.) is bonus when emitted. Without this wiring, agent writes will be invisible until manual refresh — that breaks the framework's #1 promise.
30
+
31
+ ```tsx
32
+ import { useChangeVersions } from "@agent-native/core/client";
33
+ import { useQuery } from "@tanstack/react-query";
34
+
35
+ const v = useChangeVersions(["dashboards", "action"]);
36
+ useQuery({
37
+ queryKey: ["dashboard", id, v],
38
+ queryFn: () => fetchDashboard(id),
39
+ placeholderData: (prev) => prev, // no flicker on refetch
40
+ });
41
+ ```
42
+
43
+ See the `real-time-sync` skill for the full pattern and source catalog.
44
+
45
+ ### 2. Action
46
+
47
+ Create an action in `actions/` using `defineAction`. This serves double duty: the agent calls it as a tool, and the framework auto-exposes it as an HTTP endpoint at `/_agent-native/actions/:name` for the UI to call. Set `http: { method: "GET" }` for read actions, leave default for writes, or set `http: false` for agent-only actions like `navigate` and `view-screen`.
48
+
49
+ ### 3. Skills / Instructions
50
+
51
+ Update `AGENTS.md` and/or create a skill in `.agents/skills/` if the feature introduces patterns the agent needs to know. At minimum, add the new actions to the action table in the template's `AGENTS.md`.
52
+
53
+ ### 4. Application State Sync
54
+
55
+ Expose navigation and selection state so the agent knows what the user is looking at. Write to the `navigation` app-state key on route changes. Update the `view-screen` action to fetch relevant data for the new feature. Add a `navigate` command if the agent needs to open the new view.
56
+
57
+ ## Examples
58
+
59
+ ### Adding "compose email" to a mail app
60
+
61
+ | Area | What to build |
62
+ | --------------- | ---------------------------------------------------------------------------------------- |
63
+ | UI | Compose panel with tabs, to/cc/bcc fields, body editor. Use `useActionQuery`/`useActionMutation` for data. |
64
+ | Action | `manage-draft` action (create/update/delete drafts), `send-email` action |
65
+ | Skills/AGENTS | Document compose state shape, draft lifecycle, action args in AGENTS.md |
66
+ | App-state sync | `compose-{id}` keys for each draft tab, `navigation` includes compose state |
67
+
68
+ ### Adding "create form" to a forms app
69
+
70
+ | Area | What to build |
71
+ | --------------- | ---------------------------------------------------------------------------------------- |
72
+ | UI | Form builder page with drag-and-drop fields, preview, settings. Use `useActionQuery` for lists. |
73
+ | Action | `create-form` action, `update-form` action, `list-forms` action (GET) |
74
+ | Skills/AGENTS | Document form schema shape, field types, validation rules in AGENTS.md |
75
+ | App-state sync | `navigation` includes `{ view: "form-builder", formId: "..." }`, `view-screen` fetches form data |
76
+
77
+ ### Adding "chart type" to an analytics app
78
+
79
+ | Area | What to build |
80
+ | --------------- | ---------------------------------------------------------------------------------------- |
81
+ | UI | New chart component, chart type selector in dashboard |
82
+ | Action | `create-chart` or `update-dashboard` action that sets chart type and config |
83
+ | Skills/AGENTS | Document supported chart types, config options, data requirements |
84
+ | App-state sync | `navigation` includes selected chart/dashboard, `view-screen` returns chart config |
85
+
86
+ ## Adding a new route
87
+
88
+ Templates are single-page apps with client-side routing. The app shell (AgentSidebar + top-level nav) MUST persist across navigation — it is mounted once, either in `root.tsx` around `<Outlet />` or via a pathless `_app.tsx` layout route that all authed routes nest under.
89
+
90
+ **Never wrap each new route in its own `<AppLayout>` / `<Layout>`.** That causes React to unmount the entire app shell on every navigation, reloading the agent sidebar and destroying in-progress work.
91
+
92
+ - If the template has `<AppLayout>` in `root.tsx` — just render page content in your new route file, nothing else.
93
+ - If the template has `app/routes/_app.tsx` (pathless layout) — name your new route `_app.<segment>.tsx` to inherit the shell, or bare `<segment>.tsx` for public routes that should NOT have the shell.
94
+ - If a page needs per-route data (e.g. highlighting the active item in the sidebar), read it in the layout from `useParams()` / `useLocation()`. Don't pass it as a prop through every route file.
95
+
96
+ See the "Client-Side Routing" section in the root `CLAUDE.md` for full details.
97
+
98
+ ## Anti-Patterns
99
+
100
+ - **Per-route `<AppLayout>` wrappers** — Every route file wraps its content in `<AppLayout>` or `<Layout>`. React sees a different component at the outlet on each nav and unmounts the whole shell, causing the agent sidebar to reload on every click. Mount the shell once above `<Outlet />` (root.tsx or `_app.tsx` pathless layout).
101
+ - **UI without actions** — The user can create forms but the agent cannot. The agent says "I don't have access to that" when it should be able to do it.
102
+ - **Actions without AGENTS.md** — The actions exist but the agent doesn't know about them because they're not documented. The agent reinvents solutions instead of using the actions.
103
+ - **Duplicate API routes** — Creating `/api/` routes for operations that actions already handle. Actions are auto-exposed as HTTP endpoints — use `useActionQuery`/`useActionMutation` instead.
104
+ - **Features without app-state** — The agent cannot see that the user is looking at a specific form, email, or chart. It asks "which one?" instead of acting on the current selection.
105
+ - **Actions without UI** — The agent can do something the user cannot. This is less common but still breaks parity.
106
+
107
+ ## Verification
108
+
109
+ After completing all four areas, verify:
110
+
111
+ 1. Can the user perform the operation from the UI?
112
+ 2. Can the agent perform the same operation via actions?
113
+ 3. Does `pnpm action view-screen` show the relevant state when the user is using the feature?
114
+ 4. Can the agent navigate to the feature view via the `navigate` action?
115
+ 5. Is the feature documented in AGENTS.md with action names and args?
116
+
117
+ ## One more area — sharing
118
+
119
+ If the feature stores **user-authored resources** (documents, dashboards, forms, decks, etc.), make them ownable so they get private-by-default semantics and a share dialog for free. See the `sharing` skill.
120
+
121
+ TL;DR: spread `ownableColumns()` into the resource table, pair it with `createSharesTable(...)`, call `registerShareableResource(...)`, wrap list/read queries with `accessFilter`, guard writes with `assertAccess`, and drop `<ShareButton>` in the resource header. The `share-resource`, `unshare-resource`, `list-resource-shares`, and `set-resource-visibility` actions are auto-mounted framework-wide.
122
+
123
+ ## Related Skills
124
+
125
+ - **sharing** — How to make a new resource ownable (private by default, share with users/orgs/public)
126
+ - **context-awareness** — How to expose UI state to the agent (area 4 in detail)
127
+ - **actions** — How to create actions with `defineAction` and the `http` option (area 2 in detail)
128
+ - **create-skill** — How to create skills for new patterns (area 3 in detail)
129
+ - **storing-data** — Where to store the feature's data
130
+ - **real-time-sync** — How the UI stays in sync when the agent writes data
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: address-feedback
3
+ description: >-
4
+ Triage feedback docs or pasted feedback into bugs to fix, UX suggestions to
5
+ propose, unclear questions, and skipped noise; verify bugs, check Sentry when
6
+ relevant, and keep UI changes minimal.
7
+ ---
8
+
9
+ # Address Feedback
10
+
11
+ Use this skill when the user shares a feedback document, issue, thread, or pasted notes and asks you to address the feedback.
12
+
13
+ The default posture is judgment plus action: fix clear, verified bugs you agree with; propose UX changes with rationale; skip or flag low-signal, unclear, or out-of-scope items.
14
+
15
+ ## Prerequisites
16
+
17
+ - If no link or feedback text is provided, ask for it.
18
+ - Read the repo `AGENTS.md` before touching code.
19
+ - Use the relevant connector/plugin/skill for the source when available, instead of scraping authenticated pages.
20
+
21
+ ## Steps
22
+
23
+ 1. Read the feedback source.
24
+
25
+ | Source | Reader |
26
+ | --- | --- |
27
+ | Notion link | Notion connector or Notion skill |
28
+ | Google Docs/Drive link | Google Drive connector or Google Docs skill |
29
+ | Linear link | Linear connector if installed; otherwise ask for pasted content |
30
+ | GitHub issue or PR | GitHub connector or `gh issue view` / `gh pr view` |
31
+ | Slack thread | Slack connector |
32
+ | Public URL | Web browsing |
33
+ | Pasted text | Read directly |
34
+
35
+ Use web browsing only for public URLs. Auth-gated docs usually need their matching connector.
36
+
37
+ 2. Categorize every actionable item.
38
+
39
+ - **Bug**: Broken behavior, crash, wrong data, dead link, package/API mismatch, or captured exception. Verify and fix when you agree.
40
+ - **UX suggestion**: Design, discoverability, workflow, or feature feedback. Propose the cleanest version first unless the user explicitly asked you to implement UX changes.
41
+ - **Question or unclear**: Missing detail, contradictory feedback, or behavior you cannot inspect. Ask or flag it.
42
+ - **Out of scope**: Outside this repo, already shipped, intentionally unsupported, or too low-signal. Note briefly and skip.
43
+
44
+ 3. Check Sentry when the feedback smells like an error.
45
+
46
+ - Use the Sentry skill/plugin if available, or the repo's Sentry scripts if documented.
47
+ - Search by route, stack symbol, error text, and symptom keywords.
48
+ - Default org is `builder-io` unless the user specifies another.
49
+ - Cite issue IDs or links when you find a match.
50
+ - If nothing matches, say that plainly.
51
+
52
+ 4. Fix only the clear bugs you agree with.
53
+
54
+ - Verify before fixing: reproduce locally, read the relevant code, inspect logs, or confirm with a stack trace.
55
+ - Keep each fix narrow and mapped to a feedback item.
56
+ - Follow existing project conventions and nearby patterns.
57
+ - Do not switch branches, stash, reset, force-push, or open a PR unless the user asks.
58
+ - Add or update focused tests when the bug risk warrants it.
59
+
60
+ 5. Treat UX feedback with restraint.
61
+
62
+ Do not solve UX problems by adding more visible controls, helper text, banners, top-level nav, or always-open panels by default. Prefer cleaner interaction models:
63
+
64
+ - Make the existing primary action more discoverable.
65
+ - Remove competing elements so the right action stands out.
66
+ - Move secondary actions into `DropdownMenu`, `Popover`, `Sheet`, `Collapsible`, or tabs.
67
+ - Improve empty states around one clear action.
68
+ - Use progressive disclosure for optional or advanced controls.
69
+
70
+ When proposing a UX change, write it as: what to change, why it helps, and the tradeoff. Keep each proposal short.
71
+
72
+ 6. Verify changed behavior.
73
+
74
+ - Run the smallest relevant test or typecheck command.
75
+ - For UI fixes, verify in a browser when feasible and inspect the actual screen.
76
+ - If you cannot run a useful verification, say why.
77
+
78
+ ## Report Format
79
+
80
+ Keep the final report short:
81
+
82
+ ```md
83
+ ## Bugs Fixed
84
+ - [feedback item] - [what changed, file:line]
85
+
86
+ ## Bugs Flagged But Not Fixed
87
+ - [feedback item] - [why]
88
+
89
+ ## UX Suggestions
90
+ - [feedback item] -> [proposed change]
91
+
92
+ ## Skipped
93
+ - [feedback item] - [reason]
94
+ ```
95
+
96
+ Only include sections that have content. The user can read the diff; do not write a second feedback document.
97
+
98
+ ## Avoid
99
+
100
+ - Do not agree with every suggestion by default.
101
+ - Do not bundle unrelated cleanups.
102
+ - Do not implement UX changes that make an important screen busier without explicit user approval.
103
+ - Do not claim a UI change is done without browser verification when a local app can be run.
104
+ - Do not invent Sentry matches, affected users, or reproduction steps.
105
+
106
+ ## Related Skills
107
+
108
+ - `github:gh-address-comments` for GitHub PR review threads.
109
+ - `github:gh-fix-ci` for failing GitHub checks.
110
+ - `sentry:sentry` for production error investigation.
111
+ - `frontend-design` for approved UI implementation work.
112
+ - `qa` for broader browser verification.
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: authentication
3
+ description: >-
4
+ How auth works in agent-native apps. Use when wiring login/signup,
5
+ configuring auth modes, setting up organizations, protecting routes, or
6
+ debugging session issues.
7
+ ---
8
+
9
+ # Authentication
10
+
11
+ ## Rule
12
+
13
+ Auth is powered by **Better Auth** with account-first design. Every new user creates an account on first visit. Use `getSession(event)` to authenticate custom routes; actions are auto-protected.
14
+
15
+ ## Auth Modes
16
+
17
+ | Mode | Behavior |
18
+ | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
19
+ | **Development (default)** | Auth is automatically bypassed. `getSession()` falls back to `{ email: "local@localhost" }` when nothing else succeeds. No config. |
20
+ | **Production (default)** | Better Auth with email/password + social providers (Google, GitHub). Organizations built in. |
21
+ | **`AUTH_MODE=local`** | Explicit escape hatch. `getSession()` always returns `{ email: "local@localhost" }`. Set via `.env` or the onboarding page's "Use locally" button. |
22
+ | **`AUTH_SKIP_EMAIL_VERIFICATION=1`** | QA/preview escape hatch for real email/password accounts. Signup skips email verification and does not send the signup verification email. Local dev/test skips verification by default; set `AUTH_SKIP_EMAIL_VERIFICATION=0` only when testing verification itself. Use `+qa` emails for test accounts. |
23
+ | **`ACCESS_TOKEN` / `ACCESS_TOKENS`** | Simple token-based auth for production deployments. |
24
+ | **`AUTH_DISABLED=true`** | Skip auth entirely (for apps behind infrastructure-level auth like Cloudflare Access). |
25
+ | **Custom** | Pass your own `getSession` to `autoMountAuth(app, { getSession })`. |
26
+
27
+ ## Local → Real Account Migration
28
+
29
+ Upgrading from `local@localhost` to a real account preserves SQL-backed workspace data. The built-in migration moves `application_state`, user-scoped `settings`, `oauth_tokens`, and any template table that uses `owner_email`.
30
+
31
+ Templates with legacy global settings can provide `POST /api/local-migration` for one-time re-homing during the upgrade flow.
32
+
33
+ ## Organizations
34
+
35
+ Better Auth's organization plugin is built in. Every app supports creating orgs, inviting members, and role-based access (owner/admin/member).
36
+
37
+ The active org flows automatically: `session.orgId` → `AGENT_ORG_ID` → SQL scoping (see `security` skill).
38
+
39
+ **If your template requires an org to function** (data is scoped by `organization_id`, core features can't run without one), set `AUTO_CREATE_DEFAULT_ORG=1` in your `.env`. The framework will auto-create a default org (named after the user) on first login when no memberships exist. This happens inside `getOrgContext` — no template integration needed.
40
+
41
+ As a safety net, also wrap your app shell in `<RequireActiveOrg>` from `@agent-native/core/client/org`. It blocks the wrapped area with a "Create your organization" pane (and accept-invite CTAs for pending invitations) if auto-create failed or the account predates it. Place it **inside** the agent sidebar so the setup checklist, chat, and CLI stay usable during setup.
42
+
43
+ ## A2A Identity
44
+
45
+ Set `A2A_SECRET` (same value) on all apps that must verify each other's identity.
46
+
47
+ - Outbound A2A calls are signed with JWTs
48
+ - Inbound calls are verified cryptographically
49
+ - Without `A2A_SECRET`, A2A calls are unauthenticated (fine for local dev)
50
+
51
+ ## Builder Browser Access
52
+
53
+ Apps can connect to Builder via the `cli-auth` flow and persist shared browser credentials in `.env`. Agents then use the built-in `get-browser-connection` tool to provision a real browser session via AI Services.
54
+
55
+ ## Protecting Custom Routes
56
+
57
+ Actions are auto-protected. For custom `/api/` routes:
58
+
59
+ ```ts
60
+ import { getSession } from "@agent-native/core/server";
61
+
62
+ export default defineEventHandler(async (event) => {
63
+ const session = await getSession(event);
64
+ if (!session) throw createError({ statusCode: 401 });
65
+ // ...
66
+ });
67
+ ```
68
+
69
+ Never create unprotected routes that modify data.
70
+
71
+ ## Sign-In from a Public Page
72
+
73
+ For public pages (share links, embeds, marketing pages) that need anonymous viewers to sign in and return to where they were, navigate them through the framework's sign-in entry point — never roll your own:
74
+
75
+ ```ts
76
+ const ret = window.location.pathname + window.location.search;
77
+ window.location.href =
78
+ "/_agent-native/sign-in?return=" + encodeURIComponent(ret);
79
+ ```
80
+
81
+ After successful sign-in (token / email-password / Google OAuth), the framework 302s to `return`. The path is validated as same-origin via the URL parser — open-redirect / header-injection inputs fall back to `/`.
82
+
83
+ Bookmarked private paths already work without any plumbing — the framework's login page is served at the requested URL, and post-login reload returns the user there.
84
+
85
+ ## Related Skills
86
+
87
+ - `security` — Data scoping, SQL injection, secrets
88
+ - `actions` — Auto-protected by the auth guard