@agent-native/core 0.6.1 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -3
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +154 -4
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/types.d.ts +1 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/cli/create-workspace.d.ts +8 -0
- package/dist/cli/create-workspace.d.ts.map +1 -0
- package/dist/cli/create-workspace.js +18 -0
- package/dist/cli/create-workspace.js.map +1 -0
- package/dist/cli/create.d.ts +35 -7
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +444 -251
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/index.js +59 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/workspacify.d.ts +18 -0
- package/dist/cli/workspacify.d.ts.map +1 -0
- package/dist/cli/workspacify.js +74 -0
- package/dist/cli/workspacify.js.map +1 -0
- package/dist/client/AgentPanel.d.ts +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +63 -225
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/components/CodeRequiredDialog.d.ts.map +1 -1
- package/dist/client/components/CodeRequiredDialog.js +86 -5
- package/dist/client/components/CodeRequiredDialog.js.map +1 -1
- package/dist/client/composer/MentionPopover.d.ts.map +1 -1
- package/dist/client/composer/MentionPopover.js +15 -2
- package/dist/client/composer/MentionPopover.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +3 -1
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/composer/types.d.ts +1 -1
- package/dist/client/composer/types.d.ts.map +1 -1
- package/dist/client/integrations/IntegrationsPanel.d.ts.map +1 -1
- package/dist/client/integrations/IntegrationsPanel.js +22 -9
- package/dist/client/integrations/IntegrationsPanel.js.map +1 -1
- package/dist/client/onboarding/OnboardingBanner.d.ts +13 -0
- package/dist/client/onboarding/OnboardingBanner.d.ts.map +1 -0
- package/dist/client/onboarding/OnboardingBanner.js +36 -0
- package/dist/client/onboarding/OnboardingBanner.js.map +1 -0
- package/dist/client/onboarding/OnboardingPanel.d.ts +16 -0
- package/dist/client/onboarding/OnboardingPanel.d.ts.map +1 -0
- package/dist/client/onboarding/OnboardingPanel.js +360 -0
- package/dist/client/onboarding/OnboardingPanel.js.map +1 -0
- package/dist/client/onboarding/SetupButton.d.ts +10 -0
- package/dist/client/onboarding/SetupButton.d.ts.map +1 -0
- package/dist/client/onboarding/SetupButton.js +26 -0
- package/dist/client/onboarding/SetupButton.js.map +1 -0
- package/dist/client/onboarding/index.d.ts +12 -0
- package/dist/client/onboarding/index.d.ts.map +1 -0
- package/dist/client/onboarding/index.js +11 -0
- package/dist/client/onboarding/index.js.map +1 -0
- package/dist/client/onboarding/use-onboarding.d.ts +34 -0
- package/dist/client/onboarding/use-onboarding.d.ts.map +1 -0
- package/dist/client/onboarding/use-onboarding.js +101 -0
- package/dist/client/onboarding/use-onboarding.js.map +1 -0
- package/dist/client/org/TeamPage.d.ts +6 -1
- package/dist/client/org/TeamPage.d.ts.map +1 -1
- package/dist/client/org/TeamPage.js +85 -14
- package/dist/client/org/TeamPage.js.map +1 -1
- package/dist/client/resources/ResourceEditor.d.ts.map +1 -1
- package/dist/client/resources/ResourceEditor.js +48 -77
- package/dist/client/resources/ResourceEditor.js.map +1 -1
- package/dist/client/resources/ResourceTree.d.ts.map +1 -1
- package/dist/client/resources/ResourceTree.js +16 -3
- package/dist/client/resources/ResourceTree.js.map +1 -1
- package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
- package/dist/client/resources/ResourcesPanel.js +135 -9
- package/dist/client/resources/ResourcesPanel.js.map +1 -1
- package/dist/client/resources/use-resources.d.ts +5 -0
- package/dist/client/resources/use-resources.d.ts.map +1 -1
- package/dist/client/resources/use-resources.js.map +1 -1
- package/dist/client/settings/AgentsSection.d.ts +2 -0
- package/dist/client/settings/AgentsSection.d.ts.map +1 -0
- package/dist/client/settings/AgentsSection.js +198 -0
- package/dist/client/settings/AgentsSection.js.map +1 -0
- package/dist/client/settings/BackgroundAgentSection.d.ts +2 -0
- package/dist/client/settings/BackgroundAgentSection.d.ts.map +1 -0
- package/dist/client/settings/BackgroundAgentSection.js +46 -0
- package/dist/client/settings/BackgroundAgentSection.js.map +1 -0
- package/dist/client/settings/BrowserSection.d.ts +2 -0
- package/dist/client/settings/BrowserSection.d.ts.map +1 -0
- package/dist/client/settings/BrowserSection.js +10 -0
- package/dist/client/settings/BrowserSection.js.map +1 -0
- package/dist/client/settings/ComingSoonSection.d.ts +13 -0
- package/dist/client/settings/ComingSoonSection.d.ts.map +1 -0
- package/dist/client/settings/ComingSoonSection.js +9 -0
- package/dist/client/settings/ComingSoonSection.js.map +1 -0
- package/dist/client/settings/LLMSection.d.ts +2 -0
- package/dist/client/settings/LLMSection.d.ts.map +1 -0
- package/dist/client/settings/LLMSection.js +64 -0
- package/dist/client/settings/LLMSection.js.map +1 -0
- package/dist/client/settings/SettingsPanel.d.ts +8 -0
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -0
- package/dist/client/settings/SettingsPanel.js +118 -0
- package/dist/client/settings/SettingsPanel.js.map +1 -0
- package/dist/client/settings/SettingsSection.d.ts +19 -0
- package/dist/client/settings/SettingsSection.d.ts.map +1 -0
- package/dist/client/settings/SettingsSection.js +10 -0
- package/dist/client/settings/SettingsSection.js.map +1 -0
- package/dist/client/settings/index.d.ts +3 -0
- package/dist/client/settings/index.d.ts.map +1 -0
- package/dist/client/settings/index.js +3 -0
- package/dist/client/settings/index.js.map +1 -0
- package/dist/client/settings/useBuilderStatus.d.ts +22 -0
- package/dist/client/settings/useBuilderStatus.d.ts.map +1 -0
- package/dist/client/settings/useBuilderStatus.js +41 -0
- package/dist/client/settings/useBuilderStatus.js.map +1 -0
- package/dist/deploy/build.js +198 -54
- package/dist/deploy/build.js.map +1 -1
- package/dist/deploy/route-discovery.d.ts +5 -0
- package/dist/deploy/route-discovery.d.ts.map +1 -1
- package/dist/deploy/route-discovery.js +38 -7
- package/dist/deploy/route-discovery.js.map +1 -1
- package/dist/deploy/workspace-core.d.ts +28 -0
- package/dist/deploy/workspace-core.d.ts.map +1 -0
- package/dist/deploy/workspace-core.js +223 -0
- package/dist/deploy/workspace-core.js.map +1 -0
- package/dist/deploy/workspace-deploy.d.ts +11 -0
- package/dist/deploy/workspace-deploy.d.ts.map +1 -0
- package/dist/deploy/workspace-deploy.js +148 -0
- package/dist/deploy/workspace-deploy.js.map +1 -0
- package/dist/file-upload/builder.d.ts +11 -0
- package/dist/file-upload/builder.d.ts.map +1 -0
- package/dist/file-upload/builder.js +53 -0
- package/dist/file-upload/builder.js.map +1 -0
- package/dist/file-upload/index.d.ts +4 -0
- package/dist/file-upload/index.d.ts.map +1 -0
- package/dist/file-upload/index.js +3 -0
- package/dist/file-upload/index.js.map +1 -0
- package/dist/file-upload/registry.d.ts +23 -0
- package/dist/file-upload/registry.d.ts.map +1 -0
- package/dist/file-upload/registry.js +52 -0
- package/dist/file-upload/registry.js.map +1 -0
- package/dist/file-upload/types.d.ts +37 -0
- package/dist/file-upload/types.d.ts.map +1 -0
- package/dist/file-upload/types.js +10 -0
- package/dist/file-upload/types.js.map +1 -0
- package/dist/integrations/adapters/google-docs.d.ts +89 -0
- package/dist/integrations/adapters/google-docs.d.ts.map +1 -0
- package/dist/integrations/adapters/google-docs.js +261 -0
- package/dist/integrations/adapters/google-docs.js.map +1 -0
- package/dist/integrations/adapters/slack.d.ts.map +1 -1
- package/dist/integrations/adapters/slack.js +34 -0
- package/dist/integrations/adapters/slack.js.map +1 -1
- package/dist/integrations/adapters/telegram.d.ts.map +1 -1
- package/dist/integrations/adapters/telegram.js +32 -0
- package/dist/integrations/adapters/telegram.js.map +1 -1
- package/dist/integrations/google-docs-poller.d.ts +54 -0
- package/dist/integrations/google-docs-poller.d.ts.map +1 -0
- package/dist/integrations/google-docs-poller.js +442 -0
- package/dist/integrations/google-docs-poller.js.map +1 -0
- package/dist/integrations/index.d.ts +2 -0
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +3 -0
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/plugin.d.ts.map +1 -1
- package/dist/integrations/plugin.js +49 -2
- package/dist/integrations/plugin.js.map +1 -1
- package/dist/integrations/types.d.ts +33 -0
- package/dist/integrations/types.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.d.ts +10 -1
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +13 -3
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/jobs/scheduler.d.ts +3 -0
- package/dist/jobs/scheduler.d.ts.map +1 -1
- package/dist/jobs/scheduler.js +81 -60
- package/dist/jobs/scheduler.js.map +1 -1
- package/dist/jobs/tools.d.ts.map +1 -1
- package/dist/jobs/tools.js +20 -3
- package/dist/jobs/tools.js.map +1 -1
- package/dist/mcp-client/config.d.ts +46 -0
- package/dist/mcp-client/config.d.ts.map +1 -0
- package/dist/mcp-client/config.js +152 -0
- package/dist/mcp-client/config.js.map +1 -0
- package/dist/mcp-client/index.d.ts +17 -0
- package/dist/mcp-client/index.d.ts.map +1 -0
- package/dist/mcp-client/index.js +53 -0
- package/dist/mcp-client/index.js.map +1 -0
- package/dist/mcp-client/manager.d.ts +76 -0
- package/dist/mcp-client/manager.d.ts.map +1 -0
- package/dist/mcp-client/manager.js +212 -0
- package/dist/mcp-client/manager.js.map +1 -0
- package/dist/oauth-tokens/store.d.ts.map +1 -1
- package/dist/oauth-tokens/store.js +3 -1
- package/dist/oauth-tokens/store.js.map +1 -1
- package/dist/onboarding/default-steps.d.ts +10 -0
- package/dist/onboarding/default-steps.d.ts.map +1 -0
- package/dist/onboarding/default-steps.js +164 -0
- package/dist/onboarding/default-steps.js.map +1 -0
- package/dist/onboarding/index.d.ts +12 -0
- package/dist/onboarding/index.d.ts.map +1 -0
- package/dist/onboarding/index.js +11 -0
- package/dist/onboarding/index.js.map +1 -0
- package/dist/onboarding/plugin.d.ts +19 -0
- package/dist/onboarding/plugin.d.ts.map +1 -0
- package/dist/onboarding/plugin.js +147 -0
- package/dist/onboarding/plugin.js.map +1 -0
- package/dist/onboarding/registry.d.ts +24 -0
- package/dist/onboarding/registry.d.ts.map +1 -0
- package/dist/onboarding/registry.js +40 -0
- package/dist/onboarding/registry.js.map +1 -0
- package/dist/onboarding/types.d.ts +71 -0
- package/dist/onboarding/types.d.ts.map +1 -0
- package/dist/onboarding/types.js +10 -0
- package/dist/onboarding/types.js.map +1 -0
- package/dist/resources/agents.d.ts +4 -0
- package/dist/resources/agents.d.ts.map +1 -0
- package/dist/resources/agents.js +44 -0
- package/dist/resources/agents.js.map +1 -0
- package/dist/resources/handlers.d.ts +17 -0
- package/dist/resources/handlers.d.ts.map +1 -1
- package/dist/resources/handlers.js +49 -12
- package/dist/resources/handlers.js.map +1 -1
- package/dist/resources/metadata.d.ts +48 -0
- package/dist/resources/metadata.d.ts.map +1 -0
- package/dist/resources/metadata.js +150 -0
- package/dist/resources/metadata.js.map +1 -0
- package/dist/resources/script-helpers.d.ts.map +1 -1
- package/dist/resources/script-helpers.js +3 -2
- package/dist/resources/script-helpers.js.map +1 -1
- package/dist/resources/store.d.ts.map +1 -1
- package/dist/resources/store.js +32 -17
- package/dist/resources/store.js.map +1 -1
- package/dist/scripts/call-agent.d.ts.map +1 -1
- package/dist/scripts/call-agent.js +3 -2
- package/dist/scripts/call-agent.js.map +1 -1
- package/dist/scripts/chat/search-chats.d.ts.map +1 -1
- package/dist/scripts/chat/search-chats.js +2 -1
- package/dist/scripts/chat/search-chats.js.map +1 -1
- package/dist/scripts/core-scripts.d.ts.map +1 -1
- package/dist/scripts/core-scripts.js +2 -0
- package/dist/scripts/core-scripts.js.map +1 -1
- package/dist/scripts/db/scoping.d.ts.map +1 -1
- package/dist/scripts/db/scoping.js +3 -2
- package/dist/scripts/db/scoping.js.map +1 -1
- package/dist/scripts/docs/index.d.ts +2 -0
- package/dist/scripts/docs/index.d.ts.map +1 -0
- package/dist/scripts/docs/index.js +4 -0
- package/dist/scripts/docs/index.js.map +1 -0
- package/dist/scripts/docs/search.d.ts +13 -0
- package/dist/scripts/docs/search.d.ts.map +1 -0
- package/dist/scripts/docs/search.js +130 -0
- package/dist/scripts/docs/search.js.map +1 -0
- package/dist/scripts/resources/delete-memory.d.ts +7 -0
- package/dist/scripts/resources/delete-memory.d.ts.map +1 -0
- package/dist/scripts/resources/delete-memory.js +49 -0
- package/dist/scripts/resources/delete-memory.js.map +1 -0
- package/dist/scripts/resources/delete.d.ts.map +1 -1
- package/dist/scripts/resources/delete.js +2 -1
- package/dist/scripts/resources/delete.js.map +1 -1
- package/dist/scripts/resources/index.d.ts.map +1 -1
- package/dist/scripts/resources/index.js +2 -0
- package/dist/scripts/resources/index.js.map +1 -1
- package/dist/scripts/resources/list.d.ts.map +1 -1
- package/dist/scripts/resources/list.js +2 -1
- package/dist/scripts/resources/list.js.map +1 -1
- package/dist/scripts/resources/migrate-learnings.d.ts.map +1 -1
- package/dist/scripts/resources/migrate-learnings.js +2 -1
- package/dist/scripts/resources/migrate-learnings.js.map +1 -1
- package/dist/scripts/resources/read.d.ts.map +1 -1
- package/dist/scripts/resources/read.js +2 -1
- package/dist/scripts/resources/read.js.map +1 -1
- package/dist/scripts/resources/save-memory.d.ts +9 -0
- package/dist/scripts/resources/save-memory.d.ts.map +1 -0
- package/dist/scripts/resources/save-memory.js +78 -0
- package/dist/scripts/resources/save-memory.js.map +1 -0
- package/dist/scripts/resources/write.d.ts.map +1 -1
- package/dist/scripts/resources/write.js +2 -1
- package/dist/scripts/resources/write.js.map +1 -1
- package/dist/scripts/utils.d.ts +10 -1
- package/dist/scripts/utils.d.ts.map +1 -1
- package/dist/scripts/utils.js +45 -2
- package/dist/scripts/utils.js.map +1 -1
- package/dist/server/action-discovery.d.ts +5 -0
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +51 -20
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/action-routes.d.ts.map +1 -1
- package/dist/server/action-routes.js +63 -57
- package/dist/server/action-routes.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +3 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +363 -48
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-discovery.d.ts.map +1 -1
- package/dist/server/agent-discovery.js +11 -23
- package/dist/server/agent-discovery.js.map +1 -1
- package/dist/server/agent-teams.d.ts.map +1 -1
- package/dist/server/agent-teams.js +2 -1
- package/dist/server/agent-teams.js.map +1 -1
- package/dist/server/agents-bundle.d.ts +33 -5
- package/dist/server/agents-bundle.d.ts.map +1 -1
- package/dist/server/agents-bundle.js +108 -64
- package/dist/server/agents-bundle.js.map +1 -1
- package/dist/server/auth.d.ts +1 -0
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +172 -60
- package/dist/server/auth.js.map +1 -1
- package/dist/server/better-auth-instance.d.ts.map +1 -1
- package/dist/server/better-auth-instance.js +202 -6
- package/dist/server/better-auth-instance.js.map +1 -1
- package/dist/server/builder-browser.d.ts +40 -0
- package/dist/server/builder-browser.d.ts.map +1 -0
- package/dist/server/builder-browser.js +166 -0
- package/dist/server/builder-browser.js.map +1 -0
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +152 -6
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/credential-provider.d.ts +37 -0
- package/dist/server/credential-provider.d.ts.map +1 -0
- package/dist/server/credential-provider.js +49 -0
- package/dist/server/credential-provider.js.map +1 -0
- package/dist/server/framework-request-handler.d.ts.map +1 -1
- package/dist/server/framework-request-handler.js +42 -3
- package/dist/server/framework-request-handler.js.map +1 -1
- package/dist/server/google-auth-plugin.js +1 -1
- package/dist/server/google-oauth.d.ts +1 -1
- package/dist/server/google-oauth.d.ts.map +1 -1
- package/dist/server/google-oauth.js +15 -10
- package/dist/server/google-oauth.js.map +1 -1
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +3 -0
- package/dist/server/index.js.map +1 -1
- package/dist/server/oauth-helpers.d.ts +1 -0
- package/dist/server/oauth-helpers.d.ts.map +1 -1
- package/dist/server/oauth-helpers.js +5 -4
- package/dist/server/oauth-helpers.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +94 -3
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/server/request-context.d.ts +20 -0
- package/dist/server/request-context.d.ts.map +1 -0
- package/dist/server/request-context.js +41 -0
- package/dist/server/request-context.js.map +1 -0
- package/dist/templates/default/.agents/skills/actions/SKILL.md +2 -1
- package/dist/templates/default/.agents/skills/security/SKILL.md +145 -40
- package/dist/templates/default/.agents/skills/storing-data/SKILL.md +7 -1
- package/dist/templates/default/_gitignore +1 -0
- package/dist/templates/default/app/root.tsx +4 -1
- package/dist/templates/workspace-core/AGENTS.md +62 -0
- package/dist/templates/workspace-core/actions/company-directory.ts +38 -0
- package/dist/templates/workspace-core/package.json +39 -0
- package/dist/templates/workspace-core/skills/company-policies/SKILL.md +42 -0
- package/dist/templates/workspace-core/src/client/AuthenticatedLayout.tsx +37 -0
- package/dist/templates/workspace-core/src/client/index.ts +26 -0
- package/dist/templates/workspace-core/src/credentials.ts +29 -0
- package/dist/templates/workspace-core/src/index.ts +21 -0
- package/dist/templates/workspace-core/src/server/agent-chat-plugin.ts +30 -0
- package/dist/templates/workspace-core/src/server/auth-plugin.ts +35 -0
- package/dist/templates/workspace-core/src/server/index.ts +22 -0
- package/dist/templates/workspace-core/tailwind.preset.ts +34 -0
- package/dist/templates/workspace-core/tsconfig.json +9 -0
- package/dist/templates/workspace-root/.env.example +37 -0
- package/dist/templates/workspace-root/README.md +62 -0
- package/dist/templates/workspace-root/_gitignore +23 -0
- package/dist/templates/workspace-root/package.json +18 -0
- package/dist/templates/workspace-root/pnpm-workspace.yaml +3 -0
- package/dist/templates/workspace-root/tsconfig.base.json +21 -0
- package/dist/vite/agents-bundle-plugin.d.ts.map +1 -1
- package/dist/vite/agents-bundle-plugin.js +65 -15
- package/dist/vite/agents-bundle-plugin.js.map +1 -1
- package/dist/vite/client.d.ts +16 -0
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +75 -0
- package/dist/vite/client.js.map +1 -1
- package/docs/content/a2a-protocol.md +223 -0
- package/docs/content/actions.md +129 -0
- package/docs/content/agent-mentions.md +171 -0
- package/docs/content/authentication.md +155 -0
- package/docs/content/cli-adapters.md +244 -0
- package/docs/content/client.md +175 -0
- package/docs/content/context-awareness.md +168 -0
- package/docs/content/creating-templates.md +311 -0
- package/docs/content/database.md +82 -0
- package/docs/content/deployment.md +180 -0
- package/docs/content/enterprise-workspace.md +235 -0
- package/docs/content/faq.md +101 -0
- package/docs/content/file-uploads.md +102 -0
- package/docs/content/frames.md +47 -0
- package/docs/content/getting-started.md +104 -0
- package/docs/content/integrations.md +198 -0
- package/docs/content/key-concepts.md +246 -0
- package/docs/content/mcp-clients.md +110 -0
- package/docs/content/mcp-protocol.md +168 -0
- package/docs/content/onboarding.md +107 -0
- package/docs/content/real-time-collaboration.md +185 -0
- package/docs/content/resources.md +277 -0
- package/docs/content/security.md +158 -0
- package/docs/content/server.md +200 -0
- package/docs/content/skills-guide.md +107 -0
- package/docs/content/what-is-agent-native.md +100 -0
- package/docs/content/workspace-management.md +224 -0
- package/package.json +12 -2
- package/src/templates/default/.agents/skills/actions/SKILL.md +2 -1
- package/src/templates/default/.agents/skills/security/SKILL.md +145 -40
- package/src/templates/default/.agents/skills/storing-data/SKILL.md +7 -1
- package/src/templates/default/_gitignore +1 -0
- package/src/templates/default/app/root.tsx +4 -1
- package/src/templates/workspace-core/AGENTS.md +62 -0
- package/src/templates/workspace-core/actions/company-directory.ts +38 -0
- package/src/templates/workspace-core/package.json +39 -0
- package/src/templates/workspace-core/skills/company-policies/SKILL.md +42 -0
- package/src/templates/workspace-core/src/client/AuthenticatedLayout.tsx +37 -0
- package/src/templates/workspace-core/src/client/index.ts +26 -0
- package/src/templates/workspace-core/src/credentials.ts +29 -0
- package/src/templates/workspace-core/src/index.ts +21 -0
- package/src/templates/workspace-core/src/server/agent-chat-plugin.ts +30 -0
- package/src/templates/workspace-core/src/server/auth-plugin.ts +35 -0
- package/src/templates/workspace-core/src/server/index.ts +22 -0
- package/src/templates/workspace-core/tailwind.preset.ts +34 -0
- package/src/templates/workspace-core/tsconfig.json +9 -0
- package/src/templates/workspace-root/.env.example +37 -0
- package/src/templates/workspace-root/README.md +62 -0
- package/src/templates/workspace-root/_gitignore +23 -0
- package/src/templates/workspace-root/package.json +18 -0
- package/src/templates/workspace-root/pnpm-workspace.yaml +3 -0
- package/src/templates/workspace-root/tsconfig.base.json +21 -0
- package/dist/templates/templates/default/.agents/skills/actions/SKILL.md +0 -142
- package/dist/templates/templates/default/.agents/skills/agent-engines/SKILL.md +0 -127
- package/dist/templates/templates/default/.agents/skills/capture-learnings/SKILL.md +0 -50
- package/dist/templates/templates/default/.agents/skills/create-skill/SKILL.md +0 -167
- package/dist/templates/templates/default/.agents/skills/delegate-to-agent/SKILL.md +0 -90
- package/dist/templates/templates/default/.agents/skills/frontend-design/SKILL.md +0 -69
- package/dist/templates/templates/default/.agents/skills/real-time-collab/SKILL.md +0 -183
- package/dist/templates/templates/default/.agents/skills/real-time-sync/SKILL.md +0 -112
- package/dist/templates/templates/default/.agents/skills/security/SKILL.md +0 -108
- package/dist/templates/templates/default/.agents/skills/self-modifying-code/SKILL.md +0 -79
- package/dist/templates/templates/default/.agents/skills/storing-data/SKILL.md +0 -110
- package/dist/templates/templates/default/.claude/settings.json +0 -100
- package/dist/templates/templates/default/.env.example +0 -5
- package/dist/templates/templates/default/.ignore +0 -0
- package/dist/templates/templates/default/.prettierrc +0 -5
- package/dist/templates/templates/default/AGENTS.md +0 -110
- package/dist/templates/templates/default/DEVELOPING.md +0 -117
- package/dist/templates/templates/default/_gitignore +0 -37
- package/dist/templates/templates/default/actions/hello.ts +0 -20
- package/dist/templates/templates/default/actions/navigate.ts +0 -53
- package/dist/templates/templates/default/actions/run.ts +0 -2
- package/dist/templates/templates/default/actions/view-screen.ts +0 -39
- package/dist/templates/templates/default/app/entry.client.tsx +0 -4
- package/dist/templates/templates/default/app/entry.server.tsx +0 -56
- package/dist/templates/templates/default/app/global.css +0 -95
- package/dist/templates/templates/default/app/lib/utils.ts +0 -1
- package/dist/templates/templates/default/app/root.tsx +0 -107
- package/dist/templates/templates/default/app/routes/_index.tsx +0 -62
- package/dist/templates/templates/default/app/routes.ts +0 -4
- package/dist/templates/templates/default/app/vite-env.d.ts +0 -6
- package/dist/templates/templates/default/components.json +0 -20
- package/dist/templates/templates/default/data/.gitkeep +0 -0
- package/dist/templates/templates/default/data/sync-config.json +0 -1
- package/dist/templates/templates/default/learnings.defaults.md +0 -5
- package/dist/templates/templates/default/learnings.md +0 -0
- package/dist/templates/templates/default/package.json +0 -46
- package/dist/templates/templates/default/postcss.config.js +0 -6
- package/dist/templates/templates/default/public/icon-180.svg +0 -4
- package/dist/templates/templates/default/public/icon-192.svg +0 -4
- package/dist/templates/templates/default/public/icon-512.svg +0 -4
- package/dist/templates/templates/default/public/manifest.json +0 -13
- package/dist/templates/templates/default/react-router.config.ts +0 -6
- package/dist/templates/templates/default/server/middleware/auth.ts +0 -15
- package/dist/templates/templates/default/server/plugins/.gitkeep +0 -0
- package/dist/templates/templates/default/server/routes/[...page].get.ts +0 -5
- package/dist/templates/templates/default/server/routes/api/hello.get.ts +0 -5
- package/dist/templates/templates/default/shared/api.ts +0 -6
- package/dist/templates/templates/default/ssr-entry.ts +0 -20
- package/dist/templates/templates/default/tailwind.config.ts +0 -7
- package/dist/templates/templates/default/tsconfig.json +0 -11
- package/dist/templates/templates/default/vite.config.ts +0 -6
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Key Concepts"
|
|
3
|
+
description: "How agent-native apps work: the four-area checklist, SQL database, agent chat bridge, polling sync, actions, context awareness, and portability."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Key Concepts
|
|
7
|
+
|
|
8
|
+
How agent-native apps work under the hood — the principles, the architecture, and why they're built this way.
|
|
9
|
+
|
|
10
|
+
## Why agent-native {#why-agent-native}
|
|
11
|
+
|
|
12
|
+
Teams today have four options for AI-powered work, and none of them are ideal:
|
|
13
|
+
|
|
14
|
+
1. **Chat apps** (Claude Projects, ChatGPT) — accessible but not built for structured workflows. No persistent UI, no dashboards, no team collaboration.
|
|
15
|
+
2. **Raw agent interfaces** (Claude Code, Cursor) — powerful but inaccessible to non-devs. No guardrails, no onboarding, no structured UI.
|
|
16
|
+
3. **Custom AI apps** — limited. The AI can't see what you see, can't react to what you click, and can't update the app itself. No conversation history, no rollback, no skills.
|
|
17
|
+
4. **Existing SaaS** (Amplitude, HubSpot, Google Slides) — bolting AI onto architectures that weren't designed for it. You can feel the seams.
|
|
18
|
+
|
|
19
|
+
Agent-native apps solve this by making the agent and the UI equal citizens of the same system. Think of it as Claude Code, but with buttons and visual interfaces. The agent can do anything the UI can do (via natural language), and the UI can trigger anything the agent can do (via buttons).
|
|
20
|
+
|
|
21
|
+
See [What Is Agent-Native?](/docs/what-is-agent-native) for the full vision and philosophy.
|
|
22
|
+
|
|
23
|
+
## The architecture {#the-architecture}
|
|
24
|
+
|
|
25
|
+
Every agent-native app is three things working together:
|
|
26
|
+
|
|
27
|
+
> **Agent** — Autonomous AI that reads data, writes data, runs actions, and modifies code. Customizable with skills and instructions.
|
|
28
|
+
>
|
|
29
|
+
> **Application** — Full React UI with dashboards, flows, and visualizations. Guided experiences your team can use.
|
|
30
|
+
>
|
|
31
|
+
> **Computer** — Database, browser, code execution. Agents work directly with SQL and tools — no MCPs needed.
|
|
32
|
+
|
|
33
|
+
Every app includes an embedded agent panel with chat and optional CLI terminal. Locally, you run `pnpm dev` and the agent is right there. In the cloud, Builder.io provides a managed frame with collaboration, visual editing, and managed infrastructure for teams.
|
|
34
|
+
|
|
35
|
+
Six rules govern the architecture:
|
|
36
|
+
|
|
37
|
+
1. **Data lives in SQL** — all app state lives in the database via Drizzle ORM
|
|
38
|
+
2. **All AI goes through the agent** — no inline LLM calls
|
|
39
|
+
3. **Actions for agent operations** — complex work runs as actions
|
|
40
|
+
4. **Polling keeps the UI in sync** — database changes sync via lightweight polling
|
|
41
|
+
5. **The agent can modify code** — the app evolves as you use it
|
|
42
|
+
6. **Application state in SQL** — ephemeral UI state lives in the database, readable by both agent and UI
|
|
43
|
+
|
|
44
|
+
## The four-area checklist {#four-area-checklist}
|
|
45
|
+
|
|
46
|
+
Every new feature must update all four areas. Skipping any one breaks the agent-native contract.
|
|
47
|
+
|
|
48
|
+
| Area | Description |
|
|
49
|
+
| ---------------- | -------------------------------------------------------------- |
|
|
50
|
+
| **1. UI** | Page, component, or dialog the user interacts with |
|
|
51
|
+
| **2. Action** | Agent-callable action in actions/ for the same operation |
|
|
52
|
+
| **3. Skills** | Update AGENTS.md and/or create a skill documenting the pattern |
|
|
53
|
+
| **4. App-State** | Navigation state, view-screen data, and navigate commands |
|
|
54
|
+
|
|
55
|
+
A feature with only UI is invisible to the agent. A feature with only actions is invisible to the user. A feature without app-state means the agent is blind to what the user is doing.
|
|
56
|
+
|
|
57
|
+
## Data in SQL {#data-in-sql}
|
|
58
|
+
|
|
59
|
+
All application state lives in a SQL database via Drizzle ORM. The framework supports multiple databases — SQLite, Postgres (Neon, Supabase), Turso, Cloudflare D1. Users configure `DATABASE_URL` to choose their database.
|
|
60
|
+
|
|
61
|
+
Core SQL stores are auto-created and available in every template:
|
|
62
|
+
|
|
63
|
+
- `application_state` — ephemeral UI state (navigation, drafts, selections)
|
|
64
|
+
- `settings` — persistent key-value config
|
|
65
|
+
- `oauth_tokens` — OAuth credentials
|
|
66
|
+
- `sessions` — auth sessions
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
// Drizzle schema for domain data
|
|
70
|
+
import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
|
|
71
|
+
|
|
72
|
+
export const forms = sqliteTable("forms", {
|
|
73
|
+
id: text("id").primaryKey(),
|
|
74
|
+
title: text("title").notNull(),
|
|
75
|
+
schema: text("schema").notNull(), // JSON
|
|
76
|
+
ownerEmail: text("owner_email"),
|
|
77
|
+
createdAt: integer("created_at").notNull(),
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// Core actions for quick database access
|
|
81
|
+
pnpm action db-schema # show all tables
|
|
82
|
+
pnpm action db-query --sql "SELECT * FROM forms"
|
|
83
|
+
pnpm action db-exec --sql "INSERT INTO forms ..."
|
|
84
|
+
# Surgical find/replace on a large text column — sends a diff, not the whole value
|
|
85
|
+
pnpm action db-patch --table documents --column content \
|
|
86
|
+
--where "id='doc-1'" --find "old heading" --replace "new heading"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Agent chat bridge {#agent-chat-bridge}
|
|
90
|
+
|
|
91
|
+
The UI never calls an LLM directly. When a user clicks "Generate chart" or "Write summary", the UI sends a message to the agent via `postMessage`. The agent does the work — with full conversation history, skills, instructions, and the ability to iterate.
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
// In a React component — delegate AI work to the agent
|
|
95
|
+
import { sendToAgentChat } from "@agent-native/core";
|
|
96
|
+
|
|
97
|
+
sendToAgentChat({
|
|
98
|
+
message: "Generate a chart showing signups by source",
|
|
99
|
+
context: "Dashboard ID: main, date range: last 30 days",
|
|
100
|
+
submit: true,
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Why not call an LLM inline?
|
|
105
|
+
|
|
106
|
+
- **AI is non-deterministic.** You need conversation flow to give feedback and iterate — not one-shot buttons.
|
|
107
|
+
- **Context matters.** The agent has your full codebase, instructions, skills, and history. An inline call has none of that.
|
|
108
|
+
- **The agent can do more.** It can run actions, browse the web, modify code, and chain multiple steps together.
|
|
109
|
+
- **Headless execution.** Because everything goes through the agent, any app can be driven entirely from Slack, Telegram, or another agent via [A2A](/docs/a2a-protocol).
|
|
110
|
+
|
|
111
|
+
## Actions system {#actions-system}
|
|
112
|
+
|
|
113
|
+
When the agent needs to do something complex — call an API, process data, query the database — it runs an action. Actions are TypeScript files in `actions/` that export a default async function:
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
// actions/fetch-data.ts
|
|
117
|
+
import { parseArgs } from "@agent-native/core";
|
|
118
|
+
|
|
119
|
+
export default async function fetchData(args: string[]) {
|
|
120
|
+
const { source } = parseArgs(args);
|
|
121
|
+
const res = await fetch(`https://api.example.com/${source}`);
|
|
122
|
+
const data = await res.json();
|
|
123
|
+
console.log(JSON.stringify(data, null, 2));
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Agent runs actions via CLI
|
|
129
|
+
pnpm action fetch-data --source=signups
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
This means anything the UI can do, the agent can do — and vice versa. The UI calls `POST /api/fetch-data`, the agent calls `pnpm action fetch-data`. Same logic, same results, different entry points.
|
|
133
|
+
|
|
134
|
+
## Polling sync {#polling-sync}
|
|
135
|
+
|
|
136
|
+
Database changes are synced to the UI via lightweight polling. When the agent writes to the database (application state, settings, or domain data), a version counter increments. The client `useDbSync()` hook (formerly `useFileWatcher`) polls `/_agent-native/poll` every 2 seconds and invalidates React Query caches when changes are detected.
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
// Client: invalidate caches on database changes
|
|
140
|
+
import { useDbSync } from "@agent-native/core";
|
|
141
|
+
|
|
142
|
+
useDbSync({
|
|
143
|
+
queryClient,
|
|
144
|
+
queryKeys: ["app-state", "settings", "forms"],
|
|
145
|
+
});
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The flow is:
|
|
149
|
+
|
|
150
|
+
1. Agent runs an action that writes to the database
|
|
151
|
+
2. Version counter increments
|
|
152
|
+
3. `useDbSync` detects the new version on next poll
|
|
153
|
+
4. React Query caches are invalidated
|
|
154
|
+
5. Components re-fetch and render the new data
|
|
155
|
+
|
|
156
|
+
This works in all deployment environments — including serverless and edge — because it uses the database, not in-memory state or file system watchers.
|
|
157
|
+
|
|
158
|
+
## Frames {#frames}
|
|
159
|
+
|
|
160
|
+
Agent-native apps include an embedded agent panel that provides the AI agent alongside the app UI. This is what makes the architecture work: the agent needs a computer (database, browser, code execution), and the app needs the agent for AI work.
|
|
161
|
+
|
|
162
|
+
> **Embedded Agent Panel** — Chat and optional CLI terminal built into every app. Supports Claude Code, Codex, Gemini, OpenCode, and Builder.io. Runs locally. Free and open source.
|
|
163
|
+
>
|
|
164
|
+
> **Cloud** — Deploy to any cloud with real-time collaboration, visual editing, roles and permissions. Best for teams.
|
|
165
|
+
|
|
166
|
+
## Context awareness {#context-awareness}
|
|
167
|
+
|
|
168
|
+
The agent always knows what the user is looking at. The UI writes a `navigation` key to application-state on every route change. The agent reads it via the `view-screen` action before acting.
|
|
169
|
+
|
|
170
|
+
See [Context Awareness](/docs/context-awareness) for the full pattern: navigation state, view-screen, navigate commands, and jitter prevention.
|
|
171
|
+
|
|
172
|
+
## APIs & CLIs, not MCPs {#apis-and-clis}
|
|
173
|
+
|
|
174
|
+
Agent-native apps can work with MCP servers, but the architecture leans heavily on something more standard: **regular APIs and CLIs accessed through code execution**. Agents are great at writing code that calls `fetch()` or runs a CLI command — no special protocol needed.
|
|
175
|
+
|
|
176
|
+
- **No wrapper layer.** Call APIs directly with `fetch()` or use official SDKs.
|
|
177
|
+
- **Any CLI works.** `ffmpeg`, `gh`, `aws`, `gcloud` — if it runs in a terminal, the agent can use it.
|
|
178
|
+
- **Code is the protocol.** TypeScript actions are more expressive than any tool schema.
|
|
179
|
+
- **MCP is additive.** Use MCP servers alongside actions if you want, but they're not required.
|
|
180
|
+
|
|
181
|
+
## Agent modifies code {#agent-modifies-code}
|
|
182
|
+
|
|
183
|
+
This is a feature, not a bug. The agent can safely edit the app's source code: components, routes, styles, actions.
|
|
184
|
+
|
|
185
|
+
There's no shared codebase to break. You own the app, and the agent evolves it for you over time:
|
|
186
|
+
|
|
187
|
+
1. Fork a template (e.g. the analytics template)
|
|
188
|
+
2. Customize it by asking the agent
|
|
189
|
+
3. "Add a new chart type for cohort analysis" — the agent builds it
|
|
190
|
+
4. "Connect to our Stripe account" — the agent writes the integration
|
|
191
|
+
5. Your app keeps improving without manual development
|
|
192
|
+
|
|
193
|
+
## Database agnostic {#database-agnostic}
|
|
194
|
+
|
|
195
|
+
The framework supports every Drizzle-supported database. Never write SQL that only works on one dialect.
|
|
196
|
+
|
|
197
|
+
- **SQLite** — local dev fallback when `DATABASE_URL` is unset
|
|
198
|
+
- **Neon Postgres** — common in both dev and production
|
|
199
|
+
- **Turso** (libSQL) — edge-friendly SQLite-compatible
|
|
200
|
+
- **Supabase Postgres**
|
|
201
|
+
- **Cloudflare D1**
|
|
202
|
+
- **Plain Postgres**
|
|
203
|
+
|
|
204
|
+
Use the framework helpers for dialect-agnostic SQL:
|
|
205
|
+
|
|
206
|
+
```ts
|
|
207
|
+
import { getDbExec, isPostgres, intType } from "@agent-native/core/db/client";
|
|
208
|
+
|
|
209
|
+
// getDbExec() auto-converts ? params to $1 for Postgres
|
|
210
|
+
const client = getDbExec();
|
|
211
|
+
await client.execute({
|
|
212
|
+
sql: "SELECT * FROM forms WHERE owner_email = ?",
|
|
213
|
+
args: [email],
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// Branch when syntax differs
|
|
217
|
+
const upsert = isPostgres()
|
|
218
|
+
? "INSERT INTO settings (key, value) VALUES ($1, $2) ON CONFLICT (key) DO UPDATE SET value = $2"
|
|
219
|
+
: "INSERT OR REPLACE INTO settings (key, value) VALUES (?, ?)";
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Hosting agnostic {#hosting-agnostic}
|
|
223
|
+
|
|
224
|
+
The server runs on Nitro, which compiles to any deployment target:
|
|
225
|
+
|
|
226
|
+
- Node.js — local dev, traditional servers
|
|
227
|
+
- Cloudflare Workers/Pages
|
|
228
|
+
- Netlify Functions/Edge
|
|
229
|
+
- Vercel Serverless/Edge
|
|
230
|
+
- Deno Deploy
|
|
231
|
+
- AWS Lambda
|
|
232
|
+
- Bun
|
|
233
|
+
|
|
234
|
+
Never use Node-specific APIs (`fs`, `child_process`, `path`) in server routes or plugins. These don't exist in Workers/edge environments. Actions in `actions/` run in Node.js and can use Node APIs freely.
|
|
235
|
+
|
|
236
|
+
Never assume a persistent server process. Serverless and edge environments are stateless — no in-memory caches, no long-lived connections. Use the SQL database for all state.
|
|
237
|
+
|
|
238
|
+
## Deep dives {#deep-dives}
|
|
239
|
+
|
|
240
|
+
For detailed guidance on specific patterns:
|
|
241
|
+
|
|
242
|
+
- [What Is Agent-Native?](/docs/what-is-agent-native) — the vision and philosophy
|
|
243
|
+
- [Context Awareness](/docs/context-awareness) — navigation state, view-screen, navigate commands
|
|
244
|
+
- [Skills Guide](/docs/skills-guide) — framework skills, domain skills, creating custom skills
|
|
245
|
+
- [A2A Protocol](/docs/a2a-protocol) — agent-to-agent communication
|
|
246
|
+
- [Enterprise Workspace](/docs/enterprise-workspace) — host many apps in one monorepo with shared auth, skills, components, and credentials
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MCP Clients"
|
|
3
|
+
description: "Connect your agent-native app to local MCP servers (claude-in-chrome, filesystem, playwright, etc) so the agent gains their tools."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# MCP Clients
|
|
7
|
+
|
|
8
|
+
Agent-native apps can also act as MCP **clients** — connecting to locally installed MCP servers and exposing their tools to the agent chat. This is the symmetric counterpart to the [MCP Protocol](./mcp-protocol.md) (which makes your app an MCP server).
|
|
9
|
+
|
|
10
|
+
With one config file, every agent-native app in your workspace gains access to tools provided by MCP servers on your machine: `claude-in-chrome` for browser automation, `@modelcontextprotocol/server-filesystem` for reading files, `@modelcontextprotocol/server-playwright` for browser testing, and anything else that speaks MCP.
|
|
11
|
+
|
|
12
|
+
## Adding a local MCP server {#adding-a-server}
|
|
13
|
+
|
|
14
|
+
Create `mcp.config.json` at your workspace root (or at an individual app root — workspace root wins when both exist):
|
|
15
|
+
|
|
16
|
+
```jsonc
|
|
17
|
+
{
|
|
18
|
+
"$schema": "https://agent-native.com/schema/mcp.config.json",
|
|
19
|
+
"servers": {
|
|
20
|
+
"claude-in-chrome": {
|
|
21
|
+
"command": "claude-in-chrome-mcp",
|
|
22
|
+
"args": [],
|
|
23
|
+
"env": { "LOG_LEVEL": "info" },
|
|
24
|
+
},
|
|
25
|
+
"playwright": {
|
|
26
|
+
"command": "npx",
|
|
27
|
+
"args": ["-y", "@modelcontextprotocol/server-playwright"],
|
|
28
|
+
},
|
|
29
|
+
"filesystem": {
|
|
30
|
+
"command": "npx",
|
|
31
|
+
"args": [
|
|
32
|
+
"-y",
|
|
33
|
+
"@modelcontextprotocol/server-filesystem",
|
|
34
|
+
"/Users/me/projects",
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
On next app start you'll see:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
[mcp-client] loaded config from /path/to/mcp.config.json (3 server(s))
|
|
45
|
+
[mcp-client] connected to claude-in-chrome: 12 tools
|
|
46
|
+
[mcp-client] connected to playwright: 9 tools
|
|
47
|
+
[mcp-client] connected to filesystem: 4 tools
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The tools are registered in the agent's tool registry with the prefix `mcp__<server-id>__<tool-name>` so they can't collide with your template's actions.
|
|
51
|
+
|
|
52
|
+
## Config precedence {#precedence}
|
|
53
|
+
|
|
54
|
+
MCP configuration is resolved in this order, first match wins:
|
|
55
|
+
|
|
56
|
+
1. **Workspace root `mcp.config.json`** — detected via `agent-native.workspaceCore` in `package.json`. Shared across every app in the workspace.
|
|
57
|
+
2. **App-root `mcp.config.json`** — per-app override if you don't want an MCP server available in every app.
|
|
58
|
+
3. **`MCP_SERVERS` env var** — JSON string with the same shape, for CI/production where a file doesn't make sense.
|
|
59
|
+
|
|
60
|
+
## Production deploys: `MCP_SERVERS` {#mcp-servers-env}
|
|
61
|
+
|
|
62
|
+
For production deploys set the full config shape (or the inner server map) as an environment variable:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
MCP_SERVERS='{"servers":{"playwright":{"command":"npx","args":["-y","@modelcontextprotocol/server-playwright"]}}}'
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
MCP tools only activate in Node runtimes — Cloudflare Workers and other edge targets silently skip MCP and continue with the rest of the app working normally.
|
|
69
|
+
|
|
70
|
+
## Auto-detect: `claude-in-chrome` {#autodetect}
|
|
71
|
+
|
|
72
|
+
If you have **no** `mcp.config.json` and the `claude-in-chrome-mcp` binary is on `PATH` (or in the well-known install location `~/.claude-in-chrome/bin/claude-in-chrome-mcp`), agent-native auto-registers it as a default MCP server. Set `AGENT_NATIVE_DISABLE_MCP_AUTODETECT=1` to opt out.
|
|
73
|
+
|
|
74
|
+
This means users who've installed the claude-in-chrome extension get browser control across every agent-native app they open with no config changes.
|
|
75
|
+
|
|
76
|
+
## Status route {#status-route}
|
|
77
|
+
|
|
78
|
+
Every app exposes `GET /_agent-native/mcp/status` for tooling and onboarding:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"configuredServers": ["claude-in-chrome", "playwright"],
|
|
83
|
+
"connectedServers": ["claude-in-chrome", "playwright"],
|
|
84
|
+
"totalTools": 21,
|
|
85
|
+
"tools": [
|
|
86
|
+
{
|
|
87
|
+
"source": "claude-in-chrome",
|
|
88
|
+
"name": "mcp__claude-in-chrome__navigate",
|
|
89
|
+
"description": "Navigate the browser to a URL"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"errors": {}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Use this to build "claude-in-chrome detected — your agent can now drive Chrome" onboarding hints, or debug MCP connection problems.
|
|
97
|
+
|
|
98
|
+
## Failure modes {#failures}
|
|
99
|
+
|
|
100
|
+
Individual MCP server failures never take down the agent:
|
|
101
|
+
|
|
102
|
+
- A misconfigured `command` → the server is skipped, its error appears in `/mcp/status` under `errors.<server-id>`, and every other server continues to work.
|
|
103
|
+
- The MCP SDK is missing from `node_modules` → all MCP functionality is skipped with a warning; agent chat keeps working with zero MCP tools.
|
|
104
|
+
- Running in an edge runtime → MCP client is a no-op.
|
|
105
|
+
|
|
106
|
+
Agent-native will always boot; broken MCP configuration just means fewer tools.
|
|
107
|
+
|
|
108
|
+
## Security {#security}
|
|
109
|
+
|
|
110
|
+
MCP tools run on your machine with whatever permissions the spawned process has. Treat `mcp.config.json` like any other list of executables you're willing to let the agent drive. Tools from MCP servers appear in the agent's tool-use loop just like your template's own actions, so make sure you trust every server you configure.
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MCP Protocol"
|
|
3
|
+
description: "Expose your agent-native app as a remote MCP server so Claude Code, Cursor, and other AI tools can call your app's actions directly."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# MCP Protocol
|
|
7
|
+
|
|
8
|
+
Every agent-native app automatically exposes a remote MCP (Model Context Protocol) server. This lets external AI tools like Claude Code, Cursor, and Windsurf discover and call your app's actions directly — no extra code needed.
|
|
9
|
+
|
|
10
|
+
## Overview {#overview}
|
|
11
|
+
|
|
12
|
+
MCP is the standard protocol for connecting AI tools to external capabilities. When you deploy an agent-native app, it auto-mounts an MCP endpoint alongside the existing A2A endpoint. Any MCP-compatible client can connect and use your app's tools.
|
|
13
|
+
|
|
14
|
+
Key concepts:
|
|
15
|
+
|
|
16
|
+
- **Auto-mounted** — every app gets `/_agent-native/mcp` for free, no setup required
|
|
17
|
+
- **Streamable HTTP** — uses the modern MCP transport over standard HTTP (POST + SSE)
|
|
18
|
+
- **Same actions** — the exact same action registry that powers agent chat and A2A
|
|
19
|
+
- **`ask-agent` tool** — a meta-tool that delegates to the full agent loop for complex tasks
|
|
20
|
+
- **Bearer auth** — uses `ACCESS_TOKEN` or `A2A_SECRET` for authentication
|
|
21
|
+
|
|
22
|
+
## MCP vs A2A {#mcp-vs-a2a}
|
|
23
|
+
|
|
24
|
+
Both protocols are auto-mounted. Use whichever fits your use case:
|
|
25
|
+
|
|
26
|
+
| | MCP | A2A |
|
|
27
|
+
| ------------------ | ------------------------------------- | -------------------------------------------- |
|
|
28
|
+
| **Best for** | External tools calling your app | Agent-to-agent communication |
|
|
29
|
+
| **Protocol** | MCP Streamable HTTP | JSON-RPC 2.0 |
|
|
30
|
+
| **Tool discovery** | `tools/list` | Agent card at `/.well-known/agent-card.json` |
|
|
31
|
+
| **Endpoint** | `/_agent-native/mcp` | `/_agent-native/a2a` |
|
|
32
|
+
| **Supported by** | Claude Code, Cursor, Windsurf, Cowork | Other agent-native apps |
|
|
33
|
+
| **Execution** | Direct tool calls (no extra LLM) | Full agent loop (LLM reasoning) |
|
|
34
|
+
|
|
35
|
+
You can also use the `ask-agent` MCP tool to get the best of both worlds — call it from Claude Code and let your app's agent reason through complex tasks.
|
|
36
|
+
|
|
37
|
+
## Connecting from Claude Code {#claude-code}
|
|
38
|
+
|
|
39
|
+
Add your app as a remote MCP server in Claude Code's config:
|
|
40
|
+
|
|
41
|
+
```jsonc
|
|
42
|
+
// ~/.claude/mcp_servers.json
|
|
43
|
+
{
|
|
44
|
+
"mail": {
|
|
45
|
+
"type": "url",
|
|
46
|
+
"url": "https://mail.example.com/_agent-native/mcp",
|
|
47
|
+
"headers": {
|
|
48
|
+
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Then in Claude Code, you can use your app's tools naturally:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
> draft an email to John about the Q3 report
|
|
58
|
+
|
|
59
|
+
Claude Code calls: draft-email(to: "john@example.com", subject: "Q3 Report", body: "...")
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Connecting from other MCP clients {#other-clients}
|
|
63
|
+
|
|
64
|
+
Any MCP client that supports Streamable HTTP transport can connect. The endpoint is:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
POST https://your-app.example.com/_agent-native/mcp
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The server supports the standard MCP handshake: `initialize` → `initialized` → `tools/list` → `tools/call`.
|
|
71
|
+
|
|
72
|
+
## Tools {#tools}
|
|
73
|
+
|
|
74
|
+
All actions registered in your app are exposed as MCP tools. The mapping is direct:
|
|
75
|
+
|
|
76
|
+
| Action property | MCP tool property |
|
|
77
|
+
| ------------------ | ----------------- |
|
|
78
|
+
| `tool.description` | `description` |
|
|
79
|
+
| `tool.parameters` | `inputSchema` |
|
|
80
|
+
| Action name | Tool name |
|
|
81
|
+
|
|
82
|
+
### The `ask-agent` tool {#ask-agent}
|
|
83
|
+
|
|
84
|
+
In addition to individual action tools, every MCP server includes an `ask-agent` meta-tool. This sends a natural-language message to the app's AI agent and returns the response.
|
|
85
|
+
|
|
86
|
+
Use `ask-agent` for complex tasks that benefit from the agent's reasoning and context:
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"name": "ask-agent",
|
|
91
|
+
"arguments": {
|
|
92
|
+
"message": "Draft a follow-up email to the Q3 planning thread with John, summarizing the action items we discussed"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The agent runs the same loop as the interactive chat — it can call multiple tools, reason about context, and produce a thoughtful response.
|
|
98
|
+
|
|
99
|
+
## Authentication {#authentication}
|
|
100
|
+
|
|
101
|
+
The MCP endpoint uses the same auth as the rest of the app:
|
|
102
|
+
|
|
103
|
+
| Env var | How it works |
|
|
104
|
+
| --------------- | ----------------------------------------------------------- |
|
|
105
|
+
| `ACCESS_TOKEN` | Bearer token — client sends `Authorization: Bearer <token>` |
|
|
106
|
+
| `ACCESS_TOKENS` | Comma-separated list of valid tokens |
|
|
107
|
+
| `A2A_SECRET` | JWT-based auth — tokens are verified cryptographically |
|
|
108
|
+
| _(none set)_ | No auth required (dev mode) |
|
|
109
|
+
|
|
110
|
+
In production, set `ACCESS_TOKEN` or `A2A_SECRET` to secure the endpoint. In development (no auth env vars configured), all requests are allowed.
|
|
111
|
+
|
|
112
|
+
## Custom MCP setup {#custom-setup}
|
|
113
|
+
|
|
114
|
+
The MCP server is auto-mounted by the agent-chat plugin. For most apps, no configuration is needed. If you need custom behavior, you can mount it manually in a server plugin:
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
// server/plugins/mcp.ts
|
|
118
|
+
import { mountMCP } from "@agent-native/core/mcp";
|
|
119
|
+
import { autoDiscoverActions } from "@agent-native/core/server";
|
|
120
|
+
|
|
121
|
+
export default defineNitroPlugin(async (nitro) => {
|
|
122
|
+
const actions = await autoDiscoverActions(import.meta.url);
|
|
123
|
+
|
|
124
|
+
mountMCP(nitro.h3App, {
|
|
125
|
+
name: "My App",
|
|
126
|
+
description: "Custom MCP server",
|
|
127
|
+
actions,
|
|
128
|
+
// Optional: provide ask-agent handler
|
|
129
|
+
askAgent: async (message) => {
|
|
130
|
+
// Your custom agent logic
|
|
131
|
+
return "Response";
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Example: analytics from Claude Code {#example}
|
|
138
|
+
|
|
139
|
+
You have a deployed analytics app at `analytics.example.com`. From Claude Code:
|
|
140
|
+
|
|
141
|
+
```jsonc
|
|
142
|
+
// ~/.claude/mcp_servers.json
|
|
143
|
+
{
|
|
144
|
+
"analytics": {
|
|
145
|
+
"type": "url",
|
|
146
|
+
"url": "https://analytics.example.com/_agent-native/mcp",
|
|
147
|
+
"headers": { "Authorization": "Bearer sk-analytics-token" },
|
|
148
|
+
},
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Now in Claude Code:
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
> How many signups did we get last week?
|
|
156
|
+
|
|
157
|
+
Claude Code calls: run-query(sql: "SELECT count(*) FROM signups WHERE created_at > now() - interval '7 days'")
|
|
158
|
+
→ "1,247 signups last week"
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
For more complex analysis:
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
> Ask the analytics agent to prepare a full breakdown of Q3 signups by source, with trends
|
|
165
|
+
|
|
166
|
+
Claude Code calls: ask-agent(message: "Prepare a full breakdown of Q3 signups by source, with trends")
|
|
167
|
+
→ The analytics agent runs multiple queries, reasons about the data, and returns a formatted report
|
|
168
|
+
```
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Onboarding
|
|
2
|
+
|
|
3
|
+
The framework-level onboarding system gives every template a shared setup
|
|
4
|
+
experience in the agent chat sidebar. Users see a checklist of setup steps,
|
|
5
|
+
each with one or more ways to complete it — paste an API key, connect
|
|
6
|
+
Builder, or ask the agent to do it for them.
|
|
7
|
+
|
|
8
|
+
The system is **auto-mounted**. Templates don't need to wire anything to get
|
|
9
|
+
the three built-in steps (LLM, database, auth). To add app-specific steps
|
|
10
|
+
(Gmail, Slack, Notion, etc.), call `registerOnboardingStep()` from a server
|
|
11
|
+
plugin.
|
|
12
|
+
|
|
13
|
+
## Auto-mounted routes
|
|
14
|
+
|
|
15
|
+
All routes live under `/_agent-native/onboarding/`:
|
|
16
|
+
|
|
17
|
+
| Route | Purpose |
|
|
18
|
+
| --------------------------------------------------- | --------------------------------- |
|
|
19
|
+
| `GET /_agent-native/onboarding/steps` | List steps with completion status |
|
|
20
|
+
| `POST /_agent-native/onboarding/steps/:id/complete` | Mark step complete (override) |
|
|
21
|
+
| `POST /_agent-native/onboarding/dismiss` | Dismiss the onboarding banner |
|
|
22
|
+
| `POST /_agent-native/onboarding/reopen` | Clear dismissal (re-show panel) |
|
|
23
|
+
| `GET /_agent-native/onboarding/dismissed` | Read dismissal + allComplete flag |
|
|
24
|
+
|
|
25
|
+
## Adding a step from a template
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
// server/plugins/my-onboarding.ts
|
|
29
|
+
import { defineNitroPlugin } from "@agent-native/core/server";
|
|
30
|
+
import { registerOnboardingStep } from "@agent-native/core/onboarding";
|
|
31
|
+
|
|
32
|
+
export default defineNitroPlugin(() => {
|
|
33
|
+
registerOnboardingStep({
|
|
34
|
+
id: "gmail",
|
|
35
|
+
order: 100,
|
|
36
|
+
title: "Connect Gmail",
|
|
37
|
+
description: "Grant read/send access so the agent can work with email.",
|
|
38
|
+
methods: [
|
|
39
|
+
{
|
|
40
|
+
id: "oauth",
|
|
41
|
+
kind: "link",
|
|
42
|
+
primary: true,
|
|
43
|
+
label: "Sign in with Google",
|
|
44
|
+
payload: {
|
|
45
|
+
url: "/_agent-native/google/auth-url?scope=mail",
|
|
46
|
+
external: false,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "delegate",
|
|
51
|
+
kind: "agent-task",
|
|
52
|
+
label: "Let the agent set it up",
|
|
53
|
+
badge: "beta",
|
|
54
|
+
payload: {
|
|
55
|
+
prompt: "Walk me through connecting Gmail. Set env vars as needed.",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
isComplete: () => !!process.env.GMAIL_REFRESH_TOKEN,
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Method kinds
|
|
65
|
+
|
|
66
|
+
| Kind | Payload | Use for |
|
|
67
|
+
| ------------------ | ------------------------- | ----------------------------------------- |
|
|
68
|
+
| `link` | `{ url, external? }` | Send user to an OAuth flow or docs page |
|
|
69
|
+
| `form` | `{ fields, writeScope? }` | Collect env vars (keys, secrets, URLs) |
|
|
70
|
+
| `builder-cli-auth` | `{ scope: "browser" }` | Connect Builder (unlocks shared infra) |
|
|
71
|
+
| `agent-task` | `{ prompt }` | Send a prompt to the agent chat to handle |
|
|
72
|
+
|
|
73
|
+
The `primary: true` flag marks a method as the big CTA for its step.
|
|
74
|
+
|
|
75
|
+
## Built-in steps
|
|
76
|
+
|
|
77
|
+
| ID | Required | Description |
|
|
78
|
+
| ---------- | -------- | --------------------------------------------- |
|
|
79
|
+
| `llm` | yes | ANTHROPIC_API_KEY or Builder connection |
|
|
80
|
+
| `database` | no | SQLite default or a DATABASE_URL for Postgres |
|
|
81
|
+
| `auth` | no | Local dev mode, Google OAuth, or access token |
|
|
82
|
+
|
|
83
|
+
Any of these can be overridden by re-registering with the same `id` after the
|
|
84
|
+
defaults load.
|
|
85
|
+
|
|
86
|
+
## Client usage
|
|
87
|
+
|
|
88
|
+
The panel is already inside `<AgentPanel>`. To build a custom layout:
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
import {
|
|
92
|
+
OnboardingPanel,
|
|
93
|
+
OnboardingBanner,
|
|
94
|
+
useOnboarding,
|
|
95
|
+
} from "@agent-native/core/client/onboarding";
|
|
96
|
+
|
|
97
|
+
function MySidebar() {
|
|
98
|
+
const { allComplete, dismissed, currentStepId } = useOnboarding();
|
|
99
|
+
if (allComplete || dismissed) return <Chat />;
|
|
100
|
+
return (
|
|
101
|
+
<>
|
|
102
|
+
<OnboardingPanel />
|
|
103
|
+
<Chat />
|
|
104
|
+
</>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
```
|