@agent-native/core 0.14.8 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builder-engine.js +30 -9
- package/dist/agent/engine/builder-engine.js.map +1 -1
- package/dist/agent/engine/registry.d.ts.map +1 -1
- package/dist/agent/engine/registry.js +14 -4
- package/dist/agent/engine/registry.js.map +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +71 -4
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/types.d.ts +9 -0
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/appearance/actions/change-appearance.d.ts +3 -0
- package/dist/appearance/actions/change-appearance.d.ts.map +1 -0
- package/dist/appearance/actions/change-appearance.js +29 -0
- package/dist/appearance/actions/change-appearance.js.map +1 -0
- package/dist/chat-threads/store.d.ts +53 -2
- package/dist/chat-threads/store.d.ts.map +1 -1
- package/dist/chat-threads/store.js +172 -12
- package/dist/chat-threads/store.js.map +1 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +114 -37
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/index.js +30 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/workspace-dev.d.ts +25 -1
- package/dist/cli/workspace-dev.d.ts.map +1 -1
- package/dist/cli/workspace-dev.js +275 -49
- package/dist/cli/workspace-dev.js.map +1 -1
- package/dist/client/AgentPanel.d.ts +23 -4
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +276 -53
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AppearancePicker.d.ts +11 -0
- package/dist/client/AppearancePicker.d.ts.map +1 -0
- package/dist/client/AppearancePicker.js +16 -0
- package/dist/client/AppearancePicker.js.map +1 -0
- package/dist/client/AssistantChat.d.ts +35 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +315 -32
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/ConnectBuilderCard.d.ts.map +1 -1
- package/dist/client/ConnectBuilderCard.js +5 -2
- package/dist/client/ConnectBuilderCard.js.map +1 -1
- package/dist/client/ErrorBoundary.d.ts.map +1 -1
- package/dist/client/ErrorBoundary.js +8 -10
- package/dist/client/ErrorBoundary.js.map +1 -1
- package/dist/client/FeedbackButton.d.ts.map +1 -1
- package/dist/client/FeedbackButton.js +1 -1
- package/dist/client/FeedbackButton.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts +13 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +217 -38
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/NewWorkspaceAppFlow.d.ts.map +1 -1
- package/dist/client/NewWorkspaceAppFlow.js +37 -14
- package/dist/client/NewWorkspaceAppFlow.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts +5 -0
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +4 -0
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/agent-sidebar-state.d.ts +12 -0
- package/dist/client/agent-sidebar-state.d.ts.map +1 -1
- package/dist/client/agent-sidebar-state.js +8 -0
- package/dist/client/agent-sidebar-state.js.map +1 -1
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +175 -3
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/appearance.d.ts +40 -0
- package/dist/client/appearance.d.ts.map +1 -0
- package/dist/client/appearance.js +114 -0
- package/dist/client/appearance.js.map +1 -0
- package/dist/client/builder-frame.d.ts +1 -0
- package/dist/client/builder-frame.d.ts.map +1 -1
- package/dist/client/builder-frame.js +19 -9
- package/dist/client/builder-frame.js.map +1 -1
- package/dist/client/components/CodeRequiredDialog.d.ts.map +1 -1
- package/dist/client/components/CodeRequiredDialog.js +10 -2
- package/dist/client/components/CodeRequiredDialog.js.map +1 -1
- package/dist/client/components/ui/dropdown-menu.js +2 -2
- package/dist/client/components/ui/dropdown-menu.js.map +1 -1
- package/dist/client/components/ui/hover-card.js +1 -1
- package/dist/client/components/ui/hover-card.js.map +1 -1
- package/dist/client/components/ui/popover.js +1 -1
- package/dist/client/components/ui/popover.js.map +1 -1
- package/dist/client/composer/PromptComposer.d.ts +7 -0
- package/dist/client/composer/PromptComposer.d.ts.map +1 -1
- package/dist/client/composer/PromptComposer.js +63 -32
- package/dist/client/composer/PromptComposer.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts +5 -0
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +36 -6
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/composer/useVoiceDictation.d.ts.map +1 -1
- package/dist/client/composer/useVoiceDictation.js +13 -1
- package/dist/client/composer/useVoiceDictation.js.map +1 -1
- package/dist/client/error-format.d.ts +3 -2
- package/dist/client/error-format.d.ts.map +1 -1
- package/dist/client/error-format.js +9 -2
- package/dist/client/error-format.js.map +1 -1
- package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionViewer.js +24 -2
- package/dist/client/extensions/ExtensionViewer.js.map +1 -1
- package/dist/client/index.d.ts +8 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +7 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/onboarding/OnboardingPanel.js +1 -0
- package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
- package/dist/client/org/InvitationBanner.d.ts.map +1 -1
- package/dist/client/org/InvitationBanner.js +23 -2
- package/dist/client/org/InvitationBanner.js.map +1 -1
- package/dist/client/org/OrgSwitcher.d.ts +5 -4
- package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
- package/dist/client/org/OrgSwitcher.js +57 -9
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/org/hooks.d.ts.map +1 -1
- package/dist/client/org/hooks.js +10 -6
- package/dist/client/org/hooks.js.map +1 -1
- package/dist/client/org/workspace-app-links.d.ts +31 -0
- package/dist/client/org/workspace-app-links.d.ts.map +1 -0
- package/dist/client/org/workspace-app-links.js +268 -0
- package/dist/client/org/workspace-app-links.js.map +1 -0
- package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
- package/dist/client/resources/ResourcesPanel.js +18 -5
- package/dist/client/resources/ResourcesPanel.js.map +1 -1
- package/dist/client/resources/use-resources.d.ts +18 -13
- package/dist/client/resources/use-resources.d.ts.map +1 -1
- package/dist/client/resources/use-resources.js +24 -6
- package/dist/client/resources/use-resources.js.map +1 -1
- package/dist/client/settings/BackgroundAgentSection.d.ts.map +1 -1
- package/dist/client/settings/BackgroundAgentSection.js +9 -1
- package/dist/client/settings/BackgroundAgentSection.js.map +1 -1
- package/dist/client/settings/BrowserSection.d.ts.map +1 -1
- package/dist/client/settings/BrowserSection.js +16 -1
- package/dist/client/settings/BrowserSection.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +4 -1
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.d.ts.map +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.js +5 -5
- package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
- package/dist/client/settings/useBuilderStatus.d.ts +8 -0
- package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
- package/dist/client/settings/useBuilderStatus.js +50 -13
- package/dist/client/settings/useBuilderStatus.js.map +1 -1
- package/dist/client/settings/useBuilderStatus.spec.d.ts +2 -0
- package/dist/client/settings/useBuilderStatus.spec.d.ts.map +1 -0
- package/dist/client/settings/useBuilderStatus.spec.js +64 -0
- package/dist/client/settings/useBuilderStatus.spec.js.map +1 -0
- package/dist/client/sharing/ShareButton.d.ts +5 -0
- package/dist/client/sharing/ShareButton.d.ts.map +1 -1
- package/dist/client/sharing/ShareButton.js +60 -6
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/client/theme.js +1 -1
- package/dist/client/theme.js.map +1 -1
- package/dist/client/transcription/BuilderTranscriptionCta.d.ts.map +1 -1
- package/dist/client/transcription/BuilderTranscriptionCta.js +2 -3
- package/dist/client/transcription/BuilderTranscriptionCta.js.map +1 -1
- package/dist/client/use-change-version.d.ts +46 -0
- package/dist/client/use-change-version.d.ts.map +1 -0
- package/dist/client/use-change-version.js +135 -0
- package/dist/client/use-change-version.js.map +1 -0
- package/dist/client/use-chat-threads.d.ts +16 -2
- package/dist/client/use-chat-threads.d.ts.map +1 -1
- package/dist/client/use-chat-threads.js +87 -12
- package/dist/client/use-chat-threads.js.map +1 -1
- package/dist/client/use-chat-threads.spec.d.ts +2 -0
- package/dist/client/use-chat-threads.spec.d.ts.map +1 -0
- package/dist/client/use-chat-threads.spec.js +85 -0
- package/dist/client/use-chat-threads.spec.js.map +1 -0
- package/dist/client/use-db-sync.d.ts +5 -2
- package/dist/client/use-db-sync.d.ts.map +1 -1
- package/dist/client/use-db-sync.js +41 -16
- package/dist/client/use-db-sync.js.map +1 -1
- package/dist/client/use-pinch-zoom.d.ts +35 -0
- package/dist/client/use-pinch-zoom.d.ts.map +1 -0
- package/dist/client/use-pinch-zoom.js +105 -0
- package/dist/client/use-pinch-zoom.js.map +1 -0
- package/dist/deploy/workspace-deploy.d.ts.map +1 -1
- package/dist/deploy/workspace-deploy.js +99 -5
- package/dist/deploy/workspace-deploy.js.map +1 -1
- package/dist/extensions/actions.d.ts.map +1 -1
- package/dist/extensions/actions.js +3 -0
- package/dist/extensions/actions.js.map +1 -1
- package/dist/extensions/store.d.ts +5 -0
- package/dist/extensions/store.d.ts.map +1 -1
- package/dist/extensions/store.js +16 -1
- package/dist/extensions/store.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +3 -0
- package/dist/file-upload/actions/upload-image.d.ts.map +1 -0
- package/dist/file-upload/actions/upload-image.js +145 -0
- package/dist/file-upload/actions/upload-image.js.map +1 -0
- package/dist/file-upload/builder.d.ts.map +1 -1
- package/dist/file-upload/builder.js +31 -11
- package/dist/file-upload/builder.js.map +1 -1
- package/dist/file-upload/index.d.ts +1 -0
- package/dist/file-upload/index.d.ts.map +1 -1
- package/dist/file-upload/index.js +1 -0
- package/dist/file-upload/index.js.map +1 -1
- package/dist/file-upload/pre-upload-attachments.d.ts +39 -0
- package/dist/file-upload/pre-upload-attachments.d.ts.map +1 -0
- package/dist/file-upload/pre-upload-attachments.js +110 -0
- package/dist/file-upload/pre-upload-attachments.js.map +1 -0
- package/dist/file-upload/registry.d.ts.map +1 -1
- package/dist/file-upload/registry.js +8 -7
- package/dist/file-upload/registry.js.map +1 -1
- package/dist/onboarding/default-steps.js +1 -1
- package/dist/onboarding/default-steps.js.map +1 -1
- package/dist/org/context.d.ts +15 -1
- package/dist/org/context.d.ts.map +1 -1
- package/dist/org/context.js +25 -0
- package/dist/org/context.js.map +1 -1
- package/dist/org/handlers.d.ts +2 -2
- package/dist/org/handlers.d.ts.map +1 -1
- package/dist/org/handlers.js +3 -17
- package/dist/org/handlers.js.map +1 -1
- package/dist/org/index.d.ts +1 -1
- package/dist/org/index.d.ts.map +1 -1
- package/dist/org/index.js +1 -1
- package/dist/org/index.js.map +1 -1
- package/dist/resources/handlers.d.ts +6 -0
- package/dist/resources/handlers.d.ts.map +1 -1
- package/dist/resources/handlers.js +30 -6
- package/dist/resources/handlers.js.map +1 -1
- package/dist/resources/script-helpers.d.ts +11 -2
- package/dist/resources/script-helpers.d.ts.map +1 -1
- package/dist/resources/script-helpers.js +20 -3
- package/dist/resources/script-helpers.js.map +1 -1
- package/dist/resources/store.d.ts +28 -3
- package/dist/resources/store.d.ts.map +1 -1
- package/dist/resources/store.js +170 -20
- package/dist/resources/store.js.map +1 -1
- package/dist/scripts/resources/list.d.ts +1 -1
- package/dist/scripts/resources/list.d.ts.map +1 -1
- package/dist/scripts/resources/list.js +16 -4
- package/dist/scripts/resources/list.js.map +1 -1
- package/dist/scripts/resources/write.d.ts +1 -1
- package/dist/scripts/resources/write.d.ts.map +1 -1
- package/dist/scripts/resources/write.js +47 -3
- package/dist/scripts/resources/write.js.map +1 -1
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +8 -3
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +214 -25
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-discovery.d.ts +35 -0
- package/dist/server/agent-discovery.d.ts.map +1 -1
- package/dist/server/agent-discovery.js +139 -8
- package/dist/server/agent-discovery.js.map +1 -1
- package/dist/server/app-url.d.ts +12 -6
- package/dist/server/app-url.d.ts.map +1 -1
- package/dist/server/app-url.js +58 -11
- package/dist/server/app-url.js.map +1 -1
- package/dist/server/auth.d.ts +22 -0
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +272 -59
- package/dist/server/auth.js.map +1 -1
- package/dist/server/better-auth-instance.d.ts +0 -4
- package/dist/server/better-auth-instance.d.ts.map +1 -1
- package/dist/server/better-auth-instance.js +0 -3
- package/dist/server/better-auth-instance.js.map +1 -1
- package/dist/server/builder-browser.d.ts.map +1 -1
- package/dist/server/builder-browser.js +23 -0
- package/dist/server/builder-browser.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +29 -14
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/credential-provider.d.ts +14 -0
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +88 -11
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/google-auth-plugin.d.ts.map +1 -1
- package/dist/server/google-auth-plugin.js +53 -13
- package/dist/server/google-auth-plugin.js.map +1 -1
- package/dist/server/google-oauth.d.ts.map +1 -1
- package/dist/server/google-oauth.js +47 -17
- package/dist/server/google-oauth.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/oauth-public-origin.d.ts.map +1 -1
- package/dist/server/oauth-public-origin.js +19 -1
- package/dist/server/oauth-public-origin.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +62 -15
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/server/poll.d.ts.map +1 -1
- package/dist/server/poll.js +20 -5
- package/dist/server/poll.js.map +1 -1
- package/dist/server/request-context.d.ts +8 -0
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/request-context.js.map +1 -1
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +2 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/llm-connection.d.ts +10 -0
- package/dist/shared/llm-connection.d.ts.map +1 -0
- package/dist/shared/llm-connection.js +29 -0
- package/dist/shared/llm-connection.js.map +1 -0
- package/dist/shared/workspace-app-audience.d.ts +25 -0
- package/dist/shared/workspace-app-audience.d.ts.map +1 -0
- package/dist/shared/workspace-app-audience.js +126 -0
- package/dist/shared/workspace-app-audience.js.map +1 -0
- package/dist/shared/workspace-app-id.d.ts +1 -1
- package/dist/shared/workspace-app-id.d.ts.map +1 -1
- package/dist/shared/workspace-app-id.js +1 -0
- package/dist/shared/workspace-app-id.js.map +1 -1
- package/dist/sharing/access.d.ts.map +1 -1
- package/dist/sharing/access.js +46 -5
- package/dist/sharing/access.js.map +1 -1
- package/dist/sharing/actions/list-resource-shares.d.ts.map +1 -1
- package/dist/sharing/actions/list-resource-shares.js +8 -1
- package/dist/sharing/actions/list-resource-shares.js.map +1 -1
- package/dist/sharing/actions/set-resource-visibility.d.ts.map +1 -1
- package/dist/sharing/actions/set-resource-visibility.js +12 -3
- package/dist/sharing/actions/set-resource-visibility.js.map +1 -1
- package/dist/sharing/actions/share-resource.d.ts.map +1 -1
- package/dist/sharing/actions/share-resource.js +50 -1
- package/dist/sharing/actions/share-resource.js.map +1 -1
- package/dist/sharing/registry.d.ts +26 -0
- package/dist/sharing/registry.d.ts.map +1 -1
- package/dist/sharing/registry.js.map +1 -1
- package/dist/styles/agent-native.css +91 -0
- package/dist/templates/default/.agents/skills/adding-a-feature/SKILL.md +72 -0
- package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +60 -37
- package/dist/templates/default/.agents/skills/real-time-sync/SKILL.md +28 -17
- package/dist/templates/default/.agents/skills/shadcn-ui/SKILL.md +79 -0
- package/dist/templates/default/AGENTS.md +22 -19
- package/dist/templates/default/actions/navigate.ts +3 -0
- package/dist/templates/default/app/hooks/use-navigation-state.ts +29 -5
- package/dist/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +251 -0
- package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +264 -0
- package/dist/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +130 -0
- package/dist/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +112 -0
- package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +88 -0
- package/dist/templates/workspace-core/.agents/skills/automations/SKILL.md +191 -0
- package/dist/templates/workspace-core/.agents/skills/capture-learnings/SKILL.md +74 -0
- package/dist/templates/workspace-core/.agents/skills/client-side-routing/SKILL.md +75 -0
- package/dist/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +190 -0
- package/dist/templates/workspace-core/.agents/skills/create-skill/SKILL.md +168 -0
- package/dist/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +163 -0
- package/dist/templates/workspace-core/.agents/skills/extension-points/SKILL.md +205 -0
- package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +720 -0
- package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +92 -0
- package/dist/templates/workspace-core/.agents/skills/integration-webhooks/SKILL.md +285 -0
- package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +192 -0
- package/dist/templates/workspace-core/.agents/skills/onboarding/SKILL.md +43 -0
- package/dist/templates/workspace-core/.agents/skills/portability/SKILL.md +84 -0
- package/dist/templates/workspace-core/.agents/skills/qa/SKILL.md +313 -0
- package/dist/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +112 -0
- package/dist/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +165 -0
- package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +41 -0
- package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +239 -0
- package/dist/templates/workspace-core/.agents/skills/security/SKILL.md +191 -0
- package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +79 -0
- package/dist/templates/workspace-core/.agents/skills/server-plugins/SKILL.md +73 -0
- package/dist/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +79 -0
- package/dist/templates/workspace-core/.agents/skills/sharing/SKILL.md +217 -0
- package/dist/templates/workspace-core/.agents/skills/storing-data/SKILL.md +132 -0
- package/dist/templates/workspace-core/.agents/skills/tracking/SKILL.md +150 -0
- package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +124 -0
- package/dist/templates/workspace-core/AGENTS.md +16 -1
- package/dist/templates/workspace-root/AGENTS.md +35 -0
- package/dist/templates/workspace-root/README.md +7 -0
- package/dist/vite/action-types-plugin.d.ts.map +1 -1
- package/dist/vite/action-types-plugin.js +4 -0
- package/dist/vite/action-types-plugin.js.map +1 -1
- package/docs/content/authentication.md +36 -0
- package/docs/content/creating-templates.md +15 -0
- package/docs/content/dispatch.md +3 -3
- package/docs/content/multi-app-workspace.md +5 -0
- package/docs/content/tracking.md +12 -0
- package/docs/content/workspace-management.md +39 -4
- package/package.json +15 -12
- package/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +72 -0
- package/src/templates/default/.agents/skills/frontend-design/SKILL.md +60 -37
- package/src/templates/default/.agents/skills/real-time-sync/SKILL.md +28 -17
- package/src/templates/default/.agents/skills/shadcn-ui/SKILL.md +79 -0
- package/src/templates/default/AGENTS.md +22 -19
- package/src/templates/default/actions/navigate.ts +3 -0
- package/src/templates/default/app/hooks/use-navigation-state.ts +29 -5
- package/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +251 -0
- package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +264 -0
- package/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +130 -0
- package/src/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +112 -0
- package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +88 -0
- package/src/templates/workspace-core/.agents/skills/automations/SKILL.md +191 -0
- package/src/templates/workspace-core/.agents/skills/capture-learnings/SKILL.md +74 -0
- package/src/templates/workspace-core/.agents/skills/client-side-routing/SKILL.md +75 -0
- package/src/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +190 -0
- package/src/templates/workspace-core/.agents/skills/create-skill/SKILL.md +168 -0
- package/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +163 -0
- package/src/templates/workspace-core/.agents/skills/extension-points/SKILL.md +205 -0
- package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +720 -0
- package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +92 -0
- package/src/templates/workspace-core/.agents/skills/integration-webhooks/SKILL.md +285 -0
- package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +192 -0
- package/src/templates/workspace-core/.agents/skills/onboarding/SKILL.md +43 -0
- package/src/templates/workspace-core/.agents/skills/portability/SKILL.md +84 -0
- package/src/templates/workspace-core/.agents/skills/qa/SKILL.md +313 -0
- package/src/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +112 -0
- package/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +165 -0
- package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +41 -0
- package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +239 -0
- package/src/templates/workspace-core/.agents/skills/security/SKILL.md +191 -0
- package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +79 -0
- package/src/templates/workspace-core/.agents/skills/server-plugins/SKILL.md +73 -0
- package/src/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +79 -0
- package/src/templates/workspace-core/.agents/skills/sharing/SKILL.md +217 -0
- package/src/templates/workspace-core/.agents/skills/storing-data/SKILL.md +132 -0
- package/src/templates/workspace-core/.agents/skills/tracking/SKILL.md +150 -0
- package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +124 -0
- package/src/templates/workspace-core/AGENTS.md +16 -1
- package/src/templates/workspace-root/AGENTS.md +35 -0
- package/src/templates/workspace-root/README.md +7 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: context-awareness
|
|
3
|
+
description: >-
|
|
4
|
+
How the agent knows what the user is looking at. Use when exposing UI state to
|
|
5
|
+
the agent, implementing view-screen or navigate scripts, wiring navigation
|
|
6
|
+
state, or debugging agent context issues.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Context Awareness
|
|
10
|
+
|
|
11
|
+
## Rule
|
|
12
|
+
|
|
13
|
+
The agent must always know what the user is currently viewing. The UI writes navigation state on every route change. The agent reads it before acting.
|
|
14
|
+
|
|
15
|
+
## Why
|
|
16
|
+
|
|
17
|
+
Without context awareness, the agent is blind. It asks "which email?" when the user is staring at one. It cannot act on the current selection, cannot provide relevant suggestions, and cannot modify what the user sees. Context awareness is what makes the agent feel like a collaborator rather than a disconnected chatbot.
|
|
18
|
+
|
|
19
|
+
## The Three Patterns
|
|
20
|
+
|
|
21
|
+
### 1. Navigation State (`navigation` key)
|
|
22
|
+
|
|
23
|
+
The UI writes a `navigation` key to application-state on every route change. This tells the agent what view the user is on and what item is selected.
|
|
24
|
+
|
|
25
|
+
**UI side** — the `use-navigation-state.ts` hook:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
// app/hooks/use-navigation-state.ts
|
|
29
|
+
import { useEffect, useCallback } from "react";
|
|
30
|
+
import { useLocation } from "react-router";
|
|
31
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
32
|
+
|
|
33
|
+
export function useNavigationState() {
|
|
34
|
+
const location = useLocation();
|
|
35
|
+
|
|
36
|
+
// Sync route to app-state on every navigation
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
const state = deriveNavigationState(location.pathname);
|
|
39
|
+
fetch("/_agent-native/application-state/navigation", {
|
|
40
|
+
method: "PUT",
|
|
41
|
+
headers: { "Content-Type": "application/json" },
|
|
42
|
+
body: JSON.stringify(state),
|
|
43
|
+
}).catch(() => {});
|
|
44
|
+
}, [location.pathname]);
|
|
45
|
+
|
|
46
|
+
// ... also listen for navigate commands (pattern 3)
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Agent side** — read before acting:
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import { readAppState } from "@agent-native/core/application-state";
|
|
54
|
+
|
|
55
|
+
const navigation = await readAppState("navigation");
|
|
56
|
+
// e.g. { view: "thread", threadId: "abc123", subject: "Re: Q3 Planning" }
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**What to include in navigation state:**
|
|
60
|
+
|
|
61
|
+
- `view` — the current page/section (e.g., "inbox", "form-builder", "dashboard")
|
|
62
|
+
- Item IDs — the selected/open item (e.g., `threadId`, `formId`, `issueKey`)
|
|
63
|
+
- Filter state — active search, label, or category filters
|
|
64
|
+
- Any selection — focused item, selected text range, active tab
|
|
65
|
+
|
|
66
|
+
### 2. The `view-screen` Script
|
|
67
|
+
|
|
68
|
+
Every template should have a `view-screen` script. It reads navigation state, fetches the relevant data from the API, and returns a snapshot of what the user sees. This is the agent's eyes.
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
// actions/view-screen.ts
|
|
72
|
+
import { readAppState } from "@agent-native/core/application-state";
|
|
73
|
+
|
|
74
|
+
export default async function main() {
|
|
75
|
+
const navigation = await readAppState("navigation");
|
|
76
|
+
const screen: Record<string, unknown> = { navigation };
|
|
77
|
+
|
|
78
|
+
// Fetch data based on what the user is viewing
|
|
79
|
+
if (navigation?.view === "inbox") {
|
|
80
|
+
const emails = await fetchEmailList(navigation.label);
|
|
81
|
+
screen.emailList = emails;
|
|
82
|
+
}
|
|
83
|
+
if (navigation?.threadId) {
|
|
84
|
+
const thread = await fetchThread(navigation.threadId);
|
|
85
|
+
screen.thread = thread;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
console.log(JSON.stringify(screen, null, 2));
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Navigation state is auto-injected into every user message as a `<current-screen>` block**, so the agent always has basic context without calling any tool. The `view-screen` action is still useful when you need a richer snapshot (e.g., fetching the full email thread or form data for the current view).
|
|
93
|
+
|
|
94
|
+
### 3. The `navigate` Script
|
|
95
|
+
|
|
96
|
+
The agent writes a one-shot `navigate` command to application-state. The UI reads it, performs the navigation, and deletes the entry.
|
|
97
|
+
|
|
98
|
+
**Agent side:**
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import { writeAppState } from "@agent-native/core/application-state";
|
|
102
|
+
|
|
103
|
+
// Navigate the user to a specific thread
|
|
104
|
+
await writeAppState("navigate", { view: "inbox", threadId: "abc123" });
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**UI side** — the hook polls for the command:
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
const { data: navCommand } = useQuery({
|
|
111
|
+
queryKey: ["navigate-command"],
|
|
112
|
+
queryFn: async () => {
|
|
113
|
+
const res = await fetch("/_agent-native/application-state/navigate");
|
|
114
|
+
if (!res.ok) return null;
|
|
115
|
+
const data = await res.json();
|
|
116
|
+
if (data) {
|
|
117
|
+
// Delete the one-shot command after reading
|
|
118
|
+
fetch("/_agent-native/application-state/navigate", { method: "DELETE" });
|
|
119
|
+
return data;
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
},
|
|
123
|
+
staleTime: 2_000,
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
useEffect(() => {
|
|
127
|
+
if (navCommand) {
|
|
128
|
+
router.navigate(buildPath(navCommand));
|
|
129
|
+
}
|
|
130
|
+
}, [navCommand]);
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Jitter Prevention
|
|
134
|
+
|
|
135
|
+
When the agent writes to application-state via script helpers (`writeAppState`), the write is tagged with `requestSource: "agent"`. The UI uses the `ignoreSource` option on `useDbSync()` with a per-tab ID so it ignores its own writes while still picking up changes from agents, other tabs, and scripts.
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
// app/root.tsx
|
|
139
|
+
import { TAB_ID } from "@/lib/tab-id";
|
|
140
|
+
|
|
141
|
+
useDbSync({
|
|
142
|
+
queryClient,
|
|
143
|
+
queryKeys: ["app-state", "settings"],
|
|
144
|
+
ignoreSource: TAB_ID, // ignore events from this tab's own writes
|
|
145
|
+
});
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The UI sends its tab ID via `X-Request-Source` header on PUT/DELETE requests. The server stores this as the event's `requestSource`. When polling, the UI filters out events matching its own `ignoreSource` value. This prevents the UI from refetching data it just wrote.
|
|
149
|
+
|
|
150
|
+
## Gold-Standard Example: Mail Template
|
|
151
|
+
|
|
152
|
+
The mail template demonstrates all three patterns working together:
|
|
153
|
+
|
|
154
|
+
**Navigation state shape:**
|
|
155
|
+
```json
|
|
156
|
+
{ "view": "inbox", "threadId": "thread-123", "focusedEmailId": "msg-456", "search": "budget", "label": "important" }
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**view-screen output:**
|
|
160
|
+
- Reads navigation state
|
|
161
|
+
- Fetches email list matching current view/search/label filters
|
|
162
|
+
- Fetches thread messages if a thread is open
|
|
163
|
+
- Returns everything as a single JSON snapshot
|
|
164
|
+
|
|
165
|
+
**navigate command:**
|
|
166
|
+
- `{ "view": "starred" }` — switch to starred view
|
|
167
|
+
- `{ "view": "inbox", "threadId": "thread-123" }` — open a specific thread
|
|
168
|
+
|
|
169
|
+
## Do
|
|
170
|
+
|
|
171
|
+
- Use the auto-injected `<current-screen>` block for basic context — call `view-screen` only when you need richer data
|
|
172
|
+
- Include all relevant selection state in the `navigation` key (view, item IDs, filters)
|
|
173
|
+
- Update `view-screen` when adding new features — it should return data for every view
|
|
174
|
+
- Use the one-shot `navigate` command pattern for agent-initiated navigation
|
|
175
|
+
- Tag agent writes with `requestSource: "agent"` (the script helpers do this automatically)
|
|
176
|
+
|
|
177
|
+
## Don't
|
|
178
|
+
|
|
179
|
+
- Don't assume the user is on a specific page — always check navigation state
|
|
180
|
+
- Don't hardcode navigation paths in scripts — read the current state and branch
|
|
181
|
+
- Don't write to the `navigation` key from the agent — it belongs to the UI. Use `navigate` instead.
|
|
182
|
+
- Don't ignore the `<current-screen>` block — it tells you where the user is
|
|
183
|
+
- Don't store fetched data in navigation state — it holds IDs and filters only. The `view-screen` script fetches the actual data.
|
|
184
|
+
|
|
185
|
+
## Related Skills
|
|
186
|
+
|
|
187
|
+
- **adding-a-feature** — Context awareness is area 4 of the four-area checklist
|
|
188
|
+
- **real-time-sync** — How polling and `useDbSync` deliver app-state changes to the UI
|
|
189
|
+
- **scripts** — How to create the `view-screen` and `navigate` scripts
|
|
190
|
+
- **storing-data** — Application-state is one of the core SQL stores
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-skill
|
|
3
|
+
description: >-
|
|
4
|
+
How to create new skills for an agent-native app. Use when adding a new
|
|
5
|
+
skill, documenting a pattern the agent should follow, or creating reusable
|
|
6
|
+
guidance for the agent.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Create a Skill
|
|
10
|
+
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
Create a new skill when:
|
|
14
|
+
|
|
15
|
+
- There's a pattern the agent should follow repeatedly
|
|
16
|
+
- A workflow needs step-by-step guidance
|
|
17
|
+
- You want to scaffold files from a template
|
|
18
|
+
|
|
19
|
+
Don't create a skill when:
|
|
20
|
+
|
|
21
|
+
- The guidance already exists in another skill (extend it instead)
|
|
22
|
+
- You're documenting something the agent already knows (e.g., how to write TypeScript)
|
|
23
|
+
- The guidance is a one-off — put it in `AGENTS.md` or `learnings.md` instead
|
|
24
|
+
|
|
25
|
+
## 5-Question Interview
|
|
26
|
+
|
|
27
|
+
Before writing the skill, answer these:
|
|
28
|
+
|
|
29
|
+
1. **What should this skill enable?** — The core purpose in one sentence.
|
|
30
|
+
2. **Which agent-native rule does it serve?** — Rule 1 (data in SQL), Rule 2 (delegate to agent), Rule 3 (scripts), Rule 4 (polling sync), Rule 5 (self-modify), Rule 6 (app-state in SQL), or "utility."
|
|
31
|
+
3. **When should it trigger?** — Describe the situations in natural language. Be slightly pushy — over-triggering is better than under-triggering.
|
|
32
|
+
4. **Does it involve context awareness?** — Does the agent need to know what the user is looking at to use this skill? If yes, the skill should reference the `navigation` app-state key and the `view-screen` script pattern. See the **context-awareness** skill.
|
|
33
|
+
5. **What type of skill?** — Pattern, Workflow, or Generator (see templates below).
|
|
34
|
+
6. **Does it need supporting files?** — References (read-only context) or none. Keep it minimal.
|
|
35
|
+
|
|
36
|
+
## Skill Types and Templates
|
|
37
|
+
|
|
38
|
+
### Pattern (architectural rule)
|
|
39
|
+
|
|
40
|
+
For documenting how things should be done:
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
---
|
|
44
|
+
name: my-pattern
|
|
45
|
+
description: >-
|
|
46
|
+
[Under 40 words. When should this trigger?]
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
# [Pattern Name]
|
|
50
|
+
|
|
51
|
+
## Rule
|
|
52
|
+
|
|
53
|
+
[One sentence: what must be true]
|
|
54
|
+
|
|
55
|
+
## Why
|
|
56
|
+
|
|
57
|
+
[Why this rule exists]
|
|
58
|
+
|
|
59
|
+
## How
|
|
60
|
+
|
|
61
|
+
[How to follow it, with code examples]
|
|
62
|
+
|
|
63
|
+
## Don't
|
|
64
|
+
|
|
65
|
+
[Common violations]
|
|
66
|
+
|
|
67
|
+
## Related Skills
|
|
68
|
+
|
|
69
|
+
[Which skills compose with this one]
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Workflow (step-by-step)
|
|
73
|
+
|
|
74
|
+
For multi-step implementation tasks:
|
|
75
|
+
|
|
76
|
+
```markdown
|
|
77
|
+
---
|
|
78
|
+
name: my-workflow
|
|
79
|
+
description: >-
|
|
80
|
+
[Under 40 words. When should this trigger?]
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
# [Workflow Name]
|
|
84
|
+
|
|
85
|
+
## Prerequisites
|
|
86
|
+
|
|
87
|
+
[What must be in place first]
|
|
88
|
+
|
|
89
|
+
## Steps
|
|
90
|
+
|
|
91
|
+
[Numbered steps with code examples]
|
|
92
|
+
|
|
93
|
+
## Verification
|
|
94
|
+
|
|
95
|
+
[How to confirm it worked]
|
|
96
|
+
|
|
97
|
+
## Troubleshooting
|
|
98
|
+
|
|
99
|
+
[Common issues and fixes]
|
|
100
|
+
|
|
101
|
+
## Related Skills
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Generator (scaffolding)
|
|
105
|
+
|
|
106
|
+
For creating files from templates:
|
|
107
|
+
|
|
108
|
+
```markdown
|
|
109
|
+
---
|
|
110
|
+
name: my-generator
|
|
111
|
+
description: >-
|
|
112
|
+
[Under 40 words. When should this trigger?]
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
# [Generator Name]
|
|
116
|
+
|
|
117
|
+
## Usage
|
|
118
|
+
|
|
119
|
+
[How to invoke — what args/inputs are needed]
|
|
120
|
+
|
|
121
|
+
## What Gets Created
|
|
122
|
+
|
|
123
|
+
[List of files and their purpose]
|
|
124
|
+
|
|
125
|
+
## Template
|
|
126
|
+
|
|
127
|
+
[The template content with placeholders]
|
|
128
|
+
|
|
129
|
+
## After Generation
|
|
130
|
+
|
|
131
|
+
[What to do next — wire up SSE, add routes, etc.]
|
|
132
|
+
|
|
133
|
+
## Related Skills
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Naming Conventions
|
|
137
|
+
|
|
138
|
+
- Hyphen-case only: `[a-z0-9-]`, max 64 characters
|
|
139
|
+
- Pattern skills: descriptive names (`storing-data`, `delegate-to-agent`)
|
|
140
|
+
- Workflow/generator skills: verb-noun (`create-script`, `capture-learnings`)
|
|
141
|
+
|
|
142
|
+
## Tips
|
|
143
|
+
|
|
144
|
+
- **Keep descriptions under 40 words** — They're loaded into context on every conversation.
|
|
145
|
+
- **Keep SKILL.md under 500 lines** — Move detailed content to `references/` files.
|
|
146
|
+
- **Use standard markdown headings** — No XML tags or custom formats.
|
|
147
|
+
|
|
148
|
+
## Anti-Patterns
|
|
149
|
+
|
|
150
|
+
- **Inline LLM calls** — Skills must not call LLMs directly (violates Rule 2)
|
|
151
|
+
- **Database patterns** — Skills must not introduce databases (violates Rule 1)
|
|
152
|
+
- **Ignoring db sync** — If a skill creates data, mention wiring up `useDbSync`
|
|
153
|
+
- **Vague descriptions** — "Helps with development" won't trigger. Be specific about _when_.
|
|
154
|
+
- **Pure documentation** — Skills should guide action, not just explain concepts
|
|
155
|
+
|
|
156
|
+
## File Structure
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
.agents/skills/my-skill/
|
|
160
|
+
├── SKILL.md # Main skill (required)
|
|
161
|
+
└── references/ # Optional supporting context
|
|
162
|
+
└── detailed-guide.md
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Related Skills
|
|
166
|
+
|
|
167
|
+
- **capture-learnings** — When a learning graduates to reusable guidance, create a skill
|
|
168
|
+
- **self-modifying-code** — The agent can create new skills (Tier 2 modification)
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: delegate-to-agent
|
|
3
|
+
description: >-
|
|
4
|
+
How to delegate all AI work to the agent chat. Use when delegating AI work
|
|
5
|
+
from UI or scripts to the agent, when a user asks for agent behavior or
|
|
6
|
+
LLM-powered features, when tempted to add inline LLM calls, or when sending
|
|
7
|
+
messages to the agent from application code.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Delegate All AI to the Agent
|
|
11
|
+
|
|
12
|
+
## Rule
|
|
13
|
+
|
|
14
|
+
The UI and server never call an LLM directly. All AI work is delegated to the agent through the chat bridge.
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
The agent is the single AI interface. It has context about the full project, can read/write any file, and can run scripts. Inline LLM calls bypass this — they create a shadow AI that doesn't know what the agent knows and can't coordinate with it.
|
|
19
|
+
|
|
20
|
+
## How
|
|
21
|
+
|
|
22
|
+
**From the UI (client):**
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { sendToAgentChat } from "@agent-native/core";
|
|
26
|
+
|
|
27
|
+
sendToAgentChat({
|
|
28
|
+
message: "Generate a summary of this document",
|
|
29
|
+
context: documentContent, // optional hidden context (not shown in chat UI)
|
|
30
|
+
submit: true, // auto-submit to the agent
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**From scripts (Node):**
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import { agentChat } from "@agent-native/core";
|
|
38
|
+
|
|
39
|
+
agentChat.submit("Process the uploaded images and create thumbnails");
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**From the UI, detecting when agent is done:**
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { useAgentChatGenerating } from "@agent-native/core";
|
|
46
|
+
|
|
47
|
+
function MyComponent() {
|
|
48
|
+
const isGenerating = useAgentChatGenerating();
|
|
49
|
+
// Show loading state while agent is working
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## `submit` vs Prefill
|
|
54
|
+
|
|
55
|
+
The `submit` option controls whether the message is sent automatically or placed in the chat input for user review:
|
|
56
|
+
|
|
57
|
+
| `submit` value | Behavior | Use when |
|
|
58
|
+
| -------------- | --------------------------------------- | ----------------------------------------------------------------------------------- |
|
|
59
|
+
| `true` | Auto-submits to the agent immediately | Routine operations the user has already approved |
|
|
60
|
+
| `false` | Prefills the chat input for user review | High-stakes operations (deleting data, modifying code, API calls with side effects) |
|
|
61
|
+
| omitted | Uses the project's default setting | General-purpose delegation |
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
// Auto-submit: routine operation
|
|
65
|
+
sendToAgentChat({ message: "Update the project summary", submit: true });
|
|
66
|
+
|
|
67
|
+
// Prefill: let user review before sending
|
|
68
|
+
sendToAgentChat({
|
|
69
|
+
message: "Delete all projects older than 30 days",
|
|
70
|
+
submit: false,
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Capture user input first when generating from a prompt
|
|
75
|
+
|
|
76
|
+
Buttons that produce new content ("New Design", "Create Dashboard", "Make Deck", "Generate Form") need the user's prompt as input. **Never hardcode a generic message** — the result will be a generic generation the user didn't actually ask for.
|
|
77
|
+
|
|
78
|
+
**Bad** — auto-submits a placeholder message; the user never said what they wanted:
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
<Button
|
|
82
|
+
onClick={() =>
|
|
83
|
+
sendToAgentChat({ message: "make a design", submit: true })
|
|
84
|
+
}
|
|
85
|
+
>
|
|
86
|
+
New Design
|
|
87
|
+
</Button>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Good** — Popover anchored to the button captures the prompt, then submits it:
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
94
|
+
<PopoverTrigger asChild>
|
|
95
|
+
<Button>New Design</Button>
|
|
96
|
+
</PopoverTrigger>
|
|
97
|
+
<PopoverContent className="w-96">
|
|
98
|
+
<Textarea
|
|
99
|
+
autoFocus
|
|
100
|
+
value={prompt}
|
|
101
|
+
onChange={(e) => setPrompt(e.target.value)}
|
|
102
|
+
placeholder="What do you want to design?"
|
|
103
|
+
/>
|
|
104
|
+
<Button
|
|
105
|
+
onClick={() => {
|
|
106
|
+
sendToAgentChat({ message: prompt, submit: true });
|
|
107
|
+
setOpen(false);
|
|
108
|
+
setPrompt("");
|
|
109
|
+
}}
|
|
110
|
+
>
|
|
111
|
+
Create
|
|
112
|
+
</Button>
|
|
113
|
+
</PopoverContent>
|
|
114
|
+
</Popover>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Always ask for input first when** the output depends on a prompt the user must provide — "design what?", "deck about what?", "dashboard for which metric?", "form for which use case?".
|
|
118
|
+
|
|
119
|
+
**Auto-submit without input is fine when intent is unambiguous:**
|
|
120
|
+
|
|
121
|
+
- "Try to fix" on a tool error — submits the error details with a clear fix instruction
|
|
122
|
+
- "Retry the last operation" after a transient failure
|
|
123
|
+
- Single-purpose buttons where there is nothing meaningful for the user to add
|
|
124
|
+
|
|
125
|
+
If you find yourself writing `submit: true` with a hardcoded creative verb (`"design a..."`, `"write a..."`, `"build a..."`), stop and add a Popover.
|
|
126
|
+
|
|
127
|
+
## Don't
|
|
128
|
+
|
|
129
|
+
- Don't `import Anthropic from "@anthropic-ai/sdk"` in client or server code
|
|
130
|
+
- Don't `import OpenAI from "openai"` in client or server code
|
|
131
|
+
- Don't make direct API calls to any LLM provider
|
|
132
|
+
- Don't use AI SDK functions like `generateText()`, `streamText()`, etc.
|
|
133
|
+
- Don't build "AI features" that bypass the agent chat
|
|
134
|
+
- Don't auto-submit a hardcoded prompt for generative actions — capture user input first (see above)
|
|
135
|
+
|
|
136
|
+
## Exception
|
|
137
|
+
|
|
138
|
+
Scripts may call external APIs (image generation, search, etc.) — but the AI reasoning and orchestration still goes through the agent. A script is a tool the agent uses, not a replacement for the agent.
|
|
139
|
+
|
|
140
|
+
## When to Use A2A Instead
|
|
141
|
+
|
|
142
|
+
`sendToAgentChat()` delegates work to the **local** agent — the one running alongside your app. When the work should go to a **different** agent entirely (e.g., asking an analytics agent for data, or a calendar agent for availability), use the A2A (agent-to-agent) protocol instead.
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
import { callAgent } from "@agent-native/core/a2a";
|
|
146
|
+
|
|
147
|
+
// Call a different agent — not the local agent chat
|
|
148
|
+
const stats = await callAgent(
|
|
149
|
+
"https://analytics.example.com",
|
|
150
|
+
"What were last week's signups?",
|
|
151
|
+
{ apiKey: process.env.ANALYTICS_A2A_KEY },
|
|
152
|
+
);
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
See the **a2a-protocol** skill for the full pattern.
|
|
156
|
+
|
|
157
|
+
## Related Skills
|
|
158
|
+
|
|
159
|
+
- **a2a-protocol** — When the work goes to a different agent, not the local one
|
|
160
|
+
- **scripts** — The agent invokes scripts via `pnpm action <name>` to perform complex operations
|
|
161
|
+
- **self-modifying-code** — The agent operates through the chat bridge to make code changes
|
|
162
|
+
- **storing-data** — The agent writes results to the database after processing requests
|
|
163
|
+
- **real-time-sync** — The UI updates automatically when the agent writes data
|