@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,191 @@
1
+ ---
2
+ name: automations
3
+ description: >-
4
+ Event-triggered and schedule-triggered automations with natural-language
5
+ conditions. Use when creating automations, wiring events, or understanding
6
+ how triggers fire.
7
+ ---
8
+
9
+ # Automations
10
+
11
+ ## Rule
12
+
13
+ Automations are agent-executed tasks that fire in response to events or on a cron schedule. Each automation is a markdown resource under `jobs/` with YAML frontmatter describing when and how it fires, and a body containing natural-language instructions the agent follows. Automations extend the recurring-jobs system with event triggers, natural-language condition evaluation, and outbound HTTP via the `web-request` tool.
14
+
15
+ ## The Two Trigger Types
16
+
17
+ | Type | Fires when | Key field |
18
+ | ---------- | ----------------------------------------------- | ------------------- |
19
+ | `schedule` | Cron expression matches (same as recurring jobs) | `schedule` (cron) |
20
+ | `event` | A matching event is emitted on the event bus | `event` (event name) |
21
+
22
+ Event triggers can optionally include a `condition` -- a natural-language string evaluated by Haiku against the event payload before dispatch. If the condition does not match, the automation is skipped.
23
+
24
+ ## How It Works
25
+
26
+ 1. User asks the agent to create an automation (or uses the settings UI).
27
+ 2. Agent calls `manage-automations` with `action=list-events` to discover available events.
28
+ 3. Agent calls `manage-automations` with `action=define` to write a `jobs/<name>.md` resource.
29
+ 4. The trigger dispatcher subscribes to the event on the bus.
30
+ 5. When the event fires, the dispatcher loads all matching triggers, evaluates conditions via Haiku, and dispatches matching ones.
31
+ 6. In `agentic` mode, the dispatcher runs a full `runAgentLoop` with the automation body as the prompt and the event payload as context.
32
+ 7. Status (`lastRun`, `lastStatus`, `lastError`) is written back to the resource frontmatter.
33
+
34
+ ## Markdown Format
35
+
36
+ ```yaml
37
+ ---
38
+ schedule: "0 9 * * 1-5"
39
+ enabled: true
40
+ triggerType: event
41
+ event: calendar.booking.created
42
+ condition: "attendee email ends with @example.com"
43
+ mode: agentic
44
+ domain: calendar
45
+ createdBy: owner@example.com
46
+ runAs: creator
47
+ ---
48
+
49
+ Send a Slack message to #sales with the booking details.
50
+ Use the web-request tool with ${keys.SLACK_WEBHOOK}.
51
+ ```
52
+
53
+ ### Frontmatter Fields
54
+
55
+ | Field | Type | Purpose |
56
+ | ------------- | ------------------------------ | ------------------------------------------------------ |
57
+ | `schedule` | `string` | Cron expression (required for schedule triggers) |
58
+ | `enabled` | `boolean` | Whether the automation is active |
59
+ | `triggerType` | `"schedule" \| "event"` | How the automation fires |
60
+ | `event` | `string?` | Event name to subscribe to (event triggers) |
61
+ | `condition` | `string?` | Natural-language condition evaluated before dispatch |
62
+ | `mode` | `"agentic" \| "deterministic"` | Full agent loop vs. fixed action set |
63
+ | `model` | `string?` | Override the model for this trigger's agent loop |
64
+ | `domain` | `string?` | Grouping tag (mail, calendar, clips, etc.) |
65
+ | `createdBy` | `string?` | Owner email |
66
+ | `orgId` | `string?` | Org scope |
67
+ | `runAs` | `"creator" \| "shared"` | Whose API key and permissions to use |
68
+ | `lastRun` | `string?` | ISO timestamp of last execution |
69
+ | `lastStatus` | `string?` | `success`, `error`, `running`, or `skipped` |
70
+ | `lastError` | `string?` | Error message from last failed run |
71
+
72
+ ## Agent Tools
73
+
74
+ All automation operations are accessed through a single `manage-automations` tool with an `action` parameter:
75
+
76
+ | Action | Purpose |
77
+ | ------------- | -------------------------------------------------------------------- |
78
+ | `list-events` | Discover all registered events with descriptions and payload schemas |
79
+ | `list` | List all automations with status, filter by domain or enabled |
80
+ | `define` | Create a new automation (name, trigger type, event, condition, body) |
81
+ | `update` | Update an existing automation (enabled, condition, body) |
82
+ | `delete` | Delete an automation (always confirm with user first) |
83
+ | `fire-test` | Emit a `test.event.fired` event to validate automations |
84
+
85
+ Additional tool: `web-request` — outbound HTTP with `${keys.NAME}` substitution.
86
+
87
+ ## The Event Bus
88
+
89
+ Integrations register events at module load time. The bus validates payloads against Standard Schema definitions and dispatches to subscribers.
90
+
91
+ ```ts
92
+ import { registerEvent, emit } from "@agent-native/core/event-bus";
93
+ import { z } from "zod";
94
+
95
+ // Register an event type (typically in a server plugin)
96
+ registerEvent({
97
+ name: "calendar.booking.created",
98
+ description: "A new calendar booking was created",
99
+ payloadSchema: z.object({
100
+ bookingId: z.string(),
101
+ attendeeEmail: z.string(),
102
+ startTime: z.string(),
103
+ }),
104
+ example: { bookingId: "abc", attendeeEmail: "jane@co.com", startTime: "2025-01-15T10:00:00Z" },
105
+ });
106
+
107
+ // Emit the event (from an action, webhook handler, etc.)
108
+ emit("calendar.booking.created", {
109
+ bookingId: "abc",
110
+ attendeeEmail: "jane@co.com",
111
+ startTime: "2025-01-15T10:00:00Z",
112
+ }, { owner: "owner@example.com" });
113
+ ```
114
+
115
+ ### Built-in Events
116
+
117
+ | Event | Source |
118
+ | ------------------------- | ------------------- |
119
+ | `test.event.fired` | Manual / manage-automations action=fire-test |
120
+ | `agent.turn.completed` | Agent chat |
121
+ | `calendar.*` | Calendar integration |
122
+ | `clip.*` | Clips integration |
123
+ | `mail.*` | Mail integration |
124
+
125
+ ### Event Bus API
126
+
127
+ | Function | Purpose |
128
+ | ---------------- | ------------------------------------------- |
129
+ | `registerEvent` | Declare an event type with schema |
130
+ | `emit` | Fire an event (validates payload) |
131
+ | `subscribe` | Listen for an event (returns subscription ID) |
132
+ | `unsubscribe` | Remove a subscription by ID |
133
+ | `listEvents` | List all registered event definitions |
134
+
135
+ ## Condition Evaluator
136
+
137
+ When an automation has a `condition`, the dispatcher calls Haiku (claude-haiku-4-5) to classify whether the event payload satisfies the condition. This is a yes/no classification, not a generation task.
138
+
139
+ - Empty or missing condition = unconditional (always fires).
140
+ - Results are memoized (SHA-256 of condition + payload) with a 5-minute TTL and 500-entry LRU cache.
141
+ - Payload is truncated to 4000 characters before sending to Haiku.
142
+ - On API failure, the condition evaluates to `false` (safe default -- skips the automation).
143
+
144
+ ## The `web-request` Tool and Keys
145
+
146
+ Automations use the `web-request` tool for outbound HTTP. It supports `${keys.NAME}` placeholders in the URL, headers, and body. These are resolved server-side after the agent emits the tool call -- the raw secret value never enters the agent's context.
147
+
148
+ - Keys are ad-hoc secrets created by the user via the settings UI or the `/_agent-native/secrets/adhoc` API.
149
+ - Each key can have a URL allowlist that restricts which origins the key can be sent to.
150
+ - `resolveKeyReferences()` resolves placeholders, falling back from user scope to workspace scope.
151
+ - `validateUrlAllowlist()` checks the resolved URL against per-key allowlists (origin-level matching).
152
+
153
+ ## UI
154
+
155
+ Automations appear in the settings panel under an "Automations" section. Users can view, enable/disable, and delete automations from there. Creation typically happens through the agent chat.
156
+
157
+ ## Example
158
+
159
+ User: "When someone books a meeting with a @example.com email, message me in Slack."
160
+
161
+ Agent flow:
162
+
163
+ 1. Calls `manage-automations` with `action=list-events` to find `calendar.booking.created`.
164
+ 2. Confirms the plan with the user.
165
+ 3. Calls `manage-automations` with `action=define`:
166
+ - `name`: `slack-on-builder-booking`
167
+ - `trigger_type`: `event`
168
+ - `event`: `calendar.booking.created`
169
+ - `condition`: `attendee email ends with @example.com`
170
+ - `mode`: `agentic`
171
+ - `domain`: `calendar`
172
+ - `body`: `Send a Slack message to #sales with the booking details. Use the web-request tool to POST to ${keys.SLACK_WEBHOOK}.`
173
+
174
+ ## Key Files
175
+
176
+ | File | Purpose |
177
+ | ---------------------------------------------- | ------------------------------------------------ |
178
+ | `packages/core/src/triggers/types.ts` | `TriggerFrontmatter` interface |
179
+ | `packages/core/src/triggers/actions.ts` | Agent tools (define, list, update, delete, test) |
180
+ | `packages/core/src/triggers/dispatcher.ts` | Event subscription and agentic dispatch |
181
+ | `packages/core/src/triggers/condition-evaluator.ts` | Haiku condition classification with caching |
182
+ | `packages/core/src/event-bus/` | Event bus (register, emit, subscribe) |
183
+ | `packages/core/src/tools/fetch-tool.ts` | `web-request` tool with key substitution |
184
+ | `packages/core/src/secrets/substitution.ts` | `resolveKeyReferences()` and `validateUrlAllowlist()` |
185
+
186
+ ## Related Skills
187
+
188
+ - `recurring-jobs` -- schedule-triggered automations reuse the same scheduler
189
+ - `secrets` -- ad-hoc keys and `${keys.NAME}` substitution
190
+ - `actions` -- automations can call any registered action via the agent loop
191
+ - `delegate-to-agent` -- agentic mode runs a full `runAgentLoop`
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: capture-learnings
3
+ description: >-
4
+ Capture and apply accumulated knowledge via structured memory. Use when the
5
+ user gives feedback, shares preferences, corrects a mistake, or when you
6
+ discover something worth remembering for future conversations.
7
+ user-invocable: false
8
+ ---
9
+
10
+ # Capture Learnings
11
+
12
+ This is background knowledge, not a slash command. **Your memory index is loaded at the start of every conversation.** Use `save-memory` proactively when you learn something worth remembering.
13
+
14
+ ## How to Read & Write Memories
15
+
16
+ Memories are stored as **resources** in the SQL database (personal scope), not as files on disk.
17
+
18
+ - **Save a memory:** `save-memory --name <name> --type <type> --description "..." --content "..."`
19
+ - **Read a memory:** `resource-read --path memory/<name>.md`
20
+ - **Delete a memory:** `delete-memory --name <name>`
21
+ - **List all memories:** `resource-list --prefix memory/`
22
+
23
+ ## Memory Types
24
+
25
+ | Type | Use for |
26
+ |------|---------|
27
+ | `user` | Preferences, role, personal context, contacts |
28
+ | `feedback` | Corrections, confirmed approaches, things to avoid or repeat |
29
+ | `project` | Ongoing work context, decisions, deadlines, status |
30
+ | `reference` | Pointers to external systems, URLs, API details |
31
+
32
+ ## When to Capture
33
+
34
+ ### User Preferences & Memory (`user`)
35
+ - **Tone and style** — "I prefer casual tone", "don't use emojis", "keep replies short"
36
+ - **Personal context** — contacts, relationships, habits ("my wife's email is...", "I'm in PST timezone")
37
+ - **Workflow preferences** — "always CC my assistant", "I like to review before sending"
38
+ - **Role and expertise** — "I'm a data scientist", "new to React"
39
+
40
+ ### Feedback & Corrections (`feedback`)
41
+ - **Corrections** — user says "no, do it this way" → capture the right way
42
+ - **Confirmed approaches** — user validates a non-obvious choice ("yes, that's perfect")
43
+ - **Repeated friction** — you hit the same issue twice; save it
44
+
45
+ ### Project Context (`project`)
46
+ - **Ongoing work** — who is doing what, why, by when
47
+ - **Decisions** — why something is done a certain way
48
+ - **Status** — current state of initiatives
49
+
50
+ ### References (`reference`)
51
+ - **External systems** — "bugs are tracked in Linear project INGEST"
52
+ - **URLs** — dashboards, documentation, tools
53
+ - **API quirks** — undocumented behavior, version-specific gotchas
54
+
55
+ ### Don't Capture
56
+ - Things obvious from reading the code
57
+ - Standard language/framework behavior
58
+ - Temporary debugging notes
59
+ - Anything already in AGENTS.md or skills
60
+ - Ephemeral task details (use tasks/plans instead)
61
+
62
+ ## Key Rules
63
+
64
+ 1. **Save proactively — don't ask permission.** When you learn something, save it immediately.
65
+ 2. **One memory per topic** — e.g. `coding-style`, `project-alpha`, not one giant dump
66
+ 3. **Read before updating** — if a memory exists, read it first and merge, don't overwrite
67
+ 4. **Keep descriptions concise** — the index is loaded every conversation
68
+ 5. **Memories are SQL-backed** — safe for personal info, persist across sessions, not in git
69
+
70
+ ## Graduation
71
+
72
+ When a memory is referenced repeatedly, it may belong in AGENTS.md or a skill:
73
+ - Saving a memory is lightweight (auto-apply, personal scope)
74
+ - Updating AGENTS.md or a skill is heavier (affects all users/agents)
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: client-side-routing
3
+ description: >-
4
+ How to add routes without remounting the app shell. Use when adding a new
5
+ route, fixing agent sidebar reloads on navigation, or choosing between
6
+ `root.tsx` layout and pathless `_app.tsx` layout patterns.
7
+ ---
8
+
9
+ # Client-Side Routing
10
+
11
+ ## Rule
12
+
13
+ All templates are single-page apps using React Router. **Navigation must not remount the app shell.** The agent sidebar, document tree, and any other persistent chrome must survive route changes.
14
+
15
+ ## Why
16
+
17
+ If the shell unmounts on every navigation, the agent chat reconnects/reloads, destroying in-progress work and hammering the backend.
18
+
19
+ ## Hard Rule
20
+
21
+ **The app shell (AgentSidebar + any top-level navigation) must be mounted ONCE, above the `<Outlet />`.** Never wrap each page in its own `<AppLayout>` / `<Layout>`. React sees a different component at the outlet position on each nav and unmounts the entire subtree.
22
+
23
+ ## Two Correct Patterns
24
+
25
+ ### 1. All routes need the shell
26
+
27
+ Mount `<AppLayout>` in `root.tsx` around `<Outlet />`:
28
+
29
+ ```tsx
30
+ // app/root.tsx
31
+ <AppLayout>
32
+ <Outlet />
33
+ </AppLayout>
34
+ ```
35
+
36
+ ### 2. Mix of protected and public routes
37
+
38
+ Use a React Router **pathless layout route**:
39
+
40
+ ```
41
+ app/routes/
42
+ _app.tsx # renders <AppLayout><Outlet /></AppLayout>
43
+ _app._index.tsx # / → under AppLayout
44
+ _app.settings.tsx # /settings → under AppLayout
45
+ _app.team.tsx # /team → under AppLayout
46
+ book.$slug.tsx # /book/:slug → no layout (public)
47
+ f.$.tsx # /f/* → no layout (public form filler)
48
+ ```
49
+
50
+ The `_` prefix on `_app.tsx` makes it a **pathless** parent — it contributes the layout but no URL segment. Route files prefixed with `_app.` nest under it and share the layout instance across navigations.
51
+
52
+ ## Anti-Pattern
53
+
54
+ ```tsx
55
+ // ❌ BAD — each route wraps its own Layout, causing full remount on every nav
56
+ export default function Settings() {
57
+ return (
58
+ <AppLayout>
59
+ <SettingsContent />
60
+ </AppLayout>
61
+ );
62
+ }
63
+ ```
64
+
65
+ If a page needs per-route data (e.g. sidebar highlighting the active document), derive it inside the layout from `useParams()` / `useLocation()` — don't pass it as a prop through every route file.
66
+
67
+ ## Adding a New Route
68
+
69
+ - **Pattern #1** (AppLayout in `root.tsx`): just render page content — nothing else.
70
+ - **Pattern #2** (pathless `_app.tsx`): name the file `_app.<segment>.tsx` for authed routes, or bare `<segment>.tsx` for public routes.
71
+
72
+ ## Related Skills
73
+
74
+ - `adding-a-feature` — The four-area checklist referencing route layout patterns
75
+ - `context-awareness` — Navigation state written on every route change
@@ -0,0 +1,190 @@
1
+ ---
2
+ name: context-awareness
3
+ description: >-
4
+ How the agent knows what the user is looking at. Use when exposing UI state to
5
+ the agent, implementing view-screen or navigate scripts, wiring navigation
6
+ state, or debugging agent context issues.
7
+ ---
8
+
9
+ # Context Awareness
10
+
11
+ ## Rule
12
+
13
+ The agent must always know what the user is currently viewing. The UI writes navigation state on every route change. The agent reads it before acting.
14
+
15
+ ## Why
16
+
17
+ Without context awareness, the agent is blind. It asks "which email?" when the user is staring at one. It cannot act on the current selection, cannot provide relevant suggestions, and cannot modify what the user sees. Context awareness is what makes the agent feel like a collaborator rather than a disconnected chatbot.
18
+
19
+ ## The Three Patterns
20
+
21
+ ### 1. Navigation State (`navigation` key)
22
+
23
+ The UI writes a `navigation` key to application-state on every route change. This tells the agent what view the user is on and what item is selected.
24
+
25
+ **UI side** — the `use-navigation-state.ts` hook:
26
+
27
+ ```ts
28
+ // app/hooks/use-navigation-state.ts
29
+ import { useEffect, useCallback } from "react";
30
+ import { useLocation } from "react-router";
31
+ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
32
+
33
+ export function useNavigationState() {
34
+ const location = useLocation();
35
+
36
+ // Sync route to app-state on every navigation
37
+ useEffect(() => {
38
+ const state = deriveNavigationState(location.pathname);
39
+ fetch("/_agent-native/application-state/navigation", {
40
+ method: "PUT",
41
+ headers: { "Content-Type": "application/json" },
42
+ body: JSON.stringify(state),
43
+ }).catch(() => {});
44
+ }, [location.pathname]);
45
+
46
+ // ... also listen for navigate commands (pattern 3)
47
+ }
48
+ ```
49
+
50
+ **Agent side** — read before acting:
51
+
52
+ ```ts
53
+ import { readAppState } from "@agent-native/core/application-state";
54
+
55
+ const navigation = await readAppState("navigation");
56
+ // e.g. { view: "thread", threadId: "abc123", subject: "Re: Q3 Planning" }
57
+ ```
58
+
59
+ **What to include in navigation state:**
60
+
61
+ - `view` — the current page/section (e.g., "inbox", "form-builder", "dashboard")
62
+ - Item IDs — the selected/open item (e.g., `threadId`, `formId`, `issueKey`)
63
+ - Filter state — active search, label, or category filters
64
+ - Any selection — focused item, selected text range, active tab
65
+
66
+ ### 2. The `view-screen` Script
67
+
68
+ Every template should have a `view-screen` script. It reads navigation state, fetches the relevant data from the API, and returns a snapshot of what the user sees. This is the agent's eyes.
69
+
70
+ ```ts
71
+ // actions/view-screen.ts
72
+ import { readAppState } from "@agent-native/core/application-state";
73
+
74
+ export default async function main() {
75
+ const navigation = await readAppState("navigation");
76
+ const screen: Record<string, unknown> = { navigation };
77
+
78
+ // Fetch data based on what the user is viewing
79
+ if (navigation?.view === "inbox") {
80
+ const emails = await fetchEmailList(navigation.label);
81
+ screen.emailList = emails;
82
+ }
83
+ if (navigation?.threadId) {
84
+ const thread = await fetchThread(navigation.threadId);
85
+ screen.thread = thread;
86
+ }
87
+
88
+ console.log(JSON.stringify(screen, null, 2));
89
+ }
90
+ ```
91
+
92
+ **Navigation state is auto-injected into every user message as a `<current-screen>` block**, so the agent always has basic context without calling any tool. The `view-screen` action is still useful when you need a richer snapshot (e.g., fetching the full email thread or form data for the current view).
93
+
94
+ ### 3. The `navigate` Script
95
+
96
+ The agent writes a one-shot `navigate` command to application-state. The UI reads it, performs the navigation, and deletes the entry.
97
+
98
+ **Agent side:**
99
+
100
+ ```ts
101
+ import { writeAppState } from "@agent-native/core/application-state";
102
+
103
+ // Navigate the user to a specific thread
104
+ await writeAppState("navigate", { view: "inbox", threadId: "abc123" });
105
+ ```
106
+
107
+ **UI side** — the hook polls for the command:
108
+
109
+ ```ts
110
+ const { data: navCommand } = useQuery({
111
+ queryKey: ["navigate-command"],
112
+ queryFn: async () => {
113
+ const res = await fetch("/_agent-native/application-state/navigate");
114
+ if (!res.ok) return null;
115
+ const data = await res.json();
116
+ if (data) {
117
+ // Delete the one-shot command after reading
118
+ fetch("/_agent-native/application-state/navigate", { method: "DELETE" });
119
+ return data;
120
+ }
121
+ return null;
122
+ },
123
+ staleTime: 2_000,
124
+ });
125
+
126
+ useEffect(() => {
127
+ if (navCommand) {
128
+ router.navigate(buildPath(navCommand));
129
+ }
130
+ }, [navCommand]);
131
+ ```
132
+
133
+ ## Jitter Prevention
134
+
135
+ When the agent writes to application-state via script helpers (`writeAppState`), the write is tagged with `requestSource: "agent"`. The UI uses the `ignoreSource` option on `useDbSync()` with a per-tab ID so it ignores its own writes while still picking up changes from agents, other tabs, and scripts.
136
+
137
+ ```ts
138
+ // app/root.tsx
139
+ import { TAB_ID } from "@/lib/tab-id";
140
+
141
+ useDbSync({
142
+ queryClient,
143
+ queryKeys: ["app-state", "settings"],
144
+ ignoreSource: TAB_ID, // ignore events from this tab's own writes
145
+ });
146
+ ```
147
+
148
+ The UI sends its tab ID via `X-Request-Source` header on PUT/DELETE requests. The server stores this as the event's `requestSource`. When polling, the UI filters out events matching its own `ignoreSource` value. This prevents the UI from refetching data it just wrote.
149
+
150
+ ## Gold-Standard Example: Mail Template
151
+
152
+ The mail template demonstrates all three patterns working together:
153
+
154
+ **Navigation state shape:**
155
+ ```json
156
+ { "view": "inbox", "threadId": "thread-123", "focusedEmailId": "msg-456", "search": "budget", "label": "important" }
157
+ ```
158
+
159
+ **view-screen output:**
160
+ - Reads navigation state
161
+ - Fetches email list matching current view/search/label filters
162
+ - Fetches thread messages if a thread is open
163
+ - Returns everything as a single JSON snapshot
164
+
165
+ **navigate command:**
166
+ - `{ "view": "starred" }` — switch to starred view
167
+ - `{ "view": "inbox", "threadId": "thread-123" }` — open a specific thread
168
+
169
+ ## Do
170
+
171
+ - Use the auto-injected `<current-screen>` block for basic context — call `view-screen` only when you need richer data
172
+ - Include all relevant selection state in the `navigation` key (view, item IDs, filters)
173
+ - Update `view-screen` when adding new features — it should return data for every view
174
+ - Use the one-shot `navigate` command pattern for agent-initiated navigation
175
+ - Tag agent writes with `requestSource: "agent"` (the script helpers do this automatically)
176
+
177
+ ## Don't
178
+
179
+ - Don't assume the user is on a specific page — always check navigation state
180
+ - Don't hardcode navigation paths in scripts — read the current state and branch
181
+ - Don't write to the `navigation` key from the agent — it belongs to the UI. Use `navigate` instead.
182
+ - Don't ignore the `<current-screen>` block — it tells you where the user is
183
+ - Don't store fetched data in navigation state — it holds IDs and filters only. The `view-screen` script fetches the actual data.
184
+
185
+ ## Related Skills
186
+
187
+ - **adding-a-feature** — Context awareness is area 4 of the four-area checklist
188
+ - **real-time-sync** — How polling and `useDbSync` deliver app-state changes to the UI
189
+ - **scripts** — How to create the `view-screen` and `navigate` scripts
190
+ - **storing-data** — Application-state is one of the core SQL stores