@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.
- package/corpus/README.md +1 -1
- package/corpus/templates/analytics/changelog/2026-08-10-wide-tables-in-analytics-chat-now-scroll-horizontally-within.md +6 -0
- package/corpus/templates/calendar/app/components/calendar/DayView.tsx +13 -53
- package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +11 -70
- package/corpus/templates/calendar/app/lib/event-layout.ts +122 -0
- package/corpus/templates/calendar/app/routes/_app.availability.tsx +1 -1
- package/corpus/templates/calendar/changelog/2026-08-10-opening-availability-settings-from-the-agent-lands-on-the-av.md +6 -0
- package/corpus/templates/calendar/vitest.config.ts +6 -1
- package/corpus/templates/clips/actions/lib/audio-only-transcription.ts +3 -1
- package/corpus/templates/clips/app/components/player/video-player.tsx +44 -4
- package/corpus/templates/clips/changelog/2026-08-10-fixed-transcription-failures-for-recordings-without-captured.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-10-mobile-clips-can-now-enter-fullscreen-on-iphone-safari.md +6 -0
- package/corpus/templates/content/actions/_property-utils.ts +11 -1
- package/corpus/templates/content/actions/view-screen.ts +62 -12
- package/corpus/templates/content/server/plugins/agent-chat.ts +2 -0
- package/corpus/templates/design/.agents/skills/design-templates/SKILL.md +22 -0
- package/corpus/templates/design/AGENTS.md +3 -0
- package/corpus/templates/design/actions/create-design-from-template.ts +19 -0
- package/corpus/templates/design/actions/get-design-snapshot.ts +18 -0
- package/corpus/templates/design/actions/get-design-template.ts +178 -0
- package/corpus/templates/design/actions/list-designs.ts +3 -1
- package/corpus/templates/design/actions/view-screen.ts +31 -0
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +225 -214
- package/corpus/templates/design/app/components/design/multi-screen/types.ts +3 -0
- package/corpus/templates/design/app/i18n-data.ts +78 -0
- package/corpus/templates/design/app/lib/design-authors.ts +64 -0
- package/corpus/templates/design/app/pages/Index.tsx +114 -4
- package/corpus/templates/design/app/pages/design-editor/generation-prompt-directives.ts +1 -0
- package/corpus/templates/design/changelog/2026-08-07-alt-dragging-an-element-to-copy-it-now-keeps-the-copy-visibl.md +6 -0
- package/corpus/templates/design/changelog/2026-08-07-design-cards-now-show-who-created-each-design-with-a-filter-.md +6 -0
- package/corpus/templates/design/changelog/2026-08-07-drawing-a-shape-on-the-overview-canvas-now-keeps-the-shape-s.md +6 -0
- package/corpus/templates/design/changelog/2026-08-07-hold-option-alt-while-dragging-a-frame-on-the-overview-canva.md +6 -0
- package/corpus/templates/design/server/lib/design-template-data.ts +143 -0
- package/corpus/templates/design/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/forms/AGENTS.md +2 -2
- package/corpus/templates/forms/actions/create-form.ts +1 -1
- package/corpus/templates/forms/actions/update-form.ts +5 -5
- package/corpus/templates/forms/changelog/2026-08-10-forms-now-keep-agent-applied-field-changes-visible-after-an-.md +6 -0
- package/corpus/templates/forms/changelog/2026-08-10-published-form-links-always-use-the-working-public-form-url.md +6 -0
- package/corpus/templates/forms/server/plugins/agent-chat.ts +2 -2
- package/corpus/templates/slides/AGENTS.md +4 -3
- package/corpus/templates/slides/actions/import-google-slides-reference.ts +56 -10
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +12 -74
- package/corpus/templates/slides/app/components/editor/GeneratingSlidePreview.tsx +5 -1
- package/corpus/templates/slides/app/components/editor/GoogleDriveConnectionCta.tsx +15 -4
- package/corpus/templates/slides/app/components/editor/NewDeckReferenceStep.tsx +116 -55
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +1 -0
- package/corpus/templates/slides/app/components/onboarding/FirstDeckOnboardingFlow.tsx +143 -18
- package/corpus/templates/slides/app/i18n/en-US.ts +6 -0
- package/corpus/templates/slides/app/lib/generation-state.ts +7 -1
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +32 -14
- package/corpus/templates/slides/app/pages/Index.tsx +110 -128
- package/corpus/templates/slides/changelog/2026-08-10-imported-reference-decks-now-show-clear-success-and-stay-sel.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-10-pasted-google-slides-links-import-after-reconnecting-google-.md +6 -0
- package/corpus/templates/slides/server/handlers/google-docs-auth.ts +4 -0
- package/corpus/templates/slides/server/lib/google-docs-oauth.ts +13 -0
- package/corpus/templates/slides/server/plugins/agent-chat.ts +1 -1
- package/dist/agent/engine/registry.d.ts +8 -2
- package/dist/agent/engine/registry.js +63 -29
- package/dist/agent/production-agent.js +7 -0
- package/dist/agent/run-manager.d.ts +5 -4
- package/dist/agent/run-manager.js +6 -5
- package/dist/cli/claude-code-participant.d.ts +2 -1
- package/dist/cli/claude-code-participant.js +19 -0
- package/dist/cli/code-agent-executor.js +223 -0
- package/dist/cli/create-workspace.js +3 -3
- package/dist/cli/create.d.ts +3 -2
- package/dist/cli/create.js +20 -24
- package/dist/client/AgentPanel.js +8 -4
- package/dist/client/AssistantChat.js +34 -1
- package/dist/client/agent-chat-adapter.d.ts +1 -0
- package/dist/client/agent-chat-adapter.js +10 -2
- package/dist/client/blocks/library/diagram.js +1 -1
- package/dist/client/blocks/library/sanitize-html.js +66 -2
- package/dist/client/blocks/library/wireframe-kit.js +69 -0
- package/dist/client/chat/markdown-renderer.d.ts +1 -0
- package/dist/client/chat/markdown-renderer.js +4 -0
- package/dist/client/chat/message-components.d.ts +1 -0
- package/dist/client/chat/message-components.js +9 -1
- package/dist/client/chat/tool-call-display.d.ts +8 -0
- package/dist/client/chat/tool-call-display.js +30 -21
- package/dist/client/chat-first/app-pane.js +1 -1
- package/dist/client/chat-first/apps-rail.d.ts +1 -1
- package/dist/client/chat-first/apps-rail.js +12 -12
- package/dist/client/chat-first/chat-history.d.ts +1 -1
- package/dist/client/chat-first/chat-history.js +2 -0
- package/dist/client/chat-first/copy.js +1 -0
- package/dist/client/chat-first/primary-nav.js +1 -1
- package/dist/client/chat-first/types.d.ts +1 -0
- package/dist/client/resources/McpConnectionSuggestion.js +2 -2
- package/dist/client/settings/SettingsTabsPage.d.ts +3 -1
- package/dist/client/settings/SettingsTabsPage.js +2 -2
- package/dist/client/sse-event-processor.d.ts +8 -0
- package/dist/client/sse-event-processor.js +13 -6
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/deploy/build.d.ts +5 -7
- package/dist/deploy/build.js +19 -12
- package/dist/localization/default-messages.js +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/provider-api/actions/provider-api.d.ts +2 -2
- package/dist/scripts/call-agent.js +3 -3
- package/dist/scripts/describe-workspace-apps.js +1 -1
- package/dist/secrets/routes.d.ts +6 -6
- package/dist/server/agent-capabilities.js +0 -0
- package/dist/server/agent-chat/context-tools.js +1 -1
- package/dist/server/agent-chat/prompt-resources.js +1 -1
- package/dist/server/agent-chat-plugin.js +1 -1
- package/dist/server/auth.js +190 -42
- package/dist/server/better-auth-migrations.js +53 -0
- package/dist/server/http-response-telemetry.js +7 -1
- package/dist/server/onboarding-html.js +119 -33
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/password-policy.d.ts +2 -1
- package/dist/shared/password-policy.js +2 -1
- package/dist/styles/agent-conversation.css +20 -3
- package/dist/styles/agent-native.css +14 -2
- package/dist/styles/blocks.css +132 -0
- package/dist/templates/default/app/i18n/ar-SA.ts +1 -1
- package/dist/templates/default/app/i18n/de-DE.ts +1 -1
- package/dist/templates/default/app/i18n/en-US.ts +1 -1
- package/dist/templates/default/app/i18n/es-ES.ts +1 -1
- package/dist/templates/default/app/i18n/fr-FR.ts +1 -1
- package/dist/templates/default/app/i18n/hi-IN.ts +1 -1
- package/dist/templates/default/app/i18n/ja-JP.ts +1 -1
- package/dist/templates/default/app/i18n/ko-KR.ts +1 -1
- package/dist/templates/default/app/i18n/pt-BR.ts +1 -1
- package/dist/templates/default/app/i18n/zh-CN.ts +1 -1
- package/dist/templates/default/app/i18n/zh-TW.ts +1 -1
- package/dist/templates/default/pnpm-workspace.yaml +1 -0
- package/dist/templates/workspace-root/pnpm-workspace.yaml +2 -0
- package/docs/content/actions.mdx +4 -1
- package/docs/content/agent-surfaces.mdx +8 -6
- package/docs/content/automations.mdx +1 -1
- package/docs/content/cloneable-saas.mdx +6 -6
- package/docs/content/database.mdx +6 -1
- package/docs/content/deployment.mdx +10 -8
- package/docs/content/docs-components.mdx +22 -14
- package/docs/content/drop-in-agent.mdx +1 -1
- package/docs/content/environment-variables.mdx +4 -3
- package/docs/content/getting-started-actions.mdx +5 -4
- package/docs/content/getting-started-pages.mdx +7 -6
- package/docs/content/getting-started.mdx +4 -3
- package/docs/content/notifications.mdx +6 -6
- package/docs/content/progress.mdx +5 -5
- package/docs/content/routing.mdx +3 -1
- package/docs/content/server-database.mdx +13 -4
- package/docs/content/server-overview.mdx +9 -9
- package/docs/content/server-plugins.mdx +10 -4
- package/docs/content/server-routes.mdx +7 -2
- package/docs/content/tracking.mdx +4 -4
- package/docs/content/what-is-agent-native.mdx +4 -4
- package/package.json +2 -2
- package/src/templates/default/app/i18n/ar-SA.ts +1 -1
- package/src/templates/default/app/i18n/de-DE.ts +1 -1
- package/src/templates/default/app/i18n/en-US.ts +1 -1
- package/src/templates/default/app/i18n/es-ES.ts +1 -1
- package/src/templates/default/app/i18n/fr-FR.ts +1 -1
- package/src/templates/default/app/i18n/hi-IN.ts +1 -1
- package/src/templates/default/app/i18n/ja-JP.ts +1 -1
- package/src/templates/default/app/i18n/ko-KR.ts +1 -1
- package/src/templates/default/app/i18n/pt-BR.ts +1 -1
- package/src/templates/default/app/i18n/zh-CN.ts +1 -1
- package/src/templates/default/app/i18n/zh-TW.ts +1 -1
- package/src/templates/default/pnpm-workspace.yaml +1 -0
- 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: "توسيع الدردشة
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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: "चैट को
|
|
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: "
|
|
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: "
|
|
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
|
|
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",
|
package/docs/content/actions.mdx
CHANGED
|
@@ -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
|
|
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
|
|
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"
|
|
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
|
|
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
|
|
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
|
|
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 />;
|
|
@@ -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 **
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
| `
|
|
447
|
-
| `
|
|
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 `
|
|
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
|
-
| `
|
|
579
|
-
| `
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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: "
|
|
380
|
+
{ path: "app/routes/analyses.tsx", change: "added" },
|
|
381
381
|
{
|
|
382
|
-
path: "
|
|
383
|
-
change: "
|
|
384
|
-
note: "
|
|
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: "
|
|
404
|
+
{ path: "app/routes/analyses.tsx", change: "added" },
|
|
401
405
|
{
|
|
402
|
-
path: "
|
|
403
|
-
change: "
|
|
404
|
-
note: "
|
|
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
|
|
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
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
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
|
|
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
|
-
|
|
86
|
-
the
|
|
87
|
-
custom native components, see
|
|
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.
|
|
10
|
-
|
|
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
|
-
|
|
16
|
-
`app/routes/text-analyses.tsx
|
|
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
|
|
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
|
|
10
|
-
|
|
11
|
-
|
|
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: "
|
|
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("
|
|
241
|
+
const rows = await listNotifications("user@example.com", {
|
|
242
242
|
unreadOnly: true,
|
|
243
243
|
limit: 50,
|
|
244
244
|
});
|
|
245
|
-
const unread = await countUnread("
|
|
246
|
-
await markNotificationRead(rows[0].id, "
|
|
247
|
-
await markAllNotificationsRead("
|
|
248
|
-
await deleteNotification(rows[0].id, "
|
|
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: "
|
|
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: "
|
|
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("
|
|
144
|
-
const run = await getRun("run-id", "
|
|
145
|
-
await deleteRun("run-id", "
|
|
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}
|
package/docs/content/routing.mdx
CHANGED
|
@@ -82,7 +82,9 @@ export default function SettingsPage() {
|
|
|
82
82
|
}
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
That's it — React Router picks it up automatically
|
|
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.
|
|
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
|
|
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
|
-
|
|
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,
|
|
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:
|