@agent-native/core 0.145.4 → 0.145.6

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 (398) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +18 -0
  3. package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  4. package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +17 -1
  5. package/corpus/templates/analytics/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  6. package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +1 -0
  7. package/corpus/templates/analytics/.agents/skills/gong/SKILL.md +22 -3
  8. package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +76 -23
  9. package/corpus/templates/analytics/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  10. package/corpus/templates/analytics/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  11. package/corpus/templates/analytics/AGENTS.md +2 -1
  12. package/corpus/templates/analytics/actions/account-deep-dive.ts +83 -47
  13. package/corpus/templates/analytics/actions/create-dashboard-folder.ts +27 -0
  14. package/corpus/templates/analytics/actions/gong-calls.ts +3 -3
  15. package/corpus/templates/analytics/actions/list-dashboard-folders.ts +26 -0
  16. package/corpus/templates/analytics/actions/list-sql-dashboards.ts +1 -0
  17. package/corpus/templates/analytics/actions/set-dashboard-folder.ts +26 -0
  18. package/corpus/templates/analytics/app/components/ProviderCorpusJobNotifier.tsx +18 -3
  19. package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +6 -4
  20. package/corpus/templates/analytics/app/components/layout/Header.tsx +1 -0
  21. package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +12 -2
  22. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +35 -20
  23. package/corpus/templates/analytics/app/global.css +17 -0
  24. package/corpus/templates/analytics/app/hooks/use-dashboard-revisions.ts +29 -15
  25. package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +15 -3
  26. package/corpus/templates/analytics/app/i18n-data.ts +296 -0
  27. package/corpus/templates/analytics/app/lib/prefetch-keys.ts +23 -2
  28. package/corpus/templates/analytics/app/pages/DashboardOverview.tsx +642 -0
  29. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +66 -31
  30. package/corpus/templates/analytics/app/root.tsx +4 -0
  31. package/corpus/templates/analytics/app/routes/dashboards._index.tsx +5 -1
  32. package/corpus/templates/analytics/changelog/2026-08-07-added-a-dashboards-overview-with-personal-and-shared-folders.md +6 -0
  33. package/corpus/templates/analytics/changelog/2026-08-07-analytics-tracking-and-chat-startup-no-longer-emit-avoidable.md +6 -0
  34. package/corpus/templates/analytics/changelog/2026-08-07-dashboard-panels-now-load-custom-api-data-programs-reliably.md +6 -0
  35. package/corpus/templates/analytics/changelog/2026-08-07-gong-searches-conserve-api-quota-and-report-incomplete-coverage.md +6 -0
  36. package/corpus/templates/analytics/changelog/2026-08-07-searchable-dashboards-make-personal-and-shared-folders-easie.md +6 -0
  37. package/corpus/templates/analytics/netlify.toml +3 -0
  38. package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +112 -0
  39. package/corpus/templates/analytics/server/db/index.ts +12 -0
  40. package/corpus/templates/analytics/server/db/schema.ts +14 -0
  41. package/corpus/templates/analytics/server/jobs/analytics-rollup-backfill.ts +4 -0
  42. package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +1 -0
  43. package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +85 -15
  44. package/corpus/templates/analytics/server/lib/dashboard-folders-store.ts +168 -0
  45. package/corpus/templates/analytics/server/lib/dashboard-panel-query.ts +9 -4
  46. package/corpus/templates/analytics/server/lib/dashboards-store.ts +116 -1
  47. package/corpus/templates/analytics/server/lib/first-party-analytics-rollups.ts +4 -8
  48. package/corpus/templates/analytics/server/lib/gong.ts +139 -78
  49. package/corpus/templates/analytics/server/plugins/db.ts +55 -15
  50. package/corpus/templates/analytics/server/plugins/session-replay-retention-jobs.ts +6 -2
  51. package/corpus/templates/analytics/server/routes/api/session-replay/retention.post.ts +65 -0
  52. package/corpus/templates/assets/.agents/skills/actions/SKILL.md +18 -0
  53. package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  54. package/corpus/templates/assets/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  55. package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +1 -0
  56. package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +76 -23
  57. package/corpus/templates/assets/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  58. package/corpus/templates/assets/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  59. package/corpus/templates/brain/.agents/skills/actions/SKILL.md +18 -0
  60. package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  61. package/corpus/templates/brain/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  62. package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +1 -0
  63. package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +76 -23
  64. package/corpus/templates/brain/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  65. package/corpus/templates/brain/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  66. package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +18 -0
  67. package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  68. package/corpus/templates/calendar/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  69. package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +1 -0
  70. package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +76 -23
  71. package/corpus/templates/calendar/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  72. package/corpus/templates/calendar/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  73. package/corpus/templates/chat/.agents/skills/actions/SKILL.md +18 -0
  74. package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  75. package/corpus/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  76. package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
  77. package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
  78. package/corpus/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  79. package/corpus/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  80. package/corpus/templates/chat/.env.example +3 -0
  81. package/corpus/templates/chat/AGENTS.md +4 -0
  82. package/corpus/templates/clips/.agents/skills/actions/SKILL.md +18 -0
  83. package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  84. package/corpus/templates/clips/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  85. package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +1 -0
  86. package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +76 -23
  87. package/corpus/templates/clips/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  88. package/corpus/templates/clips/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  89. package/corpus/templates/clips/actions/lib/audio-only-transcription.ts +4 -0
  90. package/corpus/templates/clips/actions/request-transcript.ts +52 -3
  91. package/corpus/templates/clips/app/components/editor/editor-layout.tsx +8 -3
  92. package/corpus/templates/clips/app/components/editor/waveform.tsx +2 -1
  93. package/corpus/templates/clips/app/components/library/search-bar.tsx +1 -1
  94. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +3 -10
  95. package/corpus/templates/clips/app/global.css +9 -0
  96. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +1 -0
  97. package/corpus/templates/clips/changelog/2026-08-07-screen-recordings-now-capture-tab-and-system-audio-even-when.md +6 -0
  98. package/corpus/templates/clips/changelog/2026-08-07-transcription-now-retries-transient-cloud-failures-automatic.md +6 -0
  99. package/corpus/templates/clips/desktop/src-tauri/src/silence_detector.rs +10 -11
  100. package/corpus/templates/clips/server/db/schema.ts +7 -0
  101. package/corpus/templates/clips/server/plugins/db.ts +8 -0
  102. package/corpus/templates/clips/shared/recording-capture.ts +38 -0
  103. package/corpus/templates/clips/shared/transcript-failure.ts +89 -0
  104. package/corpus/templates/content/.agents/skills/actions/SKILL.md +18 -0
  105. package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  106. package/corpus/templates/content/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  107. package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +1 -0
  108. package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +76 -23
  109. package/corpus/templates/content/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  110. package/corpus/templates/content/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  111. package/corpus/templates/content/.env.example +9 -3
  112. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -0
  113. package/corpus/templates/content/changelog/2026-08-07-collapsed-sidebar-utility-buttons-stay-anchored-at-the-botto.md +6 -0
  114. package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  115. package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +76 -23
  116. package/corpus/templates/crm/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  117. package/corpus/templates/crm/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  118. package/corpus/templates/design/.agents/skills/actions/SKILL.md +18 -0
  119. package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  120. package/corpus/templates/design/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  121. package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +1 -0
  122. package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +76 -23
  123. package/corpus/templates/design/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  124. package/corpus/templates/design/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  125. package/corpus/templates/design/actions/view-screen.ts +1 -0
  126. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +14 -1
  127. package/corpus/templates/design/changelog/2026-08-07-cmd-c-now-copies-selected-text-in-the-agent-panel-instead-of.md +6 -0
  128. package/corpus/templates/design/changelog/2026-08-07-real-time-voice-can-now-read-the-current-selection-and-edit-.md +6 -0
  129. package/corpus/templates/design/server/lib/reprompt-action-guard.ts +7 -3
  130. package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +18 -0
  131. package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  132. package/corpus/templates/dispatch/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  133. package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +1 -0
  134. package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +76 -23
  135. package/corpus/templates/dispatch/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  136. package/corpus/templates/dispatch/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  137. package/corpus/templates/factory/.agents/skills/actions/SKILL.md +18 -0
  138. package/corpus/templates/factory/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  139. package/corpus/templates/factory/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  140. package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +1 -0
  141. package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +76 -23
  142. package/corpus/templates/factory/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  143. package/corpus/templates/factory/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  144. package/corpus/templates/factory/actions/babysit-agent-native-pull-request.ts +279 -0
  145. package/corpus/templates/factory/actions/get-factory-automation-health.ts +23 -4
  146. package/corpus/templates/factory/app/components/factory/FactoryCanvas.tsx +1 -1
  147. package/corpus/templates/factory/app/routes/factory.tsx +21 -3
  148. package/corpus/templates/factory/changelog/2026-08-07-factory-can-keep-builder-bot-pull-requests-moving-by-request.md +6 -0
  149. package/corpus/templates/factory/server/lib/require-factory-automation.ts +1 -0
  150. package/corpus/templates/factory/server/plugins/agent-chat.ts +4 -1
  151. package/corpus/templates/factory/server/plugins/factory-scheduler-job.ts +81 -12
  152. package/corpus/templates/factory/server/triage/github-client.ts +31 -0
  153. package/corpus/templates/factory/server/triage/pr-babysit.ts +75 -1
  154. package/corpus/templates/forms/.agents/skills/actions/SKILL.md +18 -0
  155. package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  156. package/corpus/templates/forms/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  157. package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +1 -0
  158. package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +76 -23
  159. package/corpus/templates/forms/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  160. package/corpus/templates/forms/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  161. package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  162. package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +1 -0
  163. package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +76 -23
  164. package/corpus/templates/macros/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  165. package/corpus/templates/macros/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  166. package/corpus/templates/mail/.agents/skills/actions/SKILL.md +18 -0
  167. package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  168. package/corpus/templates/mail/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  169. package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +1 -0
  170. package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +76 -23
  171. package/corpus/templates/mail/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  172. package/corpus/templates/mail/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  173. package/corpus/templates/plan/.agents/skills/actions/SKILL.md +18 -0
  174. package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  175. package/corpus/templates/plan/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  176. package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +1 -0
  177. package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +76 -23
  178. package/corpus/templates/plan/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  179. package/corpus/templates/plan/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  180. package/corpus/templates/plan/app/pages/PlansPage.tsx +2 -1
  181. package/corpus/templates/plan/changelog/2026-08-07-inline-help-icons-now-stay-visually-balanced-with-nearby-tex.md +6 -0
  182. package/corpus/templates/slides/.agents/skills/actions/SKILL.md +18 -0
  183. package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  184. package/corpus/templates/slides/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  185. package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +1 -0
  186. package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +76 -23
  187. package/corpus/templates/slides/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  188. package/corpus/templates/slides/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  189. package/corpus/templates/slides/.env.example +5 -0
  190. package/corpus/templates/slides/changelog/2026-08-07-fixed-generated-slides-briefly-disappearing-while-they-are-b.md +6 -0
  191. package/corpus/templates/slides/server/plugins/collab.ts +20 -8
  192. package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +18 -0
  193. package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  194. package/corpus/templates/tasks/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  195. package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +1 -0
  196. package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +76 -23
  197. package/corpus/templates/tasks/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  198. package/corpus/templates/tasks/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  199. package/corpus/templates/tasks/.env.example +3 -0
  200. package/dist/agent/production-agent.js +24 -3
  201. package/dist/client/AgentPanel.d.ts +6 -0
  202. package/dist/client/AgentPanel.js +176 -30
  203. package/dist/client/AssistantChat.d.ts +2 -0
  204. package/dist/client/AssistantChat.js +4 -1
  205. package/dist/client/ConnectBuilderCard.js +6 -11
  206. package/dist/client/MultiTabAssistantChat.js +1 -1
  207. package/dist/client/RuntimeConfigNotice.d.ts +1 -0
  208. package/dist/client/RuntimeConfigNotice.js +94 -0
  209. package/dist/client/agent-chat/index.d.ts +1 -1
  210. package/dist/client/agent-chat/index.js +1 -1
  211. package/dist/client/agent-chat-adapter.js +85 -4
  212. package/dist/client/agent-page/AgentTabsPage.js +1 -1
  213. package/dist/client/agent-sidebar-state.d.ts +6 -0
  214. package/dist/client/agent-sidebar-state.js +25 -0
  215. package/dist/client/app-providers.js +2 -1
  216. package/dist/client/assistant-ui-recovery.js +1 -1
  217. package/dist/client/chat/index.d.ts +1 -1
  218. package/dist/client/chat/index.js +1 -1
  219. package/dist/client/chat/markdown-renderer.d.ts +2 -1
  220. package/dist/client/chat/markdown-renderer.js +48 -2
  221. package/dist/client/chat/message-components.d.ts +6 -0
  222. package/dist/client/chat/message-components.js +182 -53
  223. package/dist/client/chat/tool-call-display.d.ts +16 -4
  224. package/dist/client/chat/tool-call-display.js +225 -18
  225. package/dist/client/extensions/ExtensionsSidebarSection.js +1 -1
  226. package/dist/client/frame-protocol.d.ts +4 -0
  227. package/dist/client/i18n.js +9 -0
  228. package/dist/client/integrations/IntegrationsPanel.js +2 -5
  229. package/dist/client/onboarding/FirstRunOnboarding.js +2 -3
  230. package/dist/client/org/TeamPage.js +49 -6
  231. package/dist/client/org/hooks.d.ts +7 -2
  232. package/dist/client/org/hooks.js +11 -4
  233. package/dist/client/resources/McpConnectionSuggestion.js +2 -3
  234. package/dist/client/resources/McpIntegrationDialog.js +2 -16
  235. package/dist/client/resources/McpIntegrationLogo.d.ts +11 -0
  236. package/dist/client/resources/McpIntegrationLogo.js +14 -0
  237. package/dist/client/resources/ResourceTree.js +1 -1
  238. package/dist/client/resources/mcp-integration-logos.d.ts +1 -0
  239. package/dist/client/resources/mcp-integration-logos.js +47 -18
  240. package/dist/client/settings/useBuilderStatus.js +6 -0
  241. package/dist/client/ui/index.d.ts +1 -0
  242. package/dist/client/ui/index.js +1 -0
  243. package/dist/collab/struct-routes.d.ts +1 -1
  244. package/dist/config.d.ts +26 -3
  245. package/dist/config.js +106 -14
  246. package/dist/db/ddl-guard.d.ts +15 -2
  247. package/dist/db/ddl-guard.js +53 -5
  248. package/dist/jobs/scheduler.js +7 -0
  249. package/dist/localization/default-messages.d.ts +17 -0
  250. package/dist/localization/default-messages.js +17 -0
  251. package/dist/mcp/oauth-client-metadata.js +5 -1
  252. package/dist/mcp/oauth-route.d.ts +5 -4
  253. package/dist/mcp/oauth-route.js +25 -9
  254. package/dist/mcp/server.d.ts +1 -1
  255. package/dist/mcp/server.js +9 -10
  256. package/dist/notifications/routes.d.ts +3 -3
  257. package/dist/org/handlers.d.ts +1 -0
  258. package/dist/org/handlers.js +17 -2
  259. package/dist/provider-api/actions/custom-provider-registration.d.ts +9 -9
  260. package/dist/provider-api/actions/provider-api.d.ts +7 -7
  261. package/dist/provider-api/corpus-jobs.d.ts +12 -2
  262. package/dist/provider-api/corpus-jobs.js +31 -1
  263. package/dist/provider-api/index.d.ts +2 -0
  264. package/dist/provider-api/index.js +7 -1
  265. package/dist/secrets/routes.d.ts +6 -6
  266. package/dist/server/agent-chat/recurring-jobs-runtime.d.ts +1 -1
  267. package/dist/server/agent-chat/recurring-jobs-runtime.js +14 -2
  268. package/dist/server/agent-chat/script-entries.js +12 -1
  269. package/dist/server/agent-chat-plugin.js +2 -2
  270. package/dist/server/auth.d.ts +1 -0
  271. package/dist/server/auth.js +85 -1
  272. package/dist/server/better-auth-instance.d.ts +9 -0
  273. package/dist/server/better-auth-instance.js +25 -11
  274. package/dist/server/core-routes-plugin.d.ts +7 -0
  275. package/dist/server/core-routes-plugin.js +51 -5
  276. package/dist/server/create-server.js +23 -2
  277. package/dist/server/db-pressure.d.ts +38 -0
  278. package/dist/server/db-pressure.js +147 -0
  279. package/dist/server/index.d.ts +1 -0
  280. package/dist/server/index.js +1 -0
  281. package/dist/server/legacy-auth-migration.d.ts +10 -0
  282. package/dist/server/legacy-auth-migration.js +37 -0
  283. package/dist/server/onboarding-html.js +206 -2
  284. package/dist/server/poll.d.ts +26 -0
  285. package/dist/server/poll.js +108 -13
  286. package/dist/server/realtime-voice.d.ts +2 -1
  287. package/dist/server/realtime-voice.js +38 -56
  288. package/dist/server/short-lived-token.d.ts +43 -0
  289. package/dist/server/short-lived-token.js +74 -0
  290. package/dist/server/ssr-handler.js +4 -1
  291. package/dist/shared/index.d.ts +1 -0
  292. package/dist/shared/index.js +1 -0
  293. package/dist/shared/runtime-config.d.ts +44 -0
  294. package/dist/shared/runtime-config.js +284 -0
  295. package/dist/styles/agent-native.css +48 -1
  296. package/dist/templates/chat/.agents/skills/actions/SKILL.md +18 -0
  297. package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  298. package/dist/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  299. package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
  300. package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
  301. package/dist/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  302. package/dist/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  303. package/dist/templates/chat/.env.example +3 -0
  304. package/dist/templates/chat/AGENTS.md +4 -0
  305. package/dist/templates/default/.agents/skills/actions/SKILL.md +18 -0
  306. package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  307. package/dist/templates/default/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  308. package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +1 -0
  309. package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +76 -23
  310. package/dist/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  311. package/dist/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  312. package/dist/templates/default/AGENTS.md +6 -1
  313. package/dist/templates/default/app/i18n/ar-SA.ts +6 -0
  314. package/dist/templates/default/app/i18n/de-DE.ts +6 -0
  315. package/dist/templates/default/app/i18n/en-US.ts +6 -0
  316. package/dist/templates/default/app/i18n/es-ES.ts +6 -0
  317. package/dist/templates/default/app/i18n/fr-FR.ts +6 -0
  318. package/dist/templates/default/app/i18n/hi-IN.ts +6 -0
  319. package/dist/templates/default/app/i18n/ja-JP.ts +6 -0
  320. package/dist/templates/default/app/i18n/ko-KR.ts +6 -0
  321. package/dist/templates/default/app/i18n/pt-BR.ts +6 -0
  322. package/dist/templates/default/app/i18n/zh-CN.ts +6 -0
  323. package/dist/templates/default/app/i18n/zh-TW.ts +6 -0
  324. package/dist/templates/headless/.agents/skills/actions/SKILL.md +18 -0
  325. package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  326. package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +76 -23
  327. package/dist/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  328. package/dist/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  329. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +18 -0
  330. package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  331. package/dist/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  332. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -0
  333. package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +76 -23
  334. package/dist/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  335. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  336. package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -0
  337. package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +8 -0
  338. package/dist/templates/workspace-core/AGENTS.md +7 -2
  339. package/dist/templates/workspace-root/AGENTS.md +5 -0
  340. package/dist/vite/client.d.ts +3 -3
  341. package/dist/vite/client.js +47 -1
  342. package/dist/vite/index.d.ts +1 -1
  343. package/docs/content/agent-native-config.mdx +240 -139
  344. package/docs/content/authentication.mdx +17 -0
  345. package/docs/content/deployment.mdx +19 -14
  346. package/docs/content/drop-in-agent.mdx +19 -2
  347. package/docs/content/environment-variables.mdx +63 -38
  348. package/docs/content/getting-started-actions.mdx +15 -6
  349. package/docs/content/getting-started-database.mdx +14 -10
  350. package/docs/content/getting-started-pages.mdx +32 -35
  351. package/docs/content/getting-started.mdx +7 -6
  352. package/package.json +2 -2
  353. package/src/templates/chat/.agents/skills/actions/SKILL.md +18 -0
  354. package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  355. package/src/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  356. package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
  357. package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
  358. package/src/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  359. package/src/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  360. package/src/templates/chat/.env.example +3 -0
  361. package/src/templates/chat/AGENTS.md +4 -0
  362. package/src/templates/default/.agents/skills/actions/SKILL.md +18 -0
  363. package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  364. package/src/templates/default/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  365. package/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -0
  366. package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +76 -23
  367. package/src/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  368. package/src/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  369. package/src/templates/default/AGENTS.md +6 -1
  370. package/src/templates/default/app/i18n/ar-SA.ts +6 -0
  371. package/src/templates/default/app/i18n/de-DE.ts +6 -0
  372. package/src/templates/default/app/i18n/en-US.ts +6 -0
  373. package/src/templates/default/app/i18n/es-ES.ts +6 -0
  374. package/src/templates/default/app/i18n/fr-FR.ts +6 -0
  375. package/src/templates/default/app/i18n/hi-IN.ts +6 -0
  376. package/src/templates/default/app/i18n/ja-JP.ts +6 -0
  377. package/src/templates/default/app/i18n/ko-KR.ts +6 -0
  378. package/src/templates/default/app/i18n/pt-BR.ts +6 -0
  379. package/src/templates/default/app/i18n/zh-CN.ts +6 -0
  380. package/src/templates/default/app/i18n/zh-TW.ts +6 -0
  381. package/src/templates/headless/.agents/skills/actions/SKILL.md +18 -0
  382. package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  383. package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +76 -23
  384. package/src/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  385. package/src/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  386. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +18 -0
  387. package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  388. package/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  389. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -0
  390. package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +76 -23
  391. package/src/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  392. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  393. package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -0
  394. package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +8 -0
  395. package/src/templates/workspace-core/AGENTS.md +7 -2
  396. package/src/templates/workspace-root/AGENTS.md +5 -0
  397. package/corpus/templates/dispatch/app/routes/admin.apps.$appId.tsx +0 -1
  398. package/corpus/templates/dispatch/app/routes/admin.apps.tsx +0 -1
