@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
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: portability
|
|
3
|
+
description: >-
|
|
4
|
+
How to keep template code database-agnostic and hosting-agnostic. Use when
|
|
5
|
+
defining schemas, writing raw SQL, creating server routes, or anything that
|
|
6
|
+
could leak a SQLite-only, Postgres-only, or Node-only assumption.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Portability
|
|
10
|
+
|
|
11
|
+
## Rule
|
|
12
|
+
|
|
13
|
+
**Never write code that only works on one database or one hosting platform.** Templates must run on any SQL database (SQLite, Postgres, D1, Turso, Supabase, Neon) and any Nitro deploy target (Node, Cloudflare, Netlify, Vercel, Deno, Lambda, Bun) without code changes.
|
|
14
|
+
|
|
15
|
+
## Database Agnostic
|
|
16
|
+
|
|
17
|
+
Use the dialect-agnostic schema helpers from `@agent-native/core/db/schema`:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import {
|
|
21
|
+
table,
|
|
22
|
+
text,
|
|
23
|
+
integer,
|
|
24
|
+
real,
|
|
25
|
+
now,
|
|
26
|
+
sql,
|
|
27
|
+
} from "@agent-native/core/db/schema";
|
|
28
|
+
|
|
29
|
+
export const meals = table("meals", {
|
|
30
|
+
id: text("id").primaryKey(),
|
|
31
|
+
name: text("name").notNull(),
|
|
32
|
+
calories: integer("calories").notNull(),
|
|
33
|
+
weight: real("weight"),
|
|
34
|
+
archived: integer("archived", { mode: "boolean" }).notNull().default(false),
|
|
35
|
+
createdAt: text("created_at").notNull().default(now()),
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
| Helper | Purpose |
|
|
40
|
+
| --------- | ----------------------------------------------------------------------------------------- |
|
|
41
|
+
| `table` | Delegates to `pgTable` or `sqliteTable` based on dialect |
|
|
42
|
+
| `text` | Works in both dialects, supports `{ enum: [...] }` |
|
|
43
|
+
| `integer` | `{ mode: "boolean" }` maps to Postgres `boolean` automatically |
|
|
44
|
+
| `real` | `real` on SQLite, `double precision` on Postgres |
|
|
45
|
+
| `now` | Dialect-agnostic current timestamp — use with `.default(now())` on text timestamp columns |
|
|
46
|
+
| `sql` | Re-exported from `drizzle-orm` for raw SQL expressions |
|
|
47
|
+
|
|
48
|
+
**Never import from `drizzle-orm/sqlite-core` or `drizzle-orm/pg-core` directly in template code.** Always use `@agent-native/core/db/schema` instead.
|
|
49
|
+
|
|
50
|
+
### Raw SQL helpers
|
|
51
|
+
|
|
52
|
+
- `getDbExec()` — auto-converts `?` params to `$1` for Postgres
|
|
53
|
+
- `isPostgres()` — runtime dialect check
|
|
54
|
+
- `intType()` — returns correct integer type for the dialect
|
|
55
|
+
|
|
56
|
+
### Never
|
|
57
|
+
|
|
58
|
+
Never write SQLite-only syntax: `INSERT OR REPLACE`, `AUTOINCREMENT`, `datetime('now')`. When writing docs, say "SQL database" — not "SQLite".
|
|
59
|
+
|
|
60
|
+
## Hosting Agnostic
|
|
61
|
+
|
|
62
|
+
The server runs on **Nitro** with **H3** as the HTTP framework. Templates must be deployable to any Nitro-supported target.
|
|
63
|
+
|
|
64
|
+
### Never use Express
|
|
65
|
+
|
|
66
|
+
All server code uses H3/Nitro: `defineEventHandler`, `readBody`, `getMethod`, `setResponseHeader`, etc. Express is not a dependency. If you see Express types or patterns anywhere, replace them with H3 equivalents.
|
|
67
|
+
|
|
68
|
+
### No platform-specific config in templates
|
|
69
|
+
|
|
70
|
+
Files like `netlify.toml`, `wrangler.toml`, `vercel.json`, and `netlify/functions/` do not belong in template source. Platform configuration lives in CI/hosting dashboards or in deployment-specific repos.
|
|
71
|
+
|
|
72
|
+
### No Node APIs in server routes/plugins
|
|
73
|
+
|
|
74
|
+
Never use `fs`, `child_process`, or `path` in server routes and plugins. Use Nitro abstractions. (Actions in `actions/` run in Node.js and can use Node APIs freely.)
|
|
75
|
+
|
|
76
|
+
### No persistent-process assumptions
|
|
77
|
+
|
|
78
|
+
Never assume a persistent server process. Use the SQL database for all state.
|
|
79
|
+
|
|
80
|
+
## Related Skills
|
|
81
|
+
|
|
82
|
+
- `storing-data` — Schema patterns and the core SQL stores
|
|
83
|
+
- `server-plugins` — Framework routes and H3 handler patterns
|
|
84
|
+
- `security` — SQL injection prevention via parameterized queries
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qa
|
|
3
|
+
description: >-
|
|
4
|
+
Autonomous QA testing across template apps using Playwright. Use when testing
|
|
5
|
+
apps end-to-end, finding and fixing bugs, or running a QA sweep. Invoke as
|
|
6
|
+
/qa with optional --apps and --focus args.
|
|
7
|
+
user-invocable: true
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# QA Testing
|
|
11
|
+
|
|
12
|
+
Autonomous QA testing that spins up template apps, tests them with Playwright in parallel, fixes issues, retests, and reports findings. Only alerts the user when blocked.
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
/qa # test mail, calendar, content, forms
|
|
18
|
+
/qa --apps mail,forms # test specific apps
|
|
19
|
+
/qa --focus "test form submission and compose" # prioritize specific flows
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Args:**
|
|
23
|
+
|
|
24
|
+
- `--apps` — comma-separated app names (default: `mail,calendar,content,forms`)
|
|
25
|
+
- `--focus` — natural language guidance for what to prioritize
|
|
26
|
+
|
|
27
|
+
## Orchestrator Steps
|
|
28
|
+
|
|
29
|
+
You (the agent running this skill) are the orchestrator. Follow these steps in order.
|
|
30
|
+
|
|
31
|
+
### Step 1: Parse Args
|
|
32
|
+
|
|
33
|
+
Parse the user's invocation to determine:
|
|
34
|
+
|
|
35
|
+
- **apps**: which apps to test (default: mail, calendar, content, forms)
|
|
36
|
+
- **focus**: optional test priority guidance
|
|
37
|
+
|
|
38
|
+
### Step 2: Check Credential Readiness
|
|
39
|
+
|
|
40
|
+
For each app, check if required credentials exist:
|
|
41
|
+
|
|
42
|
+
| App | Check | Can test without? |
|
|
43
|
+
|----------|-------------------------------------------------|-------------------|
|
|
44
|
+
| forms | No credentials needed | Yes |
|
|
45
|
+
| content | No credentials needed (Notion is opt-in) | Yes |
|
|
46
|
+
| calendar | `templates/calendar/.env` has GOOGLE_CLIENT_ID | Partially — local events work, Google sync won't |
|
|
47
|
+
| mail | `templates/mail/.env` has GOOGLE_CLIENT_ID | Partially — UI renders, Gmail features won't |
|
|
48
|
+
|
|
49
|
+
Read each app's `.env` file (if it exists) to check. If credentials are missing:
|
|
50
|
+
|
|
51
|
+
- Still test the app — many features work without external APIs
|
|
52
|
+
- Include in the tester's instructions: "No Google credentials found. Test local features. Flag any feature that crashes without credentials as 'needs credentials' rather than a bug."
|
|
53
|
+
- Only alert the user (via SendMessage to team lead or AskUserQuestion) if the app **cannot start at all**
|
|
54
|
+
|
|
55
|
+
### Step 3: Start Dev Servers
|
|
56
|
+
|
|
57
|
+
Start each app's dev server on a dedicated port using `run_in_background`:
|
|
58
|
+
|
|
59
|
+
| App | Port | Command |
|
|
60
|
+
|----------|------|---------|
|
|
61
|
+
| mail | 9201 | `cd templates/mail && PORT=9201 pnpm dev` |
|
|
62
|
+
| calendar | 9202 | `cd templates/calendar && PORT=9202 pnpm dev` |
|
|
63
|
+
| content | 9203 | `cd templates/content && PORT=9203 pnpm dev` |
|
|
64
|
+
| forms | 9204 | `cd templates/forms && PORT=9204 pnpm dev` |
|
|
65
|
+
|
|
66
|
+
Start all servers in parallel (multiple Bash calls with `run_in_background: true`).
|
|
67
|
+
|
|
68
|
+
Then verify each server is ready by polling with curl:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
for i in {1..30}; do curl -s -o /dev/null -w "%{http_code}" http://localhost:9201 && break; sleep 1; done
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
If a server fails to start within 30 seconds, skip that app and note it in the report.
|
|
75
|
+
|
|
76
|
+
### Step 4: Generate Test Plans
|
|
77
|
+
|
|
78
|
+
For each app, read these files to understand what to test:
|
|
79
|
+
|
|
80
|
+
1. `templates/<app>/app/routes/` or `templates/<app>/app/routes.ts` — discover all pages
|
|
81
|
+
2. `templates/<app>/CLAUDE.md` — features, API routes, data model
|
|
82
|
+
3. `templates/<app>/server/routes/api/` — API endpoints
|
|
83
|
+
|
|
84
|
+
Combine with any `--focus` guidance to produce a test plan. The test plan is a numbered list of user-facing flows to verify. Example:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
1. Home page loads without errors
|
|
88
|
+
2. Create a new item via the UI
|
|
89
|
+
3. Edit an existing item
|
|
90
|
+
4. Delete an item
|
|
91
|
+
5. Check all navigation links work
|
|
92
|
+
6. Verify no console errors on any page
|
|
93
|
+
7. Verify no failed network requests
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Step 5: Create Team and Spawn Testers
|
|
97
|
+
|
|
98
|
+
Create a team and spawn one tester agent per app, all in parallel:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
TeamCreate: name="qa", description="QA testing sweep"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Create one task per app:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
TaskCreate: subject="QA test <app> on port <port>", description="<test plan>"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Then spawn tester agents in parallel using the Agent tool. Each agent gets:
|
|
111
|
+
|
|
112
|
+
- `name`: `qa-<app>` (e.g., `qa-mail`)
|
|
113
|
+
- `team_name`: `qa`
|
|
114
|
+
- `mode`: `auto`
|
|
115
|
+
- The full tester prompt (see Tester Agent Prompt below)
|
|
116
|
+
|
|
117
|
+
### Step 6: Monitor and Alert
|
|
118
|
+
|
|
119
|
+
After spawning testers, wait for their idle notifications and task updates.
|
|
120
|
+
|
|
121
|
+
- When a tester completes its task, note its findings
|
|
122
|
+
- When a tester reports being blocked (missing credentials, app won't start, needs user input), relay that to the user via AskUserQuestion
|
|
123
|
+
- When all testers are done, proceed to Step 7
|
|
124
|
+
|
|
125
|
+
### Step 7: Compile Report and Shutdown
|
|
126
|
+
|
|
127
|
+
Gather all tester reports from their task updates. Print a compiled summary:
|
|
128
|
+
|
|
129
|
+
```markdown
|
|
130
|
+
# QA Summary — <date>
|
|
131
|
+
|
|
132
|
+
## Apps Tested: N
|
|
133
|
+
## Total Issues Found: N
|
|
134
|
+
## Fixed: N
|
|
135
|
+
## Needs Review: N
|
|
136
|
+
|
|
137
|
+
### Mail App
|
|
138
|
+
[tester report]
|
|
139
|
+
|
|
140
|
+
### Forms App
|
|
141
|
+
[tester report]
|
|
142
|
+
|
|
143
|
+
...
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Then shut down all teammates:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
SendMessage to each tester: { type: "shutdown_request" }
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Tester Agent Prompt
|
|
155
|
+
|
|
156
|
+
Use this as the prompt when spawning each tester agent via the Agent tool. Fill in the `{{placeholders}}`:
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
**START OF TESTER PROMPT**
|
|
161
|
+
|
|
162
|
+
You are a QA tester for the **{{app_name}}** app running at `http://localhost:{{port}}`.
|
|
163
|
+
|
|
164
|
+
## Your Mission
|
|
165
|
+
|
|
166
|
+
Test the app thoroughly using Playwright MCP tools. Find bugs, fix them, retest. Report your findings.
|
|
167
|
+
|
|
168
|
+
## Team Context
|
|
169
|
+
|
|
170
|
+
You are on team "qa". Your name is "qa-{{app_name}}".
|
|
171
|
+
|
|
172
|
+
- Use TaskUpdate to mark your task as `in_progress` when you start
|
|
173
|
+
- Use TaskUpdate to mark your task as `completed` when done, with your report in the description
|
|
174
|
+
- If you are blocked and need user input, send a message to the team lead explaining what you need
|
|
175
|
+
|
|
176
|
+
## Credential Status
|
|
177
|
+
|
|
178
|
+
{{credential_status}}
|
|
179
|
+
|
|
180
|
+
## Test Plan
|
|
181
|
+
|
|
182
|
+
{{test_plan}}
|
|
183
|
+
|
|
184
|
+
## How to Test
|
|
185
|
+
|
|
186
|
+
Use these Playwright MCP tools:
|
|
187
|
+
|
|
188
|
+
1. **Navigate**: `browser_navigate` to `http://localhost:{{port}}<path>`
|
|
189
|
+
2. **See the page**: `browser_snapshot` — returns an accessibility tree showing all visible elements with `ref` attributes
|
|
190
|
+
3. **Click**: `browser_click` with `ref` from the snapshot
|
|
191
|
+
4. **Type**: `browser_type` with `ref` and `text`
|
|
192
|
+
5. **Fill forms**: `browser_fill_form` with `ref` and `values`
|
|
193
|
+
6. **Check console**: `browser_console_messages` — look for errors
|
|
194
|
+
7. **Check network**: `browser_network_requests` — look for failed requests (4xx, 5xx)
|
|
195
|
+
8. **Wait**: `browser_wait_for` when you need to wait for content to appear
|
|
196
|
+
9. **Screenshot**: `browser_take_screenshot` when you want to capture the visual state
|
|
197
|
+
|
|
198
|
+
### Testing Loop
|
|
199
|
+
|
|
200
|
+
For each test in your plan:
|
|
201
|
+
|
|
202
|
+
1. Navigate to the relevant page
|
|
203
|
+
2. Take a snapshot to see what's on screen
|
|
204
|
+
3. Check console messages for errors
|
|
205
|
+
4. Check network requests for failures
|
|
206
|
+
5. Interact with the page — click buttons, fill forms, navigate flows
|
|
207
|
+
6. If something is broken:
|
|
208
|
+
a. Document: what page, what's wrong
|
|
209
|
+
b. Read the relevant source files to understand the issue
|
|
210
|
+
c. Fix the code
|
|
211
|
+
d. Wait 2-3 seconds for Vite HMR to hot-reload
|
|
212
|
+
e. Retest by taking a new snapshot
|
|
213
|
+
f. If still broken after 3 attempts, mark as "needs human review" and move on
|
|
214
|
+
7. Move to the next test
|
|
215
|
+
|
|
216
|
+
After completing all tests, do **one more pass** on any pages where you found issues to verify fixes didn't break other things.
|
|
217
|
+
|
|
218
|
+
**Maximum 2 full passes.** Don't loop forever.
|
|
219
|
+
|
|
220
|
+
### Start by navigating to the home page
|
|
221
|
+
|
|
222
|
+
Always start by navigating to `http://localhost:{{port}}/` and taking a snapshot to verify the app is running.
|
|
223
|
+
|
|
224
|
+
If the app shows an error page or fails to load, check the dev server output and try to diagnose. If it's a missing dependency or config issue, report it and stop — don't spend time debugging infrastructure.
|
|
225
|
+
|
|
226
|
+
## Isolation Rules
|
|
227
|
+
|
|
228
|
+
**CRITICAL:** You may ONLY modify files within `templates/{{app_name}}/`. If a bug requires changes to `packages/core/` or any other template, report it as a finding but do NOT fix it.
|
|
229
|
+
|
|
230
|
+
After modifying any source file, run:
|
|
231
|
+
```bash
|
|
232
|
+
npx prettier --write <file>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## What Counts as a Bug
|
|
236
|
+
|
|
237
|
+
- Page crashes or shows error overlay
|
|
238
|
+
- Console errors (not warnings — errors only)
|
|
239
|
+
- Network requests returning 4xx or 5xx
|
|
240
|
+
- Buttons/links that don't work
|
|
241
|
+
- Forms that don't submit
|
|
242
|
+
- Data that doesn't save or display
|
|
243
|
+
- Layout severely broken (overlapping text, invisible elements)
|
|
244
|
+
- Features described in CLAUDE.md that don't work
|
|
245
|
+
|
|
246
|
+
What is NOT a bug:
|
|
247
|
+
- Minor styling preferences
|
|
248
|
+
- Missing features that aren't described in CLAUDE.md
|
|
249
|
+
- Warnings in console
|
|
250
|
+
- Slow loading (unless > 10 seconds)
|
|
251
|
+
|
|
252
|
+
## Report Format
|
|
253
|
+
|
|
254
|
+
When you're done, update your task (via TaskUpdate) with status `completed` and set the description to your report:
|
|
255
|
+
|
|
256
|
+
```markdown
|
|
257
|
+
## QA Report: {{app_name}}
|
|
258
|
+
|
|
259
|
+
### Summary: N found, N fixed, N needs review
|
|
260
|
+
|
|
261
|
+
#### Fixed
|
|
262
|
+
1. **Short description** — What file you changed and why
|
|
263
|
+
|
|
264
|
+
#### Needs Review
|
|
265
|
+
1. **Short description** — Why you couldn't fix it
|
|
266
|
+
|
|
267
|
+
#### Skipped (needs credentials)
|
|
268
|
+
1. **Feature name** — What credential is needed
|
|
269
|
+
|
|
270
|
+
#### Pages Tested
|
|
271
|
+
- /path (page name) — status (OK, N issues fixed, N needs review)
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
**END OF TESTER PROMPT**
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Troubleshooting
|
|
279
|
+
|
|
280
|
+
### Port already in use
|
|
281
|
+
|
|
282
|
+
Kill the process on the port before starting:
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
lsof -ti :9201 | xargs kill -9 2>/dev/null; true
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### Dev server won't start
|
|
289
|
+
|
|
290
|
+
Common causes:
|
|
291
|
+
|
|
292
|
+
- Missing `node_modules` — run `pnpm install` from root first
|
|
293
|
+
- Missing `.env` file — some apps need one even if empty. Check `.env.example`
|
|
294
|
+
- Port conflict — kill stale processes (see above)
|
|
295
|
+
- Build error in core — run `pnpm --filter @agent-native/core build` first
|
|
296
|
+
|
|
297
|
+
### Playwright MCP not responding
|
|
298
|
+
|
|
299
|
+
The Playwright MCP server must be configured in Claude Code's MCP settings. If browser tools aren't available, the tester agent should report "Playwright MCP tools not available" and stop.
|
|
300
|
+
|
|
301
|
+
### HMR not picking up changes
|
|
302
|
+
|
|
303
|
+
After editing a file, wait 2-3 seconds. If the page doesn't update, try a hard refresh by navigating away and back. Vite HMR sometimes misses changes in server-side files — restart the dev server if needed.
|
|
304
|
+
|
|
305
|
+
### App shows "credentials not configured" when they are
|
|
306
|
+
|
|
307
|
+
This is a known issue. The tester should:
|
|
308
|
+
|
|
309
|
+
1. Check the `.env` file exists and has the right variable names
|
|
310
|
+
2. Check if the app reads from `.env` or `data/.env`
|
|
311
|
+
3. Check the server plugin that loads credentials
|
|
312
|
+
4. Try to fix the credential detection logic
|
|
313
|
+
5. If unfixable, report as "needs review" with details about what the app expects vs. what's configured
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: real-time-collab
|
|
3
|
+
description: >-
|
|
4
|
+
Multi-user collaborative editing with Yjs CRDT and live cursors. Use when
|
|
5
|
+
adding real-time collaborative editing to a template, debugging sync issues,
|
|
6
|
+
or understanding how the agent and humans edit documents simultaneously.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Real-Time Collaboration
|
|
10
|
+
|
|
11
|
+
## Rule
|
|
12
|
+
|
|
13
|
+
Collaborative editing uses Yjs CRDT via TipTap. The agent and human users are equal participants — both edit the same Y.Doc and changes merge cleanly without conflicts.
|
|
14
|
+
|
|
15
|
+
## How It Works
|
|
16
|
+
|
|
17
|
+
- **`Y.Doc`** stores the document as a `Y.XmlFragment` (ProseMirror node tree)
|
|
18
|
+
- **TipTap's Collaboration extension** binds the editor to the Y.XmlFragment via `ySyncPlugin`
|
|
19
|
+
- **CollaborationCaret extension** renders remote users' cursors with names and colors
|
|
20
|
+
- **Polling** (every 2s) syncs Y.Doc updates and awareness state between clients and server
|
|
21
|
+
- **SQL `_collab_docs` table** persists Yjs state as base64-encoded binary (works across SQLite/Postgres)
|
|
22
|
+
|
|
23
|
+
## Agent + Human Editing
|
|
24
|
+
|
|
25
|
+
1. **Human edits** → TipTap → ySyncPlugin → Y.XmlFragment → `POST /_agent-native/collab/:docId/update`
|
|
26
|
+
2. **Agent edits** → `edit-document` action → server search-replace → Y.XmlFragment mutation → poll update → all clients
|
|
27
|
+
|
|
28
|
+
Both produce minimal Yjs operations that merge cleanly. Agent edits appear without destroying cursor position, selection, or undo history.
|
|
29
|
+
|
|
30
|
+
The `edit-document` action uses surgical search-and-replace on Y.XmlText nodes — more efficient than regenerating the entire document.
|
|
31
|
+
|
|
32
|
+
## Enabling Collaboration
|
|
33
|
+
|
|
34
|
+
### 1. Install packages
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pnpm add @tiptap/extension-collaboration @tiptap/extension-collaboration-caret @tiptap/y-tiptap
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 2. Add collab server plugin
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
// server/plugins/collab.ts
|
|
44
|
+
import { createCollabPlugin } from "@agent-native/core/collab";
|
|
45
|
+
|
|
46
|
+
export default createCollabPlugin({
|
|
47
|
+
table: "documents",
|
|
48
|
+
contentColumn: "content",
|
|
49
|
+
idColumn: "id",
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 3. Use the client hook
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { useCollaborativeDoc } from "@agent-native/core/client";
|
|
57
|
+
|
|
58
|
+
const { ydoc, provider } = useCollaborativeDoc(documentId);
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 4. Add TipTap extensions
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
import { Collaboration } from "@tiptap/extension-collaboration";
|
|
65
|
+
import { CollaborationCaret } from "@tiptap/extension-collaboration-caret";
|
|
66
|
+
|
|
67
|
+
const editor = useEditor({
|
|
68
|
+
extensions: [
|
|
69
|
+
Collaboration.configure({ document: ydoc }),
|
|
70
|
+
CollaborationCaret.configure({
|
|
71
|
+
provider,
|
|
72
|
+
user: { name: session.email, color: "#6366f1" },
|
|
73
|
+
}),
|
|
74
|
+
],
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 5. Add to vite.config.ts optimizeDeps
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
optimizeDeps: {
|
|
82
|
+
include: [
|
|
83
|
+
"@tiptap/extension-collaboration",
|
|
84
|
+
"@tiptap/extension-collaboration-caret",
|
|
85
|
+
"@tiptap/y-tiptap",
|
|
86
|
+
],
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Collab Routes (auto-mounted)
|
|
91
|
+
|
|
92
|
+
| Route | Purpose |
|
|
93
|
+
| ----- | ------- |
|
|
94
|
+
| `GET /_agent-native/collab/:docId/state` | Fetch full Y.Doc state |
|
|
95
|
+
| `POST /_agent-native/collab/:docId/update` | Apply client Yjs update |
|
|
96
|
+
| `POST /_agent-native/collab/:docId/text` | Apply full text (diff-based) |
|
|
97
|
+
| `POST /_agent-native/collab/:docId/search-replace` | Surgical find/replace in Y.XmlFragment |
|
|
98
|
+
| `POST /_agent-native/collab/:docId/awareness` | Sync cursor/presence state |
|
|
99
|
+
| `GET /_agent-native/collab/:docId/users` | List active users |
|
|
100
|
+
|
|
101
|
+
## Common Pitfalls
|
|
102
|
+
|
|
103
|
+
- **Don't pass `content` as a TipTap prop** when Collaboration is enabled — Yjs owns the content. Set initial content via the Y.Doc instead.
|
|
104
|
+
- **Don't use `editor.setContent()`** for agent edits — it bypasses Yjs and causes conflicts. Use the `search-replace` route or `edit-document` action.
|
|
105
|
+
- **Add packages to `optimizeDeps`** — Vite won't pre-bundle Yjs packages correctly otherwise, causing runtime errors in dev.
|
|
106
|
+
- **One `Y.Doc` per document** — Don't create multiple Y.Doc instances for the same document ID. Use the `useCollaborativeDoc` hook which caches by ID.
|
|
107
|
+
|
|
108
|
+
## Related Skills
|
|
109
|
+
|
|
110
|
+
- `real-time-sync` — Polling infrastructure that delivers Y.Doc updates
|
|
111
|
+
- `storing-data` — The `_collab_docs` table where Yjs state is persisted
|
|
112
|
+
- `self-modifying-code` — Agent edits to collaborative documents go through `edit-document`, not raw SQL
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: real-time-sync
|
|
3
|
+
description: >-
|
|
4
|
+
How to keep the UI in sync with agent changes via SSE plus polling fallback.
|
|
5
|
+
Use when wiring query invalidation for new data models, debugging UI not
|
|
6
|
+
updating, or understanding jitter prevention.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Real-Time Sync
|
|
10
|
+
|
|
11
|
+
## Rule
|
|
12
|
+
|
|
13
|
+
The UI stays in sync with agent/script changes through `useDbSync()`. In-process writes stream over `/_agent-native/events` first; `/_agent-native/poll` remains the cross-process/serverless fallback. When the agent writes to the database, the UI detects the change and updates automatically — no manual refresh needed.
|
|
14
|
+
|
|
15
|
+
## Why
|
|
16
|
+
|
|
17
|
+
The agent modifies data in SQL, but the UI runs in the browser. SSE bridges same-process writes immediately; polling bridges anything SSE cannot see, such as another serverless invocation, cron job, or external script. Every visible write increments a version counter, `useDbSync()` receives the change, and React Query invalidates the relevant caches. This is what makes database writes feel real-time without relying on aggressive polling.
|
|
18
|
+
|
|
19
|
+
## How It Works
|
|
20
|
+
|
|
21
|
+
1. **Server** increments a version counter on every database write. In-process events stream through the authenticated `/_agent-native/events` endpoint.
|
|
22
|
+
|
|
23
|
+
2. **Client** listens for SSE/poll events and updates per-source change counters:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { useDbSync } from "@agent-native/core";
|
|
27
|
+
useDbSync({ queryClient });
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
For each non-own event, `useDbSync` bumps a per-source counter (e.g. `dashboards`, `analyses`, `settings`, `action`) and invalidates a small fixed list of framework-internal prefixes (`["action"]`, `["app-state"]`, `["__set_url__"]`, etc.). It does **not** blanket-invalidate templates' own data queries — that caused a request storm in production.
|
|
31
|
+
|
|
32
|
+
3. **Templates fold per-source counters into their query keys.** This is the pattern that makes "agent writes show up without a manual refresh" reliable:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import { useChangeVersion } from "@agent-native/core/client";
|
|
36
|
+
import { useQuery } from "@tanstack/react-query";
|
|
37
|
+
|
|
38
|
+
const v = useChangeVersion("dashboards");
|
|
39
|
+
const dashboard = useQuery({
|
|
40
|
+
queryKey: ["dashboard", id, v],
|
|
41
|
+
queryFn: () => fetchDashboard(id),
|
|
42
|
+
placeholderData: (prev) => prev, // no flicker on refetch
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
When the agent writes (`update-dashboard` action → server emits `source: "dashboards"`), the counter advances, the queryKey changes, and React Query refetches that one query. The old data stays on screen during the refetch thanks to `placeholderData`.
|
|
47
|
+
|
|
48
|
+
For list/sidebar queries, use the same pattern — pass the counter into the queryKey of every list query you want to keep fresh.
|
|
49
|
+
|
|
50
|
+
3. **Fallback** polling calls `/_agent-native/poll?since=N`. It runs every 2 seconds until SSE is connected, then relaxes to 15 seconds. If SSE is disabled or unavailable, polling continues at the normal cadence.
|
|
51
|
+
|
|
52
|
+
4. When the agent writes to the database, the version increments, SSE/polling detects it, and React Query refetches the affected queries.
|
|
53
|
+
|
|
54
|
+
## Don't
|
|
55
|
+
|
|
56
|
+
- Don't create manual polling loops — `useDbSync()` handles SSE plus fallback polling
|
|
57
|
+
- Don't create your own fetch-based polling alongside `useDbSync` — use the `onEvent` callback for custom handling
|
|
58
|
+
|
|
59
|
+
## Which sources to depend on
|
|
60
|
+
|
|
61
|
+
Common sources you'll fold into query keys:
|
|
62
|
+
|
|
63
|
+
| Source | Bumped by |
|
|
64
|
+
| ----------------- | --------------------------------------------------------------------------- |
|
|
65
|
+
| `action` | The agent runner after every successful mutating action tool call |
|
|
66
|
+
| `app-state` | Writes to `application_state` (navigation, selections, ephemeral UI state) |
|
|
67
|
+
| `settings` | Writes to the `settings` table |
|
|
68
|
+
| `dashboards` | Dashboard CRUD via `upsertDashboard` / `archiveDashboard` etc. |
|
|
69
|
+
| `analyses` | Analysis CRUD |
|
|
70
|
+
| `extensions` | Extension CRUD |
|
|
71
|
+
| `collab` | Yjs collaborative-doc updates |
|
|
72
|
+
| `screen-refresh` | Explicit `refresh-screen` agent tool call |
|
|
73
|
+
|
|
74
|
+
If a query reads data the agent can mutate via more than one path, depend on multiple sources with `useChangeVersions`:
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
const v = useChangeVersions(["dashboards", "action"]);
|
|
78
|
+
useQuery({ queryKey: ["dashboard", id, v], ... });
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`useChangeVersions` returns a single integer that advances whenever any of the listed sources advance.
|
|
82
|
+
|
|
83
|
+
## Tuning refetch behavior
|
|
84
|
+
|
|
85
|
+
To prevent cache thrashing during rapid agent writes, set `staleTime` on your queries:
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
useQuery({
|
|
89
|
+
queryKey: ["items"],
|
|
90
|
+
queryFn: fetchItems,
|
|
91
|
+
staleTime: 2000, // don't refetch within 2 seconds
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Troubleshooting
|
|
96
|
+
|
|
97
|
+
| Symptom | Check |
|
|
98
|
+
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
99
|
+
| UI not updating after agent writes | Is `useDbSync` called with the correct `queryClient`? Does the affected query have an active observer? |
|
|
100
|
+
| Poll endpoint not responding | Is `/_agent-native/poll` accessible? Is the server running? |
|
|
101
|
+
| SSE not connecting | Is `/_agent-native/events` accessible and authenticated? Polling should still keep the UI fresh as fallback. |
|
|
102
|
+
| High CPU / event storms | The agent is writing rapidly. Add `staleTime` to queries to debounce refetches. |
|
|
103
|
+
|
|
104
|
+
## Jitter Prevention
|
|
105
|
+
|
|
106
|
+
When the agent writes to application-state via script helpers (`writeAppState`, `deleteAppState`), the write is automatically tagged with `requestSource: "agent"`. This prevents the UI from overwriting active user edits when it receives the change event.
|
|
107
|
+
|
|
108
|
+
### How it works
|
|
109
|
+
|
|
110
|
+
1. **Agent writes** are tagged: the script helpers in `@agent-native/core/application-state` pass `{ requestSource: "agent" }` to the store.
|
|
111
|
+
2. **UI writes** are tagged: templates send a per-tab ID via the `X-Request-Source` header on PUT/DELETE requests to application-state endpoints.
|
|
112
|
+
3. **Sync filters**: `useDbSync()` accepts an `ignoreSource` option. The UI passes its own tab ID so it ignores events from its own writes — but still picks up events from agents, other tabs, and scripts.
|
|
113
|
+
|
|
114
|
+
### Template setup
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
// app/lib/tab-id.ts
|
|
118
|
+
export const TAB_ID = `tab-${Math.random().toString(36).slice(2, 8)}`;
|
|
119
|
+
|
|
120
|
+
// app/root.tsx
|
|
121
|
+
import { TAB_ID } from "@/lib/tab-id";
|
|
122
|
+
|
|
123
|
+
useDbSync({
|
|
124
|
+
queryClient,
|
|
125
|
+
ignoreSource: TAB_ID,
|
|
126
|
+
});
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The `use-navigation-state.ts` hook sends the same `TAB_ID` in the `X-Request-Source` header when writing navigation state, so the tab that wrote the state does not refetch it.
|
|
130
|
+
|
|
131
|
+
### Why this matters
|
|
132
|
+
|
|
133
|
+
Without jitter prevention, a cycle occurs: the UI writes state, sync detects the change, the UI refetches and re-renders, potentially overwriting what the user is actively editing. With `ignoreSource`, the UI only reacts to changes from other sources (agent scripts, other browser tabs, other users).
|
|
134
|
+
|
|
135
|
+
## Action Routes and Polling
|
|
136
|
+
|
|
137
|
+
Action routes (`/_agent-native/actions/:name`) work with the same sync system. When a POST/PUT/DELETE action writes to the database, the version counter increments and `useDbSync` picks up the change. Frontend mutations via `useActionMutation` automatically invalidate `["action"]` query keys on success, triggering refetches of `useActionQuery` hooks.
|
|
138
|
+
|
|
139
|
+
### Auto-emit on mutating actions
|
|
140
|
+
|
|
141
|
+
The framework emits a poll event with `source: "action"` whenever any non-read-only action runs to completion — whether called via HTTP (`/_agent-native/actions/:name`) or as an agent tool call. Read-only actions (`http: { method: "GET" }` or explicit `readOnly: true`) are skipped.
|
|
142
|
+
|
|
143
|
+
This means UIs don't need the agent to remember to call `refresh-screen` after every mutation. A listener like this (used in the `macros` template) will refresh after any mutating agent call:
|
|
144
|
+
|
|
145
|
+
```ts
|
|
146
|
+
useDbSync({
|
|
147
|
+
queryClient,
|
|
148
|
+
queryKeys: [],
|
|
149
|
+
ignoreSource: TAB_ID,
|
|
150
|
+
onEvent: (data) => {
|
|
151
|
+
if (data.requestSource === TAB_ID) return;
|
|
152
|
+
// Invalidate all useActionQuery caches so list-*, get-*, etc. refetch
|
|
153
|
+
queryClient.invalidateQueries({ queryKey: ["action"] });
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
`refresh-screen` remains available for unusual cases — e.g. the agent mutated data via a path the framework can't see (external system the app mirrors), or the agent wants to pass a `scope` hint for narrower invalidation.
|
|
159
|
+
|
|
160
|
+
## Related Skills
|
|
161
|
+
|
|
162
|
+
- **storing-data** — Application-state and settings are the data stores that sync via polling
|
|
163
|
+
- **context-awareness** — Navigation state writes use jitter prevention to avoid overwriting active edits
|
|
164
|
+
- **actions** — Action routes auto-expose actions as HTTP endpoints; database writes trigger poll events
|
|
165
|
+
- **self-modifying-code** — Agent code edits trigger poll events; rapid edits can cause event storms
|