@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
@@ -1,8 +1,20 @@
1
- import { IconExternalLink, IconTable } from "@tabler/icons-react";
1
+ import {
2
+ IconDots,
3
+ IconDownload,
4
+ IconExternalLink,
5
+ IconTable,
6
+ } from "@tabler/icons-react";
2
7
 
3
8
  import { requestAgentSidebarOpen } from "../../agent-sidebar-state.js";
4
9
  import { appPath } from "../../api-path.js";
5
10
  import { startAgentChatViewTransition } from "../../chat-view-transition.js";
11
+ import {
12
+ DropdownMenu,
13
+ DropdownMenuContent,
14
+ DropdownMenuItem,
15
+ DropdownMenuTrigger,
16
+ } from "../../components/ui/dropdown-menu.js";
17
+ import { downloadFile, toCSVTable } from "../../db-admin/export-utils.js";
6
18
  import { cn } from "../../utils.js";
7
19
  import type { DataTableWidget as DataTableWidgetData } from "./data-widget-types.js";
8
20
 
@@ -82,6 +94,15 @@ function navigateSameAppHref(href: string): void {
82
94
  });
83
95
  }
84
96
 
97
+ function slugifyFilenamePart(value: string | undefined): string {
98
+ const slug = (value ?? "data-table")
99
+ .trim()
100
+ .toLowerCase()
101
+ .replace(/[^a-z0-9]+/g, "-")
102
+ .replace(/^-+|-+$/g, "");
103
+ return slug || "data-table";
104
+ }
105
+
85
106
  export function DataTableWidget({
86
107
  table,
87
108
  action,
@@ -91,6 +112,19 @@ export function DataTableWidget({
91
112
  }) {
92
113
  const rows = table.rows ?? [];
93
114
  const actionHref = action ? normalizeActionHref(action.href) : null;
115
+ const canExportCsv = table.columns.length > 0;
116
+ const exportCsv = () => {
117
+ if (!canExportCsv) return;
118
+ const stamp = new Date().toISOString().slice(0, 10);
119
+ downloadFile(
120
+ `${slugifyFilenamePart(table.title)}-${stamp}.csv`,
121
+ "text/csv;charset=utf-8",
122
+ toCSVTable(
123
+ table.columns.map((column) => column.label),
124
+ rows.map((row) => table.columns.map((column) => row[column.key])),
125
+ ),
126
+ );
127
+ };
94
128
 
95
129
  return (
96
130
  <div className="my-1.5 overflow-hidden rounded-lg border border-border bg-background text-foreground shadow-sm">
@@ -131,6 +165,23 @@ export function DataTableWidget({
131
165
  <IconExternalLink className="h-3 w-3" />
132
166
  </a>
133
167
  ) : null}
168
+ <DropdownMenu>
169
+ <DropdownMenuTrigger asChild>
170
+ <button
171
+ type="button"
172
+ aria-label="Data table options"
173
+ className="inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
174
+ >
175
+ <IconDots className="h-3.5 w-3.5" />
176
+ </button>
177
+ </DropdownMenuTrigger>
178
+ <DropdownMenuContent align="end" className="w-44">
179
+ <DropdownMenuItem onSelect={exportCsv} disabled={!canExportCsv}>
180
+ <IconDownload className="mr-2 h-3.5 w-3.5" />
181
+ Download CSV
182
+ </DropdownMenuItem>
183
+ </DropdownMenuContent>
184
+ </DropdownMenu>
134
185
  </div>
135
186
  <div className="max-h-[360px] overflow-auto">
136
187
  <table className="w-full min-w-[420px] border-collapse text-xs">
@@ -357,16 +357,9 @@ function thinkingContentPartForCodeAgentTranscriptItem(
357
357
  ): ContentPart | null {
358
358
  const text = item.text.trim();
359
359
  if (!text) return null;
360
- // Surface as a special "thinking" tool-call-like part so the chat renderer
361
- // can display a collapsed-by-default "Thinking…" cell. Using a distinct
362
- // toolName makes it easy to style in AssistantChat without a new content type.
363
360
  return {
364
- type: "tool-call",
365
- toolCallId: `thinking-${item.id}`,
366
- toolName: "thinking",
367
- argsText: "",
368
- args: {},
369
- result: text,
361
+ type: "reasoning",
362
+ text,
370
363
  };
371
364
  }
372
365
 
@@ -7,6 +7,8 @@ import {
7
7
  IconCode,
8
8
  IconArrowBackUp,
9
9
  IconDeviceFloppy,
10
+ IconDots,
11
+ IconDownload,
10
12
  IconChevronLeft,
11
13
  IconChevronRight,
12
14
  IconChevronsLeft,
@@ -25,6 +27,12 @@ import type {
25
27
  DbAdminSort,
26
28
  DbAdminMutationResult,
27
29
  } from "../../db-admin/types.js";
30
+ import {
31
+ DropdownMenu,
32
+ DropdownMenuContent,
33
+ DropdownMenuItem,
34
+ DropdownMenuTrigger,
35
+ } from "../components/ui/dropdown-menu.js";
28
36
  import {
29
37
  Popover,
30
38
  PopoverContent,
@@ -33,6 +41,7 @@ import {
33
41
  import { cn } from "../utils.js";
34
42
  import { useChangeset, pkStringFor } from "./changeset.js";
35
43
  import { DataGrid, type GridRow, type ActiveCell } from "./DataGrid.js";
44
+ import { downloadFile, toCSVTable } from "./export-utils.js";
36
45
  import { FilterBar } from "./FilterBar.js";
37
46
  import { RowSidePanel, type RowSidePanelMode } from "./RowSidePanel.js";
38
47
  import { loadGridState, saveGridState } from "./storage.js";
@@ -54,6 +63,15 @@ export interface TableEditorProps {
54
63
  const DEFAULT_PAGE_SIZE = 100;
55
64
  const PAGE_SIZES = [25, 50, 100, 250, 500];
56
65
 
66
+ function slugifyFilenamePart(value: string): string {
67
+ const slug = value
68
+ .trim()
69
+ .toLowerCase()
70
+ .replace(/[^a-z0-9]+/g, "-")
71
+ .replace(/^-+|-+$/g, "");
72
+ return slug || "table";
73
+ }
74
+
57
75
  export function TableEditor({
58
76
  table,
59
77
  dialect: _dialect,
@@ -300,6 +318,20 @@ export function TableEditor({
300
318
  }
301
319
 
302
320
  const noPk = schema.primaryKey.length === 0;
321
+ const exportCurrentPageCsv = () => {
322
+ const columns = schema.columns.map((column) => column.name);
323
+ const stamp = new Date().toISOString().slice(0, 10);
324
+ downloadFile(
325
+ `${slugifyFilenamePart(table)}-${stamp}.csv`,
326
+ "text/csv;charset=utf-8",
327
+ toCSVTable(
328
+ columns,
329
+ gridRows
330
+ .filter((row) => !row.isDeleted)
331
+ .map((row) => columns.map((column) => row.values[column])),
332
+ ),
333
+ );
334
+ };
303
335
 
304
336
  return (
305
337
  <div className="flex h-full min-h-0 flex-col">
@@ -337,6 +369,23 @@ export function TableEditor({
337
369
  primary
338
370
  />
339
371
  )}
372
+ <DropdownMenu>
373
+ <DropdownMenuTrigger asChild>
374
+ <button
375
+ type="button"
376
+ aria-label="Table options"
377
+ className="inline-flex h-7 w-7 cursor-pointer items-center justify-center rounded-md border border-border text-muted-foreground hover:bg-muted hover:text-foreground"
378
+ >
379
+ <IconDots className="h-3.5 w-3.5" />
380
+ </button>
381
+ </DropdownMenuTrigger>
382
+ <DropdownMenuContent align="end" className="w-44">
383
+ <DropdownMenuItem onSelect={exportCurrentPageCsv}>
384
+ <IconDownload className="mr-2 h-3.5 w-3.5" />
385
+ Download CSV
386
+ </DropdownMenuItem>
387
+ </DropdownMenuContent>
388
+ </DropdownMenu>
340
389
  </div>
341
390
  </div>
342
391
 
@@ -16,6 +16,9 @@ function cellToCSV(value: unknown): string {
16
16
  } else {
17
17
  str = String(value);
18
18
  }
19
+ // Spreadsheet apps treat leading =, +, -, and @ as formulas. Prefix with an
20
+ // apostrophe so exported CSV opens as literal text instead of executing.
21
+ if (/^[=+\-@]/.test(str)) str = `'${str}`;
19
22
  // Quote when the value contains a comma, quote, CR, or LF. Escape embedded
20
23
  // double-quotes by doubling them (RFC 4180).
21
24
  if (/[",\r\n]/.test(str)) {
@@ -24,16 +27,22 @@ function cellToCSV(value: unknown): string {
24
27
  return str;
25
28
  }
26
29
 
30
+ /** Render a matrix as RFC-4180-style CSV with a header row. */
31
+ export function toCSVTable(headers: string[], rows: unknown[][]): string {
32
+ const header = headers.map(cellToCSV).join(",");
33
+ const body = rows.map((row) => row.map(cellToCSV).join(","));
34
+ return [header, ...body].join("\r\n");
35
+ }
36
+
27
37
  /** Render rows as RFC-4180-style CSV with a header row of the given columns. */
28
38
  export function toCSV(
29
39
  columns: string[],
30
40
  rows: Record<string, unknown>[],
31
41
  ): string {
32
- const header = columns.map(cellToCSV).join(",");
33
- const body = rows.map((row) =>
34
- columns.map((col) => cellToCSV(row[col])).join(","),
42
+ return toCSVTable(
43
+ columns,
44
+ rows.map((row) => columns.map((col) => row[col])),
35
45
  );
36
- return [header, ...body].join("\r\n");
37
46
  }
38
47
 
39
48
  /** Render rows as a pretty-printed JSON array. */
@@ -14,7 +14,16 @@
14
14
  */
15
15
  import { useEffect, useRef } from "react";
16
16
 
17
+ import {
18
+ removeAgentChatContextItem,
19
+ setAgentChatContextItem,
20
+ } from "../agent-chat.js";
17
21
  import { agentNativePath } from "../api-path.js";
22
+ import {
23
+ deleteClientAppState,
24
+ readClientAppState,
25
+ setClientAppState,
26
+ } from "../application-state.js";
18
27
 
19
28
  const NAVIGATION_PATH = agentNativePath(
20
29
  "/_agent-native/application-state/navigation",
@@ -24,6 +33,9 @@ const NAVIGATE_PATH = agentNativePath(
24
33
  );
25
34
 
26
35
  const POLL_INTERVAL_MS = 1500;
36
+ const TABLE_CONTEXT_KEY = "database-selected-table";
37
+ const SELECTED_OBJECT_STATE_KEY = "selected-object";
38
+ const SELECTED_OBJECT_SOURCE_FIELD = "__agentNativeSelectedObjectSource";
27
39
 
28
40
  let cachedSource: string | null = null;
29
41
 
@@ -55,6 +67,23 @@ function headers(extra?: Record<string, string>): Record<string, string> {
55
67
  return h;
56
68
  }
57
69
 
70
+ async function deleteSelectedObjectIfOwned(source: string | undefined) {
71
+ if (!source) return;
72
+ try {
73
+ const current = await readClientAppState<Record<string, unknown>>(
74
+ SELECTED_OBJECT_STATE_KEY,
75
+ );
76
+ if (current?.[SELECTED_OBJECT_SOURCE_FIELD] !== source) return;
77
+ await deleteClientAppState(SELECTED_OBJECT_STATE_KEY, {
78
+ keepalive: true,
79
+ requestSource: source,
80
+ });
81
+ } catch {
82
+ // Best effort only; stale selected-object context is less harmful than
83
+ // clearing a selection owned by another tab.
84
+ }
85
+ }
86
+
58
87
  export interface DbAdminNavigationState {
59
88
  view: "database";
60
89
  table: string | null;
@@ -88,6 +117,49 @@ export function useDbAdminAgentSync({
88
117
  body: JSON.stringify(state),
89
118
  }).catch(() => {});
90
119
  }, [enabled, table, mode]);
120
+
121
+ useEffect(() => {
122
+ if (!enabled) return;
123
+ const source = requestSource();
124
+ if (!table) {
125
+ removeAgentChatContextItem({
126
+ key: TABLE_CONTEXT_KEY,
127
+ openSidebar: false,
128
+ });
129
+ deleteSelectedObjectIfOwned(source);
130
+ return;
131
+ }
132
+
133
+ const selection = {
134
+ type: "database-table",
135
+ table,
136
+ mode,
137
+ [SELECTED_OBJECT_SOURCE_FIELD]: source,
138
+ };
139
+ setAgentChatContextItem({
140
+ key: TABLE_CONTEXT_KEY,
141
+ title: `Table: ${table}`,
142
+ context: [
143
+ `The user currently has this database table selected: ${table}.`,
144
+ `Database admin mode: ${mode}`,
145
+ "Use the database admin actions and current-screen context to inspect rows, schema, or run SQL against this table.",
146
+ ].join("\n"),
147
+ openSidebar: false,
148
+ focus: false,
149
+ });
150
+ setClientAppState(SELECTED_OBJECT_STATE_KEY, selection, {
151
+ keepalive: true,
152
+ requestSource: source,
153
+ }).catch(() => {});
154
+
155
+ return () => {
156
+ removeAgentChatContextItem({
157
+ key: TABLE_CONTEXT_KEY,
158
+ openSidebar: false,
159
+ });
160
+ deleteSelectedObjectIfOwned(source);
161
+ };
162
+ }, [enabled, table, mode]);
91
163
  }
92
164
 
93
165
  interface NavigateCommand {
@@ -317,6 +317,72 @@ function signatureOf(type: string, message: string, stack?: string): string {
317
317
  return `${type}|${message}|${firstStackLine(stack)}`;
318
318
  }
319
319
 
320
+ function normalizeGlobalErrorEvent(event: ErrorEvent): {
321
+ type: string;
322
+ message: string;
323
+ stack?: string;
324
+ } {
325
+ const error = event?.error;
326
+ const normalized = error
327
+ ? normalizeCapturedError(error)
328
+ : {
329
+ type: "Error",
330
+ message: String(event?.message ?? "Uncaught error"),
331
+ };
332
+
333
+ if (!normalized.stack && event?.filename) {
334
+ const line = event.lineno ?? 0;
335
+ const col = event.colno ?? 0;
336
+ normalized.stack = `at ${event.filename}:${line}:${col}`;
337
+ }
338
+
339
+ return normalized;
340
+ }
341
+
342
+ function shouldIgnoreAutoCapturedError(normalized: {
343
+ type: string;
344
+ message: string;
345
+ stack?: string;
346
+ }): boolean {
347
+ const message = (normalized.message || "").trim();
348
+ const stack = normalized.stack || "";
349
+
350
+ if (
351
+ /^ResizeObserver loop (?:limit exceeded|completed with undelivered notifications\.?)$/i.test(
352
+ message,
353
+ )
354
+ ) {
355
+ return true;
356
+ }
357
+
358
+ if (
359
+ normalized.type === "InvalidStateError" &&
360
+ /^Transition was aborted because of invalid state$/i.test(message)
361
+ ) {
362
+ return true;
363
+ }
364
+
365
+ if (
366
+ /^This script should only be loaded in a browser extension\.?$/i.test(
367
+ message,
368
+ )
369
+ ) {
370
+ return true;
371
+ }
372
+
373
+ const hasExtensionFrame =
374
+ /\b(?:chrome|moz|safari|webkit)-extension:\/\//i.test(stack) ||
375
+ /\binjectScriptAdjust\.js\b/i.test(stack);
376
+ if (
377
+ hasExtensionFrame &&
378
+ /^(?:TypeError:\s*)?Failed to fetch$/i.test(message)
379
+ ) {
380
+ return true;
381
+ }
382
+
383
+ return false;
384
+ }
385
+
320
386
  function shouldDedupe(
321
387
  runtime: ErrorCaptureRuntime,
322
388
  signature: string,
@@ -540,13 +606,8 @@ export function installErrorCapture(
540
606
  if (runtime.config.captureGlobalErrors) {
541
607
  const onError = (event: ErrorEvent) => {
542
608
  try {
543
- const error = event?.error;
544
- const normalized = error
545
- ? normalizeCapturedError(error)
546
- : {
547
- type: "Error",
548
- message: String(event?.message ?? "Uncaught error"),
549
- };
609
+ const normalized = normalizeGlobalErrorEvent(event);
610
+ if (shouldIgnoreAutoCapturedError(normalized)) return;
550
611
  // Global errors are already logged by the session replay recorder, so
551
612
  // don't re-emit them onto the replay timeline (avoid double-counting).
552
613
  dispatch(
@@ -575,6 +636,7 @@ export function installErrorCapture(
575
636
  if (!normalized.type || normalized.type === "Error") {
576
637
  normalized.type = "UnhandledRejection";
577
638
  }
639
+ if (shouldIgnoreAutoCapturedError(normalized)) return;
578
640
  dispatch(
579
641
  runtime,
580
642
  buildEvent(runtime, normalized, {
@@ -41,6 +41,7 @@ import {
41
41
  type BridgePolicyContext,
42
42
  type ExtensionBridgeRole,
43
43
  } from "./iframe-bridge.js";
44
+ import { normalizeAgentNativeExtensionSandbox } from "./portable-extension.js";
44
45
 
45
46
  interface Extension {
46
47
  id: string;
@@ -55,6 +56,9 @@ interface Extension {
55
56
  };
56
57
  }
57
58
 
59
+ const EXTENSION_IFRAME_SANDBOX =
60
+ normalizeAgentNativeExtensionSandbox(undefined);
61
+
58
62
  // Read the host app's *actual* computed theme values for the shared token set
59
63
  // (THEME_VAR_NAMES). The iframe ships with a generic baked palette
60
64
  // (getThemeVars); syncing the live values keeps embedded extensions visually
@@ -392,7 +396,7 @@ export function EmbeddedExtension({
392
396
  key={`${extensionId}-${extension.updatedAt ?? ""}`}
393
397
  src={iframeSrc}
394
398
  title={extension.name}
395
- sandbox="allow-scripts allow-forms"
399
+ sandbox={EXTENSION_IFRAME_SANDBOX}
396
400
  style={{ width: "100%", border: 0, height, display: "block" }}
397
401
  onLoad={() => {
398
402
  iframeRef.current?.contentWindow?.postMessage(
@@ -51,6 +51,7 @@ import {
51
51
  type BridgePolicyContext,
52
52
  type ExtensionBridgeRole,
53
53
  } from "./iframe-bridge.js";
54
+ import { normalizeAgentNativeExtensionSandbox } from "./portable-extension.js";
54
55
 
55
56
  const THEME_CSS_VARS = [
56
57
  "--background",
@@ -83,6 +84,9 @@ const THEME_CSS_VARS = [
83
84
  "--sidebar-ring",
84
85
  ];
85
86
 
87
+ const EXTENSION_IFRAME_SANDBOX =
88
+ normalizeAgentNativeExtensionSandbox(undefined);
89
+
86
90
  function getParentThemeVars(): Record<string, string> {
87
91
  const computed = getComputedStyle(document.documentElement);
88
92
  const vars: Record<string, string> = {};
@@ -261,6 +265,40 @@ function compactDiffLines(
261
265
  return result;
262
266
  }
263
267
 
268
+ function ExtensionUnavailableState({ status }: { status?: number }) {
269
+ const sessionExpired = status === 401;
270
+ const accessDenied = status === 403;
271
+ const unavailable = status === 404;
272
+ const title = sessionExpired
273
+ ? "Session expired"
274
+ : accessDenied
275
+ ? "Extension is not shared"
276
+ : unavailable
277
+ ? "Extension is unavailable"
278
+ : "Extension not found";
279
+ const message = sessionExpired
280
+ ? "Sign in again to view this extension."
281
+ : accessDenied
282
+ ? "You do not have access to this extension. Ask the owner to share it with your organization or open a different extension."
283
+ : "This extension may not be shared with you, may have been deleted, or is not available to your account.";
284
+ return (
285
+ <div className="flex h-full min-h-[20rem] items-center justify-center bg-muted/20 p-6">
286
+ <div className="w-full max-w-md rounded-lg border border-border bg-background p-6 text-center shadow-sm">
287
+ <p className="text-sm font-semibold text-foreground">{title}</p>
288
+ <p className="mt-2 text-sm leading-6 text-muted-foreground">
289
+ {message}
290
+ </p>
291
+ <Link
292
+ to="/extensions"
293
+ className="mt-4 inline-flex h-9 items-center justify-center rounded-md border border-input px-3 text-sm font-medium text-foreground hover:bg-accent hover:text-accent-foreground"
294
+ >
295
+ Back to extensions
296
+ </Link>
297
+ </div>
298
+ </div>
299
+ );
300
+ }
301
+
264
302
  function diffLineClass(line: CompactDiffLine): string {
265
303
  switch (line.type) {
266
304
  case "insert":
@@ -1071,6 +1109,7 @@ export function ExtensionViewer({ extensionId }: ExtensionViewerProps) {
1071
1109
  const {
1072
1110
  data: extension,
1073
1111
  error: extensionError,
1112
+ failureReason: extensionFailureReason,
1074
1113
  isFetching,
1075
1114
  isLoading,
1076
1115
  } = useQuery<Extension>({
@@ -1079,6 +1118,9 @@ export function ExtensionViewer({ extensionId }: ExtensionViewerProps) {
1079
1118
  const res = await fetch(
1080
1119
  agentNativePath(`/_agent-native/extensions/${extensionId}`),
1081
1120
  );
1121
+ if (res.status === 401) {
1122
+ throw extensionLoadError(401, "Session expired");
1123
+ }
1082
1124
  if (res.status === 404) {
1083
1125
  throw extensionLoadError(404, "Extension not found");
1084
1126
  }
@@ -1092,6 +1134,7 @@ export function ExtensionViewer({ extensionId }: ExtensionViewerProps) {
1092
1134
  },
1093
1135
  retry: shouldRetryExtensionLoad,
1094
1136
  retryDelay: (attempt) => Math.min(1000 * 2 ** attempt, 4000),
1137
+ refetchOnMount: "always",
1095
1138
  });
1096
1139
 
1097
1140
  toolRef.current = extension ?? null;
@@ -1130,6 +1173,13 @@ export function ExtensionViewer({ extensionId }: ExtensionViewerProps) {
1130
1173
  if (!extension?.content || !isEmbedMcpChatBridgeActive()) return undefined;
1131
1174
  return buildExtensionViewerSrcDoc(extension, isDark);
1132
1175
  }, [extension, isDark]);
1176
+ const unavailableStatus = extensionLoadErrorStatus(
1177
+ extensionError ?? extensionFailureReason,
1178
+ );
1179
+ const latestFetchDenied =
1180
+ unavailableStatus === 401 ||
1181
+ unavailableStatus === 403 ||
1182
+ unavailableStatus === 404;
1133
1183
 
1134
1184
  useEffect(() => {
1135
1185
  setIframeReady(false);
@@ -1187,13 +1237,8 @@ export function ExtensionViewer({ extensionId }: ExtensionViewerProps) {
1187
1237
  );
1188
1238
  }
1189
1239
 
1190
- if (!extension) {
1191
- const status = extensionLoadErrorStatus(extensionError);
1192
- return (
1193
- <div className="flex h-full items-center justify-center text-sm text-muted-foreground">
1194
- {status === 403 ? "Extension access denied" : "Extension not found"}
1195
- </div>
1196
- );
1240
+ if (latestFetchDenied || !extension) {
1241
+ return <ExtensionUnavailableState status={unavailableStatus} />;
1197
1242
  }
1198
1243
 
1199
1244
  const isLocalExtension = extension.source?.mode === "local-files";
@@ -1334,7 +1379,7 @@ export function ExtensionViewer({ extensionId }: ExtensionViewerProps) {
1334
1379
  src={iframeSrcDoc ? undefined : iframeSrc}
1335
1380
  srcDoc={iframeSrcDoc}
1336
1381
  className="h-full w-full border-0"
1337
- sandbox="allow-scripts allow-forms"
1382
+ sandbox={EXTENSION_IFRAME_SANDBOX}
1338
1383
  title={extension.name}
1339
1384
  style={{
1340
1385
  pointerEvents: openPopoverCount > 0 ? "none" : "auto",
@@ -11,6 +11,7 @@ import {
11
11
  type BridgePolicyContext,
12
12
  type ExtensionBridgeRole,
13
13
  } from "./iframe-bridge.js";
14
+ import { normalizeAgentNativeExtensionSandbox } from "./portable-extension.js";
14
15
 
15
16
  const THEME_CSS_VARS = [
16
17
  "--background",
@@ -43,6 +44,9 @@ const THEME_CSS_VARS = [
43
44
  "--sidebar-ring",
44
45
  ];
45
46
 
47
+ const EXTENSION_IFRAME_SANDBOX =
48
+ normalizeAgentNativeExtensionSandbox(undefined);
49
+
46
50
  interface InlineExtensionSource {
47
51
  mode?: "database" | "local-files";
48
52
  permissions?: BridgePolicyContext["permissions"];
@@ -642,7 +646,7 @@ export function InlineExtensionFrame({
642
646
  src={iframeSrc}
643
647
  srcDoc={srcDoc}
644
648
  title={extension.name}
645
- sandbox="allow-scripts allow-forms"
649
+ sandbox={EXTENSION_IFRAME_SANDBOX}
646
650
  style={{ width: "100%", border: 0, height, display: "block" }}
647
651
  onLoad={() => {
648
652
  sendThemeToIframe();
@@ -447,6 +447,7 @@ export function normalizeAgentNativeExtensionSandbox(
447
447
  );
448
448
  tokens.delete("allow-same-origin");
449
449
  tokens.add("allow-scripts");
450
+ tokens.add("allow-downloads");
450
451
  return Array.from(tokens).join(" ");
451
452
  }
452
453
 
@@ -62,7 +62,7 @@ export interface OrgSwitcherProps {
62
62
  reserveSpace?: boolean;
63
63
  /**
64
64
  * Path to navigate to when the user clicks "Organization settings".
65
- * Defaults to the standard Team tab inside Settings. Templates with an
65
+ * Defaults to the Organization tab inside Settings. Templates with an
66
66
  * established org surface can pass their own path; pass `null` to only open
67
67
  * the in-sidebar settings panel.
68
68
  */
@@ -98,7 +98,7 @@ const APP_SUBMENU_CONTENT_CLASS =
98
98
  const SWITCHER_BUTTON_CLASS =
99
99
  "flex w-full items-center gap-2 rounded-md border border-border/70 px-2.5 py-1.5 text-xs font-medium text-muted-foreground hover:bg-accent/50 hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-60 cursor-pointer";
100
100
 
101
- const DEFAULT_ORGANIZATION_SETTINGS_PATH = "/settings#team";
101
+ const DEFAULT_ORGANIZATION_SETTINGS_PATH = "/settings#organization";
102
102
 
103
103
  const APP_ICON_MAP: Record<string, typeof IconApps> = {
104
104
  Mail: IconMail,
@@ -130,7 +130,9 @@ function appMenuIcon(app: OrgSwitcherAppLink): typeof IconApps {
130
130
  }
131
131
 
132
132
  function organizationSettingsPath(path: string): string {
133
- return path.includes("#") ? path : `${path}#team`;
133
+ if (path.includes("#")) return path;
134
+ const pathname = path.split("?")[0]?.replace(/\/+$/, "");
135
+ return pathname === "/settings" ? `${path}#organization` : path;
134
136
  }
135
137
 
136
138
  function AppMenuLink({
@@ -547,14 +549,15 @@ export function OrgSwitcher({
547
549
  type="button"
548
550
  onClick={() => {
549
551
  setOpen(false);
550
- window.dispatchEvent(new CustomEvent("agent-panel:open"));
551
- window.dispatchEvent(
552
- new CustomEvent("agent-panel:open-settings", {
553
- detail: { section: "workspace-settings" },
554
- }),
555
- );
556
552
  if (organizationSettingsHref) {
557
553
  navigate(organizationSettingsHref);
554
+ } else {
555
+ window.dispatchEvent(new CustomEvent("agent-panel:open"));
556
+ window.dispatchEvent(
557
+ new CustomEvent("agent-panel:open-settings", {
558
+ detail: { section: "workspace-settings" },
559
+ }),
560
+ );
558
561
  }
559
562
  }}
560
563
  className={`${ITEM_CLASS} cursor-pointer`}