@@ -0,0 +1,284 @@
1
+ /**
2
+ * Production configuration diagnostics.
3
+ *
4
+ * This module deliberately accepts an env-like record instead of reading
5
+ * process.env so the same rules can run during a Vite build, on the server,
6
+ * and in focused tests without ever exposing secret values to the browser.
7
+ */
8
+ const ENV_KEY_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
9
+ const RUNTIME_CONFIG_ISSUE_CODES = new Set([
10
+ "auth-disabled-in-production",
11
+ "missing-auth-secret",
12
+ "weak-auth-secret",
13
+ "missing-a2a-secret",
14
+ "weak-a2a-secret",
15
+ "invalid-auth-url",
16
+ "missing-database-url",
17
+ "local-database-in-production",
18
+ "missing-required-env",
19
+ ]);
20
+ export function runtimeConfigRequirementsFromSearchParams(searchParams) {
21
+ const requiredEnv = (searchParams.get("requiredEnv") ?? "")
22
+ .split(",")
23
+ .map((key) => key.trim())
24
+ .filter((key) => ENV_KEY_PATTERN.test(key))
25
+ .slice(0, 50);
26
+ return {
27
+ ...(searchParams.get("auth") === "0" ? { authEnabled: false } : {}),
28
+ ...(searchParams.get("database") === "0"
29
+ ? { databaseRequired: false }
30
+ : {}),
31
+ requiredEnv,
32
+ };
33
+ }
34
+ function valueOf(env, key) {
35
+ const value = env[key]?.trim();
36
+ return value || undefined;
37
+ }
38
+ function truthy(value) {
39
+ return value === "1" || value?.toLowerCase() === "true";
40
+ }
41
+ function isProductionEnvironment(env) {
42
+ return (valueOf(env, "NODE_ENV") === "production" ||
43
+ valueOf(env, "CONTEXT") === "production" ||
44
+ valueOf(env, "VERCEL_ENV") === "production");
45
+ }
46
+ function isWorkspaceRuntime(env) {
47
+ return (valueOf(env, "AGENT_NATIVE_WORKSPACE") === "1" ||
48
+ valueOf(env, "VITE_AGENT_NATIVE_WORKSPACE") === "1");
49
+ }
50
+ function appEnvPrefix(env, appName) {
51
+ const raw = appName ?? valueOf(env, "APP_NAME");
52
+ const prefix = raw?.toUpperCase().replace(/-/g, "_");
53
+ return prefix && ENV_KEY_PATTERN.test(prefix) ? prefix : undefined;
54
+ }
55
+ function databaseEnvKeys(env, appName) {
56
+ const keys = [];
57
+ const prefix = appEnvPrefix(env, appName);
58
+ if (prefix)
59
+ keys.push(`${prefix}_DATABASE_URL`);
60
+ keys.push("DATABASE_URL", "NETLIFY_DATABASE_URL");
61
+ return keys;
62
+ }
63
+ function configuredKey(env, keys) {
64
+ return keys.find((key) => valueOf(env, key));
65
+ }
66
+ function isLocalDatabaseUrl(url) {
67
+ return (url === "" ||
68
+ url.startsWith("file:") ||
69
+ url.startsWith("pglite:") ||
70
+ !url.includes("://"));
71
+ }
72
+ function isLoopbackUrl(url) {
73
+ try {
74
+ const hostname = new URL(url).hostname.toLowerCase();
75
+ return (hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1");
76
+ }
77
+ catch {
78
+ // coercion-ok: malformed URLs are not loopback; validation reports the config issue.
79
+ return false;
80
+ }
81
+ }
82
+ function addIssue(issues, issue, environment) {
83
+ issues.push({
84
+ ...issue,
85
+ severity: issue.severity ?? (environment === "production" ? "error" : "warning"),
86
+ });
87
+ }
88
+ export function buildRuntimeConfigPrompt(report, appName) {
89
+ const appLine = appName ? `\nApp: ${appName}` : "";
90
+ const issueLines = report.issues
91
+ .map((issue) => `- ${issue.severity.toUpperCase()}: ${issue.title}. ${issue.message}`)
92
+ .join("\n");
93
+ return [
94
+ "Fix this Agent-Native deployment configuration issue.",
95
+ `Environment: ${report.environment}`,
96
+ `Phase: ${report.phase}${appLine}`,
97
+ "",
98
+ "Detected issues:",
99
+ issueLines || "- No issues were reported.",
100
+ "",
101
+ "Inspect the app's agent-native.json or agent-native.ts, its deployment configuration, and the framework defaults. Make the smallest safe fix. Keep secrets out of source control. Do not print secret values in your response. Tell me exactly which deploy settings still need to be set, then verify the production build and runtime health check.",
102
+ ].join("\n");
103
+ }
104
+ export function getRuntimeConfigReport(env, requirements = {}, options = {}) {
105
+ const environment = options.environment ??
106
+ (isProductionEnvironment(env) ? "production" : "development");
107
+ const phase = options.phase ?? "runtime";
108
+ const authEnabled = requirements.authEnabled ?? true;
109
+ const databaseRequired = requirements.databaseRequired ?? true;
110
+ const issues = [];
111
+ if (environment === "production") {
112
+ if (authEnabled) {
113
+ if (truthy(valueOf(env, "AUTH_DISABLED"))) {
114
+ addIssue(issues, {
115
+ code: "auth-disabled-in-production",
116
+ title: "Authentication is disabled in production",
117
+ message: "AUTH_DISABLED is enabled. Unset it for a public deployment. Auth is enabled by default, so AUTH_DISABLED=false does not need to be added.",
118
+ envKeys: ["AUTH_DISABLED"],
119
+ }, environment);
120
+ }
121
+ const authSecret = valueOf(env, "BETTER_AUTH_SECRET");
122
+ const workspaceSecret = valueOf(env, "A2A_SECRET");
123
+ const hasAuthSecret = Boolean(authSecret);
124
+ const hasWorkspaceSecret = Boolean(workspaceSecret);
125
+ if (!hasAuthSecret && !(isWorkspaceRuntime(env) && hasWorkspaceSecret)) {
126
+ addIssue(issues, {
127
+ code: "missing-auth-secret",
128
+ title: "BETTER_AUTH_SECRET is not set for production",
129
+ message: "Set BETTER_AUTH_SECRET in the deployment environment, using a fresh value from `openssl rand -hex 32`. The public auth URL is inferred from APP_URL, known template or request context, and platform metadata such as Netlify or Vercel; AUTH_DISABLED defaults to false, so neither URL nor bypass flag needs to be prefilled.",
130
+ envKeys: ["BETTER_AUTH_SECRET"],
131
+ }, environment);
132
+ }
133
+ if (authSecret && authSecret.length < 32) {
134
+ addIssue(issues, {
135
+ code: "weak-auth-secret",
136
+ title: "BETTER_AUTH_SECRET is too short",
137
+ message: "Use a fresh random BETTER_AUTH_SECRET with at least 32 characters, such as the output of `openssl rand -hex 32`.",
138
+ envKeys: ["BETTER_AUTH_SECRET"],
139
+ }, environment);
140
+ }
141
+ const explicitAuthUrl = valueOf(env, "APP_URL") ?? valueOf(env, "BETTER_AUTH_URL");
142
+ if (explicitAuthUrl) {
143
+ let invalid = false;
144
+ try {
145
+ const parsed = new URL(explicitAuthUrl);
146
+ invalid = !["http:", "https:"].includes(parsed.protocol);
147
+ }
148
+ catch {
149
+ invalid = true;
150
+ }
151
+ if (isLoopbackUrl(explicitAuthUrl))
152
+ invalid = true;
153
+ if (invalid) {
154
+ addIssue(issues, {
155
+ code: "invalid-auth-url",
156
+ title: "The public auth URL is not deployable",
157
+ message: "APP_URL or BETTER_AUTH_URL must be an absolute public http(s) URL. Leave them unset when the platform URL should be inferred.",
158
+ envKeys: ["APP_URL", "BETTER_AUTH_URL"],
159
+ }, environment);
160
+ }
161
+ }
162
+ }
163
+ const workspaceSecret = valueOf(env, "A2A_SECRET");
164
+ if (isWorkspaceRuntime(env) && !workspaceSecret) {
165
+ addIssue(issues, {
166
+ code: "missing-a2a-secret",
167
+ title: "The workspace runtime needs A2A_SECRET",
168
+ message: "Set A2A_SECRET for trusted internal calls and the workspace's derived auth and OAuth secrets.",
169
+ envKeys: ["A2A_SECRET"],
170
+ }, environment);
171
+ }
172
+ if (isWorkspaceRuntime(env) &&
173
+ workspaceSecret &&
174
+ workspaceSecret.length < 32) {
175
+ addIssue(issues, {
176
+ code: "weak-a2a-secret",
177
+ title: "A2A_SECRET is too short",
178
+ message: "Use a fresh random A2A_SECRET with at least 32 characters, such as the output of `openssl rand -hex 32`.",
179
+ envKeys: ["A2A_SECRET"],
180
+ }, environment);
181
+ }
182
+ if (databaseRequired) {
183
+ const dbKeys = databaseEnvKeys(env, options.appName);
184
+ const dbKey = configuredKey(env, dbKeys);
185
+ const dbUrl = dbKey ? valueOf(env, dbKey) : undefined;
186
+ if (!dbUrl) {
187
+ addIssue(issues, {
188
+ code: "missing-database-url",
189
+ title: "Production has no persistent database URL",
190
+ message: `Set ${dbKeys.join(", ")} to a persistent SQL database. Local SQLite is a development fallback and is not safe for a serverless production deploy.`,
191
+ envKeys: dbKeys,
192
+ }, environment);
193
+ }
194
+ else if (dbKey && isLocalDatabaseUrl(dbUrl)) {
195
+ addIssue(issues, {
196
+ code: "local-database-in-production",
197
+ title: "Production is using a local database",
198
+ message: `${dbKey} resolves to a local database. Use a persistent remote SQL URL for deploys so auth and app state survive new instances.`,
199
+ envKeys: [dbKey],
200
+ }, environment);
201
+ }
202
+ }
203
+ }
204
+ for (const key of requirements.requiredEnv ?? []) {
205
+ if (!ENV_KEY_PATTERN.test(key) || valueOf(env, key))
206
+ continue;
207
+ addIssue(issues, {
208
+ code: "missing-required-env",
209
+ title: `${key} is not configured`,
210
+ message: `The app declares ${key} as required. Set it in the local or deployment environment, or remove it from the app configuration if the feature is not used.`,
211
+ envKeys: [key],
212
+ }, environment);
213
+ }
214
+ const status = issues.some((issue) => issue.severity === "error")
215
+ ? "error"
216
+ : issues.length > 0
217
+ ? "warning"
218
+ : "ok";
219
+ const report = {
220
+ ok: issues.length === 0,
221
+ status,
222
+ environment,
223
+ phase,
224
+ issues,
225
+ prompt: "",
226
+ };
227
+ report.prompt = buildRuntimeConfigPrompt(report, options.appName);
228
+ return report;
229
+ }
230
+ export function formatRuntimeConfigReport(report) {
231
+ if (report.issues.length === 0) {
232
+ return `[agent-native] ${report.environment} runtime configuration is ready.`;
233
+ }
234
+ const heading = report.status === "error"
235
+ ? "configuration errors"
236
+ : "configuration warnings";
237
+ const issueLines = report.issues
238
+ .map((issue) => ` - ${issue.severity.toUpperCase()}: ${issue.title}. ${issue.message}`)
239
+ .join("\n");
240
+ return [
241
+ `[agent-native] ${report.environment} ${heading}:`,
242
+ issueLines,
243
+ "",
244
+ "Copy the prompt below to an AI coding agent for guided remediation:",
245
+ report.prompt,
246
+ ].join("\n");
247
+ }
248
+ export function parseRuntimeConfigReport(value) {
249
+ if (!value || typeof value !== "object" || Array.isArray(value))
250
+ return null;
251
+ const report = value;
252
+ if ((report.status !== "ok" &&
253
+ report.status !== "warning" &&
254
+ report.status !== "error") ||
255
+ (report.environment !== "development" &&
256
+ report.environment !== "production") ||
257
+ (report.phase !== "build" && report.phase !== "runtime") ||
258
+ !Array.isArray(report.issues) ||
259
+ typeof report.prompt !== "string") {
260
+ return null;
261
+ }
262
+ const issues = report.issues;
263
+ if (typeof report.ok !== "boolean" ||
264
+ !issues.every((issue) => !!issue &&
265
+ typeof issue === "object" &&
266
+ RUNTIME_CONFIG_ISSUE_CODES.has(issue.code) &&
267
+ (issue.severity === "warning" ||
268
+ issue.severity === "error") &&
269
+ typeof issue.title === "string" &&
270
+ typeof issue.message === "string" &&
271
+ Array.isArray(issue.envKeys) &&
272
+ issue.envKeys.every((key) => typeof key === "string"))) {
273
+ return null;
274
+ }
275
+ const expectedStatus = issues.some((issue) => issue.severity === "error")
276
+ ? "error"
277
+ : issues.length > 0
278
+ ? "warning"
279
+ : "ok";
280
+ if (report.ok !== (issues.length === 0) || report.status !== expectedStatus) {
281
+ return null;
282
+ }
283
+ return report;
284
+ }
@@ -179,6 +179,12 @@
179
179
  background: transparent;
180
180
  }
