@agent-native/core 0.91.2 → 0.92.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 (538) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +31 -0
  3. package/corpus/core/docs/content/faq.mdx +17 -0
  4. package/corpus/core/docs/content/notifications.mdx +12 -6
  5. package/corpus/core/package.json +1 -1
  6. package/corpus/core/src/agent/production-agent.ts +140 -46
  7. package/corpus/core/src/agent/tool-search.ts +71 -4
  8. package/corpus/core/src/application-state/store.ts +12 -1
  9. package/corpus/core/src/cli/index.ts +20 -0
  10. package/corpus/core/src/cli/upgrade.ts +798 -0
  11. package/corpus/core/src/client/AssistantChat.tsx +28 -15
  12. package/corpus/core/src/client/HighlightedCodeBlock.tsx +20 -3
  13. package/corpus/core/src/client/PoweredByBadge.tsx +1 -8
  14. package/corpus/core/src/client/agent-chat-adapter.ts +68 -16
  15. package/corpus/core/src/client/chat/message-components.tsx +85 -8
  16. package/corpus/core/src/client/chat/tool-call-display.tsx +355 -144
  17. package/corpus/core/src/client/chat/widgets/DataTableWidget.tsx +52 -1
  18. package/corpus/core/src/client/code-agent-chat-adapter.ts +2 -9
  19. package/corpus/core/src/client/db-admin/TableEditor.tsx +49 -0
  20. package/corpus/core/src/client/db-admin/export-utils.ts +13 -4
  21. package/corpus/core/src/client/db-admin/useAgentSync.ts +72 -0
  22. package/corpus/core/src/client/error-capture.ts +69 -7
  23. package/corpus/core/src/client/extensions/EmbeddedExtension.tsx +5 -1
  24. package/corpus/core/src/client/extensions/ExtensionViewer.tsx +53 -8
  25. package/corpus/core/src/client/extensions/InlineExtensionFrame.tsx +5 -1
  26. package/corpus/core/src/client/extensions/portable-extension.ts +1 -0
  27. package/corpus/core/src/client/org/OrgSwitcher.tsx +12 -9
  28. package/corpus/core/src/client/org/TeamPage.tsx +77 -71
  29. package/corpus/core/src/client/session-replay.ts +3 -97
  30. package/corpus/core/src/client/settings/SettingsPanel.tsx +738 -441
  31. package/corpus/core/src/client/settings/SettingsSection.tsx +161 -17
  32. package/corpus/core/src/client/settings/SettingsTabsPage.tsx +25 -9
  33. package/corpus/core/src/client/sse-event-processor.ts +29 -2
  34. package/corpus/core/src/db-admin/agent-tools.ts +8 -2
  35. package/corpus/core/src/db-admin/operations.ts +116 -4
  36. package/corpus/core/src/db-admin/routes.ts +1 -0
  37. package/corpus/core/src/db-admin/types.ts +4 -0
  38. package/corpus/core/src/extensions/actions.ts +113 -5
  39. package/corpus/core/src/extensions/html-shell.ts +5 -4
  40. package/corpus/core/src/extensions/routes.ts +10 -0
  41. package/corpus/core/src/navigation/index.ts +1 -1
  42. package/corpus/core/src/notifications/channels.ts +88 -25
  43. package/corpus/core/src/notifications/registry.ts +17 -3
  44. package/corpus/core/src/notifications/types.ts +4 -1
  45. package/corpus/core/src/resources/handlers.ts +10 -8
  46. package/corpus/core/src/server/agent-chat-plugin.ts +7 -3
  47. package/corpus/core/src/server/poll.ts +293 -8
  48. package/corpus/core/src/server/request-context.ts +7 -0
  49. package/corpus/core/src/styles/agent-conversation.css +1 -1
  50. package/corpus/core/src/styles/agent-native.css +27 -0
  51. package/corpus/core/src/templates/default/.agents/skills/actions/SKILL.md +5 -0
  52. package/corpus/core/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +5 -0
  53. package/corpus/core/src/templates/default/.agents/skills/real-time-sync/SKILL.md +1 -1
  54. package/corpus/core/src/templates/default/.agents/skills/security/SKILL.md +7 -0
  55. package/corpus/core/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +20 -2
  56. package/corpus/core/src/templates/default/.agents/skills/storing-data/SKILL.md +5 -1
  57. package/corpus/core/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  58. package/corpus/core/src/templates/default/AGENTS.md +14 -5
  59. package/corpus/core/src/templates/default/package.json +2 -1
  60. package/corpus/core/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  61. package/corpus/core/src/templates/headless/AGENTS.md +13 -3
  62. package/corpus/core/src/templates/headless/package.json +1 -0
  63. package/corpus/core/src/templates/workspace-core/.agents/skills/actions/SKILL.md +5 -0
  64. package/corpus/core/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +5 -0
  65. package/corpus/core/src/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +4 -0
  66. package/corpus/core/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +6 -0
  67. package/corpus/core/src/templates/workspace-core/.agents/skills/performance/SKILL.md +4 -0
  68. package/corpus/core/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +1 -1
  69. package/corpus/core/src/templates/workspace-core/.agents/skills/security/SKILL.md +7 -0
  70. package/corpus/core/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +20 -2
  71. package/corpus/core/src/templates/workspace-core/.agents/skills/storing-data/SKILL.md +5 -1
  72. package/corpus/core/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  73. package/corpus/core/src/templates/workspace-core/AGENTS.md +7 -1
  74. package/corpus/core/src/templates/workspace-root/AGENTS.md +17 -5
  75. package/corpus/core/src/templates/workspace-root/package.json +1 -0
  76. package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +5 -0
  77. package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +10 -0
  78. package/corpus/templates/analytics/.agents/skills/real-time-sync/SKILL.md +1 -1
  79. package/corpus/templates/analytics/.agents/skills/security/SKILL.md +7 -0
  80. package/corpus/templates/analytics/.agents/skills/self-modifying-code/SKILL.md +20 -2
  81. package/corpus/templates/analytics/.agents/skills/session-replay/SKILL.md +5 -6
  82. package/corpus/templates/analytics/.agents/skills/storing-data/SKILL.md +5 -1
  83. package/corpus/templates/analytics/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  84. package/corpus/templates/analytics/AGENTS.md +39 -18
  85. package/corpus/templates/analytics/actions/capture-test-error.ts +4 -0
  86. package/corpus/templates/analytics/actions/get-analytics-alert-rule-defaults.ts +23 -0
  87. package/corpus/templates/analytics/actions/get-error-issue.ts +1 -1
  88. package/corpus/templates/analytics/actions/list-analysis-revisions.ts +40 -0
  89. package/corpus/templates/analytics/actions/list-dashboard-revisions.ts +40 -0
  90. package/corpus/templates/analytics/actions/list-dashboard-usage-stats.ts +299 -0
  91. package/corpus/templates/analytics/actions/navigate.ts +4 -2
  92. package/corpus/templates/analytics/actions/restore-analysis-revision.ts +43 -0
  93. package/corpus/templates/analytics/actions/restore-dashboard-revision.ts +68 -0
  94. package/corpus/templates/analytics/actions/save-analytics-alert-rule.ts +14 -0
  95. package/corpus/templates/analytics/actions/save-monitor.ts +15 -1
  96. package/corpus/templates/analytics/actions/view-screen.ts +24 -0
  97. package/corpus/templates/analytics/app/components/analysis/AnalysisHistoryPanel.tsx +181 -0
  98. package/corpus/templates/analytics/app/components/dashboard/DashboardHistoryPanel.tsx +184 -0
  99. package/corpus/templates/analytics/app/components/dashboard/DataTable.tsx +41 -6
  100. package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +122 -11
  101. package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +22 -16
  102. package/corpus/templates/analytics/app/components/layout/Header.tsx +1 -1
  103. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +27 -21
  104. package/corpus/templates/analytics/app/hooks/use-analysis-revisions.ts +43 -0
  105. package/corpus/templates/analytics/app/hooks/use-dashboard-chat-context.ts +110 -0
  106. package/corpus/templates/analytics/app/hooks/use-dashboard-revisions.ts +43 -0
  107. package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +8 -3
  108. package/corpus/templates/analytics/app/i18n/zh-TW.ts +64 -2
  109. package/corpus/templates/analytics/app/i18n-data.ts +783 -3
  110. package/corpus/templates/analytics/app/pages/Agents.tsx +359 -19
  111. package/corpus/templates/analytics/app/pages/Settings.tsx +3 -2
  112. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +34 -1
  113. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +28 -0
  114. package/corpus/templates/analytics/app/pages/analyses/AnalysisDetail.tsx +18 -1
  115. package/corpus/templates/analytics/app/pages/monitoring/ErrorsPanel.tsx +7 -10
  116. package/corpus/templates/analytics/app/pages/monitoring/MonitoringPage.tsx +8 -2
  117. package/corpus/templates/analytics/app/pages/monitoring/errors/IssueDetail.tsx +479 -23
  118. package/corpus/templates/analytics/app/pages/monitoring/errors/IssueList.tsx +0 -9
  119. package/corpus/templates/analytics/app/pages/monitoring/errors/i18n.ts +11 -0
  120. package/corpus/templates/analytics/app/pages/monitoring/errors/types.ts +9 -1
  121. package/corpus/templates/analytics/app/pages/monitoring/uptime/MonitorFormPage.tsx +157 -35
  122. package/corpus/templates/analytics/app/pages/monitoring/uptime/i18n.ts +17 -2
  123. package/corpus/templates/analytics/app/pages/monitoring/uptime/types.ts +4 -0
  124. package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +80 -220
  125. package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +9 -99
  126. package/corpus/templates/analytics/app/pages/settings/AlertRulesSettingsCard.tsx +262 -104
  127. package/corpus/templates/analytics/app/routes/team.tsx +1 -1
  128. package/corpus/templates/analytics/changelog/2026-07-08-admins-can-audit-dashboard-usage-ownership-and-cleanup-signa.md +6 -0
  129. package/corpus/templates/analytics/changelog/2026-07-08-agent-monitoring-stays-available-to-non-admins.md +6 -0
  130. package/corpus/templates/analytics/changelog/2026-07-08-alert-rules-are-easier-to-scan-expand-and-edit-from-settings.md +6 -0
  131. package/corpus/templates/analytics/changelog/2026-07-08-analytics-alert-forms-remember-last-email-recipients.md +6 -0
  132. package/corpus/templates/analytics/changelog/2026-07-08-analytics-alert-rules-can-now-use-per-rule-slack-and-webhook.md +6 -0
  133. package/corpus/templates/analytics/changelog/2026-07-08-dashboard-history-and-chat-context.md +5 -0
  134. package/corpus/templates/analytics/changelog/2026-07-08-dashboard-tables-keep-their-size-while-loading.md +6 -0
  135. package/corpus/templates/analytics/changelog/2026-07-08-dashboard-usage-now-counts-explorer-dashboard-traffic.md +6 -0
  136. package/corpus/templates/analytics/changelog/2026-07-08-demo-mode-session-emails-are-filtered-and-anonymized.md +6 -0
  137. package/corpus/templates/analytics/changelog/2026-07-08-error-issue-detail-adds-stack-traces-and-frequency-bars.md +6 -0
  138. package/corpus/templates/analytics/changelog/2026-07-08-error-issue-detail-now-shows-the-latest-occurrence-message-a.md +6 -0
  139. package/corpus/templates/analytics/changelog/2026-07-08-monitoring-errors-only-show-test-action-when-empty.md +6 -0
  140. package/corpus/templates/analytics/changelog/2026-07-08-monitoring-uptime-and-errors-tabs-now-clearly-show-which-view-is-active.md +6 -0
  141. package/corpus/templates/analytics/changelog/2026-07-08-production-session-replay-now-requires-private-blob-storage-.md +6 -0
  142. package/corpus/templates/analytics/changelog/2026-07-08-session-replay-uses-stock-rrweb-sizing-again-so-recorded.md +6 -0
  143. package/corpus/templates/analytics/changelog/2026-07-08-shared-extension-links-now-show-a-clear-message-when-you-do-.md +6 -0
  144. package/corpus/templates/analytics/changelog/2026-07-08-sidebar-dashboard-menus-now-open-above-the-dashboard-canvas.md +6 -0
  145. package/corpus/templates/analytics/changelog/2026-07-08-team-settings-show-access-controls-next-to-member-lists.md +6 -0
  146. package/corpus/templates/analytics/changelog/2026-07-08-uptime-alerting-clarifies-in-app-inbox-vs-email-and-lets-you-paste-slack-or-webhook-urls-per-monitor.md +6 -0
  147. package/corpus/templates/analytics/changelog/2026-07-08-uptime-monitors-now-use-a-10-second-request-timeout-by-defau.md +6 -0
  148. package/corpus/templates/analytics/docs/uptime-monitoring.md +13 -11
  149. package/corpus/templates/analytics/server/db/schema-monitoring.ts +5 -1
  150. package/corpus/templates/analytics/server/db/schema.ts +56 -0
  151. package/corpus/templates/analytics/server/lib/analytics-alerts.ts +92 -0
  152. package/corpus/templates/analytics/server/lib/dashboards-store.ts +334 -5
  153. package/corpus/templates/analytics/server/lib/error-capture.ts +231 -36
  154. package/corpus/templates/analytics/server/lib/session-replay.ts +114 -8
  155. package/corpus/templates/analytics/server/lib/uptime-monitors.ts +65 -16
  156. package/corpus/templates/analytics/server/plugins/db.ts +122 -2
  157. package/corpus/templates/analytics/server/routes/api/dashboard-agent-context.json.get.ts +1 -0
  158. package/corpus/templates/assets/.agents/skills/actions/SKILL.md +5 -0
  159. package/corpus/templates/assets/.agents/skills/real-time-sync/SKILL.md +1 -1
  160. package/corpus/templates/assets/.agents/skills/security/SKILL.md +7 -0
  161. package/corpus/templates/assets/.agents/skills/self-modifying-code/SKILL.md +20 -2
  162. package/corpus/templates/assets/.agents/skills/storing-data/SKILL.md +5 -1
  163. package/corpus/templates/assets/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  164. package/corpus/templates/assets/AGENTS.md +4 -0
  165. package/corpus/templates/assets/app/routes/settings.tsx +1 -1
  166. package/corpus/templates/assets/app/routes/team.tsx +1 -1
  167. package/corpus/templates/brain/.agents/skills/actions/SKILL.md +5 -0
  168. package/corpus/templates/brain/.agents/skills/adding-a-feature/SKILL.md +5 -0
  169. package/corpus/templates/brain/.agents/skills/real-time-sync/SKILL.md +1 -1
  170. package/corpus/templates/brain/.agents/skills/security/SKILL.md +7 -0
  171. package/corpus/templates/brain/.agents/skills/self-modifying-code/SKILL.md +20 -2
  172. package/corpus/templates/brain/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  173. package/corpus/templates/brain/AGENTS.md +4 -0
  174. package/corpus/templates/brain/app/routes/team.tsx +1 -1
  175. package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +5 -0
  176. package/corpus/templates/calendar/.agents/skills/real-time-sync/SKILL.md +1 -1
  177. package/corpus/templates/calendar/.agents/skills/security/SKILL.md +7 -0
  178. package/corpus/templates/calendar/.agents/skills/self-modifying-code/SKILL.md +20 -2
  179. package/corpus/templates/calendar/.agents/skills/storing-data/SKILL.md +5 -1
  180. package/corpus/templates/calendar/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  181. package/corpus/templates/calendar/AGENTS.md +4 -0
  182. package/corpus/templates/calendar/app/components/calendar/DayView.tsx +11 -2
  183. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +21 -8
  184. package/corpus/templates/calendar/app/components/calendar/MonthView.tsx +7 -1
  185. package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +11 -2
  186. package/corpus/templates/calendar/app/lib/popover-click-guard.ts +48 -4
  187. package/corpus/templates/calendar/app/pages/Settings.tsx +1 -1
  188. package/corpus/templates/calendar/app/routes/_app.team.tsx +1 -1
  189. package/corpus/templates/calendar/changelog/2026-07-08-clicking-empty-calendar-space-closes-an-open-event-popover-b.md +6 -0
  190. package/corpus/templates/chat/.agents/skills/actions/SKILL.md +5 -0
  191. package/corpus/templates/chat/.agents/skills/adding-a-feature/SKILL.md +5 -0
  192. package/corpus/templates/chat/.agents/skills/real-time-sync/SKILL.md +1 -1
  193. package/corpus/templates/chat/.agents/skills/security/SKILL.md +7 -0
  194. package/corpus/templates/chat/.agents/skills/self-modifying-code/SKILL.md +20 -2
  195. package/corpus/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  196. package/corpus/templates/chat/AGENTS.md +4 -0
  197. package/corpus/templates/chat/app/hooks/use-navigation-state.ts +1 -1
  198. package/corpus/templates/chat/app/routes/settings.tsx +2 -2
  199. package/corpus/templates/chat/app/routes/team.tsx +1 -1
  200. package/corpus/templates/clips/.agents/skills/actions/SKILL.md +5 -0
  201. package/corpus/templates/clips/.agents/skills/security/SKILL.md +7 -0
  202. package/corpus/templates/clips/.agents/skills/self-modifying-code/SKILL.md +20 -2
  203. package/corpus/templates/clips/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  204. package/corpus/templates/clips/AGENTS.md +4 -0
  205. package/corpus/templates/clips/actions/finalize-recording.ts +9 -3
  206. package/corpus/templates/clips/actions/set-thumbnail.ts +11 -2
  207. package/corpus/templates/clips/app/components/meetings/canvas-editor.tsx +1 -7
  208. package/corpus/templates/clips/app/components/player/player-controls.tsx +21 -13
  209. package/corpus/templates/clips/app/components/player/video-player.tsx +30 -75
  210. package/corpus/templates/clips/app/i18n/ar-SA.ts +6 -5
  211. package/corpus/templates/clips/app/i18n/de-DE.ts +6 -6
  212. package/corpus/templates/clips/app/i18n/en-US.ts +6 -5
  213. package/corpus/templates/clips/app/i18n/es-ES.ts +6 -5
  214. package/corpus/templates/clips/app/i18n/fr-FR.ts +6 -6
  215. package/corpus/templates/clips/app/i18n/hi-IN.ts +6 -5
  216. package/corpus/templates/clips/app/i18n/ja-JP.ts +6 -5
  217. package/corpus/templates/clips/app/i18n/ko-KR.ts +6 -5
  218. package/corpus/templates/clips/app/i18n/pt-BR.ts +6 -5
  219. package/corpus/templates/clips/app/i18n/zh-CN.ts +6 -5
  220. package/corpus/templates/clips/app/i18n/zh-TW.ts +6 -5
  221. package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +51 -118
  222. package/corpus/templates/clips/changelog/2026-07-08-desktop-meeting-notes-stay-active-from-tray-and-shortcut-controls.md +6 -0
  223. package/corpus/templates/clips/changelog/2026-07-08-desktop-meeting-popovers-can-start-notes-and-join-the-meetin.md +6 -0
  224. package/corpus/templates/clips/changelog/2026-07-08-hosted-clip-uploads-now-clear-failed-buffered-chunks.md +6 -0
  225. package/corpus/templates/clips/changelog/2026-07-08-hosted-recording-uploads-now-avoid-sql-chunk-storage.md +6 -0
  226. package/corpus/templates/clips/changelog/2026-07-08-meeting-notes-keep-their-recording-state-when-the-desktop.md +6 -0
  227. package/corpus/templates/clips/changelog/2026-07-08-meeting-recaps-now-keep-summaries-action-items-and-transcrip.md +6 -0
  228. package/corpus/templates/clips/changelog/2026-07-08-meeting-reminder-dropdowns-now-expand-fully-instead-of-being.md +6 -0
  229. package/corpus/templates/clips/changelog/2026-07-08-video-playback-controls-now-match-loom-style-5-second-skips-.md +6 -0
  230. package/corpus/templates/clips/desktop/src/app.tsx +123 -3
  231. package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +15 -1
  232. package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +23 -0
  233. package/corpus/templates/clips/desktop/src/styles.css +23 -1
  234. package/corpus/templates/clips/desktop/src-tauri/src/adhoc_meetings_watcher.rs +1 -3
  235. package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +40 -6
  236. package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +4 -2
  237. package/corpus/templates/clips/desktop/src-tauri/src/meetings_watcher.rs +3 -5
  238. package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +23 -19
  239. package/corpus/templates/clips/desktop/src-tauri/src/shortcuts.rs +3 -3
  240. package/corpus/templates/clips/desktop/src-tauri/src/silence_detector.rs +0 -1
  241. package/corpus/templates/clips/desktop/src-tauri/src/state.rs +5 -0
  242. package/corpus/templates/clips/desktop/src-tauri/src/tray.rs +18 -6
  243. package/corpus/templates/clips/server/lib/recording-upload-state.ts +63 -0
  244. package/corpus/templates/clips/server/lib/video-storage.ts +4 -0
  245. package/corpus/templates/clips/server/routes/api/recordings/[recordingId]/thumbnail.post.ts +19 -13
  246. package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +40 -1
  247. package/corpus/templates/content/.agents/skills/actions/SKILL.md +5 -0
  248. package/corpus/templates/content/.agents/skills/real-time-sync/SKILL.md +1 -1
  249. package/corpus/templates/content/.agents/skills/security/SKILL.md +7 -0
  250. package/corpus/templates/content/.agents/skills/self-modifying-code/SKILL.md +20 -2
  251. package/corpus/templates/content/.agents/skills/storing-data/SKILL.md +5 -1
  252. package/corpus/templates/content/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  253. package/corpus/templates/content/AGENTS.md +4 -0
  254. package/corpus/templates/content/actions/_batch-utils.ts +8 -0
  255. package/corpus/templates/content/actions/_builder-cms-read-client.ts +7 -5
  256. package/corpus/templates/content/actions/_database-source-utils.ts +776 -319
  257. package/corpus/templates/content/actions/_database-utils.ts +6 -1
  258. package/corpus/templates/content/actions/_property-utils.ts +168 -0
  259. package/corpus/templates/content/actions/add-content-database-source-field-property.ts +19 -12
  260. package/corpus/templates/content/actions/bind-content-database-source-field.ts +19 -12
  261. package/corpus/templates/content/actions/delete-document.ts +9 -13
  262. package/corpus/templates/content/actions/refresh-content-database-source.ts +5 -5
  263. package/corpus/templates/content/app/components/editor/body-hydration.ts +35 -11
  264. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +47 -5
  265. package/corpus/templates/content/app/hooks/use-documents.ts +8 -2
  266. package/corpus/templates/content/app/routes/_app.settings.tsx +2 -2
  267. package/corpus/templates/content/app/routes/_app.team.tsx +1 -1
  268. package/corpus/templates/content/changelog/2026-07-08-builder-source-sync-now-completes-reliably-on-hosted-databases.md +6 -0
  269. package/corpus/templates/content/changelog/2026-07-08-fixed-builder-database-sync-so-large-sources-continue-past-t.md +6 -0
  270. package/corpus/templates/content/server/plugins/db.ts +19 -0
  271. package/corpus/templates/design/.agents/skills/actions/SKILL.md +5 -0
  272. package/corpus/templates/design/.agents/skills/security/SKILL.md +7 -0
  273. package/corpus/templates/design/.agents/skills/self-modifying-code/SKILL.md +20 -2
  274. package/corpus/templates/design/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  275. package/corpus/templates/design/AGENTS.md +4 -0
  276. package/corpus/templates/design/actions/take-design-screenshot.ts +12 -9
  277. package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +57 -13
  278. package/corpus/templates/design/app/routes/team.tsx +1 -1
  279. package/corpus/templates/design/changelog/2026-07-08-local-images-added-to-designs-now-upload-to-file-storage-ins.md +6 -0
  280. package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +5 -0
  281. package/corpus/templates/dispatch/.agents/skills/security/SKILL.md +7 -0
  282. package/corpus/templates/dispatch/.agents/skills/self-modifying-code/SKILL.md +20 -2
  283. package/corpus/templates/dispatch/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  284. package/corpus/templates/dispatch/AGENTS.md +4 -0
  285. package/corpus/templates/dispatch/app/hooks/use-navigation-state.ts +1 -1
  286. package/corpus/templates/dispatch/app/routes/settings.tsx +2 -2
  287. package/corpus/templates/dispatch/app/routes/team.tsx +1 -1
  288. package/corpus/templates/forms/.agents/skills/actions/SKILL.md +5 -0
  289. package/corpus/templates/forms/.agents/skills/real-time-sync/SKILL.md +1 -1
  290. package/corpus/templates/forms/.agents/skills/security/SKILL.md +7 -0
  291. package/corpus/templates/forms/.agents/skills/self-modifying-code/SKILL.md +20 -2
  292. package/corpus/templates/forms/.agents/skills/storing-data/SKILL.md +5 -1
  293. package/corpus/templates/forms/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  294. package/corpus/templates/forms/AGENTS.md +4 -0
  295. package/corpus/templates/forms/app/routes/_app.settings.tsx +2 -2
  296. package/corpus/templates/forms/app/routes/_app.team.tsx +1 -1
  297. package/corpus/templates/forms/shared/navigation.ts +1 -1
  298. package/corpus/templates/macros/.agents/skills/security/SKILL.md +7 -0
  299. package/corpus/templates/macros/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  300. package/corpus/templates/macros/AGENTS.md +4 -0
  301. package/corpus/templates/macros/app/routes/settings.tsx +2 -2
  302. package/corpus/templates/macros/app/routes/team.tsx +1 -1
  303. package/corpus/templates/mail/.agents/skills/actions/SKILL.md +5 -0
  304. package/corpus/templates/mail/.agents/skills/email-drafts/SKILL.md +1 -1
  305. package/corpus/templates/mail/.agents/skills/real-time-sync/SKILL.md +1 -1
  306. package/corpus/templates/mail/.agents/skills/security/SKILL.md +7 -0
  307. package/corpus/templates/mail/.agents/skills/self-modifying-code/SKILL.md +20 -2
  308. package/corpus/templates/mail/.agents/skills/storing-data/SKILL.md +5 -1
  309. package/corpus/templates/mail/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  310. package/corpus/templates/mail/AGENTS.md +4 -0
  311. package/corpus/templates/mail/changelog/2026-07-08-mail-attachments-in-hosted-environments-now-require-file-sto.md +6 -0
  312. package/corpus/templates/mail/server/handlers/media.ts +26 -1
  313. package/corpus/templates/mail/server/lib/outgoing-email.ts +24 -1
  314. package/corpus/templates/mail/server/lib/upload-store.ts +2 -1
  315. package/corpus/templates/plan/.agents/skills/actions/SKILL.md +5 -0
  316. package/corpus/templates/plan/.agents/skills/adding-a-feature/SKILL.md +5 -0
  317. package/corpus/templates/plan/.agents/skills/real-time-sync/SKILL.md +1 -1
  318. package/corpus/templates/plan/.agents/skills/security/SKILL.md +7 -0
  319. package/corpus/templates/plan/.agents/skills/self-modifying-code/SKILL.md +20 -2
  320. package/corpus/templates/plan/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  321. package/corpus/templates/plan/AGENTS.md +4 -0
  322. package/corpus/templates/plan/app/hooks/use-navigation-state.ts +1 -1
  323. package/corpus/templates/plan/app/routes/settings.tsx +2 -2
  324. package/corpus/templates/plan/app/routes/team.tsx +1 -1
  325. package/corpus/templates/plan/changelog/2026-07-08-hosted-plan-images-now-require-connected-storage.md +6 -0
  326. package/corpus/templates/plan/server/lib/plan-assets.ts +33 -4
  327. package/corpus/templates/slides/.agents/skills/actions/SKILL.md +5 -0
  328. package/corpus/templates/slides/.agents/skills/security/SKILL.md +7 -0
  329. package/corpus/templates/slides/.agents/skills/self-modifying-code/SKILL.md +20 -2
  330. package/corpus/templates/slides/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  331. package/corpus/templates/slides/AGENTS.md +4 -0
  332. package/corpus/templates/slides/actions/generate-image-api.ts +15 -3
  333. package/corpus/templates/slides/app/routes/settings.tsx +2 -2
  334. package/corpus/templates/slides/app/routes/team.tsx +1 -1
  335. package/corpus/templates/slides/changelog/2026-07-08-generated-slide-images-now-return-hosted-file-storage-urls-i.md +6 -0
  336. package/corpus/templates/slides/shared/api.ts +1 -1
  337. package/corpus/templates/videos/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  338. package/corpus/templates/voice/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  339. package/dist/agent/production-agent.d.ts +5 -1
  340. package/dist/agent/production-agent.d.ts.map +1 -1
  341. package/dist/agent/production-agent.js +112 -42
  342. package/dist/agent/production-agent.js.map +1 -1
  343. package/dist/agent/tool-search.d.ts +2 -0
  344. package/dist/agent/tool-search.d.ts.map +1 -1
  345. package/dist/agent/tool-search.js +60 -4
  346. package/dist/agent/tool-search.js.map +1 -1
  347. package/dist/application-state/store.d.ts.map +1 -1
  348. package/dist/application-state/store.js +8 -2
  349. package/dist/application-state/store.js.map +1 -1
  350. package/dist/cli/index.js +19 -0
  351. package/dist/cli/index.js.map +1 -1
  352. package/dist/cli/upgrade.d.ts +100 -0
  353. package/dist/cli/upgrade.d.ts.map +1 -0
  354. package/dist/cli/upgrade.js +678 -0
  355. package/dist/cli/upgrade.js.map +1 -0
  356. package/dist/client/AssistantChat.d.ts.map +1 -1
  357. package/dist/client/AssistantChat.js +25 -14
  358. package/dist/client/AssistantChat.js.map +1 -1
  359. package/dist/client/HighlightedCodeBlock.d.ts +2 -0
  360. package/dist/client/HighlightedCodeBlock.d.ts.map +1 -1
  361. package/dist/client/HighlightedCodeBlock.js +10 -1
  362. package/dist/client/HighlightedCodeBlock.js.map +1 -1
  363. package/dist/client/PoweredByBadge.d.ts +1 -1
  364. package/dist/client/PoweredByBadge.d.ts.map +1 -1
  365. package/dist/client/PoweredByBadge.js +3 -9
  366. package/dist/client/PoweredByBadge.js.map +1 -1
  367. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  368. package/dist/client/agent-chat-adapter.js +60 -13
  369. package/dist/client/agent-chat-adapter.js.map +1 -1
  370. package/dist/client/chat/message-components.d.ts.map +1 -1
  371. package/dist/client/chat/message-components.js +61 -8
  372. package/dist/client/chat/message-components.js.map +1 -1
  373. package/dist/client/chat/tool-call-display.d.ts +12 -0
  374. package/dist/client/chat/tool-call-display.d.ts.map +1 -1
  375. package/dist/client/chat/tool-call-display.js +136 -42
  376. package/dist/client/chat/tool-call-display.js.map +1 -1
  377. package/dist/client/chat/widgets/DataTableWidget.d.ts.map +1 -1
  378. package/dist/client/chat/widgets/DataTableWidget.js +19 -2
  379. package/dist/client/chat/widgets/DataTableWidget.js.map +1 -1
  380. package/dist/client/code-agent-chat-adapter.js +2 -9
  381. package/dist/client/code-agent-chat-adapter.js.map +1 -1
  382. package/dist/client/db-admin/TableEditor.d.ts.map +1 -1
  383. package/dist/client/db-admin/TableEditor.js +19 -2
  384. package/dist/client/db-admin/TableEditor.js.map +1 -1
  385. package/dist/client/db-admin/export-utils.d.ts +2 -0
  386. package/dist/client/db-admin/export-utils.d.ts.map +1 -1
  387. package/dist/client/db-admin/export-utils.js +11 -3
  388. package/dist/client/db-admin/export-utils.js.map +1 -1
  389. package/dist/client/db-admin/useAgentSync.d.ts.map +1 -1
  390. package/dist/client/db-admin/useAgentSync.js +63 -0
  391. package/dist/client/db-admin/useAgentSync.js.map +1 -1
  392. package/dist/client/error-capture.d.ts.map +1 -1
  393. package/dist/client/error-capture.js +41 -7
  394. package/dist/client/error-capture.js.map +1 -1
  395. package/dist/client/extensions/EmbeddedExtension.d.ts.map +1 -1
  396. package/dist/client/extensions/EmbeddedExtension.js +3 -1
  397. package/dist/client/extensions/EmbeddedExtension.js.map +1 -1
  398. package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
  399. package/dist/client/extensions/ExtensionViewer.js +32 -5
  400. package/dist/client/extensions/ExtensionViewer.js.map +1 -1
  401. package/dist/client/extensions/InlineExtensionFrame.d.ts.map +1 -1
  402. package/dist/client/extensions/InlineExtensionFrame.js +3 -1
  403. package/dist/client/extensions/InlineExtensionFrame.js.map +1 -1
  404. package/dist/client/extensions/portable-extension.d.ts.map +1 -1
  405. package/dist/client/extensions/portable-extension.js +1 -0
  406. package/dist/client/extensions/portable-extension.js.map +1 -1
  407. package/dist/client/org/OrgSwitcher.d.ts +1 -1
  408. package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
  409. package/dist/client/org/OrgSwitcher.js +11 -6
  410. package/dist/client/org/OrgSwitcher.js.map +1 -1
  411. package/dist/client/org/TeamPage.d.ts.map +1 -1
  412. package/dist/client/org/TeamPage.js +5 -5
  413. package/dist/client/org/TeamPage.js.map +1 -1
  414. package/dist/client/session-replay.d.ts +0 -8
  415. package/dist/client/session-replay.d.ts.map +1 -1
  416. package/dist/client/session-replay.js +3 -80
  417. package/dist/client/session-replay.js.map +1 -1
  418. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  419. package/dist/client/settings/SettingsPanel.js +89 -33
  420. package/dist/client/settings/SettingsPanel.js.map +1 -1
  421. package/dist/client/settings/SettingsSection.d.ts +19 -4
  422. package/dist/client/settings/SettingsSection.d.ts.map +1 -1
  423. package/dist/client/settings/SettingsSection.js +33 -4
  424. package/dist/client/settings/SettingsSection.js.map +1 -1
  425. package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
  426. package/dist/client/settings/SettingsTabsPage.js +21 -10
  427. package/dist/client/settings/SettingsTabsPage.js.map +1 -1
  428. package/dist/client/sse-event-processor.d.ts +9 -0
  429. package/dist/client/sse-event-processor.d.ts.map +1 -1
  430. package/dist/client/sse-event-processor.js +20 -2
  431. package/dist/client/sse-event-processor.js.map +1 -1
  432. package/dist/db-admin/agent-tools.d.ts.map +1 -1
  433. package/dist/db-admin/agent-tools.js +7 -2
  434. package/dist/db-admin/agent-tools.js.map +1 -1
  435. package/dist/db-admin/operations.d.ts.map +1 -1
  436. package/dist/db-admin/operations.js +90 -4
  437. package/dist/db-admin/operations.js.map +1 -1
  438. package/dist/db-admin/routes.d.ts.map +1 -1
  439. package/dist/db-admin/routes.js +1 -0
  440. package/dist/db-admin/routes.js.map +1 -1
  441. package/dist/db-admin/types.d.ts +4 -0
  442. package/dist/db-admin/types.d.ts.map +1 -1
  443. package/dist/db-admin/types.js.map +1 -1
  444. package/dist/extensions/actions.d.ts.map +1 -1
  445. package/dist/extensions/actions.js +85 -5
  446. package/dist/extensions/actions.js.map +1 -1
  447. package/dist/extensions/html-shell.d.ts +5 -4
  448. package/dist/extensions/html-shell.d.ts.map +1 -1
  449. package/dist/extensions/html-shell.js.map +1 -1
  450. package/dist/extensions/routes.d.ts.map +1 -1
  451. package/dist/extensions/routes.js +8 -0
  452. package/dist/extensions/routes.js.map +1 -1
  453. package/dist/navigation/index.d.ts +1 -1
  454. package/dist/navigation/index.d.ts.map +1 -1
  455. package/dist/navigation/index.js +1 -1
  456. package/dist/navigation/index.js.map +1 -1
  457. package/dist/notifications/channels.d.ts +8 -3
  458. package/dist/notifications/channels.d.ts.map +1 -1
  459. package/dist/notifications/channels.js +61 -22
  460. package/dist/notifications/channels.js.map +1 -1
  461. package/dist/notifications/registry.d.ts.map +1 -1
  462. package/dist/notifications/registry.js +14 -3
  463. package/dist/notifications/registry.js.map +1 -1
  464. package/dist/notifications/types.d.ts +4 -1
  465. package/dist/notifications/types.d.ts.map +1 -1
  466. package/dist/notifications/types.js.map +1 -1
  467. package/dist/resources/handlers.d.ts +5 -0
  468. package/dist/resources/handlers.d.ts.map +1 -1
  469. package/dist/resources/handlers.js +9 -8
  470. package/dist/resources/handlers.js.map +1 -1
  471. package/dist/server/agent-chat-plugin.d.ts +5 -1
  472. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  473. package/dist/server/agent-chat-plugin.js +2 -2
  474. package/dist/server/agent-chat-plugin.js.map +1 -1
  475. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  476. package/dist/server/poll.d.ts +12 -4
  477. package/dist/server/poll.d.ts.map +1 -1
  478. package/dist/server/poll.js +236 -9
  479. package/dist/server/poll.js.map +1 -1
  480. package/dist/server/request-context.d.ts +7 -0
  481. package/dist/server/request-context.d.ts.map +1 -1
  482. package/dist/server/request-context.js.map +1 -1
  483. package/dist/styles/agent-conversation.css +1 -1
  484. package/dist/styles/agent-native.css +27 -0
  485. package/dist/templates/default/.agents/skills/actions/SKILL.md +5 -0
  486. package/dist/templates/default/.agents/skills/adding-a-feature/SKILL.md +5 -0
  487. package/dist/templates/default/.agents/skills/real-time-sync/SKILL.md +1 -1
  488. package/dist/templates/default/.agents/skills/security/SKILL.md +7 -0
  489. package/dist/templates/default/.agents/skills/self-modifying-code/SKILL.md +20 -2
  490. package/dist/templates/default/.agents/skills/storing-data/SKILL.md +5 -1
  491. package/dist/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  492. package/dist/templates/default/AGENTS.md +14 -5
  493. package/dist/templates/default/package.json +2 -1
  494. package/dist/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  495. package/dist/templates/headless/AGENTS.md +13 -3
  496. package/dist/templates/headless/package.json +1 -0
  497. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +5 -0
  498. package/dist/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +5 -0
  499. package/dist/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +4 -0
  500. package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +6 -0
  501. package/dist/templates/workspace-core/.agents/skills/performance/SKILL.md +4 -0
  502. package/dist/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +1 -1
  503. package/dist/templates/workspace-core/.agents/skills/security/SKILL.md +7 -0
  504. package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +20 -2
  505. package/dist/templates/workspace-core/.agents/skills/storing-data/SKILL.md +5 -1
  506. package/dist/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  507. package/dist/templates/workspace-core/AGENTS.md +7 -1
  508. package/dist/templates/workspace-root/AGENTS.md +17 -5
  509. package/dist/templates/workspace-root/package.json +1 -0
  510. package/docs/content/faq.mdx +17 -0
  511. package/docs/content/notifications.mdx +12 -6
  512. package/package.json +2 -2
  513. package/src/templates/default/.agents/skills/actions/SKILL.md +5 -0
  514. package/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +5 -0
  515. package/src/templates/default/.agents/skills/real-time-sync/SKILL.md +1 -1
  516. package/src/templates/default/.agents/skills/security/SKILL.md +7 -0
  517. package/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +20 -2
  518. package/src/templates/default/.agents/skills/storing-data/SKILL.md +5 -1
  519. package/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  520. package/src/templates/default/AGENTS.md +14 -5
  521. package/src/templates/default/package.json +2 -1
  522. package/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  523. package/src/templates/headless/AGENTS.md +13 -3
  524. package/src/templates/headless/package.json +1 -0
  525. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +5 -0
  526. package/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +5 -0
  527. package/src/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +4 -0
  528. package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +6 -0
  529. package/src/templates/workspace-core/.agents/skills/performance/SKILL.md +4 -0
  530. package/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +1 -1
  531. package/src/templates/workspace-core/.agents/skills/security/SKILL.md +7 -0
  532. package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +20 -2
  533. package/src/templates/workspace-core/.agents/skills/storing-data/SKILL.md +5 -1
  534. package/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  535. package/src/templates/workspace-core/AGENTS.md +7 -1
  536. package/src/templates/workspace-root/AGENTS.md +17 -5
  537. package/src/templates/workspace-root/package.json +1 -0
  538. package/corpus/templates/analytics/changelog/2026-07-08-session-replay-clamps-ultra-wide-viewports-while-keeping-the.md +0 -6
