@agent-native/core 0.114.16 → 0.115.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/agent-native.eject.json +2 -0
- package/corpus/README.md +3 -3
- package/corpus/core/CHANGELOG.md +29 -0
- package/corpus/core/agent-native.eject.json +2 -0
- package/corpus/core/docs/content/agent-native-toolkit.mdx +16 -0
- package/corpus/core/docs/content/recurring-jobs.mdx +35 -6
- package/corpus/core/export-snapshot.json +4 -0
- package/corpus/core/package.json +5 -1
- package/corpus/core/src/action.ts +22 -1
- package/corpus/core/src/agent/production-agent.ts +105 -3
- package/corpus/core/src/cli/templates-meta.ts +12 -0
- package/corpus/core/src/client/AssistantChat.tsx +53 -26
- package/corpus/core/src/client/agent-page/AgentJobsTab.tsx +19 -0
- package/corpus/core/src/client/agent-page/use-jobs.ts +1 -0
- package/corpus/core/src/client/chat/message-components.tsx +35 -1
- package/corpus/core/src/client/chat/tool-call-display.tsx +38 -3
- package/corpus/core/src/connections/catalog.ts +20 -1
- package/corpus/core/src/connections/reader.ts +65 -0
- package/corpus/core/src/dashboard-storage/index.ts +27 -0
- package/corpus/core/src/dashboard-storage/panel-source.ts +168 -0
- package/corpus/core/src/dashboard-storage/schema.ts +62 -0
- package/corpus/core/src/dashboard-storage/store.ts +333 -0
- package/corpus/core/src/deploy/build.ts +95 -16
- package/corpus/core/src/eject/provider-api-definitions.ts +1 -0
- package/corpus/core/src/eject/workspace-connections.ts +1 -0
- package/corpus/core/src/extensions/actions.ts +199 -73
- package/corpus/core/src/jobs/actions/list-recurring-jobs.ts +2 -0
- package/corpus/core/src/jobs/scheduler.ts +71 -4
- package/corpus/core/src/jobs/tools.ts +31 -1
- package/corpus/core/src/localization/default-messages.ts +1 -0
- package/corpus/core/src/mcp-client/index.ts +6 -0
- package/corpus/core/src/provider-api/actions/provider-api.ts +1 -1
- package/corpus/core/src/provider-api/index.ts +190 -5
- package/corpus/core/src/secrets/register-framework-secrets.ts +8 -0
- package/corpus/core/src/server/agent-chat/context-tools.ts +9 -0
- package/corpus/core/src/server/agent-chat/framework-prompts.ts +2 -2
- package/corpus/core/src/server/agent-chat-plugin.ts +22 -2
- package/corpus/core/src/server/core-routes-plugin.ts +1 -0
- package/corpus/core/src/server/credential-provider.ts +9 -3
- package/corpus/core/src/server/workspace-provider-oauth.ts +181 -4
- package/corpus/core/src/styles/agent-native.css +45 -2
- package/corpus/core/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/corpus/core/src/templates/default/.agents/skills/app-branding/SKILL.md +159 -0
- package/corpus/core/src/templates/default/.agents/skills/app-permissions/SKILL.md +155 -0
- package/corpus/core/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +31 -18
- package/corpus/core/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +15 -0
- package/corpus/core/src/triggers/actions.ts +11 -2
- package/corpus/core/src/triggers/dispatcher.ts +20 -1
- package/corpus/core/src/triggers/types.ts +5 -0
- package/corpus/core/src/vite/action-types-plugin.ts +9 -1
- package/corpus/templates/analytics/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/analytics/AGENTS.md +11 -11
- package/corpus/templates/analytics/_gitignore +39 -0
- package/corpus/templates/analytics/actions/query-dashboard-panel.ts +30 -0
- package/corpus/templates/analytics/actions/update-dashboard.ts +2 -1
- package/corpus/templates/analytics/app/lib/sql-query.ts +11 -25
- package/corpus/templates/analytics/changelog/2026-07-21-fixed-extension-updates-failing-before-changes-could-be-appl.md +6 -0
- package/corpus/templates/analytics/server/lib/dashboard-panel-query.ts +1 -0
- package/corpus/templates/analytics/server/lib/dashboard-panel-source-resolver.ts +51 -0
- package/corpus/templates/analytics/server/lib/prometheus.ts +1 -1
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +1 -1
- package/corpus/templates/assets/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/brain/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/calendar/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/calendar/_gitignore +39 -0
- package/corpus/templates/chat/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/corpus/templates/chat/AGENTS.md +1 -1
- package/corpus/templates/clips/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/clips/AGENTS.md +7 -0
- package/corpus/templates/clips/actions/prepare-crm-call-evidence.ts +58 -0
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +88 -11
- package/corpus/templates/clips/changelog/2026-07-21-crm-call-evidence-handoff.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-21-recording-retries-and-restarts-keep-their-upload-session-so-.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/background.ts +20 -5
- package/corpus/templates/clips/chrome-extension/src/native-recording-state.ts +19 -0
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +8 -0
- package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +9 -0
- package/corpus/templates/clips/desktop/src-tauri/src/recording_indicator.rs +54 -28
- package/corpus/templates/clips/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/content/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/content/_gitignore +39 -0
- package/corpus/templates/content/learnings.defaults.md +5 -0
- package/corpus/templates/crm/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +133 -0
- package/corpus/templates/crm/.agents/skills/crm/SKILL.md +128 -0
- package/corpus/templates/crm/.agents/skills/customizing-agent-native/SKILL.md +145 -0
- package/corpus/templates/crm/.agents/skills/feature-flags/SKILL.md +169 -0
- package/corpus/templates/crm/.agents/skills/upgrade-agent-native/SKILL.md +100 -0
- package/corpus/templates/crm/.env.example +5 -0
- package/corpus/templates/crm/AGENTS.md +120 -0
- package/corpus/templates/crm/CHANGELOG.md +1 -0
- package/corpus/templates/crm/DEVELOPING.md +66 -0
- package/corpus/templates/crm/README.md +106 -0
- package/corpus/templates/crm/_gitignore +12 -0
- package/corpus/templates/crm/actions/_crm-action-utils.ts +87 -0
- package/corpus/templates/crm/actions/_crm-dashboard.ts +69 -0
- package/corpus/templates/crm/actions/_crm-signal-utils.ts +79 -0
- package/corpus/templates/crm/actions/apply-crm-proposals.ts +203 -0
- package/corpus/templates/crm/actions/attach-call-evidence.ts +170 -0
- package/corpus/templates/crm/actions/configure-crm-connection.ts +126 -0
- package/corpus/templates/crm/actions/configure-native-crm.ts +44 -0
- package/corpus/templates/crm/actions/create-crm-record.ts +148 -0
- package/corpus/templates/crm/actions/create-crm-signal-tracker.ts +58 -0
- package/corpus/templates/crm/actions/delete-staged-dataset.ts +14 -0
- package/corpus/templates/crm/actions/get-crm-automation-recipe.ts +36 -0
- package/corpus/templates/crm/actions/get-crm-dashboard-panel.ts +33 -0
- package/corpus/templates/crm/actions/get-crm-dashboard.ts +14 -0
- package/corpus/templates/crm/actions/get-crm-overview.ts +13 -0
- package/corpus/templates/crm/actions/get-crm-pipeline-data.ts +61 -0
- package/corpus/templates/crm/actions/get-crm-record.ts +75 -0
- package/corpus/templates/crm/actions/install-crm-pipeline-dashboard.ts +81 -0
- package/corpus/templates/crm/actions/list-crm-dashboard-revisions.ts +15 -0
- package/corpus/templates/crm/actions/list-crm-dashboards.ts +15 -0
- package/corpus/templates/crm/actions/list-crm-proposals.ts +31 -0
- package/corpus/templates/crm/actions/list-crm-records.ts +79 -0
- package/corpus/templates/crm/actions/list-crm-saved-views.ts +15 -0
- package/corpus/templates/crm/actions/list-crm-signal-hits.ts +43 -0
- package/corpus/templates/crm/actions/list-crm-signal-trackers.ts +32 -0
- package/corpus/templates/crm/actions/list-crm-tasks.ts +22 -0
- package/corpus/templates/crm/actions/list-staged-datasets.ts +14 -0
- package/corpus/templates/crm/actions/list-workspace-connections.ts +47 -0
- package/corpus/templates/crm/actions/manage-crm-signal-tracker.ts +87 -0
- package/corpus/templates/crm/actions/manage-crm-task.ts +132 -0
- package/corpus/templates/crm/actions/navigate.ts +63 -0
- package/corpus/templates/crm/actions/provider-api-catalog.ts +22 -0
- package/corpus/templates/crm/actions/provider-api-docs.ts +54 -0
- package/corpus/templates/crm/actions/provider-api-request.ts +92 -0
- package/corpus/templates/crm/actions/query-staged-dataset.ts +44 -0
- package/corpus/templates/crm/actions/record-crm-call-insight.ts +160 -0
- package/corpus/templates/crm/actions/record-crm-smart-signal.ts +150 -0
- package/corpus/templates/crm/actions/restore-crm-dashboard-revision.ts +23 -0
- package/corpus/templates/crm/actions/review-crm-signal.ts +31 -0
- package/corpus/templates/crm/actions/run-crm-saved-view-program.ts +103 -0
- package/corpus/templates/crm/actions/run-crm-signal-trackers.ts +275 -0
- package/corpus/templates/crm/actions/run.ts +11 -0
- package/corpus/templates/crm/actions/save-crm-dashboard.ts +51 -0
- package/corpus/templates/crm/actions/save-crm-saved-view.ts +119 -0
- package/corpus/templates/crm/actions/sync-crm.ts +146 -0
- package/corpus/templates/crm/actions/update-crm-record.ts +508 -0
- package/corpus/templates/crm/actions/view-screen.ts +218 -0
- package/corpus/templates/crm/agent-native.app-skill.json +58 -0
- package/corpus/templates/crm/app/components/crm/CreateCrmRecordDialog.tsx +158 -0
- package/corpus/templates/crm/app/components/crm/CrmDashboardPanel.tsx +83 -0
- package/corpus/templates/crm/app/components/crm/CrmSignalsPanel.tsx +225 -0
- package/corpus/templates/crm/app/components/crm/IntelligenceSettings.tsx +413 -0
- package/corpus/templates/crm/app/components/crm/RecordActions.tsx +510 -0
- package/corpus/templates/crm/app/components/crm/RecordGrid.tsx +134 -0
- package/corpus/templates/crm/app/components/crm/RecordWorkspace.tsx +367 -0
- package/corpus/templates/crm/app/components/crm/SavedViewDataProgram.tsx +92 -0
- package/corpus/templates/crm/app/components/crm/Surface.tsx +96 -0
- package/corpus/templates/crm/app/components/crm/WorkOverview.tsx +180 -0
- package/corpus/templates/crm/app/components/layout/CrmLayout.tsx +106 -0
- package/corpus/templates/crm/app/components/layout/CrmSidebar.tsx +84 -0
- package/corpus/templates/crm/app/entry.client.tsx +16 -0
- package/corpus/templates/crm/app/entry.server.tsx +10 -0
- package/corpus/templates/crm/app/global.css +167 -0
- package/corpus/templates/crm/app/hooks/use-navigation-state.ts +60 -0
- package/corpus/templates/crm/app/i18n/en-US.ts +89 -0
- package/corpus/templates/crm/app/i18n/index.ts +34 -0
- package/corpus/templates/crm/app/lib/dashboard.ts +13 -0
- package/corpus/templates/crm/app/lib/navigation.ts +54 -0
- package/corpus/templates/crm/app/lib/tab-id.ts +1 -0
- package/corpus/templates/crm/app/lib/types.ts +172 -0
- package/corpus/templates/crm/app/lib/utils.ts +1 -0
- package/corpus/templates/crm/app/root.tsx +88 -0
- package/corpus/templates/crm/app/routes/_index.tsx +26 -0
- package/corpus/templates/crm/app/routes/accounts.tsx +41 -0
- package/corpus/templates/crm/app/routes/agent.tsx +5 -0
- package/corpus/templates/crm/app/routes/ask.tsx +53 -0
- package/corpus/templates/crm/app/routes/dashboard.tsx +118 -0
- package/corpus/templates/crm/app/routes/opportunities.tsx +41 -0
- package/corpus/templates/crm/app/routes/people.tsx +41 -0
- package/corpus/templates/crm/app/routes/proposals.tsx +266 -0
- package/corpus/templates/crm/app/routes/records.$recordId.tsx +35 -0
- package/corpus/templates/crm/app/routes/settings.tsx +63 -0
- package/corpus/templates/crm/app/routes/setup.tsx +308 -0
- package/corpus/templates/crm/app/routes/tasks.tsx +252 -0
- package/corpus/templates/crm/app/routes/views.tsx +333 -0
- package/corpus/templates/crm/app/routes.ts +17 -0
- package/corpus/templates/crm/app/vite-env.d.ts +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-agent-native-crm.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-clips-call-evidence-review-recipe.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-crm-can-now-find-and-review-evidence-grounded-call-signals-w.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-crm-can-now-manage-keyword-and-smart-call-signal-trackers-fr.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-delegated-local-crm-automation.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-native-sql.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-pipeline-dashboard.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-pipeline-dashboards-now-install-correctly-from-the-crm-actio.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-salesforce-connection.md +6 -0
- package/corpus/templates/crm/components.json +20 -0
- package/corpus/templates/crm/docs/architecture/crm-contract.md +180 -0
- package/corpus/templates/crm/learnings.defaults.md +5 -0
- package/corpus/templates/crm/package.json +59 -0
- package/corpus/templates/crm/public/favicon.svg +1 -0
- package/corpus/templates/crm/public/icon-180.svg +1 -0
- package/corpus/templates/crm/public/manifest.json +11 -0
- package/corpus/templates/crm/react-router.config.ts +7 -0
- package/corpus/templates/crm/server/crm/adapter.ts +32 -0
- package/corpus/templates/crm/server/crm/crm-field-firewall.ts +64 -0
- package/corpus/templates/crm/server/crm/crm-mirror.ts +711 -0
- package/corpus/templates/crm/server/crm/hubspot-adapter.ts +1143 -0
- package/corpus/templates/crm/server/crm/native-adapter.ts +1715 -0
- package/corpus/templates/crm/server/crm/read-through.ts +207 -0
- package/corpus/templates/crm/server/crm/salesforce-adapter.ts +1255 -0
- package/corpus/templates/crm/server/db/crm-store.ts +1170 -0
- package/corpus/templates/crm/server/db/index.ts +169 -0
- package/corpus/templates/crm/server/db/schema.ts +441 -0
- package/corpus/templates/crm/server/lib/intelligence/default-detectors.ts +65 -0
- package/corpus/templates/crm/server/lib/intelligence/evidence.ts +105 -0
- package/corpus/templates/crm/server/lib/intelligence/keyword-detector.ts +100 -0
- package/corpus/templates/crm/server/lib/intelligence/smart-detector.ts +144 -0
- package/corpus/templates/crm/server/lib/intelligence/summary.ts +141 -0
- package/corpus/templates/crm/server/lib/provider-api.ts +64 -0
- package/corpus/templates/crm/server/middleware/auth.ts +4 -0
- package/corpus/templates/crm/server/plugins/agent-chat.ts +68 -0
- package/corpus/templates/crm/server/plugins/auth.ts +14 -0
- package/corpus/templates/crm/server/plugins/core-routes.ts +17 -0
- package/corpus/templates/crm/server/plugins/db.ts +454 -0
- package/corpus/templates/crm/server/routes/[...page].get.ts +5 -0
- package/corpus/templates/crm/shared/crm-automation-recipes.ts +132 -0
- package/corpus/templates/crm/shared/crm-contract.ts +254 -0
- package/corpus/templates/crm/shared/crm-sales-config.ts +63 -0
- package/corpus/templates/crm/ssr-entry.ts +11 -0
- package/corpus/templates/crm/tsconfig.json +24 -0
- package/corpus/templates/crm/vite.config.ts +15 -0
- package/corpus/templates/crm/vitest.config.ts +5 -0
- package/corpus/templates/design/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/dispatch/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/forms/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/forms/_gitignore +39 -0
- package/corpus/templates/forms/learnings.defaults.md +5 -0
- package/corpus/templates/macros/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/macros/_gitignore +39 -0
- package/corpus/templates/macros/learnings.defaults.md +5 -0
- package/corpus/templates/mail/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/mail/_gitignore +39 -0
- package/corpus/templates/plan/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/slides/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/slides/_gitignore +39 -0
- package/corpus/templates/tasks/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/corpus/templates/tasks/_gitignore +39 -0
- package/corpus/toolkit/CHANGELOG.md +12 -0
- package/corpus/toolkit/README.md +30 -0
- package/corpus/toolkit/agent-native.eject.json +33 -0
- package/corpus/toolkit/package.json +15 -1
- package/corpus/toolkit/src/dashboard/DataTable.tsx +273 -0
- package/corpus/toolkit/src/dashboard/DateRangePicker.tsx +57 -0
- package/corpus/toolkit/src/dashboard/GenericChartPanel.tsx +461 -0
- package/corpus/toolkit/src/dashboard/MetricCard.tsx +54 -0
- package/corpus/toolkit/src/dashboard/StatsCard.tsx +49 -0
- package/corpus/toolkit/src/dashboard/dashboard-layout.ts +329 -0
- package/corpus/toolkit/src/dashboard/index.ts +6 -0
- package/corpus/toolkit/src/index.ts +1 -0
- package/corpus/toolkit/src/ui/calendar.tsx +8 -8
- package/corpus/toolkit/src/ui/date-picker.tsx +4 -1
- package/dist/action.d.ts +14 -1
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js.map +1 -1
- package/dist/agent/production-agent.d.ts +3 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +83 -3
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/cli/templates-meta.d.ts.map +1 -1
- package/dist/cli/templates-meta.js +12 -0
- package/dist/cli/templates-meta.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +4 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +30 -17
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/agent-page/AgentJobsTab.d.ts.map +1 -1
- package/dist/client/agent-page/AgentJobsTab.js +3 -1
- package/dist/client/agent-page/AgentJobsTab.js.map +1 -1
- package/dist/client/agent-page/use-jobs.d.ts +1 -0
- package/dist/client/agent-page/use-jobs.d.ts.map +1 -1
- package/dist/client/agent-page/use-jobs.js.map +1 -1
- package/dist/client/chat/message-components.d.ts +5 -0
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +17 -1
- 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 +17 -7
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/connections/catalog.d.ts +17 -3
- package/dist/connections/catalog.d.ts.map +1 -1
- package/dist/connections/catalog.js +16 -1
- package/dist/connections/catalog.js.map +1 -1
- package/dist/connections/reader.d.ts +18 -0
- package/dist/connections/reader.d.ts.map +1 -1
- package/dist/connections/reader.js +41 -0
- package/dist/connections/reader.js.map +1 -1
- package/dist/dashboard-storage/index.d.ts +4 -0
- package/dist/dashboard-storage/index.d.ts.map +1 -0
- package/dist/dashboard-storage/index.js +4 -0
- package/dist/dashboard-storage/index.js.map +1 -0
- package/dist/dashboard-storage/panel-source.d.ts +68 -0
- package/dist/dashboard-storage/panel-source.d.ts.map +1 -0
- package/dist/dashboard-storage/panel-source.js +76 -0
- package/dist/dashboard-storage/panel-source.js.map +1 -0
- package/dist/dashboard-storage/schema.d.ts +562 -0
- package/dist/dashboard-storage/schema.d.ts.map +1 -0
- package/dist/dashboard-storage/schema.js +32 -0
- package/dist/dashboard-storage/schema.js.map +1 -0
- package/dist/dashboard-storage/store.d.ts +62 -0
- package/dist/dashboard-storage/store.d.ts.map +1 -0
- package/dist/dashboard-storage/store.js +227 -0
- package/dist/dashboard-storage/store.js.map +1 -0
- package/dist/deploy/build.d.ts +7 -0
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +78 -14
- package/dist/deploy/build.js.map +1 -1
- package/dist/eject/provider-api-definitions.d.ts +2 -1
- package/dist/eject/provider-api-definitions.d.ts.map +1 -1
- package/dist/eject/provider-api-definitions.js +1 -0
- package/dist/eject/provider-api-definitions.js.map +1 -1
- package/dist/eject/workspace-connections.d.ts.map +1 -1
- package/dist/eject/workspace-connections.js +1 -0
- package/dist/eject/workspace-connections.js.map +1 -1
- package/dist/extensions/actions.d.ts.map +1 -1
- package/dist/extensions/actions.js +165 -67
- package/dist/extensions/actions.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/jobs/actions/list-recurring-jobs.d.ts +1 -0
- package/dist/jobs/actions/list-recurring-jobs.d.ts.map +1 -1
- package/dist/jobs/actions/list-recurring-jobs.js +1 -0
- package/dist/jobs/actions/list-recurring-jobs.js.map +1 -1
- package/dist/jobs/scheduler.d.ts +17 -2
- package/dist/jobs/scheduler.d.ts.map +1 -1
- package/dist/jobs/scheduler.js +51 -2
- package/dist/jobs/scheduler.js.map +1 -1
- package/dist/jobs/tools.d.ts.map +1 -1
- package/dist/jobs/tools.js +32 -2
- package/dist/jobs/tools.js.map +1 -1
- package/dist/localization/default-messages.d.ts +1 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +1 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp-client/index.d.ts +2 -0
- package/dist/mcp-client/index.d.ts.map +1 -1
- package/dist/mcp-client/index.js +5 -0
- package/dist/mcp-client/index.js.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +5 -5
- package/dist/provider-api/actions/custom-provider-registration.d.ts +8 -8
- package/dist/provider-api/actions/provider-api.d.ts +8 -6
- package/dist/provider-api/actions/provider-api.d.ts.map +1 -1
- package/dist/provider-api/actions/provider-api.js +1 -1
- package/dist/provider-api/actions/provider-api.js.map +1 -1
- package/dist/provider-api/index.d.ts +11 -7
- package/dist/provider-api/index.d.ts.map +1 -1
- package/dist/provider-api/index.js +143 -5
- package/dist/provider-api/index.js.map +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/register-framework-secrets.d.ts.map +1 -1
- package/dist/secrets/register-framework-secrets.js +7 -0
- package/dist/secrets/register-framework-secrets.js.map +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/agent-chat/context-tools.d.ts.map +1 -1
- package/dist/server/agent-chat/context-tools.js +9 -0
- package/dist/server/agent-chat/context-tools.js.map +1 -1
- package/dist/server/agent-chat/framework-prompts.js +2 -2
- package/dist/server/agent-chat/framework-prompts.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +18 -2
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +1 -0
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/credential-provider.d.ts +4 -3
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +9 -3
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/server/workspace-provider-oauth.d.ts +6 -1
- package/dist/server/workspace-provider-oauth.d.ts.map +1 -1
- package/dist/server/workspace-provider-oauth.js +141 -4
- package/dist/server/workspace-provider-oauth.js.map +1 -1
- package/dist/styles/agent-native.css +45 -2
- package/dist/templates/chat/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/dist/templates/chat/AGENTS.md +1 -1
- package/dist/templates/default/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/dist/templates/default/.agents/skills/app-branding/SKILL.md +159 -0
- package/dist/templates/default/.agents/skills/app-permissions/SKILL.md +155 -0
- package/dist/templates/headless/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/dist/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +31 -18
- package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +15 -0
- package/dist/triggers/actions.d.ts.map +1 -1
- package/dist/triggers/actions.js +10 -2
- package/dist/triggers/actions.js.map +1 -1
- package/dist/triggers/dispatcher.d.ts.map +1 -1
- package/dist/triggers/dispatcher.js +15 -0
- package/dist/triggers/dispatcher.js.map +1 -1
- package/dist/triggers/types.d.ts +5 -0
- package/dist/triggers/types.d.ts.map +1 -1
- package/dist/triggers/types.js.map +1 -1
- package/dist/vite/action-types-plugin.d.ts.map +1 -1
- package/dist/vite/action-types-plugin.js +4 -1
- package/dist/vite/action-types-plugin.js.map +1 -1
- package/docs/content/agent-native-toolkit.mdx +16 -0
- package/docs/content/recurring-jobs.mdx +35 -6
- package/package.json +6 -2
- package/src/action.ts +22 -1
- package/src/agent/production-agent.ts +105 -3
- package/src/cli/templates-meta.ts +12 -0
- package/src/client/AssistantChat.tsx +53 -26
- package/src/client/agent-page/AgentJobsTab.tsx +19 -0
- package/src/client/agent-page/use-jobs.ts +1 -0
- package/src/client/chat/message-components.tsx +35 -1
- package/src/client/chat/tool-call-display.tsx +38 -3
- package/src/connections/catalog.ts +20 -1
- package/src/connections/reader.ts +65 -0
- package/src/dashboard-storage/index.ts +27 -0
- package/src/dashboard-storage/panel-source.ts +168 -0
- package/src/dashboard-storage/schema.ts +62 -0
- package/src/dashboard-storage/store.ts +333 -0
- package/src/deploy/build.ts +95 -16
- package/src/eject/provider-api-definitions.ts +1 -0
- package/src/eject/workspace-connections.ts +1 -0
- package/src/extensions/actions.ts +199 -73
- package/src/jobs/actions/list-recurring-jobs.ts +2 -0
- package/src/jobs/scheduler.ts +71 -4
- package/src/jobs/tools.ts +31 -1
- package/src/localization/default-messages.ts +1 -0
- package/src/mcp-client/index.ts +6 -0
- package/src/provider-api/actions/provider-api.ts +1 -1
- package/src/provider-api/index.ts +190 -5
- package/src/secrets/register-framework-secrets.ts +8 -0
- package/src/server/agent-chat/context-tools.ts +9 -0
- package/src/server/agent-chat/framework-prompts.ts +2 -2
- package/src/server/agent-chat-plugin.ts +22 -2
- package/src/server/core-routes-plugin.ts +1 -0
- package/src/server/credential-provider.ts +9 -3
- package/src/server/workspace-provider-oauth.ts +181 -4
- package/src/styles/agent-native.css +45 -2
- package/src/templates/chat/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/src/templates/chat/AGENTS.md +1 -1
- package/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/src/templates/default/.agents/skills/app-branding/SKILL.md +159 -0
- package/src/templates/default/.agents/skills/app-permissions/SKILL.md +155 -0
- package/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +31 -18
- package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +15 -0
- package/src/triggers/actions.ts +11 -2
- package/src/triggers/dispatcher.ts +20 -1
- package/src/triggers/types.ts +5 -0
- package/src/vite/action-types-plugin.ts +9 -1
- package/corpus/templates/analytics/server/handlers/sql-query.ts +0 -36
- package/corpus/templates/analytics/server/routes/api/sql-query.post.ts +0 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useActionMutation,
|
|
3
|
+
useActionQuery,
|
|
4
|
+
} from "@agent-native/core/client/hooks";
|
|
5
|
+
import { useT } from "@agent-native/core/client/i18n";
|
|
6
|
+
import { Button } from "@agent-native/toolkit/ui/button";
|
|
7
|
+
import { IconRefresh } from "@tabler/icons-react";
|
|
8
|
+
import { useMemo } from "react";
|
|
9
|
+
import { useNavigate, useSearchParams } from "react-router";
|
|
10
|
+
import { toast } from "sonner";
|
|
11
|
+
|
|
12
|
+
import { CrmDashboardPanel } from "@/components/crm/CrmDashboardPanel";
|
|
13
|
+
import { PageHeader, SetupEmptyState } from "@/components/crm/Surface";
|
|
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
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useActionMutation,
|
|
3
|
+
useActionQuery,
|
|
4
|
+
} from "@agent-native/core/client/hooks";
|
|
5
|
+
import {
|
|
6
|
+
AlertDialog,
|
|
7
|
+
AlertDialogAction,
|
|
8
|
+
AlertDialogCancel,
|
|
9
|
+
AlertDialogContent,
|
|
10
|
+
AlertDialogDescription,
|
|
11
|
+
AlertDialogFooter,
|
|
12
|
+
AlertDialogHeader,
|
|
13
|
+
AlertDialogTitle,
|
|
14
|
+
AlertDialogTrigger,
|
|
15
|
+
} from "@agent-native/toolkit/ui/alert-dialog";
|
|
16
|
+
import { Badge } from "@agent-native/toolkit/ui/badge";
|
|
17
|
+
import { Button } from "@agent-native/toolkit/ui/button";
|
|
18
|
+
import { IconExternalLink, IconShieldCheck } from "@tabler/icons-react";
|
|
19
|
+
import { useState } from "react";
|
|
20
|
+
import { Link } from "react-router";
|
|
21
|
+
import { toast } from "sonner";
|
|
22
|
+
|
|
23
|
+
import {
|
|
24
|
+
LoadingRows,
|
|
25
|
+
PageHeader,
|
|
26
|
+
SetupEmptyState,
|
|
27
|
+
} from "@/components/crm/Surface";
|
|
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
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
}
|