@agent-native/core 0.146.3 → 0.146.5

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 (283) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +13 -10
  3. package/corpus/templates/analytics/.agents/skills/self-modifying-code/SKILL.md +7 -3
  4. package/corpus/templates/analytics/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  5. package/corpus/templates/analytics/actions/compose-dashboard.ts +53 -6
  6. package/corpus/templates/analytics/actions/dashboard-mutation-api.ts +8 -2
  7. package/corpus/templates/analytics/actions/migrate-first-party-analytics-to-bigquery.ts +3 -1
  8. package/corpus/templates/analytics/actions/mutate-dashboard.ts +48 -9
  9. package/corpus/templates/analytics/actions/update-dashboard.ts +80 -6
  10. package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +1 -1
  11. package/corpus/templates/analytics/app/components/layout/Layout.tsx +1 -1
  12. package/corpus/templates/analytics/app/pages/Settings.tsx +5 -1
  13. package/corpus/templates/analytics/app/routes/agent.tsx +7 -5
  14. package/corpus/templates/analytics/changelog/2026-08-07-dashboard-creation-and-edits-now-save-faster-with-reliable-s.md +6 -0
  15. package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +19 -19
  16. package/corpus/templates/analytics/server/jobs/analytics-bigquery-backfill.ts +21 -2
  17. package/corpus/templates/analytics/server/lib/bigquery.ts +59 -24
  18. package/corpus/templates/analytics/server/lib/canonical-first-party-dashboard-repair.ts +44 -8
  19. package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +3 -5
  20. package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +33 -69
  21. package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +90 -24
  22. package/corpus/templates/analytics/server/lib/real-data-actions.ts +1 -1
  23. package/corpus/templates/analytics/server/plugins/agent-chat.ts +17 -2
  24. package/corpus/templates/analytics/shared/dashboard-report-timeouts.ts +2 -0
  25. package/corpus/templates/assets/.agents/skills/self-modifying-code/SKILL.md +7 -3
  26. package/corpus/templates/assets/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  27. package/corpus/templates/assets/app/components/layout/Layout.tsx +1 -1
  28. package/corpus/templates/assets/app/routes/agent.tsx +7 -5
  29. package/corpus/templates/assets/app/routes/settings.tsx +7 -2
  30. package/corpus/templates/assets/netlify.toml +1 -1
  31. package/corpus/templates/assets/package.json +1 -0
  32. package/corpus/templates/assets/scripts/migrate-production.ts +24 -0
  33. package/corpus/templates/assets/server/plugins/creative-context.ts +1 -1
  34. package/corpus/templates/assets/server/plugins/db.ts +1 -1
  35. package/corpus/templates/assets/tsconfig.json +1 -0
  36. package/corpus/templates/brain/.agents/skills/self-modifying-code/SKILL.md +7 -3
  37. package/corpus/templates/brain/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  38. package/corpus/templates/brain/app/components/layout/Layout.tsx +1 -1
  39. package/corpus/templates/brain/app/lib/brain.ts +4 -2
  40. package/corpus/templates/brain/app/root.tsx +1 -1
  41. package/corpus/templates/brain/app/routes/agent.tsx +10 -2
  42. package/corpus/templates/brain/netlify.toml +1 -1
  43. package/corpus/templates/brain/package.json +2 -0
  44. package/corpus/templates/brain/scripts/migrate-production.ts +24 -0
  45. package/corpus/templates/brain/server/plugins/db.ts +1 -1
  46. package/corpus/templates/brain/tsconfig.json +1 -0
  47. package/corpus/templates/calendar/.agents/skills/self-modifying-code/SKILL.md +7 -3
  48. package/corpus/templates/calendar/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  49. package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +1 -1
  50. package/corpus/templates/calendar/app/root.tsx +1 -1
  51. package/corpus/templates/calendar/app/routes/_app.agent.tsx +8 -16
  52. package/corpus/templates/calendar/netlify.toml +1 -1
  53. package/corpus/templates/calendar/package.json +1 -0
  54. package/corpus/templates/calendar/scripts/migrate-production.ts +24 -0
  55. package/corpus/templates/calendar/server/plugins/db.ts +1 -1
  56. package/corpus/templates/calendar/tsconfig.json +1 -0
  57. package/corpus/templates/chat/.agents/skills/self-modifying-code/SKILL.md +7 -3
  58. package/corpus/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  59. package/corpus/templates/chat/app/hooks/use-navigation-state.ts +5 -2
  60. package/corpus/templates/chat/app/routes/agent.tsx +7 -31
  61. package/corpus/templates/chat/netlify.toml +1 -1
  62. package/corpus/templates/chat/package.json +1 -0
  63. package/corpus/templates/chat/scripts/migrate-production.ts +31 -0
  64. package/corpus/templates/chat/tsconfig.json +1 -0
  65. package/corpus/templates/clips/.agents/skills/self-modifying-code/SKILL.md +7 -3
  66. package/corpus/templates/clips/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  67. package/corpus/templates/clips/app/components/library/library-layout.tsx +1 -1
  68. package/corpus/templates/clips/app/root.tsx +1 -1
  69. package/corpus/templates/clips/app/routes/_app.agent.tsx +9 -7
  70. package/corpus/templates/clips/netlify.toml +1 -1
  71. package/corpus/templates/clips/package.json +1 -0
  72. package/corpus/templates/clips/scripts/migrate-production.ts +24 -0
  73. package/corpus/templates/clips/server/plugins/db.ts +1 -1
  74. package/corpus/templates/clips/tsconfig.json +1 -0
  75. package/corpus/templates/content/.agents/skills/self-modifying-code/SKILL.md +7 -3
  76. package/corpus/templates/content/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  77. package/corpus/templates/content/app/components/layout/Layout.tsx +1 -1
  78. package/corpus/templates/content/app/root.tsx +1 -1
  79. package/corpus/templates/content/app/routes/_app.agent.tsx +9 -8
  80. package/corpus/templates/content/app/routes/_app.settings.tsx +7 -2
  81. package/corpus/templates/content/netlify.toml +1 -1
  82. package/corpus/templates/content/package.json +2 -0
  83. package/corpus/templates/content/scripts/migrate-production.ts +28 -0
  84. package/corpus/templates/content/server/plugins/creative-context.ts +1 -1
  85. package/corpus/templates/content/server/plugins/db.ts +2 -2
  86. package/corpus/templates/crm/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  87. package/corpus/templates/crm/app/components/crm/RecordActions.tsx +4 -1
  88. package/corpus/templates/crm/app/components/layout/CrmLayout.tsx +1 -1
  89. package/corpus/templates/crm/app/routes/agent.tsx +10 -2
  90. package/corpus/templates/crm/netlify.toml +1 -1
  91. package/corpus/templates/crm/package.json +2 -0
  92. package/corpus/templates/crm/scripts/migrate-production.ts +24 -0
  93. package/corpus/templates/crm/server/plugins/db.ts +1 -1
  94. package/corpus/templates/crm/tsconfig.json +1 -0
  95. package/corpus/templates/design/.agents/skills/self-modifying-code/SKILL.md +7 -3
  96. package/corpus/templates/design/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  97. package/corpus/templates/design/app/components/layout/Layout.tsx +1 -1
  98. package/corpus/templates/design/app/root.tsx +1 -1
  99. package/corpus/templates/design/app/routes/agent.tsx +9 -7
  100. package/corpus/templates/design/app/routes/settings.tsx +7 -2
  101. package/corpus/templates/design/netlify.toml +1 -1
  102. package/corpus/templates/design/package.json +1 -0
  103. package/corpus/templates/design/scripts/migrate-production.ts +24 -0
  104. package/corpus/templates/design/server/plugins/creative-context.ts +1 -1
  105. package/corpus/templates/design/server/plugins/db.ts +1 -1
  106. package/corpus/templates/design/tsconfig.json +1 -0
  107. package/corpus/templates/dispatch/.agents/skills/self-modifying-code/SKILL.md +7 -3
  108. package/corpus/templates/dispatch/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  109. package/corpus/templates/dispatch/app/root.tsx +5 -2
  110. package/corpus/templates/dispatch/app/routes/agent.tsx +7 -7
  111. package/corpus/templates/dispatch/netlify.toml +1 -1
  112. package/corpus/templates/dispatch/package.json +1 -0
  113. package/corpus/templates/dispatch/scripts/migrate-production.ts +23 -0
  114. package/corpus/templates/dispatch/tsconfig.json +1 -0
  115. package/corpus/templates/factory/.agents/skills/self-modifying-code/SKILL.md +7 -3
  116. package/corpus/templates/factory/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  117. package/corpus/templates/factory/app/components/layout/Layout.tsx +1 -1
  118. package/corpus/templates/factory/app/hooks/use-navigation-state.ts +5 -2
  119. package/corpus/templates/factory/app/root.tsx +1 -1
  120. package/corpus/templates/factory/app/routes/agent.tsx +9 -14
  121. package/corpus/templates/factory/netlify.toml +1 -1
  122. package/corpus/templates/factory/package.json +1 -0
  123. package/corpus/templates/factory/scripts/migrate-production.ts +31 -0
  124. package/corpus/templates/factory/server/plugins/factory-scheduler-job.ts +2 -0
  125. package/corpus/templates/factory/tsconfig.json +1 -0
  126. package/corpus/templates/forms/.agents/skills/self-modifying-code/SKILL.md +7 -3
  127. package/corpus/templates/forms/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  128. package/corpus/templates/forms/app/components/layout/Layout.tsx +1 -1
  129. package/corpus/templates/forms/app/root.tsx +1 -1
  130. package/corpus/templates/forms/app/routes/_app.agent.tsx +9 -7
  131. package/corpus/templates/forms/netlify.toml +1 -1
  132. package/corpus/templates/forms/package.json +2 -0
  133. package/corpus/templates/forms/scripts/migrate-production.ts +24 -0
  134. package/corpus/templates/forms/server/plugins/db.ts +1 -1
  135. package/corpus/templates/forms/tsconfig.json +1 -0
  136. package/corpus/templates/macros/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  137. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +5 -3
  138. package/corpus/templates/macros/app/root.tsx +1 -1
  139. package/corpus/templates/macros/app/routes/agent.tsx +9 -6
  140. package/corpus/templates/macros/netlify.toml +1 -1
  141. package/corpus/templates/macros/package.json +1 -0
  142. package/corpus/templates/macros/scripts/migrate-production.ts +24 -0
  143. package/corpus/templates/macros/server/plugins/db.ts +1 -1
  144. package/corpus/templates/macros/tsconfig.json +1 -0
  145. package/corpus/templates/mail/.agents/skills/self-modifying-code/SKILL.md +7 -3
  146. package/corpus/templates/mail/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  147. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +8 -2
  148. package/corpus/templates/mail/app/components/layout/CommandPalette.tsx +1 -1
  149. package/corpus/templates/mail/app/routes/agent.tsx +9 -6
  150. package/corpus/templates/mail/netlify.toml +1 -1
  151. package/corpus/templates/mail/package.json +1 -0
  152. package/corpus/templates/mail/scripts/migrate-production.ts +24 -0
  153. package/corpus/templates/mail/server/plugins/db.ts +1 -1
  154. package/corpus/templates/mail/tsconfig.json +1 -0
  155. package/corpus/templates/plan/.agents/skills/self-modifying-code/SKILL.md +7 -3
  156. package/corpus/templates/plan/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  157. package/corpus/templates/plan/app/components/layout/Layout.tsx +1 -1
  158. package/corpus/templates/plan/app/root.tsx +1 -1
  159. package/corpus/templates/plan/app/routes/agent.tsx +9 -6
  160. package/corpus/templates/plan/netlify.toml +1 -1
  161. package/corpus/templates/plan/package.json +1 -0
  162. package/corpus/templates/plan/scripts/migrate-production.ts +24 -0
  163. package/corpus/templates/plan/server/plugins/00-mcp.ts +3 -2
  164. package/corpus/templates/plan/server/plugins/db.ts +1 -1
  165. package/corpus/templates/plan/tsconfig.json +1 -0
  166. package/corpus/templates/slides/.agents/skills/self-modifying-code/SKILL.md +7 -3
  167. package/corpus/templates/slides/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  168. package/corpus/templates/slides/app/components/editor/ImageGenPanel.tsx +8 -12
  169. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +39 -2
  170. package/corpus/templates/slides/app/components/layout/Layout.tsx +1 -1
  171. package/corpus/templates/slides/app/i18n/en-US.ts +1 -0
  172. package/corpus/templates/slides/app/lib/create-deck-generation.ts +22 -5
  173. package/corpus/templates/slides/app/pages/Index.tsx +20 -5
  174. package/corpus/templates/slides/app/root.tsx +1 -1
  175. package/corpus/templates/slides/app/routes/agent.tsx +6 -9
  176. package/corpus/templates/slides/app/routes/settings.tsx +7 -2
  177. package/corpus/templates/slides/netlify.toml +1 -1
  178. package/corpus/templates/slides/package.json +1 -0
  179. package/corpus/templates/slides/scripts/migrate-production.ts +24 -0
  180. package/corpus/templates/slides/server/plugins/creative-context.ts +1 -1
  181. package/corpus/templates/slides/server/plugins/db.ts +1 -1
  182. package/corpus/templates/slides/tsconfig.json +1 -0
  183. package/corpus/templates/tasks/.agents/skills/self-modifying-code/SKILL.md +7 -3
  184. package/corpus/templates/tasks/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  185. package/corpus/templates/tasks/app/components/layout/Layout.tsx +1 -1
  186. package/corpus/templates/tasks/app/routes/agent.tsx +10 -2
  187. package/corpus/templates/tasks/netlify.toml +1 -1
  188. package/corpus/templates/tasks/package.json +1 -0
  189. package/corpus/templates/tasks/scripts/migrate-production.ts +24 -0
  190. package/corpus/templates/tasks/server/plugins/db.ts +1 -1
  191. package/corpus/templates/tasks/tsconfig.json +1 -0
  192. package/dist/action.d.ts +2 -0
  193. package/dist/agent/production-agent.d.ts +1 -0
  194. package/dist/agent/production-agent.js +2 -0
  195. package/dist/agent/thread-data-builder.d.ts +4 -0
  196. package/dist/agent/thread-data-builder.js +44 -0
  197. package/dist/automations/service.d.ts +1 -0
  198. package/dist/automations/service.js +21 -2
  199. package/dist/cli/create.js +20 -2
  200. package/dist/client/agent-page/AgentJobsTab.js +3 -1
  201. package/dist/client/agent-page/AutomationDetailsDialog.js +9 -2
  202. package/dist/client/index.d.ts +1 -1
  203. package/dist/client/navigation/index.d.ts +1 -1
  204. package/dist/client/navigation/index.js +1 -1
  205. package/dist/client/org/OrgSwitcher.js +1 -1
  206. package/dist/client/settings/SettingsPanel.d.ts +8 -0
  207. package/dist/client/settings/SettingsPanel.js +16 -1
  208. package/dist/client/settings/index.d.ts +1 -1
  209. package/dist/collab/struct-routes.d.ts +1 -1
  210. package/dist/db/migrations.js +7 -13
  211. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  212. package/dist/jobs/actions/list-automation-runs.d.ts +1 -0
  213. package/dist/jobs/actions/list-automation-runs.js +9 -2
  214. package/dist/jobs/actions/list-recurring-jobs.js +3 -1
  215. package/dist/jobs/actions/manage-recurring-job.js +1 -1
  216. package/dist/jobs/actions/run-automation-now.js +1 -0
  217. package/dist/jobs/background-automation-runner.js +2 -0
  218. package/dist/jobs/frontmatter.d.ts +2 -0
  219. package/dist/jobs/frontmatter.js +4 -0
  220. package/dist/jobs/run-history.d.ts +4 -0
  221. package/dist/jobs/run-history.js +28 -8
  222. package/dist/jobs/run-now.d.ts +4 -1
  223. package/dist/jobs/run-now.js +4 -3
  224. package/dist/jobs/scheduler.js +18 -0
  225. package/dist/jobs/tools.d.ts +3 -2
  226. package/dist/jobs/tools.js +26 -12
  227. package/dist/localization/default-messages.d.ts +1 -0
  228. package/dist/localization/default-messages.js +1 -0
  229. package/dist/navigation/index.d.ts +1 -0
  230. package/dist/navigation/index.js +34 -0
  231. package/dist/notifications/routes.d.ts +1 -1
  232. package/dist/observability/routes.d.ts +1 -1
  233. package/dist/resources/handlers.d.ts +1 -1
  234. package/dist/server/action-routes.d.ts +2 -0
  235. package/dist/server/action-routes.js +1 -0
  236. package/dist/server/agent-chat-plugin.js +3 -2
  237. package/dist/server/builder-browser.js +24 -8
  238. package/dist/templates/chat/.agents/skills/self-modifying-code/SKILL.md +7 -3
  239. package/dist/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  240. package/dist/templates/chat/app/hooks/use-navigation-state.ts +5 -2
  241. package/dist/templates/chat/app/routes/agent.tsx +7 -31
  242. package/dist/templates/chat/netlify.toml +1 -1
  243. package/dist/templates/chat/package.json +1 -0
  244. package/dist/templates/chat/scripts/migrate-production.ts +31 -0
  245. package/dist/templates/chat/tsconfig.json +1 -0
  246. package/dist/templates/default/.agents/skills/self-modifying-code/SKILL.md +7 -3
  247. package/dist/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  248. package/dist/templates/default/app/routes/_index.tsx +1 -1
  249. package/dist/templates/default/app/routes/agent.tsx +7 -25
  250. package/dist/templates/default/package.json +1 -0
  251. package/dist/templates/default/scripts/migrate-production.ts +31 -0
  252. package/dist/templates/default/tsconfig.json +1 -0
  253. package/dist/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  254. package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +7 -3
  255. package/dist/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  256. package/dist/templates/workspace-root/AGENTS.md +2 -1
  257. package/dist/triggers/actions/list-automations.js +1 -1
  258. package/dist/triggers/actions/manage-automation.js +5 -1
  259. package/dist/triggers/actions.d.ts +1 -1
  260. package/dist/triggers/actions.js +21 -15
  261. package/dist/triggers/dispatcher.js +17 -2
  262. package/dist/triggers/routes.d.ts +1 -0
  263. package/dist/triggers/routes.js +1 -0
  264. package/package.json +3 -3
  265. package/src/templates/chat/.agents/skills/self-modifying-code/SKILL.md +7 -3
  266. package/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  267. package/src/templates/chat/app/hooks/use-navigation-state.ts +5 -2
  268. package/src/templates/chat/app/routes/agent.tsx +7 -31
  269. package/src/templates/chat/netlify.toml +1 -1
  270. package/src/templates/chat/package.json +1 -0
  271. package/src/templates/chat/scripts/migrate-production.ts +31 -0
  272. package/src/templates/chat/tsconfig.json +1 -0
  273. package/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +7 -3
  274. package/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  275. package/src/templates/default/app/routes/_index.tsx +1 -1
  276. package/src/templates/default/app/routes/agent.tsx +7 -25
  277. package/src/templates/default/package.json +1 -0
  278. package/src/templates/default/scripts/migrate-production.ts +31 -0
  279. package/src/templates/default/tsconfig.json +1 -0
  280. package/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  281. package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +7 -3
  282. package/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +5 -2
  283. package/src/templates/workspace-root/AGENTS.md +2 -1
