@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
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useRef, useEffect, useCallback } from "react";
|
|
3
|
-
import { IconX, IconPlus, IconHistory, IconSearch } from "@tabler/icons-react";
|
|
2
|
+
import { useState, useRef, useEffect, useCallback, useMemo, } from "react";
|
|
3
|
+
import { IconX, IconPlus, IconHistory, IconSearch, IconLink, IconLinkOff, IconCheck, } from "@tabler/icons-react";
|
|
4
4
|
import { AssistantChat, } from "./AssistantChat.js";
|
|
5
5
|
import { isTrustedFrameMessage } from "./frame.js";
|
|
6
6
|
import { cn } from "./utils.js";
|
|
7
7
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./components/ui/tooltip.js";
|
|
8
|
-
import {
|
|
8
|
+
import { Popover, PopoverContent, PopoverTrigger, } from "./components/ui/popover.js";
|
|
9
|
+
import { useChatThreads, } from "./use-chat-threads.js";
|
|
9
10
|
import { agentNativePath } from "./api-path.js";
|
|
10
11
|
import { RunStuckBanner } from "./RunStuckBanner.js";
|
|
11
12
|
import { DEFAULT_MODEL } from "../agent/default-model.js";
|
|
@@ -78,8 +79,98 @@ function resolveModelSelection(selection, groups) {
|
|
|
78
79
|
function ChatSkeleton({ header, headerOnly = false, }) {
|
|
79
80
|
return (_jsxs("div", { className: cn("flex flex-col min-h-0", headerOnly ? "shrink-0" : "flex-1 h-full"), children: [header ?? (_jsxs("div", { className: "flex items-center px-1 py-1 border-b border-border shrink-0 gap-0.5", children: [_jsx("div", { className: "h-[22px] w-20 rounded-md bg-muted animate-pulse" }), _jsxs("div", { className: "ml-auto flex gap-0.5", children: [_jsx("div", { className: "h-[22px] w-[22px] rounded-md bg-muted animate-pulse" }), _jsx("div", { className: "h-[22px] w-[22px] rounded-md bg-muted animate-pulse" })] })] })), !headerOnly && (_jsxs("div", { className: "flex-1 flex flex-col gap-3 p-4", children: [_jsx("div", { className: "flex justify-center py-8", children: _jsx("div", { className: "h-10 w-10 rounded-full bg-muted animate-pulse" }) }), _jsx("div", { className: "h-3 w-32 rounded bg-muted animate-pulse mx-auto" })] }))] }));
|
|
80
81
|
}
|
|
82
|
+
// ─── Scope Badge ─────────────────────────────────────────────────────────────
|
|
83
|
+
function formatScopeType(type) {
|
|
84
|
+
return type.replace(/[-_]+/g, " ");
|
|
85
|
+
}
|
|
86
|
+
function indefiniteArticleFor(value) {
|
|
87
|
+
return /^[aeiou]/i.test(value.trim()) ? "an" : "a";
|
|
88
|
+
}
|
|
89
|
+
function getScopeCopy(scope, isCurrentScope) {
|
|
90
|
+
const type = formatScopeType(scope.type);
|
|
91
|
+
const fallbackObject = isCurrentScope
|
|
92
|
+
? `this ${type}`
|
|
93
|
+
: `${indefiniteArticleFor(type)} ${type}`;
|
|
94
|
+
const objectLabel = scope.label || fallbackObject;
|
|
95
|
+
return {
|
|
96
|
+
objectLabel,
|
|
97
|
+
chipLabel: scope.label || (isCurrentScope ? `this ${type}` : `${type} context`),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Thin context chip at the top of a scoped chat. Click → popover with
|
|
102
|
+
* related chats and the remove-context action. The chip stays unobtrusive
|
|
103
|
+
* when the user doesn't need it, but remains available as the escape hatch
|
|
104
|
+
* for taking a scoped chat back to a general one.
|
|
105
|
+
*/
|
|
106
|
+
function ScopeBadge({ scope, currentScope, onDetach, otherScopedThreads, activeThreadId, openTabIds, onSelectThread, }) {
|
|
107
|
+
const [open, setOpen] = useState(false);
|
|
108
|
+
const isCurrentScope = Boolean(currentScope &&
|
|
109
|
+
currentScope.type === scope.type &&
|
|
110
|
+
currentScope.id === scope.id);
|
|
111
|
+
const hasDifferentCurrentScope = Boolean(currentScope && !isCurrentScope);
|
|
112
|
+
const { objectLabel, chipLabel } = getScopeCopy(scope, isCurrentScope);
|
|
113
|
+
const heading = `Using ${chipLabel}`;
|
|
114
|
+
const detailSuffix = hasDifferentCurrentScope
|
|
115
|
+
? "Start a new chat to use the current page."
|
|
116
|
+
: isCurrentScope
|
|
117
|
+
? "New chats here keep this context."
|
|
118
|
+
: "Start a new chat for a general conversation.";
|
|
119
|
+
const otherCount = otherScopedThreads.length;
|
|
120
|
+
return (_jsx("div", { className: "flex items-center justify-center py-1 px-3 text-[11px] text-muted-foreground border-b border-border/40 shrink-0", children: _jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", className: "inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 hover:bg-accent/50 hover:text-foreground cursor-pointer", "aria-label": heading, children: [_jsx(IconLink, { size: 11, className: "shrink-0 opacity-70" }), _jsx("span", { className: "truncate max-w-[220px]", children: heading }), otherCount > 0 && (_jsxs("span", { className: "ml-0.5 rounded-full bg-muted px-1.5 py-px text-[10px] leading-none text-muted-foreground", "aria-label": `${otherCount} other chats for ${objectLabel}`, children: ["+", otherCount] }))] }) }), _jsxs(PopoverContent, { align: "center", side: "bottom", className: "w-72 p-0", children: [_jsxs("p", { className: "px-3 pt-2 pb-1.5 text-[11px] text-muted-foreground", children: ["This chat can see", " ", _jsx("span", { className: "text-foreground", children: objectLabel }), ".", " ", detailSuffix] }), otherCount > 0 && (_jsxs("div", { className: "border-t border-border", children: [_jsxs("div", { className: "px-3 pt-1.5 pb-1 text-[10px] uppercase tracking-wider text-muted-foreground/70", children: ["Chats for ", objectLabel] }), _jsx("div", { className: "max-h-56 overflow-y-auto pb-1", children: otherScopedThreads.map((thread) => renderThreadRow(thread, activeThreadId, openTabIds, formatThreadTime, onSelectThread, () => setOpen(false))) })] })), _jsx("div", { className: "border-t border-border p-1", children: _jsxs("button", { type: "button", onClick: () => {
|
|
121
|
+
setOpen(false);
|
|
122
|
+
onDetach();
|
|
123
|
+
}, className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs text-foreground hover:bg-accent cursor-pointer", children: [_jsx(IconLinkOff, { size: 13 }), _jsx("span", { children: "Remove context" })] }) })] })] }) }));
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Empty-state addon shown when the user starts a fresh chat inside a
|
|
127
|
+
* scoped surface that already has other threads. Surfaces those threads
|
|
128
|
+
* inline so chats don't feel "lost" after the user navigates away and
|
|
129
|
+
* back — the chip popover lists them too, but this nudge is visible
|
|
130
|
+
* without any extra clicks.
|
|
131
|
+
*/
|
|
132
|
+
function PreviousScopedChatsHint({ scope, threads, onSelectThread, }) {
|
|
133
|
+
const MAX_INLINE = 3;
|
|
134
|
+
const shown = threads.slice(0, MAX_INLINE);
|
|
135
|
+
const remaining = threads.length - shown.length;
|
|
136
|
+
const scopeLabel = scope.label || `this ${formatScopeType(scope.type)}`;
|
|
137
|
+
return (_jsxs("div", { className: "flex w-full max-w-[280px] flex-col gap-1.5", children: [_jsxs("div", { className: "text-[10px] uppercase tracking-wider text-muted-foreground/70 text-center", children: ["Previous chats for ", scopeLabel] }), _jsx("div", { className: "flex flex-col gap-1", children: shown.map((thread) => (_jsxs("button", { type: "button", onClick: () => onSelectThread(thread.id), className: "flex items-baseline justify-between gap-2 rounded-md border border-border px-2.5 py-1.5 text-left hover:bg-accent cursor-pointer", children: [_jsx("span", { className: "truncate text-[12px] text-foreground", children: thread.title || thread.preview || "Chat" }), _jsx("span", { className: "shrink-0 text-[10px] text-muted-foreground", children: formatThreadTime(thread.updatedAt) })] }, thread.id))) }), remaining > 0 && (_jsxs("div", { className: "text-[10px] text-muted-foreground/70 text-center", children: ["+", remaining, " more"] }))] }));
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Thin confirmation banner shown briefly after detach. The chip itself
|
|
141
|
+
* unmounts the moment scope clears on the active thread, so this banner
|
|
142
|
+
* holds the visual feedback long enough for the user to register what
|
|
143
|
+
* just happened and learn where the chat went (History popover).
|
|
144
|
+
*/
|
|
145
|
+
function DetachConfirmationBanner() {
|
|
146
|
+
return (_jsx("div", { className: "flex items-center justify-center py-1 px-3 text-[11px] text-muted-foreground border-b border-border/40 shrink-0", children: _jsxs("span", { className: "inline-flex items-center gap-1.5 rounded-full bg-accent/40 px-2 py-0.5 text-foreground", children: [_jsx(IconCheck, { size: 11, className: "shrink-0 opacity-80" }), _jsx("span", { children: "Context removed. Find this chat in History." })] }) }));
|
|
147
|
+
}
|
|
81
148
|
// ─── History Popover ─────────────────────────────────────────────────────────
|
|
82
|
-
function
|
|
149
|
+
function formatThreadTime(ts) {
|
|
150
|
+
const d = new Date(ts);
|
|
151
|
+
const now = new Date();
|
|
152
|
+
const diffMs = now.getTime() - d.getTime();
|
|
153
|
+
const diffDays = Math.floor(diffMs / 86400000);
|
|
154
|
+
if (diffDays === 0)
|
|
155
|
+
return d.toLocaleTimeString([], { hour: "numeric", minute: "2-digit" });
|
|
156
|
+
if (diffDays === 1)
|
|
157
|
+
return "Yesterday";
|
|
158
|
+
if (diffDays < 7)
|
|
159
|
+
return d.toLocaleDateString([], { weekday: "short" });
|
|
160
|
+
return d.toLocaleDateString([], { month: "short", day: "numeric" });
|
|
161
|
+
}
|
|
162
|
+
function renderThreadRow(thread, activeThreadId, openTabIds, formatTime, onSelect, onClose) {
|
|
163
|
+
const isActive = thread.id === activeThreadId;
|
|
164
|
+
return (_jsxs("button", { onClick: () => {
|
|
165
|
+
onSelect(thread.id);
|
|
166
|
+
onClose();
|
|
167
|
+
}, className: cn("w-full px-3 py-2 text-left hover:bg-accent/50 cursor-pointer", isActive && "bg-accent/30"), children: [_jsxs("div", { className: "flex items-baseline justify-between gap-2", children: [_jsx("span", { className: "text-xs font-medium text-foreground truncate", children: thread.title || thread.preview || "Chat" }), _jsx("span", { className: "text-[10px] text-muted-foreground shrink-0", children: isActive
|
|
168
|
+
? "Active"
|
|
169
|
+
: openTabIds.has(thread.id)
|
|
170
|
+
? "Open"
|
|
171
|
+
: formatTime(thread.updatedAt) })] }), thread.preview && thread.title !== thread.preview && (_jsx("div", { className: "text-[11px] text-muted-foreground truncate mt-0.5", children: thread.preview })), thread.scope?.label && (_jsx("div", { className: "mt-0.5 text-[10px] text-muted-foreground/70 truncate", children: thread.scope.label }))] }, thread.id));
|
|
172
|
+
}
|
|
173
|
+
function HistoryPopover({ threads, openTabIds, activeThreadId, currentScope, onSelect, onClose, onSearch, }) {
|
|
83
174
|
const [search, setSearch] = useState("");
|
|
84
175
|
const [searchResults, setSearchResults] = useState(null);
|
|
85
176
|
const [isSearching, setIsSearching] = useState(false);
|
|
@@ -136,30 +227,20 @@ function HistoryPopover({ threads, openTabIds, activeThreadId, onSelect, onClose
|
|
|
136
227
|
const filtered = search.trim()
|
|
137
228
|
? (searchResults ?? visibleThreads).filter((t) => t.messageCount > 0 || t.id === activeThreadId)
|
|
138
229
|
: visibleThreads;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40", onClick: onClose }), _jsxs("div", { className: "absolute right-2 top-0 z-50 w-72 rounded-lg border border-border bg-popover shadow-lg", children: [_jsxs("div", { className: "flex items-center gap-2 px-3 py-2 border-b border-border", children: [_jsx(IconSearch, { size: 13 }), _jsx("input", { ref: inputRef, type: "text", value: search, onChange: (e) => setSearch(e.target.value), placeholder: "Search chats...", className: "flex-1 bg-transparent text-xs text-foreground placeholder:text-muted-foreground outline-none" })] }), _jsx("div", { className: "max-h-64 overflow-y-auto py-1", children: isSearching ? (_jsx("div", { className: "px-3 py-4 text-xs text-muted-foreground text-center", children: "Searching..." })) : filtered.length === 0 ? (_jsx("div", { className: "px-3 py-4 text-xs text-muted-foreground text-center", children: search ? "No matching chats" : "No chats yet" })) : (filtered.map((thread) =>
|
|
153
|
-
const isActive = thread.id === activeThreadId;
|
|
154
|
-
return (_jsxs("button", { onClick: () => {
|
|
155
|
-
onSelect(thread.id);
|
|
156
|
-
onClose();
|
|
157
|
-
}, className: cn("w-full px-3 py-2 text-left hover:bg-accent/50", isActive && "bg-accent/30"), children: [_jsxs("div", { className: "flex items-baseline justify-between gap-2", children: [_jsx("span", { className: "text-xs font-medium text-foreground truncate", children: thread.title || thread.preview || "Chat" }), _jsx("span", { className: "text-[10px] text-muted-foreground shrink-0", children: isActive
|
|
158
|
-
? "Active"
|
|
159
|
-
: openTabIds.has(thread.id)
|
|
160
|
-
? "Open"
|
|
161
|
-
: formatTime(thread.updatedAt) })] }), thread.preview && thread.title !== thread.preview && (_jsx("div", { className: "text-[11px] text-muted-foreground truncate mt-0.5", children: thread.preview }))] }, thread.id));
|
|
162
|
-
})) })] })] }));
|
|
230
|
+
// When scope is set we split history into two sections so the user can
|
|
231
|
+
// see "this deck's chats" first without losing access to general /
|
|
232
|
+
// other-deck chats. Section labels intentionally use the current
|
|
233
|
+
// resource type (deck/design/dashboard) instead of a generic phrase.
|
|
234
|
+
const sectionedThreads = currentScope
|
|
235
|
+
? {
|
|
236
|
+
scoped: filtered.filter((t) => t.scope?.type === currentScope.type &&
|
|
237
|
+
t.scope?.id === currentScope.id),
|
|
238
|
+
other: filtered.filter((t) => !t.scope ||
|
|
239
|
+
t.scope.type !== currentScope.type ||
|
|
240
|
+
t.scope.id !== currentScope.id),
|
|
241
|
+
}
|
|
242
|
+
: null;
|
|
243
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40", onClick: onClose }), _jsxs("div", { className: "absolute right-2 top-0 z-50 w-72 rounded-lg border border-border bg-popover shadow-lg", children: [_jsxs("div", { className: "flex items-center gap-2 px-3 py-2 border-b border-border", children: [_jsx(IconSearch, { size: 13 }), _jsx("input", { ref: inputRef, type: "text", value: search, onChange: (e) => setSearch(e.target.value), placeholder: "Search chats...", className: "flex-1 bg-transparent text-xs text-foreground placeholder:text-muted-foreground outline-none" })] }), _jsx("div", { className: "max-h-64 overflow-y-auto py-1", children: isSearching ? (_jsx("div", { className: "px-3 py-4 text-xs text-muted-foreground text-center", children: "Searching..." })) : filtered.length === 0 ? (_jsx("div", { className: "px-3 py-4 text-xs text-muted-foreground text-center", children: search ? "No matching chats" : "No chats yet" })) : sectionedThreads ? (_jsxs(_Fragment, { children: [sectionedThreads.scoped.length > 0 && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "px-3 pt-1.5 pb-1 text-[10px] uppercase tracking-wider text-muted-foreground/70", children: ["This ", currentScope.type] }), sectionedThreads.scoped.map((thread) => renderThreadRow(thread, activeThreadId, openTabIds, formatThreadTime, onSelect, onClose))] })), sectionedThreads.other.length > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "px-3 pt-2 pb-1 text-[10px] uppercase tracking-wider text-muted-foreground/70", children: "All chats" }), sectionedThreads.other.map((thread) => renderThreadRow(thread, activeThreadId, openTabIds, formatThreadTime, onSelect, onClose))] }))] })) : (filtered.map((thread) => renderThreadRow(thread, activeThreadId, openTabIds, formatThreadTime, onSelect, onClose))) })] })] }));
|
|
163
244
|
}
|
|
164
245
|
// ─── Help Popover ────────────────────────────────────────────────────────────
|
|
165
246
|
function HelpPopover({ onClose }) {
|
|
@@ -185,8 +266,8 @@ function HelpPopover({ onClose }) {
|
|
|
185
266
|
];
|
|
186
267
|
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40", onClick: onClose }), _jsxs("div", { className: "absolute right-2 top-0 z-50 w-72 rounded-lg border border-border bg-popover shadow-lg", children: [_jsxs("div", { className: "flex items-center justify-between px-3 py-2 border-b border-border", children: [_jsx("span", { className: "text-xs font-medium text-foreground", children: "Available Commands" }), _jsx("button", { onClick: onClose, "aria-label": "Close help", className: "flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground", children: _jsx(IconX, { size: 12 }) })] }), _jsx("div", { className: "py-1", children: commands.map((cmd) => (_jsxs("div", { className: "px-3 py-1.5", children: [_jsx("div", { className: "text-xs font-medium text-foreground", children: cmd.name }), _jsx("div", { className: "text-[11px] text-muted-foreground", children: cmd.description })] }, cmd.name))) })] })] }));
|
|
187
268
|
}
|
|
188
|
-
export function MultiTabAssistantChat({ showTabBar = true, renderHeader, renderOverlay, contentHidden = false, apiUrl = agentNativePath("/_agent-native/agent-chat"), storageKey, ...props }) {
|
|
189
|
-
const { threads, activeThreadId, isLoading, createThread, switchThread, deleteThread, forkThread, saveThreadData, generateTitle, searchThreads, refreshThreads, isNewThread, } = useChatThreads(apiUrl, storageKey);
|
|
269
|
+
export function MultiTabAssistantChat({ showTabBar = true, renderHeader, renderOverlay, contentHidden = false, apiUrl = agentNativePath("/_agent-native/agent-chat"), storageKey, browserTabId, scope = null, ...props }) {
|
|
270
|
+
const { threads, activeThreadId, isLoading, createThread, switchThread, deleteThread, detachThread, forkThread, saveThreadData, generateTitle, searchThreads, refreshThreads, isNewThread, } = useChatThreads(apiUrl, storageKey, scope);
|
|
190
271
|
// Namespace all localStorage keys by storageKey when provided (for per-app isolation in frame)
|
|
191
272
|
const keyPrefix = storageKey ? `:${storageKey}` : "";
|
|
192
273
|
const modelSelectionKey = `${MODEL_SELECTION_STORAGE_KEY}${keyPrefix}`;
|
|
@@ -404,7 +485,11 @@ export function MultiTabAssistantChat({ showTabBar = true, renderHeader, renderO
|
|
|
404
485
|
catch { }
|
|
405
486
|
}, [subAgentNames, SUB_AGENT_NAMES_KEY]);
|
|
406
487
|
// Open tabs — persisted to localStorage so they survive refresh.
|
|
407
|
-
|
|
488
|
+
// Per-scope: when scope changes (e.g. user navigates from Deck A to Deck
|
|
489
|
+
// B), the tab bar reflects whichever tabs they had open for *that*
|
|
490
|
+
// resource. We do not bleed deck A's tabs into deck B's view.
|
|
491
|
+
const scopeKeyPart = scope ? `:scope:${scope.type}:${scope.id}` : "";
|
|
492
|
+
const OPEN_TABS_KEY = `agent-chat-open-tabs${keyPrefix}${scopeKeyPart}`;
|
|
408
493
|
const [openTabIds, setOpenTabIds] = useState(() => {
|
|
409
494
|
try {
|
|
410
495
|
const saved = localStorage.getItem(OPEN_TABS_KEY);
|
|
@@ -422,8 +507,88 @@ export function MultiTabAssistantChat({ showTabBar = true, renderHeader, renderO
|
|
|
422
507
|
return [];
|
|
423
508
|
});
|
|
424
509
|
const initializedRef = useRef(false);
|
|
510
|
+
// Rehydrate open tabs when the scope flips. Mirrors `persistedKeyRef` in
|
|
511
|
+
// `useChatThreads`: on a scope change we need to read the new key BEFORE
|
|
512
|
+
// the persistence effect writes the current (now-wrong) tab list under
|
|
513
|
+
// that new key.
|
|
514
|
+
const openTabsKeyRef = useRef(OPEN_TABS_KEY);
|
|
515
|
+
useEffect(() => {
|
|
516
|
+
if (openTabsKeyRef.current === OPEN_TABS_KEY)
|
|
517
|
+
return;
|
|
518
|
+
openTabsKeyRef.current = OPEN_TABS_KEY;
|
|
519
|
+
initializedRef.current = false;
|
|
520
|
+
try {
|
|
521
|
+
const saved = localStorage.getItem(OPEN_TABS_KEY);
|
|
522
|
+
if (saved) {
|
|
523
|
+
const parsed = JSON.parse(saved);
|
|
524
|
+
if (Array.isArray(parsed)) {
|
|
525
|
+
for (const id of parsed)
|
|
526
|
+
mountedTabsRef.current.add(id);
|
|
527
|
+
setOpenTabIds(parsed);
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
catch { }
|
|
533
|
+
setOpenTabIds([]);
|
|
534
|
+
}, [OPEN_TABS_KEY]);
|
|
535
|
+
// Look up the active thread's actual scope from the list — when the
|
|
536
|
+
// user opens a chat from history that was scoped to a different
|
|
537
|
+
// resource, the badge should advertise that thread's binding, not
|
|
538
|
+
// necessarily the resource currently in the viewport. When the thread
|
|
539
|
+
// and the live prop refer to the same resource, prefer the prop's
|
|
540
|
+
// label so a rename or a deferred deck-title load shows up in the UI
|
|
541
|
+
// without waiting on the next persistence cycle.
|
|
542
|
+
const activeThreadScope = useMemo(() => {
|
|
543
|
+
if (!activeThreadId)
|
|
544
|
+
return null;
|
|
545
|
+
const t = threads.find((x) => x.id === activeThreadId);
|
|
546
|
+
const stored = t?.scope ?? null;
|
|
547
|
+
if (!stored)
|
|
548
|
+
return null;
|
|
549
|
+
if (scope && stored.type === scope.type && stored.id === scope.id) {
|
|
550
|
+
return { ...stored, label: scope.label || stored.label };
|
|
551
|
+
}
|
|
552
|
+
return stored;
|
|
553
|
+
}, [threads, activeThreadId, scope?.type, scope?.id, scope?.label]);
|
|
554
|
+
// Brief confirmation banner shown after detach. The chip itself disappears
|
|
555
|
+
// the instant scope clears, which the user described as "nothing different
|
|
556
|
+
// happened." We hold the confirmation in the same slot for ~2s so the
|
|
557
|
+
// detach is visually acknowledged and the user is pointed at History.
|
|
558
|
+
const [detachConfirmType, setDetachConfirmType] = useState(null);
|
|
559
|
+
const detachTimerRef = useRef(null);
|
|
560
|
+
useEffect(() => {
|
|
561
|
+
return () => {
|
|
562
|
+
if (detachTimerRef.current)
|
|
563
|
+
clearTimeout(detachTimerRef.current);
|
|
564
|
+
};
|
|
565
|
+
}, []);
|
|
566
|
+
const handleDetachActiveThread = useCallback(() => {
|
|
567
|
+
if (!activeThreadId || !activeThreadScope)
|
|
568
|
+
return;
|
|
569
|
+
const type = activeThreadScope.type;
|
|
570
|
+
setDetachConfirmType(type);
|
|
571
|
+
if (detachTimerRef.current)
|
|
572
|
+
clearTimeout(detachTimerRef.current);
|
|
573
|
+
detachTimerRef.current = setTimeout(() => setDetachConfirmType(null), 2200);
|
|
574
|
+
detachThread(activeThreadId);
|
|
575
|
+
}, [activeThreadId, activeThreadScope, detachThread]);
|
|
576
|
+
// Other chats scoped to the active thread's resource (excluding the active
|
|
577
|
+
// thread itself). Sorted most-recent-first to match user expectation in the
|
|
578
|
+
// chip popover and empty-state addon.
|
|
579
|
+
const otherScopedThreads = useMemo(() => {
|
|
580
|
+
if (!activeThreadScope)
|
|
581
|
+
return [];
|
|
582
|
+
return threads
|
|
583
|
+
.filter((t) => t.id !== activeThreadId &&
|
|
584
|
+
t.scope?.type === activeThreadScope.type &&
|
|
585
|
+
t.scope?.id === activeThreadScope.id)
|
|
586
|
+
.sort((a, b) => b.updatedAt - a.updatedAt);
|
|
587
|
+
}, [threads, activeThreadId, activeThreadScope]);
|
|
425
588
|
// Persist open tab IDs to localStorage (exclude sub-agent tabs — they're session-only)
|
|
426
589
|
useEffect(() => {
|
|
590
|
+
if (openTabsKeyRef.current !== OPEN_TABS_KEY)
|
|
591
|
+
return;
|
|
427
592
|
const mainTabs = openTabIds.filter((id) => !parentMap[id]);
|
|
428
593
|
if (mainTabs.length > 0) {
|
|
429
594
|
try {
|
|
@@ -766,13 +931,18 @@ export function MultiTabAssistantChat({ showTabBar = true, renderHeader, renderO
|
|
|
766
931
|
const handleCloseAll = () => {
|
|
767
932
|
void closeAllTabs();
|
|
768
933
|
};
|
|
934
|
+
const handleNewChat = () => {
|
|
935
|
+
void addTab();
|
|
936
|
+
};
|
|
769
937
|
window.addEventListener("agent-chat:close-current-tab", handleCloseCurrent);
|
|
770
938
|
window.addEventListener("agent-chat:close-all-tabs", handleCloseAll);
|
|
939
|
+
window.addEventListener("agent-chat:new-chat", handleNewChat);
|
|
771
940
|
return () => {
|
|
772
941
|
window.removeEventListener("agent-chat:close-current-tab", handleCloseCurrent);
|
|
773
942
|
window.removeEventListener("agent-chat:close-all-tabs", handleCloseAll);
|
|
943
|
+
window.removeEventListener("agent-chat:new-chat", handleNewChat);
|
|
774
944
|
};
|
|
775
|
-
}, [closeTab, closeAllTabs]);
|
|
945
|
+
}, [closeTab, closeAllTabs, addTab]);
|
|
776
946
|
const clearActiveTab = useCallback(() => {
|
|
777
947
|
addTab();
|
|
778
948
|
}, [addTab]);
|
|
@@ -909,7 +1079,8 @@ export function MultiTabAssistantChat({ showTabBar = true, renderHeader, renderO
|
|
|
909
1079
|
}
|
|
910
1080
|
}, [addTab, props.onExecModeChange]);
|
|
911
1081
|
const handleForkChat = useCallback(async (sourceThreadId) => {
|
|
912
|
-
const
|
|
1082
|
+
const sourceSnapshot = chatRefs.current.get(sourceThreadId)?.exportThreadSnapshot() ?? null;
|
|
1083
|
+
const forkedId = await forkThread(sourceThreadId, sourceSnapshot);
|
|
913
1084
|
if (!forkedId)
|
|
914
1085
|
return;
|
|
915
1086
|
setOpenTabIds((prev) => {
|
|
@@ -994,8 +1165,8 @@ export function MultiTabAssistantChat({ showTabBar = true, renderHeader, renderO
|
|
|
994
1165
|
(tab.id === focusParentId &&
|
|
995
1166
|
activeTab?.parentThreadId === tab.id);
|
|
996
1167
|
return (_jsxs("div", { ref: isActive ? activeTabRefCb : undefined, className: cn("agent-tab relative flex items-center rounded-md text-[11px] font-medium shrink-0 max-w-[130px]", isActive
|
|
997
|
-
? "bg-accent text-foreground"
|
|
998
|
-
: "text-muted-foreground hover:text-foreground hover:bg-accent"), children: [_jsxs("button", { type: "button", onClick: () => switchThread(tab.id), className: "flex items-center gap-1 px-2.5 py-1.5 min-w-0 flex-1 text-left", children: [_jsx("span", { className: "truncate pr-1", children: tab.label }), tab.status === "running" && (_jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-muted-foreground/50 shrink-0 animate-pulse" }))] }), _jsx("button", { type: "button", "aria-label": "Close tab", onClick: (e) => {
|
|
1168
|
+
? "bg-accent text-foreground ring-1 ring-inset ring-border/60 shadow-sm"
|
|
1169
|
+
: "text-muted-foreground hover:text-foreground hover:bg-accent/50"), children: [_jsxs("button", { type: "button", onClick: () => switchThread(tab.id), className: "flex items-center gap-1 px-2.5 py-1.5 min-w-0 flex-1 text-left", children: [_jsx("span", { className: "truncate pr-1", children: tab.label }), tab.status === "running" && (_jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-muted-foreground/50 shrink-0 animate-pulse" }))] }), _jsx("button", { type: "button", "aria-label": "Close tab", onClick: (e) => {
|
|
999
1170
|
e.stopPropagation();
|
|
1000
1171
|
e.preventDefault();
|
|
1001
1172
|
closeTab(tab.id);
|
|
@@ -1030,23 +1201,31 @@ export function MultiTabAssistantChat({ showTabBar = true, renderHeader, renderO
|
|
|
1030
1201
|
background: "linear-gradient(to right, transparent, hsl(var(--accent)) 40%)",
|
|
1031
1202
|
}, children: _jsx(IconX, { size: 12 }) })] }, tab.id)))] }) }))] }));
|
|
1032
1203
|
})()
|
|
1033
|
-
: null, _jsxs("div", { className: "relative flex-1 flex flex-col min-h-0", children: [renderOverlay ? renderOverlay(headerProps) : null,
|
|
1204
|
+
: null, _jsxs("div", { className: "relative flex-1 flex flex-col min-h-0", children: [renderOverlay ? renderOverlay(headerProps) : null, !contentHidden &&
|
|
1205
|
+
(activeThreadScope && activeThreadId ? (_jsx(ScopeBadge, { scope: activeThreadScope, currentScope: scope, onDetach: handleDetachActiveThread, otherScopedThreads: otherScopedThreads, activeThreadId: activeThreadId, openTabIds: new Set(openTabIds), onSelectThread: openFromHistory })) : detachConfirmType ? (_jsx(DetachConfirmationBanner, {})) : null), showHistory && (_jsx(HistoryPopover, { threads: threads, openTabIds: new Set(openTabIds), activeThreadId: activeThreadId, currentScope: scope, onSelect: openFromHistory, onClose: () => setShowHistory(false), onSearch: searchThreads })), helpVisible && _jsx(HelpPopover, { onClose: () => setHelpVisible(false) }), [...new Set(openTabIds)]
|
|
1034
1206
|
.filter((tabId) => tabId === activeThreadId || mountedTabsRef.current.has(tabId))
|
|
1035
1207
|
.map((tabId) => {
|
|
1036
1208
|
const modelSelection = resolveThreadModelSelection(tabId);
|
|
1209
|
+
const tabThread = threads.find((thread) => thread.id === tabId);
|
|
1210
|
+
const tabScope = tabThread?.scope ??
|
|
1211
|
+
(tabId === activeThreadId ? activeThreadScope : null);
|
|
1037
1212
|
return (_jsxs("div", { className: "flex-1 min-h-0 flex-col", style: {
|
|
1038
1213
|
display: contentHidden || tabId !== activeThreadId ? "none" : "flex",
|
|
1039
1214
|
}, children: [_jsx(RunStuckBanner, { threadId: tabId, apiUrl: apiUrl, onRetry: () => {
|
|
1040
1215
|
const handle = chatRefs.current.get(tabId);
|
|
1041
1216
|
handle?.sendMessage("Continue from where you left off and finish my last request. Do not repeat completed work.");
|
|
1042
|
-
} }), _jsx(AssistantChat, { ...props,
|
|
1217
|
+
} }), _jsx(AssistantChat, { ...props, emptyStateText: tabScope?.label && tabId === activeThreadId
|
|
1218
|
+
? `Ask about ${tabScope.label}`
|
|
1219
|
+
: props.emptyStateText, emptyStateAddon: tabId === activeThreadId &&
|
|
1220
|
+
tabScope &&
|
|
1221
|
+
otherScopedThreads.length > 0 ? (_jsx(PreviousScopedChatsHint, { scope: tabScope, threads: otherScopedThreads, onSelectThread: openFromHistory })) : undefined, ref: (handle) => {
|
|
1043
1222
|
if (handle) {
|
|
1044
1223
|
chatRefs.current.set(tabId, handle);
|
|
1045
1224
|
}
|
|
1046
1225
|
else {
|
|
1047
1226
|
chatRefs.current.delete(tabId);
|
|
1048
1227
|
}
|
|
1049
|
-
}, threadId: tabId, tabId: tabId, apiUrl: apiUrl, isNewThread: newThreadIds.current.has(tabId) || isNewThread(tabId), onMessageCountChange: (count) => setMessageCounts((prev) => prev[tabId] === count
|
|
1228
|
+
}, threadId: tabId, tabId: tabId, browserTabId: browserTabId, contextScope: tabScope, apiUrl: apiUrl, isNewThread: newThreadIds.current.has(tabId) || isNewThread(tabId), onMessageCountChange: (count) => setMessageCounts((prev) => prev[tabId] === count
|
|
1050
1229
|
? prev
|
|
1051
1230
|
: { ...prev, [tabId]: count }), onSaveThread: handleSaveThread, onGenerateTitle: handleGenerateTitle, onSlashCommand: handleSlashCommand, selectedModel: modelSelection?.model, selectedEngine: modelSelection?.engine, selectedEffort: modelSelection?.effort ?? "auto", defaultModel: defaultModel, availableModels: availableModels, onModelChange: handleModelChange, onEffortChange: handleEffortChange, onForkChat: () => handleForkChat(tabId) })] }, tabId));
|
|
1052
1231
|
})] })] }));
|