@agent-native/core 0.145.5 → 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.
- package/corpus/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +17 -1
- package/corpus/templates/analytics/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/analytics/.agents/skills/gong/SKILL.md +22 -3
- package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/analytics/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/analytics/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/analytics/AGENTS.md +2 -1
- package/corpus/templates/analytics/actions/account-deep-dive.ts +83 -47
- package/corpus/templates/analytics/actions/create-dashboard-folder.ts +27 -0
- package/corpus/templates/analytics/actions/gong-calls.ts +3 -3
- package/corpus/templates/analytics/actions/list-dashboard-folders.ts +26 -0
- package/corpus/templates/analytics/actions/list-sql-dashboards.ts +1 -0
- package/corpus/templates/analytics/actions/set-dashboard-folder.ts +26 -0
- package/corpus/templates/analytics/app/components/ProviderCorpusJobNotifier.tsx +18 -3
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +6 -4
- package/corpus/templates/analytics/app/components/layout/Header.tsx +1 -0
- package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +12 -2
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +35 -20
- package/corpus/templates/analytics/app/global.css +17 -0
- package/corpus/templates/analytics/app/hooks/use-dashboard-revisions.ts +29 -15
- package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +15 -3
- package/corpus/templates/analytics/app/i18n-data.ts +296 -0
- package/corpus/templates/analytics/app/lib/prefetch-keys.ts +23 -2
- package/corpus/templates/analytics/app/pages/DashboardOverview.tsx +642 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +66 -31
- package/corpus/templates/analytics/app/root.tsx +4 -0
- package/corpus/templates/analytics/app/routes/dashboards._index.tsx +5 -1
- package/corpus/templates/analytics/changelog/2026-08-07-added-a-dashboards-overview-with-personal-and-shared-folders.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-07-analytics-tracking-and-chat-startup-no-longer-emit-avoidable.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-07-dashboard-panels-now-load-custom-api-data-programs-reliably.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-07-gong-searches-conserve-api-quota-and-report-incomplete-coverage.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-07-searchable-dashboards-make-personal-and-shared-folders-easie.md +6 -0
- package/corpus/templates/analytics/netlify.toml +3 -0
- package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +112 -0
- package/corpus/templates/analytics/server/db/index.ts +12 -0
- package/corpus/templates/analytics/server/db/schema.ts +14 -0
- package/corpus/templates/analytics/server/jobs/analytics-rollup-backfill.ts +4 -0
- package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +1 -0
- package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +85 -15
- package/corpus/templates/analytics/server/lib/dashboard-folders-store.ts +168 -0
- package/corpus/templates/analytics/server/lib/dashboard-panel-query.ts +9 -4
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +116 -1
- package/corpus/templates/analytics/server/lib/first-party-analytics-rollups.ts +4 -8
- package/corpus/templates/analytics/server/lib/gong.ts +139 -78
- package/corpus/templates/analytics/server/plugins/db.ts +55 -15
- package/corpus/templates/analytics/server/plugins/session-replay-retention-jobs.ts +6 -2
- package/corpus/templates/analytics/server/routes/api/session-replay/retention.post.ts +65 -0
- package/corpus/templates/assets/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/assets/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/assets/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/assets/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/brain/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/brain/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/brain/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/brain/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/calendar/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/calendar/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/calendar/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/chat/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/chat/.env.example +3 -0
- package/corpus/templates/chat/AGENTS.md +4 -0
- package/corpus/templates/clips/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/clips/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/clips/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/clips/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/clips/actions/lib/audio-only-transcription.ts +4 -0
- package/corpus/templates/clips/actions/request-transcript.ts +52 -3
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +3 -10
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +1 -0
- package/corpus/templates/clips/changelog/2026-08-07-screen-recordings-now-capture-tab-and-system-audio-even-when.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-07-transcription-now-retries-transient-cloud-failures-automatic.md +6 -0
- package/corpus/templates/clips/server/db/schema.ts +7 -0
- package/corpus/templates/clips/server/plugins/db.ts +8 -0
- package/corpus/templates/clips/shared/recording-capture.ts +38 -0
- package/corpus/templates/clips/shared/transcript-failure.ts +89 -0
- package/corpus/templates/content/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/content/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/content/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/content/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/content/.env.example +9 -3
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -0
- package/corpus/templates/content/changelog/2026-08-07-collapsed-sidebar-utility-buttons-stay-anchored-at-the-botto.md +6 -0
- package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/crm/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/crm/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/design/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/design/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/design/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/design/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/dispatch/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/factory/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/factory/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/factory/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/factory/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/factory/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/factory/actions/babysit-agent-native-pull-request.ts +279 -0
- package/corpus/templates/factory/actions/get-factory-automation-health.ts +23 -4
- package/corpus/templates/factory/app/components/factory/FactoryCanvas.tsx +1 -1
- package/corpus/templates/factory/app/routes/factory.tsx +21 -3
- package/corpus/templates/factory/changelog/2026-08-07-factory-can-keep-builder-bot-pull-requests-moving-by-request.md +6 -0
- package/corpus/templates/factory/server/lib/require-factory-automation.ts +1 -0
- package/corpus/templates/factory/server/plugins/agent-chat.ts +4 -1
- package/corpus/templates/factory/server/plugins/factory-scheduler-job.ts +81 -12
- package/corpus/templates/factory/server/triage/github-client.ts +31 -0
- package/corpus/templates/factory/server/triage/pr-babysit.ts +75 -1
- package/corpus/templates/forms/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/forms/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/forms/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/forms/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/macros/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/macros/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/mail/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/mail/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/mail/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/mail/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/plan/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/plan/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/plan/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/plan/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/plan/app/pages/PlansPage.tsx +2 -1
- package/corpus/templates/plan/changelog/2026-08-07-inline-help-icons-now-stay-visually-balanced-with-nearby-tex.md +6 -0
- package/corpus/templates/slides/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/slides/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/slides/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/slides/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/slides/.env.example +5 -0
- package/corpus/templates/slides/changelog/2026-08-07-fixed-generated-slides-briefly-disappearing-while-they-are-b.md +6 -0
- package/corpus/templates/slides/server/plugins/collab.ts +20 -8
- package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +18 -0
- package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/tasks/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/corpus/templates/tasks/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/corpus/templates/tasks/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/corpus/templates/tasks/.env.example +3 -0
- package/dist/agent/production-agent.js +24 -3
- package/dist/client/AgentPanel.d.ts +6 -0
- package/dist/client/AgentPanel.js +176 -30
- package/dist/client/AssistantChat.d.ts +2 -0
- package/dist/client/AssistantChat.js +4 -1
- package/dist/client/ConnectBuilderCard.js +6 -11
- package/dist/client/MultiTabAssistantChat.js +1 -1
- package/dist/client/RuntimeConfigNotice.d.ts +1 -0
- package/dist/client/RuntimeConfigNotice.js +94 -0
- package/dist/client/agent-chat/index.d.ts +1 -1
- package/dist/client/agent-chat/index.js +1 -1
- package/dist/client/agent-chat-adapter.js +85 -4
- package/dist/client/agent-page/AgentTabsPage.js +1 -1
- package/dist/client/agent-sidebar-state.d.ts +6 -0
- package/dist/client/agent-sidebar-state.js +25 -0
- package/dist/client/app-providers.js +2 -1
- package/dist/client/assistant-ui-recovery.js +1 -1
- package/dist/client/chat/index.d.ts +1 -1
- package/dist/client/chat/index.js +1 -1
- package/dist/client/chat/markdown-renderer.d.ts +2 -1
- package/dist/client/chat/markdown-renderer.js +48 -2
- package/dist/client/chat/message-components.d.ts +6 -0
- package/dist/client/chat/message-components.js +182 -53
- package/dist/client/chat/tool-call-display.d.ts +16 -4
- package/dist/client/chat/tool-call-display.js +225 -18
- package/dist/client/extensions/ExtensionsSidebarSection.js +1 -1
- package/dist/client/frame-protocol.d.ts +4 -0
- package/dist/client/i18n.js +9 -0
- package/dist/client/integrations/IntegrationsPanel.js +2 -5
- package/dist/client/onboarding/FirstRunOnboarding.js +2 -3
- package/dist/client/org/TeamPage.js +49 -6
- package/dist/client/org/hooks.d.ts +7 -2
- package/dist/client/org/hooks.js +11 -4
- package/dist/client/resources/McpConnectionSuggestion.js +2 -3
- package/dist/client/resources/McpIntegrationDialog.js +2 -16
- package/dist/client/resources/McpIntegrationLogo.d.ts +11 -0
- package/dist/client/resources/McpIntegrationLogo.js +14 -0
- package/dist/client/resources/ResourceTree.js +1 -1
- package/dist/client/resources/mcp-integration-logos.d.ts +1 -0
- package/dist/client/resources/mcp-integration-logos.js +47 -18
- package/dist/client/settings/useBuilderStatus.js +6 -0
- package/dist/client/ui/index.d.ts +1 -0
- package/dist/client/ui/index.js +1 -0
- package/dist/collab/routes.d.ts +1 -1
- package/dist/config.d.ts +26 -3
- package/dist/config.js +106 -14
- package/dist/db/ddl-guard.d.ts +15 -2
- package/dist/db/ddl-guard.js +53 -5
- package/dist/jobs/scheduler.js +7 -0
- package/dist/localization/default-messages.d.ts +17 -0
- package/dist/localization/default-messages.js +17 -0
- package/dist/mcp/oauth-client-metadata.js +5 -1
- package/dist/mcp/oauth-route.d.ts +5 -4
- package/dist/mcp/oauth-route.js +25 -9
- package/dist/mcp/screen-memory-stdio.d.ts +7 -7
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.js +9 -10
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/org/handlers.d.ts +1 -0
- package/dist/org/handlers.js +17 -2
- package/dist/provider-api/actions/custom-provider-registration.d.ts +5 -5
- package/dist/provider-api/actions/provider-api.d.ts +7 -7
- package/dist/provider-api/corpus-jobs.d.ts +12 -2
- package/dist/provider-api/corpus-jobs.js +31 -1
- package/dist/provider-api/index.d.ts +2 -0
- package/dist/provider-api/index.js +7 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +3 -3
- package/dist/server/agent-chat/recurring-jobs-runtime.d.ts +1 -1
- package/dist/server/agent-chat/recurring-jobs-runtime.js +14 -2
- package/dist/server/agent-chat/script-entries.js +12 -1
- package/dist/server/agent-chat-plugin.js +2 -2
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/auth.d.ts +1 -0
- package/dist/server/auth.js +85 -1
- package/dist/server/better-auth-instance.d.ts +9 -0
- package/dist/server/better-auth-instance.js +25 -11
- package/dist/server/core-routes-plugin.d.ts +7 -0
- package/dist/server/core-routes-plugin.js +51 -5
- package/dist/server/create-server.js +23 -2
- package/dist/server/db-pressure.d.ts +38 -0
- package/dist/server/db-pressure.js +147 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +1 -0
- package/dist/server/legacy-auth-migration.d.ts +10 -0
- package/dist/server/legacy-auth-migration.js +37 -0
- package/dist/server/onboarding-html.js +206 -2
- package/dist/server/poll.d.ts +26 -0
- package/dist/server/poll.js +108 -13
- package/dist/server/ssr-handler.js +4 -1
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +1 -0
- package/dist/shared/runtime-config.d.ts +44 -0
- package/dist/shared/runtime-config.js +284 -0
- package/dist/styles/agent-native.css +48 -1
- package/dist/templates/chat/.agents/skills/actions/SKILL.md +18 -0
- package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
- package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/dist/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/dist/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/dist/templates/chat/.env.example +3 -0
- package/dist/templates/chat/AGENTS.md +4 -0
- package/dist/templates/default/.agents/skills/actions/SKILL.md +18 -0
- package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/default/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +1 -0
- package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/dist/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/dist/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/dist/templates/default/AGENTS.md +6 -1
- package/dist/templates/default/app/i18n/ar-SA.ts +6 -0
- package/dist/templates/default/app/i18n/de-DE.ts +6 -0
- package/dist/templates/default/app/i18n/en-US.ts +6 -0
- package/dist/templates/default/app/i18n/es-ES.ts +6 -0
- package/dist/templates/default/app/i18n/fr-FR.ts +6 -0
- package/dist/templates/default/app/i18n/hi-IN.ts +6 -0
- package/dist/templates/default/app/i18n/ja-JP.ts +6 -0
- package/dist/templates/default/app/i18n/ko-KR.ts +6 -0
- package/dist/templates/default/app/i18n/pt-BR.ts +6 -0
- package/dist/templates/default/app/i18n/zh-CN.ts +6 -0
- package/dist/templates/default/app/i18n/zh-TW.ts +6 -0
- package/dist/templates/headless/.agents/skills/actions/SKILL.md +18 -0
- package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/dist/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/dist/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +18 -0
- package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -0
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -0
- package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +8 -0
- package/dist/templates/workspace-core/AGENTS.md +7 -2
- package/dist/templates/workspace-root/AGENTS.md +5 -0
- package/dist/vite/client.d.ts +3 -3
- package/dist/vite/client.js +47 -1
- package/dist/vite/index.d.ts +1 -1
- package/docs/content/agent-native-config.mdx +240 -139
- package/docs/content/authentication.mdx +17 -0
- package/docs/content/deployment.mdx +19 -14
- package/docs/content/drop-in-agent.mdx +19 -2
- package/docs/content/environment-variables.mdx +63 -38
- package/docs/content/getting-started-actions.mdx +15 -6
- package/docs/content/getting-started-database.mdx +14 -10
- package/docs/content/getting-started-pages.mdx +32 -35
- package/docs/content/getting-started.mdx +7 -6
- package/package.json +1 -1
- package/src/templates/chat/.agents/skills/actions/SKILL.md +18 -0
- package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
- package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/src/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/src/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/src/templates/chat/.env.example +3 -0
- package/src/templates/chat/AGENTS.md +4 -0
- package/src/templates/default/.agents/skills/actions/SKILL.md +18 -0
- package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/default/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -0
- package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/src/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/src/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/src/templates/default/AGENTS.md +6 -1
- package/src/templates/default/app/i18n/ar-SA.ts +6 -0
- package/src/templates/default/app/i18n/de-DE.ts +6 -0
- package/src/templates/default/app/i18n/en-US.ts +6 -0
- package/src/templates/default/app/i18n/es-ES.ts +6 -0
- package/src/templates/default/app/i18n/fr-FR.ts +6 -0
- package/src/templates/default/app/i18n/hi-IN.ts +6 -0
- package/src/templates/default/app/i18n/ja-JP.ts +6 -0
- package/src/templates/default/app/i18n/ko-KR.ts +6 -0
- package/src/templates/default/app/i18n/pt-BR.ts +6 -0
- package/src/templates/default/app/i18n/zh-CN.ts +6 -0
- package/src/templates/default/app/i18n/zh-TW.ts +6 -0
- package/src/templates/headless/.agents/skills/actions/SKILL.md +18 -0
- package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/src/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/src/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +18 -0
- package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +45 -47
- package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -0
- package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +76 -23
- package/src/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
- package/src/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
- package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -0
- package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +8 -0
- package/src/templates/workspace-core/AGENTS.md +7 -2
- package/src/templates/workspace-root/AGENTS.md +5 -0
- package/corpus/templates/dispatch/app/routes/admin.apps.$appId.tsx +0 -1
- package/corpus/templates/dispatch/app/routes/admin.apps.tsx +0 -1
|
@@ -24,44 +24,44 @@ deployment-specific values in the environment or scoped secret store.
|
|
|
24
24
|
|
|
25
25
|
## Common application and deployment variables
|
|
26
26
|
|
|
27
|
-
| Variable | What it controls
|
|
28
|
-
| ------------------------------------------- |
|
|
29
|
-
| `DATABASE_URL` | Primary SQL connection. Local development falls back to SQLite when it is unset.
|
|
30
|
-
| `DATABASE_AUTH_TOKEN` | Separate database token when the database provider requires one.
|
|
31
|
-
| `APP_URL` |
|
|
32
|
-
| `BETTER_AUTH_URL` |
|
|
33
|
-
| `APP_BASE_PATH` | Mounts an app under a path such as `/mail`.
|
|
34
|
-
| `PORT` | Local Node/Nitro server port.
|
|
35
|
-
| `NITRO_PRESET` | Build and deployment adapter.
|
|
36
|
-
| `BETTER_AUTH_SECRET` | Better Auth session signing
|
|
37
|
-
| `OAUTH_STATE_SECRET` | Dedicated signing key for OAuth state envelopes. Falls back to `BETTER_AUTH_SECRET` when unset.
|
|
38
|
-
| `A2A_SECRET` | Shared HMAC for trusted cross-app A2A calls and signed handoffs.
|
|
39
|
-
| `SECRETS_ENCRYPTION_KEY` | Legacy app-local/shared encryption fallback.
|
|
40
|
-
| `WORKSPACE_SECRETS_ENCRYPTION_KEY` | Stable encryption key for a workspace-shared secrets vault.
|
|
41
|
-
| `WORKSPACE_SECRETS_ENCRYPTION_KEY_PREVIOUS` | Previous workspace key during rotation.
|
|
42
|
-
| `ANTHROPIC_API_KEY` | Optional deploy-level fallback for the embedded production agent.
|
|
43
|
-
| `AGENT_ENGINE` | Explicitly selects the agent engine instead of auto-detecting from provider keys.
|
|
44
|
-
| `AGENT_ENGINE_PREFER_BYO_KEY` | Prefers a provider key you set over the managed Builder gateway during auto-detection.
|
|
45
|
-
| `AUTH_MODE` | Selects the local authentication behavior used by CLI and agent flows.
|
|
46
|
-
| `AUTH_DISABLED` | Disables auth for local or preview-only work.
|
|
47
|
-
| `AUTH_MAGIC_LINK` | Controls the password-first versus magic-link sign-in path.
|
|
48
|
-
| `AUTH_SKIP_EMAIL_VERIFICATION` | Skips signup email verification for local QA or previews.
|
|
49
|
-
| `ACCESS_TOKEN` / `ACCESS_TOKENS` | Static bearer fallback for MCP and Connect clients.
|
|
50
|
-
| `AGENT_PROD_CODE_EXECUTION` | Production code-execution policy.
|
|
51
|
-
| `AGENT_NATIVE_SSR_CACHE` | Deployment-wide public SSR shell cache policy.
|
|
52
|
-
| `AGENT_NATIVE_DISABLE_KEEP_WARM` | Lets a scale-to-zero database autosuspend instead of being woken every minute.
|
|
53
|
-
| `AGENT_NATIVE_KEEP_WARM_SCHEDULE` | Keep-warm cadence override.
|
|
54
|
-
| `AGENT_NATIVE_DISABLE_KEEP_WARM_BACKGROUND` | Drops only the background-function warm and keeps the server warm.
|
|
55
|
-
| `AGENT_NATIVE_DISABLE_INPROCESS_SWEEPS` | Turns off the in-process backstop sweep timers where a durable scheduler drives the same work.
|
|
56
|
-
| `AGENT_NATIVE_SKIP_ENSURE_TABLES` | Skips on-demand schema DDL for an already-migrated database.
|
|
57
|
-
| `COOKIE_DOMAIN` | Shares auth cookies across same-database subdomains when explicitly configured.
|
|
58
|
-
| `CORS_ALLOWED_ORIGINS` | Cross-origin request allowlist.
|
|
59
|
-
| `WEBHOOK_BASE_URL` | Optional public base URL for self-callback and webhook targets.
|
|
60
|
-
| `APP_NAME` | App identity used by workspace and app-scoped configuration.
|
|
61
|
-
| `APP_ID` / `APP_TEMPLATE` | Optional app identity and generated-template metadata.
|
|
62
|
-
| `NODE_ENV` | Node runtime mode.
|
|
63
|
-
| `CI` | Marks CI-driven test and build behavior.
|
|
64
|
-
| `DEBUG` | Enables resolver-specific debug logging.
|
|
27
|
+
| Variable | What it controls | Supported values or format |
|
|
28
|
+
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
29
|
+
| `DATABASE_URL` | Primary SQL connection. Local development falls back to SQLite when it is unset. Production also accepts `<APP_NAME>_DATABASE_URL` or Netlify's `NETLIFY_DATABASE_URL`. | A provider-specific SQL URL, or unset for local SQLite. |
|
|
30
|
+
| `DATABASE_AUTH_TOKEN` | Separate database token when the database provider requires one. | An opaque provider token, or unset when the URL includes authentication. |
|
|
31
|
+
| `APP_URL` | Optional canonical public origin used for auth, OAuth, A2A, webhooks, and generated links. Netlify and Vercel metadata are inferred when it is unset. | An absolute public `http(s)` origin. |
|
|
32
|
+
| `BETTER_AUTH_URL` | Optional Better Auth origin override. Known template or request context, `APP_URL`, and platform metadata such as Netlify or Vercel are used when it is unset. | An absolute public `http(s)` origin. |
|
|
33
|
+
| `APP_BASE_PATH` | Mounts an app under a path such as `/mail`. | Unset for a standalone app, or a slash-prefixed path. |
|
|
34
|
+
| `PORT` | Local Node/Nitro server port. | A decimal TCP port. |
|
|
35
|
+
| `NITRO_PRESET` | Build and deployment adapter. | A preset supported by the target host, such as `node`, `netlify`, `vercel`, or `cloudflare_pages`. |
|
|
36
|
+
| `BETTER_AUTH_SECRET` | Stable Better Auth session signing secret for standalone production apps. Workspace deploys can derive it from `A2A_SECRET`. | A fresh random value of at least 32 characters. |
|
|
37
|
+
| `OAUTH_STATE_SECRET` | Dedicated signing key for OAuth state envelopes. Falls back to `BETTER_AUTH_SECRET` when unset. | A fresh random value of at least 32 characters. |
|
|
38
|
+
| `A2A_SECRET` | Shared HMAC for trusted cross-app A2A calls and signed handoffs. | One shared random value across trusted apps. |
|
|
39
|
+
| `SECRETS_ENCRYPTION_KEY` | Legacy app-local/shared encryption fallback. | A stable encryption key; prefer the workspace key for new shared vaults. |
|
|
40
|
+
| `WORKSPACE_SECRETS_ENCRYPTION_KEY` | Stable encryption key for a workspace-shared secrets vault. | The same stable key in every app that reads the vault. |
|
|
41
|
+
| `WORKSPACE_SECRETS_ENCRYPTION_KEY_PREVIOUS` | Previous workspace key during rotation. | The old key only; remove it after migration. |
|
|
42
|
+
| `ANTHROPIC_API_KEY` | Optional deploy-level fallback for the embedded production agent. | An API key; prefer scoped credentials for multi-tenant apps. |
|
|
43
|
+
| `AGENT_ENGINE` | Explicitly selects the agent engine instead of auto-detecting from provider keys. | A registered engine name such as `anthropic`, `ai-sdk:openai`, `builder`, or `codex-cli`. |
|
|
44
|
+
| `AGENT_ENGINE_PREFER_BYO_KEY` | Prefers a provider key you set over the managed Builder gateway during auto-detection. | `true` or `1`; Builder still applies as the fallback when no provider key is set. |
|
|
45
|
+
| `AUTH_MODE` | Selects the local authentication behavior used by CLI and agent flows. | Unset or `local`; this is not a browser login bypass. |
|
|
46
|
+
| `AUTH_DISABLED` | Disables auth for local or preview-only work. Unset already means false. | `true` or `1`; never use on a public production app. |
|
|
47
|
+
| `AUTH_MAGIC_LINK` | Controls the password-first versus magic-link sign-in path. | `0` keeps password-first sign-in; otherwise a configured email transport can enable magic links. |
|
|
48
|
+
| `AUTH_SKIP_EMAIL_VERIFICATION` | Skips signup email verification for local QA or previews. | `1`; never use it to weaken production auth. |
|
|
49
|
+
| `ACCESS_TOKEN` / `ACCESS_TOKENS` | Static bearer fallback for MCP and Connect clients. | One token or a delimited token list; these are not browser auth. |
|
|
50
|
+
| `AGENT_PROD_CODE_EXECUTION` | Production code-execution policy. | `off`, `sandboxed`, or `trusted`. See [Production Code Execution](/docs/deployment#production-code-execution). |
|
|
51
|
+
| `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). |
|
|
52
|
+
| `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). |
|
|
53
|
+
| `AGENT_NATIVE_KEEP_WARM_SCHEDULE` | Keep-warm cadence override. | A 5-field cron expression such as `*/5 * * * *`; an unparseable value fails the build. |
|
|
54
|
+
| `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). |
|
|
55
|
+
| `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. |
|
|
56
|
+
| `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. |
|
|
57
|
+
| `COOKIE_DOMAIN` | Shares auth cookies across same-database subdomains when explicitly configured. | A cookie domain. |
|
|
58
|
+
| `CORS_ALLOWED_ORIGINS` | Cross-origin request allowlist. | A comma-separated list of exact origins. |
|
|
59
|
+
| `WEBHOOK_BASE_URL` | Optional public base URL for self-callback and webhook targets. | An absolute public `http(s)` origin. |
|
|
60
|
+
| `APP_NAME` | App identity used by workspace and app-scoped configuration. | A short app name, such as `mail`. |
|
|
61
|
+
| `APP_ID` / `APP_TEMPLATE` | Optional app identity and generated-template metadata. | App-owned strings. |
|
|
62
|
+
| `NODE_ENV` | Node runtime mode. | Normally `development`, `test`, or `production`. |
|
|
63
|
+
| `CI` | Marks CI-driven test and build behavior. | A CI-provided truthy value. |
|
|
64
|
+
| `DEBUG` | Enables resolver-specific debug logging. | A resolver-supported truthy or namespace value. |
|
|
65
65
|
|
|
66
66
|
Generate strong secrets with:
|
|
67
67
|
|
|
@@ -69,6 +69,31 @@ Generate strong secrets with:
|
|
|
69
69
|
openssl rand -hex 32
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
+
## What a normal deployment actually needs
|
|
73
|
+
|
|
74
|
+
Do not copy a five-variable auth checklist into every app. The framework
|
|
75
|
+
defaults `AUTH_DISABLED` to false and infers `BETTER_AUTH_URL` from known
|
|
76
|
+
template/request context and hosting platform metadata. A standalone production app normally
|
|
77
|
+
needs only one auth-specific deploy secret, `BETTER_AUTH_SECRET`, plus a
|
|
78
|
+
persistent SQL URL. Workspace deployments can use the already-required
|
|
79
|
+
`A2A_SECRET` to derive the Better Auth secret and trusted internal signing
|
|
80
|
+
keys.
|
|
81
|
+
|
|
82
|
+
Local development intentionally uses SQLite when no database URL is present
|
|
83
|
+
and an ephemeral Better Auth secret when no local secret is configured. Those
|
|
84
|
+
fallbacks keep `pnpm dev` zero-setup, but they are not silently accepted as
|
|
85
|
+
production configuration. The build and runtime diagnostics report missing or
|
|
86
|
+
weak auth/A2A secrets, local databases, auth disabled in production, invalid
|
|
87
|
+
public origins, and app-declared required keys without including any secret
|
|
88
|
+
values.
|
|
89
|
+
|
|
90
|
+
Every framework app exposes the redacted report at
|
|
91
|
+
`/_agent-native/ping?configuration=1`. The shared provider shell turns a
|
|
92
|
+
non-healthy production report into a warning or error chip with a **Copy
|
|
93
|
+
prompt for AI** button. `agent-native.ts` or its compatibility aliases can add
|
|
94
|
+
non-secret requirements under `runtime.environment.required`; set the actual
|
|
95
|
+
values in Netlify, Vercel, or the deployment's secret store.
|
|
96
|
+
|
|
72
97
|
## Google sign-in
|
|
73
98
|
|
|
74
99
|
Set one complete Google OAuth client pair to show the Google sign-in flow.
|
|
@@ -32,27 +32,35 @@ export default defineAction({
|
|
|
32
32
|
text: z.string().default("The quick brown fox jumps over the lazy dog."),
|
|
33
33
|
}),
|
|
34
34
|
outputSchema: dataChartWidgetResultSchema,
|
|
35
|
+
http: { method: "GET" },
|
|
35
36
|
chatUI: {
|
|
36
37
|
renderer: ACTION_CHAT_UI_DATA_CHART_RENDERER,
|
|
37
38
|
title: "Text stats",
|
|
38
39
|
},
|
|
39
40
|
readOnly: true,
|
|
40
41
|
run: async ({ text }) => {
|
|
42
|
+
const summary = {
|
|
43
|
+
characters: text.length,
|
|
44
|
+
words: text.split(/\s+/).filter(Boolean).length,
|
|
45
|
+
sentences: text.split(/[.!?]+/).filter(Boolean).length,
|
|
46
|
+
paragraphs: text.split(/\n\n+/).filter(Boolean).length,
|
|
47
|
+
};
|
|
41
48
|
const points = [
|
|
42
|
-
{ label: "Characters", value:
|
|
43
|
-
{ label: "Words", value:
|
|
49
|
+
{ label: "Characters", value: summary.characters },
|
|
50
|
+
{ label: "Words", value: summary.words },
|
|
44
51
|
{
|
|
45
52
|
label: "Sentences",
|
|
46
|
-
value:
|
|
53
|
+
value: summary.sentences,
|
|
47
54
|
},
|
|
48
55
|
{
|
|
49
56
|
label: "Paragraphs",
|
|
50
|
-
value:
|
|
57
|
+
value: summary.paragraphs,
|
|
51
58
|
},
|
|
52
59
|
];
|
|
53
60
|
|
|
54
61
|
return createDataChartWidgetResult({
|
|
55
62
|
title: "Text statistics",
|
|
63
|
+
summary,
|
|
56
64
|
chartSeries: {
|
|
57
65
|
type: "bar",
|
|
58
66
|
xKey: "label",
|
|
@@ -80,5 +88,6 @@ custom native components, see [Native Chat UI](/docs/native-chat-ui).
|
|
|
80
88
|
|
|
81
89
|
## Continue
|
|
82
90
|
|
|
83
|
-
Continue with [
|
|
84
|
-
|
|
91
|
+
Continue with [Add a Page](/docs/getting-started-pages) to use the same action
|
|
92
|
+
outside the transcript. When results need to survive conversations, return to
|
|
93
|
+
[Persist Data in SQL](/docs/getting-started-database).
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Persist Data in SQL"
|
|
3
|
-
description: "
|
|
3
|
+
description: "Persist action results in SQL when they need to survive conversations."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Persist Data in SQL
|
|
7
7
|
|
|
8
|
-
This is part
|
|
9
|
-
you
|
|
10
|
-
results
|
|
8
|
+
This is the optional fourth part of the Getting Started series. In [Add a Page](/docs/getting-started-pages)
|
|
9
|
+
you used `analyze-text` directly from a route. Here you'll add app-owned SQL
|
|
10
|
+
data when results need to survive conversations.
|
|
11
11
|
|
|
12
12
|
## Add a table {#persist-data}
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
Chat already includes the SQL runtime, framework tables, and a local SQLite file
|
|
15
|
+
by default. You do not need to install a database, set `DATABASE_URL`, or add a
|
|
16
|
+
migration for Chat's built-in tables. For a new app-owned table, add these three
|
|
17
|
+
server files:
|
|
16
18
|
|
|
17
19
|
1. `server/plugins/db.ts` creates the table with an additive migration.
|
|
18
20
|
2. `server/db/schema.ts` describes the table for typed queries.
|
|
@@ -153,7 +155,8 @@ export default defineAction({
|
|
|
153
155
|
```
|
|
154
156
|
|
|
155
157
|
The actions use the typed Drizzle client for app reads and writes. Raw SQL is
|
|
156
|
-
only needed here for the additive migration.
|
|
158
|
+
only needed here for the additive migration. Skip this page until your action
|
|
159
|
+
needs durable domain data.
|
|
157
160
|
|
|
158
161
|
## Try it
|
|
159
162
|
|
|
@@ -161,9 +164,10 @@ In chat, ask the agent to do the whole flow:
|
|
|
161
164
|
|
|
162
165
|
> Run analyze-text on "Hello world", save the result with save-text-analysis, then list my saved text analyses.
|
|
163
166
|
|
|
164
|
-
The saved row is now available to the agent and to
|
|
167
|
+
The saved row is now available to the agent and to any page that reads
|
|
168
|
+
`list-text-analyses`.
|
|
165
169
|
|
|
166
170
|
## Continue
|
|
167
171
|
|
|
168
|
-
Continue with [
|
|
169
|
-
|
|
172
|
+
You now have durable app data. Continue with [Key Concepts](/docs/key-concepts)
|
|
173
|
+
to learn how actions, SQL, and pages fit together.
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Add a Page"
|
|
3
|
-
description: "Build a React route that
|
|
3
|
+
description: "Build a React route that calls your action and displays its result."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Add a Page
|
|
7
7
|
|
|
8
|
-
This is part
|
|
9
|
-
you
|
|
10
|
-
|
|
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.
|
|
11
12
|
|
|
12
13
|
## Create the route {#add-a-page}
|
|
13
14
|
|
|
@@ -19,50 +20,45 @@ Route files in `app/routes/` are picked up automatically. Create
|
|
|
19
20
|
import { useActionQuery } from "@agent-native/core/client/hooks";
|
|
20
21
|
|
|
21
22
|
type TextAnalysis = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
createdAt: string;
|
|
23
|
+
summary: {
|
|
24
|
+
characters: number;
|
|
25
|
+
words: number;
|
|
26
|
+
sentences: number;
|
|
27
|
+
paragraphs: number;
|
|
28
|
+
};
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export default function TextAnalysesRoute() {
|
|
32
|
-
const { data:
|
|
33
|
-
"
|
|
34
|
-
{},
|
|
32
|
+
const { data: analysis, isLoading } = useActionQuery<TextAnalysis>(
|
|
33
|
+
"analyze-text",
|
|
34
|
+
{ text: "Hello world. How are you today?" },
|
|
35
35
|
);
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
38
|
<main className="mx-auto flex max-w-3xl flex-col gap-6 p-6">
|
|
39
39
|
<header>
|
|
40
40
|
<h1 className="text-2xl font-semibold">Text analyses</h1>
|
|
41
|
-
<p className="text-muted-foreground">
|
|
41
|
+
<p className="text-muted-foreground">The same action, on a page.</p>
|
|
42
42
|
</header>
|
|
43
|
-
<section className="
|
|
44
|
-
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</p>
|
|
55
|
-
</article>
|
|
56
|
-
))}
|
|
43
|
+
<section className="grid gap-3 sm:grid-cols-2">
|
|
44
|
+
{isLoading && <p className="text-muted-foreground">Analyzing...</p>}
|
|
45
|
+
{analysis &&
|
|
46
|
+
Object.entries(analysis.summary).map(([label, value]) => (
|
|
47
|
+
<article key={label} className="rounded-lg border p-4">
|
|
48
|
+
<p className="text-sm capitalize text-muted-foreground">
|
|
49
|
+
{label}
|
|
50
|
+
</p>
|
|
51
|
+
<p className="text-2xl font-semibold">{value}</p>
|
|
52
|
+
</article>
|
|
53
|
+
))}
|
|
57
54
|
</section>
|
|
58
55
|
</main>
|
|
59
56
|
);
|
|
60
57
|
}
|
|
61
58
|
```
|
|
62
59
|
|
|
63
|
-
`useActionQuery` calls the same action the agent uses.
|
|
64
|
-
|
|
65
|
-
API route or a second data layer.
|
|
60
|
+
`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.
|
|
66
62
|
|
|
67
63
|
Open `http://localhost:8080/text-analyses`, or ask the agent:
|
|
68
64
|
|
|
@@ -74,6 +70,7 @@ patterns, see [Context Awareness](/docs/context-awareness).
|
|
|
74
70
|
|
|
75
71
|
## Continue
|
|
76
72
|
|
|
77
|
-
You've built a chat app with an action
|
|
78
|
-
|
|
79
|
-
[
|
|
73
|
+
You've built a chat app with an action and a page that calls the same source of
|
|
74
|
+
truth. Continue with [Persist Data in SQL](/docs/getting-started-database) when
|
|
75
|
+
results need to persist, or explore [Key Concepts](/docs/key-concepts) and
|
|
76
|
+
[Agent Surfaces](/docs/agent-surfaces).
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Getting Started"
|
|
3
|
-
description: "Create a Chat app and configure an agent, then extend it with an action
|
|
3
|
+
description: "Create a Chat app and configure an agent, then extend it with an action and a page."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Getting Started
|
|
7
7
|
|
|
8
8
|
Agent-Native apps give the agent and the UI the same [actions](/docs/actions),
|
|
9
9
|
SQL data, and application state. This is the hands-on path: start with chat,
|
|
10
|
-
then add
|
|
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.
|
|
11
12
|
|
|
12
13
|
<Steps>
|
|
13
14
|
|
|
@@ -21,13 +22,13 @@ configure an agent. You'll have a working chat app to extend.
|
|
|
21
22
|
|
|
22
23
|
Define a typed text analyzer and render its result as a chart in the chat.
|
|
23
24
|
|
|
24
|
-
###
|
|
25
|
+
### Add a page
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
Build a React route that calls the same action outside the transcript.
|
|
27
28
|
|
|
28
|
-
###
|
|
29
|
+
### Persist data in SQL (optional)
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
Add a table and persistence actions when results need to survive conversations.
|
|
31
32
|
|
|
32
33
|
</Steps>
|
|
33
34
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.145.
|
|
3
|
+
"version": "0.145.6",
|
|
4
4
|
"description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -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
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
81
|
-
|
|
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
|
|
101
|
-
| `false` | Prefills the
|
|
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
|
|
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
|
-
|
|
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({
|
|
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
|
-
|
|
149
|
+
Start in agent
|
|
128
150
|
</Button>
|
|
129
151
|
```
|
|
130
152
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
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.
|