@@ -16,6 +16,7 @@ import {
16
16
  federateSources,
17
17
  } from "./_federation-join.js";
18
18
  import {
19
+ listPropertiesForDatabaseDocuments,
19
20
  listPropertiesForDatabase,
20
21
  serializeDatabase,
21
22
  } from "./_property-utils.js";
@@ -197,6 +198,10 @@ export async function getContentDatabaseResponse(
197
198
  )
198
199
  : [];
199
200
  const documentById = new Map(documents.map((doc) => [doc.id, doc]));
201
+ const propertiesByDocumentId = await listPropertiesForDatabaseDocuments(
202
+ databaseId,
203
+ documents,
204
+ );
200
205
  const queuedBodyHydrationItemIds =
201
206
  items.length > 0
202
207
  ? new Set(
@@ -234,7 +239,7 @@ export async function getContentDatabaseResponse(
234
239
  bodyHydration: serializeBodyHydration(item, {
235
240
  queued: bodyHydrationQueued,
236
241
  }),
237
- properties: await listPropertiesForDatabase(databaseId, document),
242
+ properties: propertiesByDocumentId.get(document.id) ?? [],
238
243
  });
239
244
  }
240
245
 
@@ -41,6 +41,7 @@ import {
41
41
  type DocumentPropertyType,
42
42
  type DocumentPropertyValue,
43
43
  } from "../shared/properties.js";