181
181
 
182
+ .agent-sidebar-drawer-placeholder {
183
+ height: 100%;
184
+ min-width: 0;
185
+ pointer-events: none;
186
+ }
187
+
182
188
  .agent-layout-main-surface,
183
189
  .agent-sidebar-main-surface {
184
190
  position: relative;
@@ -297,6 +303,26 @@
297
303
  transition: transform 260ms var(--ease-drawer);
298
304
  }
299
305
 
306
+ /* The wide preset keeps the normal sidebar slot in flow while its panel
307
+ overlays the page as a fixed drawer. View Transitions morph the geometry
308
+ when available; these transforms provide the fallback and exit motion. */
309
+ .agent-sidebar-panel[data-agent-sidebar-animation="drawer"] {
310
+ overflow: clip;
311
+ will-change: transform;
312
+ box-shadow: -12px 0 30px hsl(var(--foreground) / 0.08);
313
+ transition:
314
+ transform 260ms var(--ease-drawer),
315
+ width 260ms var(--ease-drawer);
316
+ }
317
+
318
+ .agent-sidebar-panel[data-agent-sidebar-animation="drawer"][data-agent-sidebar-state="closed"][data-agent-sidebar-position="right"] {
319
+ transform: translateX(100%);
320
+ }
321
+
322
+ .agent-sidebar-panel[data-agent-sidebar-animation="drawer"][data-agent-sidebar-state="closed"][data-agent-sidebar-position="left"] {
323
+ transform: translateX(-100%);
324
+ }
325
+
300
326
  .agent-sidebar-panel[data-agent-sidebar-animation="desktop"][data-agent-sidebar-state="open"]
