@agent-native/core 0.148.0 → 0.149.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/changelog/2026-08-10-wide-tables-in-analytics-chat-now-scroll-horizontally-within.md +6 -0
  3. package/corpus/templates/calendar/app/components/calendar/DayView.tsx +13 -53
  4. package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +11 -70
  5. package/corpus/templates/calendar/app/lib/event-layout.ts +122 -0
  6. package/corpus/templates/calendar/app/routes/_app.availability.tsx +1 -1
  7. package/corpus/templates/calendar/changelog/2026-08-10-opening-availability-settings-from-the-agent-lands-on-the-av.md +6 -0
  8. package/corpus/templates/calendar/vitest.config.ts +6 -1
  9. package/corpus/templates/clips/actions/lib/audio-only-transcription.ts +3 -1
  10. package/corpus/templates/clips/app/components/player/video-player.tsx +44 -4
  11. package/corpus/templates/clips/changelog/2026-08-10-fixed-transcription-failures-for-recordings-without-captured.md +6 -0
  12. package/corpus/templates/clips/changelog/2026-08-10-mobile-clips-can-now-enter-fullscreen-on-iphone-safari.md +6 -0
  13. package/corpus/templates/content/actions/_property-utils.ts +11 -1
  14. package/corpus/templates/content/actions/view-screen.ts +62 -12
  15. package/corpus/templates/content/server/plugins/agent-chat.ts +2 -0
  16. package/corpus/templates/design/.agents/skills/design-templates/SKILL.md +22 -0
  17. package/corpus/templates/design/AGENTS.md +3 -0
  18. package/corpus/templates/design/actions/create-design-from-template.ts +19 -0
  19. package/corpus/templates/design/actions/get-design-snapshot.ts +18 -0
  20. package/corpus/templates/design/actions/get-design-template.ts +178 -0
  21. package/corpus/templates/design/actions/list-designs.ts +3 -1
  22. package/corpus/templates/design/actions/view-screen.ts +31 -0
  23. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +225 -214
  24. package/corpus/templates/design/app/components/design/multi-screen/types.ts +3 -0
  25. package/corpus/templates/design/app/i18n-data.ts +78 -0
  26. package/corpus/templates/design/app/lib/design-authors.ts +64 -0
  27. package/corpus/templates/design/app/pages/Index.tsx +114 -4
  28. package/corpus/templates/design/app/pages/design-editor/generation-prompt-directives.ts +1 -0
  29. package/corpus/templates/design/changelog/2026-08-07-alt-dragging-an-element-to-copy-it-now-keeps-the-copy-visibl.md +6 -0
  30. package/corpus/templates/design/changelog/2026-08-07-design-cards-now-show-who-created-each-design-with-a-filter-.md +6 -0
  31. package/corpus/templates/design/changelog/2026-08-07-drawing-a-shape-on-the-overview-canvas-now-keeps-the-shape-s.md +6 -0
  32. package/corpus/templates/design/changelog/2026-08-07-hold-option-alt-while-dragging-a-frame-on-the-overview-canva.md +6 -0
  33. package/corpus/templates/design/server/lib/design-template-data.ts +143 -0
  34. package/corpus/templates/design/server/plugins/agent-chat.ts +1 -0
  35. package/corpus/templates/forms/AGENTS.md +2 -2
  36. package/corpus/templates/forms/actions/create-form.ts +1 -1
  37. package/corpus/templates/forms/actions/update-form.ts +5 -5
  38. package/corpus/templates/forms/changelog/2026-08-10-forms-now-keep-agent-applied-field-changes-visible-after-an-.md +6 -0
  39. package/corpus/templates/forms/changelog/2026-08-10-published-form-links-always-use-the-working-public-form-url.md +6 -0
  40. package/corpus/templates/forms/server/plugins/agent-chat.ts +2 -2
  41. package/corpus/templates/slides/AGENTS.md +4 -3
  42. package/corpus/templates/slides/actions/import-google-slides-reference.ts +56 -10
  43. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +12 -74
  44. package/corpus/templates/slides/app/components/editor/GeneratingSlidePreview.tsx +5 -1
  45. package/corpus/templates/slides/app/components/editor/GoogleDriveConnectionCta.tsx +15 -4
  46. package/corpus/templates/slides/app/components/editor/NewDeckReferenceStep.tsx +116 -55
  47. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +1 -0
  48. package/corpus/templates/slides/app/components/onboarding/FirstDeckOnboardingFlow.tsx +143 -18
  49. package/corpus/templates/slides/app/i18n/en-US.ts +6 -0
  50. package/corpus/templates/slides/app/lib/generation-state.ts +7 -1
  51. package/corpus/templates/slides/app/pages/DeckEditor.tsx +32 -14
  52. package/corpus/templates/slides/app/pages/Index.tsx +110 -128
  53. package/corpus/templates/slides/changelog/2026-08-10-imported-reference-decks-now-show-clear-success-and-stay-sel.md +6 -0
  54. package/corpus/templates/slides/changelog/2026-08-10-pasted-google-slides-links-import-after-reconnecting-google-.md +6 -0
  55. package/corpus/templates/slides/server/handlers/google-docs-auth.ts +4 -0
  56. package/corpus/templates/slides/server/lib/google-docs-oauth.ts +13 -0
  57. package/corpus/templates/slides/server/plugins/agent-chat.ts +1 -1
  58. package/dist/agent/engine/registry.d.ts +8 -2
  59. package/dist/agent/engine/registry.js +63 -29
  60. package/dist/agent/production-agent.js +7 -0
  61. package/dist/agent/run-manager.d.ts +5 -4
  62. package/dist/agent/run-manager.js +6 -5
  63. package/dist/cli/claude-code-participant.d.ts +2 -1
  64. package/dist/cli/claude-code-participant.js +19 -0
  65. package/dist/cli/code-agent-executor.js +223 -0
  66. package/dist/cli/create-workspace.js +3 -3
  67. package/dist/cli/create.d.ts +3 -2
  68. package/dist/cli/create.js +20 -24
  69. package/dist/client/AgentPanel.js +8 -4
  70. package/dist/client/AssistantChat.js +34 -1
  71. package/dist/client/agent-chat-adapter.d.ts +1 -0
  72. package/dist/client/agent-chat-adapter.js +10 -2
  73. package/dist/client/blocks/library/diagram.js +1 -1
  74. package/dist/client/blocks/library/sanitize-html.js +66 -2
  75. package/dist/client/blocks/library/wireframe-kit.js +69 -0
  76. package/dist/client/chat/markdown-renderer.d.ts +1 -0
  77. package/dist/client/chat/markdown-renderer.js +4 -0
  78. package/dist/client/chat/message-components.d.ts +1 -0
  79. package/dist/client/chat/message-components.js +9 -1
  80. package/dist/client/chat/tool-call-display.d.ts +8 -0
  81. package/dist/client/chat/tool-call-display.js +30 -21
  82. package/dist/client/chat-first/app-pane.js +1 -1
  83. package/dist/client/chat-first/apps-rail.d.ts +1 -1
  84. package/dist/client/chat-first/apps-rail.js +12 -12
  85. package/dist/client/chat-first/chat-history.d.ts +1 -1
  86. package/dist/client/chat-first/chat-history.js +2 -0
  87. package/dist/client/chat-first/copy.js +1 -0
  88. package/dist/client/chat-first/primary-nav.js +1 -1
  89. package/dist/client/chat-first/types.d.ts +1 -0
  90. package/dist/client/resources/McpConnectionSuggestion.js +2 -2
  91. package/dist/client/settings/SettingsTabsPage.d.ts +3 -1
  92. package/dist/client/settings/SettingsTabsPage.js +2 -2
  93. package/dist/client/sse-event-processor.d.ts +8 -0
  94. package/dist/client/sse-event-processor.js +13 -6
  95. package/dist/collab/struct-routes.d.ts +1 -1
  96. package/dist/deploy/build.d.ts +5 -7
  97. package/dist/deploy/build.js +19 -12
  98. package/dist/localization/default-messages.js +1 -1
  99. package/dist/observability/routes.d.ts +3 -3
  100. package/dist/provider-api/actions/provider-api.d.ts +2 -2
  101. package/dist/scripts/call-agent.js +3 -3
  102. package/dist/scripts/describe-workspace-apps.js +1 -1
  103. package/dist/secrets/routes.d.ts +6 -6
  104. package/dist/server/agent-capabilities.js +0 -0
  105. package/dist/server/agent-chat/context-tools.js +1 -1
  106. package/dist/server/agent-chat/prompt-resources.js +1 -1
  107. package/dist/server/agent-chat-plugin.js +1 -1
  108. package/dist/server/auth.js +190 -42
  109. package/dist/server/better-auth-migrations.js +53 -0
  110. package/dist/server/http-response-telemetry.js +7 -1
  111. package/dist/server/onboarding-html.js +119 -33
  112. package/dist/server/transcribe-voice.d.ts +1 -1
  113. package/dist/shared/password-policy.d.ts +2 -1
  114. package/dist/shared/password-policy.js +2 -1
  115. package/dist/styles/agent-conversation.css +20 -3
  116. package/dist/styles/agent-native.css +14 -2
  117. package/dist/styles/blocks.css +132 -0
  118. package/dist/templates/default/app/i18n/ar-SA.ts +1 -1
  119. package/dist/templates/default/app/i18n/de-DE.ts +1 -1
  120. package/dist/templates/default/app/i18n/en-US.ts +1 -1
  121. package/dist/templates/default/app/i18n/es-ES.ts +1 -1
  122. package/dist/templates/default/app/i18n/fr-FR.ts +1 -1
  123. package/dist/templates/default/app/i18n/hi-IN.ts +1 -1
  124. package/dist/templates/default/app/i18n/ja-JP.ts +1 -1
  125. package/dist/templates/default/app/i18n/ko-KR.ts +1 -1
  126. package/dist/templates/default/app/i18n/pt-BR.ts +1 -1
  127. package/dist/templates/default/app/i18n/zh-CN.ts +1 -1
  128. package/dist/templates/default/app/i18n/zh-TW.ts +1 -1
  129. package/dist/templates/default/pnpm-workspace.yaml +1 -0
  130. package/dist/templates/workspace-root/pnpm-workspace.yaml +2 -0
  131. package/docs/content/actions.mdx +4 -1
  132. package/docs/content/agent-surfaces.mdx +8 -6
  133. package/docs/content/automations.mdx +1 -1
  134. package/docs/content/cloneable-saas.mdx +6 -6
  135. package/docs/content/database.mdx +6 -1
  136. package/docs/content/deployment.mdx +10 -8
  137. package/docs/content/docs-components.mdx +22 -14
  138. package/docs/content/drop-in-agent.mdx +1 -1
  139. package/docs/content/environment-variables.mdx +4 -3
  140. package/docs/content/getting-started-actions.mdx +5 -4
  141. package/docs/content/getting-started-pages.mdx +7 -6
  142. package/docs/content/getting-started.mdx +4 -3
  143. package/docs/content/notifications.mdx +6 -6
  144. package/docs/content/progress.mdx +5 -5
  145. package/docs/content/routing.mdx +3 -1
  146. package/docs/content/server-database.mdx +13 -4
  147. package/docs/content/server-overview.mdx +9 -9
  148. package/docs/content/server-plugins.mdx +10 -4
  149. package/docs/content/server-routes.mdx +7 -2
  150. package/docs/content/tracking.mdx +4 -4
  151. package/docs/content/what-is-agent-native.mdx +4 -4
  152. package/package.json +2 -2
  153. package/src/templates/default/app/i18n/ar-SA.ts +1 -1
  154. package/src/templates/default/app/i18n/de-DE.ts +1 -1
  155. package/src/templates/default/app/i18n/en-US.ts +1 -1
  156. package/src/templates/default/app/i18n/es-ES.ts +1 -1
  157. package/src/templates/default/app/i18n/fr-FR.ts +1 -1
  158. package/src/templates/default/app/i18n/hi-IN.ts +1 -1
  159. package/src/templates/default/app/i18n/ja-JP.ts +1 -1
  160. package/src/templates/default/app/i18n/ko-KR.ts +1 -1
  161. package/src/templates/default/app/i18n/pt-BR.ts +1 -1
  162. package/src/templates/default/app/i18n/zh-CN.ts +1 -1
  163. package/src/templates/default/app/i18n/zh-TW.ts +1 -1
  164. package/src/templates/default/pnpm-workspace.yaml +1 -0
  165. package/src/templates/workspace-root/pnpm-workspace.yaml +2 -0
