@agent-native/core 0.114.16 → 0.115.3
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 +41 -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 +122 -3
- package/corpus/core/src/cli/skills-content/visual-plan-skill.ts +19 -2
- 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/blocks/library/wireframe.tsx +3 -1
- 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/plan/.agents/skills/visual-plan/SKILL.md +19 -2
- package/corpus/templates/plan/AGENTS.md +10 -0
- package/corpus/templates/plan/actions/create-prototype-plan.ts +27 -3
- package/corpus/templates/plan/actions/get-plan-blocks.ts +1 -1
- package/corpus/templates/plan/actions/update-visual-plan.ts +3 -2
- package/corpus/templates/plan/app/components/plan/PlanContentRenderer.tsx +18 -4
- package/corpus/templates/plan/app/components/plan/PlanVisualSurface.tsx +10 -3
- package/corpus/templates/plan/app/components/plan/wireframe/Wireframe.tsx +3 -1
- package/corpus/templates/plan/app/i18n/en-US.ts +6 -0
- package/corpus/templates/plan/app/lib/create-plan-routing.ts +39 -0
- package/corpus/templates/plan/app/pages/PlansPage.tsx +31 -107
- package/corpus/templates/plan/changelog/2026-07-22-high-fidelity-mockup-requests-now-preserve-branded-css-use-d.md +6 -0
- package/corpus/templates/plan/shared/plan-content.ts +110 -2
- 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 +97 -3
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/cli/skills-content/visual-plan-skill.d.ts +1 -1
- package/dist/cli/skills-content/visual-plan-skill.d.ts.map +1 -1
- package/dist/cli/skills-content/visual-plan-skill.js +19 -2
- package/dist/cli/skills-content/visual-plan-skill.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/blocks/library/wireframe.d.ts.map +1 -1
- package/dist/client/blocks/library/wireframe.js +3 -2
- package/dist/client/blocks/library/wireframe.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/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/progress/routes.d.ts +1 -1
- 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/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/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 +7 -3
- package/src/action.ts +22 -1
- package/src/agent/production-agent.ts +122 -3
- package/src/cli/skills-content/visual-plan-skill.ts +19 -2
- 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/blocks/library/wireframe.tsx +3 -1
- 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,367 @@
|
|
|
1
|
+
import { Badge } from "@agent-native/toolkit/ui/badge";
|
|
2
|
+
import { Button } from "@agent-native/toolkit/ui/button";
|
|
3
|
+
import {
|
|
4
|
+
Tabs,
|
|
5
|
+
TabsContent,
|
|
6
|
+
TabsList,
|
|
7
|
+
TabsTrigger,
|
|
8
|
+
} from "@agent-native/toolkit/ui/tabs";
|
|
9
|
+
import {
|
|
10
|
+
IconChecklist,
|
|
11
|
+
IconExternalLink,
|
|
12
|
+
IconFileSearch,
|
|
13
|
+
IconHistory,
|
|
14
|
+
IconNotes,
|
|
15
|
+
IconSparkles,
|
|
16
|
+
} from "@tabler/icons-react";
|
|
17
|
+
import { useMemo } from "react";
|
|
18
|
+
import { Link } from "react-router";
|
|
19
|
+
|
|
20
|
+
import { CrmSignalsPanel } from "@/components/crm/CrmSignalsPanel";
|
|
21
|
+
import { LoadingRows, SetupEmptyState } from "@/components/crm/Surface";
|
|
22
|
+
import {
|
|
23
|
+
asText,
|
|
24
|
+
normalizeTasks,
|
|
25
|
+
recordId,
|
|
26
|
+
type CrmRecordDetail,
|
|
27
|
+
} from "@/lib/types";
|
|
28
|
+
|
|
29
|
+
export function RecordWorkspace({
|
|
30
|
+
record,
|
|
31
|
+
isLoading,
|
|
32
|
+
onCompleteTask,
|
|
33
|
+
isCompletingTask,
|
|
34
|
+
actions,
|
|
35
|
+
}: {
|
|
36
|
+
record: CrmRecordDetail | undefined;
|
|
37
|
+
isLoading: boolean;
|
|
38
|
+
onCompleteTask: (taskId: string) => void;
|
|
39
|
+
isCompletingTask: boolean;
|
|
40
|
+
actions?: React.ReactNode;
|
|
41
|
+
}) {
|
|
42
|
+
const details = useMemo(
|
|
43
|
+
() =>
|
|
44
|
+
Object.entries(record?.fields ?? {})
|
|
45
|
+
.filter(([, value]) => typeof value !== "object" || value === null)
|
|
46
|
+
.slice(0, 10),
|
|
47
|
+
[record?.fields],
|
|
48
|
+
);
|
|
49
|
+
const tasks = normalizeTasks(record?.tasks);
|
|
50
|
+
|
|
51
|
+
if (isLoading) return <LoadingRows rows={8} />;
|
|
52
|
+
if (!record)
|
|
53
|
+
return (
|
|
54
|
+
<SetupEmptyState
|
|
55
|
+
title="This CRM record is unavailable"
|
|
56
|
+
description="It may have been archived, removed from a connected scope, or no longer shared with you."
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div className="min-h-full">
|
|
62
|
+
<header className="border-b border-border/70 px-5 py-5 sm:px-7">
|
|
63
|
+
<div className="flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
|
|
64
|
+
<span className="capitalize">{record.kind}</span>
|
|
65
|
+
{record.stage ? (
|
|
66
|
+
<>
|
|
67
|
+
<span>•</span>
|
|
68
|
+
<Badge variant="secondary" className="font-normal">
|
|
69
|
+
{record.stage}
|
|
70
|
+
</Badge>
|
|
71
|
+
</>
|
|
72
|
+
) : null}
|
|
73
|
+
</div>
|
|
74
|
+
<div className="mt-2 flex flex-wrap items-start justify-between gap-4">
|
|
75
|
+
<div>
|
|
76
|
+
<h1 className="text-2xl font-semibold tracking-tight">
|
|
77
|
+
{record.displayName}
|
|
78
|
+
</h1>
|
|
79
|
+
{record.subtitle ? (
|
|
80
|
+
<p className="mt-1 text-sm text-muted-foreground">
|
|
81
|
+
{record.subtitle}
|
|
82
|
+
</p>
|
|
83
|
+
) : null}
|
|
84
|
+
</div>
|
|
85
|
+
<div className="grid justify-items-end gap-3">
|
|
86
|
+
{record.owner ? (
|
|
87
|
+
<p className="text-sm text-muted-foreground">
|
|
88
|
+
Owner · {record.owner}
|
|
89
|
+
</p>
|
|
90
|
+
) : null}
|
|
91
|
+
{actions}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</header>
|
|
95
|
+
<Tabs defaultValue="details" className="px-5 py-5 sm:px-7">
|
|
96
|
+
<TabsList className="h-9 bg-muted/70">
|
|
97
|
+
<TabsTrigger value="details" className="gap-1.5">
|
|
98
|
+
<IconNotes className="size-3.5" />
|
|
99
|
+
Details
|
|
100
|
+
</TabsTrigger>
|
|
101
|
+
<TabsTrigger value="cadence">Cadence</TabsTrigger>
|
|
102
|
+
<TabsTrigger value="evidence" className="gap-1.5">
|
|
103
|
+
<IconFileSearch className="size-3.5" />
|
|
104
|
+
Evidence
|
|
105
|
+
</TabsTrigger>
|
|
106
|
+
<TabsTrigger value="signals" className="gap-1.5">
|
|
107
|
+
<IconSparkles className="size-3.5" />
|
|
108
|
+
Signals
|
|
109
|
+
</TabsTrigger>
|
|
110
|
+
<TabsTrigger value="activity" className="gap-1.5">
|
|
111
|
+
<IconHistory className="size-3.5" />
|
|
112
|
+
Activity
|
|
113
|
+
</TabsTrigger>
|
|
114
|
+
<TabsTrigger value="tasks" className="gap-1.5">
|
|
115
|
+
<IconChecklist className="size-3.5" />
|
|
116
|
+
Tasks
|
|
117
|
+
</TabsTrigger>
|
|
118
|
+
</TabsList>
|
|
119
|
+
<TabsContent value="details" className="mt-5 max-w-3xl">
|
|
120
|
+
<SectionTitle
|
|
121
|
+
title="Details"
|
|
122
|
+
description="Permitted fields owned locally or mirrored from a connected CRM."
|
|
123
|
+
/>
|
|
124
|
+
<dl className="mt-4 divide-y divide-border rounded-lg border border-border/70 bg-card">
|
|
125
|
+
{details.length ? (
|
|
126
|
+
details.map(([key, value]) => (
|
|
127
|
+
<div
|
|
128
|
+
key={key}
|
|
129
|
+
className="grid grid-cols-[minmax(9rem,0.45fr)_minmax(0,1fr)] gap-4 px-4 py-3"
|
|
130
|
+
>
|
|
131
|
+
<dt className="text-sm text-muted-foreground">
|
|
132
|
+
{displayFieldName(key)}
|
|
133
|
+
</dt>
|
|
134
|
+
<dd className="break-words text-sm">{displayValue(value)}</dd>
|
|
135
|
+
</div>
|
|
136
|
+
))
|
|
137
|
+
) : (
|
|
138
|
+
<EmptyCopy text="No permitted fields are mirrored for this record." />
|
|
139
|
+
)}
|
|
140
|
+
</dl>
|
|
141
|
+
<div className="mt-6">
|
|
142
|
+
<SectionTitle
|
|
143
|
+
title="Related records"
|
|
144
|
+
description="Permitted records linked in this CRM workspace."
|
|
145
|
+
/>
|
|
146
|
+
<div className="mt-4 divide-y divide-border rounded-lg border border-border/70 bg-card">
|
|
147
|
+
{record.relatedRecords?.length ? (
|
|
148
|
+
record.relatedRecords.map((related) => (
|
|
149
|
+
<Link
|
|
150
|
+
key={`${related.id}:${related.relationshipType}`}
|
|
151
|
+
to={`/records/${encodeURIComponent(related.id)}`}
|
|
152
|
+
className="flex items-center gap-3 px-4 py-3 transition-colors hover:bg-muted/50"
|
|
153
|
+
>
|
|
154
|
+
<div className="min-w-0 flex-1">
|
|
155
|
+
<p className="truncate text-sm font-medium">
|
|
156
|
+
{related.displayName}
|
|
157
|
+
</p>
|
|
158
|
+
<p className="mt-0.5 truncate text-xs text-muted-foreground">
|
|
159
|
+
{[
|
|
160
|
+
related.relationshipLabel ?? related.relationshipType,
|
|
161
|
+
related.subtitle,
|
|
162
|
+
]
|
|
163
|
+
.filter(Boolean)
|
|
164
|
+
.join(" · ")}
|
|
165
|
+
</p>
|
|
166
|
+
</div>
|
|
167
|
+
<Badge
|
|
168
|
+
variant="secondary"
|
|
169
|
+
className="capitalize font-normal"
|
|
170
|
+
>
|
|
171
|
+
{related.kind}
|
|
172
|
+
</Badge>
|
|
173
|
+
</Link>
|
|
174
|
+
))
|
|
175
|
+
) : (
|
|
176
|
+
<EmptyCopy text="No permitted linked records are available." />
|
|
177
|
+
)}
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
</TabsContent>
|
|
181
|
+
<TabsContent value="cadence" className="mt-5 max-w-3xl">
|
|
182
|
+
<SectionTitle
|
|
183
|
+
title="Cadence"
|
|
184
|
+
description="The next contact rhythm is based on permitted CRM activity."
|
|
185
|
+
/>
|
|
186
|
+
<div className="mt-4 grid gap-3 rounded-lg border border-border/70 bg-card p-4 sm:grid-cols-3">
|
|
187
|
+
<Metric label="Cadence" value={record.cadence ?? "Not set"} />
|
|
188
|
+
<Metric
|
|
189
|
+
label="Next step"
|
|
190
|
+
value={record.nextStep ?? "No next step"}
|
|
191
|
+
/>
|
|
192
|
+
<Metric
|
|
193
|
+
label="Last updated"
|
|
194
|
+
value={
|
|
195
|
+
record.updatedAt ? formatDate(record.updatedAt) : "Unknown"
|
|
196
|
+
}
|
|
197
|
+
/>
|
|
198
|
+
</div>
|
|
199
|
+
</TabsContent>
|
|
200
|
+
<TabsContent value="evidence" className="mt-5 max-w-3xl">
|
|
201
|
+
<SectionTitle
|
|
202
|
+
title="Evidence"
|
|
203
|
+
description="Bounded references supporting CRM context."
|
|
204
|
+
/>
|
|
205
|
+
<div className="mt-4 divide-y divide-border rounded-lg border border-border/70 bg-card">
|
|
206
|
+
{record.evidence?.length ? (
|
|
207
|
+
record.evidence.map((evidence) => (
|
|
208
|
+
<div key={evidence.id} className="px-4 py-3">
|
|
209
|
+
<div className="flex items-start justify-between gap-3">
|
|
210
|
+
<p className="text-sm font-medium">{evidence.label}</p>
|
|
211
|
+
{evidence.url ? (
|
|
212
|
+
<a
|
|
213
|
+
href={evidence.url}
|
|
214
|
+
target="_blank"
|
|
215
|
+
rel="noreferrer"
|
|
216
|
+
className="text-muted-foreground hover:text-foreground"
|
|
217
|
+
aria-label={`Open ${evidence.label}`}
|
|
218
|
+
>
|
|
219
|
+
<IconExternalLink className="size-4" />
|
|
220
|
+
</a>
|
|
221
|
+
) : null}
|
|
222
|
+
</div>
|
|
223
|
+
{evidence.quote ? (
|
|
224
|
+
<p className="mt-1 text-sm leading-6 text-muted-foreground">
|
|
225
|
+
{evidence.quote}
|
|
226
|
+
</p>
|
|
227
|
+
) : null}
|
|
228
|
+
</div>
|
|
229
|
+
))
|
|
230
|
+
) : (
|
|
231
|
+
<EmptyCopy text="No evidence references are available yet." />
|
|
232
|
+
)}
|
|
233
|
+
</div>
|
|
234
|
+
</TabsContent>
|
|
235
|
+
<TabsContent value="signals" className="mt-5">
|
|
236
|
+
<CrmSignalsPanel
|
|
237
|
+
recordId={record.id}
|
|
238
|
+
evidence={record.evidence ?? []}
|
|
239
|
+
/>
|
|
240
|
+
</TabsContent>
|
|
241
|
+
<TabsContent value="activity" className="mt-5 max-w-3xl">
|
|
242
|
+
<SectionTitle
|
|
243
|
+
title="Activity"
|
|
244
|
+
description="Recent permitted interaction metadata."
|
|
245
|
+
/>
|
|
246
|
+
<div className="mt-4 divide-y divide-border rounded-lg border border-border/70 bg-card">
|
|
247
|
+
{record.activity?.length ? (
|
|
248
|
+
record.activity.map((activity) => (
|
|
249
|
+
<div key={activity.id} className="px-4 py-3">
|
|
250
|
+
<p className="text-sm font-medium">{activity.title}</p>
|
|
251
|
+
{activity.summary ? (
|
|
252
|
+
<p className="mt-1 text-sm text-muted-foreground">
|
|
253
|
+
{activity.summary}
|
|
254
|
+
</p>
|
|
255
|
+
) : null}
|
|
256
|
+
<p className="mt-2 text-xs text-muted-foreground">
|
|
257
|
+
{[
|
|
258
|
+
activity.actor,
|
|
259
|
+
activity.occurredAt
|
|
260
|
+
? formatDate(activity.occurredAt)
|
|
261
|
+
: undefined,
|
|
262
|
+
]
|
|
263
|
+
.filter(Boolean)
|
|
264
|
+
.join(" · ")}
|
|
265
|
+
</p>
|
|
266
|
+
</div>
|
|
267
|
+
))
|
|
268
|
+
) : (
|
|
269
|
+
<EmptyCopy text="No recent activity is available." />
|
|
270
|
+
)}
|
|
271
|
+
</div>
|
|
272
|
+
</TabsContent>
|
|
273
|
+
<TabsContent value="tasks" className="mt-5 max-w-3xl">
|
|
274
|
+
<SectionTitle
|
|
275
|
+
title="Tasks"
|
|
276
|
+
description="Keep follow-up work connected to the record."
|
|
277
|
+
/>
|
|
278
|
+
<div className="mt-4 divide-y divide-border rounded-lg border border-border/70 bg-card">
|
|
279
|
+
{tasks.length ? (
|
|
280
|
+
tasks.map((task) => (
|
|
281
|
+
<div
|
|
282
|
+
key={task.id}
|
|
283
|
+
className="flex items-center gap-3 px-4 py-3"
|
|
284
|
+
>
|
|
285
|
+
<div className="min-w-0 flex-1">
|
|
286
|
+
<p className="text-sm font-medium">{task.title}</p>
|
|
287
|
+
<p className="mt-0.5 text-xs text-muted-foreground">
|
|
288
|
+
{task.dueAt
|
|
289
|
+
? `Due ${formatDate(task.dueAt)}`
|
|
290
|
+
: task.status}
|
|
291
|
+
</p>
|
|
292
|
+
</div>
|
|
293
|
+
{task.status !== "done" ? (
|
|
294
|
+
<Button
|
|
295
|
+
variant="outline"
|
|
296
|
+
size="sm"
|
|
297
|
+
disabled={isCompletingTask}
|
|
298
|
+
onClick={() => onCompleteTask(task.id)}
|
|
299
|
+
>
|
|
300
|
+
Complete
|
|
301
|
+
</Button>
|
|
302
|
+
) : (
|
|
303
|
+
<Badge variant="secondary">Done</Badge>
|
|
304
|
+
)}
|
|
305
|
+
</div>
|
|
306
|
+
))
|
|
307
|
+
) : (
|
|
308
|
+
<EmptyCopy text="No follow-up tasks are attached to this record." />
|
|
309
|
+
)}
|
|
310
|
+
</div>
|
|
311
|
+
</TabsContent>
|
|
312
|
+
</Tabs>
|
|
313
|
+
</div>
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function SectionTitle({
|
|
318
|
+
title,
|
|
319
|
+
description,
|
|
320
|
+
}: {
|
|
321
|
+
title: string;
|
|
322
|
+
description: string;
|
|
323
|
+
}) {
|
|
324
|
+
return (
|
|
325
|
+
<div>
|
|
326
|
+
<h2 className="text-sm font-semibold">{title}</h2>
|
|
327
|
+
<p className="mt-1 text-sm text-muted-foreground">{description}</p>
|
|
328
|
+
</div>
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
function Metric({ label, value }: { label: string; value: string }) {
|
|
332
|
+
return (
|
|
333
|
+
<div>
|
|
334
|
+
<p className="text-xs font-medium uppercase tracking-[0.1em] text-muted-foreground">
|
|
335
|
+
{label}
|
|
336
|
+
</p>
|
|
337
|
+
<p className="mt-1 text-sm font-medium">{value}</p>
|
|
338
|
+
</div>
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
function EmptyCopy({ text }: { text: string }) {
|
|
342
|
+
return (
|
|
343
|
+
<p className="px-4 py-8 text-center text-sm text-muted-foreground">
|
|
344
|
+
{text}
|
|
345
|
+
</p>
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
function displayFieldName(value: string) {
|
|
349
|
+
return value
|
|
350
|
+
.replace(/([A-Z])/g, " $1")
|
|
351
|
+
.replace(/_/g, " ")
|
|
352
|
+
.replace(/^./, (letter: string) => letter.toUpperCase());
|
|
353
|
+
}
|
|
354
|
+
function displayValue(value: unknown) {
|
|
355
|
+
if (typeof value === "boolean") return value ? "Yes" : "No";
|
|
356
|
+
return asText(value) ?? String(value ?? "—");
|
|
357
|
+
}
|
|
358
|
+
function formatDate(value: string) {
|
|
359
|
+
const date = new Date(value);
|
|
360
|
+
return Number.isNaN(date.valueOf())
|
|
361
|
+
? value
|
|
362
|
+
: date.toLocaleDateString(undefined, {
|
|
363
|
+
month: "short",
|
|
364
|
+
day: "numeric",
|
|
365
|
+
year: "numeric",
|
|
366
|
+
});
|
|
367
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useActionMutation } from "@agent-native/core/client/hooks";
|
|
2
|
+
import { DataTable } from "@agent-native/toolkit/dashboard";
|
|
3
|
+
import { Badge } from "@agent-native/toolkit/ui/badge";
|
|
4
|
+
import { IconChartDots } from "@tabler/icons-react";
|
|
5
|
+
import { useEffect, useRef } from "react";
|
|
6
|
+
|
|
7
|
+
interface ProgramPreview {
|
|
8
|
+
ok: boolean;
|
|
9
|
+
rowCount?: number;
|
|
10
|
+
columns?: Array<{ name: string; type: string }>;
|
|
11
|
+
sampleRows?: Array<Record<string, unknown>>;
|
|
12
|
+
asOfMs?: number;
|
|
13
|
+
cacheHit?: boolean;
|
|
14
|
+
stale?: boolean;
|
|
15
|
+
truncated?: boolean;
|
|
16
|
+
message?: string;
|
|
17
|
+
lastGoodRun?: {
|
|
18
|
+
rowCount: number;
|
|
19
|
+
columns: Array<{ name: string; type: string }>;
|
|
20
|
+
sampleRows: Array<Record<string, unknown>>;
|
|
21
|
+
truncated: boolean;
|
|
22
|
+
asOfMs: number;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function SavedViewDataProgram({ data }: { data: unknown }) {
|
|
27
|
+
const viewId = linkedProgramViewId(data);
|
|
28
|
+
const lastRunViewId = useRef<string | undefined>(undefined);
|
|
29
|
+
const run = useActionMutation<ProgramPreview, { viewId: string }>(
|
|
30
|
+
"run-crm-saved-view-program" as never,
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (!viewId || lastRunViewId.current === viewId) return;
|
|
35
|
+
lastRunViewId.current = viewId;
|
|
36
|
+
run.mutate({ viewId });
|
|
37
|
+
}, [run, viewId]);
|
|
38
|
+
|
|
39
|
+
if (!viewId) return null;
|
|
40
|
+
const preview = run.data?.ok ? run.data : run.data?.lastGoodRun;
|
|
41
|
+
return (
|
|
42
|
+
<section className="mx-5 mt-5 rounded-lg border border-border/70 bg-card p-4 sm:mx-7">
|
|
43
|
+
<div className="flex flex-wrap items-start justify-between gap-3">
|
|
44
|
+
<div className="flex items-start gap-3">
|
|
45
|
+
<IconChartDots className="mt-0.5 size-4 text-muted-foreground" />
|
|
46
|
+
<div>
|
|
47
|
+
<h2 className="text-sm font-semibold">Cross-source context</h2>
|
|
48
|
+
<p className="mt-1 text-sm text-muted-foreground">
|
|
49
|
+
{run.isPending
|
|
50
|
+
? "Running the saved data program…"
|
|
51
|
+
: run.isError
|
|
52
|
+
? "The saved data program is unavailable."
|
|
53
|
+
: run.data?.ok
|
|
54
|
+
? `${run.data.rowCount ?? 0} rows from the linked data program.`
|
|
55
|
+
: run.data?.message ||
|
|
56
|
+
"Showing the last good program result."}
|
|
57
|
+
</p>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
{preview ? (
|
|
61
|
+
<div className="flex gap-2">
|
|
62
|
+
{preview.truncated ? (
|
|
63
|
+
<Badge variant="outline">Truncated</Badge>
|
|
64
|
+
) : null}
|
|
65
|
+
{run.data?.ok && run.data.cacheHit ? (
|
|
66
|
+
<Badge variant="secondary">Cached</Badge>
|
|
67
|
+
) : null}
|
|
68
|
+
</div>
|
|
69
|
+
) : null}
|
|
70
|
+
</div>
|
|
71
|
+
{preview?.sampleRows?.length ? (
|
|
72
|
+
<div className="mt-4 overflow-hidden rounded-md border border-border/70">
|
|
73
|
+
<DataTable
|
|
74
|
+
data={preview.sampleRows.slice(0, 5)}
|
|
75
|
+
columns={preview.columns?.slice(0, 8).map((column) => column.name)}
|
|
76
|
+
maxRows={5}
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
) : null}
|
|
80
|
+
</section>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function linkedProgramViewId(data: unknown) {
|
|
85
|
+
if (!data || typeof data !== "object") return undefined;
|
|
86
|
+
const appliedView = (data as { appliedView?: unknown }).appliedView;
|
|
87
|
+
if (!appliedView || typeof appliedView !== "object") return undefined;
|
|
88
|
+
const view = appliedView as Record<string, unknown>;
|
|
89
|
+
return typeof view.id === "string" && typeof view.dataProgramId === "string"
|
|
90
|
+
? view.id
|
|
91
|
+
: undefined;
|
|
92
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Button } from "@agent-native/toolkit/ui/button";
|
|
2
|
+
import { Skeleton } from "@agent-native/toolkit/ui/skeleton";
|
|
3
|
+
import {
|
|
4
|
+
IconArrowUpRight,
|
|
5
|
+
IconDatabase,
|
|
6
|
+
IconDatabaseOff,
|
|
7
|
+
} from "@tabler/icons-react";
|
|
8
|
+
import { Link } from "react-router";
|
|
9
|
+
|
|
10
|
+
export function PageHeader({
|
|
11
|
+
eyebrow,
|
|
12
|
+
title,
|
|
13
|
+
description,
|
|
14
|
+
actions,
|
|
15
|
+
}: {
|
|
16
|
+
eyebrow?: string;
|
|
17
|
+
title: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
actions?: React.ReactNode;
|
|
20
|
+
}) {
|
|
21
|
+
return (
|
|
22
|
+
<header className="flex flex-col gap-4 border-b border-border/70 px-5 py-5 sm:flex-row sm:items-end sm:justify-between sm:px-7">
|
|
23
|
+
<div className="min-w-0">
|
|
24
|
+
{eyebrow ? (
|
|
25
|
+
<p className="mb-1 text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground">
|
|
26
|
+
{eyebrow}
|
|
27
|
+
</p>
|
|
28
|
+
) : null}
|
|
29
|
+
<h1 className="text-xl font-semibold tracking-tight">{title}</h1>
|
|
30
|
+
{description ? (
|
|
31
|
+
<p className="mt-1 max-w-2xl text-sm leading-6 text-muted-foreground">
|
|
32
|
+
{description}
|
|
33
|
+
</p>
|
|
34
|
+
) : null}
|
|
35
|
+
</div>
|
|
36
|
+
{actions ? (
|
|
37
|
+
<div className="flex shrink-0 items-center gap-2">{actions}</div>
|
|
38
|
+
) : null}
|
|
39
|
+
</header>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function LoadingRows({ rows = 5 }: { rows?: number }) {
|
|
44
|
+
return (
|
|
45
|
+
<div className="grid gap-2 p-5 sm:p-7">
|
|
46
|
+
{Array.from({ length: rows }, (_, index) => (
|
|
47
|
+
<Skeleton key={index} className="h-12 w-full" />
|
|
48
|
+
))}
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function SetupEmptyState({
|
|
54
|
+
title = "Start a CRM to begin",
|
|
55
|
+
description = "Start with the built-in SQL CRM, or connect a scoped workspace CRM. No provider credentials are stored in this app.",
|
|
56
|
+
onSync,
|
|
57
|
+
isSyncing = false,
|
|
58
|
+
actionLabel,
|
|
59
|
+
}: {
|
|
60
|
+
title?: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
onSync?: () => void;
|
|
63
|
+
isSyncing?: boolean;
|
|
64
|
+
actionLabel?: string;
|
|
65
|
+
}) {
|
|
66
|
+
return (
|
|
67
|
+
<div className="grid min-h-[360px] place-items-center p-6">
|
|
68
|
+
<div className="max-w-sm text-center">
|
|
69
|
+
<div className="mx-auto grid size-10 place-items-center rounded-full bg-muted text-muted-foreground">
|
|
70
|
+
<IconDatabaseOff className="size-5" />
|
|
71
|
+
</div>
|
|
72
|
+
<h2 className="mt-4 text-base font-semibold">{title}</h2>
|
|
73
|
+
<p className="mt-2 text-sm leading-6 text-muted-foreground">
|
|
74
|
+
{description}
|
|
75
|
+
</p>
|
|
76
|
+
<div className="mt-5 flex flex-wrap justify-center gap-2">
|
|
77
|
+
<Button asChild className="gap-2">
|
|
78
|
+
<Link to="/setup">
|
|
79
|
+
<IconDatabase className="size-4" /> Start with Native SQL
|
|
80
|
+
</Link>
|
|
81
|
+
</Button>
|
|
82
|
+
<Button asChild variant="outline" className="gap-2">
|
|
83
|
+
<Link to="/settings/connections">
|
|
84
|
+
Open shared connections <IconArrowUpRight className="size-4" />
|
|
85
|
+
</Link>
|
|
86
|
+
</Button>
|
|
87
|
+
{onSync ? (
|
|
88
|
+
<Button onClick={onSync} disabled={isSyncing}>
|
|
89
|
+
{isSyncing ? "Working…" : (actionLabel ?? "Sync recent records")}
|
|
90
|
+
</Button>
|
|
91
|
+
) : null}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
);
|
|
96
|
+
}
|