@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
|
@@ -5,10 +5,33 @@
|
|
|
5
5
|
* ```ts
|
|
6
6
|
* // server/plugins/collab.ts
|
|
7
7
|
* import { createCollabPlugin } from "@agent-native/core/server";
|
|
8
|
-
* export default createCollabPlugin({
|
|
8
|
+
* export default createCollabPlugin({
|
|
9
|
+
* table: "documents",
|
|
10
|
+
* contentColumn: "content",
|
|
11
|
+
* access: { mode: "resource", resourceType: "document" },
|
|
12
|
+
* });
|
|
9
13
|
* ```
|
|
10
14
|
*/
|
|
11
15
|
type NitroPluginDef = (nitroApp: any) => void | Promise<void>;
|
|
16
|
+
export type CollabResourceIdResolver = (docId: string) => string | null | Promise<string | null>;
|
|
17
|
+
export type CollabAccess = {
|
|
18
|
+
mode: "resource";
|
|
19
|
+
/** The shareable resource type registered via `registerShareableResource`. */
|
|
20
|
+
resourceType: string;
|
|
21
|
+
/** Map a collab document id to its parent shareable resource id. */
|
|
22
|
+
resolveResourceId?: CollabResourceIdResolver;
|
|
23
|
+
} | {
|
|
24
|
+
/** Deliver collaboration events to every authenticated user. */
|
|
25
|
+
mode: "all-authenticated";
|
|
26
|
+
};
|
|
27
|
+
type NormalizedCollabAccess = {
|
|
28
|
+
mode: "resource";
|
|
29
|
+
resourceType: string;
|
|
30
|
+
resolveResourceId?: CollabResourceIdResolver;
|
|
31
|
+
} | {
|
|
32
|
+
mode: "all-authenticated";
|
|
33
|
+
explicit: boolean;
|
|
34
|
+
};
|
|
12
35
|
export interface CollabPluginOptions {
|
|
13
36
|
/** Table name containing document content. Default: "documents" */
|
|
14
37
|
table?: string;
|
|
@@ -27,18 +50,25 @@ export interface CollabPluginOptions {
|
|
|
27
50
|
contentType?: "text" | "json";
|
|
28
51
|
/** Column name for JSON content (used when contentType is "json"). */
|
|
29
52
|
jsonColumn?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Access policy for collaboration routes and event delivery.
|
|
55
|
+
* Use `resource` for registered shareable resources, or explicitly choose
|
|
56
|
+
* `all-authenticated` for deployment-wide collaboration.
|
|
57
|
+
*/
|
|
58
|
+
access?: CollabAccess;
|
|
30
59
|
/**
|
|
31
60
|
* The shareable resource type registered via `registerShareableResource`.
|
|
32
61
|
* Used to enforce access checks on collab routes.
|
|
33
|
-
*
|
|
62
|
+
* @deprecated Use `access: { mode: "resource", resourceType }`.
|
|
34
63
|
*/
|
|
35
64
|
resourceType?: string;
|
|
36
65
|
/**
|
|
37
66
|
* Map the collab document id to the shareable resource id. Many templates
|
|
38
67
|
* use route-specific collab ids (for example, one doc per slide inside a
|
|
39
68
|
* deck) while sharing is enforced at the parent resource level.
|
|
69
|
+
* @deprecated Use `access: { mode: "resource", resourceType, resolveResourceId }`.
|
|
40
70
|
*/
|
|
41
|
-
resolveResourceId?:
|
|
71
|
+
resolveResourceId?: CollabResourceIdResolver;
|
|
42
72
|
/**
|
|
43
73
|
* Maximum allowed body size in bytes for write operations
|
|
44
74
|
* (update/text/json/patch). Requests exceeding this are rejected with 413.
|
|
@@ -46,6 +76,7 @@ export interface CollabPluginOptions {
|
|
|
46
76
|
*/
|
|
47
77
|
maxPayloadBytes?: number;
|
|
48
78
|
}
|
|
79
|
+
export declare function normalizeCollabAccess(options: Pick<CollabPluginOptions, "access" | "resourceType" | "resolveResourceId">): NormalizedCollabAccess;
|
|
49
80
|
export declare function createCollabPlugin(options?: CollabPluginOptions): NitroPluginDef;
|
|
50
81
|
export {};
|
|
51
82
|
//# sourceMappingURL=collab-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collab-plugin.d.ts","sourceRoot":"","sources":["../../src/server/collab-plugin.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"collab-plugin.d.ts","sourceRoot":"","sources":["../../src/server/collab-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAiCH,KAAK,cAAc,GAAG,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAY9D,MAAM,MAAM,wBAAwB,GAAG,CACrC,KAAK,EAAE,MAAM,KACV,MAAM,GA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AI,CACX,mBAAmB,EACnB,QAAQ,GAAG,cAAc,GAAG,mBAAmB,CAChD,GACA,sBAAsB,CAkDxB;AAaD,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,mBAAwB,GAChC,cAAc,CAsShB"}
|
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
* ```ts
|
|
6
6
|
* // server/plugins/collab.ts
|
|
7
7
|
* import { createCollabPlugin } from "@agent-native/core/server";
|
|
8
|
-
* export default createCollabPlugin({
|
|
8
|
+
* export default createCollabPlugin({
|
|
9
|
+
* table: "documents",
|
|
10
|
+
* contentColumn: "content",
|
|
11
|
+
* access: { mode: "resource", resourceType: "document" },
|
|
12
|
+
* });
|
|
9
13
|
* ```
|
|
10
14
|
*/
|
|
11
15
|
import { defineEventHandler, getMethod, setResponseStatus, } from "h3";
|
|
@@ -26,13 +30,68 @@ import { runWithRequestContext } from "./request-context.js";
|
|
|
26
30
|
/** Default maximum body size in bytes for collab write operations (2 MB). */
|
|
27
31
|
const DEFAULT_MAX_PAYLOAD_BYTES = 2 * 1024 * 1024;
|
|
28
32
|
/**
|
|
29
|
-
*
|
|
30
|
-
* process. Avoids
|
|
31
|
-
*
|
|
33
|
+
* Tables whose implicit all-authenticated warning has already been logged in
|
|
34
|
+
* this process. Avoids duplicate warnings during hot reloads while still
|
|
35
|
+
* identifying every affected table.
|
|
32
36
|
*/
|
|
33
|
-
|
|
37
|
+
const COLLAB_WARNING_TABLES_KEY = "__agentNativeImplicitCollabAccessWarningTables__";
|
|
38
|
+
const collabWarningGlobal = globalThis;
|
|
39
|
+
const _unscoped_warning_tables = (collabWarningGlobal[COLLAB_WARNING_TABLES_KEY] ??= new Set());
|
|
40
|
+
export function normalizeCollabAccess(options) {
|
|
41
|
+
const hasLegacyAccess = options.resourceType !== undefined ||
|
|
42
|
+
options.resolveResourceId !== undefined;
|
|
43
|
+
if (options.access && hasLegacyAccess) {
|
|
44
|
+
throw new Error('createCollabPlugin cannot combine "access" with the deprecated root "resourceType" or "resolveResourceId" options. Move those fields into access.');
|
|
45
|
+
}
|
|
46
|
+
if (options.access?.mode === "resource") {
|
|
47
|
+
if (!options.access.resourceType.trim()) {
|
|
48
|
+
throw new Error('createCollabPlugin access mode "resource" requires a non-empty resourceType.');
|
|
49
|
+
}
|
|
50
|
+
return options.access;
|
|
51
|
+
}
|
|
52
|
+
if (options.access?.mode === "all-authenticated") {
|
|
53
|
+
return { mode: "all-authenticated", explicit: true };
|
|
54
|
+
}
|
|
55
|
+
if (options.access) {
|
|
56
|
+
throw new Error(`createCollabPlugin received an unsupported access mode: ${String(options.access.mode)}`);
|
|
57
|
+
}
|
|
58
|
+
if (options.resourceType !== undefined) {
|
|
59
|
+
if (!options.resourceType.trim()) {
|
|
60
|
+
throw new Error('createCollabPlugin "resourceType" must be a non-empty string when provided.');
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
mode: "resource",
|
|
64
|
+
resourceType: options.resourceType,
|
|
65
|
+
resolveResourceId: options.resolveResourceId,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
if (options.resolveResourceId !== undefined) {
|
|
69
|
+
throw new Error('createCollabPlugin "resolveResourceId" requires a non-empty "resourceType".');
|
|
70
|
+
}
|
|
71
|
+
return { mode: "all-authenticated", explicit: false };
|
|
72
|
+
}
|
|
73
|
+
function warnForImplicitAllAuthenticatedAccess(table) {
|
|
74
|
+
if (_unscoped_warning_tables.has(table))
|
|
75
|
+
return;
|
|
76
|
+
_unscoped_warning_tables.add(table);
|
|
77
|
+
console.warn(`[collab] WARNING: createCollabPlugin for table "${table}" does not declare an access policy. ` +
|
|
78
|
+
"Collab events will be delivered to ALL authenticated users on this deployment without document-level access scoping. " +
|
|
79
|
+
'Use access: { mode: "resource", resourceType: "..." } for access-scoped delivery, ' +
|
|
80
|
+
'or access: { mode: "all-authenticated" } to explicitly acknowledge deployment-wide delivery.');
|
|
81
|
+
}
|
|
34
82
|
export function createCollabPlugin(options = {}) {
|
|
35
|
-
const
|
|
83
|
+
const normalizedAccess = normalizeCollabAccess(options);
|
|
84
|
+
const { table = "documents", contentColumn = "content", idColumn = "id", autoSeed = true, maxPayloadBytes = DEFAULT_MAX_PAYLOAD_BYTES, } = options;
|
|
85
|
+
const resourceType = normalizedAccess.mode === "resource"
|
|
86
|
+
? normalizedAccess.resourceType
|
|
87
|
+
: undefined;
|
|
88
|
+
const resolveResourceId = normalizedAccess.mode === "resource"
|
|
89
|
+
? normalizedAccess.resolveResourceId
|
|
90
|
+
: undefined;
|
|
91
|
+
if (normalizedAccess.mode === "all-authenticated" &&
|
|
92
|
+
!normalizedAccess.explicit) {
|
|
93
|
+
warnForImplicitAllAuthenticatedAccess(table);
|
|
94
|
+
}
|
|
36
95
|
return async (nitroApp) => {
|
|
37
96
|
await awaitBootstrap(nitroApp);
|
|
38
97
|
const P = FRAMEWORK_ROUTE_PREFIX;
|
|
@@ -51,12 +110,6 @@ export function createCollabPlugin(options = {}) {
|
|
|
51
110
|
// who don't match owner/org — instead of only degrading them to the
|
|
52
111
|
// poll fallback.
|
|
53
112
|
// See also: SECURITY comment in poll.ts on canSeeChangeForUser.
|
|
54
|
-
if (!resourceType && !_unscoped_warning_logged) {
|
|
55
|
-
_unscoped_warning_logged = true;
|
|
56
|
-
console.warn("[collab] WARNING: createCollabPlugin called without resourceType. " +
|
|
57
|
-
"Collab events will be delivered to ALL authenticated users on this deployment " +
|
|
58
|
-
"without document-level access scoping. Set resourceType to enable access-scoped delivery.");
|
|
59
|
-
}
|
|
60
113
|
const collabEmitter = getCollabEmitter();
|
|
61
114
|
collabEmitter.on("collab", async (event) => {
|
|
62
115
|
if (!resourceType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collab-plugin.js","sourceRoot":"","sources":["../../src/server/collab-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,iBAAiB,GAElB,MAAM,IAAI,CAAC;AAEZ,OAAO,EA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I,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gCAC/B,MAAM,YAAY,GAAoB,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;oCACzD,CAAC,CAAC,OAAO;oCACT,CAAC,CAAC,KAAK,CAAC;gCACV,MAAM,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;4BAC1D,CAAC;4BAAC,MAAM,CAAC;gCACP,sBAAsB;4BACxB,CAAC;wBACH,CAAC;6BAAM,CAAC;4BACN,MAAM,OAAO,GAAI,GAAG,CAAC,UAAU,CAAY,IAAI,EAAE,CAAC;4BAClD,MAAM,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;wBACrC,CAAC;oBACH,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC;oBACP,sDAAsD;gBACxD,CAAC;YACH,CAAC,EAAE,IAAI,CAAC,CAAC;QACX,CAAC;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Nitro plugin that mounts collaborative editing routes.\n *\n * Templates opt in with one line:\n * ```ts\n * // server/plugins/collab.ts\n * import { createCollabPlugin } from \"@agent-native/core/server\";\n * export default createCollabPlugin({ table: \"documents\", contentColumn: \"content\" });\n * ```\n */\n\nimport {\n defineEventHandler,\n getMethod,\n setResponseStatus,\n type H3Event,\n} from \"h3\";\n\nimport { postAwareness, getActiveUsers } from \"../collab/awareness.js\";\nimport { getCollabEmitter } from \"../collab/emitter.js\";\nimport {\n getCollabState,\n postCollabUpdate,\n postCollabText,\n postCollabSearchReplace,\n} from \"../collab/routes.js\";\nimport { hasCollabState } from \"../collab/storage.js\";\nimport {\n postCollabJson,\n getCollabJson,\n postCollabPatch,\n} from \"../collab/struct-routes.js\";\nimport { seedFromText, seedFromJson } from \"../collab/ydoc-manager.js\";\nimport { getDbExec } from \"../db/client.js\";\nimport { getOrgContext } from \"../org/context.js\";\nimport { resolveAccess, assertAccess } from \"../sharing/access.js\";\nimport { getSession } from \"./auth.js\";\nimport { FRAMEWORK_ROUTE_PREFIX } from \"./core-routes-plugin.js\";\nimport { getH3App, awaitBootstrap } from \"./framework-request-handler.js\";\nimport { recordChange } from \"./poll.js\";\nimport { runWithRequestContext } from \"./request-context.js\";\n\ntype NitroPluginDef = (nitroApp: any) => void | Promise<void>;\n\n/** Default maximum body size in bytes for collab write operations (2 MB). */\nconst DEFAULT_MAX_PAYLOAD_BYTES = 2 * 1024 * 1024;\n\ntype CollabAwarenessScope = {\n owner?: string;\n orgId?: string;\n resourceType?: string;\n resourceId?: string;\n};\n\n/**\n * Whether the no-resourceType warning has already been logged once per server\n * process. Avoids flooding logs on every request in templates that deliberately\n * have no sharing model.\n */\nlet _unscoped_warning_logged = false;\n\nexport interface CollabPluginOptions {\n /** Table name containing document content. Default: \"documents\" */\n table?: string;\n /** Column name for text content. Default: \"content\" */\n contentColumn?: string;\n /** Column name for the document ID. Default: \"id\" */\n idColumn?: string;\n /** Whether to auto-seed existing documents on startup. Default: true */\n autoSeed?: boolean;\n /**\n * Callback invoked after a collab update to sync the content column.\n * If not provided, the plugin auto-syncs using table/contentColumn/idColumn.\n */\n onContentSync?: (docId: string, text: string) => Promise<void>;\n /** Content type: \"text\" for Y.Text (default) or \"json\" for Y.Map/Y.Array. */\n contentType?: \"text\" | \"json\";\n /** Column name for JSON content (used when contentType is \"json\"). */\n jsonColumn?: string;\n /**\n * The shareable resource type registered via `registerShareableResource`.\n * Used to enforce access checks on collab routes.\n * Omit only for resources that are always public (no sharing model).\n */\n resourceType?: string;\n /**\n * Map the collab document id to the shareable resource id. Many templates\n * use route-specific collab ids (for example, one doc per slide inside a\n * deck) while sharing is enforced at the parent resource level.\n */\n resolveResourceId?: (docId: string) => string | null | Promise<string | null>;\n /**\n * Maximum allowed body size in bytes for write operations\n * (update/text/json/patch). Requests exceeding this are rejected with 413.\n * Default: 2097152 (2 MB).\n */\n maxPayloadBytes?: number;\n}\n\nexport function createCollabPlugin(\n options: CollabPluginOptions = {},\n): NitroPluginDef {\n const {\n table = \"documents\",\n contentColumn = \"content\",\n idColumn = \"id\",\n autoSeed = true,\n resourceType,\n resolveResourceId,\n maxPayloadBytes = DEFAULT_MAX_PAYLOAD_BYTES,\n } = options;\n\n return async (nitroApp: any) => {\n await awaitBootstrap(nitroApp);\n const P = FRAMEWORK_ROUTE_PREFIX;\n\n // Wire collab emitter → poll ring buffer so clients receive Yjs updates.\n // Security: when resourceType is configured, resolve the resource's\n // owner/org so getChangesSinceForUser can scope delivery. We use\n // resolveAccess to obtain the resource row — it already handles ownership,\n // visibility, and share rows. In addition to the owner/org tags we also\n // tag the event with `resourceType` + `resourceId` so the per-user\n // delivery filter (canSeeChangeForUser) can evaluate resource access\n // directly for non-owner sharees:\n // • tag the event with the resource owner's email and org (owner-scoped)\n // for backward compatibility with the conservative owner/org fast path.\n // • ALSO tag with resourceType/resourceId so canSeeChangeForUser can run\n // an access-aware (cached) check and push to explicit viewer+ sharees\n // who don't match owner/org — instead of only degrading them to the\n // poll fallback.\n // See also: SECURITY comment in poll.ts on canSeeChangeForUser.\n if (!resourceType && !_unscoped_warning_logged) {\n _unscoped_warning_logged = true;\n console.warn(\n \"[collab] WARNING: createCollabPlugin called without resourceType. \" +\n \"Collab events will be delivered to ALL authenticated users on this deployment \" +\n \"without document-level access scoping. Set resourceType to enable access-scoped delivery.\",\n );\n }\n\n const collabEmitter = getCollabEmitter();\n collabEmitter.on(\"collab\", async (event) => {\n if (!resourceType) {\n // No access model — broadcast to all authenticated users (no owner/orgId tag).\n recordChange(event);\n return;\n }\n\n // Resolve the resource to learn its owner/org so we can scope the event.\n const docId = event.docId as string | undefined;\n if (!docId) {\n recordChange(event);\n return;\n }\n\n try {\n const resourceId = resolveResourceId\n ? await resolveResourceId(docId)\n : docId;\n if (!resourceId) {\n // Cannot resolve resource — drop the event to avoid leaking to\n // unauthorized pollers. The client will catch up via state-vector.\n return;\n }\n\n // Load the resource row to get owner/org. resolveAccess fetches the\n // resource row internally; use getShareableResource to read it cheaply.\n const { requireShareableResource } =\n await import(\"../sharing/registry.js\");\n const reg = requireShareableResource(resourceType);\n const db = reg.getDb() as any;\n const { eq } = await import(\"drizzle-orm\");\n const [resource] = await db\n .select()\n .from(reg.resourceTable)\n .where(eq(reg.resourceTable.id, resourceId))\n .limit(1);\n\n if (!resource) {\n // Resource deleted — drop silently.\n return;\n }\n\n const ownerEmail =\n typeof resource.ownerEmail === \"string\"\n ? resource.ownerEmail\n : undefined;\n const orgId =\n typeof resource.orgId === \"string\" ? resource.orgId : undefined;\n\n // Tag the event with owner/org (backward-compat fast path) AND with\n // resourceType/resourceId so canSeeChangeForUser can run an\n // access-aware check for non-owner sharees (see poll.ts).\n recordChange({\n ...event,\n ...(ownerEmail ? { owner: ownerEmail } : {}),\n ...(orgId ? { orgId } : {}),\n resourceType,\n resourceId,\n });\n } catch {\n // If we fail to resolve the resource (DB not ready, etc.) we skip\n // the event rather than broadcasting it without scoping.\n }\n });\n\n // Mount collab routes — manual method dispatch since the path layout is\n // `/collab/:docId/<action>`. The framework strips the `/collab` mount\n // prefix from event.url.pathname before calling us, so we see e.g.\n // `/abc-123/state`.\n getH3App(nitroApp).use(\n `${P}/collab`,\n defineEventHandler(async (event: H3Event) => {\n const parts = (event.url?.pathname || \"\")\n .replace(/^\\/+/, \"\")\n .split(\"/\");\n const docId = parts[0] || \"\";\n const action = parts[1] || \"\";\n if (!docId) return;\n if (event.context) {\n event.context.params = { ...event.context.params, docId };\n }\n const method = getMethod(event);\n\n // Auth check — all collab routes require a session\n const session = await getSession(event).catch(() => null);\n if (!session?.email) {\n setResponseStatus(event, 401);\n return { error: \"Authentication required\" };\n }\n\n const orgCtx = await getOrgContext(event).catch(() => null);\n const userEmail = session.email;\n const orgId = orgCtx?.orgId ?? undefined;\n\n return runWithRequestContext({ userEmail, orgId }, async () => {\n // Access check — require at least viewer for reads, editor for writes.\n // Awareness routes (POST awareness / GET users) require the same\n // level as other reads so that knowledge of who is editing a doc\n // doesn't leak to users without access.\n if (resourceType) {\n const resourceId = resolveResourceId\n ? await resolveResourceId(docId)\n : docId;\n if (!resourceId) {\n setResponseStatus(event, 404);\n return { error: \"Not found\" };\n }\n const isWrite =\n (action === \"update\" && method === \"POST\") ||\n (action === \"text\" && method === \"POST\") ||\n (action === \"search-replace\" && method === \"POST\") ||\n (action === \"json\" && method === \"POST\") ||\n (action === \"patch\" && method === \"POST\");\n\n if (isWrite) {\n // assertAccess throws ForbiddenError (→ 403) if no editor access\n const access = await assertAccess(\n resourceType,\n resourceId,\n \"editor\",\n );\n const resource = access.resource as Record<string, unknown>;\n const awarenessScope: CollabAwarenessScope = {\n resourceType,\n resourceId,\n ...(typeof resource.ownerEmail === \"string\"\n ? { owner: resource.ownerEmail }\n : {}),\n ...(typeof resource.orgId === \"string\"\n ? { orgId: resource.orgId }\n : {}),\n };\n if (event.context) {\n event.context._collabAwarenessScope = awarenessScope;\n }\n } else {\n // resolveAccess returns null when no access; return 404 to avoid leaking existence\n const access = await resolveAccess(resourceType, resourceId);\n if (!access) {\n setResponseStatus(event, 404);\n return { error: \"Not found\" };\n }\n const resource = access.resource as Record<string, unknown>;\n const awarenessScope: CollabAwarenessScope = {\n resourceType,\n resourceId,\n ...(typeof resource.ownerEmail === \"string\"\n ? { owner: resource.ownerEmail }\n : {}),\n ...(typeof resource.orgId === \"string\"\n ? { orgId: resource.orgId }\n : {}),\n };\n if (event.context) {\n event.context._collabAwarenessScope = awarenessScope;\n }\n }\n }\n\n // Payload size limit for write operations\n const isWriteAction =\n (action === \"update\" && method === \"POST\") ||\n (action === \"text\" && method === \"POST\") ||\n (action === \"search-replace\" && method === \"POST\") ||\n (action === \"json\" && method === \"POST\") ||\n (action === \"patch\" && method === \"POST\");\n\n if (isWriteAction) {\n const contentLength = Number(\n event.headers?.get?.(\"content-length\") ?? NaN,\n );\n if (!isNaN(contentLength) && contentLength > maxPayloadBytes) {\n setResponseStatus(event, 413);\n return {\n error: `Payload too large. Maximum is ${maxPayloadBytes} bytes.`,\n };\n }\n // Store limit in context so route handlers can enforce it on the\n // parsed body when content-length is absent or spoofed.\n if (event.context) {\n event.context._collabMaxPayloadBytes = maxPayloadBytes;\n }\n }\n\n if (action === \"state\" && method === \"GET\")\n return getCollabState(event);\n if (action === \"update\" && method === \"POST\")\n return postCollabUpdate(event);\n if (action === \"text\" && method === \"POST\")\n return postCollabText(event);\n if (action === \"search-replace\" && method === \"POST\")\n return postCollabSearchReplace(event);\n if (action === \"json\" && method === \"POST\")\n return postCollabJson(event);\n if (action === \"json\" && method === \"GET\")\n return getCollabJson(event);\n if (action === \"patch\" && method === \"POST\")\n return postCollabPatch(event);\n if (action === \"awareness\" && method === \"POST\")\n return postAwareness(event);\n if (action === \"users\" && method === \"GET\")\n return getActiveUsers(event);\n setResponseStatus(event, 404);\n return { error: \"Not found\" };\n });\n }),\n );\n\n // Auto-seed existing documents into collab state\n if (autoSeed) {\n const isJson = options.contentType === \"json\";\n const seedColumn = isJson\n ? options.jsonColumn || contentColumn\n : contentColumn;\n\n // Run in background so it doesn't block startup\n setTimeout(async () => {\n try {\n const client = getDbExec();\n const { rows } = await client.execute(\n `SELECT ${idColumn}, ${seedColumn} FROM ${table}`,\n );\n for (const row of rows) {\n const docId = row[idColumn] as string;\n const exists = await hasCollabState(docId);\n if (exists) continue;\n\n if (isJson) {\n const raw = (row[seedColumn] as string) ?? \"{}\";\n try {\n const parsed = JSON.parse(raw);\n const inferredType: \"map\" | \"array\" = Array.isArray(parsed)\n ? \"array\"\n : \"map\";\n await seedFromJson(docId, parsed, \"data\", inferredType);\n } catch {\n // Invalid JSON — skip\n }\n } else {\n const content = (row[seedColumn] as string) ?? \"\";\n await seedFromText(docId, content);\n }\n }\n } catch {\n // Table may not exist yet on first boot — that's fine\n }\n }, 1000);\n }\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"collab-plugin.js","sourceRoot":"","sources":["../../src/server/collab-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,kBA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,MAAM,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;wBACrC,CAAC;oBACH,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC;oBACP,sDAAsD;gBACxD,CAAC;YACH,CAAC,EAAE,IAAI,CAAC,CAAC;QACX,CAAC;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Nitro plugin that mounts collaborative editing routes.\n *\n * Templates opt in with one line:\n * ```ts\n * // server/plugins/collab.ts\n * import { createCollabPlugin } from \"@agent-native/core/server\";\n * export default createCollabPlugin({\n * table: \"documents\",\n * contentColumn: \"content\",\n * access: { mode: \"resource\", resourceType: \"document\" },\n * });\n * ```\n */\n\nimport {\n defineEventHandler,\n getMethod,\n setResponseStatus,\n type H3Event,\n} from \"h3\";\n\nimport { postAwareness, getActiveUsers } from \"../collab/awareness.js\";\nimport { getCollabEmitter } from \"../collab/emitter.js\";\nimport {\n getCollabState,\n postCollabUpdate,\n postCollabText,\n postCollabSearchReplace,\n} from \"../collab/routes.js\";\nimport { hasCollabState } from \"../collab/storage.js\";\nimport {\n postCollabJson,\n getCollabJson,\n postCollabPatch,\n} from \"../collab/struct-routes.js\";\nimport { seedFromText, seedFromJson } from \"../collab/ydoc-manager.js\";\nimport { getDbExec } from \"../db/client.js\";\nimport { getOrgContext } from \"../org/context.js\";\nimport { resolveAccess, assertAccess } from \"../sharing/access.js\";\nimport { getSession } from \"./auth.js\";\nimport { FRAMEWORK_ROUTE_PREFIX } from \"./core-routes-plugin.js\";\nimport { getH3App, awaitBootstrap } from \"./framework-request-handler.js\";\nimport { recordChange } from \"./poll.js\";\nimport { runWithRequestContext } from \"./request-context.js\";\n\ntype NitroPluginDef = (nitroApp: any) => void | Promise<void>;\n\n/** Default maximum body size in bytes for collab write operations (2 MB). */\nconst DEFAULT_MAX_PAYLOAD_BYTES = 2 * 1024 * 1024;\n\ntype CollabAwarenessScope = {\n owner?: string;\n orgId?: string;\n resourceType?: string;\n resourceId?: string;\n};\n\nexport type CollabResourceIdResolver = (\n docId: string,\n) => string | null | Promise<string | null>;\n\nexport type CollabAccess =\n | {\n mode: \"resource\";\n /** The shareable resource type registered via `registerShareableResource`. */\n resourceType: string;\n /** Map a collab document id to its parent shareable resource id. */\n resolveResourceId?: CollabResourceIdResolver;\n }\n | {\n /** Deliver collaboration events to every authenticated user. */\n mode: \"all-authenticated\";\n };\n\ntype NormalizedCollabAccess =\n | {\n mode: \"resource\";\n resourceType: string;\n resolveResourceId?: CollabResourceIdResolver;\n }\n | {\n mode: \"all-authenticated\";\n explicit: boolean;\n };\n\n/**\n * Tables whose implicit all-authenticated warning has already been logged in\n * this process. Avoids duplicate warnings during hot reloads while still\n * identifying every affected table.\n */\nconst COLLAB_WARNING_TABLES_KEY =\n \"__agentNativeImplicitCollabAccessWarningTables__\";\nconst collabWarningGlobal = globalThis as typeof globalThis & {\n [COLLAB_WARNING_TABLES_KEY]?: Set<string>;\n};\nconst _unscoped_warning_tables = (collabWarningGlobal[\n COLLAB_WARNING_TABLES_KEY\n] ??= new Set<string>());\n\nexport interface CollabPluginOptions {\n /** Table name containing document content. Default: \"documents\" */\n table?: string;\n /** Column name for text content. Default: \"content\" */\n contentColumn?: string;\n /** Column name for the document ID. Default: \"id\" */\n idColumn?: string;\n /** Whether to auto-seed existing documents on startup. Default: true */\n autoSeed?: boolean;\n /**\n * Callback invoked after a collab update to sync the content column.\n * If not provided, the plugin auto-syncs using table/contentColumn/idColumn.\n */\n onContentSync?: (docId: string, text: string) => Promise<void>;\n /** Content type: \"text\" for Y.Text (default) or \"json\" for Y.Map/Y.Array. */\n contentType?: \"text\" | \"json\";\n /** Column name for JSON content (used when contentType is \"json\"). */\n jsonColumn?: string;\n /**\n * Access policy for collaboration routes and event delivery.\n * Use `resource` for registered shareable resources, or explicitly choose\n * `all-authenticated` for deployment-wide collaboration.\n */\n access?: CollabAccess;\n /**\n * The shareable resource type registered via `registerShareableResource`.\n * Used to enforce access checks on collab routes.\n * @deprecated Use `access: { mode: \"resource\", resourceType }`.\n */\n resourceType?: string;\n /**\n * Map the collab document id to the shareable resource id. Many templates\n * use route-specific collab ids (for example, one doc per slide inside a\n * deck) while sharing is enforced at the parent resource level.\n * @deprecated Use `access: { mode: \"resource\", resourceType, resolveResourceId }`.\n */\n resolveResourceId?: CollabResourceIdResolver;\n /**\n * Maximum allowed body size in bytes for write operations\n * (update/text/json/patch). Requests exceeding this are rejected with 413.\n * Default: 2097152 (2 MB).\n */\n maxPayloadBytes?: number;\n}\n\nexport function normalizeCollabAccess(\n options: Pick<\n CollabPluginOptions,\n \"access\" | \"resourceType\" | \"resolveResourceId\"\n >,\n): NormalizedCollabAccess {\n const hasLegacyAccess =\n options.resourceType !== undefined ||\n options.resolveResourceId !== undefined;\n\n if (options.access && hasLegacyAccess) {\n throw new Error(\n 'createCollabPlugin cannot combine \"access\" with the deprecated root \"resourceType\" or \"resolveResourceId\" options. Move those fields into access.',\n );\n }\n\n if (options.access?.mode === \"resource\") {\n if (!options.access.resourceType.trim()) {\n throw new Error(\n 'createCollabPlugin access mode \"resource\" requires a non-empty resourceType.',\n );\n }\n return options.access;\n }\n\n if (options.access?.mode === \"all-authenticated\") {\n return { mode: \"all-authenticated\", explicit: true };\n }\n\n if (options.access) {\n throw new Error(\n `createCollabPlugin received an unsupported access mode: ${String((options.access as { mode?: unknown }).mode)}`,\n );\n }\n\n if (options.resourceType !== undefined) {\n if (!options.resourceType.trim()) {\n throw new Error(\n 'createCollabPlugin \"resourceType\" must be a non-empty string when provided.',\n );\n }\n return {\n mode: \"resource\",\n resourceType: options.resourceType,\n resolveResourceId: options.resolveResourceId,\n };\n }\n\n if (options.resolveResourceId !== undefined) {\n throw new Error(\n 'createCollabPlugin \"resolveResourceId\" requires a non-empty \"resourceType\".',\n );\n }\n\n return { mode: \"all-authenticated\", explicit: false };\n}\n\nfunction warnForImplicitAllAuthenticatedAccess(table: string): void {\n if (_unscoped_warning_tables.has(table)) return;\n _unscoped_warning_tables.add(table);\n console.warn(\n `[collab] WARNING: createCollabPlugin for table \"${table}\" does not declare an access policy. ` +\n \"Collab events will be delivered to ALL authenticated users on this deployment without document-level access scoping. \" +\n 'Use access: { mode: \"resource\", resourceType: \"...\" } for access-scoped delivery, ' +\n 'or access: { mode: \"all-authenticated\" } to explicitly acknowledge deployment-wide delivery.',\n );\n}\n\nexport function createCollabPlugin(\n options: CollabPluginOptions = {},\n): NitroPluginDef {\n const normalizedAccess = normalizeCollabAccess(options);\n const {\n table = \"documents\",\n contentColumn = \"content\",\n idColumn = \"id\",\n autoSeed = true,\n maxPayloadBytes = DEFAULT_MAX_PAYLOAD_BYTES,\n } = options;\n const resourceType =\n normalizedAccess.mode === \"resource\"\n ? normalizedAccess.resourceType\n : undefined;\n const resolveResourceId =\n normalizedAccess.mode === \"resource\"\n ? normalizedAccess.resolveResourceId\n : undefined;\n\n if (\n normalizedAccess.mode === \"all-authenticated\" &&\n !normalizedAccess.explicit\n ) {\n warnForImplicitAllAuthenticatedAccess(table);\n }\n\n return async (nitroApp: any) => {\n await awaitBootstrap(nitroApp);\n const P = FRAMEWORK_ROUTE_PREFIX;\n\n // Wire collab emitter → poll ring buffer so clients receive Yjs updates.\n // Security: when resourceType is configured, resolve the resource's\n // owner/org so getChangesSinceForUser can scope delivery. We use\n // resolveAccess to obtain the resource row — it already handles ownership,\n // visibility, and share rows. In addition to the owner/org tags we also\n // tag the event with `resourceType` + `resourceId` so the per-user\n // delivery filter (canSeeChangeForUser) can evaluate resource access\n // directly for non-owner sharees:\n // • tag the event with the resource owner's email and org (owner-scoped)\n // for backward compatibility with the conservative owner/org fast path.\n // • ALSO tag with resourceType/resourceId so canSeeChangeForUser can run\n // an access-aware (cached) check and push to explicit viewer+ sharees\n // who don't match owner/org — instead of only degrading them to the\n // poll fallback.\n // See also: SECURITY comment in poll.ts on canSeeChangeForUser.\n const collabEmitter = getCollabEmitter();\n collabEmitter.on(\"collab\", async (event) => {\n if (!resourceType) {\n // No access model — broadcast to all authenticated users (no owner/orgId tag).\n recordChange(event);\n return;\n }\n\n // Resolve the resource to learn its owner/org so we can scope the event.\n const docId = event.docId as string | undefined;\n if (!docId) {\n recordChange(event);\n return;\n }\n\n try {\n const resourceId = resolveResourceId\n ? await resolveResourceId(docId)\n : docId;\n if (!resourceId) {\n // Cannot resolve resource — drop the event to avoid leaking to\n // unauthorized pollers. The client will catch up via state-vector.\n return;\n }\n\n // Load the resource row to get owner/org. resolveAccess fetches the\n // resource row internally; use getShareableResource to read it cheaply.\n const { requireShareableResource } =\n await import(\"../sharing/registry.js\");\n const reg = requireShareableResource(resourceType);\n const db = reg.getDb() as any;\n const { eq } = await import(\"drizzle-orm\");\n const [resource] = await db\n .select()\n .from(reg.resourceTable)\n .where(eq(reg.resourceTable.id, resourceId))\n .limit(1);\n\n if (!resource) {\n // Resource deleted — drop silently.\n return;\n }\n\n const ownerEmail =\n typeof resource.ownerEmail === \"string\"\n ? resource.ownerEmail\n : undefined;\n const orgId =\n typeof resource.orgId === \"string\" ? resource.orgId : undefined;\n\n // Tag the event with owner/org (backward-compat fast path) AND with\n // resourceType/resourceId so canSeeChangeForUser can run an\n // access-aware check for non-owner sharees (see poll.ts).\n recordChange({\n ...event,\n ...(ownerEmail ? { owner: ownerEmail } : {}),\n ...(orgId ? { orgId } : {}),\n resourceType,\n resourceId,\n });\n } catch {\n // If we fail to resolve the resource (DB not ready, etc.) we skip\n // the event rather than broadcasting it without scoping.\n }\n });\n\n // Mount collab routes — manual method dispatch since the path layout is\n // `/collab/:docId/<action>`. The framework strips the `/collab` mount\n // prefix from event.url.pathname before calling us, so we see e.g.\n // `/abc-123/state`.\n getH3App(nitroApp).use(\n `${P}/collab`,\n defineEventHandler(async (event: H3Event) => {\n const parts = (event.url?.pathname || \"\")\n .replace(/^\\/+/, \"\")\n .split(\"/\");\n const docId = parts[0] || \"\";\n const action = parts[1] || \"\";\n if (!docId) return;\n if (event.context) {\n event.context.params = { ...event.context.params, docId };\n }\n const method = getMethod(event);\n\n // Auth check — all collab routes require a session\n const session = await getSession(event).catch(() => null);\n if (!session?.email) {\n setResponseStatus(event, 401);\n return { error: \"Authentication required\" };\n }\n\n const orgCtx = await getOrgContext(event).catch(() => null);\n const userEmail = session.email;\n const orgId = orgCtx?.orgId ?? undefined;\n\n return runWithRequestContext({ userEmail, orgId }, async () => {\n // Access check — require at least viewer for reads, editor for writes.\n // Awareness routes (POST awareness / GET users) require the same\n // level as other reads so that knowledge of who is editing a doc\n // doesn't leak to users without access.\n if (resourceType) {\n const resourceId = resolveResourceId\n ? await resolveResourceId(docId)\n : docId;\n if (!resourceId) {\n setResponseStatus(event, 404);\n return { error: \"Not found\" };\n }\n const isWrite =\n (action === \"update\" && method === \"POST\") ||\n (action === \"text\" && method === \"POST\") ||\n (action === \"search-replace\" && method === \"POST\") ||\n (action === \"json\" && method === \"POST\") ||\n (action === \"patch\" && method === \"POST\");\n\n if (isWrite) {\n // assertAccess throws ForbiddenError (→ 403) if no editor access\n const access = await assertAccess(\n resourceType,\n resourceId,\n \"editor\",\n );\n const resource = access.resource as Record<string, unknown>;\n const awarenessScope: CollabAwarenessScope = {\n resourceType,\n resourceId,\n ...(typeof resource.ownerEmail === \"string\"\n ? { owner: resource.ownerEmail }\n : {}),\n ...(typeof resource.orgId === \"string\"\n ? { orgId: resource.orgId }\n : {}),\n };\n if (event.context) {\n event.context._collabAwarenessScope = awarenessScope;\n }\n } else {\n // resolveAccess returns null when no access; return 404 to avoid leaking existence\n const access = await resolveAccess(resourceType, resourceId);\n if (!access) {\n setResponseStatus(event, 404);\n return { error: \"Not found\" };\n }\n const resource = access.resource as Record<string, unknown>;\n const awarenessScope: CollabAwarenessScope = {\n resourceType,\n resourceId,\n ...(typeof resource.ownerEmail === \"string\"\n ? { owner: resource.ownerEmail }\n : {}),\n ...(typeof resource.orgId === \"string\"\n ? { orgId: resource.orgId }\n : {}),\n };\n if (event.context) {\n event.context._collabAwarenessScope = awarenessScope;\n }\n }\n }\n\n // Payload size limit for write operations\n const isWriteAction =\n (action === \"update\" && method === \"POST\") ||\n (action === \"text\" && method === \"POST\") ||\n (action === \"search-replace\" && method === \"POST\") ||\n (action === \"json\" && method === \"POST\") ||\n (action === \"patch\" && method === \"POST\");\n\n if (isWriteAction) {\n const contentLength = Number(\n event.headers?.get?.(\"content-length\") ?? NaN,\n );\n if (!isNaN(contentLength) && contentLength > maxPayloadBytes) {\n setResponseStatus(event, 413);\n return {\n error: `Payload too large. Maximum is ${maxPayloadBytes} bytes.`,\n };\n }\n // Store limit in context so route handlers can enforce it on the\n // parsed body when content-length is absent or spoofed.\n if (event.context) {\n event.context._collabMaxPayloadBytes = maxPayloadBytes;\n }\n }\n\n if (action === \"state\" && method === \"GET\")\n return getCollabState(event);\n if (action === \"update\" && method === \"POST\")\n return postCollabUpdate(event);\n if (action === \"text\" && method === \"POST\")\n return postCollabText(event);\n if (action === \"search-replace\" && method === \"POST\")\n return postCollabSearchReplace(event);\n if (action === \"json\" && method === \"POST\")\n return postCollabJson(event);\n if (action === \"json\" && method === \"GET\")\n return getCollabJson(event);\n if (action === \"patch\" && method === \"POST\")\n return postCollabPatch(event);\n if (action === \"awareness\" && method === \"POST\")\n return postAwareness(event);\n if (action === \"users\" && method === \"GET\")\n return getActiveUsers(event);\n setResponseStatus(event, 404);\n return { error: \"Not found\" };\n });\n }),\n );\n\n // Auto-seed existing documents into collab state\n if (autoSeed) {\n const isJson = options.contentType === \"json\";\n const seedColumn = isJson\n ? options.jsonColumn || contentColumn\n : contentColumn;\n\n // Run in background so it doesn't block startup\n setTimeout(async () => {\n try {\n const client = getDbExec();\n const { rows } = await client.execute(\n `SELECT ${idColumn}, ${seedColumn} FROM ${table}`,\n );\n for (const row of rows) {\n const docId = row[idColumn] as string;\n const exists = await hasCollabState(docId);\n if (exists) continue;\n\n if (isJson) {\n const raw = (row[seedColumn] as string) ?? \"{}\";\n try {\n const parsed = JSON.parse(raw);\n const inferredType: \"map\" | \"array\" = Array.isArray(parsed)\n ? \"array\"\n : \"map\";\n await seedFromJson(docId, parsed, \"data\", inferredType);\n } catch {\n // Invalid JSON — skip\n }\n } else {\n const content = (row[seedColumn] as string) ?? \"\";\n await seedFromText(docId, content);\n }\n }\n } catch {\n // Table may not exist yet on first boot — that's fine\n }\n }, 1000);\n }\n };\n}\n"]}
|
package/dist/server/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export { DEFAULT_BROWSER_SESSION_REQUEST_POLL_MS, DEFAULT_BROWSER_SESSION_REQUES
|
|
|
42
42
|
export { mountBrowserSessionRoutes, type MountBrowserSessionRoutesOptions, } from "../browser-sessions/routes.js";
|
|
43
43
|
export type { AgentNativeBrowserSession, AgentNativeBrowserSessionAction, AgentNativeBrowserSessionRecord, AgentNativeBrowserSessionRequest, AgentNativeBrowserSessionRequestStatus, AgentNativeBrowserSessionRequestType, CreateAgentNativeBrowserSessionRequestInput, RegisterAgentNativeBrowserSessionInput, } from "../browser-sessions/types.js";
|
|
44
44
|
export { createTerminalPlugin, defaultTerminalPlugin, type TerminalPluginOptions, } from "../terminal/terminal-plugin.js";
|
|
45
|
-
export { createCollabPlugin, type CollabPluginOptions, } from "./collab-plugin.js";
|
|
45
|
+
export { createCollabPlugin, type CollabAccess, type CollabPluginOptions, type CollabResourceIdResolver, } from "./collab-plugin.js";
|
|
46
46
|
export { spawnTask, getTask, getTaskByThread, listTasks, sendToTask, markTaskErrored, type AgentTask, type SpawnTaskOptions, } from "./agent-teams.js";
|
|
47
47
|
export { isOAuthConnected, getOAuthAccounts } from "./oauth-helpers.js";
|
|
48
48
|
export { hasGoogleSignInCredentials, GOOGLE_LEGACY_PROVIDER_CREDENTIAL_KEYS, GOOGLE_PRIMARY_PROVIDER_CREDENTIAL_KEYS, GOOGLE_PROVIDER_CREDENTIAL_KEY_PAIRS, resolveGoogleLegacyProviderCredentials, resolveGoogleProviderCredentialCandidatesWithReader, resolveGoogleProviderCredentialCandidates, resolveGoogleProviderCredentials, resolveGoogleSignInCredentials, type GoogleOAuthCredentialKeyPair, type GoogleOAuthCredentials, type ReadGoogleOAuthCredential, } from "./google-oauth-credentials.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,YAAY,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gCAAgC,EAChC,gCAAgC,EAChC,sCAAsC,EACtC,4CAA4C,EAC5C,oCAAoC,GACrC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,UAAU,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,gCAAgC,EAChC,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,KAAK,aAAa,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,EACnB,KAAK,sBAAsB,GAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,8BAA8B,EAC9B,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACrC,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,GACnC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,WAAW,EACX,UAAU,EACV,aA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EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,yBAAyB,EACzB,KAAK,gCAAgC,GACtC,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,yBAAyB,EACzB,+BAA+B,EAC/B,+BAA+B,EAC/B,gCAAgC,EAChC,sCAAsC,EACtC,oCAAoC,EACpC,2CAA2C,EAC3C,sCAAsC,GACvC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,kBAAkB,EAClB,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,YAAY,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gCAAgC,EAChC,gCAAgC,EAChC,sCAAsC,EACtC,4CAA4C,EAC5C,oCAAoC,GACrC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,UAAU,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,gCAAgC,EAChC,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,KAAK,aAAa,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,EACnB,KAAK,sBAAsB,GAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,wBAAwB,EACxB,yB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MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,QAAQ,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,IAAI,2BAA2B,GACjD,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,kBAAkB,EAClB,gCAAgC,EAChC,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,4BAA4B,EAC5B,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,gBAAgB,EAChB,4BAA4B,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,GACnC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,oCAAoC,EACpC,mCAAmC,EACnC,mCAAmC,EACnC,0CAA0C,EAC1C,eAAe,EACf,KAAK,8BAA8B,EACnC,KAAK,0CAA0C,GAChD,MAAM,sCAAsC,CAAC;AAU9C,MAAM,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACrE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,cAAc,CAErE"}
|
package/dist/server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,GAGb,MAAM,oBAAoB,CAAC;AAC5B,O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C,sCAAsC,EACtC,6BAA6B,GAY9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,+BAA+B,EAC/B,6BAA6B,EAC7B,gCAAgC,EAChC,eAAe,GAEhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,GAIpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,gBAAgB,GAIjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,GAIV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GAGtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,kBAAkB,EAClB,gCAAgC,EAChC,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,4BAA4B,EAC5B,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,gBAAgB,EAChB,4BAA4B,GAM7B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,oCAAoC,EACpC,mCAAmC,EACnC,mCAAmC,EACnC,0CAA0C,EAC1C,eAAe,GAGhB,MAAM,sCAAsC,CAAC;AAW9C,MAAM,UAAU,iBAAiB,CAAC,GAAmB;IACnD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["export {\n createServer,\n type CreateServerOptions,\n type EnvKeyConfig,\n} from \"./create-server.js\";\nexport {\n AGENT_BACKGROUND_PROCESSOR_FIELD,\n AGENT_BACKGROUND_PROCESSOR_ROUTE,\n AGENT_BACKGROUND_PROCESSOR_ROUTE_FIELD,\n dispatchPathTargetsNetlifyBackgroundFunction,\n resolveDurableBackgroundDispatchPath,\n} from \"../agent/durable-background.js\";\n\nexport {\n readBody,\n readBodyWithSizeLimit,\n streamFile,\n DEFAULT_CHAT_MAX_BODY_BYTES,\n DEFAULT_UPLOAD_MAX_FILE_BYTES,\n MAX_CHAT_ATTACHMENTS_PER_MESSAGE,\n isAllowedUploadMimeType,\n} from \"./h3-helpers.js\";\nexport {\n buildDeepLink,\n toAbsoluteOpenUrl,\n toDesktopOpenUrl,\n toVsCodeOpenUrl,\n OPEN_ROUTE_SUBPATH,\n DESKTOP_OPEN_URL,\n VSCODE_OPEN_URL,\n type DeepLinkInput,\n} from \"./deep-link.js\";\nexport { createOpenRouteHandler, type OpenRouteOptions } from \"./open-route.js\";\nexport {\n createEmbedStartRouteHandler,\n buildEmbedStartPath,\n type EmbedStartRouteOptions,\n} from \"./embed-route.js\";\nexport {\n createEmbedSessionTicket,\n consumeEmbedSessionTicket,\n normalizeEmbedTargetPath,\n requestHasEmbedAuthMarker,\n resolveEmbedSessionFromRequest,\n setEmbedSessionCookie,\n signEmbedSessionToken,\n verifyEmbedSessionToken,\n type ConsumedEmbedSessionTicket,\n type ConsumeEmbedSessionTicketOptions,\n type EmbedSessionTicket,\n type EmbedSessionTicketInput,\n type EmbedSessionTokenClaims,\n type ResolvedEmbedSession,\n type VerifyEmbedSessionTokenResult,\n} from \"./embed-session.js\";\nexport { createSSEHandler, type SSEHandlerOptions } from \"./sse.js\";\nexport {\n mountAuthMiddleware,\n autoMountAuth,\n getSession,\n COOKIE_NAME,\n addSession,\n removeSession,\n getSessionEmail,\n getFrameworkSessionCookieValues,\n setFrameworkSessionCookie,\n clearFrameworkSessionCookies,\n runAuthGuard,\n setDesktopExchange,\n setDesktopExchangeError,\n safeReturnPath,\n type DesktopExchangeErrorPayload,\n type AuthSession,\n type AuthOptions,\n} from \"./auth.js\";\nexport {\n handleIdentitySso,\n getIdentityHubUrl,\n isIdentitySsoEnabled,\n isIdentitySsoBypassPath,\n identitySsoLoginButtonHtml,\n IDENTITY_SSO_PROVIDER_ID,\n IDENTITY_SSO_SCOPE,\n} from \"./identity-sso.js\";\nexport { requireEnvKey, type MissingKeyResponse } from \"./missing-key.js\";\nexport {\n assertCurrentRequestUserIsOrgAdmin,\n currentRequestUserIsOrgAdmin,\n} from \"./org-admin.js\";\nexport { verifyCaptcha, type CaptchaVerifyResult } from \"./captcha.js\";\nexport {\n getLocaleInitScript,\n parseAcceptLanguage,\n resolveLocaleFromRequest,\n type LocaleInitScriptOptions,\n type ResolveLocaleFromRequestOptions,\n type ResolvedRequestLocale,\n} from \"../localization/server.js\";\nexport {\n createProductionAgentHandler,\n type ActionEntry,\n type ScriptEntry,\n type ProductionAgentOptions,\n type ActionTool,\n type ScriptTool,\n type AgentMessage,\n type AgentChatRequest,\n type AgentChatEvent,\n type AgentChatAttachment,\n type AgentChatReference,\n type MentionProvider,\n type MentionProviderItem,\n type AgentLoopFinalResponseGuard,\n type AgentLoopFinalResponseGuardContext,\n type AgentLoopFinalResponseGuardResult,\n type AgentLoopToolCallSummary,\n type AgentLoopToolResultSummary,\n} from \"../agent/index.js\";\nexport {\n actionsToEngineTools,\n executeAgentToolCall,\n getOwnerActiveApiKey,\n runAgentLoop,\n type AgentToolCallExecutionResult,\n type ExecuteAgentToolCallOptions,\n} from \"../agent/production-agent.js\";\nexport {\n mountRealtimeVoiceRoutes,\n realtimeVoiceSafetyIdentifier,\n REALTIME_VOICE_MAX_SDP_BYTES,\n REALTIME_VOICE_MAX_TOOL_BODY_BYTES,\n REALTIME_VOICE_MAX_TOOL_OUTPUT_CHARS,\n REALTIME_VOICE_SESSION_PATH,\n REALTIME_VOICE_TOOL_PATH,\n type MountRealtimeVoiceRoutesOptions,\n type RealtimeVoiceRequestContext,\n type RealtimeVoiceToolExecutionRequest,\n type RealtimeVoiceToolExecutionResult,\n} from \"./realtime-voice.js\";\nexport {\n getStoredModelForEngine,\n resolveEngine,\n} from \"../agent/engine/index.js\";\nexport {\n completeText,\n type CompleteTextMessage,\n type CompleteTextOptions,\n type CompleteTextResult,\n type CompleteTextUsage,\n} from \"./complete-text.js\";\nexport { createDevScriptRegistry } from \"../scripts/dev/index.js\";\n\nexport {\n createPollHandler,\n recordChange,\n getVersion,\n getChangesSince,\n getPollEmitter,\n canSeeChangeForUser,\n POLL_CHANGE_EVENT,\n} from \"./poll.js\";\nexport { createPollEventsHandler } from \"./poll-events.js\";\nexport { createAuthPlugin, defaultAuthPlugin } from \"./auth-plugin.js\";\nexport {\n initServerSentry,\n isServerSentryEnabled,\n setSentryUserForRequest,\n captureRouteError,\n type RouteErrorContext,\n} from \"./sentry.js\";\nexport {\n captureError,\n captureServerError,\n registerErrorCaptureProvider,\n type CaptureErrorContext,\n type CaptureErrorProvider,\n} from \"./capture-error.js\";\nexport { createSentryPlugin, defaultSentryPlugin } from \"./sentry-plugin.js\";\n// Re-export the org plugin so the auto-discovery's DEFAULT_PLUGIN_REGISTRY\n// (which references \"defaultOrgPlugin\" from @agent-native/core/server) can\n// resolve it during the deploy build worker-entry generation.\nexport { createOrgPlugin, defaultOrgPlugin } from \"../org/plugin.js\";\nexport { createFeatureFlagsPlugin } from \"../feature-flags/plugin.js\";\nexport {\n createContextXrayPlugin,\n defaultContextXrayPlugin,\n} from \"../agent/context-xray/plugin.js\";\nexport {\n createObservationalMemoryPlugin,\n defaultObservationalMemoryPlugin,\n} from \"../agent/observational-memory/plugin.js\";\nexport {\n createGoogleAuthPlugin,\n type GoogleAuthPluginOptions,\n} from \"./google-auth-plugin.js\";\nexport type { GoogleAuthMode } from \"./google-auth-mode.js\";\nexport {\n createAgentChatPlugin,\n defaultAgentChatPlugin,\n refreshGlobalMcpManager,\n type AgentChatPluginOptions,\n} from \"./agent-chat-plugin.js\";\nexport {\n configureAgentNativeEmbeddedEnvironment,\n createAgentNativeEmbeddedAuthOptions,\n createAgentNativeEmbeddedPlugin,\n mountAgentNativeEmbedded,\n normalizeAgentNativeEmbeddedSession,\n type AgentNativeEmbeddedAuthOptions,\n type AgentNativeEmbeddedGetSession,\n type AgentNativeEmbeddedHostSession,\n type AgentNativeEmbeddedPluginOptions,\n} from \"./embedded.js\";\nexport {\n createThread,\n getThread,\n listThreads,\n updateThreadData,\n deleteThread,\n setThreadArchived,\n setThreadPinned,\n setThreadScope,\n type ChatThread,\n type ChatThreadScope,\n type ChatThreadSummary,\n type ListThreadsOptions,\n} from \"../chat-threads/store.js\";\nexport {\n createResourcesPlugin,\n defaultResourcesPlugin,\n} from \"./resources-plugin.js\";\nexport {\n createCoreRoutesPlugin,\n defaultCoreRoutesPlugin,\n FRAMEWORK_ROUTE_PREFIX,\n type CoreRoutesPluginOptions,\n} from \"./core-routes-plugin.js\";\nexport {\n AGENT_NATIVE_OG_IMAGE_CACHE_CONTROL,\n AGENT_NATIVE_OG_IMAGE_HEIGHT,\n AGENT_NATIVE_OG_IMAGE_NETLIFY_CACHE_CONTROL,\n AGENT_NATIVE_OG_IMAGE_WIDTH,\n agentNativeOgImageResponseHeaders,\n createAgentNativeOgImageHandler,\n renderAgentNativeOgImagePng,\n renderAgentNativeOgImageSvg,\n type AgentNativeOgImageInput,\n} from \"./social-og-image.js\";\nexport { resolveOgFontFiles } from \"./og-fonts.js\";\nexport {\n createBrowserSessionActionEntries,\n type CreateBrowserSessionActionEntriesOptions,\n} from \"../browser-sessions/actions.js\";\nexport {\n DEFAULT_BROWSER_SESSION_REQUEST_POLL_MS,\n DEFAULT_BROWSER_SESSION_REQUEST_TIMEOUT_MS,\n DEFAULT_BROWSER_SESSION_TTL_MS,\n callBrowserSession,\n claimBrowserSessionRequest,\n completeBrowserSessionRequest,\n createBrowserSessionRequest,\n disconnectBrowserSession,\n getBrowserSession,\n getBrowserSessionRequest,\n listBrowserSessions,\n registerBrowserSession,\n waitForBrowserSessionRequest,\n} from \"../browser-sessions/store.js\";\nexport {\n mountBrowserSessionRoutes,\n type MountBrowserSessionRoutesOptions,\n} from \"../browser-sessions/routes.js\";\nexport type {\n AgentNativeBrowserSession,\n AgentNativeBrowserSessionAction,\n AgentNativeBrowserSessionRecord,\n AgentNativeBrowserSessionRequest,\n AgentNativeBrowserSessionRequestStatus,\n AgentNativeBrowserSessionRequestType,\n CreateAgentNativeBrowserSessionRequestInput,\n RegisterAgentNativeBrowserSessionInput,\n} from \"../browser-sessions/types.js\";\nexport {\n createTerminalPlugin,\n defaultTerminalPlugin,\n type TerminalPluginOptions,\n} from \"../terminal/terminal-plugin.js\";\nexport {\n createCollabPlugin,\n type CollabPluginOptions,\n} from \"./collab-plugin.js\";\n\nexport {\n spawnTask,\n getTask,\n getTaskByThread,\n listTasks,\n sendToTask,\n markTaskErrored,\n type AgentTask,\n type SpawnTaskOptions,\n} from \"./agent-teams.js\";\nexport { isOAuthConnected, getOAuthAccounts } from \"./oauth-helpers.js\";\nexport {\n hasGoogleSignInCredentials,\n GOOGLE_LEGACY_PROVIDER_CREDENTIAL_KEYS,\n GOOGLE_PRIMARY_PROVIDER_CREDENTIAL_KEYS,\n GOOGLE_PROVIDER_CREDENTIAL_KEY_PAIRS,\n resolveGoogleLegacyProviderCredentials,\n resolveGoogleProviderCredentialCandidatesWithReader,\n resolveGoogleProviderCredentialCandidates,\n resolveGoogleProviderCredentials,\n resolveGoogleSignInCredentials,\n type GoogleOAuthCredentialKeyPair,\n type GoogleOAuthCredentials,\n type ReadGoogleOAuthCredential,\n} from \"./google-oauth-credentials.js\";\nexport { wrapWithAnalytics } from \"./analytics.js\";\nexport {\n getH3App,\n awaitBootstrap,\n markDefaultPluginProvided,\n type H3AppShim,\n} from \"./framework-request-handler.js\";\nexport {\n fireInternalDispatch,\n resolveSelfDispatchBaseUrl,\n type FireInternalDispatchOptions,\n} from \"./self-dispatch.js\";\nexport {\n extractBearerToken as extractInternalBearerToken,\n verifyInternalToken,\n} from \"../integrations/internal-token.js\";\nexport {\n autoDiscoverActions,\n autoDiscoverScripts,\n loadActionsFromStaticRegistry,\n mergeCoreSharingActions,\n registerPackageActions,\n} from \"./action-discovery.js\";\nexport {\n registerPromptContextProvider,\n type PromptContextProvider,\n type PromptContextProviderContext,\n type PromptContextProviderContribution,\n} from \"./agent-chat/prompt-resources.js\";\nexport {\n mountActionRoutes,\n type MountActionRoutesOptions,\n type ActionRouteAuthAdapter,\n type ActionRouteResolvedCaller,\n} from \"./action-routes.js\";\nexport {\n AGENT_RUN_OWNER_CONTEXT_KEY,\n seedAgentRunOwnerContext,\n type AgentRunOwnerContext,\n} from \"./agent-run-context.js\";\nexport {\n runWithRequestContext,\n hasRequestContext,\n getRequestContext,\n getRequestUserEmail,\n getRequestUserName,\n getRequestOrgId,\n getRequestTimezone,\n getRequestRunContext,\n getCredentialContext,\n isIntegrationCallerRequest,\n type RequestContext,\n type RequestRunContext,\n} from \"./request-context.js\";\nexport { formatDateInTimezone, todayInTimezone } from \"./date-utils.js\";\n\nexport {\n createOnboardingPlugin,\n defaultOnboardingPlugin,\n} from \"../onboarding/plugin.js\";\n\nexport {\n registerFileUploadProvider,\n unregisterFileUploadProvider,\n listFileUploadProviders,\n getActiveFileUploadProvider,\n getActiveFileUploadProviderForRequest,\n uploadFile,\n builderFileUploadProvider,\n type FileUploadInput,\n type FileUploadProvider,\n type FileUploadResult,\n} from \"../file-upload/index.js\";\n\nexport {\n createIntegrationsPlugin,\n defaultIntegrationsPlugin,\n enqueueRemoteCommand,\n slackAdapter,\n telegramAdapter,\n whatsappAdapter,\n discordAdapter,\n microsoftTeamsAdapter,\n emailAdapter,\n assertPlatformCapability,\n type PlatformAdapter,\n type IncomingMessage,\n type OutgoingMessage,\n type PlatformAdapterCapabilities,\n type ImmediateWebhookResponse,\n type IntegrationStatus,\n type IntegrationsPluginOptions,\n type IntegrationExecutionContext,\n BUILT_IN_INTEGRATION_CATALOG,\n INTEGRATION_CATEGORIES,\n getIntegrationCatalogEntry,\n listBuiltInChannelIntegrations,\n listIntegrationCatalog,\n type BuiltInChannelId,\n type ChannelCapabilities,\n type IntegrationAvailability,\n type IntegrationCatalogEntry,\n type IntegrationCategory,\n type IntegrationCredentialRequirement,\n type IntegrationIconKey,\n type IntegrationSupportMaturity,\n} from \"../integrations/index.js\";\n\nexport {\n isElectron,\n isMobile,\n getOrigin,\n getAppBasePath,\n getAppUrl,\n resolveOAuthRedirectUri,\n isAllowedOAuthRedirectUri,\n encodeOAuthState,\n decodeOAuthState,\n resolveOAuthOwner,\n createOAuthSession,\n oauthCallbackResponse,\n oauthErrorPage,\n oauthDesktopExchangePage,\n type OAuthStatePayload,\n type OAuthOwnerResult,\n type OAuthSessionResult,\n} from \"./google-oauth.js\";\n\nexport {\n buildWorkspaceProviderAuthorizationUrl,\n createWorkspaceProviderOAuthHandler,\n exchangeWorkspaceProviderOAuthCode,\n handleWorkspaceProviderOAuthCallback,\n handleWorkspaceProviderOAuthStart,\n isWorkspaceProviderOAuthFlowValid,\n mergeWorkspaceOAuthValues,\n resolveWorkspaceProviderIdentity,\n workspaceProviderOAuthPath,\n type GenericWorkspaceOAuthProvider,\n type WorkspaceProviderOAuthFlow,\n} from \"./workspace-provider-oauth.js\";\n\nexport {\n FeatureNotConfiguredError,\n hasBuilderPrivateKey,\n isBuilderEnvManaged,\n getBuilderProxyOrigin,\n getBuilderImageGenerationBaseUrl,\n getBuilderWebSearchBaseUrl,\n getBuilderAuthHeader,\n resolveBuilderPrivateKey,\n resolveBuilderAuthHeader,\n resolveHasBuilderPrivateKey,\n resolveHasCompleteBuilderConnection,\n resolveBuilderCredentials,\n resolveBuilderCredential,\n readDeployCredentialEnv,\n writeBuilderCredentials,\n deleteBuilderCredentials,\n resolveSecret,\n} from \"./credential-provider.js\";\nexport {\n builderDesignSystemUrl,\n buildBuilderDesignSystemIndexFiles,\n createBuilderDesignSystemProxyFields,\n fetchBuilderDesignSystemDocs,\n getBuilderDesignSystemsBaseUrl,\n hydrateBuilderDesignSystemReference,\n localBuilderDesignSystemId,\n mimeTypeForBuilderDesignSystemFilename,\n parseBuilderDesignSystemProxyReference,\n startBuilderDesignSystemIndex,\n type BuildBuilderDesignSystemIndexFilesOptions,\n type BuilderDesignSystemCodeFileInput,\n type BuilderDesignSystemDocsOptions,\n type BuilderDesignSystemDocument,\n type BuilderDesignSystemHydratedReference,\n type BuilderDesignSystemIndexFile,\n type BuilderDesignSystemIndexOptions,\n type BuilderDesignSystemIndexResult,\n type BuilderDesignSystemProxyFields,\n type BuilderDesignSystemProxyFieldsOptions,\n type BuilderDesignSystemProxyReference,\n} from \"./builder-design-systems.js\";\nexport {\n getBuilderBranchProjectId,\n isBuilderBranchingEnabled,\n requestBuilderBrowserConnection,\n resolveBuilderBranchProjectId,\n resolveIsBuilderBranchingEnabled,\n runBuilderAgent,\n type RunBuilderAgentResult,\n} from \"./builder-browser.js\";\nexport {\n ensureFusionContainer,\n sendFusionBranchMessage,\n pushFusionBranch,\n reserveFusionHostingSlug,\n deployFusionProject,\n getFusionDeploys,\n getFusionBranchEditorUrl,\n getFusionHostingUrl,\n type FusionBranchRef,\n type EnsureFusionContainerResult,\n type SendFusionMessageResult,\n} from \"./fusion-app.js\";\n\nexport {\n sendEmail,\n isEmailConfigured,\n getEmailProvider,\n type EmailAttachment,\n type EmailProvider,\n type SendEmailArgs,\n} from \"./email.js\";\nexport {\n renderEmail,\n emailStrong,\n emailLink,\n type RenderEmailArgs,\n type RenderedEmail,\n type EmailCta,\n} from \"./email-template.js\";\nexport { getAppProductionUrl, getFirstPartyProdUrl } from \"./app-url.js\";\nexport {\n getConfiguredAppBasePath,\n normalizeAppBasePath,\n withConfiguredAppBasePath,\n} from \"./app-base-path.js\";\nexport {\n signShortLivedToken,\n verifyShortLivedToken,\n type ShortLivedTokenClaims,\n type VerifyResult as ShortLivedTokenVerifyResult,\n} from \"./short-lived-token.js\";\nexport {\n AGENT_ACCESS_PARAM,\n DEFAULT_AGENT_ACCESS_TTL_SECONDS,\n appendAgentAccessParam,\n buildAgentAccessApiUrl,\n buildAgentAccessUrl,\n createScopedAgentAccessGrant,\n normalizeAgentAccessBasePath,\n normalizeAgentAccessOrigin,\n scopedAgentAccessResourceId,\n signScopedAgentAccessToken,\n toAgentAccessUrl,\n verifyScopedAgentAccessToken,\n type AgentAccessApiUrlOptions,\n type AgentAccessResourceScope,\n type AgentAccessUrlOptions,\n type ScopedAgentAccessGrant,\n type ScopedAgentAccessTokenOptions,\n} from \"./agent-access.js\";\nexport {\n AGENT_READABLE_RESOURCE_PAYLOAD_TYPE,\n AGENT_READABLE_RESOURCE_SCRIPT_TYPE,\n buildAgentReadableResourceDiscovery,\n renderAgentReadableResourceDiscoveryScript,\n safeJsonForHtml,\n type AgentReadableResourceDiscovery,\n type BuildAgentReadableResourceDiscoveryOptions,\n} from \"../shared/agent-readable-resource.js\";\n\n// SSR handler is NOT re-exported here — it uses a virtual module\n// (virtual:react-router/server-build) that only exists at Vite dev/build time.\n// Including it in this barrel would break the esbuild CF Pages bundler.\n// Templates import directly: import { ssrHandler } from \"@agent-native/core/server/ssr-handler\"\n\n// Nitro plugin helper — re-exported so templates don't need nitro as a direct dependency.\n// defineNitroPlugin is an identity function; this typed wrapper lets templates use it\n// without resolving `nitro/runtime` (which requires Nitro's virtual modules at runtime).\nexport type NitroPluginDef = (nitroApp: any) => void | Promise<void>;\nexport function defineNitroPlugin(def: NitroPluginDef): NitroPluginDef {\n return def;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,GAGb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gCAAgC,EAChC,gCAAgC,EAChC,sCAAsC,EACtC,4CAA4C,EAC5C,oCAAoC,GACrC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,UAAU,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,gCAAgC,EAChC,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,aAAa,E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ACnB,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,GAIpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,gBAAgB,GAIjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,GAIV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GAGtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,kBAAkB,EAClB,gCAAgC,EAChC,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,4BAA4B,EAC5B,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,gBAAgB,EAChB,4BAA4B,GAM7B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,oCAAoC,EACpC,mCAAmC,EACnC,mCAAmC,EACnC,0CAA0C,EAC1C,eAAe,GAGhB,MAAM,sCAAsC,CAAC;AAW9C,MAAM,UAAU,iBAAiB,CAAC,GAAmB;IACnD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["export {\n createServer,\n type CreateServerOptions,\n type EnvKeyConfig,\n} from \"./create-server.js\";\nexport {\n AGENT_BACKGROUND_PROCESSOR_FIELD,\n AGENT_BACKGROUND_PROCESSOR_ROUTE,\n AGENT_BACKGROUND_PROCESSOR_ROUTE_FIELD,\n dispatchPathTargetsNetlifyBackgroundFunction,\n resolveDurableBackgroundDispatchPath,\n} from \"../agent/durable-background.js\";\n\nexport {\n readBody,\n readBodyWithSizeLimit,\n streamFile,\n DEFAULT_CHAT_MAX_BODY_BYTES,\n DEFAULT_UPLOAD_MAX_FILE_BYTES,\n MAX_CHAT_ATTACHMENTS_PER_MESSAGE,\n isAllowedUploadMimeType,\n} from \"./h3-helpers.js\";\nexport {\n buildDeepLink,\n toAbsoluteOpenUrl,\n toDesktopOpenUrl,\n toVsCodeOpenUrl,\n OPEN_ROUTE_SUBPATH,\n DESKTOP_OPEN_URL,\n VSCODE_OPEN_URL,\n type DeepLinkInput,\n} from \"./deep-link.js\";\nexport { createOpenRouteHandler, type OpenRouteOptions } from \"./open-route.js\";\nexport {\n createEmbedStartRouteHandler,\n buildEmbedStartPath,\n type EmbedStartRouteOptions,\n} from \"./embed-route.js\";\nexport {\n createEmbedSessionTicket,\n consumeEmbedSessionTicket,\n normalizeEmbedTargetPath,\n requestHasEmbedAuthMarker,\n resolveEmbedSessionFromRequest,\n setEmbedSessionCookie,\n signEmbedSessionToken,\n verifyEmbedSessionToken,\n type ConsumedEmbedSessionTicket,\n type ConsumeEmbedSessionTicketOptions,\n type EmbedSessionTicket,\n type EmbedSessionTicketInput,\n type EmbedSessionTokenClaims,\n type ResolvedEmbedSession,\n type VerifyEmbedSessionTokenResult,\n} from \"./embed-session.js\";\nexport { createSSEHandler, type SSEHandlerOptions } from \"./sse.js\";\nexport {\n mountAuthMiddleware,\n autoMountAuth,\n getSession,\n COOKIE_NAME,\n addSession,\n removeSession,\n getSessionEmail,\n getFrameworkSessionCookieValues,\n setFrameworkSessionCookie,\n clearFrameworkSessionCookies,\n runAuthGuard,\n setDesktopExchange,\n setDesktopExchangeError,\n safeReturnPath,\n type DesktopExchangeErrorPayload,\n type AuthSession,\n type AuthOptions,\n} from \"./auth.js\";\nexport {\n handleIdentitySso,\n getIdentityHubUrl,\n isIdentitySsoEnabled,\n isIdentitySsoBypassPath,\n identitySsoLoginButtonHtml,\n IDENTITY_SSO_PROVIDER_ID,\n IDENTITY_SSO_SCOPE,\n} from \"./identity-sso.js\";\nexport { requireEnvKey, type MissingKeyResponse } from \"./missing-key.js\";\nexport {\n assertCurrentRequestUserIsOrgAdmin,\n currentRequestUserIsOrgAdmin,\n} from \"./org-admin.js\";\nexport { verifyCaptcha, type CaptchaVerifyResult } from \"./captcha.js\";\nexport {\n getLocaleInitScript,\n parseAcceptLanguage,\n resolveLocaleFromRequest,\n type LocaleInitScriptOptions,\n type ResolveLocaleFromRequestOptions,\n type ResolvedRequestLocale,\n} from \"../localization/server.js\";\nexport {\n createProductionAgentHandler,\n type ActionEntry,\n type ScriptEntry,\n type ProductionAgentOptions,\n type ActionTool,\n type ScriptTool,\n type AgentMessage,\n type AgentChatRequest,\n type AgentChatEvent,\n type AgentChatAttachment,\n type AgentChatReference,\n type MentionProvider,\n type MentionProviderItem,\n type AgentLoopFinalResponseGuard,\n type AgentLoopFinalResponseGuardContext,\n type AgentLoopFinalResponseGuardResult,\n type AgentLoopToolCallSummary,\n type AgentLoopToolResultSummary,\n} from \"../agent/index.js\";\nexport {\n actionsToEngineTools,\n executeAgentToolCall,\n getOwnerActiveApiKey,\n runAgentLoop,\n type AgentToolCallExecutionResult,\n type ExecuteAgentToolCallOptions,\n} from \"../agent/production-agent.js\";\nexport {\n mountRealtimeVoiceRoutes,\n realtimeVoiceSafetyIdentifier,\n REALTIME_VOICE_MAX_SDP_BYTES,\n REALTIME_VOICE_MAX_TOOL_BODY_BYTES,\n REALTIME_VOICE_MAX_TOOL_OUTPUT_CHARS,\n REALTIME_VOICE_SESSION_PATH,\n REALTIME_VOICE_TOOL_PATH,\n type MountRealtimeVoiceRoutesOptions,\n type RealtimeVoiceRequestContext,\n type RealtimeVoiceToolExecutionRequest,\n type RealtimeVoiceToolExecutionResult,\n} from \"./realtime-voice.js\";\nexport {\n getStoredModelForEngine,\n resolveEngine,\n} from \"../agent/engine/index.js\";\nexport {\n completeText,\n type CompleteTextMessage,\n type CompleteTextOptions,\n type CompleteTextResult,\n type CompleteTextUsage,\n} from \"./complete-text.js\";\nexport { createDevScriptRegistry } from \"../scripts/dev/index.js\";\n\nexport {\n createPollHandler,\n recordChange,\n getVersion,\n getChangesSince,\n getPollEmitter,\n canSeeChangeForUser,\n POLL_CHANGE_EVENT,\n} from \"./poll.js\";\nexport { createPollEventsHandler } from \"./poll-events.js\";\nexport { createAuthPlugin, defaultAuthPlugin } from \"./auth-plugin.js\";\nexport {\n initServerSentry,\n isServerSentryEnabled,\n setSentryUserForRequest,\n captureRouteError,\n type RouteErrorContext,\n} from \"./sentry.js\";\nexport {\n captureError,\n captureServerError,\n registerErrorCaptureProvider,\n type CaptureErrorContext,\n type CaptureErrorProvider,\n} from \"./capture-error.js\";\nexport { createSentryPlugin, defaultSentryPlugin } from \"./sentry-plugin.js\";\n// Re-export the org plugin so the auto-discovery's DEFAULT_PLUGIN_REGISTRY\n// (which references \"defaultOrgPlugin\" from @agent-native/core/server) can\n// resolve it during the deploy build worker-entry generation.\nexport { createOrgPlugin, defaultOrgPlugin } from \"../org/plugin.js\";\nexport { createFeatureFlagsPlugin } from \"../feature-flags/plugin.js\";\nexport {\n createContextXrayPlugin,\n defaultContextXrayPlugin,\n} from \"../agent/context-xray/plugin.js\";\nexport {\n createObservationalMemoryPlugin,\n defaultObservationalMemoryPlugin,\n} from \"../agent/observational-memory/plugin.js\";\nexport {\n createGoogleAuthPlugin,\n type GoogleAuthPluginOptions,\n} from \"./google-auth-plugin.js\";\nexport type { GoogleAuthMode } from \"./google-auth-mode.js\";\nexport {\n createAgentChatPlugin,\n defaultAgentChatPlugin,\n refreshGlobalMcpManager,\n type AgentChatPluginOptions,\n} from \"./agent-chat-plugin.js\";\nexport {\n configureAgentNativeEmbeddedEnvironment,\n createAgentNativeEmbeddedAuthOptions,\n createAgentNativeEmbeddedPlugin,\n mountAgentNativeEmbedded,\n normalizeAgentNativeEmbeddedSession,\n type AgentNativeEmbeddedAuthOptions,\n type AgentNativeEmbeddedGetSession,\n type AgentNativeEmbeddedHostSession,\n type AgentNativeEmbeddedPluginOptions,\n} from \"./embedded.js\";\nexport {\n createThread,\n getThread,\n listThreads,\n updateThreadData,\n deleteThread,\n setThreadArchived,\n setThreadPinned,\n setThreadScope,\n type ChatThread,\n type ChatThreadScope,\n type ChatThreadSummary,\n type ListThreadsOptions,\n} from \"../chat-threads/store.js\";\nexport {\n createResourcesPlugin,\n defaultResourcesPlugin,\n} from \"./resources-plugin.js\";\nexport {\n createCoreRoutesPlugin,\n defaultCoreRoutesPlugin,\n FRAMEWORK_ROUTE_PREFIX,\n type CoreRoutesPluginOptions,\n} from \"./core-routes-plugin.js\";\nexport {\n AGENT_NATIVE_OG_IMAGE_CACHE_CONTROL,\n AGENT_NATIVE_OG_IMAGE_HEIGHT,\n AGENT_NATIVE_OG_IMAGE_NETLIFY_CACHE_CONTROL,\n AGENT_NATIVE_OG_IMAGE_WIDTH,\n agentNativeOgImageResponseHeaders,\n createAgentNativeOgImageHandler,\n renderAgentNativeOgImagePng,\n renderAgentNativeOgImageSvg,\n type AgentNativeOgImageInput,\n} from \"./social-og-image.js\";\nexport { resolveOgFontFiles } from \"./og-fonts.js\";\nexport {\n createBrowserSessionActionEntries,\n type CreateBrowserSessionActionEntriesOptions,\n} from \"../browser-sessions/actions.js\";\nexport {\n DEFAULT_BROWSER_SESSION_REQUEST_POLL_MS,\n DEFAULT_BROWSER_SESSION_REQUEST_TIMEOUT_MS,\n DEFAULT_BROWSER_SESSION_TTL_MS,\n callBrowserSession,\n claimBrowserSessionRequest,\n completeBrowserSessionRequest,\n createBrowserSessionRequest,\n disconnectBrowserSession,\n getBrowserSession,\n getBrowserSessionRequest,\n listBrowserSessions,\n registerBrowserSession,\n waitForBrowserSessionRequest,\n} from \"../browser-sessions/store.js\";\nexport {\n mountBrowserSessionRoutes,\n type MountBrowserSessionRoutesOptions,\n} from \"../browser-sessions/routes.js\";\nexport type {\n AgentNativeBrowserSession,\n AgentNativeBrowserSessionAction,\n AgentNativeBrowserSessionRecord,\n AgentNativeBrowserSessionRequest,\n AgentNativeBrowserSessionRequestStatus,\n AgentNativeBrowserSessionRequestType,\n CreateAgentNativeBrowserSessionRequestInput,\n RegisterAgentNativeBrowserSessionInput,\n} from \"../browser-sessions/types.js\";\nexport {\n createTerminalPlugin,\n defaultTerminalPlugin,\n type TerminalPluginOptions,\n} from \"../terminal/terminal-plugin.js\";\nexport {\n createCollabPlugin,\n type CollabAccess,\n type CollabPluginOptions,\n type CollabResourceIdResolver,\n} from \"./collab-plugin.js\";\n\nexport {\n spawnTask,\n getTask,\n getTaskByThread,\n listTasks,\n sendToTask,\n markTaskErrored,\n type AgentTask,\n type SpawnTaskOptions,\n} from \"./agent-teams.js\";\nexport { isOAuthConnected, getOAuthAccounts } from \"./oauth-helpers.js\";\nexport {\n hasGoogleSignInCredentials,\n GOOGLE_LEGACY_PROVIDER_CREDENTIAL_KEYS,\n GOOGLE_PRIMARY_PROVIDER_CREDENTIAL_KEYS,\n GOOGLE_PROVIDER_CREDENTIAL_KEY_PAIRS,\n resolveGoogleLegacyProviderCredentials,\n resolveGoogleProviderCredentialCandidatesWithReader,\n resolveGoogleProviderCredentialCandidates,\n resolveGoogleProviderCredentials,\n resolveGoogleSignInCredentials,\n type GoogleOAuthCredentialKeyPair,\n type GoogleOAuthCredentials,\n type ReadGoogleOAuthCredential,\n} from \"./google-oauth-credentials.js\";\nexport { wrapWithAnalytics } from \"./analytics.js\";\nexport {\n getH3App,\n awaitBootstrap,\n markDefaultPluginProvided,\n type H3AppShim,\n} from \"./framework-request-handler.js\";\nexport {\n fireInternalDispatch,\n resolveSelfDispatchBaseUrl,\n type FireInternalDispatchOptions,\n} from \"./self-dispatch.js\";\nexport {\n extractBearerToken as extractInternalBearerToken,\n verifyInternalToken,\n} from \"../integrations/internal-token.js\";\nexport {\n autoDiscoverActions,\n autoDiscoverScripts,\n loadActionsFromStaticRegistry,\n mergeCoreSharingActions,\n registerPackageActions,\n} from \"./action-discovery.js\";\nexport {\n registerPromptContextProvider,\n type PromptContextProvider,\n type PromptContextProviderContext,\n type PromptContextProviderContribution,\n} from \"./agent-chat/prompt-resources.js\";\nexport {\n mountActionRoutes,\n type MountActionRoutesOptions,\n type ActionRouteAuthAdapter,\n type ActionRouteResolvedCaller,\n} from \"./action-routes.js\";\nexport {\n AGENT_RUN_OWNER_CONTEXT_KEY,\n seedAgentRunOwnerContext,\n type AgentRunOwnerContext,\n} from \"./agent-run-context.js\";\nexport {\n runWithRequestContext,\n hasRequestContext,\n getRequestContext,\n getRequestUserEmail,\n getRequestUserName,\n getRequestOrgId,\n getRequestTimezone,\n getRequestRunContext,\n getCredentialContext,\n isIntegrationCallerRequest,\n type RequestContext,\n type RequestRunContext,\n} from \"./request-context.js\";\nexport { formatDateInTimezone, todayInTimezone } from \"./date-utils.js\";\n\nexport {\n createOnboardingPlugin,\n defaultOnboardingPlugin,\n} from \"../onboarding/plugin.js\";\n\nexport {\n registerFileUploadProvider,\n unregisterFileUploadProvider,\n listFileUploadProviders,\n getActiveFileUploadProvider,\n getActiveFileUploadProviderForRequest,\n uploadFile,\n builderFileUploadProvider,\n type FileUploadInput,\n type FileUploadProvider,\n type FileUploadResult,\n} from \"../file-upload/index.js\";\n\nexport {\n createIntegrationsPlugin,\n defaultIntegrationsPlugin,\n enqueueRemoteCommand,\n slackAdapter,\n telegramAdapter,\n whatsappAdapter,\n discordAdapter,\n microsoftTeamsAdapter,\n emailAdapter,\n assertPlatformCapability,\n type PlatformAdapter,\n type IncomingMessage,\n type OutgoingMessage,\n type PlatformAdapterCapabilities,\n type ImmediateWebhookResponse,\n type IntegrationStatus,\n type IntegrationsPluginOptions,\n type IntegrationExecutionContext,\n BUILT_IN_INTEGRATION_CATALOG,\n INTEGRATION_CATEGORIES,\n getIntegrationCatalogEntry,\n listBuiltInChannelIntegrations,\n listIntegrationCatalog,\n type BuiltInChannelId,\n type ChannelCapabilities,\n type IntegrationAvailability,\n type IntegrationCatalogEntry,\n type IntegrationCategory,\n type IntegrationCredentialRequirement,\n type IntegrationIconKey,\n type IntegrationSupportMaturity,\n} from \"../integrations/index.js\";\n\nexport {\n isElectron,\n isMobile,\n getOrigin,\n getAppBasePath,\n getAppUrl,\n resolveOAuthRedirectUri,\n isAllowedOAuthRedirectUri,\n encodeOAuthState,\n decodeOAuthState,\n resolveOAuthOwner,\n createOAuthSession,\n oauthCallbackResponse,\n oauthErrorPage,\n oauthDesktopExchangePage,\n type OAuthStatePayload,\n type OAuthOwnerResult,\n type OAuthSessionResult,\n} from \"./google-oauth.js\";\n\nexport {\n buildWorkspaceProviderAuthorizationUrl,\n createWorkspaceProviderOAuthHandler,\n exchangeWorkspaceProviderOAuthCode,\n handleWorkspaceProviderOAuthCallback,\n handleWorkspaceProviderOAuthStart,\n isWorkspaceProviderOAuthFlowValid,\n mergeWorkspaceOAuthValues,\n resolveWorkspaceProviderIdentity,\n workspaceProviderOAuthPath,\n type GenericWorkspaceOAuthProvider,\n type WorkspaceProviderOAuthFlow,\n} from \"./workspace-provider-oauth.js\";\n\nexport {\n FeatureNotConfiguredError,\n hasBuilderPrivateKey,\n isBuilderEnvManaged,\n getBuilderProxyOrigin,\n getBuilderImageGenerationBaseUrl,\n getBuilderWebSearchBaseUrl,\n getBuilderAuthHeader,\n resolveBuilderPrivateKey,\n resolveBuilderAuthHeader,\n resolveHasBuilderPrivateKey,\n resolveHasCompleteBuilderConnection,\n resolveBuilderCredentials,\n resolveBuilderCredential,\n readDeployCredentialEnv,\n writeBuilderCredentials,\n deleteBuilderCredentials,\n resolveSecret,\n} from \"./credential-provider.js\";\nexport {\n builderDesignSystemUrl,\n buildBuilderDesignSystemIndexFiles,\n createBuilderDesignSystemProxyFields,\n fetchBuilderDesignSystemDocs,\n getBuilderDesignSystemsBaseUrl,\n hydrateBuilderDesignSystemReference,\n localBuilderDesignSystemId,\n mimeTypeForBuilderDesignSystemFilename,\n parseBuilderDesignSystemProxyReference,\n startBuilderDesignSystemIndex,\n type BuildBuilderDesignSystemIndexFilesOptions,\n type BuilderDesignSystemCodeFileInput,\n type BuilderDesignSystemDocsOptions,\n type BuilderDesignSystemDocument,\n type BuilderDesignSystemHydratedReference,\n type BuilderDesignSystemIndexFile,\n type BuilderDesignSystemIndexOptions,\n type BuilderDesignSystemIndexResult,\n type BuilderDesignSystemProxyFields,\n type BuilderDesignSystemProxyFieldsOptions,\n type BuilderDesignSystemProxyReference,\n} from \"./builder-design-systems.js\";\nexport {\n getBuilderBranchProjectId,\n isBuilderBranchingEnabled,\n requestBuilderBrowserConnection,\n resolveBuilderBranchProjectId,\n resolveIsBuilderBranchingEnabled,\n runBuilderAgent,\n type RunBuilderAgentResult,\n} from \"./builder-browser.js\";\nexport {\n ensureFusionContainer,\n sendFusionBranchMessage,\n pushFusionBranch,\n reserveFusionHostingSlug,\n deployFusionProject,\n getFusionDeploys,\n getFusionBranchEditorUrl,\n getFusionHostingUrl,\n type FusionBranchRef,\n type EnsureFusionContainerResult,\n type SendFusionMessageResult,\n} from \"./fusion-app.js\";\n\nexport {\n sendEmail,\n isEmailConfigured,\n getEmailProvider,\n type EmailAttachment,\n type EmailProvider,\n type SendEmailArgs,\n} from \"./email.js\";\nexport {\n renderEmail,\n emailStrong,\n emailLink,\n type RenderEmailArgs,\n type RenderedEmail,\n type EmailCta,\n} from \"./email-template.js\";\nexport { getAppProductionUrl, getFirstPartyProdUrl } from \"./app-url.js\";\nexport {\n getConfiguredAppBasePath,\n normalizeAppBasePath,\n withConfiguredAppBasePath,\n} from \"./app-base-path.js\";\nexport {\n signShortLivedToken,\n verifyShortLivedToken,\n type ShortLivedTokenClaims,\n type VerifyResult as ShortLivedTokenVerifyResult,\n} from \"./short-lived-token.js\";\nexport {\n AGENT_ACCESS_PARAM,\n DEFAULT_AGENT_ACCESS_TTL_SECONDS,\n appendAgentAccessParam,\n buildAgentAccessApiUrl,\n buildAgentAccessUrl,\n createScopedAgentAccessGrant,\n normalizeAgentAccessBasePath,\n normalizeAgentAccessOrigin,\n scopedAgentAccessResourceId,\n signScopedAgentAccessToken,\n toAgentAccessUrl,\n verifyScopedAgentAccessToken,\n type AgentAccessApiUrlOptions,\n type AgentAccessResourceScope,\n type AgentAccessUrlOptions,\n type ScopedAgentAccessGrant,\n type ScopedAgentAccessTokenOptions,\n} from \"./agent-access.js\";\nexport {\n AGENT_READABLE_RESOURCE_PAYLOAD_TYPE,\n AGENT_READABLE_RESOURCE_SCRIPT_TYPE,\n buildAgentReadableResourceDiscovery,\n renderAgentReadableResourceDiscoveryScript,\n safeJsonForHtml,\n type AgentReadableResourceDiscovery,\n type BuildAgentReadableResourceDiscoveryOptions,\n} from \"../shared/agent-readable-resource.js\";\n\n// SSR handler is NOT re-exported here — it uses a virtual module\n// (virtual:react-router/server-build) that only exists at Vite dev/build time.\n// Including it in this barrel would break the esbuild CF Pages bundler.\n// Templates import directly: import { ssrHandler } from \"@agent-native/core/server/ssr-handler\"\n\n// Nitro plugin helper — re-exported so templates don't need nitro as a direct dependency.\n// defineNitroPlugin is an identity function; this typed wrapper lets templates use it\n// without resolving `nitro/runtime` (which requires Nitro's virtual modules at runtime).\nexport type NitroPluginDef = (nitroApp: any) => void | Promise<void>;\nexport function defineNitroPlugin(def: NitroPluginDef): NitroPluginDef {\n return def;\n}\n"]}
|
|
@@ -927,7 +927,35 @@
|
|
|
927
927
|
display: inline-block;
|
|
928
928
|
}
|
|
929
929
|
|
|
930
|
+
.agent-tool-call {
|
|
931
|
+
position: relative;
|
|
932
|
+
}
|
|
933
|
+
|
|
930
934
|
@media (prefers-reduced-motion: no-preference) {
|
|
935
|
+
.agent-tool-call--entering {
|
|
936
|
+
animation: agent-tool-call-enter 220ms var(--ease-out-strong) both;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
.agent-tool-call[data-active-tail="true"]::after {
|
|
940
|
+
position: absolute;
|
|
941
|
+
z-index: 1;
|
|
942
|
+
inset: 0 0 auto;
|
|
943
|
+
height: 2rem;
|
|
944
|
+
pointer-events: none;
|
|
945
|
+
content: "";
|
|
946
|
+
background: linear-gradient(
|
|
947
|
+
90deg,
|
|
948
|
+
transparent 0%,
|
|
949
|
+
transparent 38%,
|
|
950
|
+
hsl(var(--foreground) / 0.055) 50%,
|
|
951
|
+
transparent 62%,
|
|
952
|
+
transparent 100%
|
|
953
|
+
);
|
|
954
|
+
background-repeat: repeat;
|
|
955
|
+
background-size: 14rem 100%;
|
|
956
|
+
animation: agent-thinking-shine 2.6s linear infinite;
|
|
957
|
+
}
|
|
958
|
+
|
|
931
959
|
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
|
|
932
960
|
.agent-thinking-indicator__text,
|
|
933
961
|
.agent-running-shimmer {
|
|
@@ -960,6 +988,18 @@
|
|
|
960
988
|
}
|
|
961
989
|
}
|
|
962
990
|
|
|
991
|
+
@keyframes agent-tool-call-enter {
|
|
992
|
+
from {
|
|
993
|
+
opacity: 0;
|
|
994
|
+
transform: translateY(0.375rem);
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
to {
|
|
998
|
+
opacity: 1;
|
|
999
|
+
transform: translateY(0);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
|
|
963
1003
|
@supports (view-transition-name: agent-native-chat) {
|
|
964
1004
|
.agent-native-chat-view-transition {
|
|
965
1005
|
contain: layout;
|
|
@@ -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
|
|