@@ -1,5 +1,4 @@
1
- import { useT } from "@agent-native/core/client/i18n";
2
- import { useSetPageTitle } from "@agent-native/toolkit/app-shell";
1
+ import { buildLegacyAgentSettingsRoute } from "@agent-native/core/client/navigation";
3
2
  import { Navigate, useLocation } from "react-router";
4
3
 
5
4
  export function meta() {
@@ -7,34 +6,11 @@ export function meta() {
7
6
  }
8
7
 
9
8
  export default function AgentRoute() {
10
- const t = useT();
11
9
  const location = useLocation();
12
- useSetPageTitle(t("settings.agentTitle"));
13
-
14
- const legacyTab = location.hash.replace(/^#/, "").toLowerCase();
15
- const resourceTabs = new Set([
16
- "files",
17
- "instructions",
18
- "agents",
19
- "memory",
20
- "skills",
21
- "learnings",
22
- ]);
23
- const destination = resourceTabs.has(legacyTab)
24
- ? `/settings/agent/resources/${legacyTab}`
25
- : legacyTab === "remote-agents"
26
- ? "/settings/agent/agents"
27
- : legacyTab === "connections"
28
- ? "/settings/integrations"
29
- : legacyTab === "jobs"
30
- ? "/settings/agent/automations"
31
- : legacyTab === "access"
32
- ? "/settings/agent"
33
- : ["llm", "app-models", "limits", "voice", "background"].includes(
34
- legacyTab,
35
- )
36
- ? `/settings/agent/${legacyTab}`
37
- : "/settings/agent";
38
-
39
- return <Navigate to={destination} replace />;
10
+ return (
11
+ <Navigate
12
+ to={buildLegacyAgentSettingsRoute(location.hash, location.search)}
13
+ replace
14
+ />
15
+ );
40
16
  }
@@ -1,6 +1,6 @@
1
1
  [build]
2
2
  ignore = "node ./scripts/netlify-ignore-build.mjs chat"
3
- command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter chat build"
3
+ command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter chat build && if [ \"${CONTEXT:-}\" = \"production\" ]; then pnpm --filter chat migrate:production; fi"
4
4
  publish = "templates/chat/dist"
5
5
  functions = "templates/chat/.netlify/functions-internal"
6
6
 
@@ -5,6 +5,7 @@
5
5
  "description": "Minimal chat-first agent-native app template.",
6
6
  "type": "module",
7
7
  "scripts": {
8
+ "migrate:production": "tsx scripts/migrate-production.ts",
8
9
  "dev": "agent-native dev --open",
9
10
  "build": "agent-native build",
10
11
  "start": "agent-native start",
@@ -0,0 +1,31 @@
1
+ import { closeDbExec, withMigrationRuntime } from "@agent-native/core/db";
2
+ import { runFrameworkReleaseMigrations } from "@agent-native/core/server";
3
+
4
+ /**
5
+ * Release-time schema entrypoint.
6
+ *
7
+ * Every deploy runs this once, and request functions never touch schema. That
8
+ * ordering is not an optimization: on serverless, "migrate on first use" means
9
+ * migrate on EVERY cold start, and a production incident traced a multi-hour
10
+ * outage to schema introspection running 4-6 times concurrently on the request
11
+ * path.
12
+ *
13
+ * `withMigrationRuntime()` is load-bearing. The Netlify BUILD environment sets
14
+ * NETLIFY=true, so this script looks like a serverless request to the guard in
15
+ * `runMigrations` — it is allowed to migrate only because it claims duty here.
16
+ * A release entrypoint that forgets the wrapper silently does nothing.
17
+ *
18
+ * If this app owns tables of its own, export its migration runner from
19
+ * `server/plugins/db.ts` and call it inside the same block.
20
+ */
21
+ async function main(): Promise<void> {
22
+ await withMigrationRuntime(async () => {
23
+ await runFrameworkReleaseMigrations(null);
24
+ });
25
+ }
26
+
27
+ try {
28
+ await main();
29
+ } finally {
30
+ await closeDbExec();
31
+ }
@@ -13,6 +13,7 @@
13
13
  "app/**/*",
14
14
  "server/**/*",
15
15
  "shared/**/*",
16
+ "scripts/**/*",
16
17
  "vite.config.ts",
17
18
  "react-router.config.ts",
18
19
  ".react-router/types/**/*",
@@ -36,8 +36,10 @@ Tier 4 includes **all** of the following — not only editing package source:
36
36
  - Files under `node_modules/@agent-native/*` (core, dispatch, scheduling, …)
37
37
  - `pnpm.overrides`, `overrides`, `resolutions`, or `patchedDependencies` that
38
38
  target any `@agent-native/*` package
39
- - Local package patches or invented "dispatch/core behavior" shims meant to
40
- paper over a version skew or failed upgrade
39
+ - `pnpm patch`, `pnpm patch-commit`, or local package patch artifacts for any
40
+ dependency
41
+ - Invented "dispatch/core behavior" shims meant to paper over a version skew
42
+ or failed upgrade
41
43
 
42
44
  This does not prohibit intentional app-owned UI customization. When public
43
45
  props and composition are insufficient, the `customizing-agent-native` skill
@@ -100,8 +102,10 @@ inline strings in components.
100
102
  - Don't confuse readable package source with app-owned code: use
101
103
  `customizing-agent-native` and `agent-native eject` for supported ownership
102
104
  transfer
105
+ - Don't use `pnpm patch` / `pnpm patch-commit`, commit `patches/` artifacts, or
106
+ add `pnpm.patchedDependencies` to "make the app run" after a version bump
103
107
  - Don't add `pnpm.overrides` / `patchedDependencies` / `resolutions` for
104
- `@agent-native/*` to "make the app run" after a version bump
108
+ `@agent-native/*` to paper over a broken upgrade
105
109
  - Don't invent local dispatch/core behavior overrides when upgrade fails —
106
110
  run `npx @agent-native/core@latest upgrade`, then fix app-level errors only
107
111
  - Don't modify `.agents/skills/` or `AGENTS.md` unless explicitly requested
@@ -15,8 +15,9 @@ metadata:
15
15
 
16
16
  When an older Agent Native app/branch needs to run on current packages, use
17
17
  `agent-native upgrade`. Never "fix" upgrade breakage with
18
- `pnpm.overrides`, `patchedDependencies`, `resolutions`, local patches, or
19
- edits under `node_modules/@agent-native/*` — especially not against
18
+ `pnpm patch`, `pnpm patch-commit`, `pnpm.patchedDependencies`,
19
+ `pnpm.overrides`, `patchedDependencies`, `resolutions`, local patch artifacts,
20
+ or edits under `node_modules/@agent-native/*` — especially not against
20
21
  `@agent-native/core` or `@agent-native/dispatch`.
21
22
 
22
23
  ## Why
@@ -109,6 +110,8 @@ install → refresh scaffold skills → verify, then fix **app** code only.
109
110
 
110
111
  - Don't add `pnpm.overrides`, `overrides`, `resolutions`, or
111
112
  `patchedDependencies` for any `@agent-native/*` package
113
+ - Don't run `pnpm patch` or `pnpm patch-commit`, or commit files under
114
+ `patches/`, for any dependency
112
115
  - Don't edit `node_modules/@agent-native/core` or
113
116
  `node_modules/@agent-native/dispatch`
114
117
  - Don't invent local "dispatch behavior" shims to paper over version skew
@@ -722,7 +722,7 @@ export function LibraryLayout({ children }: LibraryLayoutProps) {
722
722
  t("navigation.agentSuggestionPricing"),
723
723
  t("navigation.agentSuggestionFiller"),
724
724
  ]}
725
- agentPageHref="/agent"
725
+ agentPageHref="/settings/agent"
726
726
  scope={recordingScope}
727
727
  browserTabId={getBrowserTabId()}
728
728
  >
@@ -369,7 +369,7 @@ function AppContent() {
369
369
  changelogKey="clips"
370
370
  >
371
371
  <CommandMenu.Group heading={t("root.commandActions")}>
372
- <CommandMenu.Item onSelect={() => navigate("/agent")}>
372
+ <CommandMenu.Item onSelect={() => navigate("/settings/agent")}>
373
373
  <IconHierarchy2 size={16} />
374
374
  {t("root.openAgent")}
375
375
  </CommandMenu.Item>
@@ -1,6 +1,5 @@
1
- import { AgentTabsPage } from "@agent-native/core/client/agent-chat";
2
- import { useT } from "@agent-native/core/client/i18n";
3
- import { useSetPageTitle } from "@agent-native/toolkit/app-shell";
1
+ import { buildLegacyAgentSettingsRoute } from "@agent-native/core/client/navigation";
2
+ import { Navigate, useLocation } from "react-router";
4
3
 
5
4
  import messages from "@/i18n/en-US";
6
5
 
@@ -9,8 +8,11 @@ export function meta() {
9
8
  }
10
9
 
11
10
  export default function AgentRoute() {
12
- const t = useT();
13
- useSetPageTitle(t("settings.agentTitle"));
14
-
15
- return <AgentTabsPage />;
11
+ const location = useLocation();
12
+ return (
13
+ <Navigate
14
+ to={buildLegacyAgentSettingsRoute(location.hash, location.search)}
15
+ replace
16
+ />
17
+ );
16
18
  }
@@ -1,6 +1,6 @@
1
1
  [build]
2
2
  ignore = "node ./scripts/netlify-ignore-build.mjs clips"
3
- command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter clips build && pnpm exec tsx templates/clips/jobs/emit-netlify-brain-export-cron.ts"
3
+ command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter clips build && pnpm exec tsx templates/clips/jobs/emit-netlify-brain-export-cron.ts && if [ \"${CONTEXT:-}\" = \"production\" ]; then pnpm --filter clips migrate:production; fi"
4
4
  publish = "templates/clips/dist"
5
5
  functions = "templates/clips/.netlify/functions-internal"
6
6
 
@@ -8,6 +8,7 @@
8
8
  "build": "agent-native build",
9
9
  "start": "agent-native start",
10
10
  "typecheck": "agent-native typecheck",
11
+ "migrate:production": "tsx scripts/migrate-production.ts",
11
12
  "action": "agent-native action",
12
13
  "script": "agent-native script",
13
14
  "tauri": "cd desktop && pnpm tauri",
@@ -0,0 +1,24 @@
1
+ import { closeDbExec, withMigrationRuntime } from "@agent-native/core/db";
2
+ import { runFrameworkReleaseMigrations } from "@agent-native/core/server";
3
+
4
+ import { migrations as runClipsMigrations } from "../server/plugins/db.js";
5
+
6
+ /**
7
+ * Release-time schema entrypoint for Clips.
8
+ *
9
+ * This script is the production owner of schema changes. It runs against the
10
+ * direct migration endpoint selected by core, while request functions skip
11
+ * all migration and ensure-table work automatically.
12
+ */
13
+ async function main(): Promise<void> {
14
+ await withMigrationRuntime(async () => {
15
+ await runFrameworkReleaseMigrations(null);
16
+ await runClipsMigrations(null);
17
+ });
18
+ }
19
+
20
+ try {
21
+ await main();
22
+ } finally {
23
+ await closeDbExec();
24
+ }
@@ -236,7 +236,7 @@ function scheduleRecordingOrgIdBackfill(): void {
236
236
  // packages/core/src/db/migrations.ts for the full rationale). Version numbers
237
237
  // alone are not a safe identity across parallel branches that each extend
238
238
  // this list independently — see the v41 incident documented on v41 below.
239
- const migrations = runMigrations(
239
+ export const migrations = runMigrations(
240
240
  [
241
241
  // ---------------------------------------------------------------------------
242
242
  // Workspaces & members
@@ -13,6 +13,7 @@
13
13
  "app/**/*",
14
14
  "server/**/*",
15
15
  "shared/**/*",
16
+ "scripts/**/*",
16
17
  "vite.config.ts",
17
18
  "react-router.config.ts",
18
19
  ".react-router/types/**/*",
@@ -36,8 +36,10 @@ Tier 4 includes **all** of the following — not only editing package source:
36
36
  - Files under `node_modules/@agent-native/*` (core, dispatch, scheduling, …)
37
37
  - `pnpm.overrides`, `overrides`, `resolutions`, or `patchedDependencies` that
38
38
  target any `@agent-native/*` package
39
- - Local package patches or invented "dispatch/core behavior" shims meant to
40
- paper over a version skew or failed upgrade
39
+ - `pnpm patch`, `pnpm patch-commit`, or local package patch artifacts for any
40
+ dependency
41
+ - Invented "dispatch/core behavior" shims meant to paper over a version skew
42
+ or failed upgrade
41
43
 
42
44
  This does not prohibit intentional app-owned UI customization. When public
43
45
  props and composition are insufficient, the `customizing-agent-native` skill
@@ -100,8 +102,10 @@ inline strings in components.
100
102
  - Don't confuse readable package source with app-owned code: use
101
103
  `customizing-agent-native` and `agent-native eject` for supported ownership
102
104
  transfer
105
+ - Don't use `pnpm patch` / `pnpm patch-commit`, commit `patches/` artifacts, or
106
+ add `pnpm.patchedDependencies` to "make the app run" after a version bump
103
107
  - Don't add `pnpm.overrides` / `patchedDependencies` / `resolutions` for
104
- `@agent-native/*` to "make the app run" after a version bump
108
+ `@agent-native/*` to paper over a broken upgrade
105
109
  - Don't invent local dispatch/core behavior overrides when upgrade fails —
106
110
  run `npx @agent-native/core@latest upgrade`, then fix app-level errors only
107
111
  - Don't modify `.agents/skills/` or `AGENTS.md` unless explicitly requested
@@ -15,8 +15,9 @@ metadata:
15
15
 
16
16
  When an older Agent Native app/branch needs to run on current packages, use
17
17
  `agent-native upgrade`. Never "fix" upgrade breakage with
18
- `pnpm.overrides`, `patchedDependencies`, `resolutions`, local patches, or
19
- edits under `node_modules/@agent-native/*` — especially not against
18
+ `pnpm patch`, `pnpm patch-commit`, `pnpm.patchedDependencies`,
19
+ `pnpm.overrides`, `patchedDependencies`, `resolutions`, local patch artifacts,
20
+ or edits under `node_modules/@agent-native/*` — especially not against
20
21
  `@agent-native/core` or `@agent-native/dispatch`.
21
22
 
22
23
  ## Why
@@ -109,6 +110,8 @@ install → refresh scaffold skills → verify, then fix **app** code only.
109
110
 
110
111
  - Don't add `pnpm.overrides`, `overrides`, `resolutions`, or
111
112
  `patchedDependencies` for any `@agent-native/*` package
113
+ - Don't run `pnpm patch` or `pnpm patch-commit`, or commit files under
114
+ `patches/`, for any dependency
112
115
  - Don't edit `node_modules/@agent-native/core` or
113
116
  `node_modules/@agent-native/dispatch`
114
117
  - Don't invent local "dispatch behavior" shims to paper over version skew
@@ -192,7 +192,7 @@ export function Layout({ children }: LayoutProps) {
192
192
  <AgentSidebar
193
193
  position="right"
194
194
  defaultOpen={false}
195
- agentPageHref="/agent"
195
+ agentPageHref="/settings/agent"
196
196
  emptyStateText={t("chat.emptyState")}
197
197
  suggestions={[
198
198
  t("chat.suggestionPrd"),
@@ -570,7 +570,7 @@ function ContentCommandMenu({
570
570
  )}
571
571
  >
572
572
  <CommandMenu.Group heading={t("root.commandContent")}>
573
- <CommandMenu.Item onSelect={() => navigate("/agent")}>
573
+ <CommandMenu.Item onSelect={() => navigate("/settings/agent")}>
574
574
  <IconHierarchy2 size={16} />
575
575
  {t("root.openAgent")}
576
576
  </CommandMenu.Item>
@@ -1,7 +1,5 @@
1
- import { AgentTabsPage } from "@agent-native/core/client/agent-chat";
2
- import { useT } from "@agent-native/core/client/i18n";
3
- import { createCreativeContextAgentTab } from "@agent-native/creative-context/client";
4
- import { useSetPageTitle } from "@agent-native/toolkit/app-shell";
1
+ import { buildLegacyAgentSettingsRoute } from "@agent-native/core/client/navigation";
2
+ import { Navigate, useLocation } from "react-router";
5
3
 
6
4
  import { messagesByLocale } from "@/i18n-data";
7
5
 
@@ -10,8 +8,11 @@ export function meta() {
10
8
  }
11
9
 
12
10
  export default function AgentRoute() {
13
- const t = useT();
14
- useSetPageTitle(t("settings.agentTitle"));
15
-
16
- return <AgentTabsPage extraTabFactories={[createCreativeContextAgentTab]} />;
11
+ const location = useLocation();
12
+ return (
13
+ <Navigate
14
+ to={buildLegacyAgentSettingsRoute(location.hash, location.search)}
15
+ replace
16
+ />
17
+ );
17
18
  }
@@ -9,7 +9,10 @@ import {
9
9
  useAgentSettingsTabs,
10
10
  type SettingsSearchEntry,
11
11
  } from "@agent-native/core/client/settings";
12
- import { CreativeContextSettingsLink } from "@agent-native/creative-context/client";
12
+ import {
13
+ CreativeContextSettingsLink,
14
+ createCreativeContextAgentTab,
15
+ } from "@agent-native/creative-context/client";
13
16
  import { useSetPageTitle } from "@agent-native/toolkit/app-shell";
14
17
  import { useMemo } from "react";
15
18
  import { toast } from "sonner";
@@ -26,7 +29,9 @@ export function meta() {
26
29
 
27
30
  export default function SettingsRoute() {
28
31
  const t = useT();
29
- const agentSettingsTabs = useAgentSettingsTabs();
32
+ const agentSettingsTabs = useAgentSettingsTabs({
33
+ agentAdditionalTabFactories: [createCreativeContextAgentTab],
34
+ });
30
35
  useSetPageTitle(t("settings.title"));
31
36
  const { prefs, loading: prefsLoading, save: savePrefs } = useContentPrefs();
32
37
 
@@ -1,6 +1,6 @@
1
1
  [build]
2
2
  ignore = "node ./scripts/netlify-ignore-build.mjs content"
3
- command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter content build"
3
+ command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter content build && if [ \"${CONTEXT:-}\" = \"production\" ]; then pnpm --filter content migrate:production; fi"
4
4
  publish = "templates/content/dist"
5
5
  functions = "templates/content/.netlify/functions-internal"
6
6
 
@@ -14,6 +14,7 @@
14
14
  "eval:parity": "agent-native eval parity",
15
15
  "format.fix": "oxfmt --write .",
16
16
  "typecheck": "agent-native typecheck",
17
+ "migrate:production": "tsx scripts/migrate-production.ts",
17
18
  "action": "agent-native action",
18
19
  "script": "agent-native script",
19
20
  "seed:demo": "node scripts/seed-demo-user.mjs"
@@ -99,6 +100,7 @@
99
100
  "sonner": "^2.0.7",
100
101
  "tailwind-merge": "^3.5.0",
101
102
  "tailwindcss": "catalog:",
103
+ "tsx": "^4.20.3",
102
104
  "typescript-7": "catalog:",
103
105
  "vite": "catalog:",
104
106
  "vitest": "catalog:"
@@ -0,0 +1,28 @@
1
+ import { closeDbExec, withMigrationRuntime } from "@agent-native/core/db";
2
+ import { runFrameworkReleaseMigrations } from "@agent-native/core/server";
3
+
4
+ import {
5
+ runContentMigrations,
6
+ runContentSourceMigrations,
7
+ } from "../server/plugins/db.js";
8
+
9
+ /**
10
+ * Release-time schema entrypoint for Content.
11
+ *
12
+ * This script is the production owner of schema changes. It runs against the
13
+ * direct migration endpoint selected by core, while request functions skip
14
+ * all migration and ensure-table work automatically.
15
+ */
16
+ async function main(): Promise<void> {
17
+ await withMigrationRuntime(async () => {
18
+ await runFrameworkReleaseMigrations(null);
19
+ await runContentMigrations(null);
20
+ await runContentSourceMigrations(null);
21
+ });
22
+ }
23
+
24
+ try {
25
+ await main();
26
+ } finally {
27
+ await closeDbExec();
28
+ }
@@ -20,7 +20,7 @@ registerOnboardingStep({
20
20
  kind: "link",
21
21
  primary: true,
22
22
  label: "Open Library",
23
- payload: { url: "/agent#library", external: false },
23
+ payload: { url: "/settings/library", external: false },
24
24
  },
25
25
  ],
26
26
  isComplete: async () => {
@@ -43,7 +43,7 @@ function scheduleBlocksRepairRetry(attempt = 1): void {
43
43
  // alone are not a safe identity across parallel branches that each extend
44
44
  // this list independently — see the analytics db.ts v75-v83 incident this
45
45
  // convention was introduced to prevent.
46
- const runContentMigrations = runMigrations(
46
+ export const runContentMigrations = runMigrations(
47
47
  [
48
48
  {
49
49
  version: 1,
@@ -960,7 +960,7 @@ const runContentMigrations = runMigrations(
960
960
  { table: "content_migrations" },
961
961
  );
962
962
 
963
- const runContentSourceMigrations = runMigrations(
963
+ export const runContentSourceMigrations = runMigrations(
964
964
  [
965
965
  {
966
966
  version: 1,
@@ -15,8 +15,9 @@ metadata:
15
15
 
16
16
  When an older Agent Native app/branch needs to run on current packages, use
17
17
  `agent-native upgrade`. Never "fix" upgrade breakage with
18
- `pnpm.overrides`, `patchedDependencies`, `resolutions`, local patches, or
19
- edits under `node_modules/@agent-native/*` — especially not against
18
+ `pnpm patch`, `pnpm patch-commit`, `pnpm.patchedDependencies`,
19
+ `pnpm.overrides`, `patchedDependencies`, `resolutions`, local patch artifacts,
20
+ or edits under `node_modules/@agent-native/*` — especially not against
20
21
  `@agent-native/core` or `@agent-native/dispatch`.
21
22
 
22
23
  ## Why
@@ -109,6 +110,8 @@ install → refresh scaffold skills → verify, then fix **app** code only.
109
110
 
110
111
  - Don't add `pnpm.overrides`, `overrides`, `resolutions`, or
111
112
  `patchedDependencies` for any `@agent-native/*` package
113
+ - Don't run `pnpm patch` or `pnpm patch-commit`, or commit files under
114
+ `patches/`, for any dependency
112
115
  - Don't edit `node_modules/@agent-native/core` or
113
116
  `node_modules/@agent-native/dispatch`
114
117
  - Don't invent local "dispatch behavior" shims to paper over version skew
@@ -601,7 +601,10 @@ function CallEvidenceAutomationDialog({ record }: { record: CrmRecordDetail }) {
601
601
  </div>
602
602
  <DialogFooter className="flex-row flex-wrap justify-end gap-2 sm:justify-end">
603
603
  <Button asChild variant="ghost" size="sm" className="gap-1.5">
604
- <Link to="/agent#jobs" onClick={() => setOpen(false)}>
604
+ <Link
605
+ to="/settings/agent/automations"
606
+ onClick={() => setOpen(false)}
607
+ >
605
608
  <IconExternalLink className="size-4" />{" "}
606
609
  {t("recordActions.manageAutomations")}
607
610
  </Link>
@@ -121,7 +121,7 @@ export function CrmLayout({ children }: { children: React.ReactNode }) {
121
121
  "Summarize this account",
122
122
  "Which opportunities need attention?",
123
123
  ]}
124
- agentPageHref="/agent"
124
+ agentPageHref="/settings/agent"
125
125
  >
126
126
  {shell}
127
127
  </AgentSidebar>
@@ -1,5 +1,13 @@
1
- import { AgentTabsPage } from "@agent-native/core/client/agent-chat";
1
+ import { buildLegacyAgentSettingsRoute } from "@agent-native/core/client/navigation";
2
+ import { Navigate, useLocation } from "react-router";
2
3
 
3
4
  export default function AgentRoute() {
4
- return <AgentTabsPage appName="CRM" />;
5
+ const location = useLocation();
6
+
7
+ return (
8
+ <Navigate
9
+ to={buildLegacyAgentSettingsRoute(location.hash, location.search)}
10
+ replace
11
+ />
12
+ );
5
13
  }
@@ -1,6 +1,6 @@
1
1
  [build]
2
2
  ignore = "node ./scripts/netlify-ignore-build.mjs crm"
3
- command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter crm build"
3
+ command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter crm build && if [ \"${CONTEXT:-}\" = \"production\" ]; then pnpm --filter crm migrate:production; fi"
4
4
  publish = "templates/crm/dist"
5
5
  functions = "templates/crm/.netlify/functions-internal"
6
6
 
@@ -10,6 +10,7 @@
10
10
  "start": "agent-native start",
11
11
  "format.fix": "oxfmt --write .",
12
12
  "typecheck": "agent-native typecheck",
13
+ "migrate:production": "tsx scripts/migrate-production.ts",
13
14
  "action": "agent-native action",
14
15
  "script": "agent-native script",
15
16
  "test": "vitest --run --passWithNoTests --config vitest.config.ts"
@@ -52,6 +53,7 @@
52
53
  "sonner": "^2.0.7",
53
54
  "tailwind-merge": "^3.6.0",
54
55
  "tailwindcss": "catalog:",
56
+ "tsx": "^4.20.3",
55
57
  "typescript": "catalog:",
56
58
  "typescript-7": "catalog:",
57
59
  "vite": "catalog:",
@@ -0,0 +1,24 @@
1
+ import { closeDbExec, withMigrationRuntime } from "@agent-native/core/db";
2
+ import { runFrameworkReleaseMigrations } from "@agent-native/core/server";
3
+
4
+ import { runCrmMigrations } from "../server/plugins/db.js";
5
+
6
+ /**
7
+ * Release-time schema entrypoint for CRM.
8
+ *
9
+ * This script is the production owner of schema changes. It runs against the
10
+ * direct migration endpoint selected by core, while request functions skip
11
+ * all migration and ensure-table work automatically.
12
+ */
13
+ async function main(): Promise<void> {
14
+ await withMigrationRuntime(async () => {
15
+ await runFrameworkReleaseMigrations(null);
16
+ await runCrmMigrations(null);
17
+ });
18
+ }
19
+
20
+ try {
21
+ await main();
22
+ } finally {
23
+ await closeDbExec();
24
+ }
@@ -616,7 +616,7 @@ const nativeAttributeTypeBackfill = [
616
616
  `UPDATE crm_field_policies SET attribute_type = 'text' WHERE field_name IN ('name', 'industry', 'ownerName', 'firstName', 'lastName', 'title') AND connection_id IN (SELECT id FROM crm_connections WHERE provider = 'native')`,
617
617
  ].join(";\n");
618
618
 
619
- const runCrmMigrations = runMigrations(
619
+ export const runCrmMigrations = runMigrations(
620
620
  [
621
621
  { version: 1, name: "crm-initial-thin-mirror-schema", sql: initialSchema },
622
622
  { version: 2, name: "crm-signals-engine-schema", sql: signalsSchema },
@@ -14,6 +14,7 @@
14
14
  "server/**/*",
15
15
  "shared/**/*",
16
16
  "actions/**/*",
17
+ "scripts/**/*",
17
18
  "vite.config.ts",
18
19
  "vitest.config.ts",
19
20
  "react-router.config.ts",
@@ -36,8 +36,10 @@ Tier 4 includes **all** of the following — not only editing package source:
36
36
  - Files under `node_modules/@agent-native/*` (core, dispatch, scheduling, …)
37
37
  - `pnpm.overrides`, `overrides`, `resolutions`, or `patchedDependencies` that
38
38
  target any `@agent-native/*` package
39
- - Local package patches or invented "dispatch/core behavior" shims meant to
40
- paper over a version skew or failed upgrade
39
+ - `pnpm patch`, `pnpm patch-commit`, or local package patch artifacts for any
40
+ dependency
41
+ - Invented "dispatch/core behavior" shims meant to paper over a version skew
42
+ or failed upgrade
41
43
 
42
44
  This does not prohibit intentional app-owned UI customization. When public
43
45
  props and composition are insufficient, the `customizing-agent-native` skill
@@ -100,8 +102,10 @@ inline strings in components.
100
102
  - Don't confuse readable package source with app-owned code: use
101
103
  `customizing-agent-native` and `agent-native eject` for supported ownership
102
104
  transfer
105
+ - Don't use `pnpm patch` / `pnpm patch-commit`, commit `patches/` artifacts, or
106
+ add `pnpm.patchedDependencies` to "make the app run" after a version bump
103
107
  - Don't add `pnpm.overrides` / `patchedDependencies` / `resolutions` for
104
- `@agent-native/*` to "make the app run" after a version bump
108
+ `@agent-native/*` to paper over a broken upgrade
105
109
  - Don't invent local dispatch/core behavior overrides when upgrade fails —
106
110
  run `npx @agent-native/core@latest upgrade`, then fix app-level errors only
107
111
  - Don't modify `.agents/skills/` or `AGENTS.md` unless explicitly requested