@agent-native/core 0.14.8 → 0.15.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 +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/dev-mode.d.ts +14 -0
- package/dist/client/dev-mode.d.ts.map +1 -0
- package/dist/client/dev-mode.js +14 -0
- package/dist/client/dev-mode.js.map +1 -0
- 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/EmbeddedTool.d.ts +20 -0
- package/dist/client/extensions/EmbeddedTool.d.ts.map +1 -0
- package/dist/client/extensions/EmbeddedTool.js +199 -0
- package/dist/client/extensions/EmbeddedTool.js.map +1 -0
- 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/extensions/ToolEditor.d.ts +5 -0
- package/dist/client/extensions/ToolEditor.d.ts.map +1 -0
- package/dist/client/extensions/ToolEditor.js +129 -0
- package/dist/client/extensions/ToolEditor.js.map +1 -0
- package/dist/client/extensions/ToolViewer.d.ts +5 -0
- package/dist/client/extensions/ToolViewer.d.ts.map +1 -0
- package/dist/client/extensions/ToolViewer.js +400 -0
- package/dist/client/extensions/ToolViewer.js.map +1 -0
- package/dist/client/extensions/ToolViewerPage.d.ts +2 -0
- package/dist/client/extensions/ToolViewerPage.d.ts.map +1 -0
- package/dist/client/extensions/ToolViewerPage.js +24 -0
- package/dist/client/extensions/ToolViewerPage.js.map +1 -0
- package/dist/client/extensions/ToolsListPage.d.ts +2 -0
- package/dist/client/extensions/ToolsListPage.d.ts.map +1 -0
- package/dist/client/extensions/ToolsListPage.js +67 -0
- package/dist/client/extensions/ToolsListPage.js.map +1 -0
- package/dist/client/extensions/ToolsSidebarSection.d.ts +2 -0
- package/dist/client/extensions/ToolsSidebarSection.d.ts.map +1 -0
- package/dist/client/extensions/ToolsSidebarSection.js +236 -0
- package/dist/client/extensions/ToolsSidebarSection.js.map +1 -0
- package/dist/client/extensions/tool-order.d.ts +7 -0
- package/dist/client/extensions/tool-order.d.ts.map +1 -0
- package/dist/client/extensions/tool-order.js +47 -0
- package/dist/client/extensions/tool-order.js.map +1 -0
- 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/tools/EmbeddedTool.d.ts +20 -0
- package/dist/client/tools/EmbeddedTool.d.ts.map +1 -0
- package/dist/client/tools/EmbeddedTool.js +199 -0
- package/dist/client/tools/EmbeddedTool.js.map +1 -0
- package/dist/client/tools/ExtensionSlot.d.ts +27 -0
- package/dist/client/tools/ExtensionSlot.d.ts.map +1 -0
- package/dist/client/tools/ExtensionSlot.js +96 -0
- package/dist/client/tools/ExtensionSlot.js.map +1 -0
- package/dist/client/tools/ToolEditor.d.ts +5 -0
- package/dist/client/tools/ToolEditor.d.ts.map +1 -0
- package/dist/client/tools/ToolEditor.js +129 -0
- package/dist/client/tools/ToolEditor.js.map +1 -0
- package/dist/client/tools/ToolViewer.d.ts +5 -0
- package/dist/client/tools/ToolViewer.d.ts.map +1 -0
- package/dist/client/tools/ToolViewer.js +400 -0
- package/dist/client/tools/ToolViewer.js.map +1 -0
- package/dist/client/tools/ToolViewerPage.d.ts +2 -0
- package/dist/client/tools/ToolViewerPage.d.ts.map +1 -0
- package/dist/client/tools/ToolViewerPage.js +24 -0
- package/dist/client/tools/ToolViewerPage.js.map +1 -0
- package/dist/client/tools/ToolsListPage.d.ts +2 -0
- package/dist/client/tools/ToolsListPage.d.ts.map +1 -0
- package/dist/client/tools/ToolsListPage.js +67 -0
- package/dist/client/tools/ToolsListPage.js.map +1 -0
- package/dist/client/tools/ToolsSidebarSection.d.ts +2 -0
- package/dist/client/tools/ToolsSidebarSection.d.ts.map +1 -0
- package/dist/client/tools/ToolsSidebarSection.js +236 -0
- package/dist/client/tools/ToolsSidebarSection.js.map +1 -0
- package/dist/client/tools/iframe-bridge.d.ts +38 -0
- package/dist/client/tools/iframe-bridge.d.ts.map +1 -0
- package/dist/client/tools/iframe-bridge.js +207 -0
- package/dist/client/tools/iframe-bridge.js.map +1 -0
- package/dist/client/tools/index.d.ts +8 -0
- package/dist/client/tools/index.d.ts.map +1 -0
- package/dist/client/tools/index.js +8 -0
- package/dist/client/tools/index.js.map +1 -0
- package/dist/client/tools/tool-order.d.ts +7 -0
- package/dist/client/tools/tool-order.d.ts.map +1 -0
- package/dist/client/tools/tool-order.js +47 -0
- package/dist/client/tools/tool-order.js.map +1 -0
- 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 +316 -65
- 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 +65 -17
- 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/local-migration.d.ts +41 -0
- package/dist/server/local-migration.d.ts.map +1 -0
- package/dist/server/local-migration.js +235 -0
- package/dist/server/local-migration.js.map +1 -0
- 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 +74 -19
- 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/tools/actions.d.ts +3 -0
- package/dist/tools/actions.d.ts.map +1 -0
- package/dist/tools/actions.js +272 -0
- package/dist/tools/actions.js.map +1 -0
- package/dist/tools/fetch-tool.d.ts +23 -0
- package/dist/tools/fetch-tool.d.ts.map +1 -0
- package/dist/tools/fetch-tool.js +178 -0
- package/dist/tools/fetch-tool.js.map +1 -0
- package/dist/tools/html-shell.d.ts +45 -0
- package/dist/tools/html-shell.d.ts.map +1 -0
- package/dist/tools/html-shell.js +514 -0
- package/dist/tools/html-shell.js.map +1 -0
- package/dist/tools/proxy-security.d.ts +12 -0
- package/dist/tools/proxy-security.d.ts.map +1 -0
- package/dist/tools/proxy-security.js +158 -0
- package/dist/tools/proxy-security.js.map +1 -0
- package/dist/tools/routes.d.ts +2 -0
- package/dist/tools/routes.d.ts.map +1 -0
- package/dist/tools/routes.js +627 -0
- package/dist/tools/routes.js.map +1 -0
- package/dist/tools/schema.d.ts +664 -0
- package/dist/tools/schema.d.ts.map +1 -0
- package/dist/tools/schema.js +146 -0
- package/dist/tools/schema.js.map +1 -0
- package/dist/tools/slots/routes.d.ts +15 -0
- package/dist/tools/slots/routes.d.ts.map +1 -0
- package/dist/tools/slots/routes.js +94 -0
- package/dist/tools/slots/routes.js.map +1 -0
- package/dist/tools/slots/schema.d.ts +303 -0
- package/dist/tools/slots/schema.d.ts.map +1 -0
- package/dist/tools/slots/schema.js +76 -0
- package/dist/tools/slots/schema.js.map +1 -0
- package/dist/tools/slots/store.d.ts +66 -0
- package/dist/tools/slots/store.d.ts.map +1 -0
- package/dist/tools/slots/store.js +227 -0
- package/dist/tools/slots/store.js.map +1 -0
- package/dist/tools/store.d.ts +40 -0
- package/dist/tools/store.d.ts.map +1 -0
- package/dist/tools/store.js +193 -0
- package/dist/tools/store.js.map +1 -0
- package/dist/tools/theme.d.ts +2 -0
- package/dist/tools/theme.d.ts.map +1 -0
- package/dist/tools/theme.js +67 -0
- package/dist/tools/theme.js.map +1 -0
- package/dist/tools/url-safety.d.ts +24 -0
- package/dist/tools/url-safety.d.ts.map +1 -0
- package/dist/tools/url-safety.js +224 -0
- package/dist/tools/url-safety.js.map +1 -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
|
@@ -20,35 +20,47 @@ The agent modifies data in SQL, but the UI runs in the browser. Polling bridges
|
|
|
20
20
|
|
|
21
21
|
1. **Server** increments a version counter on every database write. The `/_agent-native/poll` endpoint returns the current version and any events since the last poll.
|
|
22
22
|
|
|
23
|
-
2. **Client** polls for changes and
|
|
23
|
+
2. **Client** polls for changes and updates per-source counters:
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
26
|
import { useDbSync } from "@agent-native/core";
|
|
27
|
-
useDbSync({ queryClient
|
|
27
|
+
useDbSync({ queryClient });
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
3.
|
|
30
|
+
3. **Templates fold a per-source counter into the relevant query key.** When the source advances, only the dependent query refetches:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { useChangeVersion } from "@agent-native/core/client";
|
|
34
|
+
|
|
35
|
+
const v = useChangeVersion("items"); // or "settings", "dashboards", "action", etc.
|
|
36
|
+
const { data } = useQuery({
|
|
37
|
+
queryKey: ["items", v],
|
|
38
|
+
queryFn: fetchItems,
|
|
39
|
+
placeholderData: (prev) => prev,
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
4. When the agent writes to the database, the server emits a `recordChange({ source, ... })` event. `useDbSync` bumps the matching counter; any query with that counter in its key refetches; everything else stays untouched.
|
|
31
44
|
|
|
32
45
|
## Don't
|
|
33
46
|
|
|
34
47
|
- Don't create manual polling loops — `useDbSync()` handles it (polls every 2 seconds by default)
|
|
35
48
|
- Don't create your own fetch-based polling alongside `useDbSync` — use the `onEvent` callback for custom handling
|
|
36
49
|
|
|
37
|
-
##
|
|
50
|
+
## Tuning refetch behavior
|
|
38
51
|
|
|
39
|
-
|
|
52
|
+
`useDbSync` invalidates every active query on any non-own change event. The `onEvent` callback still fires with each change event, so templates can layer surgical extras on top — for example, invalidating an inactive query that wouldn't otherwise refetch:
|
|
40
53
|
|
|
41
54
|
```ts
|
|
42
55
|
useDbSync({
|
|
43
56
|
queryClient,
|
|
44
|
-
queryKeys: [], // don't auto-invalidate everything
|
|
45
57
|
onEvent: (data) => {
|
|
46
58
|
if (data.source === "settings") {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
59
|
+
// Force a refetch even when not actively observed
|
|
60
|
+
queryClient.invalidateQueries({
|
|
61
|
+
queryKey: ["settings"],
|
|
62
|
+
refetchType: "all",
|
|
63
|
+
});
|
|
52
64
|
}
|
|
53
65
|
},
|
|
54
66
|
});
|
|
@@ -66,11 +78,11 @@ useQuery({
|
|
|
66
78
|
|
|
67
79
|
## Troubleshooting
|
|
68
80
|
|
|
69
|
-
| Symptom | Check
|
|
70
|
-
| ---------------------------------- |
|
|
71
|
-
| UI not updating after agent writes | Is `useDbSync` called with the correct `queryClient`?
|
|
72
|
-
| Poll endpoint not responding | Is `/_agent-native/poll` accessible? Is the server running?
|
|
73
|
-
| High CPU / event storms | The agent is writing rapidly. Add `staleTime` to queries
|
|
81
|
+
| Symptom | Check |
|
|
82
|
+
| ---------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
83
|
+
| UI not updating after agent writes | Is `useDbSync` called with the correct `queryClient`? Does the affected query have an active observer? |
|
|
84
|
+
| Poll endpoint not responding | Is `/_agent-native/poll` accessible? Is the server running? |
|
|
85
|
+
| High CPU / event storms | The agent is writing rapidly. Add `staleTime` to queries to debounce refetches. |
|
|
74
86
|
|
|
75
87
|
## Jitter Prevention
|
|
76
88
|
|
|
@@ -93,7 +105,6 @@ import { TAB_ID } from "@/lib/tab-id";
|
|
|
93
105
|
|
|
94
106
|
useDbSync({
|
|
95
107
|
queryClient,
|
|
96
|
-
queryKeys: ["app-state", "settings"],
|
|
97
108
|
ignoreSource: TAB_ID,
|
|
98
109
|
});
|
|
99
110
|
```
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: shadcn-ui
|
|
3
|
+
description: >-
|
|
4
|
+
Use when adding, updating, debugging, styling, or composing shadcn/ui
|
|
5
|
+
components, forms, dialogs, menus, charts, sidebars, themes, registries, or
|
|
6
|
+
any project with a components.json file.
|
|
7
|
+
source: https://ui.shadcn.com/docs/skills
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# shadcn/ui
|
|
11
|
+
|
|
12
|
+
This skill keeps shadcn/ui work project-aware. Components are source files in the app, so always inspect the local project before adding, importing, or rewriting them.
|
|
13
|
+
|
|
14
|
+
## First Steps
|
|
15
|
+
|
|
16
|
+
1. Work from the app root that owns `components.json`.
|
|
17
|
+
2. Run `pnpm dlx shadcn@latest info --json` when you need current project context: framework, Tailwind version, aliases, icon library, installed components, and resolved paths.
|
|
18
|
+
3. Use the actual aliases from `components.json` or `shadcn info`; do not assume `@/components/ui` if the project says otherwise.
|
|
19
|
+
4. Check `app/components/ui/` or the resolved `ui` path before importing a component.
|
|
20
|
+
5. For unfamiliar components, run `pnpm dlx shadcn@latest docs <component>` and read the returned docs or examples before coding.
|
|
21
|
+
|
|
22
|
+
## Adding Or Updating Components
|
|
23
|
+
|
|
24
|
+
- Add missing primitives with `pnpm dlx shadcn@latest add <component>` from the app root.
|
|
25
|
+
- Before overwriting an existing component, use `pnpm dlx shadcn@latest add <component> --dry-run` and `--diff` to inspect the change.
|
|
26
|
+
- After adding registry code, read the generated files. Fix import aliases, icon imports, missing subcomponents, and composition issues before using the component.
|
|
27
|
+
- Do not fetch raw component files manually from GitHub when the shadcn CLI can resolve the registry item.
|
|
28
|
+
- If a user asks to add a third-party block but does not name a registry, ask which registry to use instead of guessing.
|
|
29
|
+
|
|
30
|
+
## Component Composition
|
|
31
|
+
|
|
32
|
+
- Use existing primitives before custom markup: `Alert` for callouts, `Badge` for small status labels, `Separator` for dividers, `Skeleton` for placeholders, `Table` for tabular data, and `Card` for framed content.
|
|
33
|
+
- Use full card anatomy when appropriate: `CardHeader`, `CardTitle`, `CardDescription`, `CardContent`, and `CardFooter`.
|
|
34
|
+
- Dialog, Sheet, Drawer, and AlertDialog content must include an accessible title. Use visually hidden titles only when the visible UI already communicates the title.
|
|
35
|
+
- Put items inside their group components: `SelectItem` in `SelectGroup`, `DropdownMenuItem` in `DropdownMenuGroup`, `CommandItem` in `CommandGroup`, and equivalent menu groups.
|
|
36
|
+
- `TabsTrigger` belongs inside `TabsList`.
|
|
37
|
+
- `Avatar` always needs `AvatarFallback`.
|
|
38
|
+
- Buttons do not have magic loading props. Compose loading with `disabled`, `Spinner`, and clear text.
|
|
39
|
+
|
|
40
|
+
## Forms And Inputs
|
|
41
|
+
|
|
42
|
+
- Use the app's shadcn form primitives instead of raw div stacks.
|
|
43
|
+
- If `Field`, `FieldGroup`, `FieldSet`, or `InputGroup` are installed or worth adding, use them for form layout, grouped fields, and input add-ons.
|
|
44
|
+
- Do not place buttons inside inputs with absolute positioning. Use `InputGroup` and `InputGroupAddon` when available.
|
|
45
|
+
- Use `ToggleGroup` for small option sets, `RadioGroup` for one-of-many choices, `Checkbox` for multi-select, `Switch` for settings toggles, `Select` or `Combobox` for predefined choices, and `Slider` or numeric input for numeric values.
|
|
46
|
+
- Validation must be accessible: pair visual invalid states with `aria-invalid`, and connect descriptions/errors to controls.
|
|
47
|
+
|
|
48
|
+
## Styling And Theming
|
|
49
|
+
|
|
50
|
+
- Use semantic tokens (`bg-background`, `text-foreground`, `text-muted-foreground`, `bg-primary`, `border-border`, `text-destructive`) instead of raw colors for reusable app UI.
|
|
51
|
+
- Prefer built-in variants and sizes before custom classes.
|
|
52
|
+
- Use `className` mostly for layout and spacing; avoid overriding component colors and typography unless the component is intentionally being extended.
|
|
53
|
+
- Use `gap-*` instead of `space-x-*` / `space-y-*`.
|
|
54
|
+
- Use `size-*` when width and height are equal.
|
|
55
|
+
- Use `truncate` for single-line clipping.
|
|
56
|
+
- Use `cn()` for conditional classes.
|
|
57
|
+
- Do not add manual `z-index` to overlay primitives unless you are fixing a verified stacking bug.
|
|
58
|
+
- Add custom colors as CSS variables in the existing Tailwind CSS file reported by shadcn info. For Tailwind v4, register variables with `@theme inline`.
|
|
59
|
+
|
|
60
|
+
## Icons
|
|
61
|
+
|
|
62
|
+
- Agent-native apps use `@tabler/icons-react`. Do not add `lucide-react` because a registry example used it.
|
|
63
|
+
- If registry code imports a different icon package, replace those imports with Tabler equivalents before finishing.
|
|
64
|
+
- Let shadcn components size icons through their CSS. Avoid manual icon sizing inside buttons, menus, alerts, and sidebars unless the local component API requires it.
|
|
65
|
+
|
|
66
|
+
## Base-Specific APIs
|
|
67
|
+
|
|
68
|
+
Check the project context before using trigger composition APIs:
|
|
69
|
+
|
|
70
|
+
- Radix-based components use `asChild` for custom triggers.
|
|
71
|
+
- Base UI components may use `render` and sometimes `nativeButton={false}`.
|
|
72
|
+
|
|
73
|
+
Do not wrap triggers in extra divs just to place a Button or Link inside them.
|
|
74
|
+
|
|
75
|
+
## Related Skills
|
|
76
|
+
|
|
77
|
+
- **frontend-design** — Product UX, visual direction, responsive polish, and verification
|
|
78
|
+
- **actions** — Data fetching and mutation patterns for agent-native apps
|
|
79
|
+
- **security** — User data, forms, external input, and action safety
|
|
@@ -9,7 +9,7 @@ This is an **@agent-native/core** application -- the AI agent and UI share state
|
|
|
9
9
|
1. **Shared SQL database** -- All app state lives in SQL (SQLite locally, cloud DB via `DATABASE_URL` in production). Core stores: `application_state`, `settings`, `oauth_tokens`, `sessions`, `resources`.
|
|
10
10
|
2. **All AI through agent chat** -- No inline LLM calls. UI delegates to the AI via `sendToAgentChat()` / `agentChat.submit()`.
|
|
11
11
|
3. **Actions for agent operations** -- `pnpm action <name>` dispatches to callable action files in `actions/`.
|
|
12
|
-
4. **Polling for real-time sync** -- Database writes trigger version counter increments that the UI polls to stay in sync.
|
|
12
|
+
4. **Polling for real-time sync** -- Database writes trigger version counter increments that the UI polls to stay in sync. **When you (the agent) write data, the UI must reflect the change without a manual refresh.** This is non-negotiable. Use `useActionQuery` (auto-covered) or fold `useChangeVersions([<source>, "action"])` into raw `useQuery` keys. See the `real-time-sync` and `adding-a-feature` skills.
|
|
13
13
|
5. **Agent can update code** -- The agent can modify this app's source code directly.
|
|
14
14
|
|
|
15
15
|
### Authentication
|
|
@@ -90,28 +90,31 @@ You do NOT get auto-injected screen state. **Call `pnpm action view-screen` at t
|
|
|
90
90
|
|
|
91
91
|
Skills in `.agents/skills/` provide detailed guidance for each architectural rule. Read them before making changes.
|
|
92
92
|
|
|
93
|
-
| Skill | When to read
|
|
94
|
-
| --------------------- |
|
|
95
|
-
| `
|
|
96
|
-
| `
|
|
97
|
-
| `
|
|
98
|
-
| `
|
|
99
|
-
| `
|
|
100
|
-
| `
|
|
101
|
-
| `
|
|
102
|
-
| `
|
|
103
|
-
| `
|
|
104
|
-
| `
|
|
93
|
+
| Skill | When to read |
|
|
94
|
+
| --------------------- | --------------------------------------------------------------------------------- |
|
|
95
|
+
| `adding-a-feature` | **Read first when adding ANY new feature** — the four-area parity checklist |
|
|
96
|
+
| `real-time-sync` | Before wiring data fetching for anything the agent can mutate (must auto-refresh) |
|
|
97
|
+
| `storing-data` | Before storing or reading any app state |
|
|
98
|
+
| `delegate-to-agent` | Before adding LLM calls or AI delegation |
|
|
99
|
+
| `actions` | Before creating or modifying actions |
|
|
100
|
+
| `self-modifying-code` | Before editing source, components, or styles |
|
|
101
|
+
| `capture-learnings` | Before recording user preferences or corrections |
|
|
102
|
+
| `frontend-design` | Before building or restyling any UI component, page, or layout |
|
|
103
|
+
| `shadcn-ui` | Before adding, updating, or debugging shadcn/ui components |
|
|
104
|
+
| `agent-engines` | Before switching LLM providers or registering a custom engine |
|
|
105
|
+
| `notifications` | Before surfacing alerts/progress to the user or adding channels |
|
|
106
|
+
| `progress` | Before running any task that takes more than a few seconds |
|
|
105
107
|
|
|
106
108
|
## When Adding Features
|
|
107
109
|
|
|
108
|
-
|
|
110
|
+
**Read the `adding-a-feature` skill first** — it has the full four-area checklist (UI / Action / Skills / App-State). Quick summary:
|
|
109
111
|
|
|
110
|
-
1. **Add navigation state entries**
|
|
111
|
-
2. **Enhance view-screen**
|
|
112
|
-
3. **Create domain actions**
|
|
113
|
-
4. **
|
|
114
|
-
5. **
|
|
112
|
+
1. **Add navigation state entries** — extend `app/hooks/use-navigation-state.ts` to track new routes
|
|
113
|
+
2. **Enhance view-screen** — make the view-screen script return relevant context for the new view
|
|
114
|
+
3. **Create domain actions** — add actions in `actions/` for CRUD operations on new data models
|
|
115
|
+
4. **Wire UI for auto-refresh** — use `useActionQuery` (auto-covered) OR fold `useChangeVersions([<source>, "action"])` into raw `useQuery` keys with `placeholderData`. When the agent mutates this data, the UI must reflect the change without a manual refresh. See `real-time-sync` skill.
|
|
116
|
+
5. **Create domain skills** — add `.agents/skills/<feature>/SKILL.md` documenting the data model, storage patterns, and agent operations
|
|
117
|
+
6. **Update this AGENTS.md** — add the new actions, state keys, and common tasks
|
|
115
118
|
|
|
116
119
|
---
|
|
117
120
|
|
|
@@ -35,6 +35,9 @@ export async function run(args: Record<string, string>): Promise<string> {
|
|
|
35
35
|
const nav: Record<string, string> = {};
|
|
36
36
|
if (args.view) nav.view = args.view;
|
|
37
37
|
if (args.path) nav.path = args.path;
|
|
38
|
+
// Unique-per-write token so the UI's `use-navigation-state` hook can dedup
|
|
39
|
+
// race-driven re-reads of the same command.
|
|
40
|
+
nav._writeId = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
38
41
|
await writeAppState("navigate", nav);
|
|
39
42
|
return `Navigating to ${args.view || args.path}`;
|
|
40
43
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
2
|
import { useLocation, useNavigate } from "react-router";
|
|
3
3
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
4
|
import {
|
|
@@ -10,6 +10,10 @@ import {
|
|
|
10
10
|
export interface NavigationState {
|
|
11
11
|
view: string;
|
|
12
12
|
path?: string;
|
|
13
|
+
/** Optional unique-per-write token. Used by the UI to dedup the same
|
|
14
|
+
* command being re-read when the fire-and-forget DELETE below loses its
|
|
15
|
+
* race against the next polling refetch. */
|
|
16
|
+
_writeId?: string;
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
export function useNavigationState() {
|
|
@@ -31,7 +35,11 @@ export function useNavigationState() {
|
|
|
31
35
|
}).catch(() => {});
|
|
32
36
|
}, [location.pathname]);
|
|
33
37
|
|
|
34
|
-
|
|
38
|
+
// Default React Query structuralSharing reuses the previous reference when
|
|
39
|
+
// the JSON is unchanged, so repeated invalidations driven by `useDbSync`
|
|
40
|
+
// (which fire on every relevant app-state event) don't re-fire the
|
|
41
|
+
// useEffect with a brand-new object containing the same command.
|
|
42
|
+
const { data: navCommand } = useQuery<NavigationState | null>({
|
|
35
43
|
queryKey: ["navigate-command"],
|
|
36
44
|
queryFn: async () => {
|
|
37
45
|
const res = await fetch(
|
|
@@ -39,19 +47,35 @@ export function useNavigationState() {
|
|
|
39
47
|
);
|
|
40
48
|
if (!res.ok) return null;
|
|
41
49
|
const data = await res.json();
|
|
42
|
-
return data
|
|
50
|
+
return data ?? null;
|
|
43
51
|
},
|
|
44
52
|
refetchInterval: 2_000,
|
|
45
|
-
structuralSharing: false,
|
|
46
53
|
});
|
|
47
54
|
|
|
55
|
+
const lastProcessedDedupKeyRef = useRef<string | null>(null);
|
|
56
|
+
|
|
48
57
|
useEffect(() => {
|
|
49
58
|
if (!navCommand) return;
|
|
59
|
+
const cmd = navCommand;
|
|
60
|
+
const dedupKey =
|
|
61
|
+
cmd._writeId ?? JSON.stringify({ view: cmd.view, path: cmd.path });
|
|
62
|
+
if (lastProcessedDedupKeyRef.current === dedupKey) {
|
|
63
|
+
// Same command we already handled — the consume-DELETE races against
|
|
64
|
+
// the next polling refetch, so when it loses the same command can show
|
|
65
|
+
// up again. Re-fire DELETE and bail rather than navigate again.
|
|
66
|
+
fetch(agentNativePath("/_agent-native/application-state/navigate"), {
|
|
67
|
+
method: "DELETE",
|
|
68
|
+
headers: { "X-Agent-Native-CSRF": "1" },
|
|
69
|
+
}).catch(() => {});
|
|
70
|
+
qc.setQueryData(["navigate-command"], null);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
lastProcessedDedupKeyRef.current = dedupKey;
|
|
74
|
+
|
|
50
75
|
fetch(agentNativePath("/_agent-native/application-state/navigate"), {
|
|
51
76
|
method: "DELETE",
|
|
52
77
|
headers: { "X-Agent-Native-CSRF": "1" },
|
|
53
78
|
}).catch(() => {});
|
|
54
|
-
const cmd = navCommand as NavigationState;
|
|
55
79
|
|
|
56
80
|
const path = routerPath(cmd.path || pathFromView(cmd.view));
|
|
57
81
|
navigate(path);
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: a2a-protocol
|
|
3
|
+
description: >-
|
|
4
|
+
How agents call other agents via the A2A (agent-to-agent) JSON-RPC protocol.
|
|
5
|
+
Use when enabling inter-agent communication, exposing agent skills to other
|
|
6
|
+
agents, or calling external agents from scripts.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# A2A Protocol (Agent-to-Agent)
|
|
10
|
+
|
|
11
|
+
## Rule
|
|
12
|
+
|
|
13
|
+
Agents can call other agents using the A2A protocol. This is a JSON-RPC-based protocol for agent discovery and communication. Use it when work should go to a different agent entirely — not the local agent chat.
|
|
14
|
+
|
|
15
|
+
## Why
|
|
16
|
+
|
|
17
|
+
Agent-native apps don't exist in isolation. A mail agent might need analytics data. A calendar agent might need to search issues. A2A lets agents discover each other, send messages, and receive structured results — all over HTTP with bearer token auth.
|
|
18
|
+
|
|
19
|
+
## How to Enable A2A (Server Side)
|
|
20
|
+
|
|
21
|
+
Add `mountA2A()` to a server plugin:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
// server/plugins/a2a.ts
|
|
25
|
+
import { mountA2A } from "@agent-native/core/a2a";
|
|
26
|
+
|
|
27
|
+
export default defineNitroPlugin((nitro) => {
|
|
28
|
+
const app = nitro.h3App;
|
|
29
|
+
|
|
30
|
+
mountA2A(app, {
|
|
31
|
+
name: "Analytics Agent",
|
|
32
|
+
description: "Queries analytics data across providers",
|
|
33
|
+
version: "1.0.0",
|
|
34
|
+
skills: [
|
|
35
|
+
{
|
|
36
|
+
id: "query-data",
|
|
37
|
+
name: "Query Data",
|
|
38
|
+
description: "Run analytics queries across connected data sources",
|
|
39
|
+
tags: ["analytics", "data"],
|
|
40
|
+
examples: ["What were last week's signups?", "Show conversion rates"],
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
apiKeyEnv: "A2A_API_KEY", // env var holding the bearer token
|
|
44
|
+
streaming: true, // enable message/stream method
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
This mounts the agent-native A2A endpoints:
|
|
50
|
+
|
|
51
|
+
- `GET /.well-known/agent-card.json` — public agent discovery (no auth required)
|
|
52
|
+
- `POST /_agent-native/a2a` — primary JSON-RPC endpoint (bearer token auth required)
|
|
53
|
+
|
|
54
|
+
The client may fall back to `POST /a2a` for external or legacy peers that only
|
|
55
|
+
expose that simple path. New agent-native apps should document and call the
|
|
56
|
+
`/_agent-native/a2a` endpoint.
|
|
57
|
+
|
|
58
|
+
## The Config Object
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
interface A2AConfig {
|
|
62
|
+
name: string; // agent display name
|
|
63
|
+
description: string; // what this agent does
|
|
64
|
+
version?: string; // semver version (default: "1.0.0")
|
|
65
|
+
skills: AgentSkill[]; // capabilities this agent exposes
|
|
66
|
+
handler?: A2AHandler; // custom message handler
|
|
67
|
+
apiKeyEnv?: string; // env var name for bearer token auth
|
|
68
|
+
streaming?: boolean; // enable streaming responses
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
interface AgentSkill {
|
|
72
|
+
id: string; // unique skill identifier
|
|
73
|
+
name: string; // human-readable name
|
|
74
|
+
description: string; // what this skill does
|
|
75
|
+
tags?: string[]; // categorization tags
|
|
76
|
+
examples?: string[]; // example prompts
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Agent Card
|
|
81
|
+
|
|
82
|
+
The agent card is auto-generated at `GET /.well-known/agent-card.json`. Other agents fetch this to discover what skills are available:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"name": "Analytics Agent",
|
|
87
|
+
"description": "Queries analytics data across providers",
|
|
88
|
+
"url": "https://analytics.example.com",
|
|
89
|
+
"version": "1.0.0",
|
|
90
|
+
"protocolVersion": "0.3",
|
|
91
|
+
"capabilities": { "streaming": true },
|
|
92
|
+
"skills": [
|
|
93
|
+
{
|
|
94
|
+
"id": "query-data",
|
|
95
|
+
"name": "Query Data",
|
|
96
|
+
"description": "Run analytics queries across connected data sources"
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Calling Another Agent
|
|
103
|
+
|
|
104
|
+
### Simple: `callAgent()` (text in, text out)
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
import { callAgent } from "@agent-native/core/a2a";
|
|
108
|
+
|
|
109
|
+
const answer = await callAgent(
|
|
110
|
+
"https://analytics.example.com",
|
|
111
|
+
"What were last week's signups?",
|
|
112
|
+
{ apiKey: process.env.ANALYTICS_A2A_KEY },
|
|
113
|
+
);
|
|
114
|
+
// answer is a plain string
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Advanced: `A2AClient` (full control)
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
import { A2AClient } from "@agent-native/core/a2a";
|
|
121
|
+
|
|
122
|
+
const client = new A2AClient(
|
|
123
|
+
"https://analytics.example.com",
|
|
124
|
+
process.env.ANALYTICS_A2A_KEY,
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
// Discover agent capabilities
|
|
128
|
+
const card = await client.getAgentCard();
|
|
129
|
+
|
|
130
|
+
// Send a message and get a task back
|
|
131
|
+
const task = await client.send({
|
|
132
|
+
role: "user",
|
|
133
|
+
parts: [{ type: "text", text: "What were last week's signups?" }],
|
|
134
|
+
});
|
|
135
|
+
// task.status.state === "completed"
|
|
136
|
+
// task.status.message.parts[0].text === "Last week: 1,247 signups..."
|
|
137
|
+
|
|
138
|
+
// Stream responses
|
|
139
|
+
for await (const update of client.stream({
|
|
140
|
+
role: "user",
|
|
141
|
+
parts: [{ type: "text", text: "Detailed breakdown by day" }],
|
|
142
|
+
})) {
|
|
143
|
+
console.log(update.status.state, update.status.message);
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## JSON-RPC Methods
|
|
148
|
+
|
|
149
|
+
| Method | Purpose | Auth required |
|
|
150
|
+
| ---------------- | -------------------------------- | ------------- |
|
|
151
|
+
| `message/send` | Send a message, get a task back | Yes |
|
|
152
|
+
| `message/stream` | Send a message, stream responses | Yes |
|
|
153
|
+
| `tasks/get` | Get task status by ID | Yes |
|
|
154
|
+
| `tasks/cancel` | Cancel a running task | Yes |
|
|
155
|
+
|
|
156
|
+
## Task Lifecycle
|
|
157
|
+
|
|
158
|
+
Tasks go through these states:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
submitted → working → completed
|
|
162
|
+
→ failed
|
|
163
|
+
→ canceled
|
|
164
|
+
→ input-required
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
- **submitted** — message received, not yet processing
|
|
168
|
+
- **working** — agent is processing the request
|
|
169
|
+
- **completed** — agent finished, result in `status.message`
|
|
170
|
+
- **failed** — agent encountered an error
|
|
171
|
+
- **canceled** — task was canceled via `tasks/cancel`
|
|
172
|
+
- **input-required** — agent needs more information from the caller
|
|
173
|
+
|
|
174
|
+
## Security
|
|
175
|
+
|
|
176
|
+
A2A uses bearer token auth. The server reads the token from the environment variable specified by `apiKeyEnv`:
|
|
177
|
+
|
|
178
|
+
- Set `A2A_API_KEY=my-secret-token` in the server's environment
|
|
179
|
+
- Callers pass it as `Authorization: Bearer my-secret-token`
|
|
180
|
+
- The agent card endpoint (`/.well-known/agent-card.json`) is public — no auth needed for discovery
|
|
181
|
+
|
|
182
|
+
## Message Parts
|
|
183
|
+
|
|
184
|
+
Messages contain typed parts:
|
|
185
|
+
|
|
186
|
+
| Part type | Fields | Use for |
|
|
187
|
+
| --------- | ----------------------------------- | -------------------------- |
|
|
188
|
+
| `text` | `{ type: "text", text: "..." }` | Natural language messages |
|
|
189
|
+
| `file` | `{ type: "file", file: { ... } }` | Files (bytes or URI) |
|
|
190
|
+
| `data` | `{ type: "data", data: { ... } }` | Structured JSON data |
|
|
191
|
+
|
|
192
|
+
## Example: Cross-Agent Workflow
|
|
193
|
+
|
|
194
|
+
A mail agent calls an analytics agent to include data in an email draft:
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
// actions/draft-with-analytics.ts
|
|
198
|
+
import { callAgent } from "@agent-native/core/a2a";
|
|
199
|
+
import { writeAppState } from "@agent-native/core/application-state";
|
|
200
|
+
|
|
201
|
+
export default async function (args: string[]) {
|
|
202
|
+
// Ask the analytics agent for data
|
|
203
|
+
const stats = await callAgent(
|
|
204
|
+
process.env.ANALYTICS_AGENT_URL!,
|
|
205
|
+
"Summarize last week's key metrics in 3 bullet points",
|
|
206
|
+
{ apiKey: process.env.ANALYTICS_A2A_KEY },
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
// Create a draft with the analytics data
|
|
210
|
+
await writeAppState("compose-analytics-report", {
|
|
211
|
+
id: "analytics-report",
|
|
212
|
+
to: "team@example.com",
|
|
213
|
+
subject: "Weekly Analytics Summary",
|
|
214
|
+
body: `Hi team,\n\nHere are last week's numbers:\n\n${stats}\n\nBest`,
|
|
215
|
+
mode: "compose",
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## All Types
|
|
221
|
+
|
|
222
|
+
All types are exported from `@agent-native/core/a2a`:
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
import type {
|
|
226
|
+
A2AConfig,
|
|
227
|
+
A2AHandler,
|
|
228
|
+
A2AHandlerContext,
|
|
229
|
+
A2AHandlerResult,
|
|
230
|
+
AgentCard,
|
|
231
|
+
AgentSkill,
|
|
232
|
+
AgentCapabilities,
|
|
233
|
+
Task,
|
|
234
|
+
TaskState,
|
|
235
|
+
TaskStatus,
|
|
236
|
+
Message,
|
|
237
|
+
Part,
|
|
238
|
+
TextPart,
|
|
239
|
+
FilePart,
|
|
240
|
+
DataPart,
|
|
241
|
+
Artifact,
|
|
242
|
+
JsonRpcRequest,
|
|
243
|
+
JsonRpcResponse,
|
|
244
|
+
} from "@agent-native/core/a2a";
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## Related Skills
|
|
248
|
+
|
|
249
|
+
- **delegate-to-agent** — For work the local agent handles. Use A2A when the work goes to a different agent.
|
|
250
|
+
- **scripts** — A2A calls typically happen in scripts
|
|
251
|
+
- **storing-data** — Results from A2A calls are stored in SQL like any other data
|