@agent-native/core 0.90.11 → 0.91.0

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 (315) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +22 -0
  3. package/corpus/core/docs/content/toolkit-settings.mdx +56 -3
  4. package/corpus/core/package.json +2 -1
  5. package/corpus/core/src/agent/run-ownership.ts +29 -1
  6. package/corpus/core/src/changelog/parse.ts +78 -0
  7. package/corpus/core/src/chat-threads/schema.ts +43 -0
  8. package/corpus/core/src/chat-threads/store.ts +144 -12
  9. package/corpus/core/src/cli/workspace-dev.ts +25 -5
  10. package/corpus/core/src/client/AgentPanel.tsx +79 -14
  11. package/corpus/core/src/client/AssistantChat.tsx +359 -425
  12. package/corpus/core/src/client/analytics-session.ts +70 -0
  13. package/corpus/core/src/client/analytics.ts +175 -49
  14. package/corpus/core/src/client/chat/message-components.tsx +22 -2
  15. package/corpus/core/src/client/components/ui/message-scroller.tsx +131 -0
  16. package/corpus/core/src/client/conversation/AgentConversation.tsx +63 -41
  17. package/corpus/core/src/client/error-capture.ts +616 -0
  18. package/corpus/core/src/client/index.ts +12 -0
  19. package/corpus/core/src/client/session-replay.ts +57 -7
  20. package/corpus/core/src/client/settings/SettingsPanel.tsx +123 -1
  21. package/corpus/core/src/client/settings/SettingsTabsPage.tsx +292 -45
  22. package/corpus/core/src/client/settings/index.ts +1 -0
  23. package/corpus/core/src/client/sharing/ShareButton.tsx +14 -11
  24. package/corpus/core/src/client/sharing/ShareDialog.tsx +13 -10
  25. package/corpus/core/src/mcp/builtin-tools.ts +29 -2
  26. package/corpus/core/src/server/agent-chat-plugin.ts +174 -79
  27. package/corpus/core/src/server/onboarding-html.ts +28 -16
  28. package/corpus/core/src/sharing/actions/list-resource-shares.ts +45 -1
  29. package/corpus/core/src/sharing/actions/share-resource.ts +9 -0
  30. package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +4 -2
  31. package/corpus/core/src/templates/workspace-core/.agents/skills/changelog/SKILL.md +9 -6
  32. package/corpus/core/src/vite/client.ts +217 -35
  33. package/corpus/templates/analytics/.agents/skills/adhoc-analysis/SKILL.md +8 -7
  34. package/corpus/templates/analytics/.agents/skills/analysis-workspace/SKILL.md +14 -10
  35. package/corpus/templates/analytics/.agents/skills/bigquery/SKILL.md +15 -15
  36. package/corpus/templates/analytics/.agents/skills/cross-source-analysis/SKILL.md +1 -0
  37. package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +38 -22
  38. package/corpus/templates/analytics/.agents/skills/data-programs/SKILL.md +114 -61
  39. package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +1 -0
  40. package/corpus/templates/analytics/.agents/skills/gong/SKILL.md +7 -7
  41. package/corpus/templates/analytics/.agents/skills/hubspot/SKILL.md +1 -0
  42. package/corpus/templates/analytics/.agents/skills/prometheus/SKILL.md +1 -1
  43. package/corpus/templates/analytics/.builder/skills/bigquery/SKILL.md +17 -17
  44. package/corpus/templates/analytics/.builder/skills/gcloud/SKILL.md +5 -5
  45. package/corpus/templates/analytics/.builder/skills/github/SKILL.md +7 -7
  46. package/corpus/templates/analytics/.builder/skills/gong/SKILL.md +12 -12
  47. package/corpus/templates/analytics/.builder/skills/grafana/SKILL.md +7 -7
  48. package/corpus/templates/analytics/.builder/skills/sentry/SKILL.md +7 -7
  49. package/corpus/templates/analytics/.builder/skills/slack/SKILL.md +6 -6
  50. package/corpus/templates/analytics/.builder/skills/stripe/SKILL.md +7 -7
  51. package/corpus/templates/analytics/AGENTS.md +47 -2
  52. package/corpus/templates/analytics/actions/add-status-page-monitor.ts +36 -0
  53. package/corpus/templates/analytics/actions/capture-test-error.ts +33 -0
  54. package/corpus/templates/analytics/actions/delete-monitor.ts +24 -0
  55. package/corpus/templates/analytics/actions/delete-status-page.ts +23 -0
  56. package/corpus/templates/analytics/actions/get-error-issue.ts +36 -0
  57. package/corpus/templates/analytics/actions/get-monitor-stats.ts +55 -0
  58. package/corpus/templates/analytics/actions/get-monitor.ts +27 -0
  59. package/corpus/templates/analytics/actions/get-public-status-page.ts +41 -0
  60. package/corpus/templates/analytics/actions/get-status-page.ts +29 -0
  61. package/corpus/templates/analytics/actions/list-error-issues.ts +40 -0
  62. package/corpus/templates/analytics/actions/list-monitors.ts +21 -0
  63. package/corpus/templates/analytics/actions/list-status-pages.ts +21 -0
  64. package/corpus/templates/analytics/actions/match-error-issues.ts +51 -0
  65. package/corpus/templates/analytics/actions/navigate.ts +58 -4
  66. package/corpus/templates/analytics/actions/remove-status-page-monitor.ts +22 -0
  67. package/corpus/templates/analytics/actions/reorder-status-page-monitors.ts +25 -0
  68. package/corpus/templates/analytics/actions/resolve-error-issue.ts +38 -0
  69. package/corpus/templates/analytics/actions/run-monitor-check.ts +23 -0
  70. package/corpus/templates/analytics/actions/save-analysis.ts +1 -0
  71. package/corpus/templates/analytics/actions/save-monitor.ts +145 -0
  72. package/corpus/templates/analytics/actions/save-status-page.ts +47 -0
  73. package/corpus/templates/analytics/actions/view-screen.ts +212 -0
  74. package/corpus/templates/analytics/app/components/layout/Header.tsx +1 -0
  75. package/corpus/templates/analytics/app/components/layout/Layout.tsx +10 -1
  76. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +134 -39
  77. package/corpus/templates/analytics/app/components/monitoring/PublicStatusView.tsx +351 -0
  78. package/corpus/templates/analytics/app/components/monitoring/ResponseTimeChart.tsx +174 -0
  79. package/corpus/templates/analytics/app/components/monitoring/UptimeStatCards.tsx +85 -0
  80. package/corpus/templates/analytics/app/components/monitoring/UptimeTimelineBars.tsx +106 -0
  81. package/corpus/templates/analytics/app/components/monitoring/chart-utils.ts +101 -0
  82. package/corpus/templates/analytics/app/components/monitoring/index.ts +28 -0
  83. package/corpus/templates/analytics/app/components/monitoring/types.ts +42 -0
  84. package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +34 -0
  85. package/corpus/templates/analytics/app/i18n/zh-TW.ts +6 -0
  86. package/corpus/templates/analytics/app/i18n-data.ts +33 -0
  87. package/corpus/templates/analytics/app/pages/DataSources.tsx +28 -0
  88. package/corpus/templates/analytics/app/pages/Settings.tsx +77 -9
  89. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +3 -3
  90. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/dashboard-layout.ts +7 -0
  91. package/corpus/templates/analytics/app/pages/monitoring/ErrorsPanel.tsx +205 -0
  92. package/corpus/templates/analytics/app/pages/monitoring/MonitoringPage.tsx +100 -0
  93. package/corpus/templates/analytics/app/pages/monitoring/UptimePanel.tsx +475 -0
  94. package/corpus/templates/analytics/app/pages/monitoring/errors/IssueDetail.tsx +372 -0
  95. package/corpus/templates/analytics/app/pages/monitoring/errors/IssueList.tsx +360 -0
  96. package/corpus/templates/analytics/app/pages/monitoring/errors/Sparkline.tsx +55 -0
  97. package/corpus/templates/analytics/app/pages/monitoring/errors/i18n.ts +106 -0
  98. package/corpus/templates/analytics/app/pages/monitoring/errors/types.ts +75 -0
  99. package/corpus/templates/analytics/app/pages/monitoring/errors/utils.ts +132 -0
  100. package/corpus/templates/analytics/app/pages/monitoring/uptime/MonitorDetail.tsx +535 -0
  101. package/corpus/templates/analytics/app/pages/monitoring/uptime/MonitorFormPage.tsx +1026 -0
  102. package/corpus/templates/analytics/app/pages/monitoring/uptime/MonitorList.tsx +311 -0
  103. package/corpus/templates/analytics/app/pages/monitoring/uptime/i18n.ts +235 -0
  104. package/corpus/templates/analytics/app/pages/monitoring/uptime/status-pages/StatusPageEditor.tsx +661 -0
  105. package/corpus/templates/analytics/app/pages/monitoring/uptime/status-pages/StatusPagesView.tsx +355 -0
  106. package/corpus/templates/analytics/app/pages/monitoring/uptime/status-pages/i18n.ts +106 -0
  107. package/corpus/templates/analytics/app/pages/monitoring/uptime/status-pages/slug.ts +24 -0
  108. package/corpus/templates/analytics/app/pages/monitoring/uptime/status-pages/types.ts +20 -0
  109. package/corpus/templates/analytics/app/pages/monitoring/uptime/status-summary.ts +87 -0
  110. package/corpus/templates/analytics/app/pages/monitoring/uptime/types.ts +161 -0
  111. package/corpus/templates/analytics/app/pages/monitoring/uptime/utils.ts +210 -0
  112. package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +76 -1
  113. package/corpus/templates/analytics/app/pages/sessions/SessionDevToolsPanel.tsx +74 -9
  114. package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +197 -20
  115. package/corpus/templates/analytics/app/root.tsx +33 -1
  116. package/corpus/templates/analytics/app/routes/monitoring._index.tsx +10 -0
  117. package/corpus/templates/analytics/app/routes/status.$slug.tsx +118 -0
  118. package/corpus/templates/analytics/changelog/2026-07-08-add-uptime-monitors-that-ping-your-urls-and-alert-you-when-t.md +6 -0
  119. package/corpus/templates/analytics/changelog/2026-07-08-analytics-chats-keep-large-data-dictionaries-compact-so-prov.md +6 -0
  120. package/corpus/templates/analytics/changelog/2026-07-08-create-public-status-pages-that-share-the-live-health-of-cho.md +6 -0
  121. package/corpus/templates/analytics/changelog/2026-07-08-dashboard-extension-panels-use-clearer-open-copy.md +6 -0
  122. package/corpus/templates/analytics/changelog/2026-07-08-error-capture.md +6 -0
  123. package/corpus/templates/analytics/changelog/2026-07-08-fixed-single-panel-dashboard-drags-so-they-no-longer-rewrite.md +6 -0
  124. package/corpus/templates/analytics/changelog/2026-07-08-jump-straight-from-an-error-in-a-session-recording-to-its-fu.md +6 -0
  125. package/corpus/templates/analytics/changelog/2026-07-08-monitor-detail-and-list-now-show-colorful-uptime-timelines-r.md +6 -0
  126. package/corpus/templates/analytics/changelog/2026-07-08-pinned-ask-chats-now-show-a-pin-icon-in-the-sidebar.md +6 -0
  127. package/corpus/templates/analytics/changelog/2026-07-08-publish-a-public-uptime-status-page-with-colorful-uptime-tim.md +6 -0
  128. package/corpus/templates/analytics/changelog/2026-07-08-sessions-now-hide-visitor-emails-in-demo-mode-and-show-clean.md +6 -0
  129. package/corpus/templates/analytics/changelog/2026-07-08-settings-are-cleaner-searchable-and-alerts-have-their-own-tab.md +5 -0
  130. package/corpus/templates/analytics/changelog/2026-07-08-sidebar-sections-stay-collapsed-until-opened.md +5 -0
  131. package/corpus/templates/analytics/changelog/2026-07-08-the-uptime-monitor-list-now-has-a-current-status-overview-wi.md +6 -0
  132. package/corpus/templates/analytics/docs/error-capture.md +172 -0
  133. package/corpus/templates/analytics/docs/uptime-monitoring.md +150 -0
  134. package/corpus/templates/analytics/server/db/schema-errors.ts +150 -0
  135. package/corpus/templates/analytics/server/db/schema-monitoring.ts +177 -0
  136. package/corpus/templates/analytics/server/db/schema.ts +6 -0
  137. package/corpus/templates/analytics/server/jobs/uptime-monitors.ts +123 -0
  138. package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +41 -0
  139. package/corpus/templates/analytics/server/lib/data-dictionary-context.ts +55 -12
  140. package/corpus/templates/analytics/server/lib/error-capture.ts +1331 -0
  141. package/corpus/templates/analytics/server/lib/first-party-analytics.ts +47 -1
  142. package/corpus/templates/analytics/server/lib/monitor-stats.ts +494 -0
  143. package/corpus/templates/analytics/server/lib/status-pages.ts +798 -0
  144. package/corpus/templates/analytics/server/lib/uptime-monitors.ts +1665 -0
  145. package/corpus/templates/analytics/server/plugins/agent-chat.ts +7 -37
  146. package/corpus/templates/analytics/server/plugins/auth.ts +11 -1
  147. package/corpus/templates/analytics/server/plugins/db.ts +408 -0
  148. package/corpus/templates/analytics/server/plugins/uptime-monitor-jobs.ts +63 -0
  149. package/corpus/templates/assets/app/routes/_index.tsx +1 -1
  150. package/corpus/templates/assets/app/routes/settings.tsx +22 -1
  151. package/corpus/templates/assets/changelog/2026-07-08-recent-drafts-keep-comfortable-side-padding.md +6 -0
  152. package/corpus/templates/assets/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
  153. package/corpus/templates/brain/app/routes/settings.tsx +43 -5
  154. package/corpus/templates/brain/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
  155. package/corpus/templates/calendar/app/pages/Settings.tsx +44 -6
  156. package/corpus/templates/calendar/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
  157. package/corpus/templates/chat/app/routes/settings.tsx +16 -1
  158. package/corpus/templates/chat/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
  159. package/corpus/templates/clips/actions/lib/audio-only-transcription.ts +79 -37
  160. package/corpus/templates/clips/app/components/player/player-controls.tsx +35 -0
  161. package/corpus/templates/clips/app/components/player/video-player.tsx +162 -18
  162. package/corpus/templates/clips/app/routes/_app.settings._index.tsx +63 -6
  163. package/corpus/templates/clips/app/routes/record.tsx +18 -1
  164. package/corpus/templates/clips/changelog/2026-07-07-shared-clips-start-playback-reliably-from-the-first-play-click.md +6 -0
  165. package/corpus/templates/clips/changelog/2026-07-08-chrome-extension-camera-and-microphone-menus-now-show-which-.md +6 -0
  166. package/corpus/templates/clips/changelog/2026-07-08-chrome-extension-copies-new-clip-links-after-saving.md +6 -0
  167. package/corpus/templates/clips/changelog/2026-07-08-chrome-extension-recordings-now-continue-after-granting-came.md +6 -0
  168. package/corpus/templates/clips/changelog/2026-07-08-mobile-shared-clips-now-have-loom-style-tap-and-skip-controls.md +6 -0
  169. package/corpus/templates/clips/changelog/2026-07-08-recordings-and-uploads-copy-links-after-saving.md +6 -0
  170. package/corpus/templates/clips/changelog/2026-07-08-settings-are-cleaner-searchable-and-collapse-s3-with-builder.md +5 -0
  171. package/corpus/templates/clips/changelog/2026-07-08-transcripts-are-more-reliable-for-longer-desktop-recordings-.md +6 -0
  172. package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -0
  173. package/corpus/templates/clips/chrome-extension/src/background.ts +162 -13
  174. package/corpus/templates/clips/chrome-extension/src/content-script.ts +14 -0
  175. package/corpus/templates/clips/chrome-extension/src/offscreen.ts +36 -0
  176. package/corpus/templates/clips/chrome-extension/src/overlay.ts +99 -25
  177. package/corpus/templates/clips/chrome-extension/src/permission.ts +63 -14
  178. package/corpus/templates/clips/chrome-extension/src/popup.ts +123 -23
  179. package/corpus/templates/content/actions/_builder-cms-read-client.ts +47 -0
  180. package/corpus/templates/content/actions/_database-source-utils.ts +33 -4
  181. package/corpus/templates/content/actions/add-content-database-source-field-property.ts +214 -29
  182. package/corpus/templates/content/actions/attach-content-database-source.ts +3 -0
  183. package/corpus/templates/content/actions/change-content-database-source-role.ts +1 -0
  184. package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +42 -32
  185. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +352 -81
  186. package/corpus/templates/content/app/components/editor/database/settings.tsx +49 -24
  187. package/corpus/templates/content/app/routes/_app.settings.tsx +19 -1
  188. package/corpus/templates/content/changelog/2026-07-07-builder-source-tag-fields-now-import-as-multi-select.md +6 -0
  189. package/corpus/templates/content/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
  190. package/corpus/templates/content/shared/api.ts +3 -0
  191. package/corpus/templates/content/shared/properties.ts +42 -0
  192. package/corpus/templates/design/actions/generate-design.ts +3 -0
  193. package/corpus/templates/design/actions/get-design-system.ts +147 -1
  194. package/corpus/templates/design/app/routes/settings.tsx +16 -1
  195. package/corpus/templates/design/changelog/2026-07-08-design-generation-now-follows-hydrated-builder-design-system.md +6 -0
  196. package/corpus/templates/design/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
  197. package/corpus/templates/dispatch/app/routes/settings.tsx +23 -2
  198. package/corpus/templates/dispatch/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
  199. package/corpus/templates/forms/app/routes/_app.settings.tsx +16 -1
  200. package/corpus/templates/forms/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
  201. package/corpus/templates/macros/app/routes/settings.tsx +16 -1
  202. package/corpus/templates/macros/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
  203. package/corpus/templates/mail/app/components/settings/GmailFiltersSection.tsx +1 -1
  204. package/corpus/templates/mail/app/components/settings/SnippetsSection.tsx +1 -1
  205. package/corpus/templates/mail/app/pages/SettingsPage.tsx +123 -105
  206. package/corpus/templates/mail/changelog/2026-07-08-settings-redesigned-with-a-consistent-searchable-layout.md +5 -0
  207. package/corpus/templates/plan/app/routes/settings.tsx +23 -2
  208. package/corpus/templates/plan/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
  209. package/corpus/templates/slides/actions/add-slide.ts +1 -0
  210. package/corpus/templates/slides/actions/get-design-system.ts +147 -1
  211. package/corpus/templates/slides/app/pages/Index.tsx +46 -1
  212. package/corpus/templates/slides/app/routes/settings.tsx +16 -1
  213. package/corpus/templates/slides/changelog/2026-07-08-deck-generation-now-follows-hydrated-builder-design-system-g.md +6 -0
  214. package/corpus/templates/slides/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
  215. package/dist/agent/run-ownership.d.ts +6 -0
  216. package/dist/agent/run-ownership.d.ts.map +1 -1
  217. package/dist/agent/run-ownership.js +11 -1
  218. package/dist/agent/run-ownership.js.map +1 -1
  219. package/dist/changelog/parse.d.ts +7 -0
  220. package/dist/changelog/parse.d.ts.map +1 -1
  221. package/dist/changelog/parse.js +64 -0
  222. package/dist/changelog/parse.js.map +1 -1
  223. package/dist/chat-threads/schema.d.ts +445 -0
  224. package/dist/chat-threads/schema.d.ts.map +1 -0
  225. package/dist/chat-threads/schema.js +39 -0
  226. package/dist/chat-threads/schema.js.map +1 -0
  227. package/dist/chat-threads/store.d.ts +12 -0
  228. package/dist/chat-threads/store.d.ts.map +1 -1
  229. package/dist/chat-threads/store.js +99 -10
  230. package/dist/chat-threads/store.js.map +1 -1
  231. package/dist/cli/workspace-dev.d.ts.map +1 -1
  232. package/dist/cli/workspace-dev.js +20 -5
  233. package/dist/cli/workspace-dev.js.map +1 -1
  234. package/dist/client/AgentPanel.d.ts.map +1 -1
  235. package/dist/client/AgentPanel.js +35 -7
  236. package/dist/client/AgentPanel.js.map +1 -1
  237. package/dist/client/AssistantChat.d.ts.map +1 -1
  238. package/dist/client/AssistantChat.js +105 -183
  239. package/dist/client/AssistantChat.js.map +1 -1
  240. package/dist/client/analytics-session.d.ts +3 -0
  241. package/dist/client/analytics-session.d.ts.map +1 -0
  242. package/dist/client/analytics-session.js +66 -0
  243. package/dist/client/analytics-session.js.map +1 -0
  244. package/dist/client/analytics.d.ts +32 -0
  245. package/dist/client/analytics.d.ts.map +1 -1
  246. package/dist/client/analytics.js +116 -46
  247. package/dist/client/analytics.js.map +1 -1
  248. package/dist/client/chat/message-components.d.ts +2 -1
  249. package/dist/client/chat/message-components.d.ts.map +1 -1
  250. package/dist/client/chat/message-components.js +16 -6
  251. package/dist/client/chat/message-components.js.map +1 -1
  252. package/dist/client/components/ui/message-scroller.d.ts +16 -0
  253. package/dist/client/components/ui/message-scroller.d.ts.map +1 -0
  254. package/dist/client/components/ui/message-scroller.js +25 -0
  255. package/dist/client/components/ui/message-scroller.js.map +1 -0
  256. package/dist/client/conversation/AgentConversation.d.ts +1 -1
  257. package/dist/client/conversation/AgentConversation.d.ts.map +1 -1
  258. package/dist/client/conversation/AgentConversation.js +3 -8
  259. package/dist/client/conversation/AgentConversation.js.map +1 -1
  260. package/dist/client/error-capture.d.ts +99 -0
  261. package/dist/client/error-capture.d.ts.map +1 -0
  262. package/dist/client/error-capture.js +437 -0
  263. package/dist/client/error-capture.js.map +1 -0
  264. package/dist/client/index.d.ts +2 -2
  265. package/dist/client/index.d.ts.map +1 -1
  266. package/dist/client/index.js +3 -1
  267. package/dist/client/index.js.map +1 -1
  268. package/dist/client/session-replay.d.ts +22 -0
  269. package/dist/client/session-replay.d.ts.map +1 -1
  270. package/dist/client/session-replay.js +45 -4
  271. package/dist/client/session-replay.js.map +1 -1
  272. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  273. package/dist/client/settings/SettingsPanel.js +100 -5
  274. package/dist/client/settings/SettingsPanel.js.map +1 -1
  275. package/dist/client/settings/SettingsTabsPage.d.ts +49 -1
  276. package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
  277. package/dist/client/settings/SettingsTabsPage.js +131 -19
  278. package/dist/client/settings/SettingsTabsPage.js.map +1 -1
  279. package/dist/client/settings/index.d.ts +1 -1
  280. package/dist/client/settings/index.d.ts.map +1 -1
  281. package/dist/client/settings/index.js.map +1 -1
  282. package/dist/client/sharing/ShareButton.d.ts.map +1 -1
  283. package/dist/client/sharing/ShareButton.js +13 -8
  284. package/dist/client/sharing/ShareButton.js.map +1 -1
  285. package/dist/client/sharing/ShareDialog.d.ts.map +1 -1
  286. package/dist/client/sharing/ShareDialog.js +12 -7
  287. package/dist/client/sharing/ShareDialog.js.map +1 -1
  288. package/dist/collab/struct-routes.d.ts +1 -1
  289. package/dist/mcp/builtin-tools.d.ts.map +1 -1
  290. package/dist/mcp/builtin-tools.js +21 -2
  291. package/dist/mcp/builtin-tools.js.map +1 -1
  292. package/dist/notifications/routes.d.ts +1 -1
  293. package/dist/org/schema.d.ts +15 -15
  294. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  295. package/dist/resources/handlers.d.ts +3 -3
  296. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  297. package/dist/server/agent-chat-plugin.js +109 -73
  298. package/dist/server/agent-chat-plugin.js.map +1 -1
  299. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  300. package/dist/server/onboarding-html.d.ts.map +1 -1
  301. package/dist/server/onboarding-html.js +28 -16
  302. package/dist/server/onboarding-html.js.map +1 -1
  303. package/dist/sharing/actions/list-resource-shares.js +30 -1
  304. package/dist/sharing/actions/list-resource-shares.js.map +1 -1
  305. package/dist/sharing/actions/share-resource.js +6 -0
  306. package/dist/sharing/actions/share-resource.js.map +1 -1
  307. package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +4 -2
  308. package/dist/templates/workspace-core/.agents/skills/changelog/SKILL.md +9 -6
  309. package/dist/vite/client.d.ts.map +1 -1
  310. package/dist/vite/client.js +192 -30
  311. package/dist/vite/client.js.map +1 -1
  312. package/docs/content/toolkit-settings.mdx +56 -3
  313. package/package.json +2 -1
  314. package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +4 -2
  315. package/src/templates/workspace-core/.agents/skills/changelog/SKILL.md +9 -6
