@agent-native/core 0.123.0 → 0.123.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.
Files changed (263) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +16 -0
  3. package/corpus/core/package.json +1 -1
  4. package/corpus/core/src/cli/templates-meta.ts +12 -0
  5. package/corpus/templates/crm/.agents/skills/agent-native-docs/SKILL.md +115 -0
  6. package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +177 -0
  7. package/corpus/templates/crm/.agents/skills/crm/SKILL.md +205 -0
  8. package/corpus/templates/crm/.agents/skills/customizing-agent-native/SKILL.md +220 -0
  9. package/corpus/templates/crm/.agents/skills/feature-flags/SKILL.md +169 -0
  10. package/corpus/templates/crm/.agents/skills/sharing/SKILL.md +228 -0
  11. package/corpus/templates/crm/.agents/skills/storing-data/SKILL.md +178 -0
  12. package/corpus/templates/crm/.agents/skills/upgrade-agent-native/SKILL.md +122 -0
  13. package/corpus/templates/crm/.env.example +5 -0
  14. package/corpus/templates/crm/AGENTS.md +82 -0
  15. package/corpus/templates/crm/CHANGELOG.md +25 -0
  16. package/corpus/templates/crm/DEVELOPING.md +66 -0
  17. package/corpus/templates/crm/README.md +122 -0
  18. package/corpus/templates/crm/_gitignore +12 -0
  19. package/corpus/templates/crm/actions/_crm-action-utils.ts +98 -0
  20. package/corpus/templates/crm/actions/_crm-attribute-utils.ts +219 -0
  21. package/corpus/templates/crm/actions/_crm-dashboard.ts +69 -0
  22. package/corpus/templates/crm/actions/_crm-data-program-actions.ts +15 -0
  23. package/corpus/templates/crm/actions/_crm-list-utils.ts +775 -0
  24. package/corpus/templates/crm/actions/_crm-signal-utils.ts +79 -0
  25. package/corpus/templates/crm/actions/add-crm-record-to-list.ts +164 -0
  26. package/corpus/templates/crm/actions/apply-crm-proposals.ts +291 -0
  27. package/corpus/templates/crm/actions/archive-crm-attribute.ts +69 -0
  28. package/corpus/templates/crm/actions/attach-call-evidence.ts +170 -0
  29. package/corpus/templates/crm/actions/configure-crm-connection.ts +126 -0
  30. package/corpus/templates/crm/actions/configure-native-crm.ts +44 -0
  31. package/corpus/templates/crm/actions/create-crm-attribute.ts +350 -0
  32. package/corpus/templates/crm/actions/create-crm-list.ts +194 -0
  33. package/corpus/templates/crm/actions/create-crm-record.ts +148 -0
  34. package/corpus/templates/crm/actions/create-crm-signal-tracker.ts +58 -0
  35. package/corpus/templates/crm/actions/delete-crm-saved-view.ts +68 -0
  36. package/corpus/templates/crm/actions/delete-staged-dataset.ts +14 -0
  37. package/corpus/templates/crm/actions/estimate-crm-enrichment.ts +229 -0
  38. package/corpus/templates/crm/actions/find-crm-duplicates.ts +87 -0
  39. package/corpus/templates/crm/actions/get-crm-automation-recipe.ts +36 -0
  40. package/corpus/templates/crm/actions/get-crm-dashboard-panel.ts +35 -0
  41. package/corpus/templates/crm/actions/get-crm-dashboard.ts +14 -0
  42. package/corpus/templates/crm/actions/get-crm-overview.ts +13 -0
  43. package/corpus/templates/crm/actions/get-crm-pipeline-data.ts +61 -0
  44. package/corpus/templates/crm/actions/get-crm-record-page.ts +287 -0
  45. package/corpus/templates/crm/actions/get-crm-record.ts +75 -0
  46. package/corpus/templates/crm/actions/get-crm-workspace.ts +364 -0
  47. package/corpus/templates/crm/actions/install-crm-pipeline-dashboard.ts +81 -0
  48. package/corpus/templates/crm/actions/list-crm-attributes.ts +71 -0
  49. package/corpus/templates/crm/actions/list-crm-connections.ts +68 -0
  50. package/corpus/templates/crm/actions/list-crm-dashboard-revisions.ts +15 -0
  51. package/corpus/templates/crm/actions/list-crm-dashboards.ts +15 -0
  52. package/corpus/templates/crm/actions/list-crm-enrichment-slots.ts +28 -0
  53. package/corpus/templates/crm/actions/list-crm-list-entries.ts +192 -0
  54. package/corpus/templates/crm/actions/list-crm-lists.ts +80 -0
  55. package/corpus/templates/crm/actions/list-crm-proposals.ts +55 -0
  56. package/corpus/templates/crm/actions/list-crm-record-field-history.ts +201 -0
  57. package/corpus/templates/crm/actions/list-crm-record-values.ts +200 -0
  58. package/corpus/templates/crm/actions/list-crm-records.ts +103 -0
  59. package/corpus/templates/crm/actions/list-crm-saved-views.ts +66 -0
  60. package/corpus/templates/crm/actions/list-crm-signal-hits.ts +43 -0
  61. package/corpus/templates/crm/actions/list-crm-signal-trackers.ts +32 -0
  62. package/corpus/templates/crm/actions/list-crm-tasks.ts +22 -0
  63. package/corpus/templates/crm/actions/list-staged-datasets.ts +14 -0
  64. package/corpus/templates/crm/actions/list-workspace-connections.ts +47 -0
  65. package/corpus/templates/crm/actions/manage-crm-attribute-option.ts +272 -0
  66. package/corpus/templates/crm/actions/manage-crm-signal-tracker.ts +87 -0
  67. package/corpus/templates/crm/actions/manage-crm-task.ts +132 -0
  68. package/corpus/templates/crm/actions/merge-crm-records.ts +691 -0
  69. package/corpus/templates/crm/actions/navigate.ts +54 -0
  70. package/corpus/templates/crm/actions/provider-api-catalog.ts +22 -0
  71. package/corpus/templates/crm/actions/provider-api-docs.ts +54 -0
  72. package/corpus/templates/crm/actions/provider-api-request.ts +92 -0
  73. package/corpus/templates/crm/actions/query-staged-dataset.ts +44 -0
  74. package/corpus/templates/crm/actions/record-crm-call-insight.ts +160 -0
  75. package/corpus/templates/crm/actions/record-crm-smart-signal.ts +150 -0
  76. package/corpus/templates/crm/actions/remove-crm-list-entry.ts +79 -0
  77. package/corpus/templates/crm/actions/restore-crm-dashboard-revision.ts +23 -0
  78. package/corpus/templates/crm/actions/review-crm-signal.ts +31 -0
  79. package/corpus/templates/crm/actions/run-crm-attribute-fill.ts +443 -0
  80. package/corpus/templates/crm/actions/run-crm-enrichment.ts +647 -0
  81. package/corpus/templates/crm/actions/run-crm-saved-view-program.ts +103 -0
  82. package/corpus/templates/crm/actions/run-crm-signal-trackers.ts +265 -0
  83. package/corpus/templates/crm/actions/run.ts +7 -0
  84. package/corpus/templates/crm/actions/save-crm-dashboard.ts +51 -0
  85. package/corpus/templates/crm/actions/save-crm-saved-view.ts +296 -0
  86. package/corpus/templates/crm/actions/sync-crm.ts +146 -0
  87. package/corpus/templates/crm/actions/update-crm-attribute.ts +111 -0
  88. package/corpus/templates/crm/actions/update-crm-list-entry.ts +102 -0
  89. package/corpus/templates/crm/actions/update-crm-list.ts +97 -0
  90. package/corpus/templates/crm/actions/update-crm-record.ts +543 -0
  91. package/corpus/templates/crm/actions/view-screen.ts +324 -0
  92. package/corpus/templates/crm/agent-native.app-skill.json +69 -0
  93. package/corpus/templates/crm/app/components/crm/CreateCrmRecordDialog.tsx +158 -0
  94. package/corpus/templates/crm/app/components/crm/CrmDashboardPanel.tsx +78 -0
  95. package/corpus/templates/crm/app/components/crm/CrmSignalsPanel.tsx +220 -0
  96. package/corpus/templates/crm/app/components/crm/IntelligenceSettings.tsx +414 -0
  97. package/corpus/templates/crm/app/components/crm/RecordActions.tsx +648 -0
  98. package/corpus/templates/crm/app/components/crm/RecordGrid.tsx +488 -0
  99. package/corpus/templates/crm/app/components/crm/RecordWorkspace.tsx +232 -0
  100. package/corpus/templates/crm/app/components/crm/SavedViewDataProgram.tsx +93 -0
  101. package/corpus/templates/crm/app/components/crm/Surface.tsx +97 -0
  102. package/corpus/templates/crm/app/components/crm/WorkOverview.tsx +180 -0
  103. package/corpus/templates/crm/app/components/crm/board/CrmBoard.tsx +988 -0
  104. package/corpus/templates/crm/app/components/crm/board/board-model.ts +399 -0
  105. package/corpus/templates/crm/app/components/crm/board/entry-filter.ts +150 -0
  106. package/corpus/templates/crm/app/components/crm/board/view-draft.ts +227 -0
  107. package/corpus/templates/crm/app/components/crm/grid/CrmGrid.tsx +1033 -0
  108. package/corpus/templates/crm/app/components/crm/grid/GridCell.tsx +620 -0
  109. package/corpus/templates/crm/app/components/crm/grid/clipboard.ts +84 -0
  110. package/corpus/templates/crm/app/components/crm/grid/model.ts +304 -0
  111. package/corpus/templates/crm/app/components/crm/grid/navigation.ts +220 -0
  112. package/corpus/templates/crm/app/components/crm/grid/query.ts +214 -0
  113. package/corpus/templates/crm/app/components/crm/record/AttributePanel.tsx +192 -0
  114. package/corpus/templates/crm/app/components/crm/record/FieldHistory.tsx +179 -0
  115. package/corpus/templates/crm/app/components/crm/record/RecordHeader.tsx +103 -0
  116. package/corpus/templates/crm/app/components/crm/record/RecordLists.tsx +235 -0
  117. package/corpus/templates/crm/app/components/crm/record/RecordTabs.tsx +206 -0
  118. package/corpus/templates/crm/app/components/crm/record/field-editors.tsx +245 -0
  119. package/corpus/templates/crm/app/components/crm/record/record-data.ts +603 -0
  120. package/corpus/templates/crm/app/components/crm/settings/AdvancedSettings.tsx +49 -0
  121. package/corpus/templates/crm/app/components/crm/settings/AttributeOptionsEditor.tsx +441 -0
  122. package/corpus/templates/crm/app/components/crm/settings/ConnectionSettings.tsx +169 -0
  123. package/corpus/templates/crm/app/components/crm/settings/FieldsSettings.tsx +935 -0
  124. package/corpus/templates/crm/app/components/crm/settings/ListsSettings.tsx +339 -0
  125. package/corpus/templates/crm/app/components/crm/settings/settings-admin.ts +377 -0
  126. package/corpus/templates/crm/app/components/crm/shared/AttributeValueParts.tsx +69 -0
  127. package/corpus/templates/crm/app/components/crm/shared/attribute-value.ts +591 -0
  128. package/corpus/templates/crm/app/components/layout/CrmCommandMenu.tsx +556 -0
  129. package/corpus/templates/crm/app/components/layout/CrmLayout.tsx +130 -0
  130. package/corpus/templates/crm/app/components/layout/CrmSidebar.tsx +407 -0
  131. package/corpus/templates/crm/app/components/layout/command-palette-search.ts +126 -0
  132. package/corpus/templates/crm/app/components/layout/crm-ui-intents.ts +41 -0
  133. package/corpus/templates/crm/app/components/layout/sidebar-collapse.ts +40 -0
  134. package/corpus/templates/crm/app/components/layout/sidebar-lists.ts +109 -0
  135. package/corpus/templates/crm/app/components/ui/alert-dialog.tsx +1 -0
  136. package/corpus/templates/crm/app/components/ui/badge.tsx +1 -0
  137. package/corpus/templates/crm/app/components/ui/button.tsx +1 -0
  138. package/corpus/templates/crm/app/components/ui/card.tsx +1 -0
  139. package/corpus/templates/crm/app/components/ui/checkbox.tsx +1 -0
  140. package/corpus/templates/crm/app/components/ui/dialog.tsx +1 -0
  141. package/corpus/templates/crm/app/components/ui/dropdown-menu.tsx +1 -0
  142. package/corpus/templates/crm/app/components/ui/hover-card.tsx +1 -0
  143. package/corpus/templates/crm/app/components/ui/input.tsx +1 -0
  144. package/corpus/templates/crm/app/components/ui/label.tsx +1 -0
  145. package/corpus/templates/crm/app/components/ui/popover.tsx +1 -0
  146. package/corpus/templates/crm/app/components/ui/select.tsx +1 -0
  147. package/corpus/templates/crm/app/components/ui/sheet.tsx +1 -0
  148. package/corpus/templates/crm/app/components/ui/skeleton.tsx +1 -0
  149. package/corpus/templates/crm/app/components/ui/switch.tsx +1 -0
  150. package/corpus/templates/crm/app/components/ui/table.tsx +1 -0
  151. package/corpus/templates/crm/app/components/ui/tabs.tsx +1 -0
  152. package/corpus/templates/crm/app/components/ui/textarea.tsx +1 -0
  153. package/corpus/templates/crm/app/components/ui/toolkit-provider.tsx +17 -0
  154. package/corpus/templates/crm/app/components/ui/tooltip.tsx +1 -0
  155. package/corpus/templates/crm/app/design-system.ts +3 -0
  156. package/corpus/templates/crm/app/entry.client.tsx +19 -0
  157. package/corpus/templates/crm/app/entry.server.tsx +10 -0
  158. package/corpus/templates/crm/app/global.css +167 -0
  159. package/corpus/templates/crm/app/hooks/use-keyboard-shortcuts.ts +206 -0
  160. package/corpus/templates/crm/app/hooks/use-navigation-state.ts +48 -0
  161. package/corpus/templates/crm/app/i18n/en-US.ts +684 -0
  162. package/corpus/templates/crm/app/i18n/index.ts +34 -0
  163. package/corpus/templates/crm/app/lib/dashboard.ts +13 -0
  164. package/corpus/templates/crm/app/lib/navigation.ts +17 -0
  165. package/corpus/templates/crm/app/lib/tab-id.ts +1 -0
  166. package/corpus/templates/crm/app/lib/types.ts +172 -0
  167. package/corpus/templates/crm/app/lib/utils.ts +1 -0
  168. package/corpus/templates/crm/app/root.tsx +93 -0
  169. package/corpus/templates/crm/app/routes/_index.tsx +26 -0
  170. package/corpus/templates/crm/app/routes/accounts.tsx +41 -0
  171. package/corpus/templates/crm/app/routes/agent.tsx +5 -0
  172. package/corpus/templates/crm/app/routes/ask.tsx +53 -0
  173. package/corpus/templates/crm/app/routes/dashboard.tsx +118 -0
  174. package/corpus/templates/crm/app/routes/lists.tsx +228 -0
  175. package/corpus/templates/crm/app/routes/opportunities.tsx +41 -0
  176. package/corpus/templates/crm/app/routes/people.tsx +41 -0
  177. package/corpus/templates/crm/app/routes/proposals.tsx +388 -0
  178. package/corpus/templates/crm/app/routes/records.$recordId.tsx +53 -0
  179. package/corpus/templates/crm/app/routes/records.tsx +64 -0
  180. package/corpus/templates/crm/app/routes/settings.tsx +118 -0
  181. package/corpus/templates/crm/app/routes/setup.tsx +308 -0
  182. package/corpus/templates/crm/app/routes/tasks.tsx +252 -0
  183. package/corpus/templates/crm/app/routes/views.tsx +683 -0
  184. package/corpus/templates/crm/app/routes.ts +19 -0
  185. package/corpus/templates/crm/app/vite-env.d.ts +6 -0
  186. package/corpus/templates/crm/changelog/2026-07-26-any-list-or-view-can-be-shown-as-a-board-grouped-by-stage-so.md +6 -0
  187. package/corpus/templates/crm/changelog/2026-07-26-crm-now-finds-likely-duplicate-records-and-tells-you-exactly.md +6 -0
  188. package/corpus/templates/crm/changelog/2026-07-26-enrichment-now-shows-what-a-run-will-cost-before-it-starts-g.md +6 -0
  189. package/corpus/templates/crm/changelog/2026-07-26-lists-turn-any-set-of-records-into-a-pipeline-with-its-own-s.md +6 -0
  190. package/corpus/templates/crm/changelog/2026-07-26-moving-a-record-or-list-entry-into-a-stage-that-was-retired-.md +6 -0
  191. package/corpus/templates/crm/changelog/2026-07-26-opening-a-record-now-shows-one-page-with-its-fields-the-list.md +6 -0
  192. package/corpus/templates/crm/changelog/2026-07-26-press-cmd-k-to-jump-to-any-record-list-view-or-setting-and-u.md +6 -0
  193. package/corpus/templates/crm/changelog/2026-07-26-provider-record-edits-now-show-an-exact-before-after-diff-an.md +6 -0
  194. package/corpus/templates/crm/changelog/2026-07-26-record-page-attribute-labels-now-read-in-full-instead-of-bei.md +6 -0
  195. package/corpus/templates/crm/changelog/2026-07-26-records-now-use-typed-fields-currency-dates-ratings-status-s.md +6 -0
  196. package/corpus/templates/crm/changelog/2026-07-26-retyping-a-value-on-the-record-page-now-replaces-it-instead-.md +6 -0
  197. package/corpus/templates/crm/changelog/2026-07-26-settings-now-has-fields-and-lists-tabs-for-adding-fields-edi.md +6 -0
  198. package/corpus/templates/crm/changelog/2026-07-26-the-proposal-review-now-shows-the-field-that-actually-change.md +6 -0
  199. package/corpus/templates/crm/changelog/2026-07-26-the-record-grid-is-now-a-real-spreadsheet-filter-sort-and-pa.md +6 -0
  200. package/corpus/templates/crm/components.json +20 -0
  201. package/corpus/templates/crm/docs/architecture/crm-contract.md +214 -0
  202. package/corpus/templates/crm/docs/features/README.md +55 -0
  203. package/corpus/templates/crm/docs/features/f1-records-and-fields.mdx +52 -0
  204. package/corpus/templates/crm/docs/features/f2-lists-pipelines-and-views.mdx +48 -0
  205. package/corpus/templates/crm/docs/features/f3-work-and-record-quality.mdx +40 -0
  206. package/corpus/templates/crm/docs/features/f4-evidence-and-chat.mdx +47 -0
  207. package/corpus/templates/crm/learnings.defaults.md +5 -0
  208. package/corpus/templates/crm/netlify.toml +11 -0
  209. package/corpus/templates/crm/package.json +61 -0
  210. package/corpus/templates/crm/public/favicon.svg +1 -0
  211. package/corpus/templates/crm/public/icon-180.svg +1 -0
  212. package/corpus/templates/crm/public/manifest.json +11 -0
  213. package/corpus/templates/crm/react-router.config.ts +7 -0
  214. package/corpus/templates/crm/server/crm/adapter.ts +32 -0
  215. package/corpus/templates/crm/server/crm/crm-field-firewall.ts +64 -0
  216. package/corpus/templates/crm/server/crm/crm-mirror.ts +721 -0
  217. package/corpus/templates/crm/server/crm/field-policy-attributes.ts +48 -0
  218. package/corpus/templates/crm/server/crm/hubspot-adapter.ts +1146 -0
  219. package/corpus/templates/crm/server/crm/native-adapter.ts +1810 -0
  220. package/corpus/templates/crm/server/crm/provider-record-link.ts +264 -0
  221. package/corpus/templates/crm/server/crm/read-through.ts +207 -0
  222. package/corpus/templates/crm/server/crm/salesforce-adapter.ts +1255 -0
  223. package/corpus/templates/crm/server/db/crm-store.ts +1112 -0
  224. package/corpus/templates/crm/server/db/index.ts +191 -0
  225. package/corpus/templates/crm/server/db/schema.ts +647 -0
  226. package/corpus/templates/crm/server/lib/crm-query.ts +1558 -0
  227. package/corpus/templates/crm/server/lib/dedupe.ts +714 -0
  228. package/corpus/templates/crm/server/lib/enrichment-cost.ts +381 -0
  229. package/corpus/templates/crm/server/lib/enrichment-slots.ts +519 -0
  230. package/corpus/templates/crm/server/lib/intelligence/default-detectors.ts +65 -0
  231. package/corpus/templates/crm/server/lib/intelligence/evidence.ts +105 -0
  232. package/corpus/templates/crm/server/lib/intelligence/keyword-detector.ts +94 -0
  233. package/corpus/templates/crm/server/lib/intelligence/smart-detector.ts +39 -0
  234. package/corpus/templates/crm/server/lib/intelligence/summary.ts +19 -0
  235. package/corpus/templates/crm/server/lib/lifecycle.ts +634 -0
  236. package/corpus/templates/crm/server/lib/provider-api.ts +64 -0
  237. package/corpus/templates/crm/server/middleware/auth.ts +4 -0
  238. package/corpus/templates/crm/server/plugins/agent-chat.ts +65 -0
  239. package/corpus/templates/crm/server/plugins/auth.ts +14 -0
  240. package/corpus/templates/crm/server/plugins/core-routes.ts +17 -0
  241. package/corpus/templates/crm/server/plugins/db.ts +738 -0
  242. package/corpus/templates/crm/server/routes/[...page].get.ts +5 -0
  243. package/corpus/templates/crm/shared/crm-attributes.ts +469 -0
  244. package/corpus/templates/crm/shared/crm-automation-recipes.ts +132 -0
  245. package/corpus/templates/crm/shared/crm-contract.ts +417 -0
  246. package/corpus/templates/crm/shared/crm-navigation.ts +190 -0
  247. package/corpus/templates/crm/shared/crm-sales-config.ts +63 -0
  248. package/corpus/templates/crm/ssr-entry.ts +11 -0
  249. package/corpus/templates/crm/tsconfig.json +24 -0
  250. package/corpus/templates/crm/vite.config.ts +15 -0
  251. package/corpus/templates/crm/vitest.config.ts +5 -0
  252. package/corpus/templates/design/app/i18n-data.ts +12 -12
  253. package/corpus/templates/design/changelog/2026-07-26-apply-design-updates-from-a-centered-top-toolbar-without-cov.md +6 -0
  254. package/dist/cli/templates-meta.d.ts.map +1 -1
  255. package/dist/cli/templates-meta.js +12 -0
  256. package/dist/cli/templates-meta.js.map +1 -1
  257. package/dist/collab/routes.d.ts +1 -1
  258. package/dist/observability/routes.d.ts +3 -3
  259. package/dist/resources/handlers.d.ts +1 -1
  260. package/dist/server/realtime-token.d.ts +1 -1
  261. package/dist/server/transcribe-voice.d.ts +1 -1
  262. package/package.json +1 -1
  263. package/src/cli/templates-meta.ts +12 -0
@@ -0,0 +1,34 @@
1
+ import { type AgentNativeI18nCatalog } from "@agent-native/core/client/i18n";
2
+
3
+ import enUS from "./en-US";
4
+
5
+ export const i18nCatalog = {
6
+ sourceLocale: "en-US",
7
+ messages: enUS,
8
+ loadMessages: async (locale) => {
9
+ switch (locale) {
10
+ case "ar-SA":
11
+ return (await import("./ar-SA")).default;
12
+ case "de-DE":
13
+ return (await import("./de-DE")).default;
14
+ case "es-ES":
15
+ return (await import("./es-ES")).default;
16
+ case "fr-FR":
17
+ return (await import("./fr-FR")).default;
18
+ case "hi-IN":
19
+ return (await import("./hi-IN")).default;
20
+ case "ja-JP":
21
+ return (await import("./ja-JP")).default;
22
+ case "ko-KR":
23
+ return (await import("./ko-KR")).default;
24
+ case "pt-BR":
25
+ return (await import("./pt-BR")).default;
26
+ case "zh-CN":
27
+ return (await import("./zh-CN")).default;
28
+ case "zh-TW":
29
+ return (await import("./zh-TW")).default;
30
+ default:
31
+ return null;
32
+ }
33
+ },
34
+ } satisfies AgentNativeI18nCatalog;
@@ -0,0 +1,13 @@
1
+ import type { CrmDashboardPanelConfig } from "./types";
2
+
3
+ export function dashboardDataPanelId(
4
+ panels: CrmDashboardPanelConfig[],
5
+ panel: CrmDashboardPanelConfig,
6
+ ): string {
7
+ return (
8
+ panels.find(
9
+ (candidate) =>
10
+ candidate.source === panel.source && candidate.query === panel.query,
11
+ )?.id ?? panel.id
12
+ );
13
+ }
@@ -0,0 +1,17 @@
1
+ import {
2
+ CRM_VIEW_PATHS,
3
+ crmNavigationPath,
4
+ viewFromPath,
5
+ type CrmNavigationTarget,
6
+ type CrmSettingsSection,
7
+ type CrmView,
8
+ } from "../../shared/crm-navigation";
9
+
10
+ export {
11
+ CRM_VIEW_PATHS,
12
+ crmNavigationPath,
13
+ viewFromPath,
14
+ type CrmNavigationTarget,
15
+ type CrmSettingsSection,
16
+ type CrmView,
17
+ };
@@ -0,0 +1 @@
1
+ export const TAB_ID = `crm-${Math.random().toString(36).slice(2, 8)}`;
@@ -0,0 +1,172 @@
1
+ export type CrmKind = "account" | "person" | "opportunity";
2
+
3
+ export interface CrmRecordSummary {
4
+ id: string;
5
+ displayName: string;
6
+ kind: CrmKind;
7
+ subtitle?: string;
8
+ owner?: string;
9
+ stage?: string;
10
+ cadence?: string;
11
+ nextStep?: string;
12
+ updatedAt?: string;
13
+ fields?: Record<string, unknown>;
14
+ }
15
+
16
+ export interface CrmRecordDetail extends CrmRecordSummary {
17
+ provider?: "hubspot" | "salesforce" | string;
18
+ description?: string;
19
+ remoteRevision?: string;
20
+ activity?: Array<{
21
+ id: string;
22
+ title: string;
23
+ summary?: string;
24
+ occurredAt?: string;
25
+ actor?: string;
26
+ }>;
27
+ evidence?: Array<{
28
+ id: string;
29
+ label: string;
30
+ quote?: string;
31
+ url?: string;
32
+ observedAt?: string;
33
+ }>;
34
+ tasks?: Array<CrmTask>;
35
+ relatedRecords?: Array<{
36
+ id: string;
37
+ displayName: string;
38
+ kind: CrmKind;
39
+ relationshipType: string;
40
+ relationshipLabel?: string;
41
+ subtitle?: string;
42
+ }>;
43
+ }
44
+
45
+ export interface CrmTask {
46
+ id: string;
47
+ title: string;
48
+ status: "open" | "done" | "blocked" | string;
49
+ dueAt?: string;
50
+ recordId?: string;
51
+ }
52
+
53
+ export interface CrmSavedView {
54
+ id: string;
55
+ name: string;
56
+ description?: string;
57
+ kind?: CrmKind;
58
+ query?: string;
59
+ dataProgramId?: string;
60
+ }
61
+
62
+ export interface CrmOverview {
63
+ focus?: Array<{ label: string; value: string; detail?: string }>;
64
+ tasks?: CrmTask[];
65
+ records?: CrmRecordSummary[];
66
+ }
67
+
68
+ export interface CrmDashboardPanelConfig {
69
+ id: string;
70
+ title: string;
71
+ source: "program";
72
+ query: string;
73
+ chartType: "metric" | "bar" | "table";
74
+ }
75
+
76
+ export interface CrmDashboard {
77
+ id: string;
78
+ kind: "pipeline";
79
+ title: string;
80
+ config: { version: 1; panels: CrmDashboardPanelConfig[] };
81
+ updatedAt: string;
82
+ }
83
+
84
+ export function recordId(record: unknown): string | undefined {
85
+ if (!record || typeof record !== "object") return undefined;
86
+ const value = record as Record<string, unknown>;
87
+ const ref = value.ref as Record<string, unknown> | undefined;
88
+ return (
89
+ asText(value.id) ??
90
+ asText(value.recordId) ??
91
+ asText(ref?.localId) ??
92
+ asText(ref?.remoteId)
93
+ );
94
+ }
95
+
96
+ export function asText(value: unknown): string | undefined {
97
+ return typeof value === "string" && value.length ? value : undefined;
98
+ }
99
+
100
+ export function normalizeRecord(
101
+ record: unknown,
102
+ fallbackKind: CrmKind,
103
+ ): CrmRecordSummary | null {
104
+ if (!record || typeof record !== "object") return null;
105
+ const value = record as Record<string, unknown>;
106
+ const id = recordId(value);
107
+ if (!id) return null;
108
+ const fields = isObject(value.fields) ? value.fields : undefined;
109
+ const ref = isObject(value.ref) ? value.ref : undefined;
110
+ const kind = asKind(value.kind) ?? asKind(ref?.kind) ?? fallbackKind;
111
+ return {
112
+ id,
113
+ displayName: asText(value.displayName) ?? asText(value.name) ?? id,
114
+ kind,
115
+ subtitle:
116
+ asText(value.subtitle) ?? asText(fields?.domain) ?? asText(fields?.email),
117
+ owner: asText(value.owner) ?? asText(fields?.owner),
118
+ stage: asText(value.stage) ?? asText(fields?.stage),
119
+ cadence: asText(value.cadence) ?? asText(fields?.cadence),
120
+ nextStep: asText(value.nextStep) ?? asText(fields?.nextStep),
121
+ updatedAt: asText(value.updatedAt) ?? asText(value.remoteUpdatedAt),
122
+ fields,
123
+ };
124
+ }
125
+
126
+ export function normalizeRecords(
127
+ data: unknown,
128
+ kind: CrmKind,
129
+ ): CrmRecordSummary[] {
130
+ const values = Array.isArray(data)
131
+ ? data
132
+ : isObject(data) && Array.isArray(data.records)
133
+ ? data.records
134
+ : [];
135
+ return values.flatMap((value) => {
136
+ const record = normalizeRecord(value, kind);
137
+ return record ? [record] : [];
138
+ });
139
+ }
140
+
141
+ export function normalizeTasks(data: unknown): CrmTask[] {
142
+ const values = Array.isArray(data)
143
+ ? data
144
+ : isObject(data) && Array.isArray(data.tasks)
145
+ ? data.tasks
146
+ : [];
147
+ return values.flatMap((value) => {
148
+ if (!isObject(value)) return [];
149
+ const id = asText(value.id) ?? asText(value.taskId);
150
+ const title = asText(value.title) ?? asText(value.name);
151
+ if (!id || !title) return [];
152
+ return [
153
+ {
154
+ id,
155
+ title,
156
+ status: asText(value.status) ?? "open",
157
+ dueAt: asText(value.dueAt),
158
+ recordId: asText(value.recordId),
159
+ },
160
+ ];
161
+ });
162
+ }
163
+
164
+ function asKind(value: unknown): CrmKind | undefined {
165
+ return value === "account" || value === "person" || value === "opportunity"
166
+ ? value
167
+ : undefined;
168
+ }
169
+
170
+ function isObject(value: unknown): value is Record<string, unknown> {
171
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
172
+ }
@@ -0,0 +1 @@
1
+ export { cn } from "@agent-native/toolkit/utils";
@@ -0,0 +1,93 @@
1
+ import { configureTracking } from "@agent-native/core/client/analytics";
2
+ import { appPath } from "@agent-native/core/client/api-path";
3
+ import {
4
+ AppProviders,
5
+ createAgentNativeQueryClient,
6
+ useDbSync,
7
+ } from "@agent-native/core/client/hooks";
8
+ import { getLocaleInitScript } from "@agent-native/core/client/i18n";
9
+ import { getThemeInitScript } from "@agent-native/core/client/ui";
10
+ import { useQueryClient } from "@tanstack/react-query";
11
+ import { useState } from "react";
12
+ import { Links, Meta, Outlet, Scripts, ScrollRestoration } from "react-router";
13
+ import type { LinksFunction } from "react-router";
14
+
15
+ import { CrmCommandMenu } from "@/components/layout/CrmCommandMenu";
16
+ import { CrmLayout } from "@/components/layout/CrmLayout";
17
+ import { AppToolkitProvider } from "@/components/ui/toolkit-provider";
18
+ import { useNavigationState } from "@/hooks/use-navigation-state";
19
+ import { i18nCatalog } from "@/i18n";
20
+ import { TAB_ID } from "@/lib/tab-id";
21
+
22
+ import stylesheet from "./global.css?url";
23
+
24
+ configureTracking({
25
+ getDefaultProps: (_name, properties) => ({
26
+ ...properties,
27
+ app: "crm",
28
+ template: "crm",
29
+ }),
30
+ });
31
+
32
+ export const links: LinksFunction = () => [
33
+ { rel: "stylesheet", href: stylesheet },
34
+ ];
35
+
36
+ export function Layout({ children }: { children: React.ReactNode }) {
37
+ return (
38
+ <html lang="en" suppressHydrationWarning>
39
+ <head>
40
+ <meta charSet="utf-8" />
41
+ <meta
42
+ name="viewport"
43
+ content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
44
+ />
45
+ <script
46
+ data-agent-native-theme-init
47
+ suppressHydrationWarning
48
+ dangerouslySetInnerHTML={{ __html: getThemeInitScript() }}
49
+ />
50
+ <script
51
+ data-agent-native-locale-init
52
+ suppressHydrationWarning
53
+ dangerouslySetInnerHTML={{ __html: getLocaleInitScript() }}
54
+ />
55
+ <link rel="manifest" href={appPath("/manifest.json")} />
56
+ <meta name="theme-color" content="#71717A" />
57
+ <link rel="icon" type="image/svg+xml" href={appPath("/favicon.svg")} />
58
+ <link rel="apple-touch-icon" href={appPath("/icon-180.svg")} />
59
+ <Meta />
60
+ <Links />
61
+ </head>
62
+ <body>
63
+ {children}
64
+ <ScrollRestoration />
65
+ <Scripts />
66
+ </body>
67
+ </html>
68
+ );
69
+ }
70
+
71
+ function SyncBridge() {
72
+ const queryClient = useQueryClient();
73
+ useNavigationState();
74
+ useDbSync({ queryClient, ignoreSource: TAB_ID });
75
+ return null;
76
+ }
77
+
78
+ export default function Root() {
79
+ const [queryClient] = useState(() => createAgentNativeQueryClient());
80
+ return (
81
+ <AppToolkitProvider>
82
+ <AppProviders queryClient={queryClient} i18n={{ catalog: i18nCatalog }}>
83
+ <SyncBridge />
84
+ <CrmCommandMenu />
85
+ <CrmLayout>
86
+ <Outlet />
87
+ </CrmLayout>
88
+ </AppProviders>
89
+ </AppToolkitProvider>
90
+ );
91
+ }
92
+
93
+ export { ErrorBoundary } from "@agent-native/core/client/ui";
@@ -0,0 +1,26 @@
1
+ import { useActionQuery } from "@agent-native/core/client/hooks";
2
+
3
+ import { PageHeader } from "@/components/crm/Surface";
4
+ import { WorkOverview } from "@/components/crm/WorkOverview";
5
+ import type { CrmOverview } from "@/lib/types";
6
+
7
+ export function meta() {
8
+ return [{ title: "My work · CRM" }];
9
+ }
10
+
11
+ export default function WorkRoute() {
12
+ const overview = useActionQuery<CrmOverview>(
13
+ "get-crm-overview" as never,
14
+ {} as never,
15
+ );
16
+ return (
17
+ <>
18
+ <PageHeader
19
+ eyebrow="CRM"
20
+ title="My work"
21
+ description="A calm view of follow-up work and current relationship context."
22
+ />
23
+ <WorkOverview overview={overview.data} isLoading={overview.isLoading} />
24
+ </>
25
+ );
26
+ }
@@ -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: "Accounts · CRM" }];
12
+ }
13
+ export default function AccountsRoute() {
14
+ const [searchParams] = useSearchParams();
15
+ const viewId = searchParams.get("view") ?? undefined;
16
+ const query = useActionQuery<unknown>(
17
+ "list-crm-records" as never,
18
+ { kind: "account", viewId } as never,
19
+ );
20
+ return (
21
+ <>
22
+ <PageHeader
23
+ eyebrow="Records"
24
+ title="Accounts"
25
+ description={
26
+ viewId
27
+ ? "Accounts matching this saved view."
28
+ : "Accounts from your Native SQL workspace and connected CRM mirrors."
29
+ }
30
+ actions={<CreateCrmRecordDialog kind="account" />}
31
+ />
32
+ <SavedViewDataProgram data={query.data} />
33
+ <RecordGrid
34
+ kind="account"
35
+ records={normalizeRecords(query.data, "account")}
36
+ isLoading={query.isLoading}
37
+ emptyTitle="No accounts yet"
38
+ />
39
+ </>
40
+ );
41
+ }
@@ -0,0 +1,5 @@
1
+ import { AgentTabsPage } from "@agent-native/core/client/agent-chat";
2
+
3
+ export default function AgentRoute() {
4
+ return <AgentTabsPage appName="CRM" />;
5
+ }
@@ -0,0 +1,53 @@
1
+ import {
2
+ AgentChatSurface,
3
+ markAgentChatHomeHandoff,
4
+ } from "@agent-native/core/client/agent-chat";
5
+ import { useEffect } from "react";
6
+
7
+ import { TAB_ID } from "@/lib/tab-id";
8
+
9
+ export function meta() {
10
+ return [{ title: "Ask CRM" }];
11
+ }
12
+
13
+ export default function AskCrmRoute() {
14
+ useEffect(() => {
15
+ const onChatRunning = (event: Event) => {
16
+ if ((event as CustomEvent<{ isRunning?: boolean }>).detail?.isRunning)
17
+ markAgentChatHomeHandoff("crm");
18
+ };
19
+ window.addEventListener("agentNative.chatRunning", onChatRunning);
20
+ return () =>
21
+ window.removeEventListener("agentNative.chatRunning", onChatRunning);
22
+ }, []);
23
+ return (
24
+ <div className="flex h-full min-h-0 flex-col bg-background">
25
+ <AgentChatSurface
26
+ mode="page"
27
+ chatViewTransition
28
+ className="crm-chat-panel"
29
+ storageKey="crm"
30
+ browserTabId={TAB_ID}
31
+ defaultMode="chat"
32
+ showHeader={false}
33
+ showTabBar={false}
34
+ dynamicSuggestions={false}
35
+ suggestions={[]}
36
+ emptyStateText="Ask CRM"
37
+ emptyStateDisplay="hidden"
38
+ centerComposerWhenEmpty
39
+ composerLayoutVariant="hero"
40
+ composerPlaceholder="Ask about your CRM"
41
+ composerSlot={
42
+ <div className="crm-chat-intro">
43
+ <h1>Ask CRM</h1>
44
+ <p>
45
+ Explore permitted account context, follow-up work, and evidence
46
+ across Native SQL and connected records.
47
+ </p>
48
+ </div>
49
+ }
50
+ />
51
+ </div>
52
+ );
53
+ }
@@ -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 { IconRefresh } from "@tabler/icons-react";
7
+ import { useMemo } from "react";
8
+ import { useNavigate, useSearchParams } from "react-router";
9
+ import { toast } from "sonner";
10
+
11
+ import { CrmDashboardPanel } from "@/components/crm/CrmDashboardPanel";
12
+ import { PageHeader, SetupEmptyState } from "@/components/crm/Surface";
13
+ import { Button } from "@/components/ui/button";
14
+ import { crmDashboardMetaTitle } from "@/i18n/en-US";
15
+ import { dashboardDataPanelId } from "@/lib/dashboard";
16
+ import type { CrmDashboard } from "@/lib/types";
17
+
18
+ export function meta() {
19
+ return [{ title: crmDashboardMetaTitle }];
20
+ }
21
+
22
+ export default function DashboardRoute() {
23
+ const t = useT();
24
+ const [searchParams] = useSearchParams();
25
+ const navigate = useNavigate();
26
+ const dashboards = useActionQuery<CrmDashboard[]>(
27
+ "list-crm-dashboards" as never,
28
+ {} as never,
29
+ );
30
+ const install = useActionMutation<
31
+ { dashboardId: string },
32
+ Record<string, never>
33
+ >("install-crm-pipeline-dashboard" as never);
34
+ const dashboard = useMemo(() => {
35
+ const requested = searchParams.get("id");
36
+ return (
37
+ dashboards.data?.find((item) => item.id === requested) ??
38
+ dashboards.data?.find((item) => item.kind === "pipeline")
39
+ );
40
+ }, [dashboards.data, searchParams]);
41
+
42
+ async function installDashboard() {
43
+ try {
44
+ const result = await install.mutateAsync({});
45
+ navigate(`/dashboard?id=${encodeURIComponent(result.dashboardId)}`, {
46
+ replace: true,
47
+ });
48
+ toast.success(t("dashboard.ready"));
49
+ } catch (error) {
50
+ toast.error(
51
+ error instanceof Error ? error.message : t("dashboard.installFailed"),
52
+ );
53
+ }
54
+ }
55
+
56
+ if (dashboards.isLoading) {
57
+ return (
58
+ <PageHeader
59
+ eyebrow="CRM"
60
+ title={t("dashboard.pipeline")}
61
+ description={t("dashboard.loadingDescription")}
62
+ />
63
+ );
64
+ }
65
+
66
+ if (!dashboard) {
67
+ return (
68
+ <>
69
+ <PageHeader
70
+ eyebrow="CRM"
71
+ title={t("dashboard.pipeline")}
72
+ description={t("dashboard.emptyDescription")}
73
+ />
74
+ <SetupEmptyState
75
+ title={t("dashboard.installTitle")}
76
+ description={t("dashboard.installDescription")}
77
+ onSync={installDashboard}
78
+ isSyncing={install.isPending}
79
+ actionLabel={t("dashboard.installAction")}
80
+ />
81
+ </>
82
+ );
83
+ }
84
+
85
+ return (
86
+ <>
87
+ <PageHeader
88
+ eyebrow="CRM"
89
+ title={dashboard.title}
90
+ description={t("dashboard.liveDescription")}
91
+ actions={
92
+ <Button
93
+ variant="outline"
94
+ size="sm"
95
+ className="gap-2"
96
+ onClick={installDashboard}
97
+ disabled={install.isPending}
98
+ >
99
+ <IconRefresh className="size-4" />
100
+ {install.isPending
101
+ ? t("dashboard.updating")
102
+ : t("dashboard.updatePack")}
103
+ </Button>
104
+ }
105
+ />
106
+ <div className="grid gap-4 p-5 sm:grid-cols-2 sm:p-7 xl:grid-cols-3">
107
+ {dashboard.config.panels.map((panel) => (
108
+ <CrmDashboardPanel
109
+ key={panel.id}
110
+ dashboardId={dashboard.id}
111
+ panel={panel}
112
+ dataPanelId={dashboardDataPanelId(dashboard.config.panels, panel)}
113
+ />
114
+ ))}
115
+ </div>
116
+ </>
117
+ );
118
+ }