301
327
  > .agent-sidebar-panel-inner {
302
328
  transform: translateX(0);
@@ -364,6 +390,7 @@
364
390
  .agent-sidebar-panel[data-agent-sidebar-animation],
365
391
  .agent-sidebar-panel[data-agent-sidebar-animation="desktop"]
366
392
  > .agent-sidebar-panel-inner,
393
+ .agent-sidebar-panel[data-agent-sidebar-animation="drawer"],
367
394
  .agent-sidebar-backdrop[data-agent-sidebar-animation] {
368
395
  transition: none;
369
396
  }
@@ -935,6 +962,21 @@
935
962
  width: 100%;
936
963
  }
937
964
 
965
+ /* Tool-call rows are rendered in several disclosure/grouping shapes as the
966
+ stream grows. Keep the motion wrapper layout-transparent, while its short
967
+ lived exit clones can travel from the visible stack into the summary row. */
968
+ .agent-tool-call-stack {
969
+ display: contents;
970
+ }
971
+
972
+ .agent-tool-call-stack__exit {
973
+ box-sizing: border-box;
974
+ position: fixed;
975
+ z-index: 2;
976
+ pointer-events: none;
977
+ margin: 0 !important;
978
+ }
979
+
938
980
  [data-agent-empty-state="centered"] {
939
981
  justify-content: center;
940
982
  padding-bottom: clamp(3rem, 8vh, 6rem);
@@ -978,10 +1020,15 @@
978
1020
  }
