@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,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "File Uploads"
|
|
3
|
+
description: "Configure file upload storage — SQL fallback for dev, Builder.io or custom providers for production."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# File Uploads
|
|
7
|
+
|
|
8
|
+
The framework provides a file upload abstraction that routes uploads through a configurable provider. Templates call `uploadFile()` and get back a URL — the storage backend is swappable without changing application code.
|
|
9
|
+
|
|
10
|
+
## How It Works {#how-it-works}
|
|
11
|
+
|
|
12
|
+
Upload requests go to `POST /_agent-native/file-upload`, which dispatches to the active provider. You can check which provider is configured at `GET /_agent-native/file-upload/status`.
|
|
13
|
+
|
|
14
|
+
The provider resolution order is:
|
|
15
|
+
|
|
16
|
+
1. **User-registered providers** — custom providers registered via `registerFileUploadProvider()`
|
|
17
|
+
2. **Builder.io provider** — built-in, activates automatically when Builder.io is connected
|
|
18
|
+
3. **SQL fallback** — stores files as base64 in the database (fine for dev, not for production)
|
|
19
|
+
|
|
20
|
+
## Default: SQL Fallback {#sql-fallback}
|
|
21
|
+
|
|
22
|
+
When no provider is configured, files are stored as base64 data in the SQL database via the resources system. This works out of the box for local development but is not recommended for production — large files bloat the database and there's no CDN.
|
|
23
|
+
|
|
24
|
+
A one-time warning is logged when the fallback is used.
|
|
25
|
+
|
|
26
|
+
## Builder.io Hosting {#builder-hosting}
|
|
27
|
+
|
|
28
|
+
When your app is connected to Builder.io, file uploads are automatically routed to Builder's asset hosting. Files are served from a CDN with no configuration needed. This is the recommended production setup.
|
|
29
|
+
|
|
30
|
+
## Custom Providers {#custom-providers}
|
|
31
|
+
|
|
32
|
+
Register a custom provider in a server plugin to use any storage backend (S3, Cloudflare R2, GCS, etc.):
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
// server/plugins/file-upload.ts
|
|
36
|
+
import { registerFileUploadProvider } from "@agent-native/core/file-upload";
|
|
37
|
+
|
|
38
|
+
export default defineNitroPlugin(() => {
|
|
39
|
+
registerFileUploadProvider({
|
|
40
|
+
id: "s3",
|
|
41
|
+
name: "Amazon S3",
|
|
42
|
+
isConfigured: () => !!process.env.S3_BUCKET,
|
|
43
|
+
upload: async ({ data, filename, mimeType }) => {
|
|
44
|
+
const key = `uploads/${Date.now()}-${filename}`;
|
|
45
|
+
await s3Client.putObject({
|
|
46
|
+
Bucket: process.env.S3_BUCKET!,
|
|
47
|
+
Key: key,
|
|
48
|
+
Body: data,
|
|
49
|
+
ContentType: mimeType,
|
|
50
|
+
});
|
|
51
|
+
return {
|
|
52
|
+
url: `https://${process.env.S3_BUCKET}.s3.amazonaws.com/${key}`,
|
|
53
|
+
provider: "s3",
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Upload API {#upload-api}
|
|
61
|
+
|
|
62
|
+
The `FileUploadProvider` interface:
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
interface FileUploadProvider {
|
|
66
|
+
id: string; // Unique id, e.g. "s3"
|
|
67
|
+
name: string; // Human-readable name
|
|
68
|
+
isConfigured: () => boolean; // True when ready (env vars set, etc.)
|
|
69
|
+
upload: (input: FileUploadInput) => Promise<FileUploadResult>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
interface FileUploadInput {
|
|
73
|
+
data: Uint8Array | Buffer; // File contents
|
|
74
|
+
filename?: string; // Original filename
|
|
75
|
+
mimeType?: string; // MIME type, e.g. "image/png"
|
|
76
|
+
ownerEmail?: string; // For per-user scoping in fallback
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface FileUploadResult {
|
|
80
|
+
url: string; // Public URL for the uploaded file
|
|
81
|
+
id?: string; // Provider-specific id
|
|
82
|
+
provider: string; // Which provider handled it
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Use `uploadFile()` from `@agent-native/core/file-upload` in actions or server code:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
import { uploadFile } from "@agent-native/core/file-upload";
|
|
90
|
+
|
|
91
|
+
const result = await uploadFile({
|
|
92
|
+
data: fileBuffer,
|
|
93
|
+
filename: "photo.jpg",
|
|
94
|
+
mimeType: "image/jpeg",
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
if (result) {
|
|
98
|
+
// Provider handled it — result.url is the public URL
|
|
99
|
+
} else {
|
|
100
|
+
// No provider configured — handle SQL fallback yourself, or skip
|
|
101
|
+
}
|
|
102
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Frames"
|
|
3
|
+
description: "Embedded agent panel and cloud frame options for running AI agents alongside your app."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Frames
|
|
7
|
+
|
|
8
|
+
Agent-native apps run with an AI agent alongside the app UI. Locally, the agent panel is embedded directly in your app. In the cloud, Builder.io provides a managed frame with collaboration and visual editing.
|
|
9
|
+
|
|
10
|
+
## Embedded Agent Panel {#embedded-agent}
|
|
11
|
+
|
|
12
|
+
- Ships with `@agent-native/core` — no separate package needed
|
|
13
|
+
- Agent panel embedded directly in your app with chat and optional CLI terminal
|
|
14
|
+
- Supports multiple AI coding CLIs — switch between them from the settings panel
|
|
15
|
+
- Toggle between production mode (app tools only) and development mode (full filesystem, shell, and database access)
|
|
16
|
+
- Great for local development, self-hosted production, and OSS
|
|
17
|
+
|
|
18
|
+
## Supported CLIs {#supported-clis}
|
|
19
|
+
|
|
20
|
+
| CLI | Command | Key Flags |
|
|
21
|
+
| ----------- | ---------- | --------------------------------------------------- |
|
|
22
|
+
| Claude Code | `claude` | --dangerously-skip-permissions, --resume, --verbose |
|
|
23
|
+
| Codex | `codex` | --full-auto, --quiet |
|
|
24
|
+
| Gemini CLI | `gemini` | --sandbox |
|
|
25
|
+
| OpenCode | `opencode` | — |
|
|
26
|
+
| Builder.io | `builder` | — |
|
|
27
|
+
|
|
28
|
+
Switch between CLIs at any time from the agent panel settings. The terminal restarts with the selected CLI.
|
|
29
|
+
|
|
30
|
+
## [Builder.io Cloud](https://www.builder.io) {#cloud-frame}
|
|
31
|
+
|
|
32
|
+
- Runs in the cloud
|
|
33
|
+
- Real-time collaboration — multiple users can watch/interact simultaneously
|
|
34
|
+
- Visual editing, roles and permissions
|
|
35
|
+
- Parallel agent execution for faster iteration
|
|
36
|
+
- Great for team use
|
|
37
|
+
|
|
38
|
+
## How It Works {#how-it-works}
|
|
39
|
+
|
|
40
|
+
The framework provides type-safe APIs so you never deal with raw messaging:
|
|
41
|
+
|
|
42
|
+
1. **Agent chat** — use `sendToAgentChat()` to send messages to the agent
|
|
43
|
+
2. **Generation state** — use `useAgentChatGenerating()` to track when the agent is running
|
|
44
|
+
3. **File watching** — SSE endpoint keeps UI in sync when the agent modifies files
|
|
45
|
+
4. **Action system** — `pnpm action <name>` dispatches to callable actions
|
|
46
|
+
|
|
47
|
+
Your app code is identical regardless of how the agent is provided.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Getting Started"
|
|
3
|
+
description: "Pick a template, create your app, and start customizing it with AI."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Getting Started
|
|
7
|
+
|
|
8
|
+
The fastest way to get started is to pick a template and customize it. Templates are complete, production-ready apps — not starter kits. You get a working app in under a minute and start making it yours.
|
|
9
|
+
|
|
10
|
+
## Create Your Workspace {#create-your-app}
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npx @agent-native/core create my-platform
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The CLI shows a multi-select picker — pick as many templates as you want (Mail + Calendar + Forms, for example) and they all get scaffolded into the same workspace sharing auth, brand, and agent config. Then boot them all:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
cd my-platform
|
|
20
|
+
pnpm install
|
|
21
|
+
pnpm dev
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
That's it — you have every app running locally with an AI agent built in. Open the agent panel, ask it to do something, and watch it work.
|
|
25
|
+
|
|
26
|
+
Want a single app with no monorepo? Pass `--standalone`:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx @agent-native/core create my-app --standalone --template mail
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Need to add more apps later? From inside the workspace:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
agent-native add-app
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
From here, use your AI coding tool (Claude Code, Cursor, Windsurf, etc.) to customize it. The agent instructions in `AGENTS.md` are already set up so any tool understands the codebase. See [Enterprise Workspace](/docs/enterprise-workspace) for the full story on sharing auth, skills, components, and credentials across apps.
|
|
39
|
+
|
|
40
|
+
## Templates {#templates}
|
|
41
|
+
|
|
42
|
+
Each template is a complete app with UI, agent actions, database schema, and AI instructions ready to go:
|
|
43
|
+
|
|
44
|
+
| Template | Replaces |
|
|
45
|
+
| --------------------------------- | --------------------------- |
|
|
46
|
+
| [Mail](/templates/mail) | Superhuman, Gmail |
|
|
47
|
+
| [Calendar](/templates/calendar) | Google Calendar, Calendly |
|
|
48
|
+
| [Content](/templates/content) | Notion, Google Docs |
|
|
49
|
+
| [Slides](/templates/slides) | Google Slides, Pitch |
|
|
50
|
+
| [Video](/templates/video) | video editing |
|
|
51
|
+
| [Analytics](/templates/analytics) | Amplitude, Mixpanel, Looker |
|
|
52
|
+
|
|
53
|
+
Browse the [template gallery](/templates) for live demos and detailed feature lists.
|
|
54
|
+
|
|
55
|
+
## Project Structure {#project-structure}
|
|
56
|
+
|
|
57
|
+
Every agent-native app — whether from a template or from scratch — follows the same structure:
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
my-app/
|
|
61
|
+
app/ # React frontend (routes, components, hooks)
|
|
62
|
+
server/ # Nitro API server (routes, plugins)
|
|
63
|
+
actions/ # Agent-callable actions
|
|
64
|
+
.agents/ # Agent instructions and skills
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Templates add domain-specific code on top of this: database schemas in `server/db/`, API routes in `server/routes/api/`, and actions in `actions/`.
|
|
68
|
+
|
|
69
|
+
## Configuration {#configuration}
|
|
70
|
+
|
|
71
|
+
Templates come pre-configured. If you're starting from scratch, here are the config files:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
// vite.config.ts
|
|
75
|
+
import { defineConfig } from "@agent-native/core/vite";
|
|
76
|
+
export default defineConfig();
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
// tsconfig.json
|
|
81
|
+
{ "extends": "@agent-native/core/tsconfig.base.json" }
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
// tailwind.config.ts
|
|
86
|
+
import type { Config } from "tailwindcss";
|
|
87
|
+
import preset from "@agent-native/core/tailwind";
|
|
88
|
+
|
|
89
|
+
export default {
|
|
90
|
+
presets: [preset],
|
|
91
|
+
content: ["./app/**/*.{ts,tsx}"],
|
|
92
|
+
} satisfies Config;
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Architecture Principles {#architecture-principles}
|
|
96
|
+
|
|
97
|
+
These principles apply to all agent-native apps. Understanding them helps you customize templates or build from scratch:
|
|
98
|
+
|
|
99
|
+
1. **Agent + UI are equal partners** — Everything the UI can do, the agent can do, and vice versa. They share the same database and always stay in sync. You don't think about "the agent" and "the app" separately — you think about them together.
|
|
100
|
+
2. **Context-aware** — The agent always knows what you're looking at. If an email is open, it knows which one. If you select text and hit Cmd+I, it can act on just that selection.
|
|
101
|
+
3. **Skills-driven** — Core functionalities have instructions so the agent doesn't explore from scratch every time. When you add a feature, you update all four areas: UI, actions, skills/instructions, and application state.
|
|
102
|
+
4. **Inter-agent communication** — Agents can discover and call each other via the A2A protocol. Tag your analytics agent from the mail app to pull data into a draft.
|
|
103
|
+
5. **Fully portable** — Any SQL database Drizzle supports, any hosting backend Nitro supports, any AI coding tool. These are non-negotiable.
|
|
104
|
+
6. **Fork and customize** — Apps you clone and evolve. The agent can modify the app's own code — components, routes, styles, actions — so it gets better over time.
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Integrations"
|
|
3
|
+
description: "Connect your agent to Slack, Telegram, WhatsApp, and other messaging platforms."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Integrations
|
|
7
|
+
|
|
8
|
+
Connect your agent to messaging platforms so you can chat with it from Slack, Telegram, WhatsApp, and more. Same agent, same tools, same thread history.
|
|
9
|
+
|
|
10
|
+
## Overview {#overview}
|
|
11
|
+
|
|
12
|
+
Messaging integrations let users talk to their agent from the platforms they already use. Instead of opening the web UI, you send a message in Slack or Telegram and the agent responds right there. It has access to the same actions, the same database, and the same conversation history as the web chat.
|
|
13
|
+
|
|
14
|
+
Each integration works through webhooks. The messaging platform sends incoming messages to your app, the agent processes them, and the response is posted back. No polling, no long-lived connections — just standard HTTP webhooks.
|
|
15
|
+
|
|
16
|
+
## How it works {#how-it-works}
|
|
17
|
+
|
|
18
|
+
The flow for every platform follows the same pattern:
|
|
19
|
+
|
|
20
|
+
1. A user sends a message on the external platform (Slack, Telegram, etc.)
|
|
21
|
+
2. The platform delivers the message to your app via a webhook at `/_agent-native/integrations/<platform>/webhook`
|
|
22
|
+
3. The integrations plugin validates the request, extracts the message text and thread context, and maps it to an internal conversation thread
|
|
23
|
+
4. The agent processes the message in the background using the same pipeline as the web chat — same system prompt, same actions, same tools
|
|
24
|
+
5. The response is posted back to the external platform in the same thread
|
|
25
|
+
|
|
26
|
+
`User (Slack/Telegram/WhatsApp)` → `Webhook` → `Agent Processing` → `Response posted back`
|
|
27
|
+
|
|
28
|
+
## Setup {#setup}
|
|
29
|
+
|
|
30
|
+
The integrations plugin auto-mounts when no custom version exists in your template. To customize it, create a plugin file:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
// server/plugins/integrations.ts
|
|
34
|
+
import { createIntegrationsPlugin } from "@agent-native/core/server";
|
|
35
|
+
import { scriptRegistry } from "../../agent.config";
|
|
36
|
+
|
|
37
|
+
export default createIntegrationsPlugin({
|
|
38
|
+
actions: scriptRegistry,
|
|
39
|
+
systemPrompt: "You are a helpful assistant...",
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The plugin registers webhook routes for each enabled platform under `/_agent-native/integrations/`. Which platforms are active depends on which environment variables are configured.
|
|
44
|
+
|
|
45
|
+
## Slack {#slack}
|
|
46
|
+
|
|
47
|
+
### 1. Create a Slack app
|
|
48
|
+
|
|
49
|
+
Go to [api.slack.com/apps](https://api.slack.com/apps) and create a new app. Under **OAuth & Permissions**, add the following bot token scopes:
|
|
50
|
+
|
|
51
|
+
- `chat:write` — send messages
|
|
52
|
+
- `app_mentions:read` — receive @-mentions (optional)
|
|
53
|
+
|
|
54
|
+
### 2. Enable Event Subscriptions
|
|
55
|
+
|
|
56
|
+
Under **Event Subscriptions**, set the Request URL to:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
https://your-app.example.com/_agent-native/integrations/slack/webhook
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Subscribe to the `message.im` bot event (and optionally `app_mention` for channel mentions).
|
|
63
|
+
|
|
64
|
+
### 3. Set environment variables
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
SLACK_BOT_TOKEN=xoxb-your-bot-token
|
|
68
|
+
SLACK_SIGNING_SECRET=your-signing-secret
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The bot token is found under **OAuth & Permissions** after installing the app to your workspace. The signing secret is under **Basic Information**.
|
|
72
|
+
|
|
73
|
+
## Telegram {#telegram}
|
|
74
|
+
|
|
75
|
+
### 1. Create a bot
|
|
76
|
+
|
|
77
|
+
Message [@BotFather](https://t.me/BotFather) on Telegram and use the `/newbot` command. You will receive a bot token.
|
|
78
|
+
|
|
79
|
+
### 2. Set environment variables
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
TELEGRAM_BOT_TOKEN=your-bot-token
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 3. Register the webhook
|
|
86
|
+
|
|
87
|
+
After deploying your app, call the setup endpoint to register the webhook with Telegram:
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
// The integrations plugin exposes a setup endpoint
|
|
91
|
+
POST /_agent-native/integrations/telegram/setup
|
|
92
|
+
|
|
93
|
+
// This calls Telegram's setWebhook API pointing to:
|
|
94
|
+
// https://your-app.example.com/_agent-native/integrations/telegram/webhook
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
You can also register the webhook manually using the Telegram Bot API if you prefer.
|
|
98
|
+
|
|
99
|
+
## WhatsApp {#whatsapp}
|
|
100
|
+
|
|
101
|
+
### 1. Set up the WhatsApp Cloud API
|
|
102
|
+
|
|
103
|
+
Go to the [Meta Developer Portal](https://developers.facebook.com/), create an app, and enable the WhatsApp product. Configure a phone number for your business.
|
|
104
|
+
|
|
105
|
+
### 2. Set environment variables
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
WHATSAPP_ACCESS_TOKEN=your-access-token
|
|
109
|
+
WHATSAPP_VERIFY_TOKEN=your-verify-token
|
|
110
|
+
WHATSAPP_PHONE_NUMBER_ID=your-phone-number-id
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The verify token is a string you choose — Meta uses it during webhook verification. The access token and phone number ID come from the Meta Developer Portal.
|
|
114
|
+
|
|
115
|
+
### 3. Configure the webhook
|
|
116
|
+
|
|
117
|
+
In the Meta Developer Portal, set the webhook URL to:
|
|
118
|
+
|
|
119
|
+
```text
|
|
120
|
+
https://your-app.example.com/_agent-native/integrations/whatsapp/webhook
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Subscribe to the `messages` webhook field.
|
|
124
|
+
|
|
125
|
+
## Configuration {#configuration}
|
|
126
|
+
|
|
127
|
+
Integrations can be managed from the settings UI in the sidebar. Each platform shows its connection status and webhook URL. You can enable/disable individual integrations without removing environment variables.
|
|
128
|
+
|
|
129
|
+
The webhook URLs follow a consistent pattern:
|
|
130
|
+
|
|
131
|
+
```text
|
|
132
|
+
/_agent-native/integrations/<platform>/webhook
|
|
133
|
+
|
|
134
|
+
# Examples:
|
|
135
|
+
/_agent-native/integrations/slack/webhook
|
|
136
|
+
/_agent-native/integrations/telegram/webhook
|
|
137
|
+
/_agent-native/integrations/whatsapp/webhook
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Thread continuity {#thread-continuity}
|
|
141
|
+
|
|
142
|
+
Conversations from external platforms are mapped to internal threads. Each Slack DM, Telegram chat, or WhatsApp conversation becomes a persistent thread in the agent-native database. This means:
|
|
143
|
+
|
|
144
|
+
- The agent retains context across messages in the same external conversation
|
|
145
|
+
- External conversations appear in the web UI alongside web-originated threads, tagged with their source platform
|
|
146
|
+
- You can continue a conversation that started in Slack from the web UI, or vice versa
|
|
147
|
+
|
|
148
|
+
## Custom adapters {#custom-adapters}
|
|
149
|
+
|
|
150
|
+
To add support for a new messaging platform, implement the `PlatformAdapter` interface:
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
import type { PlatformAdapter } from "@agent-native/core/server";
|
|
154
|
+
|
|
155
|
+
const myAdapter: PlatformAdapter = {
|
|
156
|
+
platform: "discord",
|
|
157
|
+
|
|
158
|
+
// Verify the incoming webhook request is authentic
|
|
159
|
+
verifyRequest(request: Request): Promise<boolean> {
|
|
160
|
+
// Validate signature headers
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
// Extract the message text and thread context from the webhook payload
|
|
164
|
+
parseMessage(body: unknown): Promise<{
|
|
165
|
+
text: string;
|
|
166
|
+
threadId: string;
|
|
167
|
+
senderId: string;
|
|
168
|
+
metadata?: Record<string, unknown>;
|
|
169
|
+
}> {
|
|
170
|
+
// Parse platform-specific payload
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
// Send the agent's response back to the platform
|
|
174
|
+
sendResponse(threadId: string, text: string): Promise<void> {
|
|
175
|
+
// Call the platform's API to post the message
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Register your adapter in the integrations plugin config:
|
|
181
|
+
|
|
182
|
+
```ts
|
|
183
|
+
export default createIntegrationsPlugin({
|
|
184
|
+
actions: scriptRegistry,
|
|
185
|
+
systemPrompt: "You are a helpful assistant...",
|
|
186
|
+
adapters: [myAdapter],
|
|
187
|
+
});
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Security {#security}
|
|
191
|
+
|
|
192
|
+
Every incoming webhook is verified before processing:
|
|
193
|
+
|
|
194
|
+
- **Slack** — HMAC-SHA256 signature verification using `SLACK_SIGNING_SECRET`. The `X-Slack-Signature` header is checked against the request body.
|
|
195
|
+
- **Telegram** — requests are validated by checking the secret token set during webhook registration via the Telegram Bot API.
|
|
196
|
+
- **WhatsApp** — Meta's webhook verification challenge (using `WHATSAPP_VERIFY_TOKEN`) and payload signature validation.
|
|
197
|
+
|
|
198
|
+
All platform credentials (tokens, secrets) are stored as environment variables and never persisted in the database or source code. Use the settings UI or your deployment platform's env var management to configure them.
|