@agent-native/core 0.118.0 → 0.118.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +21 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/a2a/client.ts +32 -10
- package/corpus/core/src/cli/index.ts +18 -10
- package/corpus/core/src/cli/multi-frontier-runs.ts +5 -3
- package/corpus/core/src/cli/templates-meta.ts +0 -12
- package/corpus/core/src/cli/workspace-dev.ts +1 -1
- package/corpus/core/src/client/AgentPanel.tsx +9 -1
- package/corpus/core/src/client/RunStuckBanner.tsx +39 -47
- package/corpus/core/src/client/chat/action-chat-ui-surface.tsx +32 -0
- package/corpus/core/src/client/chat/message-components.tsx +53 -8
- package/corpus/core/src/client/chat/tool-call-display.tsx +24 -9
- package/corpus/core/src/client/chat/widgets/InlineExtensionWidget.tsx +0 -1
- package/corpus/core/src/client/chat/widgets/builtin-tool-renderers.tsx +7 -3
- package/corpus/core/src/client/conversation/AgentConversation.tsx +12 -1
- package/corpus/core/src/client/error-capture.ts +2 -6
- package/corpus/core/src/client/resources/McpConnectionSuggestion.tsx +20 -14
- package/corpus/core/src/client/resources/ResourcesPanel.tsx +5 -1
- package/corpus/core/src/client/resources/mcp-integration-catalog.ts +7 -17
- package/corpus/core/src/client/resources/mcp-integration-logos.ts +2 -2
- package/corpus/core/src/client/route-chunk-recovery.ts +5 -3
- package/corpus/core/src/client/session-replay.ts +3 -3
- package/corpus/core/src/client/settings/SettingsPanel.tsx +15 -6
- package/corpus/core/src/client/transcription/use-live-transcription.ts +64 -45
- package/corpus/core/src/deploy/build.ts +2 -1
- package/corpus/core/src/guards/db-tool-scoping.ts +1 -1
- package/corpus/core/src/integrations/adapters/slack.ts +84 -5
- package/corpus/core/src/integrations/index.ts +5 -1
- package/corpus/core/src/localization/default-messages.ts +1 -1
- package/corpus/core/src/mcp-client/oauth-routes.ts +45 -12
- package/corpus/core/src/server/realtime-voice.ts +4 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +7 -5
- package/corpus/core/src/terminal/cli-registry.ts +1 -1
- package/corpus/core/src/vite/client.ts +166 -1
- package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +13 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewsMenu.tsx +10 -0
- package/corpus/templates/analytics/changelog/2026-07-22-show-a-useful-error-when-saving-a-dashboard-view-fails.md +6 -0
- package/corpus/templates/brain/app/routes/sources.tsx +181 -114
- package/corpus/templates/clips/AGENTS.md +8 -6
- package/corpus/templates/clips/actions/request-transcript.ts +90 -420
- package/corpus/templates/clips/actions/save-browser-transcript.ts +11 -28
- package/corpus/templates/clips/app/components/capture-install-options.tsx +5 -3
- package/corpus/templates/clips/app/components/player/transcript-panel.tsx +3 -136
- package/corpus/templates/clips/app/lib/capture-install-options.ts +15 -4
- package/corpus/templates/clips/app/routes/download.tsx +3 -2
- package/corpus/templates/clips/changelog/2026-07-22-fixed-an-intermittent-hydration-error-on-the-download-page.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-22-fixed-transcript-generation-when-native-speech-capture-retur.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-22-transcript-generation-now-retries-with-backup-speech-recogni.md +6 -0
- package/corpus/templates/clips/server/lib/public-agent-context.ts +2 -2
- package/corpus/templates/clips/server/register-secrets.ts +7 -6
- package/corpus/templates/content/app/components/editor/SlashCommandMenu.tsx +16 -84
- package/corpus/templates/content/app/components/editor/VisualEditor.tsx +13 -7
- package/corpus/templates/content/app/components/editor/extensions/ImageBlock.tsx +2 -2
- package/corpus/templates/content/app/i18n-data.ts +10 -0
- package/corpus/templates/design/server/lib/fig-file-decoder.ts +1 -0
- package/corpus/templates/plan/app/entry.client.tsx +3 -0
- package/corpus/templates/plan/changelog/2026-07-22-recover-stale-pages-after-a-deployment-refresh-automatically.md +6 -0
- package/corpus/templates/slides/app/hooks/use-agent-generating.ts +10 -3
- package/corpus/templates/slides/app/pages/Index.tsx +1 -0
- package/corpus/templates/slides/changelog/2026-07-22-new-deck-prompts-now-open-in-their-own-visible-chat-thread.md +6 -0
- package/corpus/toolkit/CHANGELOG.md +9 -0
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/src/composer/PromptComposer.tsx +5 -1
- package/corpus/toolkit/src/composer/RealtimeVoiceMode.tsx +119 -31
- package/corpus/toolkit/src/composer/useRealtimeVoiceMode.tsx +30 -0
- package/corpus/toolkit/src/conformance/runner.tsx +153 -1
- package/corpus/toolkit/src/editor/SharedRichEditor.tsx +13 -2
- package/corpus/toolkit/src/editor/SlashCommandMenu.tsx +20 -0
- package/corpus/toolkit/src/editor/index.ts +2 -0
- package/corpus/toolkit/src/styles.css +52 -23
- package/dist/a2a/client.d.ts +3 -1
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +17 -12
- package/dist/a2a/client.js.map +1 -1
- package/dist/cli/index.js +18 -8
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/multi-frontier-runs.js +3 -3
- package/dist/cli/multi-frontier-runs.js.map +1 -1
- package/dist/cli/templates-meta.d.ts.map +1 -1
- package/dist/cli/templates-meta.js +0 -12
- package/dist/cli/templates-meta.js.map +1 -1
- package/dist/cli/workspace-dev.js +1 -1
- package/dist/cli/workspace-dev.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +4 -1
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/RunStuckBanner.d.ts +3 -5
- package/dist/client/RunStuckBanner.d.ts.map +1 -1
- package/dist/client/RunStuckBanner.js +17 -18
- package/dist/client/RunStuckBanner.js.map +1 -1
- package/dist/client/chat/action-chat-ui-surface.d.ts +8 -0
- package/dist/client/chat/action-chat-ui-surface.d.ts.map +1 -0
- package/dist/client/chat/action-chat-ui-surface.js +10 -0
- package/dist/client/chat/action-chat-ui-surface.js.map +1 -0
- package/dist/client/chat/message-components.d.ts +3 -0
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +40 -7
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +3 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +13 -9
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/chat/widgets/InlineExtensionWidget.d.ts.map +1 -1
- package/dist/client/chat/widgets/InlineExtensionWidget.js +1 -1
- package/dist/client/chat/widgets/InlineExtensionWidget.js.map +1 -1
- package/dist/client/chat/widgets/builtin-tool-renderers.d.ts.map +1 -1
- package/dist/client/chat/widgets/builtin-tool-renderers.js +5 -3
- package/dist/client/chat/widgets/builtin-tool-renderers.js.map +1 -1
- package/dist/client/conversation/AgentConversation.d.ts.map +1 -1
- package/dist/client/conversation/AgentConversation.js +3 -2
- package/dist/client/conversation/AgentConversation.js.map +1 -1
- package/dist/client/error-capture.d.ts.map +1 -1
- package/dist/client/error-capture.js +2 -2
- package/dist/client/error-capture.js.map +1 -1
- package/dist/client/resources/McpConnectionSuggestion.d.ts +1 -0
- package/dist/client/resources/McpConnectionSuggestion.d.ts.map +1 -1
- package/dist/client/resources/McpConnectionSuggestion.js +9 -8
- package/dist/client/resources/McpConnectionSuggestion.js.map +1 -1
- package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
- package/dist/client/resources/ResourcesPanel.js +3 -1
- package/dist/client/resources/ResourcesPanel.js.map +1 -1
- 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 +4 -17
- package/dist/client/resources/mcp-integration-catalog.js.map +1 -1
- package/dist/client/resources/mcp-integration-logos.js +2 -2
- package/dist/client/resources/mcp-integration-logos.js.map +1 -1
- package/dist/client/route-chunk-recovery.d.ts.map +1 -1
- package/dist/client/route-chunk-recovery.js +5 -3
- package/dist/client/route-chunk-recovery.js.map +1 -1
- package/dist/client/session-replay.js +3 -3
- package/dist/client/session-replay.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +2 -2
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/transcription/use-live-transcription.d.ts +3 -3
- package/dist/client/transcription/use-live-transcription.d.ts.map +1 -1
- package/dist/client/transcription/use-live-transcription.js +22 -11
- package/dist/client/transcription/use-live-transcription.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +1 -1
- package/dist/deploy/build.js.map +1 -1
- package/dist/guards/db-tool-scoping.js +1 -1
- package/dist/guards/db-tool-scoping.js.map +1 -1
- package/dist/integrations/adapters/slack.d.ts +1 -0
- package/dist/integrations/adapters/slack.d.ts.map +1 -1
- package/dist/integrations/adapters/slack.js +61 -5
- package/dist/integrations/adapters/slack.js.map +1 -1
- package/dist/integrations/index.d.ts +1 -1
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +1 -1
- package/dist/integrations/index.js.map +1 -1
- package/dist/localization/default-messages.js +1 -1
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp-client/oauth-routes.d.ts +3 -0
- package/dist/mcp-client/oauth-routes.d.ts.map +1 -1
- package/dist/mcp-client/oauth-routes.js +41 -12
- package/dist/mcp-client/oauth-routes.js.map +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +3 -3
- package/dist/provider-api/actions/custom-provider-registration.d.ts +8 -8
- package/dist/provider-api/actions/provider-api.d.ts +11 -11
- package/dist/secrets/routes.d.ts +6 -6
- package/dist/server/realtime-voice.d.ts.map +1 -1
- package/dist/server/realtime-voice.js +1 -1
- package/dist/server/realtime-voice.js.map +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +7 -5
- package/dist/terminal/cli-registry.js +1 -1
- package/dist/terminal/cli-registry.js.map +1 -1
- package/dist/vite/client.d.ts +8 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +113 -2
- package/dist/vite/client.js.map +1 -1
- package/package.json +2 -2
- package/src/a2a/client.ts +32 -10
- package/src/cli/index.ts +18 -10
- package/src/cli/multi-frontier-runs.ts +5 -3
- package/src/cli/templates-meta.ts +0 -12
- package/src/cli/workspace-dev.ts +1 -1
- package/src/client/AgentPanel.tsx +9 -1
- package/src/client/RunStuckBanner.tsx +39 -47
- package/src/client/chat/action-chat-ui-surface.tsx +32 -0
- package/src/client/chat/message-components.tsx +53 -8
- package/src/client/chat/tool-call-display.tsx +24 -9
- package/src/client/chat/widgets/InlineExtensionWidget.tsx +0 -1
- package/src/client/chat/widgets/builtin-tool-renderers.tsx +7 -3
- package/src/client/conversation/AgentConversation.tsx +12 -1
- package/src/client/error-capture.ts +2 -6
- package/src/client/resources/McpConnectionSuggestion.tsx +20 -14
- package/src/client/resources/ResourcesPanel.tsx +5 -1
- package/src/client/resources/mcp-integration-catalog.ts +7 -17
- package/src/client/resources/mcp-integration-logos.ts +2 -2
- package/src/client/route-chunk-recovery.ts +5 -3
- package/src/client/session-replay.ts +3 -3
- package/src/client/settings/SettingsPanel.tsx +15 -6
- package/src/client/transcription/use-live-transcription.ts +64 -45
- package/src/deploy/build.ts +2 -1
- package/src/guards/db-tool-scoping.ts +1 -1
- package/src/integrations/adapters/slack.ts +84 -5
- package/src/integrations/index.ts +5 -1
- package/src/localization/default-messages.ts +1 -1
- package/src/mcp-client/oauth-routes.ts +45 -12
- package/src/server/realtime-voice.ts +4 -1
- package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +7 -5
- package/src/terminal/cli-registry.ts +1 -1
- package/src/vite/client.ts +166 -1
- package/corpus/templates/crm/.agents/skills/agent-native-docs/SKILL.md +0 -115
- package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +0 -177
- package/corpus/templates/crm/.agents/skills/crm/SKILL.md +0 -128
- package/corpus/templates/crm/.agents/skills/customizing-agent-native/SKILL.md +0 -220
- package/corpus/templates/crm/.agents/skills/feature-flags/SKILL.md +0 -169
- package/corpus/templates/crm/.agents/skills/upgrade-agent-native/SKILL.md +0 -100
- package/corpus/templates/crm/.env.example +0 -5
- package/corpus/templates/crm/AGENTS.md +0 -120
- package/corpus/templates/crm/CHANGELOG.md +0 -1
- package/corpus/templates/crm/DEVELOPING.md +0 -66
- package/corpus/templates/crm/README.md +0 -106
- package/corpus/templates/crm/_gitignore +0 -12
- package/corpus/templates/crm/actions/_crm-action-utils.ts +0 -87
- package/corpus/templates/crm/actions/_crm-dashboard.ts +0 -69
- package/corpus/templates/crm/actions/_crm-data-program-actions.ts +0 -15
- package/corpus/templates/crm/actions/_crm-signal-utils.ts +0 -79
- package/corpus/templates/crm/actions/apply-crm-proposals.ts +0 -203
- package/corpus/templates/crm/actions/attach-call-evidence.ts +0 -170
- package/corpus/templates/crm/actions/configure-crm-connection.ts +0 -126
- package/corpus/templates/crm/actions/configure-native-crm.ts +0 -44
- package/corpus/templates/crm/actions/create-crm-record.ts +0 -148
- package/corpus/templates/crm/actions/create-crm-signal-tracker.ts +0 -58
- package/corpus/templates/crm/actions/delete-staged-dataset.ts +0 -14
- package/corpus/templates/crm/actions/get-crm-automation-recipe.ts +0 -36
- package/corpus/templates/crm/actions/get-crm-dashboard-panel.ts +0 -35
- package/corpus/templates/crm/actions/get-crm-dashboard.ts +0 -14
- package/corpus/templates/crm/actions/get-crm-overview.ts +0 -13
- package/corpus/templates/crm/actions/get-crm-pipeline-data.ts +0 -61
- package/corpus/templates/crm/actions/get-crm-record.ts +0 -75
- package/corpus/templates/crm/actions/install-crm-pipeline-dashboard.ts +0 -81
- package/corpus/templates/crm/actions/list-crm-dashboard-revisions.ts +0 -15
- package/corpus/templates/crm/actions/list-crm-dashboards.ts +0 -15
- package/corpus/templates/crm/actions/list-crm-proposals.ts +0 -31
- package/corpus/templates/crm/actions/list-crm-records.ts +0 -79
- package/corpus/templates/crm/actions/list-crm-saved-views.ts +0 -15
- package/corpus/templates/crm/actions/list-crm-signal-hits.ts +0 -43
- package/corpus/templates/crm/actions/list-crm-signal-trackers.ts +0 -32
- package/corpus/templates/crm/actions/list-crm-tasks.ts +0 -22
- package/corpus/templates/crm/actions/list-staged-datasets.ts +0 -14
- package/corpus/templates/crm/actions/list-workspace-connections.ts +0 -47
- package/corpus/templates/crm/actions/manage-crm-signal-tracker.ts +0 -87
- package/corpus/templates/crm/actions/manage-crm-task.ts +0 -132
- package/corpus/templates/crm/actions/navigate.ts +0 -63
- package/corpus/templates/crm/actions/provider-api-catalog.ts +0 -22
- package/corpus/templates/crm/actions/provider-api-docs.ts +0 -54
- package/corpus/templates/crm/actions/provider-api-request.ts +0 -92
- package/corpus/templates/crm/actions/query-staged-dataset.ts +0 -44
- package/corpus/templates/crm/actions/record-crm-call-insight.ts +0 -160
- package/corpus/templates/crm/actions/record-crm-smart-signal.ts +0 -150
- package/corpus/templates/crm/actions/restore-crm-dashboard-revision.ts +0 -23
- package/corpus/templates/crm/actions/review-crm-signal.ts +0 -31
- package/corpus/templates/crm/actions/run-crm-saved-view-program.ts +0 -103
- package/corpus/templates/crm/actions/run-crm-signal-trackers.ts +0 -275
- package/corpus/templates/crm/actions/run.ts +0 -7
- package/corpus/templates/crm/actions/save-crm-dashboard.ts +0 -51
- package/corpus/templates/crm/actions/save-crm-saved-view.ts +0 -119
- package/corpus/templates/crm/actions/sync-crm.ts +0 -146
- package/corpus/templates/crm/actions/update-crm-record.ts +0 -510
- package/corpus/templates/crm/actions/view-screen.ts +0 -218
- package/corpus/templates/crm/agent-native.app-skill.json +0 -58
- package/corpus/templates/crm/app/components/crm/CreateCrmRecordDialog.tsx +0 -158
- package/corpus/templates/crm/app/components/crm/CrmDashboardPanel.tsx +0 -78
- package/corpus/templates/crm/app/components/crm/CrmSignalsPanel.tsx +0 -226
- package/corpus/templates/crm/app/components/crm/IntelligenceSettings.tsx +0 -414
- package/corpus/templates/crm/app/components/crm/RecordActions.tsx +0 -510
- package/corpus/templates/crm/app/components/crm/RecordGrid.tsx +0 -134
- package/corpus/templates/crm/app/components/crm/RecordWorkspace.tsx +0 -362
- package/corpus/templates/crm/app/components/crm/SavedViewDataProgram.tsx +0 -93
- package/corpus/templates/crm/app/components/crm/Surface.tsx +0 -97
- package/corpus/templates/crm/app/components/crm/WorkOverview.tsx +0 -180
- package/corpus/templates/crm/app/components/layout/CrmLayout.tsx +0 -112
- package/corpus/templates/crm/app/components/layout/CrmSidebar.tsx +0 -84
- package/corpus/templates/crm/app/components/ui/alert-dialog.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/badge.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/button.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/card.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/dialog.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/input.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/label.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/select.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/sheet.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/skeleton.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/switch.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/table.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/tabs.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/textarea.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/toolkit-provider.tsx +0 -17
- package/corpus/templates/crm/app/design-system.ts +0 -3
- package/corpus/templates/crm/app/entry.client.tsx +0 -16
- package/corpus/templates/crm/app/entry.server.tsx +0 -10
- package/corpus/templates/crm/app/global.css +0 -167
- package/corpus/templates/crm/app/hooks/use-navigation-state.ts +0 -60
- package/corpus/templates/crm/app/i18n/en-US.ts +0 -89
- package/corpus/templates/crm/app/i18n/index.ts +0 -34
- package/corpus/templates/crm/app/lib/dashboard.ts +0 -13
- package/corpus/templates/crm/app/lib/navigation.ts +0 -54
- package/corpus/templates/crm/app/lib/tab-id.ts +0 -1
- package/corpus/templates/crm/app/lib/types.ts +0 -172
- package/corpus/templates/crm/app/lib/utils.ts +0 -1
- package/corpus/templates/crm/app/root.tsx +0 -91
- package/corpus/templates/crm/app/routes/_index.tsx +0 -26
- package/corpus/templates/crm/app/routes/accounts.tsx +0 -41
- package/corpus/templates/crm/app/routes/agent.tsx +0 -5
- package/corpus/templates/crm/app/routes/ask.tsx +0 -53
- package/corpus/templates/crm/app/routes/dashboard.tsx +0 -118
- package/corpus/templates/crm/app/routes/opportunities.tsx +0 -41
- package/corpus/templates/crm/app/routes/people.tsx +0 -41
- package/corpus/templates/crm/app/routes/proposals.tsx +0 -266
- package/corpus/templates/crm/app/routes/records.$recordId.tsx +0 -35
- package/corpus/templates/crm/app/routes/settings.tsx +0 -63
- package/corpus/templates/crm/app/routes/setup.tsx +0 -308
- package/corpus/templates/crm/app/routes/tasks.tsx +0 -252
- package/corpus/templates/crm/app/routes/views.tsx +0 -333
- package/corpus/templates/crm/app/routes.ts +0 -17
- package/corpus/templates/crm/app/vite-env.d.ts +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-agent-native-crm.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-clips-call-evidence-review-recipe.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-crm-can-now-find-and-review-evidence-grounded-call-signals-w.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-crm-can-now-manage-keyword-and-smart-call-signal-trackers-fr.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-delegated-local-crm-automation.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-native-sql.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-pipeline-dashboard.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-pipeline-dashboards-now-install-correctly-from-the-crm-actio.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-salesforce-connection.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-22-crm-field-validation-now-explains-which-fields-cannot-be-edi.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-22-fixed-hubspot-contact-syncs-missing-records-updated-after-th.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-22-fixed-pipeline-dashboard-panels-so-their-opportunity-data-lo.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-22-full-page-chat-keeps-the-active-conversation-when-moving-to-.md +0 -6
- package/corpus/templates/crm/components.json +0 -20
- package/corpus/templates/crm/docs/architecture/crm-contract.md +0 -180
- package/corpus/templates/crm/learnings.defaults.md +0 -5
- package/corpus/templates/crm/package.json +0 -59
- package/corpus/templates/crm/public/favicon.svg +0 -1
- package/corpus/templates/crm/public/icon-180.svg +0 -1
- package/corpus/templates/crm/public/manifest.json +0 -11
- package/corpus/templates/crm/react-router.config.ts +0 -7
- package/corpus/templates/crm/server/crm/adapter.ts +0 -32
- package/corpus/templates/crm/server/crm/crm-field-firewall.ts +0 -64
- package/corpus/templates/crm/server/crm/crm-mirror.ts +0 -711
- package/corpus/templates/crm/server/crm/hubspot-adapter.ts +0 -1146
- package/corpus/templates/crm/server/crm/native-adapter.ts +0 -1715
- package/corpus/templates/crm/server/crm/read-through.ts +0 -207
- package/corpus/templates/crm/server/crm/salesforce-adapter.ts +0 -1255
- package/corpus/templates/crm/server/db/crm-store.ts +0 -1170
- package/corpus/templates/crm/server/db/index.ts +0 -169
- package/corpus/templates/crm/server/db/schema.ts +0 -441
- package/corpus/templates/crm/server/lib/intelligence/default-detectors.ts +0 -65
- package/corpus/templates/crm/server/lib/intelligence/evidence.ts +0 -105
- package/corpus/templates/crm/server/lib/intelligence/keyword-detector.ts +0 -100
- package/corpus/templates/crm/server/lib/intelligence/smart-detector.ts +0 -144
- package/corpus/templates/crm/server/lib/intelligence/summary.ts +0 -141
- package/corpus/templates/crm/server/lib/provider-api.ts +0 -64
- package/corpus/templates/crm/server/middleware/auth.ts +0 -4
- package/corpus/templates/crm/server/plugins/agent-chat.ts +0 -68
- package/corpus/templates/crm/server/plugins/auth.ts +0 -14
- package/corpus/templates/crm/server/plugins/core-routes.ts +0 -17
- package/corpus/templates/crm/server/plugins/db.ts +0 -454
- package/corpus/templates/crm/server/routes/[...page].get.ts +0 -5
- package/corpus/templates/crm/shared/crm-automation-recipes.ts +0 -132
- package/corpus/templates/crm/shared/crm-contract.ts +0 -254
- package/corpus/templates/crm/shared/crm-sales-config.ts +0 -63
- package/corpus/templates/crm/ssr-entry.ts +0 -11
- package/corpus/templates/crm/tsconfig.json +0 -24
- package/corpus/templates/crm/vite.config.ts +0 -15
- package/corpus/templates/crm/vitest.config.ts +0 -5
|
@@ -1,362 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IconChecklist,
|
|
3
|
-
IconExternalLink,
|
|
4
|
-
IconFileSearch,
|
|
5
|
-
IconHistory,
|
|
6
|
-
IconNotes,
|
|
7
|
-
IconSparkles,
|
|
8
|
-
} from "@tabler/icons-react";
|
|
9
|
-
import { useMemo } from "react";
|
|
10
|
-
import { Link } from "react-router";
|
|
11
|
-
|
|
12
|
-
import { CrmSignalsPanel } from "@/components/crm/CrmSignalsPanel";
|
|
13
|
-
import { LoadingRows, SetupEmptyState } from "@/components/crm/Surface";
|
|
14
|
-
import { Badge } from "@/components/ui/badge";
|
|
15
|
-
import { Button } from "@/components/ui/button";
|
|
16
|
-
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
|
17
|
-
import {
|
|
18
|
-
asText,
|
|
19
|
-
normalizeTasks,
|
|
20
|
-
recordId,
|
|
21
|
-
type CrmRecordDetail,
|
|
22
|
-
} from "@/lib/types";
|
|
23
|
-
|
|
24
|
-
export function RecordWorkspace({
|
|
25
|
-
record,
|
|
26
|
-
isLoading,
|
|
27
|
-
onCompleteTask,
|
|
28
|
-
isCompletingTask,
|
|
29
|
-
actions,
|
|
30
|
-
}: {
|
|
31
|
-
record: CrmRecordDetail | undefined;
|
|
32
|
-
isLoading: boolean;
|
|
33
|
-
onCompleteTask: (taskId: string) => void;
|
|
34
|
-
isCompletingTask: boolean;
|
|
35
|
-
actions?: React.ReactNode;
|
|
36
|
-
}) {
|
|
37
|
-
const details = useMemo(
|
|
38
|
-
() =>
|
|
39
|
-
Object.entries(record?.fields ?? {})
|
|
40
|
-
.filter(([, value]) => typeof value !== "object" || value === null)
|
|
41
|
-
.slice(0, 10),
|
|
42
|
-
[record?.fields],
|
|
43
|
-
);
|
|
44
|
-
const tasks = normalizeTasks(record?.tasks);
|
|
45
|
-
|
|
46
|
-
if (isLoading) return <LoadingRows rows={8} />;
|
|
47
|
-
if (!record)
|
|
48
|
-
return (
|
|
49
|
-
<SetupEmptyState
|
|
50
|
-
title="This CRM record is unavailable"
|
|
51
|
-
description="It may have been archived, removed from a connected scope, or no longer shared with you."
|
|
52
|
-
/>
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<div className="min-h-full">
|
|
57
|
-
<header className="border-b border-border/70 px-5 py-5 sm:px-7">
|
|
58
|
-
<div className="flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
|
|
59
|
-
<span className="capitalize">{record.kind}</span>
|
|
60
|
-
{record.stage ? (
|
|
61
|
-
<>
|
|
62
|
-
<span>•</span>
|
|
63
|
-
<Badge variant="secondary" className="font-normal">
|
|
64
|
-
{record.stage}
|
|
65
|
-
</Badge>
|
|
66
|
-
</>
|
|
67
|
-
) : null}
|
|
68
|
-
</div>
|
|
69
|
-
<div className="mt-2 flex flex-wrap items-start justify-between gap-4">
|
|
70
|
-
<div>
|
|
71
|
-
<h1 className="text-2xl font-semibold tracking-tight">
|
|
72
|
-
{record.displayName}
|
|
73
|
-
</h1>
|
|
74
|
-
{record.subtitle ? (
|
|
75
|
-
<p className="mt-1 text-sm text-muted-foreground">
|
|
76
|
-
{record.subtitle}
|
|
77
|
-
</p>
|
|
78
|
-
) : null}
|
|
79
|
-
</div>
|
|
80
|
-
<div className="grid justify-items-end gap-3">
|
|
81
|
-
{record.owner ? (
|
|
82
|
-
<p className="text-sm text-muted-foreground">
|
|
83
|
-
Owner · {record.owner}
|
|
84
|
-
</p>
|
|
85
|
-
) : null}
|
|
86
|
-
{actions}
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
</header>
|
|
90
|
-
<Tabs defaultValue="details" className="px-5 py-5 sm:px-7">
|
|
91
|
-
<TabsList className="h-9 bg-muted/70">
|
|
92
|
-
<TabsTrigger value="details" className="gap-1.5">
|
|
93
|
-
<IconNotes className="size-3.5" />
|
|
94
|
-
Details
|
|
95
|
-
</TabsTrigger>
|
|
96
|
-
<TabsTrigger value="cadence">Cadence</TabsTrigger>
|
|
97
|
-
<TabsTrigger value="evidence" className="gap-1.5">
|
|
98
|
-
<IconFileSearch className="size-3.5" />
|
|
99
|
-
Evidence
|
|
100
|
-
</TabsTrigger>
|
|
101
|
-
<TabsTrigger value="signals" className="gap-1.5">
|
|
102
|
-
<IconSparkles className="size-3.5" />
|
|
103
|
-
Signals
|
|
104
|
-
</TabsTrigger>
|
|
105
|
-
<TabsTrigger value="activity" className="gap-1.5">
|
|
106
|
-
<IconHistory className="size-3.5" />
|
|
107
|
-
Activity
|
|
108
|
-
</TabsTrigger>
|
|
109
|
-
<TabsTrigger value="tasks" className="gap-1.5">
|
|
110
|
-
<IconChecklist className="size-3.5" />
|
|
111
|
-
Tasks
|
|
112
|
-
</TabsTrigger>
|
|
113
|
-
</TabsList>
|
|
114
|
-
<TabsContent value="details" className="mt-5 max-w-3xl">
|
|
115
|
-
<SectionTitle
|
|
116
|
-
title="Details"
|
|
117
|
-
description="Permitted fields owned locally or mirrored from a connected CRM."
|
|
118
|
-
/>
|
|
119
|
-
<dl className="mt-4 divide-y divide-border rounded-lg border border-border/70 bg-card">
|
|
120
|
-
{details.length ? (
|
|
121
|
-
details.map(([key, value]) => (
|
|
122
|
-
<div
|
|
123
|
-
key={key}
|
|
124
|
-
className="grid grid-cols-[minmax(9rem,0.45fr)_minmax(0,1fr)] gap-4 px-4 py-3"
|
|
125
|
-
>
|
|
126
|
-
<dt className="text-sm text-muted-foreground">
|
|
127
|
-
{displayFieldName(key)}
|
|
128
|
-
</dt>
|
|
129
|
-
<dd className="break-words text-sm">{displayValue(value)}</dd>
|
|
130
|
-
</div>
|
|
131
|
-
))
|
|
132
|
-
) : (
|
|
133
|
-
<EmptyCopy text="No permitted fields are mirrored for this record." />
|
|
134
|
-
)}
|
|
135
|
-
</dl>
|
|
136
|
-
<div className="mt-6">
|
|
137
|
-
<SectionTitle
|
|
138
|
-
title="Related records"
|
|
139
|
-
description="Permitted records linked in this CRM workspace."
|
|
140
|
-
/>
|
|
141
|
-
<div className="mt-4 divide-y divide-border rounded-lg border border-border/70 bg-card">
|
|
142
|
-
{record.relatedRecords?.length ? (
|
|
143
|
-
record.relatedRecords.map((related) => (
|
|
144
|
-
<Link
|
|
145
|
-
key={`${related.id}:${related.relationshipType}`}
|
|
146
|
-
to={`/records/${encodeURIComponent(related.id)}`}
|
|
147
|
-
className="flex items-center gap-3 px-4 py-3 transition-colors hover:bg-muted/50"
|
|
148
|
-
>
|
|
149
|
-
<div className="min-w-0 flex-1">
|
|
150
|
-
<p className="truncate text-sm font-medium">
|
|
151
|
-
{related.displayName}
|
|
152
|
-
</p>
|
|
153
|
-
<p className="mt-0.5 truncate text-xs text-muted-foreground">
|
|
154
|
-
{[
|
|
155
|
-
related.relationshipLabel ?? related.relationshipType,
|
|
156
|
-
related.subtitle,
|
|
157
|
-
]
|
|
158
|
-
.filter(Boolean)
|
|
159
|
-
.join(" · ")}
|
|
160
|
-
</p>
|
|
161
|
-
</div>
|
|
162
|
-
<Badge
|
|
163
|
-
variant="secondary"
|
|
164
|
-
className="capitalize font-normal"
|
|
165
|
-
>
|
|
166
|
-
{related.kind}
|
|
167
|
-
</Badge>
|
|
168
|
-
</Link>
|
|
169
|
-
))
|
|
170
|
-
) : (
|
|
171
|
-
<EmptyCopy text="No permitted linked records are available." />
|
|
172
|
-
)}
|
|
173
|
-
</div>
|
|
174
|
-
</div>
|
|
175
|
-
</TabsContent>
|
|
176
|
-
<TabsContent value="cadence" className="mt-5 max-w-3xl">
|
|
177
|
-
<SectionTitle
|
|
178
|
-
title="Cadence"
|
|
179
|
-
description="The next contact rhythm is based on permitted CRM activity."
|
|
180
|
-
/>
|
|
181
|
-
<div className="mt-4 grid gap-3 rounded-lg border border-border/70 bg-card p-4 sm:grid-cols-3">
|
|
182
|
-
<Metric label="Cadence" value={record.cadence ?? "Not set"} />
|
|
183
|
-
<Metric
|
|
184
|
-
label="Next step"
|
|
185
|
-
value={record.nextStep ?? "No next step"}
|
|
186
|
-
/>
|
|
187
|
-
<Metric
|
|
188
|
-
label="Last updated"
|
|
189
|
-
value={
|
|
190
|
-
record.updatedAt ? formatDate(record.updatedAt) : "Unknown"
|
|
191
|
-
}
|
|
192
|
-
/>
|
|
193
|
-
</div>
|
|
194
|
-
</TabsContent>
|
|
195
|
-
<TabsContent value="evidence" className="mt-5 max-w-3xl">
|
|
196
|
-
<SectionTitle
|
|
197
|
-
title="Evidence"
|
|
198
|
-
description="Bounded references supporting CRM context."
|
|
199
|
-
/>
|
|
200
|
-
<div className="mt-4 divide-y divide-border rounded-lg border border-border/70 bg-card">
|
|
201
|
-
{record.evidence?.length ? (
|
|
202
|
-
record.evidence.map((evidence) => (
|
|
203
|
-
<div key={evidence.id} className="px-4 py-3">
|
|
204
|
-
<div className="flex items-start justify-between gap-3">
|
|
205
|
-
<p className="text-sm font-medium">{evidence.label}</p>
|
|
206
|
-
{evidence.url ? (
|
|
207
|
-
<a
|
|
208
|
-
href={evidence.url}
|
|
209
|
-
target="_blank"
|
|
210
|
-
rel="noreferrer"
|
|
211
|
-
className="text-muted-foreground hover:text-foreground"
|
|
212
|
-
aria-label={`Open ${evidence.label}`}
|
|
213
|
-
>
|
|
214
|
-
<IconExternalLink className="size-4" />
|
|
215
|
-
</a>
|
|
216
|
-
) : null}
|
|
217
|
-
</div>
|
|
218
|
-
{evidence.quote ? (
|
|
219
|
-
<p className="mt-1 text-sm leading-6 text-muted-foreground">
|
|
220
|
-
{evidence.quote}
|
|
221
|
-
</p>
|
|
222
|
-
) : null}
|
|
223
|
-
</div>
|
|
224
|
-
))
|
|
225
|
-
) : (
|
|
226
|
-
<EmptyCopy text="No evidence references are available yet." />
|
|
227
|
-
)}
|
|
228
|
-
</div>
|
|
229
|
-
</TabsContent>
|
|
230
|
-
<TabsContent value="signals" className="mt-5">
|
|
231
|
-
<CrmSignalsPanel
|
|
232
|
-
recordId={record.id}
|
|
233
|
-
evidence={record.evidence ?? []}
|
|
234
|
-
/>
|
|
235
|
-
</TabsContent>
|
|
236
|
-
<TabsContent value="activity" className="mt-5 max-w-3xl">
|
|
237
|
-
<SectionTitle
|
|
238
|
-
title="Activity"
|
|
239
|
-
description="Recent permitted interaction metadata."
|
|
240
|
-
/>
|
|
241
|
-
<div className="mt-4 divide-y divide-border rounded-lg border border-border/70 bg-card">
|
|
242
|
-
{record.activity?.length ? (
|
|
243
|
-
record.activity.map((activity) => (
|
|
244
|
-
<div key={activity.id} className="px-4 py-3">
|
|
245
|
-
<p className="text-sm font-medium">{activity.title}</p>
|
|
246
|
-
{activity.summary ? (
|
|
247
|
-
<p className="mt-1 text-sm text-muted-foreground">
|
|
248
|
-
{activity.summary}
|
|
249
|
-
</p>
|
|
250
|
-
) : null}
|
|
251
|
-
<p className="mt-2 text-xs text-muted-foreground">
|
|
252
|
-
{[
|
|
253
|
-
activity.actor,
|
|
254
|
-
activity.occurredAt
|
|
255
|
-
? formatDate(activity.occurredAt)
|
|
256
|
-
: undefined,
|
|
257
|
-
]
|
|
258
|
-
.filter(Boolean)
|
|
259
|
-
.join(" · ")}
|
|
260
|
-
</p>
|
|
261
|
-
</div>
|
|
262
|
-
))
|
|
263
|
-
) : (
|
|
264
|
-
<EmptyCopy text="No recent activity is available." />
|
|
265
|
-
)}
|
|
266
|
-
</div>
|
|
267
|
-
</TabsContent>
|
|
268
|
-
<TabsContent value="tasks" className="mt-5 max-w-3xl">
|
|
269
|
-
<SectionTitle
|
|
270
|
-
title="Tasks"
|
|
271
|
-
description="Keep follow-up work connected to the record."
|
|
272
|
-
/>
|
|
273
|
-
<div className="mt-4 divide-y divide-border rounded-lg border border-border/70 bg-card">
|
|
274
|
-
{tasks.length ? (
|
|
275
|
-
tasks.map((task) => (
|
|
276
|
-
<div
|
|
277
|
-
key={task.id}
|
|
278
|
-
className="flex items-center gap-3 px-4 py-3"
|
|
279
|
-
>
|
|
280
|
-
<div className="min-w-0 flex-1">
|
|
281
|
-
<p className="text-sm font-medium">{task.title}</p>
|
|
282
|
-
<p className="mt-0.5 text-xs text-muted-foreground">
|
|
283
|
-
{task.dueAt
|
|
284
|
-
? `Due ${formatDate(task.dueAt)}`
|
|
285
|
-
: task.status}
|
|
286
|
-
</p>
|
|
287
|
-
</div>
|
|
288
|
-
{task.status !== "done" ? (
|
|
289
|
-
<Button
|
|
290
|
-
variant="outline"
|
|
291
|
-
size="sm"
|
|
292
|
-
disabled={isCompletingTask}
|
|
293
|
-
onClick={() => onCompleteTask(task.id)}
|
|
294
|
-
>
|
|
295
|
-
Complete
|
|
296
|
-
</Button>
|
|
297
|
-
) : (
|
|
298
|
-
<Badge variant="secondary">Done</Badge>
|
|
299
|
-
)}
|
|
300
|
-
</div>
|
|
301
|
-
))
|
|
302
|
-
) : (
|
|
303
|
-
<EmptyCopy text="No follow-up tasks are attached to this record." />
|
|
304
|
-
)}
|
|
305
|
-
</div>
|
|
306
|
-
</TabsContent>
|
|
307
|
-
</Tabs>
|
|
308
|
-
</div>
|
|
309
|
-
);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
function SectionTitle({
|
|
313
|
-
title,
|
|
314
|
-
description,
|
|
315
|
-
}: {
|
|
316
|
-
title: string;
|
|
317
|
-
description: string;
|
|
318
|
-
}) {
|
|
319
|
-
return (
|
|
320
|
-
<div>
|
|
321
|
-
<h2 className="text-sm font-semibold">{title}</h2>
|
|
322
|
-
<p className="mt-1 text-sm text-muted-foreground">{description}</p>
|
|
323
|
-
</div>
|
|
324
|
-
);
|
|
325
|
-
}
|
|
326
|
-
function Metric({ label, value }: { label: string; value: string }) {
|
|
327
|
-
return (
|
|
328
|
-
<div>
|
|
329
|
-
<p className="text-xs font-medium uppercase tracking-[0.1em] text-muted-foreground">
|
|
330
|
-
{label}
|
|
331
|
-
</p>
|
|
332
|
-
<p className="mt-1 text-sm font-medium">{value}</p>
|
|
333
|
-
</div>
|
|
334
|
-
);
|
|
335
|
-
}
|
|
336
|
-
function EmptyCopy({ text }: { text: string }) {
|
|
337
|
-
return (
|
|
338
|
-
<p className="px-4 py-8 text-center text-sm text-muted-foreground">
|
|
339
|
-
{text}
|
|
340
|
-
</p>
|
|
341
|
-
);
|
|
342
|
-
}
|
|
343
|
-
function displayFieldName(value: string) {
|
|
344
|
-
return value
|
|
345
|
-
.replace(/([A-Z])/g, " $1")
|
|
346
|
-
.replace(/_/g, " ")
|
|
347
|
-
.replace(/^./, (letter: string) => letter.toUpperCase());
|
|
348
|
-
}
|
|
349
|
-
function displayValue(value: unknown) {
|
|
350
|
-
if (typeof value === "boolean") return value ? "Yes" : "No";
|
|
351
|
-
return asText(value) ?? String(value ?? "—");
|
|
352
|
-
}
|
|
353
|
-
function formatDate(value: string) {
|
|
354
|
-
const date = new Date(value);
|
|
355
|
-
return Number.isNaN(date.valueOf())
|
|
356
|
-
? value
|
|
357
|
-
: date.toLocaleDateString(undefined, {
|
|
358
|
-
month: "short",
|
|
359
|
-
day: "numeric",
|
|
360
|
-
year: "numeric",
|
|
361
|
-
});
|
|
362
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { useActionMutation } from "@agent-native/core/client/hooks";
|
|
2
|
-
import { DataTable } from "@agent-native/toolkit/dashboard";
|
|
3
|
-
import { IconChartDots } from "@tabler/icons-react";
|
|
4
|
-
import { useEffect, useRef } from "react";
|
|
5
|
-
|
|
6
|
-
import { Badge } from "@/components/ui/badge";
|
|
7
|
-
|
|
8
|
-
interface ProgramPreview {
|
|
9
|
-
ok: boolean;
|
|
10
|
-
rowCount?: number;
|
|
11
|
-
columns?: Array<{ name: string; type: string }>;
|
|
12
|
-
sampleRows?: Array<Record<string, unknown>>;
|
|
13
|
-
asOfMs?: number;
|
|
14
|
-
cacheHit?: boolean;
|
|
15
|
-
stale?: boolean;
|
|
16
|
-
truncated?: boolean;
|
|
17
|
-
message?: string;
|
|
18
|
-
lastGoodRun?: {
|
|
19
|
-
rowCount: number;
|
|
20
|
-
columns: Array<{ name: string; type: string }>;
|
|
21
|
-
sampleRows: Array<Record<string, unknown>>;
|
|
22
|
-
truncated: boolean;
|
|
23
|
-
asOfMs: number;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function SavedViewDataProgram({ data }: { data: unknown }) {
|
|
28
|
-
const viewId = linkedProgramViewId(data);
|
|
29
|
-
const lastRunViewId = useRef<string | undefined>(undefined);
|
|
30
|
-
const run = useActionMutation<ProgramPreview, { viewId: string }>(
|
|
31
|
-
"run-crm-saved-view-program" as never,
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
if (!viewId || lastRunViewId.current === viewId) return;
|
|
36
|
-
lastRunViewId.current = viewId;
|
|
37
|
-
run.mutate({ viewId });
|
|
38
|
-
}, [run, viewId]);
|
|
39
|
-
|
|
40
|
-
if (!viewId) return null;
|
|
41
|
-
const preview = run.data?.ok ? run.data : run.data?.lastGoodRun;
|
|
42
|
-
return (
|
|
43
|
-
<section className="mx-5 mt-5 rounded-lg border border-border/70 bg-card p-4 sm:mx-7">
|
|
44
|
-
<div className="flex flex-wrap items-start justify-between gap-3">
|
|
45
|
-
<div className="flex items-start gap-3">
|
|
46
|
-
<IconChartDots className="mt-0.5 size-4 text-muted-foreground" />
|
|
47
|
-
<div>
|
|
48
|
-
<h2 className="text-sm font-semibold">Cross-source context</h2>
|
|
49
|
-
<p className="mt-1 text-sm text-muted-foreground">
|
|
50
|
-
{run.isPending
|
|
51
|
-
? "Running the saved data program…"
|
|
52
|
-
: run.isError
|
|
53
|
-
? "The saved data program is unavailable."
|
|
54
|
-
: run.data?.ok
|
|
55
|
-
? `${run.data.rowCount ?? 0} rows from the linked data program.`
|
|
56
|
-
: run.data?.message ||
|
|
57
|
-
"Showing the last good program result."}
|
|
58
|
-
</p>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
{preview ? (
|
|
62
|
-
<div className="flex gap-2">
|
|
63
|
-
{preview.truncated ? (
|
|
64
|
-
<Badge variant="outline">Truncated</Badge>
|
|
65
|
-
) : null}
|
|
66
|
-
{run.data?.ok && run.data.cacheHit ? (
|
|
67
|
-
<Badge variant="secondary">Cached</Badge>
|
|
68
|
-
) : null}
|
|
69
|
-
</div>
|
|
70
|
-
) : null}
|
|
71
|
-
</div>
|
|
72
|
-
{preview?.sampleRows?.length ? (
|
|
73
|
-
<div className="mt-4 overflow-hidden rounded-md border border-border/70">
|
|
74
|
-
<DataTable
|
|
75
|
-
data={preview.sampleRows.slice(0, 5)}
|
|
76
|
-
columns={preview.columns?.slice(0, 8).map((column) => column.name)}
|
|
77
|
-
maxRows={5}
|
|
78
|
-
/>
|
|
79
|
-
</div>
|
|
80
|
-
) : null}
|
|
81
|
-
</section>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function linkedProgramViewId(data: unknown) {
|
|
86
|
-
if (!data || typeof data !== "object") return undefined;
|
|
87
|
-
const appliedView = (data as { appliedView?: unknown }).appliedView;
|
|
88
|
-
if (!appliedView || typeof appliedView !== "object") return undefined;
|
|
89
|
-
const view = appliedView as Record<string, unknown>;
|
|
90
|
-
return typeof view.id === "string" && typeof view.dataProgramId === "string"
|
|
91
|
-
? view.id
|
|
92
|
-
: undefined;
|
|
93
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IconArrowUpRight,
|
|
3
|
-
IconDatabase,
|
|
4
|
-
IconDatabaseOff,
|
|
5
|
-
} from "@tabler/icons-react";
|
|
6
|
-
import { Link } from "react-router";
|
|
7
|
-
|
|
8
|
-
import { Button } from "@/components/ui/button";
|
|
9
|
-
import { Skeleton } from "@/components/ui/skeleton";
|
|
10
|
-
|
|
11
|
-
export function PageHeader({
|
|
12
|
-
eyebrow,
|
|
13
|
-
title,
|
|
14
|
-
description,
|
|
15
|
-
actions,
|
|
16
|
-
}: {
|
|
17
|
-
eyebrow?: string;
|
|
18
|
-
title: string;
|
|
19
|
-
description?: string;
|
|
20
|
-
actions?: React.ReactNode;
|
|
21
|
-
}) {
|
|
22
|
-
return (
|
|
23
|
-
<header className="flex flex-col gap-4 border-b border-border/70 px-5 py-5 sm:flex-row sm:items-end sm:justify-between sm:px-7">
|
|
24
|
-
<div className="min-w-0">
|
|
25
|
-
{eyebrow ? (
|
|
26
|
-
<p className="mb-1 text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground">
|
|
27
|
-
{eyebrow}
|
|
28
|
-
</p>
|
|
29
|
-
) : null}
|
|
30
|
-
<h1 className="text-xl font-semibold tracking-tight">{title}</h1>
|
|
31
|
-
{description ? (
|
|
32
|
-
<p className="mt-1 max-w-2xl text-sm leading-6 text-muted-foreground">
|
|
33
|
-
{description}
|
|
34
|
-
</p>
|
|
35
|
-
) : null}
|
|
36
|
-
</div>
|
|
37
|
-
{actions ? (
|
|
38
|
-
<div className="flex shrink-0 items-center gap-2">{actions}</div>
|
|
39
|
-
) : null}
|
|
40
|
-
</header>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function LoadingRows({ rows = 5 }: { rows?: number }) {
|
|
45
|
-
return (
|
|
46
|
-
<div className="grid gap-2 p-5 sm:p-7">
|
|
47
|
-
{Array.from({ length: rows }, (_, index) => (
|
|
48
|
-
<Skeleton key={index} className="h-12 w-full" />
|
|
49
|
-
))}
|
|
50
|
-
</div>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export function SetupEmptyState({
|
|
55
|
-
title = "Start a CRM to begin",
|
|
56
|
-
description = "Start with the built-in SQL CRM, or connect a scoped workspace CRM. No provider credentials are stored in this app.",
|
|
57
|
-
onSync,
|
|
58
|
-
isSyncing = false,
|
|
59
|
-
actionLabel,
|
|
60
|
-
}: {
|
|
61
|
-
title?: string;
|
|
62
|
-
description?: string;
|
|
63
|
-
onSync?: () => void;
|
|
64
|
-
isSyncing?: boolean;
|
|
65
|
-
actionLabel?: string;
|
|
66
|
-
}) {
|
|
67
|
-
return (
|
|
68
|
-
<div className="grid min-h-[360px] place-items-center p-6">
|
|
69
|
-
<div className="max-w-sm text-center">
|
|
70
|
-
<div className="mx-auto grid size-10 place-items-center rounded-full bg-muted text-muted-foreground">
|
|
71
|
-
<IconDatabaseOff className="size-5" />
|
|
72
|
-
</div>
|
|
73
|
-
<h2 className="mt-4 text-base font-semibold">{title}</h2>
|
|
74
|
-
<p className="mt-2 text-sm leading-6 text-muted-foreground">
|
|
75
|
-
{description}
|
|
76
|
-
</p>
|
|
77
|
-
<div className="mt-5 flex flex-wrap justify-center gap-2">
|
|
78
|
-
<Button asChild className="gap-2">
|
|
79
|
-
<Link to="/setup">
|
|
80
|
-
<IconDatabase className="size-4" /> Start with Native SQL
|
|
81
|
-
</Link>
|
|
82
|
-
</Button>
|
|
83
|
-
<Button asChild variant="outline" className="gap-2">
|
|
84
|
-
<Link to="/settings/connections">
|
|
85
|
-
Open shared connections <IconArrowUpRight className="size-4" />
|
|
86
|
-
</Link>
|
|
87
|
-
</Button>
|
|
88
|
-
{onSync ? (
|
|
89
|
-
<Button onClick={onSync} disabled={isSyncing}>
|
|
90
|
-
{isSyncing ? "Working…" : (actionLabel ?? "Sync recent records")}
|
|
91
|
-
</Button>
|
|
92
|
-
) : null}
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
);
|
|
97
|
-
}
|