@@ -5,8 +5,11 @@ import {
5
5
  useChangeVersions,
6
6
  ChangelogSettingsCard,
7
7
  LanguagePicker,
8
+ SettingsTabsPage,
8
9
  useAgentSettingsTabs,
9
10
  useT,
11
+ type SettingsSearchEntry,
12
+ type SettingsTabItem,
10
13
  } from "@agent-native/core/client";
11
14
  import { appApiPath } from "@agent-native/core/client";
12
15
  import { TeamPage } from "@agent-native/core/client/org";
@@ -32,8 +35,6 @@ import {
32
35
  IconSignature,
33
36
  IconFilter,
34
37
  IconInfoCircle,
35
- IconHistory,
36
- IconSettings,
37
38
  IconMessage2,
38
39
  } from "@tabler/icons-react";
39
40
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
@@ -328,7 +329,7 @@ function AliasesSection() {
328
329
  };
329
330
 
330
331
  return (
331
- <div className="flex-1 p-4 sm:p-8 overflow-y-auto">
332
+ <div>
332
333
  {/* Header */}
333
334
  <div className="flex items-center justify-between mb-6">
334
335
  <div>
@@ -938,7 +939,7 @@ function AutomationsSection() {
938
939
  };
939
940
 
940
941
  return (
941
- <div className="flex-1 p-4 sm:p-8 overflow-y-auto">
942
+ <div>
942
943
  {/* Header */}
943
944
  <div className="flex items-center justify-between mb-6">
944
945
  <div>
@@ -1115,7 +1116,7 @@ function DraftingSection() {
1115
1116
  };
1116
1117
 
1117
1118
  return (
1118
- <div className="flex-1 overflow-y-auto p-4 sm:p-8">
1119
+ <div>
1119
1120
  <div className="mb-6">
1120
1121
  <h2 className="text-[16px] font-semibold text-foreground">
1121
1122
  {t("settings.drafting")}
@@ -1252,7 +1253,7 @@ function TrackingSection() {
1252
1253
  };
1253
1254
 
1254
1255
  return (
1255
- <div className="flex-1 p-4 sm:p-8 overflow-y-auto">
1256
+ <div>
1256
1257
  <div className="mb-6">
1257
1258
  <h2 className="text-[16px] font-semibold text-foreground">
1258
1259
  {t("settings.tracking")}
@@ -1334,7 +1335,7 @@ function SlackIntakeSection() {
1334
1335
  : t("settings.slackNeedsCredentials");
1335
1336
 
1336
1337
  return (
1337
- <div className="flex-1 overflow-y-auto p-4 sm:p-8">
1338
+ <div>
1338
1339
  <div className="mb-6">
1339
1340
  <h2 className="text-[16px] font-semibold text-foreground">
1340
1341
  {t("settings.slackIntake")}
@@ -1412,7 +1413,7 @@ function SlackIntakeSection() {
1412
1413
  function GeneralSection() {
1413
1414
  const t = useT();
1414
1415
  return (
1415
- <div className="flex-1 overflow-y-auto p-4 sm:p-8">
1416
+ <div>
1416
1417
  <div className="mb-6">
1417
1418
  <h2 className="text-[16px] font-semibold text-foreground">
1418
1419
  {t("settings.general")}
@@ -1422,7 +1423,10 @@ function GeneralSection() {
1422
1423
  </p>
1423
1424
  </div>
1424
1425
 
1425
- <div className="max-w-2xl rounded-lg border border-border/20 bg-card/50 p-4">
1426
+ <div
1427
+ id="language"
1428
+ className="max-w-2xl scroll-mt-4 rounded-lg border border-border/20 bg-card/50 p-4"
1429
+ >
1426
1430
  <div className="mb-3">
1427
1431
  <h3 className="text-[13px] font-semibold text-foreground">
1428
1432
  {t("settings.languageTitle")}
@@ -1442,7 +1446,7 @@ function GeneralSection() {
1442
1446
  function WhatsNewSection() {
1443
1447
  const t = useT();
1444
1448
  return (
1445
- <div className="flex-1 overflow-y-auto p-4 sm:p-8">
1449
+ <div>
1446
1450
  <div className="mb-6">
1447
1451
  <h2 className="text-[16px] font-semibold text-foreground">
1448
1452
  {t("settings.whatsNew")}
@@ -1461,119 +1465,133 @@ function WhatsNewSection() {
1461
1465
 
1462
1466
  // ─── Settings Page ────────────────────────────────────────────────────────────
1463
1467
 
1464
- type SettingsNavItem = {
1465
- id: string;
1466
- labelKey?: string;
1467
- label?: string;
1468
- icon: React.ComponentType<{ className?: string }>;
1469
- };
1470
-
1471
- const navItems: SettingsNavItem[] = [
1472
- { id: "general", labelKey: "settings.general", icon: IconSettings },
1473
- { id: "team", labelKey: "settings.team", icon: IconUsers },
1474
- { id: "whats-new", labelKey: "settings.whatsNew", icon: IconHistory },
1475
- { id: "drafting", labelKey: "settings.drafting", icon: IconSignature },
1476
- { id: "snippets", labelKey: "settings.snippets", icon: IconMessage2 },
1477
- { id: "automations", labelKey: "settings.automations", icon: IconBolt },
1478
- { id: "gmail-filters", labelKey: "settings.gmailFilters", icon: IconFilter },
1479
- { id: "aliases", labelKey: "settings.aliases", icon: IconUsers },
1480
- { id: "tracking", labelKey: "settings.tracking", icon: IconChartBar },
1481
- { id: "slack", labelKey: "settings.slack", icon: IconBolt },
1482
- ];
1483
-
1484
1468
  export function SettingsPage() {
1485
1469
  const t = useT();
1486
1470
  const [searchParams, setSearchParams] = useSearchParams();
1487
1471
  const navState = useNavigationState();
1488
1472
  const agentSettingsTabs = useAgentSettingsTabs();
1489
1473
  const [activeSection, setActiveSection] = useState<string>("general");
1490
- const allNavItems = useMemo<SettingsNavItem[]>(
1474
+
1475
+ const mailTabs = useMemo<SettingsTabItem[]>(
1491
1476
  () => [
1492
- ...navItems,
1493
- ...agentSettingsTabs.map((tab) => ({
1494
- id: tab.id,
1495
- label: tab.label,
1496
- icon: tab.icon ?? IconSettings,
1497
- })),
1477
+ {
1478
+ id: "drafting",
1479
+ label: t("settings.drafting"),
1480
+ icon: IconSignature,
1481
+ content: <DraftingSection />,
1482
+ keywords: "signature writing style compose reply draft",
1483
+ },
1484
+ {
1485
+ id: "snippets",
1486
+ label: t("settings.snippets"),
1487
+ icon: IconMessage2,
1488
+ content: <SnippetsSection />,
1489
+ keywords: "snippets templates canned responses shortcuts",
1490
+ },
1491
+ {
1492
+ id: "automations",
1493
+ label: t("settings.automations"),
1494
+ icon: IconBolt,
1495
+ content: <AutomationsSection />,
1496
+ keywords: "automations rules triggers events labels model",
1497
+ },
1498
+ {
1499
+ id: "gmail-filters",
1500
+ label: t("settings.gmailFilters"),
1501
+ icon: IconFilter,
1502
+ content: <GmailFiltersSection />,
1503
+ keywords: "gmail filters import rules",
1504
+ },
1505
+ {
1506
+ id: "aliases",
1507
+ label: t("settings.aliases"),
1508
+ icon: IconUsers,
1509
+ content: <AliasesSection />,
1510
+ keywords: "aliases groups distribution lists recipients",
1511
+ },
1512
+ {
1513
+ id: "tracking",
1514
+ label: t("settings.tracking"),
1515
+ icon: IconChartBar,
1516
+ content: <TrackingSection />,
1517
+ keywords: "tracking opens clicks pixel analytics",
1518
+ },
1519
+ {
1520
+ id: "slack",
1521
+ label: t("settings.slack"),
1522
+ icon: IconBolt,
1523
+ content: <SlackIntakeSection />,
1524
+ keywords: "slack intake integration webhook",
1525
+ },
1526
+ ],
1527
+ [t],
1528
+ );
1529
+
1530
+ const extraTabs = useMemo<SettingsTabItem[]>(
1531
+ () => [...mailTabs, ...agentSettingsTabs],
1532
+ [agentSettingsTabs, mailTabs],
1533
+ );
1534
+
1535
+ const generalSearchEntries = useMemo<SettingsSearchEntry[]>(
1536
+ () => [
1537
+ {
1538
+ id: "mail-language",
1539
+ label: t("settings.languageTitle"),
1540
+ keywords: "language locale translation i18n",
1541
+ hash: "language",
1542
+ },
1498
1543
  ],
1499
- [agentSettingsTabs],
1544
+ [t],
1500
1545
  );
1501
1546
 
1547
+ const validSectionIds = useMemo(() => {
1548
+ const ids = new Set<string>(["general", "team", "whats-new"]);
1549
+ for (const tab of extraTabs) ids.add(tab.id);
1550
+ return ids;
1551
+ }, [extraTabs]);
1552
+
1553
+ // Deep links arrive as /settings?section=<id> (e.g. from the agent's
1554
+ // navigate action). Adopt that section, then strip the param so later tab
1555
+ // switches aren't overridden by a stale query value.
1502
1556
  useEffect(() => {
1503
1557
  const section = searchParams.get("section");
1504
- if (!section || !allNavItems.some((item) => item.id === section)) return;
1558
+ if (!section || !validSectionIds.has(section)) return;
1505
1559
  setActiveSection(section);
1506
- setSearchParams((prev) => {
1507
- const next = new URLSearchParams(prev);
1508
- next.delete("section");
1509
- return next;
1510
- });
1511
- }, [allNavItems, searchParams, setSearchParams]);
1560
+ setSearchParams(
1561
+ (prev) => {
1562
+ const next = new URLSearchParams(prev);
1563
+ next.delete("section");
1564
+ return next;
1565
+ },
1566
+ { replace: true },
1567
+ );
1568
+ }, [searchParams, setSearchParams, validSectionIds]);
1512
1569
 
1570
+ // Keep app state aware of the visible settings section for the agent.
1513
1571
  useEffect(() => {
1514
1572
  navState.sync({ view: "settings", settingsSection: activeSection });
1515
1573
  }, [activeSection]); // eslint-disable-line react-hooks/exhaustive-deps
1516
1574
 
1517
1575
  return (
1518
- <div className="flex flex-1 flex-col sm:flex-row overflow-hidden">
1519
- {/* Top tabs on mobile, left sidebar on desktop */}
1520
- <div className="sm:w-[200px] shrink-0 sm:border-e border-b sm:border-b-0 border-border/30 bg-muted/50 dark:bg-[var(--mail-sidebar-surface)] sm:p-3 flex sm:flex-col gap-0.5 overflow-x-auto">
1521
- {allNavItems.map((item) => {
1522
- const Icon = item.icon;
1523
- const isActive = activeSection === item.id;
1524
- const label = item.labelKey
1525
- ? t(item.labelKey)
1526
- : (item.label ?? item.id);
1527
- return (
1528
- <button
1529
- key={item.id}
1530
- onClick={() => setActiveSection(item.id)}
1531
- className={cn(
1532
- "flex items-center gap-2.5 sm:w-full rounded-md px-3 sm:px-2.5 py-2.5 sm:py-2 text-[13px] transition-colors text-start whitespace-nowrap",
1533
- isActive
1534
- ? "bg-blue-500/15 text-blue-400 font-medium"
1535
- : "text-muted-foreground hover:text-foreground hover:bg-accent/50",
1536
- )}
1537
- >
1538
- <Icon
1539
- className={cn(
1540
- "h-4 w-4 shrink-0",
1541
- isActive ? "text-blue-400" : "text-muted-foreground/60",
1542
- )}
1543
- />
1544
- {label}
1545
- </button>
1546
- );
1547
- })}
1548
- </div>
1549
-
1550
- {/* Right content panel */}
1551
- <div className="flex flex-1 overflow-hidden bg-background">
1552
- {activeSection === "general" && <GeneralSection />}
1553
- {activeSection === "whats-new" && <WhatsNewSection />}
1554
- {activeSection === "drafting" && <DraftingSection />}
1555
- {activeSection === "snippets" && <SnippetsSection />}
1556
- {activeSection === "automations" && <AutomationsSection />}
1557
- {activeSection === "gmail-filters" && <GmailFiltersSection />}
1558
- {activeSection === "aliases" && <AliasesSection />}
1559
- {activeSection === "tracking" && <TrackingSection />}
1560
- {activeSection === "slack" && <SlackIntakeSection />}
1561
- {activeSection === "team" && (
1562
- <div className="flex-1 overflow-y-auto">
1563
- <TeamPage
1564
- showTitle={false}
1565
- createOrgDescription={t("settings.teamDescription")}
1566
- />
1567
- </div>
1568
- )}
1569
- {agentSettingsTabs.map((tab) =>
1570
- activeSection === tab.id ? (
1571
- <div key={tab.id} className="flex-1 overflow-y-auto p-4 sm:p-8">
1572
- {tab.content}
1573
- </div>
1574
- ) : null,
1575
- )}
1576
- </div>
1577
- </div>
1576
+ <SettingsTabsPage
1577
+ className="flex-1"
1578
+ generalLabel={t("settings.general")}
1579
+ teamLabel={t("settings.team")}
1580
+ whatsNewLabel={t("settings.whatsNew")}
1581
+ extraTabs={extraTabs}
1582
+ generalSearchEntries={generalSearchEntries}
1583
+ value={activeSection}
1584
+ onValueChange={setActiveSection}
1585
+ general={<GeneralSection />}
1586
+ team={
1587
+ <div className="mx-auto w-full max-w-3xl">
1588
+ <TeamPage
1589
+ showTitle={false}
1590
+ createOrgDescription={t("settings.teamDescription")}
1591
+ />
1592
+ </div>
1593
+ }
1594
+ whatsNew={<WhatsNewSection />}
1595
+ />
1578
1596
  );
1579
1597
  }
@@ -0,0 +1,5 @@
1
+ ---
2
+ type: improved
3
+ ---
4
+
5
+ Settings are redesigned with a consistent, edge-to-edge navigation and a search box that jumps straight to any setting.
@@ -4,9 +4,11 @@ import {
4
4
  SettingsTabsPage,
5
5
  useAgentSettingsTabs,
6
6
  useT,
7
+ type SettingsSearchEntry,
7
8
  } from "@agent-native/core/client";
8
9
  import { TeamPage } from "@agent-native/core/client/org";
9
10
  import { useSetPageTitle } from "@agent-native/toolkit/app-shell";
11
+ import { useMemo } from "react";
10
12
 
11
13
  import { Button } from "@/components/ui/button";
12
14
  import {
@@ -30,17 +32,36 @@ export default function SettingsRoute() {
30
32
  const agentSettingsTabs = useAgentSettingsTabs();
31
33
  useSetPageTitle(t("settings.title"));
32
34
 
35
+ const generalSearchEntries = useMemo<SettingsSearchEntry[]>(
36
+ () => [
37
+ {
38
+ id: "plan-language",
39
+ label: t("settings.languageTitle"),
40
+ keywords: "language locale translation i18n",
41
+ hash: "language",
42
+ },
43
+ {
44
+ id: "plan-editor",
45
+ label: t("settings.editorTitle"),
46
+ keywords: "editor extension vscode ide",
47
+ hash: "editor",
48
+ },
49
+ ],
50
+ [t],
51
+ );
52
+
33
53
  return (
34
54
  <SettingsTabsPage
35
55
  teamLabel={t("header.team")}
36
56
  extraTabs={agentSettingsTabs}
57
+ generalSearchEntries={generalSearchEntries}
37
58
  general={
38
59
  <div className="mx-auto w-full max-w-3xl space-y-6">
39
60
  <p className="text-sm leading-6 text-muted-foreground">
40
61
  {t("settings.description")}
41
62
  </p>
42
63
 
43
- <Card>
64
+ <Card id="language" className="scroll-mt-16">
44
65
  <CardHeader>
45
66
  <CardTitle className="text-base">
46
67
  {t("settings.languageTitle")}
@@ -55,7 +76,7 @@ export default function SettingsRoute() {
55
76
  </CardContent>
56
77
  </Card>
57
78
 
58
- <Card>
79
+ <Card id="editor" className="scroll-mt-16">
59
80
  <CardHeader>
60
81
  <CardTitle className="text-base">
61
82
  {t("settings.editorTitle")}
@@ -0,0 +1,5 @@
1
+ ---
2
+ type: improved
3
+ ---
4
+
5
+ Settings are cleaner and searchable, with a consistent navigation that jumps straight to any setting.
@@ -35,6 +35,7 @@ export default defineAction({
35
35
  "Add a single slide to an existing deck. Use this to build decks slide-by-slide — " +
36
36
  "call it once per slide in slide order and wait for each result before adding the next slide. " +
37
37
  "Avoid parallel add-slide calls for the same deck; sequential writes keep the editor and agent connection stable. " +
38
+ "If the deck has a designSystemId, first use `get-design-system` and apply its `agentContext` tokens/docs; do not use generic slide styling from the id alone. " +
38
39
  "Returns the new slide ID, 1-based slideNumber, and updated slide count.",
39
40
  schema: z.object({
40
41
  deckId: z.string().describe("Target deck ID"),
@@ -8,9 +8,146 @@ import { z } from "zod";
8
8
 
9
9
  import "../server/db/index.js"; // ensure registerShareableResource runs
10
10
 
11
+ const MAX_AGENT_CONTEXT_CHARS = 14_000;
12
+ const MAX_JSON_CONTEXT_CHARS = 2_500;
13
+ const MAX_BUILDER_DOCS = 8;
14
+ const MAX_BUILDER_DOC_CHARS = 1_200;
15
+ const MAX_TOKEN_VALUES = 48;
16
+
17
+ interface BuilderGenerationContext {
18
+ builderDesignSystemId: string;
19
+ builderJobId: string;
20
+ builderProjectId?: string;
21
+ builderUrl?: string;
22
+ builderStatus?: string;
23
+ docs: Array<{
24
+ name?: string;
25
+ type?: string;
26
+ description?: string;
27
+ content?: string;
28
+ tokenValues?: Record<string, string>;
29
+ }>;
30
+ tokenValues: Record<string, string>;
31
+ docCount: number;
32
+ warning?: string;
33
+ }
34
+
35
+ function truncate(value: string, maxChars: number): string {
36
+ if (value.length <= maxChars) return value;
37
+ return `${value.slice(0, maxChars).trimEnd()}\n[truncated]`;
38
+ }
39
+
40
+ function parseJson(value: string | null | undefined): unknown {
41
+ if (!value) return null;
42
+ try {
43
+ return JSON.parse(value);
44
+ } catch {
45
+ return null;
46
+ }
47
+ }
48
+
49
+ function formatJson(value: unknown, maxChars = MAX_JSON_CONTEXT_CHARS): string {
50
+ return truncate(JSON.stringify(value, null, 2), maxChars);
51
+ }
52
+
53
+ function formatTokenValues(tokenValues: Record<string, string>): string[] {
54
+ const entries = Object.entries(tokenValues)
55
+ .filter(([, value]) => typeof value === "string" && value.trim())
56
+ .slice(0, MAX_TOKEN_VALUES);
57
+ if (entries.length === 0) return [];
58
+ return [
59
+ "Builder DSI token values to apply first:",
60
+ ...entries.map(([name, value]) => `- ${name}: ${value}`),
61
+ ];
62
+ }
63
+
64
+ function buildDesignSystemAgentContext({
65
+ id,
66
+ title,
67
+ description,
68
+ data,
69
+ assets,
70
+ customInstructions,
71
+ builder,
72
+ }: {
73
+ id: string;
74
+ title: string;
75
+ description?: string | null;
76
+ data?: string | null;
77
+ assets?: string | null;
78
+ customInstructions?: string | null;
79
+ builder: BuilderGenerationContext | null;
80
+ }): string {
81
+ const lines: string[] = [
82
+ "## Selected Design System Context",
83
+ `Use "${title}" (id: ${id}) as the visual source of truth for this deck.`,
84
+ "Apply these tokens, assets, and usage notes before choosing colors, type, spacing, radius, imagery, slide defaults, or component language.",
85
+ ];
86
+
87
+ if (description?.trim()) {
88
+ lines.push("", "Description:", description.trim());
89
+ }
90
+
91
+ if (customInstructions?.trim()) {
92
+ lines.push("", "Custom instructions:", customInstructions.trim());
93
+ }
94
+
95
+ const parsedAssets = parseJson(assets);
96
+ if (Array.isArray(parsedAssets) && parsedAssets.length > 0) {
97
+ lines.push("", "Design system assets:", formatJson(parsedAssets));
98
+ }
99
+
100
+ if (builder) {
101
+ lines.push(
102
+ "",
103
+ "Builder DSI:",
104
+ `- Design system id: ${builder.builderDesignSystemId}`,
105
+ `- Job id: ${builder.builderJobId}`,
106
+ builder.builderProjectId
107
+ ? `- Project id: ${builder.builderProjectId}`
108
+ : "",
109
+ builder.builderUrl ? `- URL: ${builder.builderUrl}` : "",
110
+ builder.builderStatus ? `- Status: ${builder.builderStatus}` : "",
111
+ "- Builder DSI docs and token values override local proxy placeholders.",
112
+ "- Do not substitute a generic style if DSI docs or tokens are unavailable; call get-design-system again or tell the user Builder indexing is not ready.",
113
+ );
114
+
115
+ if (builder.warning) {
116
+ lines.push(`- Warning: ${builder.warning}`);
117
+ }
118
+
119
+ lines.push("", ...formatTokenValues(builder.tokenValues));
120
+
121
+ const docs = builder.docs.slice(0, MAX_BUILDER_DOCS);
122
+ if (docs.length > 0) {
123
+ lines.push("", "Builder DSI docs to follow:");
124
+ for (const doc of docs) {
125
+ const label = [doc.name, doc.type ? `(${doc.type})` : ""]
126
+ .filter(Boolean)
127
+ .join(" ");
128
+ lines.push(
129
+ "",
130
+ `### ${label || "Design system doc"}`,
131
+ doc.description?.trim() ? doc.description.trim() : "",
132
+ doc.content?.trim()
133
+ ? truncate(doc.content.trim(), MAX_BUILDER_DOC_CHARS)
134
+ : "",
135
+ );
136
+ }
137
+ }
138
+ } else {
139
+ const parsedData = parseJson(data);
140
+ if (parsedData) {
141
+ lines.push("", "Local design-system tokens:", formatJson(parsedData));
142
+ }
143
+ }
144
+
145
+ return truncate(lines.filter(Boolean).join("\n"), MAX_AGENT_CONTEXT_CHARS);
146
+ }
147
+
11
148
  export default defineAction({
12
149
  description:
13
- "Get a design system by ID. Returns full design system data including colors, typography, spacing, and assets.",
150
+ "Get a design system by ID. Returns full design system data including colors, typography, spacing, assets, and a compact agentContext for generation.",
14
151
  schema: z.object({
15
152
  id: z.string().describe("Design system ID"),
16
153
  }),
@@ -51,6 +188,15 @@ export default defineAction({
51
188
  createdAt: row.createdAt,
52
189
  updatedAt: row.updatedAt,
53
190
  builder,
191
+ agentContext: buildDesignSystemAgentContext({
192
+ id: row.id,
193
+ title: row.title,
194
+ description: row.description,
195
+ data: row.data,
196
+ assets: row.assets,
197
+ customInstructions: row.customInstructions,
198
+ builder,
199
+ }),
54
200
  };
55
201
  },
56
202
  });
@@ -101,6 +101,47 @@ function truncateSourceForContext(prompt: string): {
101
101
  };
102
102
  }
103
103
 
104
+ interface DesignSystemGenerationContextResult {
105
+ title?: string;
106
+ agentContext?: string;
107
+ }
108
+
109
+ async function loadDesignSystemGenerationContext(
110
+ designSystemId?: string | null,
111
+ ): Promise<string> {
112
+ if (!designSystemId) return "";
113
+ try {
114
+ const result = (await callAction(
115
+ "get-design-system",
116
+ { id: designSystemId },
117
+ { method: "GET" },
118
+ )) as DesignSystemGenerationContextResult | undefined;
119
+ if (result?.agentContext?.trim()) {
120
+ return [
121
+ "",
122
+ result.agentContext.trim(),
123
+ "",
124
+ "The selected design system context above was hydrated before this agent run. Follow it directly; do not replace it with generic colors, fonts, spacing, imagery, or slide components.",
125
+ ].join("\n");
126
+ }
127
+ } catch (error) {
128
+ const message =
129
+ error instanceof Error ? error.message : "unknown loading error";
130
+ return [
131
+ "",
132
+ "## Selected Design System Context",
133
+ `The selected design system id "${designSystemId}" could not be loaded before generation: ${message}`,
134
+ "Before adding slides, call `get-design-system` for this id. If it still fails, stop and tell the user the selected design system is unavailable instead of improvising a generic style.",
135
+ ].join("\n");
136
+ }
137
+ return [
138
+ "",
139
+ "## Selected Design System Context",
140
+ `The selected design system id "${designSystemId}" returned no generation context.`,
141
+ "Call `get-design-system` for this id before adding slides. If it still has no usable tokens/docs, stop and ask the user to finish design-system indexing instead of improvising a generic style.",
142
+ ].join("\n");
143
+ }
144
+
104
145
  function describeUploadedFilesForAgent(
105
146
  files: UploadedFile[],
106
147
  deckId: string,
@@ -359,13 +400,17 @@ export default function Index() {
359
400
  "If the action cannot read a private document, tell the user the exact sharing step from the action error instead of generating from the URL alone.",
360
401
  ].join("\n")
361
402
  : "";
403
+ const hydratedDesignSystemContext = await loadDesignSystemGenerationContext(
404
+ selectedDesignSystem?.id,
405
+ );
362
406
  const designSystemContext = selectedDesignSystem
363
407
  ? [
364
408
  "",
365
409
  "Design system selection:",
366
410
  `- Use "${selectedDesignSystem.title}" (id: ${selectedDesignSystem.id}).`,
367
411
  "- The deck has already been linked to this design system.",
368
- `- Before adding slides, call \`get-design-system --id ${selectedDesignSystem.id}\` and use its tokens for colors, typography, spacing, imagery, and slide defaults.`,
412
+ "- Use the hydrated design system context below for colors, typography, spacing, imagery, and slide defaults.",
413
+ hydratedDesignSystemContext,
369
414
  "- Do not choose or apply a different design system.",
370
415
  ].join("\n")
371
416
  : [
@@ -4,9 +4,11 @@ import {
4
4
  SettingsTabsPage,
5
5
  useAgentSettingsTabs,
6
6
  useT,
7
+ type SettingsSearchEntry,
7
8
  } from "@agent-native/core/client";
8
9
  import { TeamPage } from "@agent-native/core/client/org";
9
10
  import { useSetPageTitle } from "@agent-native/toolkit/app-shell";
11
+ import { useMemo } from "react";
10
12
 
11
13
  import {
12
14
  Card,
@@ -29,17 +31,30 @@ export default function SettingsRoute() {
29
31
  const agentSettingsTabs = useAgentSettingsTabs();
30
32
  useSetPageTitle(t("settings.title"));
31
33
 
34
+ const generalSearchEntries = useMemo<SettingsSearchEntry[]>(
35
+ () => [
36
+ {
37
+ id: "slides-language",
38
+ label: t("settings.languageTitle"),
39
+ keywords: "language locale translation i18n",
40
+ hash: "language",
41
+ },
42
+ ],
43
+ [t],
44
+ );
45
+
32
46
  return (
33
47
  <SettingsTabsPage
34
48
  teamLabel={t("navigation.team")}
35
49
  extraTabs={agentSettingsTabs}
50
+ generalSearchEntries={generalSearchEntries}
36
51
  general={
37
52
  <div className="mx-auto w-full max-w-3xl space-y-6">
38
53
  <p className="text-sm leading-6 text-muted-foreground">
39
54
  {t("settings.description")}
40
55
  </p>
41
56
 
42
- <Card>
57
+ <Card id="language" className="scroll-mt-16">
43
58
  <CardHeader>
44
59
  <CardTitle className="text-base">
45
60
  {t("settings.languageTitle")}
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-07-08
4
+ ---
5
+
6
+ Deck generation now follows hydrated Builder design-system guidance before adding slides.