@agent-native/core 0.115.4 → 0.116.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-native.eject.json +1 -0
- package/corpus/README.md +3 -3
- package/corpus/core/CHANGELOG.md +28 -0
- package/corpus/core/agent-native.eject.json +1 -0
- package/corpus/core/docs/AGENTS.md +1 -1
- package/corpus/core/docs/content/agent-mentions.mdx +2 -2
- package/corpus/core/docs/content/{workspace.mdx → agent-resources.mdx} +1 -7
- package/corpus/core/docs/content/agent-teams.mdx +4 -4
- package/corpus/core/docs/content/dispatch.mdx +10 -10
- package/corpus/core/docs/content/drop-in-agent.mdx +4 -4
- package/corpus/core/docs/content/external-agents.mdx +1 -1
- package/corpus/core/docs/content/frames.mdx +1 -1
- package/corpus/core/docs/content/integrations.mdx +13 -2
- package/corpus/core/docs/content/key-concepts.mdx +2 -2
- package/corpus/core/docs/content/mcp-clients.mdx +7 -1
- package/corpus/core/docs/content/multi-app-workspace.mdx +3 -3
- package/corpus/core/docs/content/real-time-collaboration.mdx +33 -15
- package/corpus/core/docs/content/recurring-jobs.mdx +7 -7
- package/corpus/core/docs/content/skills-guide.mdx +4 -4
- package/corpus/core/docs/content/template-brain.mdx +1 -1
- package/corpus/core/docs/content/toolkit-collaboration.mdx +1 -1
- package/corpus/core/docs/content/using-your-agent.mdx +1 -1
- package/corpus/core/docs/content/what-is-agent-native.mdx +4 -4
- package/corpus/core/docs/content/workspace-management.mdx +4 -4
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/production-agent.ts +13 -3
- package/corpus/core/src/cli/doctor.ts +6 -1
- package/corpus/core/src/client/AgentPanel.tsx +79 -41
- package/corpus/core/src/client/AssistantChat.tsx +71 -25
- package/corpus/core/src/client/FeedbackButton.tsx +33 -7
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +6 -8
- package/corpus/core/src/client/agent-chat-adapter.ts +11 -2
- package/corpus/core/src/client/agent-page/AgentTabFrame.tsx +22 -3
- package/corpus/core/src/client/agent-page/AgentTabsPage.tsx +34 -19
- package/corpus/core/src/client/chat/message-components.tsx +43 -16
- package/corpus/core/src/client/chat/tool-call-display.tsx +30 -18
- package/corpus/core/src/client/chat/tool-render-registry.tsx +2 -0
- package/corpus/core/src/client/resources/McpConnectionSuggestion.tsx +19 -2
- package/corpus/core/src/client/resources/ResourceTree.tsx +7 -10
- package/corpus/core/src/client/resources/ResourcesPanel.tsx +33 -70
- package/corpus/core/src/client/resources/mcp-connection-resume.ts +107 -0
- package/corpus/core/src/client/resources/mcp-integration-catalog.ts +65 -12
- package/corpus/core/src/client/resources/mcp-integration-logos.ts +4 -0
- package/corpus/core/src/client/sse-event-processor.ts +50 -14
- package/corpus/core/src/client/use-db-sync.ts +16 -6
- package/corpus/core/src/connections/catalog.ts +7 -1
- package/corpus/core/src/eject/remote-mcp-presets.ts +37 -5
- package/corpus/core/src/guards/explicit-collab-access.ts +229 -0
- package/corpus/core/src/guards/index.ts +1 -0
- package/corpus/core/src/localization/default-messages.ts +54 -5
- package/corpus/core/src/mcp/connect-route.ts +34 -51
- package/corpus/core/src/provider-api/index.ts +1 -1
- package/corpus/core/src/server/collab-plugin.ts +137 -18
- package/corpus/core/src/server/index.ts +2 -0
- package/corpus/core/src/styles/agent-native.css +40 -0
- package/corpus/core/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/core/src/templates/default/.agents/skills/real-time-collab/SKILL.md +35 -13
- package/corpus/core/src/templates/default/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/corpus/core/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +35 -13
- package/corpus/core/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +12 -8
- package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/templates/analytics/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/corpus/templates/analytics/AGENTS.md +7 -2
- package/corpus/templates/analytics/actions/export-dashboard-panel-to-google-sheet.ts +144 -0
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +7 -88
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +34 -37
- package/corpus/templates/analytics/app/global.css +0 -4
- package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +2 -7
- package/corpus/templates/analytics/app/i18n-data.ts +107 -0
- package/corpus/templates/analytics/app/lib/data-source-status.ts +9 -0
- package/corpus/templates/analytics/app/lib/sql-query.ts +1 -2
- package/corpus/templates/analytics/app/pages/Ask.tsx +2 -7
- package/corpus/templates/analytics/app/pages/DataSources.tsx +48 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +59 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +2 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/report-panel-window.ts +3 -1
- package/corpus/templates/analytics/changelog/2026-07-22-clear-background-chat-progress.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-22-daily-dashboard-email-query-batches.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-22-export-table-panels-directly-to-google-sheets.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-22-full-page-chat-keeps-the-active-conversation-when-moving-to-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-22-recent-chats-can-expand-in-the-sidebar.md +6 -0
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +8 -8
- package/corpus/templates/analytics/server/lib/canonical-first-party-dashboard-repair.ts +31 -0
- package/corpus/templates/analytics/server/lib/dashboard-report-subscriptions.ts +3 -5
- package/corpus/templates/analytics/server/lib/dashboard-report.ts +12 -0
- package/corpus/templates/analytics/server/lib/first-party-dashboard-repair.ts +3 -5
- package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +150 -21
- package/corpus/templates/analytics/server/lib/google-sheets-export.ts +188 -0
- package/corpus/templates/analytics/server/lib/provider-api.ts +7 -2
- package/corpus/templates/analytics/server/plugins/collab.ts +6 -3
- package/corpus/templates/analytics/shared/sql-query-limits.ts +1 -0
- package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/templates/assets/.agents/skills/real-time-collab/SKILL.md +35 -13
- package/corpus/templates/assets/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/corpus/templates/assets/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +54 -62
- package/corpus/templates/assets/app/hooks/use-navigation-state.ts +2 -6
- package/corpus/templates/assets/app/routes/_index.tsx +8 -5
- package/corpus/templates/assets/changelog/2026-07-22-full-page-chat-keeps-the-active-conversation-when-moving-to-.md +6 -0
- package/corpus/templates/assets/changelog/2026-07-22-recent-chats-expand-from-a-compact-list.md +6 -0
- package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/templates/brain/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/corpus/templates/brain/actions/rotate-source-ingest-token.ts +77 -0
- package/corpus/templates/brain/app/components/layout/Layout.tsx +5 -1
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +38 -51
- package/corpus/templates/brain/app/hooks/use-navigation-state.ts +2 -9
- package/corpus/templates/brain/app/i18n-data.ts +120 -0
- package/corpus/templates/brain/app/routes/sources.tsx +156 -5
- package/corpus/templates/brain/changelog/2026-07-22-chat-runs-always-end-with-an-answer.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-22-clear-background-chat-progress.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-22-compact-sidebar-footer.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-22-full-page-chat-keeps-the-active-conversation-when-moving-to-.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-22-long-chat-titles-stay-inside-the-sidebar.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-22-new-clips-and-webhook-sources-now-show-their-secure-connecti.md +6 -0
- package/corpus/templates/brain/jobs/emit-netlify-brain-queue-cron.ts +125 -0
- package/corpus/templates/brain/netlify.toml +5 -1
- package/corpus/templates/brain/scripts/configure-prod-clips-source.ts +50 -0
- package/corpus/templates/brain/server/lib/capture-sanitization.ts +64 -6
- package/corpus/templates/brain/server/plugins/agent-chat.ts +4 -0
- package/corpus/templates/brain/server/plugins/brain-jobs.ts +1 -0
- package/corpus/templates/brain/server/routes/api/brain/queue/run.post.ts +55 -0
- package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/templates/calendar/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/templates/chat/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/corpus/templates/chat/app/components/layout/Layout.tsx +1 -0
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +43 -67
- package/corpus/templates/chat/app/hooks/use-navigation-state.ts +2 -7
- package/corpus/templates/chat/app/routes/_index.tsx +8 -5
- package/corpus/templates/chat/changelog/2026-07-22-compact-sidebar-footer.md +6 -0
- package/corpus/templates/chat/changelog/2026-07-22-full-page-chat-keeps-the-active-conversation-when-moving-to-.md +6 -0
- package/corpus/templates/chat/changelog/2026-07-22-recent-chats-are-easier-to-scan-and-expand.md +6 -0
- package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/templates/clips/AGENTS.md +9 -1
- package/corpus/templates/clips/actions/export-to-brain.ts +82 -6
- package/corpus/templates/clips/actions/request-transcript.ts +25 -14
- package/corpus/templates/clips/changelog/2026-07-22-clips-transcripts-now-retry-brain-export.md +5 -0
- package/corpus/templates/clips/changelog/2026-07-22-german-umlauts-and-other-non-ascii-characters-now-paste-corr.md +6 -0
- package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +26 -3
- package/corpus/templates/clips/jobs/emit-netlify-brain-export-cron.ts +118 -0
- package/corpus/templates/clips/netlify.toml +4 -1
- package/corpus/templates/clips/scripts/configure-prod-brain-export.ts +92 -0
- package/corpus/templates/clips/server/jobs/brain-export.ts +182 -0
- package/corpus/templates/clips/server/lib/brain-export-state.ts +42 -0
- package/corpus/templates/clips/server/lib/post-finalize-dispatch.ts +5 -1
- package/corpus/templates/clips/server/plugins/calendar-jobs.ts +2 -0
- package/corpus/templates/clips/server/register-secrets.ts +42 -0
- package/corpus/templates/clips/server/routes/api/_agent-native-background/post-finalize-worker.post.ts +10 -1
- package/corpus/templates/clips/server/routes/api/clips/brain-export/run.post.ts +45 -0
- package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/templates/content/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -1
- package/corpus/templates/content/server/plugins/collab.ts +1 -1
- package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/templates/crm/actions/_crm-data-program-actions.ts +15 -0
- package/corpus/templates/crm/actions/get-crm-dashboard-panel.ts +2 -0
- package/corpus/templates/crm/actions/run.ts +2 -6
- package/corpus/templates/crm/actions/update-crm-record.ts +4 -2
- package/corpus/templates/crm/app/components/layout/CrmLayout.tsx +6 -0
- package/corpus/templates/crm/changelog/2026-07-22-crm-field-validation-now-explains-which-fields-cannot-be-edi.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-22-fixed-hubspot-contact-syncs-missing-records-updated-after-th.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-22-fixed-pipeline-dashboard-panels-so-their-opportunity-data-lo.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-22-full-page-chat-keeps-the-active-conversation-when-moving-to-.md +6 -0
- package/corpus/templates/crm/server/crm/hubspot-adapter.ts +4 -1
- package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +1 -1
- package/corpus/templates/design/server/plugins/collab.ts +11 -8
- package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/templates/forms/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/corpus/templates/forms/app/components/layout/Layout.tsx +1 -0
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +1 -1
- package/corpus/templates/forms/app/hooks/use-navigation-state.ts +2 -9
- package/corpus/templates/forms/app/root.tsx +1 -6
- package/corpus/templates/forms/changelog/2026-07-22-full-page-chat-keeps-the-active-conversation-when-moving-to-.md +6 -0
- package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/templates/mail/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +2 -2
- package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/templates/plan/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/corpus/templates/plan/app/components/layout/Layout.tsx +5 -1
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +57 -72
- package/corpus/templates/plan/app/hooks/use-navigation-state.ts +2 -9
- package/corpus/templates/plan/app/lib/create-plan-routing.ts +2 -2
- package/corpus/templates/plan/app/pages/PlanChatPage.tsx +0 -1
- package/corpus/templates/plan/changelog/2026-07-22-compact-sidebar-footer.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-22-full-page-chat-keeps-the-active-conversation-when-moving-to-.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-22-recent-chats-and-sidebar-controls-are-more-compact.md +6 -0
- package/corpus/templates/plan/server/plugins/collab.ts +5 -2
- package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +1 -1
- package/corpus/templates/slides/server/plugins/collab.ts +11 -8
- package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/corpus/templates/tasks/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +5 -22
- package/corpus/templates/tasks/changelog/2026-07-22-compact-sidebar-footer.md +6 -0
- package/corpus/toolkit/CHANGELOG.md +7 -0
- package/corpus/toolkit/README.md +12 -3
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/src/chat-history/ChatHistoryRail.tsx +89 -0
- package/corpus/toolkit/src/chat-history/index.ts +5 -0
- package/corpus/toolkit/src/chat-history.css +59 -0
- package/corpus/toolkit/src/composer/RealtimeVoiceMode.tsx +106 -36
- package/corpus/toolkit/src/composer/VoiceButton.tsx +49 -0
- package/corpus/toolkit/src/composer/realtime-voice-audio-level.ts +2 -1
- package/corpus/toolkit/src/composer/useRealtimeVoiceMode.tsx +5 -3
- package/corpus/toolkit/src/styles.css +35 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +13 -3
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/cli/doctor.d.ts +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +5 -2
- package/dist/cli/doctor.js.map +1 -1
- package/dist/client/AgentPanel.d.ts +1 -0
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +38 -18
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +55 -20
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/FeedbackButton.d.ts +4 -2
- package/dist/client/FeedbackButton.d.ts.map +1 -1
- package/dist/client/FeedbackButton.js +18 -2
- package/dist/client/FeedbackButton.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +2 -3
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +11 -3
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/agent-page/AgentTabFrame.d.ts +3 -1
- package/dist/client/agent-page/AgentTabFrame.d.ts.map +1 -1
- package/dist/client/agent-page/AgentTabFrame.js +3 -2
- package/dist/client/agent-page/AgentTabFrame.js.map +1 -1
- package/dist/client/agent-page/AgentTabsPage.d.ts +2 -0
- package/dist/client/agent-page/AgentTabsPage.d.ts.map +1 -1
- package/dist/client/agent-page/AgentTabsPage.js +26 -15
- package/dist/client/agent-page/AgentTabsPage.js.map +1 -1
- package/dist/client/chat/message-components.d.ts +6 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +17 -11
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +11 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +16 -17
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/chat/tool-render-registry.d.ts +2 -0
- package/dist/client/chat/tool-render-registry.d.ts.map +1 -1
- package/dist/client/chat/tool-render-registry.js.map +1 -1
- package/dist/client/resources/McpConnectionSuggestion.d.ts.map +1 -1
- package/dist/client/resources/McpConnectionSuggestion.js +15 -1
- package/dist/client/resources/McpConnectionSuggestion.js.map +1 -1
- package/dist/client/resources/ResourceTree.d.ts.map +1 -1
- package/dist/client/resources/ResourceTree.js +3 -3
- package/dist/client/resources/ResourceTree.js.map +1 -1
- package/dist/client/resources/ResourcesPanel.d.ts +1 -0
- package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
- package/dist/client/resources/ResourcesPanel.js +34 -20
- package/dist/client/resources/ResourcesPanel.js.map +1 -1
- package/dist/client/resources/mcp-connection-resume.d.ts +11 -0
- package/dist/client/resources/mcp-connection-resume.d.ts.map +1 -0
- package/dist/client/resources/mcp-connection-resume.js +95 -0
- package/dist/client/resources/mcp-connection-resume.js.map +1 -0
- package/dist/client/resources/mcp-integration-catalog.d.ts +1 -0
- package/dist/client/resources/mcp-integration-catalog.d.ts.map +1 -1
- package/dist/client/resources/mcp-integration-catalog.js +63 -8
- package/dist/client/resources/mcp-integration-catalog.js.map +1 -1
- package/dist/client/resources/mcp-integration-logos.d.ts.map +1 -1
- package/dist/client/resources/mcp-integration-logos.js +4 -0
- package/dist/client/resources/mcp-integration-logos.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts +5 -0
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +39 -13
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/client/use-db-sync.d.ts +3 -2
- package/dist/client/use-db-sync.d.ts.map +1 -1
- package/dist/client/use-db-sync.js +17 -6
- package/dist/client/use-db-sync.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/connections/catalog.d.ts +1 -1
- package/dist/connections/catalog.d.ts.map +1 -1
- package/dist/connections/catalog.js +7 -1
- package/dist/connections/catalog.js.map +1 -1
- package/dist/eject/remote-mcp-presets.d.ts.map +1 -1
- package/dist/eject/remote-mcp-presets.js +33 -3
- package/dist/eject/remote-mcp-presets.js.map +1 -1
- package/dist/guards/explicit-collab-access.d.ts +8 -0
- package/dist/guards/explicit-collab-access.d.ts.map +1 -0
- package/dist/guards/explicit-collab-access.js +214 -0
- package/dist/guards/explicit-collab-access.js.map +1 -0
- package/dist/guards/index.d.ts +1 -0
- package/dist/guards/index.d.ts.map +1 -1
- package/dist/guards/index.js +1 -0
- package/dist/guards/index.js.map +1 -1
- package/dist/localization/default-messages.d.ts +43 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +48 -5
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp/connect-route.d.ts.map +1 -1
- package/dist/mcp/connect-route.js +34 -48
- package/dist/mcp/connect-route.js.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +11 -11
- package/dist/provider-api/actions/provider-api.d.ts +7 -7
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/provider-api/index.js +1 -1
- package/dist/provider-api/index.js.map +1 -1
- package/dist/server/collab-plugin.d.ts +34 -3
- package/dist/server/collab-plugin.d.ts.map +1 -1
- package/dist/server/collab-plugin.js +65 -12
- package/dist/server/collab-plugin.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.map +1 -1
- package/dist/styles/agent-native.css +40 -0
- package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/dist/templates/chat/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/dist/templates/chat/app/components/layout/Layout.tsx +1 -0
- package/dist/templates/chat/app/components/layout/Sidebar.tsx +43 -67
- package/dist/templates/chat/app/hooks/use-navigation-state.ts +2 -7
- package/dist/templates/chat/app/routes/_index.tsx +8 -5
- package/dist/templates/chat/changelog/2026-07-22-compact-sidebar-footer.md +6 -0
- package/dist/templates/chat/changelog/2026-07-22-full-page-chat-keeps-the-active-conversation-when-moving-to-.md +6 -0
- package/dist/templates/chat/changelog/2026-07-22-recent-chats-are-easier-to-scan-and-expand.md +6 -0
- package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/dist/templates/default/.agents/skills/real-time-collab/SKILL.md +35 -13
- package/dist/templates/default/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/dist/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +35 -13
- package/dist/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +12 -8
- package/docs/AGENTS.md +1 -1
- package/docs/content/agent-mentions.mdx +2 -2
- package/docs/content/{workspace.mdx → agent-resources.mdx} +1 -7
- package/docs/content/agent-teams.mdx +4 -4
- package/docs/content/dispatch.mdx +10 -10
- package/docs/content/drop-in-agent.mdx +4 -4
- package/docs/content/external-agents.mdx +1 -1
- package/docs/content/frames.mdx +1 -1
- package/docs/content/integrations.mdx +13 -2
- package/docs/content/key-concepts.mdx +2 -2
- package/docs/content/mcp-clients.mdx +7 -1
- package/docs/content/multi-app-workspace.mdx +3 -3
- package/docs/content/real-time-collaboration.mdx +33 -15
- package/docs/content/recurring-jobs.mdx +7 -7
- package/docs/content/skills-guide.mdx +4 -4
- package/docs/content/template-brain.mdx +1 -1
- package/docs/content/toolkit-collaboration.mdx +1 -1
- package/docs/content/using-your-agent.mdx +1 -1
- package/docs/content/what-is-agent-native.mdx +4 -4
- package/docs/content/workspace-management.mdx +4 -4
- package/package.json +3 -3
- package/src/agent/production-agent.ts +13 -3
- package/src/cli/doctor.ts +6 -1
- package/src/client/AgentPanel.tsx +79 -41
- package/src/client/AssistantChat.tsx +71 -25
- package/src/client/FeedbackButton.tsx +33 -7
- package/src/client/MultiTabAssistantChat.tsx +6 -8
- package/src/client/agent-chat-adapter.ts +11 -2
- package/src/client/agent-page/AgentTabFrame.tsx +22 -3
- package/src/client/agent-page/AgentTabsPage.tsx +34 -19
- package/src/client/chat/message-components.tsx +43 -16
- package/src/client/chat/tool-call-display.tsx +30 -18
- package/src/client/chat/tool-render-registry.tsx +2 -0
- package/src/client/resources/McpConnectionSuggestion.tsx +19 -2
- package/src/client/resources/ResourceTree.tsx +7 -10
- package/src/client/resources/ResourcesPanel.tsx +33 -70
- package/src/client/resources/mcp-connection-resume.ts +107 -0
- package/src/client/resources/mcp-integration-catalog.ts +65 -12
- package/src/client/resources/mcp-integration-logos.ts +4 -0
- package/src/client/sse-event-processor.ts +50 -14
- package/src/client/use-db-sync.ts +16 -6
- package/src/connections/catalog.ts +7 -1
- package/src/eject/remote-mcp-presets.ts +37 -5
- package/src/guards/explicit-collab-access.ts +229 -0
- package/src/guards/index.ts +1 -0
- package/src/localization/default-messages.ts +54 -5
- package/src/mcp/connect-route.ts +34 -51
- package/src/provider-api/index.ts +1 -1
- package/src/server/collab-plugin.ts +137 -18
- package/src/server/index.ts +2 -0
- package/src/styles/agent-native.css +40 -0
- package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/src/templates/chat/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/src/templates/chat/app/components/layout/Layout.tsx +1 -0
- package/src/templates/chat/app/components/layout/Sidebar.tsx +43 -67
- package/src/templates/chat/app/hooks/use-navigation-state.ts +2 -7
- package/src/templates/chat/app/routes/_index.tsx +8 -5
- package/src/templates/chat/changelog/2026-07-22-compact-sidebar-footer.md +6 -0
- package/src/templates/chat/changelog/2026-07-22-full-page-chat-keeps-the-active-conversation-when-moving-to-.md +6 -0
- package/src/templates/chat/changelog/2026-07-22-recent-chats-are-easier-to-scan-and-expand.md +6 -0
- package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/src/templates/default/.agents/skills/real-time-collab/SKILL.md +35 -13
- package/src/templates/default/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +4 -1
- package/src/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +35 -13
- package/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +1 -1
- package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +12 -8
|
@@ -12,7 +12,7 @@ import { useT } from "@agent-native/core/client/i18n";
|
|
|
12
12
|
import { OrgSwitcher } from "@agent-native/core/client/org";
|
|
13
13
|
import { FeedbackButton } from "@agent-native/core/client/ui";
|
|
14
14
|
import {
|
|
15
|
-
|
|
15
|
+
ChatHistoryRail,
|
|
16
16
|
type ChatHistoryItem,
|
|
17
17
|
} from "@agent-native/toolkit/chat-history";
|
|
18
18
|
import {
|
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
IconLayoutSidebarLeftExpand,
|
|
23
23
|
IconLayoutGrid,
|
|
24
24
|
IconPhotoPlus,
|
|
25
|
-
IconPlus,
|
|
26
25
|
IconSettings,
|
|
27
26
|
IconShare3,
|
|
28
27
|
} from "@tabler/icons-react";
|
|
@@ -96,6 +95,12 @@ function persistedActiveThreadId() {
|
|
|
96
95
|
}
|
|
97
96
|
}
|
|
98
97
|
|
|
98
|
+
function persistActiveThreadId(threadId: string) {
|
|
99
|
+
try {
|
|
100
|
+
localStorage.setItem(ASSETS_ACTIVE_THREAD_KEY, threadId);
|
|
101
|
+
} catch {}
|
|
102
|
+
}
|
|
103
|
+
|
|
99
104
|
function threadIdFromPath(pathname: string) {
|
|
100
105
|
const match = pathname.match(/^\/chat\/([^/]+)/);
|
|
101
106
|
if (!match) return null;
|
|
@@ -134,8 +139,7 @@ function AssetsChatsSection() {
|
|
|
134
139
|
() =>
|
|
135
140
|
threads
|
|
136
141
|
.filter((thread) => thread.messageCount > 0 && !thread.archivedAt)
|
|
137
|
-
.sort(compareThreads)
|
|
138
|
-
.slice(0, 10),
|
|
142
|
+
.sort(compareThreads),
|
|
139
143
|
[threads],
|
|
140
144
|
);
|
|
141
145
|
const displayedActiveThreadId =
|
|
@@ -177,6 +181,7 @@ function AssetsChatsSection() {
|
|
|
177
181
|
|
|
178
182
|
function openThread(threadId: string, options?: { isNew?: boolean }) {
|
|
179
183
|
switchThread(threadId);
|
|
184
|
+
persistActiveThreadId(threadId);
|
|
180
185
|
navigateWithAgentChatViewTransition(
|
|
181
186
|
navigate,
|
|
182
187
|
options?.isNew ? "/" : chatThreadPath(threadId),
|
|
@@ -236,63 +241,50 @@ function AssetsChatsSection() {
|
|
|
236
241
|
|
|
237
242
|
return (
|
|
238
243
|
<div className="mt-2 border-s border-border/70 ps-3">
|
|
239
|
-
<
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
labels={{
|
|
284
|
-
options: (item) =>
|
|
285
|
-
t("chat.optionsFor", { title: item.titleText ?? "" }),
|
|
286
|
-
renameInput: (item) => `Rename ${item.titleText ?? ""}`,
|
|
287
|
-
rename: t("chat.renameChat"),
|
|
288
|
-
pin: t("chat.pinChat"),
|
|
289
|
-
unpin: t("chat.unpinChat"),
|
|
290
|
-
delete: t("chat.archiveChat"),
|
|
291
|
-
}}
|
|
292
|
-
variant="rail"
|
|
293
|
-
className="min-w-0"
|
|
294
|
-
/>
|
|
295
|
-
)}
|
|
244
|
+
<ChatHistoryRail
|
|
245
|
+
items={chatItems}
|
|
246
|
+
activeId={displayedActiveThreadId}
|
|
247
|
+
onSelect={openThread}
|
|
248
|
+
onNewChat={() => void handleNewChat()}
|
|
249
|
+
railLabels={{
|
|
250
|
+
newChat: t("chat.newChat"),
|
|
251
|
+
showMore: t("chat.chats"),
|
|
252
|
+
showLess: t("chat.chats"),
|
|
253
|
+
}}
|
|
254
|
+
previewCount={5}
|
|
255
|
+
expandedCount={15}
|
|
256
|
+
onTogglePin={(threadId) => {
|
|
257
|
+
const thread = visibleThreads.find((item) => item.id === threadId);
|
|
258
|
+
if (thread) void pinThread(threadId, !thread.pinnedAt);
|
|
259
|
+
}}
|
|
260
|
+
onRename={handleRenameThread}
|
|
261
|
+
renameMaxLength={160}
|
|
262
|
+
onDelete={(threadId) => void handleArchiveThread(threadId)}
|
|
263
|
+
renderAdditionalRowActions={(item, closeMenu) => (
|
|
264
|
+
<button
|
|
265
|
+
type="button"
|
|
266
|
+
role="menuitem"
|
|
267
|
+
className="an-chat-history-row__menu-item"
|
|
268
|
+
onClick={() => {
|
|
269
|
+
closeMenu();
|
|
270
|
+
void handleCopyShareLink(item.id);
|
|
271
|
+
}}
|
|
272
|
+
>
|
|
273
|
+
<IconShare3 size={13} strokeWidth={1.8} />
|
|
274
|
+
<span>{t("chat.copyShareLink")}</span>
|
|
275
|
+
</button>
|
|
276
|
+
)}
|
|
277
|
+
labels={{
|
|
278
|
+
options: (item) =>
|
|
279
|
+
t("chat.optionsFor", { title: item.titleText ?? "" }),
|
|
280
|
+
renameInput: (item) => `Rename ${item.titleText ?? ""}`,
|
|
281
|
+
rename: t("chat.renameChat"),
|
|
282
|
+
pin: t("chat.pinChat"),
|
|
283
|
+
unpin: t("chat.unpinChat"),
|
|
284
|
+
delete: t("chat.archiveChat"),
|
|
285
|
+
}}
|
|
286
|
+
className="min-w-0"
|
|
287
|
+
/>
|
|
296
288
|
</div>
|
|
297
289
|
);
|
|
298
290
|
}
|
|
@@ -466,7 +458,7 @@ export function Sidebar() {
|
|
|
466
458
|
<OrgSwitcher />
|
|
467
459
|
</div>
|
|
468
460
|
|
|
469
|
-
<div className="px-3 py-2">
|
|
461
|
+
<div className="px-3 py-2 empty:hidden">
|
|
470
462
|
<DevDatabaseLink />
|
|
471
463
|
<FeedbackButton />
|
|
472
464
|
</div>
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isAgentChatHomeHandoffActive,
|
|
3
|
-
markAgentChatHomeHandoff,
|
|
4
|
-
} from "@agent-native/core/client/agent-chat";
|
|
1
|
+
import { markAgentChatHomeHandoff } from "@agent-native/core/client/agent-chat";
|
|
5
2
|
import { getBrowserTabId } from "@agent-native/core/client/hooks";
|
|
6
3
|
import { useAgentRouteState } from "@agent-native/core/client/navigation";
|
|
7
4
|
import { useLocation } from "react-router";
|
|
@@ -204,8 +201,7 @@ export function useNavigationState() {
|
|
|
204
201
|
onNavigate: (_command, path) => {
|
|
205
202
|
if (
|
|
206
203
|
isCreatePath(location.pathname) &&
|
|
207
|
-
!isCreatePath(pathnameFromPath(path))
|
|
208
|
-
isAgentChatHomeHandoffActive(ASSETS_CHAT_STORAGE_KEY)
|
|
204
|
+
!isCreatePath(pathnameFromPath(path))
|
|
209
205
|
) {
|
|
210
206
|
markAgentChatHomeHandoff(ASSETS_CHAT_STORAGE_KEY);
|
|
211
207
|
}
|
|
@@ -59,6 +59,13 @@ export default function CreatePage() {
|
|
|
59
59
|
const { threadId } = useParams();
|
|
60
60
|
const navigate = useNavigate();
|
|
61
61
|
const t = useT();
|
|
62
|
+
const threadUrlSync = threadId
|
|
63
|
+
? {
|
|
64
|
+
routeThreadId: threadId,
|
|
65
|
+
getPath: chatThreadPath,
|
|
66
|
+
navigate,
|
|
67
|
+
}
|
|
68
|
+
: undefined;
|
|
62
69
|
const imageModelMenu = useImageModelMenu();
|
|
63
70
|
|
|
64
71
|
useEffect(() => {
|
|
@@ -82,11 +89,7 @@ export default function CreatePage() {
|
|
|
82
89
|
className="assets-create-chat-panel"
|
|
83
90
|
defaultMode="chat"
|
|
84
91
|
storageKey={ASSETS_CHAT_STORAGE_KEY}
|
|
85
|
-
threadUrlSync={
|
|
86
|
-
routeThreadId: threadId ?? null,
|
|
87
|
-
getPath: chatThreadPath,
|
|
88
|
-
navigate,
|
|
89
|
-
}}
|
|
92
|
+
threadUrlSync={threadUrlSync}
|
|
90
93
|
browserTabId={getBrowserTabId()}
|
|
91
94
|
threadFooterSlot={({ threadId }) => (
|
|
92
95
|
<GenerationResults threadId={threadId} />
|
|
@@ -85,7 +85,10 @@ in the moment of agent use.
|
|
|
85
85
|
approval, generative UI, progress, and screen-state exposure.
|
|
86
86
|
- **Chat history kit**: presentational chat lists and recent-chat rails belong
|
|
87
87
|
in Toolkit; Core keeps thread persistence, agent execution, transport, and
|
|
88
|
-
page-to-sidebar handoff.
|
|
88
|
+
page-to-sidebar handoff. Use Toolkit's `ChatHistoryRail` for the standard
|
|
89
|
+
five-item sidebar preview and a footer row with New chat followed by an
|
|
90
|
+
ellipsis disclosure up to fifteen. Apps inject routing, labels, and domain
|
|
91
|
+
actions.
|
|
89
92
|
- **Agent page kit**: the full-page `/agent` surface (`AgentTabsPage` from
|
|
90
93
|
`@agent-native/core/client`) with Context, Files, Connections, Jobs, and
|
|
91
94
|
Access tabs plus a Personal/Organization scope toggle. The canonical home
|
|
@@ -72,7 +72,7 @@ The agent modifies data in SQL, but the UI runs in the browser. SSE bridges same
|
|
|
72
72
|
});
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
`useDbSync` and every `subscribeSyncEvents` subscriber share one `EventSource` and one fallback poll loop per tab — this is how collaborative documents receive doc updates and cursor/awareness events.
|
|
75
|
+
`useDbSync` and every `subscribeSyncEvents` subscriber share one `EventSource` and one fallback poll loop per tab — this is how collaborative documents receive doc updates and cursor/awareness events. Hidden tabs keep that shared transport alive by default: SSE stays connected and active fallback polling relaxes to a 10-second floor (idle polling remains once per minute). Pass `pauseWhenHidden: true` only for a consumer that explicitly must stop all hidden-tab sync.
|
|
76
76
|
|
|
77
77
|
## Which sources to depend on
|
|
78
78
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core";
|
|
2
|
+
import { assertAccess } from "@agent-native/core/sharing";
|
|
3
|
+
import { eq } from "drizzle-orm";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
|
|
6
|
+
import { getDb, schema } from "../server/db/index.js";
|
|
7
|
+
import {
|
|
8
|
+
nanoid,
|
|
9
|
+
nowIso,
|
|
10
|
+
parseJson,
|
|
11
|
+
serializeSource,
|
|
12
|
+
sha256Hex,
|
|
13
|
+
stableJson,
|
|
14
|
+
} from "../server/lib/brain.js";
|
|
15
|
+
|
|
16
|
+
function sourceKeyFor(source: {
|
|
17
|
+
sourceKey?: string | null;
|
|
18
|
+
configJson?: string | null;
|
|
19
|
+
}) {
|
|
20
|
+
const columnValue = source.sourceKey?.trim();
|
|
21
|
+
if (columnValue) return columnValue;
|
|
22
|
+
const config = parseJson<Record<string, unknown>>(source.configJson, {});
|
|
23
|
+
const configValue = config.sourceKey;
|
|
24
|
+
return typeof configValue === "string" && configValue.trim()
|
|
25
|
+
? configValue.trim()
|
|
26
|
+
: null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default defineAction({
|
|
30
|
+
description:
|
|
31
|
+
"Rotate the signed ingest token for a configured Clips or generic Brain source. The new token is returned once so it can be saved in the sending app.",
|
|
32
|
+
agentTool: false,
|
|
33
|
+
toolCallable: false,
|
|
34
|
+
schema: z.object({
|
|
35
|
+
sourceId: z.string().min(1),
|
|
36
|
+
}),
|
|
37
|
+
run: async ({ sourceId }) => {
|
|
38
|
+
const access = await assertAccess("brain-source", sourceId, "admin");
|
|
39
|
+
const existing = access.resource;
|
|
40
|
+
if (existing.provider !== "clips" && existing.provider !== "generic") {
|
|
41
|
+
throw new Error(
|
|
42
|
+
"Only configured Clips or generic sources can rotate an ingest token.",
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const sourceKey = sourceKeyFor(existing);
|
|
47
|
+
if (!sourceKey) {
|
|
48
|
+
throw new Error("This source is missing a signed-ingest source key.");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const ingestToken = `brain_${nanoid(32)}`;
|
|
52
|
+
const ingestTokenHash = await sha256Hex(ingestToken);
|
|
53
|
+
const config = {
|
|
54
|
+
...parseJson<Record<string, unknown>>(existing.configJson, {}),
|
|
55
|
+
sourceKey,
|
|
56
|
+
ingestTokenHash,
|
|
57
|
+
};
|
|
58
|
+
const db = getDb();
|
|
59
|
+
await db
|
|
60
|
+
.update(schema.brainSources)
|
|
61
|
+
.set({
|
|
62
|
+
sourceKey,
|
|
63
|
+
ingestTokenHash,
|
|
64
|
+
configJson: stableJson(config),
|
|
65
|
+
updatedAt: nowIso(),
|
|
66
|
+
})
|
|
67
|
+
.where(eq(schema.brainSources.id, sourceId));
|
|
68
|
+
const [source] = await db
|
|
69
|
+
.select()
|
|
70
|
+
.from(schema.brainSources)
|
|
71
|
+
.where(eq(schema.brainSources.id, sourceId))
|
|
72
|
+
.limit(1);
|
|
73
|
+
if (!source) throw new Error(`Brain source ${sourceId} was not found`);
|
|
74
|
+
|
|
75
|
+
return { source: serializeSource(source), ingestToken };
|
|
76
|
+
},
|
|
77
|
+
});
|
|
@@ -44,7 +44,11 @@ export function Layout({ children }: { children: React.ReactNode }) {
|
|
|
44
44
|
activePath: location.pathname,
|
|
45
45
|
enabled: !isAskRoute,
|
|
46
46
|
});
|
|
47
|
-
useAgentChatHomeHandoffLinks({
|
|
47
|
+
useAgentChatHomeHandoffLinks({
|
|
48
|
+
storageKey: "brain",
|
|
49
|
+
chatPath: "/",
|
|
50
|
+
requireActiveHandoff: false,
|
|
51
|
+
});
|
|
48
52
|
|
|
49
53
|
useEffect(() => {
|
|
50
54
|
setMobileSidebarOpen(false);
|
|
@@ -10,13 +10,12 @@ import { useT } from "@agent-native/core/client/i18n";
|
|
|
10
10
|
import { OrgSwitcher } from "@agent-native/core/client/org";
|
|
11
11
|
import { FeedbackButton } from "@agent-native/core/client/ui";
|
|
12
12
|
import {
|
|
13
|
-
|
|
13
|
+
ChatHistoryRail,
|
|
14
14
|
type ChatHistoryItem,
|
|
15
15
|
} from "@agent-native/toolkit/chat-history";
|
|
16
16
|
import {
|
|
17
17
|
IconLayoutSidebarLeftCollapse,
|
|
18
18
|
IconLayoutSidebarLeftExpand,
|
|
19
|
-
IconPlus,
|
|
20
19
|
} from "@tabler/icons-react";
|
|
21
20
|
import { useEffect, useMemo } from "react";
|
|
22
21
|
import { Link, NavLink, useLocation, useNavigate } from "react-router";
|
|
@@ -102,8 +101,7 @@ function BrainChatsSection() {
|
|
|
102
101
|
() =>
|
|
103
102
|
threads
|
|
104
103
|
.filter((thread) => thread.messageCount > 0 && !thread.archivedAt)
|
|
105
|
-
.sort(compareThreads)
|
|
106
|
-
.slice(0, 8),
|
|
104
|
+
.sort(compareThreads),
|
|
107
105
|
[threads],
|
|
108
106
|
);
|
|
109
107
|
const chatItems = useMemo<ChatHistoryItem[]>(
|
|
@@ -178,50 +176,37 @@ function BrainChatsSection() {
|
|
|
178
176
|
|
|
179
177
|
return (
|
|
180
178
|
<div className="mt-2 border-s border-sidebar-border/70 ps-3">
|
|
181
|
-
<
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
options: (item) =>
|
|
213
|
-
t("chat.optionsFor", { title: item.titleText ?? "" }),
|
|
214
|
-
renameInput: (item) =>
|
|
215
|
-
t("chat.renameThread", { title: item.titleText ?? "" }),
|
|
216
|
-
rename: t("chat.renameChat"),
|
|
217
|
-
pin: t("chat.pinChat"),
|
|
218
|
-
unpin: t("chat.unpinChat"),
|
|
219
|
-
delete: t("chat.archiveChat"),
|
|
220
|
-
}}
|
|
221
|
-
variant="rail"
|
|
222
|
-
className="min-w-0"
|
|
223
|
-
/>
|
|
224
|
-
)}
|
|
179
|
+
<ChatHistoryRail
|
|
180
|
+
items={chatItems}
|
|
181
|
+
activeId={activeThreadId}
|
|
182
|
+
onSelect={openThread}
|
|
183
|
+
onNewChat={() => void handleNewChat()}
|
|
184
|
+
railLabels={{
|
|
185
|
+
newChat: t("chat.newChat"),
|
|
186
|
+
showMore: t("chat.chats"),
|
|
187
|
+
showLess: t("chat.chats"),
|
|
188
|
+
}}
|
|
189
|
+
previewCount={5}
|
|
190
|
+
expandedCount={15}
|
|
191
|
+
onTogglePin={(threadId) => {
|
|
192
|
+
const thread = visibleThreads.find((item) => item.id === threadId);
|
|
193
|
+
if (thread) void pinThread(threadId, !thread.pinnedAt);
|
|
194
|
+
}}
|
|
195
|
+
onRename={handleRenameThread}
|
|
196
|
+
renameMaxLength={160}
|
|
197
|
+
onDelete={(threadId) => void handleArchiveThread(threadId)}
|
|
198
|
+
labels={{
|
|
199
|
+
options: (item) =>
|
|
200
|
+
t("chat.optionsFor", { title: item.titleText ?? "" }),
|
|
201
|
+
renameInput: (item) =>
|
|
202
|
+
t("chat.renameThread", { title: item.titleText ?? "" }),
|
|
203
|
+
rename: t("chat.renameChat"),
|
|
204
|
+
pin: t("chat.pinChat"),
|
|
205
|
+
unpin: t("chat.unpinChat"),
|
|
206
|
+
delete: t("chat.archiveChat"),
|
|
207
|
+
}}
|
|
208
|
+
className="min-w-0"
|
|
209
|
+
/>
|
|
225
210
|
</div>
|
|
226
211
|
);
|
|
227
212
|
}
|
|
@@ -312,7 +297,6 @@ export function Sidebar({
|
|
|
312
297
|
</p>
|
|
313
298
|
</div>
|
|
314
299
|
</Link>
|
|
315
|
-
{!collapsed ? collapseButton : null}
|
|
316
300
|
</div>
|
|
317
301
|
|
|
318
302
|
<nav
|
|
@@ -394,11 +378,14 @@ export function Sidebar({
|
|
|
394
378
|
{!collapsed ? (
|
|
395
379
|
<div className="px-3 py-2">
|
|
396
380
|
<DevDatabaseLink />
|
|
397
|
-
<
|
|
381
|
+
<div className="flex items-center justify-end gap-1">
|
|
382
|
+
<FeedbackButton className="min-w-0 flex-1" side="right" />
|
|
383
|
+
{collapseButton}
|
|
384
|
+
</div>
|
|
398
385
|
</div>
|
|
399
386
|
) : null}
|
|
400
387
|
|
|
401
|
-
{collapseButton ? (
|
|
388
|
+
{collapsed && collapseButton ? (
|
|
402
389
|
<div className="flex justify-center px-2 py-2">{collapseButton}</div>
|
|
403
390
|
) : null}
|
|
404
391
|
</div>
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isAgentChatHomeHandoffActive,
|
|
3
|
-
markAgentChatHomeHandoff,
|
|
4
|
-
} from "@agent-native/core/client/agent-chat";
|
|
1
|
+
import { markAgentChatHomeHandoff } from "@agent-native/core/client/agent-chat";
|
|
5
2
|
import { appBasePath, appPath } from "@agent-native/core/client/api-path";
|
|
6
3
|
import { useAgentRouteState } from "@agent-native/core/client/navigation";
|
|
7
4
|
import { useLocation } from "react-router";
|
|
@@ -109,11 +106,7 @@ export function useNavigationState() {
|
|
|
109
106
|
return `${path}${params.size ? `?${params.toString()}` : ""}`;
|
|
110
107
|
},
|
|
111
108
|
onNavigate: (_command, path) => {
|
|
112
|
-
if (
|
|
113
|
-
location.pathname === "/" &&
|
|
114
|
-
pathnameFromPath(path) !== "/" &&
|
|
115
|
-
isAgentChatHomeHandoffActive("brain")
|
|
116
|
-
) {
|
|
109
|
+
if (location.pathname === "/" && pathnameFromPath(path) !== "/") {
|
|
117
110
|
markAgentChatHomeHandoff("brain");
|
|
118
111
|
}
|
|
119
112
|
},
|