979
1021
 
980
1022
  @media (prefers-reduced-motion: no-preference) {
981
- .agent-tool-call--entering {
1023
+ .agent-tool-call--entering > .agent-tool-call__content,
1024
+ .agent-tool-call--stack-entering > .agent-tool-call__content {
982
1025
  animation: agent-tool-call-enter 220ms var(--ease-out-strong) both;
983
1026
  }
984
1027
 
1028
+ .agent-tool-summary__label {
1029
+ display: inline-block;
1030
+ }
1031
+
985
1032
  @supports ((background-clip: text) or (-webkit-background-clip: text)) {
986
1033
  .agent-thinking-indicator__text,
987
1034
  .agent-running-shimmer {
@@ -20,6 +20,24 @@ Before creating any custom REST/API route for app data, inspect `actions/` and t
20
20
 
21
21
  **Stop trigger:** the moment you are about to create a file under `server/routes/api/` — or add server middleware to guard one — stop and check it against the exception list in *When You Still Need Custom `/api/` Routes* below. If it is not on that list, write a `defineAction` instead. This applies even when you already started the route; abandoning a half-written action to hand-roll routes is the exact failure this rule exists to prevent.
22
22
 
23
+ ## Keep actions deterministic and composable
24
+
25
+ An action may call a provider API, validate or normalize data, and persist
26
+ records without being an AI feature. Keep those operations deterministic,
27
+ focused, and independently useful to the agent. Do not put LLM calls or a
28
+ second model runtime in ordinary actions. The only narrow exception is the
29
+ `completeText()` text-in/text-out escape hatch described in
30
+ `delegate-to-agent`; it must not own tools, chat history, run state, side
31
+ effects, or user steering.
32
+
33
+ When a workflow is framed as research, analysis, generation, recommendation,
34
+ or synthesis, or spans several provider calls and writes, route the user into
35
+ the AgentSidebar and let the agent orchestrate focused actions. Do not hide an
36
+ AI-shaped workflow behind one opaque `generate-*` or `create-*` action just
37
+ because its implementation is deterministic. A visible user-initiated run
38
+ should use `sendToAgentChat({ openSidebar: true })`, and its follow-ups should
39
+ continue in the same thread rather than a separate freeform input.
40
+
23
41
  ## Why
24
42
 
25
43
  Actions give the agent callable tools with structured input/output, AND they give the frontend a typed client contract through hooks. 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.
@@ -56,6 +56,11 @@ The repeated app shell has two distinct navigation surfaces:
56
56
  labeled as local, preview, or analyze. For original/generated review, stack
57
57
  the source above the result by default and use side-by-side only for short,
58
58
  highly scannable content.
59
+ - Deterministic implementation does not make an AI-shaped experience
60
+ deterministic. If the user expects research, analysis, generation,
61
+ recommendation, synthesis, visible progress, or steering, route the button
62
+ to the AgentSidebar and let the agent call focused actions. Keep revisions in
63
+ the same thread instead of adding a second freeform prompt box.
59
64
  - Standalone apps with `AgentSidebar` must resolve one assistant-ui runtime
60
65
  context. Match direct assistant-ui pins to the installed core/toolkit peer
61
66
  graph, use Vite dedupe/aliases when linked dependencies can split contexts,
@@ -14,11 +14,21 @@ metadata:
14
14
 
15
15
  ## Rule
16
16
 
17
- The UI never calls an LLM directly. Product workflows are delegated to the
18
- agent through the chat bridge so users can see, steer, and audit the work.
19
- Server-side one-shot model calls are an explicit escape hatch for narrow text
20
- transforms only; use `completeText()` from `@agent-native/core/server` when the
21
- work intentionally does not need tools, chat history, or run state.
17
+ The app's default AI surface is the agent chat. Any user-facing work that asks
18
+ the model to research, analyze, generate, recommend, synthesize, or reason over
19
+ multiple steps must start or continue in the AgentSidebar so users can see,
20
+ steer, and audit the work. UI buttons use `sendToAgentChat()` with
21
+ `openSidebar: true`, and follow-up or revision text belongs in that same thread
22
+ instead of a second app-local textbox.
23
+
24
+ Actions are tools, not alternate AI runtimes. Keep them deterministic and
25
+ focused: provider reads, validation, deterministic transforms, CRUD, and
26
+ persistence are good action work. Let the agent orchestrate several such tools
27
+ when the workflow is AI-shaped or user-steerable. Server-side one-shot model
28
+ calls are a rare escape hatch for narrow text transforms only; use
29
+ `completeText()` from `@agent-native/core/server` only when the work
30
+ intentionally does not need tools, chat history, run state, side effects, or
31
+ user steering.
22
32
 
23
33
  ## Why
24
34
 
@@ -35,6 +45,7 @@ sendToAgentChat({
35
45
  message: "Generate a summary of this document",
36
46
  context: documentContent, // optional hidden context (not shown in chat UI)
37
47
  submit: true, // auto-submit to the agent
48
+ openSidebar: true,
38
49
  });
39
50
  ```
40
51
 
@@ -56,6 +67,10 @@ sendToAgentChat({
56
67
  This is still a full agent run: tools, actions, thread state, and run tracking
57
68
  all remain active. It simply does not focus or open the sidebar.
58
69
 
70
+ Use this silent form only for explicitly background or system-initiated work.
71
+ It is not the default for a user clicking an AI-labeled button; visible work
72
+ should open the sidebar so the user can follow and redirect the run.
73
+
59
74
  **From scripts (Node):**
60
75
 
61
76
  ```ts
@@ -77,8 +92,9 @@ const result = await completeText({
77
92
  });
78
93
  ```
79
94
 
80
- Wrap user-facing uses in actions so the UI and agent share the same operation.
81
- Do not call provider SDKs directly.
95
+ If the narrow exception is exposed to the UI, wrap it in an action so the UI
96
+ and agent share the same operation. Keep it clearly non-conversational and do
97
+ not call provider SDKs directly.
82
98
 
83
99
  **From the UI, detecting when agent is done:**
84
100
 
@@ -97,9 +113,9 @@ The `submit` option controls whether the message is sent automatically or placed
97
113
 
98
114
  | `submit` value | Behavior | Use when |
99
115
  | -------------- | --------------------------------------- | ----------------------------------------------------------------------------------- |
100
- | `true` | Auto-submits to the agent immediately | Routine operations the user has already approved |
101
- | `false` | Prefills the chat input for user review | High-stakes operations (deleting data, modifying code, API calls with side effects) |
102
- | omitted | Uses the project's default setting | General-purpose delegation |
116
+ | `true` | Auto-submits to the agent immediately | Routine operations with clear intent; keep `openSidebar: true` for visible work |
117
+ | `false` | Prefills the AgentSidebar composer | Review, edit, or add detail before the run; use the existing sidebar thread |
118
+ | omitted | Uses the project's default setting | General-purpose delegation |
103
119
 
104
120
  ```ts
105
121
  // Auto-submit: routine operation
@@ -109,61 +125,43 @@ sendToAgentChat({ message: "Update the project summary", submit: true });
109
125
  sendToAgentChat({
110
126
  message: "Delete all projects older than 30 days",
111
127
  submit: false,
128
+ openSidebar: true,
112
129
  });
113
130
  ```
114
131
 
115
- ## Capture user input first when generating from a prompt
116
-
117
- Buttons that produce new content ("New Design", "Create Dashboard", "Make Deck", "Generate Form") need the user's prompt as input. **Never hardcode a generic message** — the result will be a generic generation the user didn't actually ask for.
132
+ ## Capture user input in the sidebar
118
133
 
119
- **Bad** — auto-submits a placeholder message; the user never said what they wanted:
134
+ The AgentSidebar composer is the default prompt surface. When a button needs
135
+ the user to describe what to create, prefill that same composer and let the
136
+ user edit or complete it:
120
137
 
121
138
  ```tsx
122
139
  <Button
123
140
  onClick={() =>
124
- sendToAgentChat({ message: "make a design", submit: true })
141
+ sendToAgentChat({
142
+ message: "Help me create a research report from this brief:",
143
+ context: researchBrief,
144
+ submit: false,
145
+ openSidebar: true,
146
+ })
125
147
  }
126
148
  >
127
- New Design
149
+ Start in agent
128
150
  </Button>
129
151
  ```
130
152
 
131
- **Good** — Popover anchored to the button captures the prompt, then submits it:
132
-
133
- ```tsx
134
- <Popover open={open} onOpenChange={setOpen}>
135
- <PopoverTrigger asChild>
136
- <Button>New Design</Button>
137
- </PopoverTrigger>
138
- <PopoverContent className="w-96">
139
- <Textarea
140
- autoFocus
141
- value={prompt}
142
- onChange={(e) => setPrompt(e.target.value)}
143
- placeholder="What do you want to design?"
144
- />
145
- <Button
146
- onClick={() => {
147
- sendToAgentChat({ message: prompt, submit: true });
148
- setOpen(false);
149
- setPrompt("");
150
- }}
151
- >
152
- Create
153
- </Button>
154
- </PopoverContent>
155
- </Popover>
156
- ```
157
-
158
- **Always ask for input first when** the output depends on a prompt the user must provide — "design what?", "deck about what?", "dashboard for which metric?", "form for which use case?".
159
-
160
- **Auto-submit without input is fine when intent is unambiguous:**
153
+ Never auto-submit a generic creative prompt when the user has not said what
154
+ they want. Auto-submit without additional input is fine when intent is
155
+ unambiguous:
161
156
 
162
157
  - "Try to fix" on a tool error — submits the error details with a clear fix instruction
163
158
  - "Retry the last operation" after a transient failure
164
159
  - Single-purpose buttons where there is nothing meaningful for the user to add
165
160
 
166
- If you find yourself writing `submit: true` with a hardcoded creative verb (`"design a..."`, `"write a..."`, `"build a..."`), stop and add a Popover.
161
+ Use a Popover only for compact, structured parameters the UI must validate,
162
+ such as a date range, target, or approval choice. Do not add a second freeform
163
+ prompt or follow-up textbox for an AI workflow; keep the conversation and
164
+ revisions in the AgentSidebar thread.
167
165
 
168
166
  ## Delegating to a Sub-Agent (Agent Teams)
169
167
 
@@ -130,6 +130,7 @@ passed this requirement yet.
130
130
  - Do not build custom dropdowns, menus, popovers, modals, or confirmations with manual absolute positioning and click-outside effects.
131
131
  - Never use browser dialogs (`window.alert`, `window.confirm`, `window.prompt`). Use `AlertDialog`, `Dialog`, or app-specific confirmation UI.
132
132
  - Use Tabler icons for all first-party UI icons. Do not add Lucide, Heroicons, inline SVG icon sets, or emoji icons.
133
+ - Keep inline help/info glyphs next to labels at `size-3` (12px) or smaller than the adjacent text. Preserve a larger hit area on the trigger, not the glyph. Use `guard:allow-large-help-icon` only for deliberate heading documentation or menu action exceptions.
133
134
  - Use `useActionQuery` and `useActionMutation` from `@agent-native/core/client` for action-backed UI. Standard CRUD should go through actions, not custom `/api/` routes.
134
135
  - Keep UI optimistic where possible: update cache and navigation immediately, then reconcile or roll back on mutation result.
135
136
  - Custom styles belong in Tailwind classes, component CSS, or the existing global CSS theme file; avoid inline styles.