@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,118 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useActionMutation,
|
|
3
|
-
useActionQuery,
|
|
4
|
-
} from "@agent-native/core/client/hooks";
|
|
5
|
-
import { useT } from "@agent-native/core/client/i18n";
|
|
6
|
-
import { IconRefresh } from "@tabler/icons-react";
|
|
7
|
-
import { useMemo } from "react";
|
|
8
|
-
import { useNavigate, useSearchParams } from "react-router";
|
|
9
|
-
import { toast } from "sonner";
|
|
10
|
-
|
|
11
|
-
import { CrmDashboardPanel } from "@/components/crm/CrmDashboardPanel";
|
|
12
|
-
import { PageHeader, SetupEmptyState } from "@/components/crm/Surface";
|
|
13
|
-
import { Button } from "@/components/ui/button";
|
|
14
|
-
import { crmDashboardMetaTitle } from "@/i18n/en-US";
|
|
15
|
-
import { dashboardDataPanelId } from "@/lib/dashboard";
|
|
16
|
-
import type { CrmDashboard } from "@/lib/types";
|
|
17
|
-
|
|
18
|
-
export function meta() {
|
|
19
|
-
return [{ title: crmDashboardMetaTitle }];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default function DashboardRoute() {
|
|
23
|
-
const t = useT();
|
|
24
|
-
const [searchParams] = useSearchParams();
|
|
25
|
-
const navigate = useNavigate();
|
|
26
|
-
const dashboards = useActionQuery<CrmDashboard[]>(
|
|
27
|
-
"list-crm-dashboards" as never,
|
|
28
|
-
{} as never,
|
|
29
|
-
);
|
|
30
|
-
const install = useActionMutation<
|
|
31
|
-
{ dashboardId: string },
|
|
32
|
-
Record<string, never>
|
|
33
|
-
>("install-crm-pipeline-dashboard" as never);
|
|
34
|
-
const dashboard = useMemo(() => {
|
|
35
|
-
const requested = searchParams.get("id");
|
|
36
|
-
return (
|
|
37
|
-
dashboards.data?.find((item) => item.id === requested) ??
|
|
38
|
-
dashboards.data?.find((item) => item.kind === "pipeline")
|
|
39
|
-
);
|
|
40
|
-
}, [dashboards.data, searchParams]);
|
|
41
|
-
|
|
42
|
-
async function installDashboard() {
|
|
43
|
-
try {
|
|
44
|
-
const result = await install.mutateAsync({});
|
|
45
|
-
navigate(`/dashboard?id=${encodeURIComponent(result.dashboardId)}`, {
|
|
46
|
-
replace: true,
|
|
47
|
-
});
|
|
48
|
-
toast.success(t("dashboard.ready"));
|
|
49
|
-
} catch (error) {
|
|
50
|
-
toast.error(
|
|
51
|
-
error instanceof Error ? error.message : t("dashboard.installFailed"),
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (dashboards.isLoading) {
|
|
57
|
-
return (
|
|
58
|
-
<PageHeader
|
|
59
|
-
eyebrow="CRM"
|
|
60
|
-
title={t("dashboard.pipeline")}
|
|
61
|
-
description={t("dashboard.loadingDescription")}
|
|
62
|
-
/>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (!dashboard) {
|
|
67
|
-
return (
|
|
68
|
-
<>
|
|
69
|
-
<PageHeader
|
|
70
|
-
eyebrow="CRM"
|
|
71
|
-
title={t("dashboard.pipeline")}
|
|
72
|
-
description={t("dashboard.emptyDescription")}
|
|
73
|
-
/>
|
|
74
|
-
<SetupEmptyState
|
|
75
|
-
title={t("dashboard.installTitle")}
|
|
76
|
-
description={t("dashboard.installDescription")}
|
|
77
|
-
onSync={installDashboard}
|
|
78
|
-
isSyncing={install.isPending}
|
|
79
|
-
actionLabel={t("dashboard.installAction")}
|
|
80
|
-
/>
|
|
81
|
-
</>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
<>
|
|
87
|
-
<PageHeader
|
|
88
|
-
eyebrow="CRM"
|
|
89
|
-
title={dashboard.title}
|
|
90
|
-
description={t("dashboard.liveDescription")}
|
|
91
|
-
actions={
|
|
92
|
-
<Button
|
|
93
|
-
variant="outline"
|
|
94
|
-
size="sm"
|
|
95
|
-
className="gap-2"
|
|
96
|
-
onClick={installDashboard}
|
|
97
|
-
disabled={install.isPending}
|
|
98
|
-
>
|
|
99
|
-
<IconRefresh className="size-4" />
|
|
100
|
-
{install.isPending
|
|
101
|
-
? t("dashboard.updating")
|
|
102
|
-
: t("dashboard.updatePack")}
|
|
103
|
-
</Button>
|
|
104
|
-
}
|
|
105
|
-
/>
|
|
106
|
-
<div className="grid gap-4 p-5 sm:grid-cols-2 sm:p-7 xl:grid-cols-3">
|
|
107
|
-
{dashboard.config.panels.map((panel) => (
|
|
108
|
-
<CrmDashboardPanel
|
|
109
|
-
key={panel.id}
|
|
110
|
-
dashboardId={dashboard.id}
|
|
111
|
-
panel={panel}
|
|
112
|
-
dataPanelId={dashboardDataPanelId(dashboard.config.panels, panel)}
|
|
113
|
-
/>
|
|
114
|
-
))}
|
|
115
|
-
</div>
|
|
116
|
-
</>
|
|
117
|
-
);
|
|
118
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { useActionQuery } from "@agent-native/core/client/hooks";
|
|
2
|
-
import { useSearchParams } from "react-router";
|
|
3
|
-
|
|
4
|
-
import { CreateCrmRecordDialog } from "@/components/crm/CreateCrmRecordDialog";
|
|
5
|
-
import { RecordGrid } from "@/components/crm/RecordGrid";
|
|
6
|
-
import { SavedViewDataProgram } from "@/components/crm/SavedViewDataProgram";
|
|
7
|
-
import { PageHeader } from "@/components/crm/Surface";
|
|
8
|
-
import { normalizeRecords } from "@/lib/types";
|
|
9
|
-
|
|
10
|
-
export function meta() {
|
|
11
|
-
return [{ title: "Opportunities · CRM" }];
|
|
12
|
-
}
|
|
13
|
-
export default function OpportunitiesRoute() {
|
|
14
|
-
const [searchParams] = useSearchParams();
|
|
15
|
-
const viewId = searchParams.get("view") ?? undefined;
|
|
16
|
-
const query = useActionQuery<unknown>(
|
|
17
|
-
"list-crm-records" as never,
|
|
18
|
-
{ kind: "opportunity", viewId } as never,
|
|
19
|
-
);
|
|
20
|
-
return (
|
|
21
|
-
<>
|
|
22
|
-
<PageHeader
|
|
23
|
-
eyebrow="Records"
|
|
24
|
-
title="Opportunities"
|
|
25
|
-
description={
|
|
26
|
-
viewId
|
|
27
|
-
? "Opportunities matching this saved view."
|
|
28
|
-
: "Opportunities in your Native SQL workspace and connected CRM mirrors."
|
|
29
|
-
}
|
|
30
|
-
actions={<CreateCrmRecordDialog kind="opportunity" />}
|
|
31
|
-
/>
|
|
32
|
-
<SavedViewDataProgram data={query.data} />
|
|
33
|
-
<RecordGrid
|
|
34
|
-
kind="opportunity"
|
|
35
|
-
records={normalizeRecords(query.data, "opportunity")}
|
|
36
|
-
isLoading={query.isLoading}
|
|
37
|
-
emptyTitle="No opportunities yet"
|
|
38
|
-
/>
|
|
39
|
-
</>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { useActionQuery } from "@agent-native/core/client/hooks";
|
|
2
|
-
import { useSearchParams } from "react-router";
|
|
3
|
-
|
|
4
|
-
import { CreateCrmRecordDialog } from "@/components/crm/CreateCrmRecordDialog";
|
|
5
|
-
import { RecordGrid } from "@/components/crm/RecordGrid";
|
|
6
|
-
import { SavedViewDataProgram } from "@/components/crm/SavedViewDataProgram";
|
|
7
|
-
import { PageHeader } from "@/components/crm/Surface";
|
|
8
|
-
import { normalizeRecords } from "@/lib/types";
|
|
9
|
-
|
|
10
|
-
export function meta() {
|
|
11
|
-
return [{ title: "People · CRM" }];
|
|
12
|
-
}
|
|
13
|
-
export default function PeopleRoute() {
|
|
14
|
-
const [searchParams] = useSearchParams();
|
|
15
|
-
const viewId = searchParams.get("view") ?? undefined;
|
|
16
|
-
const query = useActionQuery<unknown>(
|
|
17
|
-
"list-crm-records" as never,
|
|
18
|
-
{ kind: "person", viewId } as never,
|
|
19
|
-
);
|
|
20
|
-
return (
|
|
21
|
-
<>
|
|
22
|
-
<PageHeader
|
|
23
|
-
eyebrow="Records"
|
|
24
|
-
title="People"
|
|
25
|
-
description={
|
|
26
|
-
viewId
|
|
27
|
-
? "People matching this saved view."
|
|
28
|
-
: "People in your Native SQL workspace and connected CRM mirrors."
|
|
29
|
-
}
|
|
30
|
-
actions={<CreateCrmRecordDialog kind="person" />}
|
|
31
|
-
/>
|
|
32
|
-
<SavedViewDataProgram data={query.data} />
|
|
33
|
-
<RecordGrid
|
|
34
|
-
kind="person"
|
|
35
|
-
records={normalizeRecords(query.data, "person")}
|
|
36
|
-
isLoading={query.isLoading}
|
|
37
|
-
emptyTitle="No people yet"
|
|
38
|
-
/>
|
|
39
|
-
</>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useActionMutation,
|
|
3
|
-
useActionQuery,
|
|
4
|
-
} from "@agent-native/core/client/hooks";
|
|
5
|
-
import { IconExternalLink, IconShieldCheck } from "@tabler/icons-react";
|
|
6
|
-
import { useState } from "react";
|
|
7
|
-
import { Link } from "react-router";
|
|
8
|
-
import { toast } from "sonner";
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
LoadingRows,
|
|
12
|
-
PageHeader,
|
|
13
|
-
SetupEmptyState,
|
|
14
|
-
} from "@/components/crm/Surface";
|
|
15
|
-
import {
|
|
16
|
-
AlertDialog,
|
|
17
|
-
AlertDialogAction,
|
|
18
|
-
AlertDialogCancel,
|
|
19
|
-
AlertDialogContent,
|
|
20
|
-
AlertDialogDescription,
|
|
21
|
-
AlertDialogFooter,
|
|
22
|
-
AlertDialogHeader,
|
|
23
|
-
AlertDialogTitle,
|
|
24
|
-
AlertDialogTrigger,
|
|
25
|
-
} from "@/components/ui/alert-dialog";
|
|
26
|
-
import { Badge } from "@/components/ui/badge";
|
|
27
|
-
import { Button } from "@/components/ui/button";
|
|
28
|
-
|
|
29
|
-
interface ProposalPreview {
|
|
30
|
-
id: string;
|
|
31
|
-
recordId?: string;
|
|
32
|
-
recordName?: string;
|
|
33
|
-
provider?: string;
|
|
34
|
-
operation: string;
|
|
35
|
-
status: string;
|
|
36
|
-
risk?: string;
|
|
37
|
-
createdAt?: string;
|
|
38
|
-
fields?: Array<{ name: string; before?: unknown; after?: unknown }>;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export default function ProposalsRoute() {
|
|
42
|
-
const query = useActionQuery<unknown>(
|
|
43
|
-
"list-crm-proposals" as never,
|
|
44
|
-
{ limit: 100 } as never,
|
|
45
|
-
);
|
|
46
|
-
const apply = useActionMutation<
|
|
47
|
-
{ status?: string; message?: string },
|
|
48
|
-
{ proposalId: string }
|
|
49
|
-
>("apply-crm-proposals" as never);
|
|
50
|
-
const proposals = normalizeProposals(query.data);
|
|
51
|
-
const [pendingProposalIds, setPendingProposalIds] = useState<Set<string>>(
|
|
52
|
-
new Set(),
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
async function applyProposal(proposalId: string) {
|
|
56
|
-
setPendingProposalIds((current) => new Set(current).add(proposalId));
|
|
57
|
-
try {
|
|
58
|
-
const result = await apply.mutateAsync({ proposalId });
|
|
59
|
-
toast.info(
|
|
60
|
-
result.message ||
|
|
61
|
-
"Proposal reviewed. Complete the approved change in the connected CRM.",
|
|
62
|
-
);
|
|
63
|
-
} catch (error) {
|
|
64
|
-
toast.error(error instanceof Error ? error.message : "Proposal failed.");
|
|
65
|
-
} finally {
|
|
66
|
-
setPendingProposalIds((current) => {
|
|
67
|
-
const next = new Set(current);
|
|
68
|
-
next.delete(proposalId);
|
|
69
|
-
return next;
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<>
|
|
76
|
-
<PageHeader
|
|
77
|
-
eyebrow="Review"
|
|
78
|
-
title="Proposals"
|
|
79
|
-
description="Review the exact record and field scope before completing provider changes upstream."
|
|
80
|
-
/>
|
|
81
|
-
{query.isLoading ? (
|
|
82
|
-
<LoadingRows rows={6} />
|
|
83
|
-
) : proposals.length ? (
|
|
84
|
-
<div className="grid gap-3 p-5 sm:p-7">
|
|
85
|
-
{proposals.map((proposal) => (
|
|
86
|
-
<section
|
|
87
|
-
key={proposal.id}
|
|
88
|
-
className="rounded-lg border border-border/70 bg-card p-4"
|
|
89
|
-
>
|
|
90
|
-
<div className="flex flex-wrap items-start justify-between gap-3">
|
|
91
|
-
<div>
|
|
92
|
-
<div className="flex flex-wrap items-center gap-2">
|
|
93
|
-
<p className="text-sm font-medium">
|
|
94
|
-
{proposal.recordName || "CRM record"}
|
|
95
|
-
</p>
|
|
96
|
-
<Badge
|
|
97
|
-
variant="secondary"
|
|
98
|
-
className="font-normal capitalize"
|
|
99
|
-
>
|
|
100
|
-
{proposal.status}
|
|
101
|
-
</Badge>
|
|
102
|
-
{proposal.risk ? (
|
|
103
|
-
<Badge
|
|
104
|
-
variant="outline"
|
|
105
|
-
className="font-normal capitalize"
|
|
106
|
-
>
|
|
107
|
-
{proposal.risk}
|
|
108
|
-
</Badge>
|
|
109
|
-
) : null}
|
|
110
|
-
</div>
|
|
111
|
-
<p className="mt-1 text-xs text-muted-foreground">
|
|
112
|
-
{proposal.operation}
|
|
113
|
-
{proposal.createdAt
|
|
114
|
-
? ` · ${formatDate(proposal.createdAt)}`
|
|
115
|
-
: ""}
|
|
116
|
-
</p>
|
|
117
|
-
</div>
|
|
118
|
-
<div className="flex items-center gap-2">
|
|
119
|
-
{proposal.recordId ? (
|
|
120
|
-
<Button
|
|
121
|
-
asChild
|
|
122
|
-
variant="ghost"
|
|
123
|
-
size="sm"
|
|
124
|
-
className="gap-1.5"
|
|
125
|
-
>
|
|
126
|
-
<Link
|
|
127
|
-
to={`/records/${encodeURIComponent(proposal.recordId)}`}
|
|
128
|
-
>
|
|
129
|
-
Record <IconExternalLink className="size-3.5" />
|
|
130
|
-
</Link>
|
|
131
|
-
</Button>
|
|
132
|
-
) : null}
|
|
133
|
-
{proposal.status === "pending" ? (
|
|
134
|
-
<ApprovalButton
|
|
135
|
-
proposal={proposal}
|
|
136
|
-
pending={pendingProposalIds.has(proposal.id)}
|
|
137
|
-
onApprove={() => void applyProposal(proposal.id)}
|
|
138
|
-
/>
|
|
139
|
-
) : null}
|
|
140
|
-
</div>
|
|
141
|
-
</div>
|
|
142
|
-
<ProposalFields fields={proposal.fields} />
|
|
143
|
-
</section>
|
|
144
|
-
))}
|
|
145
|
-
</div>
|
|
146
|
-
) : (
|
|
147
|
-
<SetupEmptyState
|
|
148
|
-
title="No CRM proposals"
|
|
149
|
-
description="Agent-initiated provider edits appear here before anything changes upstream."
|
|
150
|
-
/>
|
|
151
|
-
)}
|
|
152
|
-
</>
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function ApprovalButton({
|
|
157
|
-
proposal,
|
|
158
|
-
pending,
|
|
159
|
-
onApprove,
|
|
160
|
-
}: {
|
|
161
|
-
proposal: ProposalPreview;
|
|
162
|
-
pending: boolean;
|
|
163
|
-
onApprove: () => void;
|
|
164
|
-
}) {
|
|
165
|
-
const fieldNames = proposal.fields?.map((field) => field.name).join(", ");
|
|
166
|
-
return (
|
|
167
|
-
<AlertDialog>
|
|
168
|
-
<AlertDialogTrigger asChild>
|
|
169
|
-
<Button size="sm" className="gap-1.5" disabled={pending}>
|
|
170
|
-
<IconShieldCheck className="size-4" /> Review upstream change
|
|
171
|
-
</Button>
|
|
172
|
-
</AlertDialogTrigger>
|
|
173
|
-
<AlertDialogContent>
|
|
174
|
-
<AlertDialogHeader>
|
|
175
|
-
<AlertDialogTitle>Review this provider change</AlertDialogTitle>
|
|
176
|
-
<AlertDialogDescription>
|
|
177
|
-
This connection has not proved an atomic expected-revision write.
|
|
178
|
-
Review
|
|
179
|
-
{proposal.recordName ? ` ${proposal.recordName}` : " this record"}
|
|
180
|
-
{fieldNames ? ` in ${fieldNames}` : ""}, then make the change in
|
|
181
|
-
{proposal.provider === "salesforce" ? " Salesforce" : " HubSpot"}.
|
|
182
|
-
</AlertDialogDescription>
|
|
183
|
-
</AlertDialogHeader>
|
|
184
|
-
<ProposalFields fields={proposal.fields} />
|
|
185
|
-
<AlertDialogFooter>
|
|
186
|
-
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
187
|
-
<AlertDialogAction onClick={onApprove}>Acknowledge</AlertDialogAction>
|
|
188
|
-
</AlertDialogFooter>
|
|
189
|
-
</AlertDialogContent>
|
|
190
|
-
</AlertDialog>
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function ProposalFields({ fields }: { fields?: ProposalPreview["fields"] }) {
|
|
195
|
-
if (!fields?.length) {
|
|
196
|
-
return (
|
|
197
|
-
<p className="mt-4 text-sm text-muted-foreground">
|
|
198
|
-
The field preview is unavailable. Approval remains scoped to this single
|
|
199
|
-
record.
|
|
200
|
-
</p>
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
return (
|
|
204
|
-
<dl className="mt-4 divide-y divide-border/70 rounded-md border border-border/70">
|
|
205
|
-
{fields.slice(0, 20).map((field) => (
|
|
206
|
-
<div
|
|
207
|
-
key={field.name}
|
|
208
|
-
className="grid grid-cols-[8rem_1fr_1fr] gap-3 px-3 py-2 text-sm"
|
|
209
|
-
>
|
|
210
|
-
<dt className="truncate text-muted-foreground">{field.name}</dt>
|
|
211
|
-
<dd className="break-words">{displayValue(field.before)}</dd>
|
|
212
|
-
<dd className="break-words font-medium">
|
|
213
|
-
{displayValue(field.after)}
|
|
214
|
-
</dd>
|
|
215
|
-
</div>
|
|
216
|
-
))}
|
|
217
|
-
</dl>
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
function normalizeProposals(data: unknown): ProposalPreview[] {
|
|
222
|
-
const rows =
|
|
223
|
-
isObject(data) && Array.isArray(data.proposals) ? data.proposals : [];
|
|
224
|
-
return rows.flatMap((row) => {
|
|
225
|
-
if (!isObject(row) || typeof row.id !== "string") return [];
|
|
226
|
-
const fields = Array.isArray(row.fields)
|
|
227
|
-
? row.fields.flatMap((field) =>
|
|
228
|
-
isObject(field) && typeof field.name === "string"
|
|
229
|
-
? [{ name: field.name, before: field.before, after: field.after }]
|
|
230
|
-
: [],
|
|
231
|
-
)
|
|
232
|
-
: undefined;
|
|
233
|
-
return [
|
|
234
|
-
{
|
|
235
|
-
id: row.id,
|
|
236
|
-
recordId: typeof row.recordId === "string" ? row.recordId : undefined,
|
|
237
|
-
recordName:
|
|
238
|
-
typeof row.recordName === "string" ? row.recordName : undefined,
|
|
239
|
-
provider: typeof row.provider === "string" ? row.provider : undefined,
|
|
240
|
-
operation: typeof row.operation === "string" ? row.operation : "update",
|
|
241
|
-
status: typeof row.status === "string" ? row.status : "pending",
|
|
242
|
-
risk: typeof row.risk === "string" ? row.risk : undefined,
|
|
243
|
-
createdAt:
|
|
244
|
-
typeof row.createdAt === "string" ? row.createdAt : undefined,
|
|
245
|
-
fields,
|
|
246
|
-
},
|
|
247
|
-
];
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
function isObject(value: unknown): value is Record<string, unknown> {
|
|
252
|
-
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
function displayValue(value: unknown) {
|
|
256
|
-
if (value === null || value === undefined || value === "") return "—";
|
|
257
|
-
if (typeof value === "string" || typeof value === "number")
|
|
258
|
-
return String(value);
|
|
259
|
-
if (typeof value === "boolean") return value ? "Yes" : "No";
|
|
260
|
-
return "Structured value";
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
function formatDate(value: string) {
|
|
264
|
-
const date = new Date(value);
|
|
265
|
-
return Number.isNaN(date.valueOf()) ? value : date.toLocaleString();
|
|
266
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useActionMutation,
|
|
3
|
-
useActionQuery,
|
|
4
|
-
} from "@agent-native/core/client/hooks";
|
|
5
|
-
import { useParams } from "react-router";
|
|
6
|
-
|
|
7
|
-
import { RecordActions } from "@/components/crm/RecordActions";
|
|
8
|
-
import { RecordWorkspace } from "@/components/crm/RecordWorkspace";
|
|
9
|
-
import { normalizeRecord, type CrmRecordDetail } from "@/lib/types";
|
|
10
|
-
|
|
11
|
-
export default function RecordRoute() {
|
|
12
|
-
const { recordId } = useParams();
|
|
13
|
-
const query = useActionQuery<unknown>(
|
|
14
|
-
"get-crm-record" as never,
|
|
15
|
-
{ recordId } as never,
|
|
16
|
-
{ enabled: Boolean(recordId) },
|
|
17
|
-
);
|
|
18
|
-
const manageTask = useActionMutation<
|
|
19
|
-
unknown,
|
|
20
|
-
{ taskId: string; status: "done" }
|
|
21
|
-
>("manage-crm-task" as never);
|
|
22
|
-
const summary = normalizeRecord(query.data, "account");
|
|
23
|
-
const detail = summary
|
|
24
|
-
? ({ ...summary, ...(query.data as object) } as CrmRecordDetail)
|
|
25
|
-
: undefined;
|
|
26
|
-
return (
|
|
27
|
-
<RecordWorkspace
|
|
28
|
-
record={detail}
|
|
29
|
-
isLoading={query.isLoading}
|
|
30
|
-
isCompletingTask={manageTask.isPending}
|
|
31
|
-
onCompleteTask={(taskId) => manageTask.mutate({ taskId, status: "done" })}
|
|
32
|
-
actions={detail ? <RecordActions record={detail} /> : undefined}
|
|
33
|
-
/>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { ChangelogSettingsCard } from "@agent-native/core/client/changelog";
|
|
2
|
-
import {
|
|
3
|
-
SettingsTabsPage,
|
|
4
|
-
useAgentSettingsTabs,
|
|
5
|
-
type SettingsTabItem,
|
|
6
|
-
} from "@agent-native/core/client/settings";
|
|
7
|
-
import { IconWaveSine } from "@tabler/icons-react";
|
|
8
|
-
import { useMemo } from "react";
|
|
9
|
-
import { useLocation } from "react-router";
|
|
10
|
-
|
|
11
|
-
import { IntelligenceSettings } from "@/components/crm/IntelligenceSettings";
|
|
12
|
-
|
|
13
|
-
import changelog from "../../CHANGELOG.md?raw";
|
|
14
|
-
|
|
15
|
-
export function meta() {
|
|
16
|
-
return [{ title: "CRM settings" }];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default function SettingsRoute() {
|
|
20
|
-
const location = useLocation();
|
|
21
|
-
const agentSettingsTabs = useAgentSettingsTabs();
|
|
22
|
-
const tabs = useMemo<SettingsTabItem[]>(
|
|
23
|
-
() => [
|
|
24
|
-
{
|
|
25
|
-
id: "intelligence",
|
|
26
|
-
label: "Intelligence",
|
|
27
|
-
icon: IconWaveSine,
|
|
28
|
-
keywords: "signals trackers keywords smart detectors call evidence",
|
|
29
|
-
content: <IntelligenceSettings />,
|
|
30
|
-
},
|
|
31
|
-
...agentSettingsTabs,
|
|
32
|
-
],
|
|
33
|
-
[agentSettingsTabs],
|
|
34
|
-
);
|
|
35
|
-
const defaultTab = location.pathname.includes("connections")
|
|
36
|
-
? "connections"
|
|
37
|
-
: location.pathname.includes("intelligence")
|
|
38
|
-
? "intelligence"
|
|
39
|
-
: "general";
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<SettingsTabsPage
|
|
43
|
-
defaultTab={defaultTab}
|
|
44
|
-
extraTabs={tabs}
|
|
45
|
-
general={
|
|
46
|
-
<div className="mx-auto w-full max-w-2xl space-y-3">
|
|
47
|
-
<h1 className="text-xl font-semibold tracking-tight">CRM settings</h1>
|
|
48
|
-
<p className="text-sm leading-6 text-muted-foreground">
|
|
49
|
-
Native SQL keeps CRM-owned records local and portable. HubSpot and
|
|
50
|
-
Salesforce use workspace Connections; their mirrors store only
|
|
51
|
-
allow-listed fields, scoped metadata, and bounded evidence
|
|
52
|
-
references.
|
|
53
|
-
</p>
|
|
54
|
-
</div>
|
|
55
|
-
}
|
|
56
|
-
whatsNew={
|
|
57
|
-
<div className="mx-auto w-full max-w-2xl">
|
|
58
|
-
<ChangelogSettingsCard markdown={changelog} />
|
|
59
|
-
</div>
|
|
60
|
-
}
|
|
61
|
-
/>
|
|
62
|
-
);
|
|
63
|
-
}
|