44
+ import { chunks } from "./_batch-utils.js";
44
45
 
45
46
  type DocumentRow = InferSelectModel<typeof schema.documents>;
46
47
  type ContentDatabaseRow = InferSelectModel<typeof schema.contentDatabases>;
@@ -526,6 +527,173 @@ export async function listPropertiesForDatabase(
526
527
  return nextProperties;
527
528
  }
528
529
 
530
+ function serializePropertyDefinition(
531
+ definition: typeof schema.documentPropertyDefinitions.$inferSelect,
532
+ ) {
533
+ const type = definition.type as DocumentPropertyType;
534
+ return {
535
+ id: definition.id,
536
+ databaseId: definition.databaseId,
537
+ name: definition.name,
538
+ type,
539
+ visibility: normalizePropertyVisibility(definition.visibility),
540
+ options: parsePropertyOptions(definition.optionsJson),
541
+ position: definition.position,
542
+ createdAt: definition.createdAt,
543
+ updatedAt: definition.updatedAt,
544
+ };
545
+ }
546
+
547
+ function propertyValueKey(documentId: string, propertyId: string) {
548
+ return `${documentId}\0${propertyId}`;
549
+ }
550
+
551
+ export async function listPropertiesForDatabaseDocuments(
552
+ databaseId: string,
553
+ valueDocuments: DocumentRow[],
554
+ ): Promise<Map<string, DocumentProperty[]>> {
555
+ const db = getDb();
556
+ const definitions = await db
557
+ .select()
558
+ .from(schema.documentPropertyDefinitions)
559
+ .where(eq(schema.documentPropertyDefinitions.databaseId, databaseId))
560
+ .orderBy(asc(schema.documentPropertyDefinitions.position));
561
+ const result = new Map<string, DocumentProperty[]>();
562
+ if (valueDocuments.length === 0) return result;
563
+ if (definitions.length === 0) {
564
+ for (const document of valueDocuments) result.set(document.id, []);
565
+ return result;
566
+ }
567
+
568
+ const documentIds = valueDocuments.map((document) => document.id);
569
+ const propertyIds = definitions.map((definition) => definition.id);
570
+ const values: Array<typeof schema.documentPropertyValues.$inferSelect> = [];
571
+ for (const documentIdChunk of chunks(documentIds, 200)) {
572
+ for (const propertyIdChunk of chunks(propertyIds, 200)) {
573
+ values.push(
574
+ ...(await db
575
+ .select()
576
+ .from(schema.documentPropertyValues)
577
+ .where(
578
+ and(
579
+ inArray(
580
+ schema.documentPropertyValues.documentId,
581
+ documentIdChunk,
582
+ ),
583
+ inArray(
584
+ schema.documentPropertyValues.propertyId,
585
+ propertyIdChunk,
586
+ ),
587
+ ),
588
+ )),
589
+ );
590
+ }
591
+ }
592
+ const valueByDocumentAndProperty = new Map(
593
+ values.map((value) => [
594
+ propertyValueKey(value.documentId, value.propertyId),
595
+ value,
596
+ ]),
597
+ );
598
+
599
+ const rowNumberByDocumentId = definitions.some((definition) =>
600
+ isComputedPropertyType(definition.type as DocumentPropertyType),
601
+ )
602
+ ? await databaseRowNumbersByDocumentId(databaseId)
603
+ : new Map<string, number>();
604
+
605
+ const blockContentByDocumentAndProperty = new Map<string, string>();
606
+ const hasAdditionalBlocksFields = definitions.some((definition) => {
607
+ const type = definition.type as DocumentPropertyType;
608
+ return (
609
+ isBlocksPropertyType(type) &&
610
+ !isPrimaryBlocksField(parsePropertyOptions(definition.optionsJson))
611
+ );
612
+ });
613
+ if (hasAdditionalBlocksFields) {
614
+ for (const documentIdChunk of chunks(documentIds, 200)) {
615
+ const rows = await db
616
+ .select({
617
+ documentId: schema.documentBlockFieldContents.documentId,
618
+ propertyId: schema.documentBlockFieldContents.propertyId,
619
+ content: schema.documentBlockFieldContents.content,
620
+ })
621
+ .from(schema.documentBlockFieldContents)
622
+ .where(
623
+ inArray(
624
+ schema.documentBlockFieldContents.documentId,
625
+ documentIdChunk,
626
+ ),
627
+ );
628
+ for (const row of rows) {
629
+ blockContentByDocumentAndProperty.set(
630
+ propertyValueKey(row.documentId, row.propertyId),
631
+ row.content ?? "",
632
+ );
633
+ }
634
+ }
635
+ }
636
+
637
+ for (const document of valueDocuments) {
638
+ const properties = definitions.map((definition) => {
639
+ const propertyDefinition = serializePropertyDefinition(definition);
640
+ const storedValue = valueByDocumentAndProperty.get(
641
+ propertyValueKey(document.id, definition.id),
642
+ );
643
+ return {
644
+ definition: propertyDefinition,
645
+ value:
646
+ isComputedPropertyType(propertyDefinition.type) &&
647
+ propertyDefinition.type !== "formula"
648
+ ? computedPropertyValue(propertyDefinition.type, document, {
649
+ databaseRowNumber: rowNumberByDocumentId.get(document.id),
650
+ })
651
+ : isBlocksPropertyType(propertyDefinition.type)
652
+ ? resolveBlocksFieldValue({
653
+ options: propertyDefinition.options,
654
+ documentBody: document.content,
655
+ blockFieldContent: blockContentByDocumentAndProperty.get(
656
+ propertyValueKey(document.id, definition.id),
657
+ ),
658
+ })
659
+ : parsePropertyValue(storedValue?.valueJson),
660
+ editable: !isComputedPropertyType(propertyDefinition.type),
661
+ };
662
+ });
663
+
664
+ const valuesByName = Object.fromEntries(
665
+ properties
666
+ .filter((property) => property.definition.type !== "formula")
667
+ .map((property) => [property.definition.name, property.value]),
668
+ );
669
+ const evaluatedProperties = properties.map((property) =>
670
+ property.definition.type === "formula"
671
+ ? {
672
+ ...property,
673
+ value: evaluatePropertyFormula(
674
+ property.definition.options.formula,
675
+ valuesByName,
676
+ ),
677
+ }
678
+ : property,
679
+ );
680
+ const nextProperties = [];
681
+ for (const property of evaluatedProperties) {
682
+ if (property.definition.type === "rollup") {
683
+ nextProperties.push({
684
+ ...property,
685
+ value: await evaluatePropertyRollup(property, evaluatedProperties),
686
+ });
687
+ } else {
688
+ nextProperties.push(property);
689
+ }
690
+ }
691
+ result.set(document.id, nextProperties);
692
+ }
693
+
694
+ return result;
695
+ }
696
+
529
697
  async function evaluatePropertyRollup(
530
698
  property: DocumentProperty,
531
699
  properties: DocumentProperty[],
@@ -21,6 +21,7 @@ import {
21
21
  type DocumentPropertyOptions,
22
22
  type DocumentPropertyType,
23
23
  } from "../shared/properties.js";
24
+ import { chunks } from "./_batch-utils.js";
24
25
  import {
25
26
  resolveDatabaseForSourceMutation,
26
27
  serializeSourceField,
@@ -343,7 +344,11 @@ export default defineAction({
343
344
  const sourceRows = isSecondary
344
345
  ? []
345
346
  : await db
346
- .select()
347
+ .select({
348
+ databaseItemId: schema.contentDatabaseSourceRows.databaseItemId,
349
+ documentId: schema.contentDatabaseSourceRows.documentId,
350
+ sourceValuesJson: schema.contentDatabaseSourceRows.sourceValuesJson,
351
+ })
347
352
  .from(schema.contentDatabaseSourceRows)
348
353
  .where(eq(schema.contentDatabaseSourceRows.sourceId, source.id));
349
354
  const builderMetadata = builderMetadataForSourceField({
@@ -397,17 +402,19 @@ export default defineAction({
397
402
  options,
398
403
  );
399
404
  if (itemValues.length > 0) {
400
- await db.insert(schema.documentPropertyValues).values(
401
- itemValues.map((row) => ({
402
- id: nanoid(),
403
- ownerEmail: database.ownerEmail,
404
- documentId: row.documentId,
405
- propertyId,
406
- valueJson: serializePropertyValue(row.value),
407
- createdAt: now,
408
- updatedAt: now,
409
- })),
410
- );
405
+ for (const chunk of chunks(itemValues, 200)) {
406
+ await db.insert(schema.documentPropertyValues).values(
407
+ chunk.map((row) => ({
408
+ id: nanoid(),
409
+ ownerEmail: database.ownerEmail,
410
+ documentId: row.documentId,
411
+ propertyId,
412
+ valueJson: serializePropertyValue(row.value),
413
+ createdAt: now,
414
+ updatedAt: now,
415
+ })),
416
+ );
417
+ }
411
418
  }
412
419
 
413
420
  const sourceField = serializeSourceField(
@@ -9,6 +9,7 @@ import type {
9
9
  ContentDatabaseResponse,
10
10
  } from "../shared/api.js";
11
11
  import { serializePropertyValue } from "../shared/properties.js";
12
+ import { chunks } from "./_batch-utils.js";
12
13
  import { resolveDatabaseForSourceMutation } from "./_database-source-utils.js";
13
14
  import { getContentDatabaseResponse } from "./_database-utils.js";
14
15
  import { nanoid } from "./_property-utils.js";
@@ -207,7 +208,11 @@ export default defineAction({
207
208
  }
208
209
  if (federationRole !== "secondary") {
209
210
  const sourceRows = await db
210
- .select()
211
+ .select({
212
+ databaseItemId: schema.contentDatabaseSourceRows.databaseItemId,
213
+ documentId: schema.contentDatabaseSourceRows.documentId,
214
+ sourceValuesJson: schema.contentDatabaseSourceRows.sourceValuesJson,
215
+ })
211
216
  .from(schema.contentDatabaseSourceRows)
212
217
  .where(eq(schema.contentDatabaseSourceRows.sourceId, source.id));
213
218
  const itemValues = sourceFieldPropertyValuesFromRows(
@@ -237,17 +242,19 @@ export default defineAction({
237
242
  );
238
243
  }
239
244
  if (itemValues.length > 0) {
240
- await db.insert(schema.documentPropertyValues).values(
241
- itemValues.map((row) => ({
242
- id: nanoid(),
243
- ownerEmail: database.ownerEmail,
244
- documentId: row.documentId,
245
- propertyId: property.id,
246
- valueJson: serializePropertyValue(row.value),
247
- createdAt: now,
248
- updatedAt: now,
249
- })),
250
- );
245
+ for (const chunk of chunks(itemValues, 200)) {
246
+ await db.insert(schema.documentPropertyValues).values(
247
+ chunk.map((row) => ({
248
+ id: nanoid(),
249
+ ownerEmail: database.ownerEmail,
250
+ documentId: row.documentId,
251
+ propertyId: property.id,
252
+ valueJson: serializePropertyValue(row.value),
253
+ createdAt: now,
254
+ updatedAt: now,
255
+ })),
256
+ );
257
+ }
251
258
  }
252
259
  }
253
260
 
@@ -5,6 +5,7 @@ import { and, eq, inArray } from "drizzle-orm";
5
5
  import { z } from "zod";
6
6
 
7
7
  import { getDb, schema } from "../server/db/index.js";
8
+ import { chunks } from "./_batch-utils.js";
8
9
  import {
9
10
  deleteLocalFileDocument,
10
11
  isLocalDocumentId,
@@ -13,21 +14,13 @@ import {
13
14
 
14
15
  const DELETE_BATCH_SIZE = 90;
15
16
 
16
- function chunks<T>(items: T[], size = DELETE_BATCH_SIZE): T[][] {
17
- const out: T[][] = [];
18
- for (let index = 0; index < items.length; index += size) {
19
- out.push(items.slice(index, index + size));
20
- }
21
- return out;
22
- }
23
-
24
17
  async function selectDocumentChildren(
25
18
  db: ReturnType<typeof getDb>,
26
19
  parentIds: string[],
27
20
  ownerEmail: string,
28
21
  ) {
29
22
  const rows: Array<{ id: string }> = [];
30
- for (const batch of chunks(parentIds)) {
23
+ for (const batch of chunks(parentIds, DELETE_BATCH_SIZE)) {
31
24
  rows.push(
32
25
  ...(await db
33
26
  .select({ id: schema.documents.id })
@@ -49,7 +42,7 @@ async function selectOwnedDatabaseIds(
49
42
  ownerEmail: string,
50
43
  ) {
51
44
  const rows: Array<{ id: string }> = [];
52
- for (const batch of chunks(documentIds)) {
45
+ for (const batch of chunks(documentIds, DELETE_BATCH_SIZE)) {
53
46
  rows.push(
54
47
  ...(await db
55
48
  .select({ id: schema.contentDatabases.id })
@@ -71,7 +64,7 @@ async function selectDatabaseItemDocuments(
71
64
  ownerEmail: string,
72
65
  ) {
73
66
  const rows: Array<{ documentId: string }> = [];
74
- for (const batch of chunks(databaseIds)) {
67
+ for (const batch of chunks(databaseIds, DELETE_BATCH_SIZE)) {
75
68
  rows.push(
76
69
  ...(await db
77
70
  .select({ documentId: schema.contentDatabaseItems.documentId })
@@ -87,7 +80,10 @@ async function selectDatabaseItemDocuments(
87
80
  if (rows.length === 0) return rows;
88
81
 
89
82
  const ownedRows: Array<{ id: string }> = [];
90
- for (const batch of chunks(rows.map((row) => row.documentId))) {
83
+ for (const batch of chunks(
84
+ rows.map((row) => row.documentId),
85
+ DELETE_BATCH_SIZE,
86
+ )) {
91
87
  ownedRows.push(
92
88
  ...(await db
93
89
  .select({ id: schema.documents.id })
@@ -167,7 +163,7 @@ async function deleteWhereIn<T>(
167
163
  items: T[],
168
164
  run: (batch: T[]) => Promise<unknown>,
169
165
  ) {
170
- for (const batch of chunks(items)) {
166
+ for (const batch of chunks(items, DELETE_BATCH_SIZE)) {
171
167
  if (batch.length > 0) await run(batch);
172
168
  }
173
169
  }
@@ -4,7 +4,8 @@ import { z } from "zod";
4
4
 
5
5
  import type { ContentDatabaseSourceStatusResponse } from "../shared/api.js";
6
6
  import {
7
- getContentDatabaseSourceSnapshotForWrite,
7
+ getContentDatabaseSourceSnapshot,
8
+ getContentDatabaseSourceSnapshotById,
8
9
  getExistingSourceForWrite,
9
10
  resyncBuilderCmsSourceSnapshot,
10
11
  resyncMockSourceSnapshot,
@@ -60,10 +61,9 @@ export default defineAction({
60
61
  } else {
61
62
  throw new Error(`Unsupported source type "${source.sourceType}".`);
62
63
  }
63
- const snapshot = await getContentDatabaseSourceSnapshotForWrite(
64
- database,
65
- args.sourceId,
66
- );
64
+ const snapshot = args.sourceId
65
+ ? await getContentDatabaseSourceSnapshotById(database, args.sourceId)
66
+ : await getContentDatabaseSourceSnapshot(database);
67
67
 
68
68
  const builderProgress =
69
69
  snapshot?.sourceType === "builder-cms" ? snapshot.metadata : null;
@@ -39,29 +39,39 @@ export function builderBodyHydrationDisplayHydratedCount(args: {
39
39
  export function databaseItemBodyHydrationIsPending(
40
40
  item: Pick<ContentDatabaseItem, "bodyHydration" | "document">,
41
41
  ) {
42
+ const hydration =
43
+ item.bodyHydration ?? item.document.databaseMembership?.bodyHydration;
42
44
  if (
43
- item.document.databaseMembership?.sourceId &&
44
- !item.bodyHydration &&
45
- !item.document.databaseMembership.bodyHydration
45
+ sourceBackedEmptyBodyNeedsHydration({
46
+ sourceId: item.document.databaseMembership?.sourceId,
47
+ content: item.document.content,
48
+ hydration,
49
+ })
46
50
  ) {
47
51
  return true;
48
52
  }
49
- return builderBodyHydrationIsPending(
50
- item.bodyHydration ?? item.document.databaseMembership?.bodyHydration,
51
- );
53
+ return builderBodyHydrationIsPending(hydration);
52
54
  }
53
55
 
54
56
  export function documentBodyHydrationIsPending(
55
- document: Pick<Document, "databaseMembership">,
57
+ document: Pick<Document, "content" | "databaseMembership">,
56
58
  ) {
57
- return builderBodyHydrationIsPending(
58
- document.databaseMembership?.bodyHydration,
59
- );
59
+ const hydration = document.databaseMembership?.bodyHydration;
60
+ if (
61
+ sourceBackedEmptyBodyNeedsHydration({
62
+ sourceId: document.databaseMembership?.sourceId,
63
+ content: document.content,
64
+ hydration,
65
+ })
66
+ ) {
67
+ return true;
68
+ }
69
+ return builderBodyHydrationIsPending(hydration);
60
70
  }
61
71
 
62
72
  export function previewBodyHydrationIsPending(args: {
63
73
  item: Pick<ContentDatabaseItem, "bodyHydration" | "document">;
64
- document: Pick<Document, "databaseMembership"> | null | undefined;
74
+ document: Pick<Document, "content" | "databaseMembership"> | null | undefined;
65
75
  }) {
66
76
  const membership =
67
77
  args.document?.databaseMembership ?? args.item.document.databaseMembership;
@@ -101,6 +111,20 @@ export function isEffectivelyEmptyDocumentContent(
101
111
  return normalized === "" || normalized === "<empty-block/>";
102
112
  }
103
113
 
114
+ function sourceBackedEmptyBodyNeedsHydration(args: {
115
+ sourceId: string | null | undefined;
116
+ content: string | null | undefined;
117
+ hydration: ContentDatabaseBodyHydration | null | undefined;
118
+ }) {
119
+ if (!args.sourceId || !isEffectivelyEmptyDocumentContent(args.content)) {
120
+ return false;
121
+ }
122
+ if (!args.hydration) return true;
123
+ if (builderBodyHydrationIsPending(args.hydration)) return true;
124
+ if (args.hydration.status === "error") return false;
125
+ return args.hydration.status === "hydrated" && !args.hydration.version;
126
+ }
127
+
104
128
  export function shouldIgnorePreviewEmptyNormalization(args: {
105
129
  currentContent: string | null | undefined;
106
130
  nextContent: string | null | undefined;
@@ -7159,6 +7159,11 @@ function BuilderSourceContinuationBar({
7159
7159
  )
7160
7160
  : rawFetchedCount;
7161
7161
  const hasMore = source.metadata.lastReadHasMore === true && !rowsComplete;
7162
+ const fetchedCountDetail = builderSourceContinuationFetchedCountDetail(
7163
+ source,
7164
+ fetchedCount,
7165
+ rowsComplete,
7166
+ );
7162
7167
  const bodyHydrationActive =
7163
7168
  !hasMore &&
7164
7169
  !!bodyHydration &&
@@ -7212,7 +7217,9 @@ function BuilderSourceContinuationBar({
7212
7217
  failed: bodyHydration.error,
7213
7218
  },
7214
7219
  )
7215
- : dbText("builderRowsFetchedSoFar", { count: fetchedCount });
7220
+ : dbText("builderRowsFetchedSoFar", {
7221
+ count: fetchedCountDetail ?? fetchedCount,
7222
+ });
7216
7223
 
7217
7224
  return (
7218
7225
  <div
@@ -8030,6 +8037,24 @@ export function builderSourceContinuationProgressPercent(
8030
8037
  : rawPercent;
8031
8038
  }
8032
8039
 
8040
+ export function builderSourceContinuationFetchedCountDetail(
8041
+ source: Pick<ContentDatabaseSource, "metadata">,
8042
+ fetchedCount: number | null,
8043
+ rowsComplete = false,
8044
+ ) {
8045
+ const knownFetchTotal =
8046
+ !rowsComplete &&
8047
+ source.metadata.lastReadHasMore === true &&
8048
+ typeof source.metadata.lastReadLimit === "number"
8049
+ ? source.metadata.lastReadLimit
8050
+ : null;
8051
+ return fetchedCount !== null &&
8052
+ knownFetchTotal !== null &&
8053
+ knownFetchTotal > fetchedCount
8054
+ ? `${fetchedCount} of ${knownFetchTotal}`
8055
+ : fetchedCount;
8056
+ }
8057
+
8033
8058
  export function builderSourceContinuationWatchdogDecision(refires: number) {
8034
8059
  return "refire";
8035
8060
  }
@@ -12427,12 +12452,24 @@ function isTablePropertyVisible(
12427
12452
  });
12428
12453
  }
12429
12454
 
12430
- function databaseTableCellDisplayValue(property: DocumentProperty) {
12455
+ function databaseTableCellDisplayValue(
12456
+ property: DocumentProperty,
12457
+ item?: Pick<ContentDatabaseItem, "bodyHydration" | "document">,
12458
+ ) {
12431
12459
  // Blocks columns show a word count, never the dumped body content.
12432
12460
  if (property.definition.type === "blocks") {
12433
12461
  const content = typeof property.value === "string" ? property.value : "";
12434
12462
  const words = countWords(content);
12435
- if (words === 0) return <span aria-hidden="true">&nbsp;</span>;
12463
+ if (words === 0) {
12464
+ if (item && databaseItemBodyHydrationIsPending(item)) {
12465
+ return (
12466
+ <span className="text-muted-foreground">
12467
+ {dbText("builderBodySyncing")}
12468
+ </span>
12469
+ );
12470
+ }
12471
+ return <span aria-hidden="true">&nbsp;</span>;
12472
+ }
12436
12473
  return (
12437
12474
  <span className="text-muted-foreground">{formatWordCount(content)}</span>
12438
12475
  );
@@ -16865,6 +16902,9 @@ function DatabaseTableRow({
16865
16902
  item.properties.find(
16866
16903
  (candidate) => candidate.definition.id === property.definition.id,
16867
16904
  ) ?? property;
16905
+ const bodyCellHydrationPending =
16906
+ itemProperty.definition.type === "blocks" &&
16907
+ databaseItemBodyHydrationIsPending(item);
16868
16908
 
16869
16909
  const value = (
16870
16910
  <div
@@ -16873,10 +16913,12 @@ function DatabaseTableRow({
16873
16913
  wrapCells
16874
16914
  ? "whitespace-normal break-words"
16875
16915
  : "truncate whitespace-nowrap",
16876
- isEmptyPropertyValue(itemProperty.value) && "text-transparent",
16916
+ isEmptyPropertyValue(itemProperty.value) &&
16917
+ !bodyCellHydrationPending &&
16918
+ "text-transparent",
16877
16919
  )}
16878
16920
  >
16879
- {databaseTableCellDisplayValue(itemProperty)}
16921
+ {databaseTableCellDisplayValue(itemProperty, item)}
16880
16922
  </div>
16881
16923
  );
16882
16924
  const isEditableCheckbox =
@@ -14,6 +14,7 @@ import { useQueryClient } from "@tanstack/react-query";
14
14
  import { toast } from "sonner";
15
15
 
16
16
  import { databaseItemBodyHydrationIsPending } from "@/components/editor/body-hydration";
17
+ import { isEffectivelyEmptyDocumentContent } from "@/components/editor/body-hydration";
17
18
 
18
19
  import type { DocumentUpdateConflictResponse } from "../../actions/update-document";
19
20
  import { useRestoreContentDatabase } from "./use-content-database";
@@ -85,14 +86,19 @@ export function seedDatabaseItemDocumentCaches(
85
86
  queryClient: Pick<QueryClient, "getQueryData" | "setQueryData">,
86
87
  item: ContentDatabaseItem,
87
88
  ) {
89
+ const sourceBackedEmptyBody =
90
+ (!!item.bodyHydration || !!item.document.databaseMembership?.sourceId) &&
91
+ isEffectivelyEmptyDocumentContent(item.document.content);
88
92
  // Seed only cold caches. Overwriting an existing entry would bump its
89
93
  // freshness with possibly older table-snapshot data (a background database
90
94
  // refetch can lag a just-saved document edit) and suppress the correcting
91
95
  // refetch for the whole staleTime window. Rows whose Builder body has not
92
- // hydrated yet are never seeded: their empty table-snapshot `content` would
93
- // render as an authoritative empty document.
96
+ // hydrated yet, or whose source-backed list snapshot intentionally omits the
97
+ // body, are never seeded: their empty table-snapshot `content` would render as
98
+ // an authoritative empty document.
94
99
  if (
95
100
  !databaseItemBodyHydrationIsPending(item) &&
101
+ !sourceBackedEmptyBody &&
96
102
  queryClient.getQueryData(documentQueryKey(item.document.id)) === undefined
97
103
  ) {
98
104
  queryClient.setQueryData<Document>(documentQueryKey(item.document.id), {
@@ -43,7 +43,7 @@ export default function SettingsRoute() {
43
43
  extraTabs={agentSettingsTabs}
44
44
  generalSearchEntries={generalSearchEntries}
45
45
  general={
46
- <main className="mx-auto w-full max-w-3xl space-y-6">
46
+ <main className="mx-auto w-full max-w-2xl space-y-6">
47
47
  <p className="text-sm leading-6 text-muted-foreground">
48
48
  {t("settings.description")}
49
49
  </p>
@@ -77,7 +77,7 @@ export default function SettingsRoute() {
77
77
  </div>
78
78
  }
79
79
  whatsNew={
80
- <div className="mx-auto w-full max-w-3xl">
80
+ <div className="mx-auto w-full max-w-2xl">
81
81
  <ChangelogSettingsCard markdown={changelog} />
82
82
  </div>
83
83
  }
@@ -7,5 +7,5 @@ export function meta() {
7
7
  }
8
8
 
9
9
  export default function TeamRoute() {
10
- return <Navigate to="/settings#team" replace />;
10
+ return <Navigate to="/settings#organization" replace />;
11
11
  }
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-07-08
4
+ ---
5
+
6
+ Builder source sync now completes reliably on hosted databases with hundreds of entries.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-07-08
4
+ ---
5
+
6
+ Fixed Builder database sync so large sources continue past the first batch without leaving the table stuck mid-refresh.
@@ -616,6 +616,25 @@ const runContentMigrations = runMigrations(
616
616
  // becoming unrelated top-level comments. See actions/sync-notion-comments.ts.
617
617
  sql: `ALTER TABLE document_comments ADD COLUMN IF NOT EXISTS notion_discussion_id TEXT`,
618
618
  },
619
+ {
620
+ version: 63,
621
+ name: "builder-source-refresh-hot-path-indexes",
622
+ sql: `CREATE INDEX IF NOT EXISTS content_database_items_database_position_idx ON content_database_items (database_id, position);
623
+ CREATE INDEX IF NOT EXISTS content_database_items_document_idx ON content_database_items (document_id);
624
+ CREATE INDEX IF NOT EXISTS content_database_source_rows_source_created_idx ON content_database_source_rows (source_id, created_at);
625
+ CREATE INDEX IF NOT EXISTS content_database_source_rows_source_document_idx ON content_database_source_rows (source_id, document_id);
626
+ CREATE INDEX IF NOT EXISTS content_database_source_rows_source_item_idx ON content_database_source_rows (source_id, database_item_id);
627
+ CREATE INDEX IF NOT EXISTS content_database_source_rows_source_row_idx ON content_database_source_rows (source_id, source_row_id);
628
+ CREATE INDEX IF NOT EXISTS content_database_source_fields_source_key_idx ON content_database_source_fields (source_id, source_field_key);
629
+ CREATE INDEX IF NOT EXISTS content_database_source_fields_source_property_idx ON content_database_source_fields (source_id, property_id);
630
+ CREATE INDEX IF NOT EXISTS content_database_body_hydration_queue_source_document_idx ON content_database_body_hydration_queue (source_id, document_id, priority, created_at)`,
631
+ },
632
+ {
633
+ version: 64,
634
+ name: "document-property-value-hot-path-indexes",
635
+ sql: `CREATE INDEX IF NOT EXISTS document_property_values_document_property_idx ON document_property_values (document_id, property_id);
636
+ CREATE INDEX IF NOT EXISTS document_property_values_property_document_idx ON document_property_values (property_id, document_id)`,
637
+ },
619
638
  ],
620
639
  { table: "content_migrations" },
621
640
  );