@@ -232,7 +232,7 @@ const messages = {
232
232
  newTerminal: "محطة جديدة",
233
233
  panelOptions: "خيارات لوحة الوكيل",
234
234
  collapseSidebar: "طي الشريط الجانبي",
235
- widenChat: "توسيع الدردشة إلى 75٪",
235
+ widenChat: "توسيع الدردشة",
236
236
  returnChatToLayout: "إعادة الدردشة إلى تخطيط الصفحة",
237
237
  hideChats: "إخفاء الدردشات",
238
238
  allChats: "جميع الدردشات",
@@ -234,7 +234,7 @@ const messages = {
234
234
  newTerminal: "Neues Terminal",
235
235
  panelOptions: "Optionen im Agentenpanel",
236
236
  collapseSidebar: "Seitenleiste einklappen",
237
- widenChat: "Chat auf 75 % verbreitern",
237
+ widenChat: "Chat verbreitern",
238
238
  returnChatToLayout: "Chat zurück ins Layout",
239
239
  hideChats: "Chats ausblenden",
240
240
  allChats: "Alle Chats",
@@ -229,7 +229,7 @@ const messages = {
229
229
  newTerminal: "New terminal",
230
230
  panelOptions: "Agent panel options",
231
231
  collapseSidebar: "Collapse sidebar",
232
- widenChat: "Widen chat to 75%",
232
+ widenChat: "Widen chat",
233
233
  returnChatToLayout: "Return chat to layout",
234
234
  hideChats: "Hide chats",
235
235
  allChats: "All chats",
@@ -235,7 +235,7 @@ const messages = {
235
235
  newTerminal: "Nueva terminal",
236
236
  panelOptions: "Opciones del panel de agentes",
237
237
  collapseSidebar: "Contraer barra lateral",
238
- widenChat: "Ampliar el chat al 75 %",
238
+ widenChat: "Ampliar el chat",
239
239
  returnChatToLayout: "Devolver el chat al diseño",
240
240
  hideChats: "Ocultar chats",
241
241
  allChats: "Todos los chats",
@@ -236,7 +236,7 @@ const messages = {
236
236
  newTerminal: "Nouvelle borne",
237
237
  panelOptions: "Options du panneau d'agent",
238
238
  collapseSidebar: "Réduire la barre latérale",
239
- widenChat: "Élargir le chat à 75 %",
239
+ widenChat: "Élargir le chat",
240
240
  returnChatToLayout: "Remettre le chat dans la mise en page",
241
241
  hideChats: "Masquer les discussions",
242
242
  allChats: "Toutes les discussions",
@@ -221,7 +221,7 @@ const messages = {
221
221
  newTerminal: "नया टर्मिनल",
222
222
  panelOptions: "एजेंट पैनल विकल्प",
223
223
  collapseSidebar: "साइडबार समेटें",
224
- widenChat: "चैट को 75% चौड़ा करें",
224
+ widenChat: "चैट को चौड़ा करें",
225
225
  returnChatToLayout: "चैट को लेआउट में वापस लाएँ",
226
226
  hideChats: "चैट छुपाएं",
227
227
  allChats: "सभी चैट",
@@ -230,7 +230,7 @@ const messages = {
230
230
  newTerminal: "新しいターミナル",
231
231
  panelOptions: "エージェントパネルのオプション",
232
232
  collapseSidebar: "サイドバーを折りたたむ",
233
- widenChat: "チャットを75%に広げる",
233
+ widenChat: "チャットを広げる",
234
234
  returnChatToLayout: "チャットをレイアウトに戻す",
235
235
  hideChats: "チャットを非表示にする",
236
236
  allChats: "すべてのチャット",
@@ -225,7 +225,7 @@ const messages = {
225
225
  newTerminal: "새로운 터미널",
226
226
  panelOptions: "상담원 패널 옵션",
227
227
  collapseSidebar: "사이드바 접기",
228
- widenChat: "채팅을 75% 너비로 넓히기",
228
+ widenChat: "채팅 넓히기",
229
229
  returnChatToLayout: "채팅을 레이아웃으로 되돌리기",
230
230
  hideChats: "채팅 숨기기",
231
231
  allChats: "모든 채팅",
@@ -234,7 +234,7 @@ const messages = {
234
234
  newTerminal: "Novo terminal",
235
235
  panelOptions: "Opções do painel do agente",
236
236
  collapseSidebar: "Recolher barra lateral",
237
- widenChat: "Ampliar o chat para 75%",
237
+ widenChat: "Ampliar o chat",
238
238
  returnChatToLayout: "Retornar o chat ao layout",
239
239
  hideChats: "Ocultar bate-papos",
240
240
  allChats: "Todos os bate-papos",
@@ -219,7 +219,7 @@ const messages = {
219
219
  newTerminal: "新航站楼",
220
220
  panelOptions: "代理面板选项",
221
221
  collapseSidebar: "收起侧边栏",
222
- widenChat: "将聊天窗口加宽到 75%",
222
+ widenChat: "加宽聊天窗口",
223
223
  returnChatToLayout: "将聊天窗口恢复到布局中",
224
224
  hideChats: "隐藏聊天记录",
225
225
  allChats: "所有聊天记录",
@@ -217,7 +217,7 @@ const messages = {
217
217
  newTerminal: "新航站樓",
218
218
  panelOptions: "代理面板選項",
219
219
  collapseSidebar: "收起側邊欄",
220
- widenChat: "將聊天視窗加寬至 75%",
220
+ widenChat: "將聊天視窗加寬",
221
221
  returnChatToLayout: "將聊天視窗放回版面配置",
222
222
  hideChats: "隱藏聊天紀錄",
223
223
  allChats: "所有聊天紀錄",
@@ -6,3 +6,4 @@ overrides:
6
6
  allowBuilds:
7
7
  better-sqlite3: true
8
8
  esbuild: true
9
+ tesseract.js: true
@@ -24,6 +24,7 @@ onlyBuiltDependencies:
24
24
  - esbuild
25
25
  - lightningcss
26
26
  - node-pty
27
+ - tesseract.js
27
28
 
28
29
  allowBuilds:
29
30
  "@swc/core": true
@@ -33,3 +34,4 @@ allowBuilds:
33
34
  esbuild: true
34
35
  lightningcss: true
35
36
  node-pty: true
37
+ tesseract.js: true
@@ -391,12 +391,15 @@ export default defineAction({
391
391
  description: "Create a lead in the CRM.",
392
392
  schema: z.object({ name: z.string(), company: z.string() }),
393
393
  run: async ({ name, company }, ctx) => {
394
+ if (!ctx?.userEmail) {
395
+ throw new Error("An authenticated user is required.");
396
+ }
394
397
  const db = getDb();
395
398
  await db.insert(schema.leads).values({
396
399
  id: crypto.randomUUID(),
397
400
  name,
398
401
  company,
399
- ownerEmail: ctx?.userEmail ?? "system",
402
+ ownerEmail: ctx.userEmail,
400
403
  });
401
404
  return { ok: true };
402
405
  },
@@ -10,7 +10,7 @@ A **surface** is the way users (or other systems) interact with your app: a chat
10
10
 
11
11
  ## How surfaces relate to each other
12
12
 
13
- The four main product shapes sit on a spectrum from most interactive to fully headless. What makes them composable is that the foundation stays the same throughout: the same actions, the same SQL database, and the same agent loop power every shape. Adding a new surface doesn't mean rewriting what's underneath — you're just adding a new way to reach the same operations.
13
+ The four main product shapes sit on a spectrum from most interactive to fully headless. What makes them composable is that they share the same actions and SQL-backed app state. Use the framework agent loop when a surface needs an agent. Adding a new surface doesn't mean rewriting what's underneath — you're adding a new way to reach the same operations.
14
14
 
15
15
  <Diagram id="doc-block-hvdxgh" title="The surface spectrum" summary={"One action surface, four product shapes, each adding UI without changing the operation underneath."}>
16
16
 
@@ -37,7 +37,9 @@ The four main product shapes sit on a spectrum from most interactive to fully he
37
37
  </div>
38
38
  </div>
39
39
  <div class="diagram-base" data-rough>
40
- <span class="diagram-muted">same actions · same SQL · same agent loop</span>
40
+ <span class="diagram-muted"
41
+ >same actions · SQL-backed state · agent loop where used</span
42
+ >
41
43
  </div>
42
44
  ```
43
45
 
@@ -192,7 +194,7 @@ Full apps add product UI around the same action and agent contract:
192
194
 
193
195
  ### SQL state
194
196
 
195
- App data, navigation, settings, and chat history are all durable. The agent reads and writes the same rows the UI does.
197
+ App data, navigation, settings, and chat history are durable in SQL. The agent reads and writes the same rows the UI does.
196
198
 
197
199
  ### Context awareness
198
200
 
@@ -200,7 +202,7 @@ The agent knows the current route, selection, and focused object, so "edit this"
200
202
 
201
203
  ### Live sync
202
204
 
203
- Agent changes update the UI in real time, and UI changes update the agent's context. No polling, no refresh.
205
+ Agent changes update the UI through live sync, and UI changes update the agent's context. The framework uses SSE with polling fallback, so users do not need to refresh manually.
204
206
 
205
207
  ### Deep links
206
208
 
@@ -224,9 +226,9 @@ want a complete product shape.
224
226
 
225
227
  Every Agent-Native app eventually needs a place where users can configure their agent: set standing instructions, review what it's done, connect MCP servers, manage automations, and control access. Building that UI from scratch is a lot of work. Agent-Native ships a pre-built full-page component, `AgentTabsPage`, that covers all of it across twelve tabs.
226
228
 
227
- Mount it at `/agent` in your app. Current templates pair that route with an app-navigation entry and pass `agentPageHref="/agent"` to `AgentSidebar`, so the sidebar's Resources and Settings modes can link to the full page without duplicating those flows.
229
+ Mount it at `/settings/agent` in your app. Current templates use this as the canonical route and pass `agentPageHref="/settings/agent"` to `AgentSidebar`. `/agent` is kept as a legacy redirect.
228
230
 
229
- ```tsx filename="app/routes/agent.tsx"
231
+ ```tsx filename="app/routes/settings.agent.tsx"
230
232
  import { AgentTabsPage } from "@agent-native/core/client/agent-chat";
231
233
  export default function AgentRoute() {
232
234
  return <AgentTabsPage />;
@@ -214,7 +214,7 @@ emit(
214
214
  customerEmail: "jane@example.com",
215
215
  total: 49.99,
216
216
  },
217
- { owner: "steve@builder.io" },
217
+ { owner: "user@example.com" },
218
218
  );
219
219
  ```
220
220
 
@@ -298,12 +298,12 @@ If you're scaffolding now, the CLI command is:
298
298
  npx @agent-native/core@latest create my-platform
299
299
  ```
300
300
 
301
- The CLI first asks **How do you want to start?** — pick **Full template(s)**
302
- to reach the multi-select picker (Chat and Headless each scaffold a single
303
- standalone app directly instead, skipping the picker). Pick one app
304
- (standalone) or several (workspace — apps share auth, brand, agent config, and
305
- database). Each picked app is scaffolded into `apps/<name>/` with every file
306
- you need. For a no-browser automation instead of an app UI, use
301
+ The CLI first asks **How do you want to start?** — pick **Chat** for a minimal
302
+ workspace with Chat and Dispatch, or pick **First-party template(s)** to reach the
303
+ multi-select picker. Community and Headless are the standalone on-ramps.
304
+ Workspace apps share auth, brand, agent config, and database; each app is
305
+ scaffolded into `apps/<name>/` with every file you need. For a no-browser
306
+ automation instead of an app UI, use
307
307
  `npx @agent-native/core@latest create my-agent --headless`.
308
308
 
309
309
  Fill in `.env` (mostly `ANTHROPIC_API_KEY` and `DATABASE_URL`), `pnpm install`, `pnpm dev`, and it works. No "TODO: implement login," no placeholder routes.
@@ -267,7 +267,12 @@ All database schema updates must be **strictly additive**.
267
267
 
268
268
  ### Safe Migration Path
269
269
 
270
- Instead of pushing directly, schema changes should be applied via SQL migrations executed at application startup. Implement additive migrations within a server plugin (e.g., `server/plugins/db.ts`) by invoking the framework's `runMigrations()` helper:
270
+ Instead of pushing directly, schema changes should be applied via additive SQL
271
+ migrations. For local development, implement them in a server plugin (e.g.
272
+ `server/plugins/db.ts`) by invoking the framework's `runMigrations()` helper.
273
+ For production or serverless deployments, run migrations in a release or deploy
274
+ step instead of on the first request. The Chat template provides
275
+ `pnpm migrate:production` for this.
271
276
 
272
277
  <AnnotatedCode
273
278
  id="doc-block-zaaj7e"
@@ -435,19 +435,20 @@ The workspace build writes static assets under `dist/_workspace_static/` and rou
435
435
 
436
436
  ### Keep-warm and scale-to-zero databases {#netlify-keep-warm}
437
437
 
438
- The Netlify build emits a scheduled function that requests `/_agent-native/health` **every minute**. That keeps the server function and its database warm so the next visitor after an idle period doesn't pay a cold start (1–5s on Neon). On provisioned compute this is the right default.
438
+ When enabled, the Netlify build emits a scheduled function that requests `/_agent-native/health` **every minute**. That keeps the server function and its database warm so the next visitor after an idle period doesn't pay a cold start (1–5s on Neon).
439
439
 
440
- **On a metered scale-to-zero database it is the wrong default.** A once-a-minute wake means autosuspend never fires, so the database bills and quota-limits as though it were awake continuously with nobody using the app. On a free-tier Neon this exhausts the compute quota, and the database then rejects **all** reads mid-session — the symptom is a dead app, not a slow one.
440
+ Keep-warm is **disabled by default** because a once-a-minute wake prevents autosuspend on metered scale-to-zero databases. On a free-tier Neon this can exhaust the compute quota, and the database then rejects **all** reads mid-session — the symptom is a dead app, not a slow one. Set `AGENT_NATIVE_ENABLE_KEEP_WARM=1` when the lower next-visitor latency is worth the database awake-time.
441
441
 
442
- Three knobs, all opt-in, defaults unchanged:
442
+ The keep-warm schedule and background-function warm only apply after the main keep-warm flag is enabled:
443
443
 
444
444
  | Variable | Effect |
445
445
  | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
446
- | `AGENT_NATIVE_DISABLE_KEEP_WARM` | Skips the scheduled function entirely. The database is free to autosuspend; the next visitor after an idle period pays its cold start. |
447
- | `AGENT_NATIVE_KEEP_WARM_SCHEDULE` | Overrides the cadence with a 5-field cron expression, e.g. `*/5 * * * *`. An unparseable value **fails the build** rather than silently reverting to once a minute. |
446
+ | `AGENT_NATIVE_ENABLE_KEEP_WARM` | Opts into the scheduled server/database warm. Unset by default. |
447
+ | `AGENT_NATIVE_DISABLE_KEEP_WARM` | Compatibility kill switch that wins over the opt-in flag when set. |
448
+ | `AGENT_NATIVE_KEEP_WARM_SCHEDULE` | Overrides the cadence with a 5-field cron expression, e.g. `*/5 * * * *`. The default cadence when enabled is `* * * * *`; an unparseable value **fails the build**. |
448
449
  | `AGENT_NATIVE_DISABLE_KEEP_WARM_BACKGROUND` | Drops only the background-function warm, keeping the server warm. Warming `server` is one request; warming `-background` starts a fresh container that re-probes the schema. |
449
450
 
450
- If you are on a free or otherwise quota-limited database tier, set `AGENT_NATIVE_DISABLE_KEEP_WARM=1` or pick a slower cadence.
451
+ If you are on a free or otherwise quota-limited database tier, leave `AGENT_NATIVE_ENABLE_KEEP_WARM` unset. If you opt in, use a slower cadence or set `AGENT_NATIVE_DISABLE_KEEP_WARM_BACKGROUND=1` to drop the more expensive background warm.
451
452
 
452
453
  ### On-demand schema DDL {#skip-ensure-tables}
453
454
 
@@ -575,8 +576,9 @@ hosting behavior.
575
576
  | `APP_URL` | Optional canonical public origin. Checked ahead of `BETTER_AUTH_URL` when resolving the A2A JWT audience, the OAuth public origin, self-dispatch webhook targets, and generated resource links. Set it explicitly on preview/staging deploys where the request host is unreliable. |
576
577
  | `AGENT_PROD_CODE_EXECUTION` | Optional production code-execution mode: `off` (default), `sandboxed`, or `trusted`. See [Production Code Execution](#production-code-execution). |
577
578
  | `AGENT_NATIVE_SSR_CACHE` | Deployment-wide SSR shell cache policy: unset/`on` keeps the default hard-cache, `off` sends `no-store`, or a duration such as `30s` / `5m` sets a shorter freshness. See [SSR Caching](#ssr-caching). |
578
- | `AGENT_NATIVE_DISABLE_KEEP_WARM` | Skip the Netlify keep-warm scheduled function so a scale-to-zero database can autosuspend. See [Keep-warm](#netlify-keep-warm). |
579
- | `AGENT_NATIVE_KEEP_WARM_SCHEDULE` | Override the keep-warm cadence with a 5-field cron expression (default `* * * * *`). An unparseable value fails the build. See [Keep-warm](#netlify-keep-warm). |
579
+ | `AGENT_NATIVE_ENABLE_KEEP_WARM` | Opt into the Netlify keep-warm scheduled function. Unset by default; see [Keep-warm](#netlify-keep-warm). |
580
+ | `AGENT_NATIVE_DISABLE_KEEP_WARM` | Compatibility kill switch for the Netlify keep-warm scheduled function. See [Keep-warm](#netlify-keep-warm). |
581
+ | `AGENT_NATIVE_KEEP_WARM_SCHEDULE` | Override the keep-warm cadence with a 5-field cron expression (default `* * * * *` when enabled). An unparseable value fails the build. See [Keep-warm](#netlify-keep-warm). |
580
582
  | `AGENT_NATIVE_DISABLE_KEEP_WARM_BACKGROUND` | Drop only the background-function warm and keep the server warm. See [Keep-warm](#netlify-keep-warm). |
581
583
  | `AGENT_NATIVE_DISABLE_INPROCESS_SWEEPS` | Turn off the in-process backstop sweep timers (automation redispatch, agent-teams reconciliation, sandbox-execution recovery). On serverless these run per warm container, so their query rate scales with instance count. Set it **only** where a durable scheduler already drives the same recovery, or queued work will not be retried. |
582
584
  | `AGENT_NATIVE_SKIP_ENSURE_TABLES` | Skip on-demand schema DDL entirely. Removes the schema-probe round trips every cold start pays before doing any work. Requires that your schema is already migrated — see [On-demand schema DDL](#skip-ensure-tables). |
@@ -105,7 +105,7 @@ pnpm install
105
105
  pnpm dev
106
106
  ```
107
107
 
108
- Open `http://localhost:3000`. The app is ready when **VITE ready** appears in the terminal.
108
+ Open the local URL shown by the dev server. The app is ready when **VITE ready** appears in the terminal.
109
109
 
110
110
  ### Sign in
111
111
 
@@ -130,7 +130,7 @@ pnpm install
130
130
  pnpm dev
131
131
  ```
132
132
 
133
- Open `http://localhost:3000`. The app is ready when **VITE ready** appears in the terminal.
133
+ Open the local URL shown by the dev server. The app is ready when **VITE ready** appears in the terminal.
134
134
 
135
135
  ### Sign in
136
136
 
@@ -215,13 +215,13 @@ Use `Notice` when a `Callout` would be too easy to skim past — something the r
215
215
 
216
216
  <Banner
217
217
  tone="warning"
218
- body="This page describes the v9 API. See [Migrating to v10](/docs/migrating-v10) for what changed."
218
+ body="This page describes a beta API. Check the release notes before using it."
219
219
  />
220
220
 
221
221
  ```mdx
222
222
  <Banner
223
223
  tone="warning"
224
- body="This page describes the v9 API. See [Migrating to v10](/docs/migrating-v10) for what changed."
224
+ body="This page describes a beta API. Check the release notes before using it."
225
225
  />
226
226
  ```
227
227
 
@@ -377,13 +377,17 @@ Use a fenced code block with the `mermaid` language tag. Mermaid supports flowch
377
377
  note: "New action — callable from agent, UI, and CLI",
378
378
  },
379
379
  { path: "actions/list-text-analyses.ts", change: "added" },
380
- { path: "app/routes/analyses.tsx", change: "modified" },
380
+ { path: "app/routes/analyses.tsx", change: "added" },
381
381
  {
382
- path: "app/config/nav.ts",
383
- change: "modified",
384
- note: "Add the new route to the sidebar nav",
382
+ path: "server/db/schema.ts",
383
+ change: "added",
384
+ note: "Define the app-owned table",
385
+ },
386
+ {
387
+ path: "server/plugins/db.ts",
388
+ change: "added",
389
+ note: "Run additive migrations",
385
390
  },
386
- { path: "db/migrations/001_analyses.sql" },
387
391
  ]}
388
392
  />
389
393
 
@@ -397,13 +401,17 @@ Use a fenced code block with the `mermaid` language tag. Mermaid supports flowch
397
401
  note: "New action — callable from agent, UI, and CLI",
398
402
  },
399
403
  { path: "actions/list-text-analyses.ts", change: "added" },
400
- { path: "app/routes/analyses.tsx", change: "modified" },
404
+ { path: "app/routes/analyses.tsx", change: "added" },
401
405
  {
402
- path: "app/config/nav.ts",
403
- change: "modified",
404
- note: "Add the new route to the sidebar nav",
406
+ path: "server/db/schema.ts",
407
+ change: "added",
408
+ note: "Define the app-owned table",
409
+ },
410
+ {
411
+ path: "server/plugins/db.ts",
412
+ change: "added",
413
+ note: "Run additive migrations",
405
414
  },
406
- { path: "db/migrations/001_analyses.sql" },
407
415
  ]}
408
416
  />
409
417
  ```
@@ -170,7 +170,7 @@ export default function AgentRoute() {
170
170
  }
171
171
  ```
172
172
 
173
- `<AgentPanel>` gives you the raw tabs (Chat / CLI / Resources) without the sidebar wrapper, the collapse button, or any state persistence. Put it wherever you want; you handle the layout.
173
+ `<AgentPanel>` gives you the raw tabs (Chat / CLI / Resources) without the sidebar wrapper or the collapse button. Put it wherever you want; you control the surrounding layout.
174
174
 
175
175
  ### Selected props
176
176
 
@@ -50,9 +50,10 @@ deployment-specific values in the environment or scoped secret store.
50
50
  | `ACCESS_TOKEN` / `ACCESS_TOKENS` | Static bearer fallback for MCP and Connect clients. | One token or a delimited token list; these are not browser auth. |
51
51
  | `AGENT_PROD_CODE_EXECUTION` | Production code-execution policy. | `off`, `sandboxed`, or `trusted`. See [Production Code Execution](/docs/deployment#production-code-execution). |
52
52
  | `AGENT_NATIVE_SSR_CACHE` | Deployment-wide public SSR shell cache policy. | Unset/`on`, `off`, or a duration such as `30s` or `5m`. See [SSR Caching](/docs/deployment#ssr-caching). |
53
- | `AGENT_NATIVE_DISABLE_KEEP_WARM` | Lets a scale-to-zero database autosuspend instead of being woken every minute. | `1`; see [Keep-warm](/docs/deployment#netlify-keep-warm). |
54
- | `AGENT_NATIVE_KEEP_WARM_SCHEDULE` | Keep-warm cadence override. | A 5-field cron expression such as `*/5 * * * *`; an unparseable value fails the build. |
55
- | `AGENT_NATIVE_DISABLE_KEEP_WARM_BACKGROUND` | Drops only the background-function warm and keeps the server warm. | `1`; see [Keep-warm](/docs/deployment#netlify-keep-warm). |
53
+ | `AGENT_NATIVE_ENABLE_KEEP_WARM` | Opts into the Netlify keep-warm scheduled function; unset by default. | `1`; see [Keep-warm](/docs/deployment#netlify-keep-warm). |
54
+ | `AGENT_NATIVE_DISABLE_KEEP_WARM` | Compatibility kill switch for the Netlify keep-warm scheduled function. | `1`; see [Keep-warm](/docs/deployment#netlify-keep-warm). |
55
+ | `AGENT_NATIVE_KEEP_WARM_SCHEDULE` | Keep-warm cadence override when enabled. | A 5-field cron expression such as `*/5 * * * *`; an unparseable value fails the build. |
56
+ | `AGENT_NATIVE_DISABLE_KEEP_WARM_BACKGROUND` | Drops only the background-function warm and keeps the server warm when keep-warm is enabled. | `1`; see [Keep-warm](/docs/deployment#netlify-keep-warm). |
56
57
  | `AGENT_NATIVE_DISABLE_INPROCESS_SWEEPS` | Turns off the in-process backstop sweep timers where a durable scheduler drives the same work. | `1`; queued work is not retried without another driver. |
57
58
  | `AGENT_NATIVE_SKIP_ENSURE_TABLES` | Skips on-demand schema DDL for an already-migrated database. | `1`; see [On-demand schema DDL](/docs/deployment#skip-ensure-tables). You own migrations when this is set. |
58
59
  | `COOKIE_DOMAIN` | Shares auth cookies across same-database subdomains when explicitly configured. | A cookie domain. |
@@ -72,7 +72,7 @@ export default defineAction({
72
72
  });
73
73
  ```
74
74
 
75
- Run it from the terminal:
75
+ Run this from the app directory:
76
76
 
77
77
  ```bash
78
78
  pnpm action analyze-text --text "Hello world. How are you today?"
@@ -82,9 +82,10 @@ Or ask the agent in chat:
82
82
 
83
83
  > Run the analyze-text action on "Hello world. How are you today?"
84
84
 
85
- The built-in `data-chart` renderer turns the structured result into a chart in
86
- the transcript. There is no renderer file or `app/root.tsx` import to add. For
87
- custom native components, see [Native Chat UI](/docs/native-chat-ui).
85
+ When the agent runs this action in chat, the built-in `data-chart` renderer
86
+ turns the structured result into a chart in the transcript. There is no renderer
87
+ file or `app/root.tsx` import to add. For custom native components, see
88
+ [Native Chat UI](/docs/native-chat-ui).
88
89
 
89
90
  ## Continue
90
91
 
@@ -6,14 +6,15 @@ description: "Build a React route that calls your action and displays its result
6
6
  # Add a Page
7
7
 
8
8
  This is part three of the Getting Started series. In [Add an Action](/docs/getting-started-actions)
9
- you created `analyze-text`. Here you'll call that same action from a route. No
10
- database is needed yet: Chat already includes the SQL runtime for when you need
11
- to persist domain data.
9
+ you created `analyze-text`. Here you'll call that same action from a route. This
10
+ example does not need a new database table. Chat already stores chat history in
11
+ SQL; add your own tables when you need to persist domain data.
12
12
 
13
13
  ## Create the route {#add-a-page}
14
14
 
15
- Route files in `app/routes/` are picked up automatically. Create
16
- `app/routes/text-analyses.tsx`; it will be available at
15
+ The dev server reads route files when it starts. Create
16
+ `app/routes/text-analyses.tsx`, then restart `pnpm dev` if it is already
17
+ running. The route will be available at
17
18
  `http://localhost:8080/text-analyses`.
18
19
 
19
20
  ```tsx filename="app/routes/text-analyses.tsx"
@@ -58,7 +59,7 @@ export default function TextAnalysesRoute() {
58
59
  ```
59
60
 
60
61
  `useActionQuery` calls the same read-only action the agent uses. The page does
61
- not need a custom API route, a second data layer, or SQL yet.
62
+ not need a custom API route, a second data layer, or a new SQL table.
62
63
 
63
64
  Open `http://localhost:8080/text-analyses`, or ask the agent:
64
65
 
@@ -6,9 +6,9 @@ description: "Create a Chat app and configure an agent, then extend it with an a
6
6
  # Getting Started
7
7
 
8
8
  Agent-Native apps give the agent and the UI the same [actions](/docs/actions),
9
- SQL data, and application state. This is the hands-on path: start with chat,
10
- then add an action and a page. SQL is already configured in Chat and becomes an
11
- optional next step when results need to persist.
9
+ SQL data, and application state. This path starts with Chat, which already
10
+ creates the framework tables it needs and stores chat history in local SQLite by
11
+ default. Add your own tables only when your app needs to persist domain data.
12
12
 
13
13
  <Steps>
14
14
 
@@ -65,4 +65,5 @@ Once the agent responds, continue with [Add an Action](/docs/getting-started-act
65
65
 
66
66
  - [What Is Agent-Native?](/docs/what-is-agent-native): the architecture behind this path.
67
67
  - [Chat Template](/docs/template-chat): what the starter app includes.
68
+ - [Database](/docs/database): add app-owned tables when your app needs domain data.
68
69
  - [FAQ](/docs/faq): answers about models, hosting, and templates.
@@ -14,7 +14,7 @@ import { notify } from "@agent-native/core/notifications";
14
14
 
15
15
  await notify(
16
16
  { severity: "info", title: "Booking confirmed", body: "Jane at 3pm" },
17
- { owner: "steve@builder.io" },
17
+ { owner: "user@example.com" },
18
18
  );
19
19
  ```
20
20
 
@@ -238,14 +238,14 @@ import {
238
238
  deleteNotification,
239
239
  } from "@agent-native/core/notifications";
240
240
 
241
- const rows = await listNotifications("steve@builder.io", {
241
+ const rows = await listNotifications("user@example.com", {
242
242
  unreadOnly: true,
243
243
  limit: 50,
244
244
  });
245
- const unread = await countUnread("steve@builder.io");
246
- await markNotificationRead(rows[0].id, "steve@builder.io");
247
- await markAllNotificationsRead("steve@builder.io");
248
- await deleteNotification(rows[0].id, "steve@builder.io");
245
+ const unread = await countUnread("user@example.com");
246
+ await markNotificationRead(rows[0].id, "user@example.com");
247
+ await markAllNotificationsRead("user@example.com");
248
+ await deleteNotification(rows[0].id, "user@example.com");
249
249
  ```
250
250
 
251
251
  Each function is owner-scoped — no cross-user reads, no cross-user writes.
@@ -15,7 +15,7 @@ import {
15
15
  } from "@agent-native/core/progress";
16
16
 
17
17
  const run = await startRun({
18
- owner: "steve@builder.io",
18
+ owner: "user@example.com",
19
19
  title: "Triage 128 unread emails",
20
20
  step: "Fetching inbox",
21
21
  });
@@ -100,7 +100,7 @@ Create a run. Returns the full `AgentRun` with a generated id.
100
100
 
101
101
  ```ts
102
102
  const run = await startRun({
103
- owner: "steve@builder.io",
103
+ owner: "user@example.com",
104
104
  title: "Ingest 1M rows",
105
105
  step: "Opening CSV",
106
106
  metadata: { jobId: "abc123", artifactPath: "s3://..." },
@@ -140,9 +140,9 @@ Also emits `run.progress.updated` with the terminal status.
140
140
  ```ts
141
141
  import { listRuns, getRun, deleteRun } from "@agent-native/core/progress";
142
142
 
143
- const active = await listRuns("steve@builder.io", { activeOnly: true });
144
- const run = await getRun("run-id", "steve@builder.io");
145
- await deleteRun("run-id", "steve@builder.io");
143
+ const active = await listRuns("user@example.com", { activeOnly: true });
144
+ const run = await getRun("run-id", "user@example.com");
145
+ await deleteRun("run-id", "user@example.com");
146
146
  ```
147
147
 
148
148
  ## HTTP API {#http}
@@ -82,7 +82,9 @@ export default function SettingsPage() {
82
82
  }
83
83
  ```
84
84
 
85
- That's it — React Router picks it up automatically, no registration needed.
85
+ That's it — React Router picks it up automatically after the route table is
86
+ rebuilt. If `pnpm dev` is already running, restart it after adding the file. No
87
+ registration is needed.
86
88
 
87
89
  ## Dynamic params {#dynamic-params}
88
90
 
@@ -5,7 +5,7 @@ description: "Connect a portable SQL database to your agent-native app: schema h
5
5
 
6
6
  # Database
7
7
 
8
- Every agent-native app stores its state in SQL. The UI and the agent both read and write the same tables through the same actions, using the same [Drizzle ORM](https://orm.drizzle.team) client. When either side changes data, the other sees it through the polling layer.
8
+ Every agent-native app stores its state in SQL. The UI and the agent both read and write the same tables through the same actions, using the same [Drizzle ORM](https://orm.drizzle.team) client. Live sync uses SSE with polling fallback, so changes appear in the other surface without a manual refresh.
9
9
 
10
10
  <Diagram id="doc-block-9mtx2f" title="How data flows to the database" summary="The UI and the agent both reach the database through the same Actions layer. Both callers use the same getDb() client and the same SQL tables. There is no separate backend for each.">
11
11
 
@@ -110,7 +110,7 @@ An app that uses the database needs three files:
110
110
 
111
111
  - `server/db/schema.ts`: table definitions
112
112
  - `server/db/index.ts`: the typed DB client singleton
113
- - `server/plugins/db.ts`: migrations that run at startup
113
+ - `server/plugins/db.ts`: app-owned migrations for local startup
114
114
 
115
115
  ### 1. Define your schema {#schema}
116
116
 
@@ -208,7 +208,8 @@ Import `getDb` from this template-local path in actions and routes. Do not impor
208
208
 
209
209
  ### 3. Write migrations {#migrations}
210
210
 
211
- Schema changes are applied at startup via a Nitro plugin in `server/plugins/db.ts`. Use `runMigrations` from `@agent-native/core/db`:
211
+ For local development, schema changes can run through a Nitro plugin in
212
+ `server/plugins/db.ts`. Use `runMigrations` from `@agent-native/core/db`:
212
213
 
213
214
  <AnnotatedCode
214
215
  id="doc-block-7qwlpz"
@@ -242,7 +243,15 @@ Schema changes are applied at startup via a Nitro plugin in `server/plugins/db.t
242
243
  ]}
243
244
  />
244
245
 
245
- `runMigrations` runs each entry in order once, then records the version so it is skipped on future restarts. Entries are idempotent. The plugin is safe to call on every boot.
246
+ `runMigrations` runs each pending entry in order once, records it as applied, and
247
+ skips it on later runs. Give new entries a stable `name`; named migrations are
248
+ tracked independently of their version number.
249
+
250
+ <Callout tone="warning">
251
+ For production or serverless deployments, run migrations in a release or
252
+ deploy step instead of on the first request. The Chat template provides `pnpm
253
+ migrate:production` for this.
254
+ </Callout>
246
255
 
247
256
  <Callout tone="warning">
248
257
  Give every new migration a stable `name` (e.g. `{ version: 4, name: