@agent-native/core 0.120.1 → 0.120.3

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 (396) hide show
  1. package/corpus/README.md +3 -3
  2. package/corpus/core/CHANGELOG.md +29 -0
  3. package/corpus/core/docs/content/extensions.mdx +23 -4
  4. package/corpus/core/package.json +1 -1
  5. package/corpus/core/src/agent/production-agent.ts +4 -0
  6. package/corpus/core/src/agent/run-manager.ts +36 -10
  7. package/corpus/core/src/agent/types.ts +2 -0
  8. package/corpus/core/src/cli/context-xray-local.ts +1 -1
  9. package/corpus/core/src/cli/index.ts +63 -18
  10. package/corpus/core/src/cli/skills.ts +5 -0
  11. package/corpus/core/src/cli/telemetry.ts +118 -1
  12. package/corpus/core/src/client/AgentPanel.tsx +10 -0
  13. package/corpus/core/src/client/CommandMenu.tsx +13 -1
  14. package/corpus/core/src/client/agent-page/AgentTabsPage.tsx +39 -4
  15. package/corpus/core/src/client/analytics.ts +13 -0
  16. package/corpus/core/src/client/error-capture.ts +6 -1
  17. package/corpus/core/src/client/extensions/ExtensionsListPage.tsx +28 -8
  18. package/corpus/core/src/client/extensions/agent-native-extension-runtime.ts +1 -1
  19. package/corpus/core/src/client/navigation/index.ts +2 -0
  20. package/corpus/core/src/client/org/OrgSwitcher.tsx +14 -32
  21. package/corpus/core/src/client/settings/ExtensionsSettingsContent.tsx +24 -0
  22. package/corpus/core/src/client/settings/SettingsPanel.tsx +10 -0
  23. package/corpus/core/src/deploy/build.ts +3 -0
  24. package/corpus/core/src/extensions/theme.ts +1 -1
  25. package/corpus/core/src/localization/default-messages.ts +2 -0
  26. package/corpus/core/src/server/analytics.ts +154 -25
  27. package/corpus/core/src/server/core-routes-plugin.ts +10 -1
  28. package/corpus/core/src/server/framework-request-handler.ts +17 -26
  29. package/corpus/core/src/styles/agent-native.css +13 -0
  30. package/corpus/core/src/templates/chat/app/components/layout/Layout.tsx +3 -0
  31. package/corpus/core/src/templates/chat/app/components/layout/Sidebar.tsx +113 -51
  32. package/corpus/core/src/templates/chat/app/global.css +1 -1
  33. package/corpus/core/src/templates/chat/app/routes/extensions._index.tsx +2 -2
  34. package/corpus/core/src/templates/chat/netlify.toml +1 -0
  35. package/corpus/core/src/templates/default/app/global.css +1 -1
  36. package/corpus/core/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +16 -0
  37. package/corpus/core/src/tracking/error-capture.ts +151 -0
  38. package/corpus/core/src/tracking/index.ts +5 -0
  39. package/corpus/core/src/vite/client.ts +6 -0
  40. package/corpus/templates/analytics/.agents/skills/adhoc-analysis/SKILL.md +27 -43
  41. package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +19 -8
  42. package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +2 -2
  43. package/corpus/templates/analytics/AGENTS.md +20 -8
  44. package/corpus/templates/analytics/actions/get-explorer-dashboard.ts +3 -0
  45. package/corpus/templates/analytics/actions/list-dashboard-usage-stats.ts +140 -46
  46. package/corpus/templates/analytics/actions/migrate-analytics-artifacts.ts +48 -0
  47. package/corpus/templates/analytics/actions/save-analysis.ts +2 -3
  48. package/corpus/templates/analytics/actions/view-screen.ts +1 -1
  49. package/corpus/templates/analytics/app/components/dashboard/CumulativeNetChart.tsx +1 -1
  50. package/corpus/templates/analytics/app/components/dashboard/DashboardHistoryPanel.tsx +1 -4
  51. package/corpus/templates/analytics/app/components/dashboard/DashboardMetadata.tsx +77 -0
  52. package/corpus/templates/analytics/app/components/dashboard/DashboardPanelSkeleton.tsx +7 -1
  53. package/corpus/templates/analytics/app/components/dashboard/DataTable.tsx +1 -1
  54. package/corpus/templates/analytics/app/components/dashboard/DateRangePicker.tsx +2 -2
  55. package/corpus/templates/analytics/app/components/dashboard/MetricCard.tsx +1 -1
  56. package/corpus/templates/analytics/app/components/dashboard/RecentActivity.tsx +1 -1
  57. package/corpus/templates/analytics/app/components/dashboard/RevenueChart.tsx +1 -1
  58. package/corpus/templates/analytics/app/components/dashboard/RevenueComparisonChart.tsx +1 -1
  59. package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +41 -9
  60. package/corpus/templates/analytics/app/components/dashboard/StatsCard.tsx +1 -1
  61. package/corpus/templates/analytics/app/components/dashboard/TimeSeriesChart.tsx +1 -1
  62. package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +2 -0
  63. package/corpus/templates/analytics/app/components/layout/Layout.tsx +28 -14
  64. package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +1 -0
  65. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +255 -626
  66. package/corpus/templates/analytics/app/global.css +31 -1
  67. package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +2 -2
  68. package/corpus/templates/analytics/app/i18n-data.ts +80 -0
  69. package/corpus/templates/analytics/app/lib/dashboard-report-capture.ts +42 -0
  70. package/corpus/templates/analytics/app/pages/Agents.tsx +49 -2
  71. package/corpus/templates/analytics/app/pages/adhoc/_shared/KpiChart.tsx +1 -1
  72. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/ChartTypePicker.tsx +1 -1
  73. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/DateRangePicker.tsx +1 -1
  74. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventRow.tsx +1 -1
  75. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/SqlPreview.tsx +2 -2
  76. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +54 -11
  77. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +3 -3
  78. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/EmailReportDialog.tsx +2 -2
  79. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +1 -1
  80. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +4 -54
  81. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +178 -69
  82. package/corpus/templates/analytics/app/pages/analyses/AnalysisDetail.tsx +2 -2
  83. package/corpus/templates/analytics/app/root.tsx +28 -0
  84. package/corpus/templates/analytics/app/routes/analyses._index.tsx +3 -2
  85. package/corpus/templates/analytics/app/routes/extensions._index.tsx +2 -2
  86. package/corpus/templates/analytics/changelog/2026-07-23-analytics-now-groups-saved-analyses-and-embedded-extensions-.md +6 -0
  87. package/corpus/templates/analytics/changelog/2026-07-23-dashboard-menus-show-who-created-and-last-updated-each-dashb.md +6 -0
  88. package/corpus/templates/analytics/changelog/2026-07-23-dashboard-usage-now-loads-reliably-for-organizations-with-ma.md +6 -0
  89. package/corpus/templates/analytics/changelog/2026-07-23-long-dashboard-building-requests-now-continue-without-stoppi.md +6 -0
  90. package/corpus/templates/analytics/changelog/2026-07-24-analytics-charts-now-explain-slow-loads-and-offer-a-direct-r.md +6 -0
  91. package/corpus/templates/analytics/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  92. package/corpus/templates/analytics/changelog/2026-07-24-daily-dashboard-emails-now-load-signed-reports-more-reliably.md +6 -0
  93. package/corpus/templates/analytics/changelog/2026-07-24-manage-agent-is-clearly-marked-as-a-link-to-its-dedicated-pa.md +6 -0
  94. package/corpus/templates/analytics/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
  95. package/corpus/templates/analytics/netlify.toml +4 -0
  96. package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +1 -1
  97. package/corpus/templates/analytics/server/db/schema.ts +9 -0
  98. package/corpus/templates/analytics/server/jobs/dashboard-report.ts +21 -0
  99. package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +0 -1
  100. package/corpus/templates/analytics/server/lib/agent-readable-resource-context.ts +1 -0
  101. package/corpus/templates/analytics/server/lib/canonical-first-party-dashboard-repair.ts +11 -0
  102. package/corpus/templates/analytics/server/lib/dashboard-report-subscriptions.ts +54 -0
  103. package/corpus/templates/analytics/server/lib/dashboard-report.ts +235 -26
  104. package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +4 -1
  105. package/corpus/templates/analytics/server/lib/migrate-analytics-artifacts.ts +1062 -0
  106. package/corpus/templates/analytics/server/plugins/agent-chat.ts +6 -52
  107. package/corpus/templates/analytics/server/plugins/core-routes.ts +1 -1
  108. package/corpus/templates/analytics/server/plugins/db.ts +19 -0
  109. package/corpus/templates/analytics/shared/dashboard-report-timeouts.ts +1 -1
  110. package/corpus/templates/assets/actions/generate-image-batch.ts +36 -1
  111. package/corpus/templates/assets/actions/generate-image.ts +28 -1
  112. package/corpus/templates/assets/app/components/asset/AssetPreviewDialog.tsx +376 -0
  113. package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +14 -4
  114. package/corpus/templates/assets/app/components/layout/Layout.tsx +5 -0
  115. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +164 -82
  116. package/corpus/templates/assets/app/global.css +1 -1
  117. package/corpus/templates/assets/app/i18n-data.ts +10 -0
  118. package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +99 -10
  119. package/corpus/templates/assets/app/routes/extensions._index.tsx +2 -2
  120. package/corpus/templates/assets/app/routes/library.tsx +21 -198
  121. package/corpus/templates/assets/changelog/2026-07-21-unified-asset-preview-click-any-asset-to-open-one-preview-wi.md +6 -0
  122. package/corpus/templates/assets/changelog/2026-07-23-assets-image-generation-now-recovers-after-a-completed-tool-.md +6 -0
  123. package/corpus/templates/assets/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  124. package/corpus/templates/assets/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
  125. package/corpus/templates/assets/netlify.toml +1 -0
  126. package/corpus/templates/brain/app/components/layout/Layout.tsx +3 -0
  127. package/corpus/templates/brain/app/components/layout/Sidebar.tsx +114 -51
  128. package/corpus/templates/brain/app/global.css +1 -1
  129. package/corpus/templates/brain/app/routes/extensions._index.tsx +2 -2
  130. package/corpus/templates/brain/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  131. package/corpus/templates/brain/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
  132. package/corpus/templates/brain/netlify.toml +1 -0
  133. package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +110 -57
  134. package/corpus/templates/calendar/app/global.css +1 -1
  135. package/corpus/templates/calendar/app/routes/_app.extensions._index.tsx +2 -16
  136. package/corpus/templates/calendar/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  137. package/corpus/templates/calendar/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
  138. package/corpus/templates/calendar/netlify.toml +1 -0
  139. package/corpus/templates/chat/app/components/layout/Layout.tsx +3 -0
  140. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +113 -51
  141. package/corpus/templates/chat/app/global.css +1 -1
  142. package/corpus/templates/chat/app/routes/extensions._index.tsx +2 -2
  143. package/corpus/templates/chat/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  144. package/corpus/templates/chat/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
  145. package/corpus/templates/chat/netlify.toml +1 -0
  146. package/corpus/templates/clips/app/components/library/library-layout.tsx +117 -37
  147. package/corpus/templates/clips/app/components/library/organization-switcher.tsx +2 -2
  148. package/corpus/templates/clips/app/components/player/video-player.tsx +16 -1
  149. package/corpus/templates/clips/app/global.css +1 -1
  150. package/corpus/templates/clips/app/hooks/use-view-tracking.ts +55 -12
  151. package/corpus/templates/clips/app/routes/_app.extensions._index.tsx +2 -16
  152. package/corpus/templates/clips/app/routes/embed.$shareId.tsx +6 -5
  153. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +7 -7
  154. package/corpus/templates/clips/app/routes/share.$shareId.tsx +6 -5
  155. package/corpus/templates/clips/changelog/2026-07-23-agent-settings-are-clearly-labeled-manage-agent-in-the-sideb.md +6 -0
  156. package/corpus/templates/clips/changelog/2026-07-23-meeting-recording-meters-and-dismissed-prompts.md +6 -0
  157. package/corpus/templates/clips/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  158. package/corpus/templates/clips/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
  159. package/corpus/templates/clips/desktop/src/hooks/useMicMeter.ts +1 -1
  160. package/corpus/templates/clips/desktop/src/lib/meeting-notification-dismissal.ts +2 -0
  161. package/corpus/templates/clips/desktop/src/lib/voice-dictation.ts +1 -3
  162. package/corpus/templates/clips/desktop/src/overlays/live-audio-bars.tsx +86 -0
  163. package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +24 -0
  164. package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +5 -69
  165. package/corpus/templates/clips/desktop/src/styles.css +35 -3
  166. package/corpus/templates/clips/desktop/src-tauri/src/adhoc_meetings_watcher.rs +13 -44
  167. package/corpus/templates/clips/desktop/src-tauri/src/notifications.rs +119 -17
  168. package/corpus/templates/clips/netlify.toml +1 -0
  169. package/corpus/templates/clips/server/plugins/db.ts +113 -68
  170. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +69 -49
  171. package/corpus/templates/content/app/global.css +1 -1
  172. package/corpus/templates/content/app/routes/_app.extensions._index.tsx +2 -2
  173. package/corpus/templates/content/changelog/2026-07-23-agent-settings-are-clearly-labeled-manage-agent-in-the-sideb.md +6 -0
  174. package/corpus/templates/content/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  175. package/corpus/templates/content/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
  176. package/corpus/templates/content/netlify.toml +1 -0
  177. package/corpus/templates/design/app/components/layout/Sidebar.tsx +115 -42
  178. package/corpus/templates/design/app/entry.client.tsx +14 -1
  179. package/corpus/templates/design/app/global.css +1 -1
  180. package/corpus/templates/design/app/routes/extensions._index.tsx +2 -2
  181. package/corpus/templates/design/changelog/2026-07-23-agent-settings-are-clearly-labeled-manage-agent-in-the-sideb.md +6 -0
  182. package/corpus/templates/design/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  183. package/corpus/templates/design/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
  184. package/corpus/templates/design/netlify.toml +1 -0
  185. package/corpus/templates/dispatch/app/dispatch-extensions.tsx +1 -1
  186. package/corpus/templates/dispatch/app/global.css +1 -1
  187. package/corpus/templates/dispatch/changelog/2026-07-23-agent-settings-are-clearly-labeled-manage-agent-in-the-sideb.md +6 -0
  188. package/corpus/templates/dispatch/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  189. package/corpus/templates/dispatch/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
  190. package/corpus/templates/dispatch/netlify.toml +1 -0
  191. package/corpus/templates/forms/app/components/layout/Layout.tsx +3 -0
  192. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +113 -82
  193. package/corpus/templates/forms/app/global.css +1 -1
  194. package/corpus/templates/forms/app/routes/_app.extensions._index.tsx +2 -2
  195. package/corpus/templates/forms/changelog/2026-07-23-agent-settings-are-clearly-labeled-manage-agent-in-the-sideb.md +6 -0
  196. package/corpus/templates/forms/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  197. package/corpus/templates/forms/changelog/2026-07-24-forms-sidebar-actions-now-keep-search-language-feedback-and-.md +6 -0
  198. package/corpus/templates/forms/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
  199. package/corpus/templates/forms/netlify.toml +1 -0
  200. package/corpus/templates/macros/app/components/DailyProgress.tsx +5 -5
  201. package/corpus/templates/macros/app/components/ExerciseCard.tsx +2 -2
  202. package/corpus/templates/macros/app/components/MealCard.tsx +2 -2
  203. package/corpus/templates/macros/app/components/WeightCard.tsx +2 -2
  204. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +92 -34
  205. package/corpus/templates/macros/app/components/ui/button.tsx +1 -2
  206. package/corpus/templates/macros/app/components/ui/card.tsx +1 -1
  207. package/corpus/templates/macros/app/global.css +1 -1
  208. package/corpus/templates/macros/app/routes/_index.tsx +1 -1
  209. package/corpus/templates/macros/app/routes/analytics.tsx +4 -7
  210. package/corpus/templates/macros/app/routes/extensions._index.tsx +2 -2
  211. package/corpus/templates/macros/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  212. package/corpus/templates/macros/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
  213. package/corpus/templates/macros/netlify.toml +1 -0
  214. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +125 -46
  215. package/corpus/templates/mail/app/global.css +1 -1
  216. package/corpus/templates/mail/app/routes/extensions._index.tsx +2 -2
  217. package/corpus/templates/mail/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  218. package/corpus/templates/mail/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
  219. package/corpus/templates/mail/netlify.toml +1 -0
  220. package/corpus/templates/plan/app/components/layout/Layout.tsx +3 -0
  221. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +128 -65
  222. package/corpus/templates/plan/app/global.css +1 -1
  223. package/corpus/templates/plan/app/routes/extensions._index.tsx +2 -2
  224. package/corpus/templates/plan/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  225. package/corpus/templates/plan/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
  226. package/corpus/templates/plan/netlify.toml +1 -0
  227. package/corpus/templates/slides/app/components/layout/Sidebar.tsx +116 -36
  228. package/corpus/templates/slides/app/global.css +1 -1
  229. package/corpus/templates/slides/app/routes/extensions._index.tsx +2 -2
  230. package/corpus/templates/slides/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  231. package/corpus/templates/slides/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
  232. package/corpus/templates/slides/netlify.toml +1 -0
  233. package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +37 -6
  234. package/corpus/templates/tasks/app/global.css +1 -1
  235. package/corpus/templates/tasks/app/routes/extensions._index.tsx +2 -2
  236. package/corpus/templates/tasks/app/routes/settings.tsx +31 -0
  237. package/corpus/templates/tasks/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  238. package/corpus/templates/tasks/netlify.toml +1 -0
  239. package/corpus/toolkit/CHANGELOG.md +8 -0
  240. package/corpus/toolkit/README.md +8 -1
  241. package/corpus/toolkit/agent-native.eject.json +1 -1
  242. package/corpus/toolkit/package.json +1 -1
  243. package/corpus/toolkit/src/app-shell/index.ts +1 -0
  244. package/corpus/toolkit/src/app-shell/sidebar-footer-actions.tsx +48 -0
  245. package/corpus/toolkit/src/chat-history.css +52 -1
  246. package/corpus/toolkit/src/design-system/default-adapter.tsx +1 -1
  247. package/corpus/toolkit/src/ui/button.tsx +1 -2
  248. package/corpus/toolkit/src/ui/card.tsx +1 -1
  249. package/corpus/toolkit/src/ui/table.tsx +4 -11
  250. package/dist/agent/production-agent.d.ts.map +1 -1
  251. package/dist/agent/production-agent.js +4 -0
  252. package/dist/agent/production-agent.js.map +1 -1
  253. package/dist/agent/run-manager.d.ts +9 -0
  254. package/dist/agent/run-manager.d.ts.map +1 -1
  255. package/dist/agent/run-manager.js +25 -10
  256. package/dist/agent/run-manager.js.map +1 -1
  257. package/dist/agent/types.d.ts +2 -2
  258. package/dist/agent/types.d.ts.map +1 -1
  259. package/dist/agent/types.js.map +1 -1
  260. package/dist/cli/context-xray-local.js +1 -1
  261. package/dist/cli/context-xray-local.js.map +1 -1
  262. package/dist/cli/index.js +56 -17
  263. package/dist/cli/index.js.map +1 -1
  264. package/dist/cli/skills.d.ts.map +1 -1
  265. package/dist/cli/skills.js +5 -0
  266. package/dist/cli/skills.js.map +1 -1
  267. package/dist/cli/telemetry.d.ts +7 -0
  268. package/dist/cli/telemetry.d.ts.map +1 -1
  269. package/dist/cli/telemetry.js +91 -1
  270. package/dist/cli/telemetry.js.map +1 -1
  271. package/dist/client/AgentPanel.d.ts +7 -1
  272. package/dist/client/AgentPanel.d.ts.map +1 -1
  273. package/dist/client/AgentPanel.js +2 -2
  274. package/dist/client/AgentPanel.js.map +1 -1
  275. package/dist/client/CommandMenu.d.ts +2 -0
  276. package/dist/client/CommandMenu.d.ts.map +1 -1
  277. package/dist/client/CommandMenu.js +12 -1
  278. package/dist/client/CommandMenu.js.map +1 -1
  279. package/dist/client/agent-page/AgentTabsPage.d.ts +4 -0
  280. package/dist/client/agent-page/AgentTabsPage.d.ts.map +1 -1
  281. package/dist/client/agent-page/AgentTabsPage.js +8 -4
  282. package/dist/client/agent-page/AgentTabsPage.js.map +1 -1
  283. package/dist/client/analytics.d.ts.map +1 -1
  284. package/dist/client/analytics.js +7 -0
  285. package/dist/client/analytics.js.map +1 -1
  286. package/dist/client/error-capture.d.ts.map +1 -1
  287. package/dist/client/error-capture.js +8 -1
  288. package/dist/client/error-capture.js.map +1 -1
  289. package/dist/client/extensions/ExtensionsListPage.d.ts +5 -1
  290. package/dist/client/extensions/ExtensionsListPage.d.ts.map +1 -1
  291. package/dist/client/extensions/ExtensionsListPage.js +6 -4
  292. package/dist/client/extensions/ExtensionsListPage.js.map +1 -1
  293. package/dist/client/extensions/agent-native-extension-runtime.js +1 -1
  294. package/dist/client/extensions/agent-native-extension-runtime.js.map +1 -1
  295. package/dist/client/navigation/index.d.ts +1 -1
  296. package/dist/client/navigation/index.d.ts.map +1 -1
  297. package/dist/client/navigation/index.js +1 -1
  298. package/dist/client/navigation/index.js.map +1 -1
  299. package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
  300. package/dist/client/org/OrgSwitcher.js +9 -13
  301. package/dist/client/org/OrgSwitcher.js.map +1 -1
  302. package/dist/client/settings/ExtensionsSettingsContent.d.ts +2 -0
  303. package/dist/client/settings/ExtensionsSettingsContent.d.ts.map +1 -0
  304. package/dist/client/settings/ExtensionsSettingsContent.js +10 -0
  305. package/dist/client/settings/ExtensionsSettingsContent.js.map +1 -0
  306. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  307. package/dist/client/settings/SettingsPanel.js +10 -1
  308. package/dist/client/settings/SettingsPanel.js.map +1 -1
  309. package/dist/deploy/build.js +1 -0
  310. package/dist/deploy/build.js.map +1 -1
  311. package/dist/extensions/theme.js +1 -1
  312. package/dist/extensions/theme.js.map +1 -1
  313. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  314. package/dist/localization/default-messages.d.ts +2 -0
  315. package/dist/localization/default-messages.d.ts.map +1 -1
  316. package/dist/localization/default-messages.js +2 -0
  317. package/dist/localization/default-messages.js.map +1 -1
  318. package/dist/observability/routes.d.ts +3 -3
  319. package/dist/progress/routes.d.ts +1 -1
  320. package/dist/provider-api/actions/custom-provider-registration.d.ts +7 -7
  321. package/dist/provider-api/actions/provider-api.d.ts +9 -9
  322. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  323. package/dist/resources/handlers.d.ts +1 -1
  324. package/dist/server/analytics.d.ts +9 -4
  325. package/dist/server/analytics.d.ts.map +1 -1
  326. package/dist/server/analytics.js +111 -22
  327. package/dist/server/analytics.js.map +1 -1
  328. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  329. package/dist/server/core-routes-plugin.js +8 -1
  330. package/dist/server/core-routes-plugin.js.map +1 -1
  331. package/dist/server/framework-request-handler.d.ts.map +1 -1
  332. package/dist/server/framework-request-handler.js +17 -27
  333. package/dist/server/framework-request-handler.js.map +1 -1
  334. package/dist/server/realtime-token.d.ts +1 -1
  335. package/dist/styles/agent-native.css +13 -0
  336. package/dist/templates/chat/app/components/layout/Layout.tsx +3 -0
  337. package/dist/templates/chat/app/components/layout/Sidebar.tsx +113 -51
  338. package/dist/templates/chat/app/global.css +1 -1
  339. package/dist/templates/chat/app/routes/extensions._index.tsx +2 -2
  340. package/dist/templates/chat/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  341. package/dist/templates/chat/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
  342. package/dist/templates/chat/netlify.toml +1 -0
  343. package/dist/templates/default/app/global.css +1 -1
  344. package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +16 -0
  345. package/dist/tracking/error-capture.d.ts +14 -0
  346. package/dist/tracking/error-capture.d.ts.map +1 -0
  347. package/dist/tracking/error-capture.js +113 -0
  348. package/dist/tracking/error-capture.js.map +1 -0
  349. package/dist/tracking/index.d.ts +1 -0
  350. package/dist/tracking/index.d.ts.map +1 -1
  351. package/dist/tracking/index.js +1 -0
  352. package/dist/tracking/index.js.map +1 -1
  353. package/dist/vite/client.d.ts.map +1 -1
  354. package/dist/vite/client.js +2 -0
  355. package/dist/vite/client.js.map +1 -1
  356. package/docs/content/extensions.mdx +23 -4
  357. package/package.json +2 -2
  358. package/src/agent/production-agent.ts +4 -0
  359. package/src/agent/run-manager.ts +36 -10
  360. package/src/agent/types.ts +2 -0
  361. package/src/cli/context-xray-local.ts +1 -1
  362. package/src/cli/index.ts +63 -18
  363. package/src/cli/skills.ts +5 -0
  364. package/src/cli/telemetry.ts +118 -1
  365. package/src/client/AgentPanel.tsx +10 -0
  366. package/src/client/CommandMenu.tsx +13 -1
  367. package/src/client/agent-page/AgentTabsPage.tsx +39 -4
  368. package/src/client/analytics.ts +13 -0
  369. package/src/client/error-capture.ts +6 -1
  370. package/src/client/extensions/ExtensionsListPage.tsx +28 -8
  371. package/src/client/extensions/agent-native-extension-runtime.ts +1 -1
  372. package/src/client/navigation/index.ts +2 -0
  373. package/src/client/org/OrgSwitcher.tsx +14 -32
  374. package/src/client/settings/ExtensionsSettingsContent.tsx +24 -0
  375. package/src/client/settings/SettingsPanel.tsx +10 -0
  376. package/src/deploy/build.ts +3 -0
  377. package/src/extensions/theme.ts +1 -1
  378. package/src/localization/default-messages.ts +2 -0
  379. package/src/server/analytics.ts +154 -25
  380. package/src/server/core-routes-plugin.ts +10 -1
  381. package/src/server/framework-request-handler.ts +17 -26
  382. package/src/styles/agent-native.css +13 -0
  383. package/src/templates/chat/app/components/layout/Layout.tsx +3 -0
  384. package/src/templates/chat/app/components/layout/Sidebar.tsx +113 -51
  385. package/src/templates/chat/app/global.css +1 -1
  386. package/src/templates/chat/app/routes/extensions._index.tsx +2 -2
  387. package/src/templates/chat/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
  388. package/src/templates/chat/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
  389. package/src/templates/chat/netlify.toml +1 -0
  390. package/src/templates/default/app/global.css +1 -1
  391. package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +16 -0
  392. package/src/tracking/error-capture.ts +151 -0
  393. package/src/tracking/index.ts +5 -0
  394. package/src/vite/client.ts +6 -0
  395. package/corpus/templates/analytics/app/components/layout/NewAnalysisDialog.tsx +0 -165
  396. package/corpus/templates/analytics/app/pages/analyses/AnalysesList.tsx +0 -175
@@ -98,6 +98,8 @@ export declare namespace CommandMenu {
98
98
  export { CommandShortcut as Shortcut };
99
99
  export { CommandSeparator as Separator };
100
100
  }
101
+ export declare const COMMAND_MENU_OPEN_EVENT = "agent-native:open-command-menu";
102
+ export declare function openCommandMenu(): void;
101
103
  /**
102
104
  * Hook to handle Cmd+K (or Ctrl+K) to open the command menu
103
105
  */
@@ -1 +1 @@
1
- {"version":3,"file":"CommandMenu.d.ts","sourceRoot":"","sources":["../../src/client/CommandMenu.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAiBH,OAAO,KAAK,EAAE,EAQZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAyBf;;GAEG;AACH,wBAAgB,gBAAgB,SAE/B;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,CAAC,EAAE,MAAM,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,QA6B/C;AAED,wBAAgB,cAAc,SAO7B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,QAG5C;AAID,UAAU,iBAAiB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,iBAAS,YAAY,CAAC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
  CommandMenu.Separator = CommandSeparator;
270
270
  // ─── Keyboard Hook ──────────────────────────────────────────────────────────
271
+ export const COMMAND_MENU_OPEN_EVENT = "agent-native:open-command-menu";
272
+ export function openCommandMenu() {
273
+ if (typeof window !== "undefined") {
274
+ window.dispatchEvent(new Event(COMMAND_MENU_OPEN_EVENT));
275
+ }
276
+ }
271
277
  /**
272
278
  * Hook to handle Cmd+K (or Ctrl+K) to open the command menu
273
279
  */
@@ -288,9 +294,14 @@ export function useCommandMenuShortcut(onOpen, options = {}) {
288
294
  onOpen();
289
295
  }
290
296
  };
297
+ const handleOpenRequest = () => onOpen();
291
298
  const useCapture = Boolean(options.allowContentEditable);
292
299
  document.addEventListener("keydown", handleKeyDown, useCapture);
293
- return () => document.removeEventListener("keydown", handleKeyDown, useCapture);
300
+ window.addEventListener(COMMAND_MENU_OPEN_EVENT, handleOpenRequest);
301
+ return () => {
302
+ document.removeEventListener("keydown", handleKeyDown, useCapture);
303
+ window.removeEventListener(COMMAND_MENU_OPEN_EVENT, handleOpenRequest);
304
+ };
294
305
  }, [onOpen, options.allowContentEditable]);
295
306
  }
296
307
  //# sourceMappingURL=CommandMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommandMenu.js","sourceRoot":"","sources":["../../src/client/CommandMenu.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,OAAO,IAAI,gBAAgB,EAC3B,YAAY,IAAI,qBAAqB,EACrC,YAAY,IAAI,qBAAqB,EACrC,WAAW,IAAI,oBAAoB,EACnC,WAAW,IAAI,oBAAoB,EACnC,gBAAgB,IAAI,yBAAyB,EAC7C,eAAe,IAAI,wBAAwB,GAC5C,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,EACZ,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EAC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,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;IACvE,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["/**\n * CommandMenu — reusable command palette with agent chat fallback.\n *\n * Features:\n * - Anchored to top of viewport (not centered)\n * - Falls back to agent chat when no command matches\n * - Opens agent sidebar automatically when sending prompts\n * - Customizable commands via children\n *\n * Usage:\n * <CommandMenu open={open} onOpenChange={setOpen}>\n * <CommandMenu.Group heading=\"Actions\">\n * <CommandMenu.Item onSelect={() => doThing()}>Do thing</CommandMenu.Item>\n * </CommandMenu.Group>\n * </CommandMenu>\n */\n\nimport {\n Command as CommandPrimitive,\n CommandGroup as CommandGroupPrimitive,\n CommandInput as CommandInputPrimitive,\n CommandItem as CommandItemPrimitive,\n CommandList as CommandListPrimitive,\n CommandSeparator as CommandSeparatorPrimitive,\n CommandShortcut as CommandShortcutPrimitive,\n} from \"@agent-native/toolkit/ui/command\";\nimport {\n IconBook2,\n IconExternalLink,\n IconMessage,\n IconHistory,\n} from \"@tabler/icons-react\";\nimport React, {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\n\nimport { parseChangelog } from \"../changelog/parse.js\";\nimport { sendToAgentChat } from \"./agent-chat.js\";\nimport { ChangelogDialog, useChangelogSeen } from \"./changelog/Changelog.js\";\nimport { Dialog, DialogContent, DialogTitle } from \"./components/ui/dialog.js\";\nimport { cn } from \"./utils.js\";\n\n// ─── Context ────────────────────────────────────────────────────────────────\n\ninterface CommandMenuContextValue {\n search: string;\n onOpenChange: (open: boolean) => void;\n}\n\nconst CommandMenuContext = createContext<CommandMenuContextValue | null>(null);\n\nfunction useCommandMenuContext() {\n const ctx = useContext(CommandMenuContext);\n if (!ctx) throw new Error(\"CommandMenu.* must be used inside <CommandMenu>\");\n return ctx;\n}\n\n// ─── Hooks ──────────────────────────────────────────────────────────────────\n\n/**\n * Opens the agent sidebar (dispatches event that AgentSidebar listens for)\n */\nexport function openAgentSidebar() {\n window.dispatchEvent(new Event(\"agent-panel:open\"));\n}\n\nexport function openAgentSettings(\n section?: string | { section?: string | null },\n) {\n if (typeof window === \"undefined\") return;\n\n const normalizedSection =\n typeof section === \"string\" ? section : section?.section;\n\n const secretHash = normalizedSection?.replace(/^#/, \"\");\n if (secretHash?.toLowerCase().startsWith(\"secrets:\")) {\n window.location.hash = `#${secretHash}`;\n }\n\n openAgentSidebar();\n // Voice mode unmounts the chat surface while its dock is collapsed, so its\n // settings listener does not exist until opening the sidebar remounts it.\n // Deliver after the open-state render can commit instead of racing React's\n // concurrent remount. Non-visual runtimes fall back to the next task.\n const dispatchSettings = () => {\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:open-settings\", {\n detail: normalizedSection ? { section: normalizedSection } : undefined,\n }),\n );\n };\n if (typeof window.requestAnimationFrame === \"function\") {\n window.requestAnimationFrame(dispatchSettings);\n } else {\n window.setTimeout(dispatchSettings, 0);\n }\n}\n\nexport function focusAgentChat() {\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:set-mode\", {\n detail: { mode: \"chat\" },\n }),\n );\n openAgentSidebar();\n}\n\n/**\n * Sends a prompt to the agent and opens the sidebar\n */\nexport function submitToAgent(message: string) {\n focusAgentChat();\n sendToAgentChat({ message, submit: true });\n}\n\n// ─── Sub-components ─────────────────────────────────────────────────────────\n\ninterface CommandGroupProps {\n heading?: string;\n children: ReactNode;\n}\n\nfunction CommandGroup({ heading, children }: CommandGroupProps) {\n return (\n <CommandGroupPrimitive heading={heading}>{children}</CommandGroupPrimitive>\n );\n}\n\ninterface CommandItemProps {\n onSelect: () => void;\n children: ReactNode;\n keywords?: string[];\n className?: string;\n deferSelect?: boolean;\n}\n\nfunction CommandItem({\n onSelect,\n children,\n keywords: _keywords,\n className,\n deferSelect = true,\n}: CommandItemProps) {\n const { onOpenChange } = useCommandMenuContext();\n\n const handleSelect = () => {\n if (!deferSelect) {\n onSelect();\n onOpenChange(false);\n return;\n }\n\n onOpenChange(false);\n // Small delay to let dialog close animation start\n setTimeout(onSelect, 50);\n };\n\n return (\n <CommandItemPrimitive\n className={cn(\"cursor-pointer gap-2\", className)}\n onSelect={handleSelect}\n >\n {children}\n </CommandItemPrimitive>\n );\n}\n\ninterface CommandShortcutProps {\n children: ReactNode;\n className?: string;\n}\n\nfunction CommandShortcut({ children, className }: CommandShortcutProps) {\n return (\n <CommandShortcutPrimitive className={className}>\n {children}\n </CommandShortcutPrimitive>\n );\n}\n\nfunction CommandSeparator({ className }: { className?: string }) {\n return <CommandSeparatorPrimitive className={cn(\"my-1\", className)} />;\n}\n\nexport interface CommandMenuDoc {\n title: string;\n href: string;\n description?: string;\n keywords?: string[];\n}\n\ninterface CommandDocsGroupProps {\n docs: CommandMenuDoc[];\n heading?: string;\n}\n\nfunction commandDocSearchText(doc: CommandMenuDoc): string {\n return [doc.title, doc.description, ...(doc.keywords ?? [])]\n .filter(Boolean)\n .join(\" \")\n .toLowerCase();\n}\n\nfunction filterCommandDocs(docs: CommandMenuDoc[], search: string) {\n const searchLower = search.trim().toLowerCase();\n if (!searchLower) return docs;\n return docs.filter((doc) => commandDocSearchText(doc).includes(searchLower));\n}\n\nfunction openDocsHref(href: string) {\n if (/^https?:\\/\\//i.test(href)) {\n window.open(href, \"_blank\", \"noopener,noreferrer\");\n return;\n }\n window.location.assign(href);\n}\n\nfunction CommandDocsGroup({ docs, heading = \"Docs\" }: CommandDocsGroupProps) {\n if (docs.length === 0) return null;\n\n return (\n <CommandGroup heading={heading}>\n {docs.map((doc) => (\n <CommandItem\n key={doc.href}\n onSelect={() => openDocsHref(doc.href)}\n keywords={[doc.title, doc.description ?? \"\", ...(doc.keywords ?? [])]}\n deferSelect={false}\n className=\"items-start py-2\"\n >\n <IconBook2 className=\"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground\" />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-medium\">{doc.title}</span>\n {doc.description ? (\n <span className=\"mt-0.5 block line-clamp-2 text-xs leading-snug text-muted-foreground\">\n {doc.description}\n </span>\n ) : null}\n </span>\n <IconExternalLink className=\"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n </CommandItem>\n ))}\n </CommandGroup>\n );\n}\n\n// ─── Main Component ─────────────────────────────────────────────────────────\n\nexport interface CommandMenuProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n children: ReactNode;\n /** Render app-specific dynamic results from the current search value. */\n renderResults?: (search: string) => ReactNode;\n /** Placeholder text for the search input */\n placeholder?: string;\n /** Text shown when no results match (before showing agent fallback) */\n emptyText?: string;\n /** Whether to show the \"Ask AI\" fallback when no commands match. Default: true */\n showAgentFallback?: boolean;\n /** Custom class for the dialog content */\n className?: string;\n /**\n * Raw CHANGELOG.md contents. When provided, the menu shows a built-in\n * \"What's new\" entry that opens an in-app changelog dialog (with an unseen\n * dot for new releases). Pass your app's own file:\n * import changelog from \"../CHANGELOG.md?raw\";\n * <CommandMenu ... changelog={changelog} />\n */\n changelog?: string;\n /** Label for the built-in changelog entry. Default: \"What's new\". */\n changelogLabel?: string;\n /**\n * Stable key used to remember which release a user has already seen (for the\n * unseen dot). Defaults to the document title's host app; set explicitly when\n * multiple apps share an origin.\n */\n changelogKey?: string;\n}\n\nexport function CommandMenu({\n open,\n onOpenChange,\n children,\n renderResults,\n placeholder = \"Type a command or ask AI...\",\n emptyText: _emptyText = \"No commands found.\",\n showAgentFallback = true,\n className,\n changelog,\n changelogLabel = \"What's new\",\n changelogKey,\n}: CommandMenuProps) {\n const [search, setSearch] = useState(\"\");\n const inputRef = useRef<HTMLInputElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Built-in \"What's new\" changelog surface (only active when `changelog` is\n // passed). The dialog is rendered alongside the menu so it survives the menu\n // closing; the unseen dot persists per browser via localStorage.\n const [changelogOpen, setChangelogOpen] = useState(false);\n const hasChangelog =\n typeof changelog === \"string\" && changelog.trim().length > 0;\n const changelogEntries = useMemo(\n () => (hasChangelog ? parseChangelog(changelog as string) : []),\n [hasChangelog, changelog],\n );\n const latestChangelogId = changelogEntries[0]?.id;\n const { unseen: changelogUnseen, markSeen: markChangelogSeen } =\n useChangelogSeen(changelogKey ?? \"app\", latestChangelogId);\n\n const openChangelog = useCallback(() => {\n onOpenChange(false);\n markChangelogSeen();\n // Let the menu close before the dialog opens (avoids overlay flicker).\n setTimeout(() => setChangelogOpen(true), 50);\n }, [onOpenChange, markChangelogSeen]);\n\n // Focus input when opening; clear search while closed so reopen never renders\n // dynamic results for the previous query.\n useEffect(() => {\n if (!open) {\n setSearch(\"\");\n return;\n }\n\n if (open) {\n setSearch(\"\");\n // Wait for render then focus\n requestAnimationFrame(() => {\n inputRef.current?.focus();\n });\n }\n }, [open]);\n\n const handleSubmitToAgent = useCallback(() => {\n onOpenChange(false);\n if (!search.trim()) {\n focusAgentChat();\n return;\n }\n submitToAgent(search.trim());\n }, [search, onOpenChange]);\n\n // The built-in \"What's new\" row matches changelog-ish search terms.\n const changelogRowMatches =\n !search ||\n [\n changelogLabel,\n \"changelog\",\n \"what's new\",\n \"whats new\",\n \"updates\",\n \"release notes\",\n \"changes\",\n ]\n .join(\" \")\n .toLowerCase()\n .includes(search.toLowerCase());\n const showChangelogRow = hasChangelog && changelogRowMatches;\n\n // Filter children based on search\n const filterChildren = (nodes: ReactNode): ReactNode => {\n return React.Children.map(nodes, (child) => {\n if (!React.isValidElement(child)) return child;\n const props = child.props as Record<string, unknown>;\n\n // If it's a CommandGroup, filter its children\n if (child.type === CommandGroup) {\n const groupChildren = filterChildren(props.children as ReactNode);\n const hasChildren = React.Children.count(groupChildren) > 0;\n if (!hasChildren) return null;\n return React.cloneElement(child, {\n ...props,\n children: groupChildren,\n } as Record<string, unknown>);\n }\n\n if (child.type === CommandDocsGroup) {\n const docs = Array.isArray(props.docs)\n ? (props.docs as CommandMenuDoc[])\n : [];\n const filteredDocs = filterCommandDocs(docs, search);\n if (filteredDocs.length === 0) return null;\n return React.cloneElement(child, {\n ...props,\n docs: filteredDocs,\n } as Record<string, unknown>);\n }\n\n // If it's a CommandItem, check if it matches search\n if (child.type === CommandItem) {\n if (!search) return child;\n const text = getTextContent(props.children as ReactNode).toLowerCase();\n const keywords = ((props.keywords as string[]) || [])\n .join(\" \")\n .toLowerCase();\n const searchLower = search.toLowerCase();\n if (text.includes(searchLower) || keywords.includes(searchLower)) {\n return child;\n }\n return null;\n }\n\n // If it's a separator, keep it (will be cleaned up later if needed)\n if (child.type === CommandSeparator) {\n return search ? null : child; // Hide separators when searching\n }\n\n return child;\n });\n };\n\n const filteredChildren = filterChildren(children);\n const hasResults = React.Children.toArray(filteredChildren).some(\n (child) =>\n React.isValidElement(child) &&\n (child.type === CommandGroup || child.type === CommandDocsGroup),\n );\n const dynamicResults = open ? renderResults?.(search) : null;\n const hasDynamicResults = Boolean(dynamicResults);\n\n return (\n <>\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n ref={containerRef}\n aria-describedby={undefined}\n hideClose\n motion=\"instant\"\n overlayClassName=\"fixed inset-0 z-50 bg-black/50 backdrop-blur-none transition-none\"\n overlayStyle={{\n zIndex: 50,\n backgroundColor: \"rgb(0 0 0 / 0.5)\",\n backdropFilter: \"none\",\n animation: \"none\",\n transition: \"none\",\n }}\n className={cn(\n \"fixed left-1/2 top-[15vh] !z-50 !max-h-none -translate-x-1/2 !translate-y-0 !gap-0 w-full max-w-lg\",\n \"rounded-lg border border-border bg-popover p-0 text-popover-foreground shadow-lg\",\n className,\n )}\n style={{\n animation: \"none\",\n transition: \"none\",\n }}\n >\n <DialogTitle className=\"sr-only\">{placeholder}</DialogTitle>\n <CommandPrimitive\n loop\n shouldFilter={false}\n className=\"h-auto rounded-lg\"\n >\n <CommandMenuContext.Provider value={{ search, onOpenChange }}>\n {/* Search input */}\n <CommandInputPrimitive\n ref={inputRef}\n value={search}\n onValueChange={setSearch}\n placeholder={placeholder}\n />\n\n {/* Command list */}\n <CommandListPrimitive>\n {dynamicResults}\n {hasResults && filteredChildren}\n\n {/* What's new — built-in changelog entry */}\n {showChangelogRow && (\n <>\n {hasResults && <CommandSeparator />}\n <div className=\"p-1\">\n <CommandItemPrimitive\n className=\"cursor-pointer gap-2 py-2\"\n onSelect={openChangelog}\n >\n <IconHistory className=\"h-4 w-4 text-muted-foreground\" />\n <span>{changelogLabel}</span>\n {changelogUnseen && (\n <span\n className=\"ms-auto h-2 w-2 rounded-full bg-primary\"\n aria-label=\"New updates available\"\n />\n )}\n </CommandItemPrimitive>\n </div>\n </>\n )}\n\n {/* Ask AI — always visible at the bottom */}\n {showAgentFallback && (\n <>\n {(hasResults || showChangelogRow || hasDynamicResults) && (\n <CommandSeparator />\n )}\n <div className=\"p-1\">\n <CommandItemPrimitive\n className=\"cursor-pointer gap-2 py-2\"\n onSelect={handleSubmitToAgent}\n >\n <IconMessage className=\"h-4 w-4 text-muted-foreground\" />\n <span>\n {search.trim() ? (\n <>\n Ask AI:{\" \"}\n <span className=\"text-muted-foreground\">\n \"{search}\"\n </span>\n </>\n ) : (\n <span className=\"text-muted-foreground\">\n Ask AI anything...\n </span>\n )}\n </span>\n {search.trim() && (\n <span className=\"ms-auto text-xs text-muted-foreground\">\n ↵\n </span>\n )}\n </CommandItemPrimitive>\n </div>\n </>\n )}\n </CommandListPrimitive>\n </CommandMenuContext.Provider>\n </CommandPrimitive>\n </DialogContent>\n </Dialog>\n\n {hasChangelog && (\n <ChangelogDialog\n open={changelogOpen}\n onOpenChange={setChangelogOpen}\n markdown={changelog as string}\n title={changelogLabel}\n />\n )}\n </>\n );\n}\n\n// Helper to extract text content from React children\nfunction getTextContent(children: ReactNode): string {\n if (typeof children === \"string\") return children;\n if (typeof children === \"number\") return String(children);\n if (!children) return \"\";\n if (Array.isArray(children)) {\n return children.map(getTextContent).join(\" \");\n }\n if (\n React.isValidElement(children) &&\n (children.props as Record<string, unknown>).children\n ) {\n return getTextContent(\n (children.props as Record<string, unknown>).children as ReactNode,\n );\n }\n return \"\";\n}\n\n// Attach sub-components\nCommandMenu.Group = CommandGroup;\nCommandMenu.Item = CommandItem;\nCommandMenu.DocsGroup = CommandDocsGroup;\nCommandMenu.Shortcut = CommandShortcut;\nCommandMenu.Separator = CommandSeparator;\n\n// ─── Keyboard Hook ──────────────────────────────────────────────────────────\n\n/**\n * Hook to handle Cmd+K (or Ctrl+K) to open the command menu\n */\nexport function useCommandMenuShortcut(\n onOpen: () => void,\n options: { allowContentEditable?: boolean } = {},\n) {\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === \"k\") {\n // Don't trigger if user is typing in a native form control.\n const target = e.target instanceof HTMLElement ? e.target : null;\n const isContentEditable = target?.isContentEditable;\n if (\n target?.tagName === \"INPUT\" ||\n target?.tagName === \"TEXTAREA\" ||\n target?.tagName === \"SELECT\" ||\n (!options.allowContentEditable && isContentEditable)\n ) {\n return;\n }\n e.preventDefault();\n onOpen();\n }\n };\n const useCapture = Boolean(options.allowContentEditable);\n document.addEventListener(\"keydown\", handleKeyDown, useCapture);\n return () =>\n document.removeEventListener(\"keydown\", handleKeyDown, useCapture);\n }, [onOpen, options.allowContentEditable]);\n}\n\nexport type {\n CommandDocsGroupProps,\n CommandGroupProps,\n CommandItemProps,\n CommandShortcutProps,\n};\n"]}
1
+ {"version":3,"file":"CommandMenu.js","sourceRoot":"","sources":["../../src/client/CommandMenu.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,OAAO,IAAI,gBAAgB,EAC3B,YAAY,IAAI,qBAAqB,EACrC,YAAY,IAAI,qBAAqB,EACrC,WAAW,IAAI,oBAAoB,EACnC,WAAW,IAAI,oBAAoB,EACnC,gBAAgB,IAAI,yBAAyB,EAC7C,eAAe,IAAI,wBAAwB,GAC5C,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,SAAS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;oBAC5B,CAAC,CAAC,OAAO,CAAC,oBAAoB,IAAI,iBAAiB,CAAC,EACpD,CAAC;oBACD,OAAO;gBACT,CAAC;gBACD,CAAC,CAAC,cAAc,EAAE,CAAC;gBACnB,MAAM,EAAE,CAAC;YACX,CAAC;QACH,CAAC,CAAC;QACF,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;QACzC,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;QACzD,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;QAChE,MAAM,CAAC,gBAAgB,CAAC,uBAAuB,EAAE,iBAAiB,CAAC,CAAC;QACpE,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;YACnE,MAAM,CAAC,mBAAmB,CAAC,uBAAuB,EAAE,iBAAiB,CAAC,CAAC;QACzE,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["/**\n * CommandMenu — reusable command palette with agent chat fallback.\n *\n * Features:\n * - Anchored to top of viewport (not centered)\n * - Falls back to agent chat when no command matches\n * - Opens agent sidebar automatically when sending prompts\n * - Customizable commands via children\n *\n * Usage:\n * <CommandMenu open={open} onOpenChange={setOpen}>\n * <CommandMenu.Group heading=\"Actions\">\n * <CommandMenu.Item onSelect={() => doThing()}>Do thing</CommandMenu.Item>\n * </CommandMenu.Group>\n * </CommandMenu>\n */\n\nimport {\n Command as CommandPrimitive,\n CommandGroup as CommandGroupPrimitive,\n CommandInput as CommandInputPrimitive,\n CommandItem as CommandItemPrimitive,\n CommandList as CommandListPrimitive,\n CommandSeparator as CommandSeparatorPrimitive,\n CommandShortcut as CommandShortcutPrimitive,\n} from \"@agent-native/toolkit/ui/command\";\nimport {\n IconBook2,\n IconExternalLink,\n IconMessage,\n IconHistory,\n} from \"@tabler/icons-react\";\nimport React, {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\n\nimport { parseChangelog } from \"../changelog/parse.js\";\nimport { sendToAgentChat } from \"./agent-chat.js\";\nimport { ChangelogDialog, useChangelogSeen } from \"./changelog/Changelog.js\";\nimport { Dialog, DialogContent, DialogTitle } from \"./components/ui/dialog.js\";\nimport { cn } from \"./utils.js\";\n\n// ─── Context ────────────────────────────────────────────────────────────────\n\ninterface CommandMenuContextValue {\n search: string;\n onOpenChange: (open: boolean) => void;\n}\n\nconst CommandMenuContext = createContext<CommandMenuContextValue | null>(null);\n\nfunction useCommandMenuContext() {\n const ctx = useContext(CommandMenuContext);\n if (!ctx) throw new Error(\"CommandMenu.* must be used inside <CommandMenu>\");\n return ctx;\n}\n\n// ─── Hooks ──────────────────────────────────────────────────────────────────\n\n/**\n * Opens the agent sidebar (dispatches event that AgentSidebar listens for)\n */\nexport function openAgentSidebar() {\n window.dispatchEvent(new Event(\"agent-panel:open\"));\n}\n\nexport function openAgentSettings(\n section?: string | { section?: string | null },\n) {\n if (typeof window === \"undefined\") return;\n\n const normalizedSection =\n typeof section === \"string\" ? section : section?.section;\n\n const secretHash = normalizedSection?.replace(/^#/, \"\");\n if (secretHash?.toLowerCase().startsWith(\"secrets:\")) {\n window.location.hash = `#${secretHash}`;\n }\n\n openAgentSidebar();\n // Voice mode unmounts the chat surface while its dock is collapsed, so its\n // settings listener does not exist until opening the sidebar remounts it.\n // Deliver after the open-state render can commit instead of racing React's\n // concurrent remount. Non-visual runtimes fall back to the next task.\n const dispatchSettings = () => {\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:open-settings\", {\n detail: normalizedSection ? { section: normalizedSection } : undefined,\n }),\n );\n };\n if (typeof window.requestAnimationFrame === \"function\") {\n window.requestAnimationFrame(dispatchSettings);\n } else {\n window.setTimeout(dispatchSettings, 0);\n }\n}\n\nexport function focusAgentChat() {\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:set-mode\", {\n detail: { mode: \"chat\" },\n }),\n );\n openAgentSidebar();\n}\n\n/**\n * Sends a prompt to the agent and opens the sidebar\n */\nexport function submitToAgent(message: string) {\n focusAgentChat();\n sendToAgentChat({ message, submit: true });\n}\n\n// ─── Sub-components ─────────────────────────────────────────────────────────\n\ninterface CommandGroupProps {\n heading?: string;\n children: ReactNode;\n}\n\nfunction CommandGroup({ heading, children }: CommandGroupProps) {\n return (\n <CommandGroupPrimitive heading={heading}>{children}</CommandGroupPrimitive>\n );\n}\n\ninterface CommandItemProps {\n onSelect: () => void;\n children: ReactNode;\n keywords?: string[];\n className?: string;\n deferSelect?: boolean;\n}\n\nfunction CommandItem({\n onSelect,\n children,\n keywords: _keywords,\n className,\n deferSelect = true,\n}: CommandItemProps) {\n const { onOpenChange } = useCommandMenuContext();\n\n const handleSelect = () => {\n if (!deferSelect) {\n onSelect();\n onOpenChange(false);\n return;\n }\n\n onOpenChange(false);\n // Small delay to let dialog close animation start\n setTimeout(onSelect, 50);\n };\n\n return (\n <CommandItemPrimitive\n className={cn(\"cursor-pointer gap-2\", className)}\n onSelect={handleSelect}\n >\n {children}\n </CommandItemPrimitive>\n );\n}\n\ninterface CommandShortcutProps {\n children: ReactNode;\n className?: string;\n}\n\nfunction CommandShortcut({ children, className }: CommandShortcutProps) {\n return (\n <CommandShortcutPrimitive className={className}>\n {children}\n </CommandShortcutPrimitive>\n );\n}\n\nfunction CommandSeparator({ className }: { className?: string }) {\n return <CommandSeparatorPrimitive className={cn(\"my-1\", className)} />;\n}\n\nexport interface CommandMenuDoc {\n title: string;\n href: string;\n description?: string;\n keywords?: string[];\n}\n\ninterface CommandDocsGroupProps {\n docs: CommandMenuDoc[];\n heading?: string;\n}\n\nfunction commandDocSearchText(doc: CommandMenuDoc): string {\n return [doc.title, doc.description, ...(doc.keywords ?? [])]\n .filter(Boolean)\n .join(\" \")\n .toLowerCase();\n}\n\nfunction filterCommandDocs(docs: CommandMenuDoc[], search: string) {\n const searchLower = search.trim().toLowerCase();\n if (!searchLower) return docs;\n return docs.filter((doc) => commandDocSearchText(doc).includes(searchLower));\n}\n\nfunction openDocsHref(href: string) {\n if (/^https?:\\/\\//i.test(href)) {\n window.open(href, \"_blank\", \"noopener,noreferrer\");\n return;\n }\n window.location.assign(href);\n}\n\nfunction CommandDocsGroup({ docs, heading = \"Docs\" }: CommandDocsGroupProps) {\n if (docs.length === 0) return null;\n\n return (\n <CommandGroup heading={heading}>\n {docs.map((doc) => (\n <CommandItem\n key={doc.href}\n onSelect={() => openDocsHref(doc.href)}\n keywords={[doc.title, doc.description ?? \"\", ...(doc.keywords ?? [])]}\n deferSelect={false}\n className=\"items-start py-2\"\n >\n <IconBook2 className=\"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground\" />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-medium\">{doc.title}</span>\n {doc.description ? (\n <span className=\"mt-0.5 block line-clamp-2 text-xs leading-snug text-muted-foreground\">\n {doc.description}\n </span>\n ) : null}\n </span>\n <IconExternalLink className=\"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n </CommandItem>\n ))}\n </CommandGroup>\n );\n}\n\n// ─── Main Component ─────────────────────────────────────────────────────────\n\nexport interface CommandMenuProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n children: ReactNode;\n /** Render app-specific dynamic results from the current search value. */\n renderResults?: (search: string) => ReactNode;\n /** Placeholder text for the search input */\n placeholder?: string;\n /** Text shown when no results match (before showing agent fallback) */\n emptyText?: string;\n /** Whether to show the \"Ask AI\" fallback when no commands match. Default: true */\n showAgentFallback?: boolean;\n /** Custom class for the dialog content */\n className?: string;\n /**\n * Raw CHANGELOG.md contents. When provided, the menu shows a built-in\n * \"What's new\" entry that opens an in-app changelog dialog (with an unseen\n * dot for new releases). Pass your app's own file:\n * import changelog from \"../CHANGELOG.md?raw\";\n * <CommandMenu ... changelog={changelog} />\n */\n changelog?: string;\n /** Label for the built-in changelog entry. Default: \"What's new\". */\n changelogLabel?: string;\n /**\n * Stable key used to remember which release a user has already seen (for the\n * unseen dot). Defaults to the document title's host app; set explicitly when\n * multiple apps share an origin.\n */\n changelogKey?: string;\n}\n\nexport function CommandMenu({\n open,\n onOpenChange,\n children,\n renderResults,\n placeholder = \"Type a command or ask AI...\",\n emptyText: _emptyText = \"No commands found.\",\n showAgentFallback = true,\n className,\n changelog,\n changelogLabel = \"What's new\",\n changelogKey,\n}: CommandMenuProps) {\n const [search, setSearch] = useState(\"\");\n const inputRef = useRef<HTMLInputElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Built-in \"What's new\" changelog surface (only active when `changelog` is\n // passed). The dialog is rendered alongside the menu so it survives the menu\n // closing; the unseen dot persists per browser via localStorage.\n const [changelogOpen, setChangelogOpen] = useState(false);\n const hasChangelog =\n typeof changelog === \"string\" && changelog.trim().length > 0;\n const changelogEntries = useMemo(\n () => (hasChangelog ? parseChangelog(changelog as string) : []),\n [hasChangelog, changelog],\n );\n const latestChangelogId = changelogEntries[0]?.id;\n const { unseen: changelogUnseen, markSeen: markChangelogSeen } =\n useChangelogSeen(changelogKey ?? \"app\", latestChangelogId);\n\n const openChangelog = useCallback(() => {\n onOpenChange(false);\n markChangelogSeen();\n // Let the menu close before the dialog opens (avoids overlay flicker).\n setTimeout(() => setChangelogOpen(true), 50);\n }, [onOpenChange, markChangelogSeen]);\n\n // Focus input when opening; clear search while closed so reopen never renders\n // dynamic results for the previous query.\n useEffect(() => {\n if (!open) {\n setSearch(\"\");\n return;\n }\n\n if (open) {\n setSearch(\"\");\n // Wait for render then focus\n requestAnimationFrame(() => {\n inputRef.current?.focus();\n });\n }\n }, [open]);\n\n const handleSubmitToAgent = useCallback(() => {\n onOpenChange(false);\n if (!search.trim()) {\n focusAgentChat();\n return;\n }\n submitToAgent(search.trim());\n }, [search, onOpenChange]);\n\n // The built-in \"What's new\" row matches changelog-ish search terms.\n const changelogRowMatches =\n !search ||\n [\n changelogLabel,\n \"changelog\",\n \"what's new\",\n \"whats new\",\n \"updates\",\n \"release notes\",\n \"changes\",\n ]\n .join(\" \")\n .toLowerCase()\n .includes(search.toLowerCase());\n const showChangelogRow = hasChangelog && changelogRowMatches;\n\n // Filter children based on search\n const filterChildren = (nodes: ReactNode): ReactNode => {\n return React.Children.map(nodes, (child) => {\n if (!React.isValidElement(child)) return child;\n const props = child.props as Record<string, unknown>;\n\n // If it's a CommandGroup, filter its children\n if (child.type === CommandGroup) {\n const groupChildren = filterChildren(props.children as ReactNode);\n const hasChildren = React.Children.count(groupChildren) > 0;\n if (!hasChildren) return null;\n return React.cloneElement(child, {\n ...props,\n children: groupChildren,\n } as Record<string, unknown>);\n }\n\n if (child.type === CommandDocsGroup) {\n const docs = Array.isArray(props.docs)\n ? (props.docs as CommandMenuDoc[])\n : [];\n const filteredDocs = filterCommandDocs(docs, search);\n if (filteredDocs.length === 0) return null;\n return React.cloneElement(child, {\n ...props,\n docs: filteredDocs,\n } as Record<string, unknown>);\n }\n\n // If it's a CommandItem, check if it matches search\n if (child.type === CommandItem) {\n if (!search) return child;\n const text = getTextContent(props.children as ReactNode).toLowerCase();\n const keywords = ((props.keywords as string[]) || [])\n .join(\" \")\n .toLowerCase();\n const searchLower = search.toLowerCase();\n if (text.includes(searchLower) || keywords.includes(searchLower)) {\n return child;\n }\n return null;\n }\n\n // If it's a separator, keep it (will be cleaned up later if needed)\n if (child.type === CommandSeparator) {\n return search ? null : child; // Hide separators when searching\n }\n\n return child;\n });\n };\n\n const filteredChildren = filterChildren(children);\n const hasResults = React.Children.toArray(filteredChildren).some(\n (child) =>\n React.isValidElement(child) &&\n (child.type === CommandGroup || child.type === CommandDocsGroup),\n );\n const dynamicResults = open ? renderResults?.(search) : null;\n const hasDynamicResults = Boolean(dynamicResults);\n\n return (\n <>\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n ref={containerRef}\n aria-describedby={undefined}\n hideClose\n motion=\"instant\"\n overlayClassName=\"fixed inset-0 z-50 bg-black/50 backdrop-blur-none transition-none\"\n overlayStyle={{\n zIndex: 50,\n backgroundColor: \"rgb(0 0 0 / 0.5)\",\n backdropFilter: \"none\",\n animation: \"none\",\n transition: \"none\",\n }}\n className={cn(\n \"fixed left-1/2 top-[15vh] !z-50 !max-h-none -translate-x-1/2 !translate-y-0 !gap-0 w-full max-w-lg\",\n \"rounded-lg border border-border bg-popover p-0 text-popover-foreground shadow-lg\",\n className,\n )}\n style={{\n animation: \"none\",\n transition: \"none\",\n }}\n >\n <DialogTitle className=\"sr-only\">{placeholder}</DialogTitle>\n <CommandPrimitive\n loop\n shouldFilter={false}\n className=\"h-auto rounded-lg\"\n >\n <CommandMenuContext.Provider value={{ search, onOpenChange }}>\n {/* Search input */}\n <CommandInputPrimitive\n ref={inputRef}\n value={search}\n onValueChange={setSearch}\n placeholder={placeholder}\n />\n\n {/* Command list */}\n <CommandListPrimitive>\n {dynamicResults}\n {hasResults && filteredChildren}\n\n {/* What's new — built-in changelog entry */}\n {showChangelogRow && (\n <>\n {hasResults && <CommandSeparator />}\n <div className=\"p-1\">\n <CommandItemPrimitive\n className=\"cursor-pointer gap-2 py-2\"\n onSelect={openChangelog}\n >\n <IconHistory className=\"h-4 w-4 text-muted-foreground\" />\n <span>{changelogLabel}</span>\n {changelogUnseen && (\n <span\n className=\"ms-auto h-2 w-2 rounded-full bg-primary\"\n aria-label=\"New updates available\"\n />\n )}\n </CommandItemPrimitive>\n </div>\n </>\n )}\n\n {/* Ask AI — always visible at the bottom */}\n {showAgentFallback && (\n <>\n {(hasResults || showChangelogRow || hasDynamicResults) && (\n <CommandSeparator />\n )}\n <div className=\"p-1\">\n <CommandItemPrimitive\n className=\"cursor-pointer gap-2 py-2\"\n onSelect={handleSubmitToAgent}\n >\n <IconMessage className=\"h-4 w-4 text-muted-foreground\" />\n <span>\n {search.trim() ? (\n <>\n Ask AI:{\" \"}\n <span className=\"text-muted-foreground\">\n \"{search}\"\n </span>\n </>\n ) : (\n <span className=\"text-muted-foreground\">\n Ask AI anything...\n </span>\n )}\n </span>\n {search.trim() && (\n <span className=\"ms-auto text-xs text-muted-foreground\">\n ↵\n </span>\n )}\n </CommandItemPrimitive>\n </div>\n </>\n )}\n </CommandListPrimitive>\n </CommandMenuContext.Provider>\n </CommandPrimitive>\n </DialogContent>\n </Dialog>\n\n {hasChangelog && (\n <ChangelogDialog\n open={changelogOpen}\n onOpenChange={setChangelogOpen}\n markdown={changelog as string}\n title={changelogLabel}\n />\n )}\n </>\n );\n}\n\n// Helper to extract text content from React children\nfunction getTextContent(children: ReactNode): string {\n if (typeof children === \"string\") return children;\n if (typeof children === \"number\") return String(children);\n if (!children) return \"\";\n if (Array.isArray(children)) {\n return children.map(getTextContent).join(\" \");\n }\n if (\n React.isValidElement(children) &&\n (children.props as Record<string, unknown>).children\n ) {\n return getTextContent(\n (children.props as Record<string, unknown>).children as ReactNode,\n );\n }\n return \"\";\n}\n\n// Attach sub-components\nCommandMenu.Group = CommandGroup;\nCommandMenu.Item = CommandItem;\nCommandMenu.DocsGroup = CommandDocsGroup;\nCommandMenu.Shortcut = CommandShortcut;\nCommandMenu.Separator = CommandSeparator;\n\n// ─── Keyboard Hook ──────────────────────────────────────────────────────────\n\nexport const COMMAND_MENU_OPEN_EVENT = \"agent-native:open-command-menu\";\n\nexport function openCommandMenu() {\n if (typeof window !== \"undefined\") {\n window.dispatchEvent(new Event(COMMAND_MENU_OPEN_EVENT));\n }\n}\n\n/**\n * Hook to handle Cmd+K (or Ctrl+K) to open the command menu\n */\nexport function useCommandMenuShortcut(\n onOpen: () => void,\n options: { allowContentEditable?: boolean } = {},\n) {\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === \"k\") {\n // Don't trigger if user is typing in a native form control.\n const target = e.target instanceof HTMLElement ? e.target : null;\n const isContentEditable = target?.isContentEditable;\n if (\n target?.tagName === \"INPUT\" ||\n target?.tagName === \"TEXTAREA\" ||\n target?.tagName === \"SELECT\" ||\n (!options.allowContentEditable && isContentEditable)\n ) {\n return;\n }\n e.preventDefault();\n onOpen();\n }\n };\n const handleOpenRequest = () => onOpen();\n const useCapture = Boolean(options.allowContentEditable);\n document.addEventListener(\"keydown\", handleKeyDown, useCapture);\n window.addEventListener(COMMAND_MENU_OPEN_EVENT, handleOpenRequest);\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown, useCapture);\n window.removeEventListener(COMMAND_MENU_OPEN_EVENT, handleOpenRequest);\n };\n }, [onOpen, options.allowContentEditable]);\n}\n\nexport type {\n CommandDocsGroupProps,\n CommandGroupProps,\n CommandItemProps,\n CommandShortcutProps,\n};\n"]}
@@ -3,6 +3,10 @@ import type { ResourceView } from "../resources/ResourcesPanel.js";
3
3
  import type { SettingsTabItem } from "../settings/SettingsTabsPage.js";
4
4
  import type { AgentPageTabProps } from "./types.js";
5
5
  export declare const AGENT_RESOURCE_DOCS_HREF: Record<ResourceView, string>;
6
+ export declare const AGENT_ACCESS_DOCS_HREF: {
7
+ readonly mcp: "https://agent-native.com/docs/mcp-protocol";
8
+ readonly a2a: "https://agent-native.com/docs/a2a-protocol";
9
+ };
6
10
  export interface AgentPageExtraTabContext extends AgentPageTabProps {
7
11
  scopeControl: ReactNode;
8
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AgentTabsPage.d.ts","sourceRoot":"","sources":["../../../src/client/agent-page/AgentTabsPage.tsx"],"names":[],"mappings":"AAgBA,OAAO,EASL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAkBf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAanE,OAAO,KAAK,EAEV,eAAe,EAChB,MAAM,iCAAiC,CAAC;AAIzC,OAAO,KAAK,EAAkB,iBAAiB,EAAE,MAAM,YAAY,CAAC;AA6EpE,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,Y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AAE,MAAM,CASjE,CAAC;AAiRF,eAAO,MAAM,sBAAsB;aACjC,GAAG,EAAE,4CAA4C;aACjD,GAAG,EAAE,4CAA4C;CACzC,CAAC;AAqQX,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IACjE,YAAY,EAAE,SAAS,CAAC;CACzB;AAED,MAAM,MAAM,wBAAwB,GAAG,CACrC,OAAO,EAAE,wBAAwB,KAC9B,eAAe,CAAC;AAErB,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;IAC9B,iFAAiF;IACjF,iBAAiB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAc,EACd,iBAAsB,EACtB,UAAoB,EACpB,SAAS,EACT,YAAmB,EACnB,iBAA4B,EAC5B,UAAe,EACf,KAAK,EACL,aAAa,GACd,EAAE,kBAAkB,+BAybpB"}
@@ -1,5 +1,5 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { IconBook2, IconChecklist, IconClock, IconExternalLink, IconFolder, IconHistory, IconHierarchy2, IconNotes, IconPlugConnected, IconTopologyRing2, IconSearch, IconSettings, IconShieldLock, IconX, } from "@tabler/icons-react";
2
+ import { IconBook2, IconChecklist, IconClock, IconExternalLink, IconFolder, IconHistory, IconHelpCircle, IconHierarchy2, IconNotes, IconPlugConnected, IconTopologyRing2, IconSearch, IconSettings, IconShieldLock, IconX, } from "@tabler/icons-react";
3
3
  import { lazy, Suspense, useCallback, useEffect, useMemo, useRef, useState, } from "react";
4
4
  import { MCP_CONNECT_GUIDES, MCP_CONNECT_MCP_URL_TEMPLATE, MCP_STATIC_TOKEN_FALLBACK, interpolateMcpConnectTemplate, } from "../../shared/mcp-connect-content.js";
5
5
  import { appPath } from "../api-path.js";
@@ -166,7 +166,11 @@ function ConnectionsTab({ canManageOrg = false }) {
166
166
  ? "Connect a service to give the agent access to it."
167
167
  : "Organization connections shared with this workspace will appear here." }))] }, section.label))) })), _jsx(McpIntegrationDialog, { open: dialogOpen, onOpenChange: setDialogOpen, defaultScope: "user", canCreateOrgMcp: canCreateOrgMcp, hasOrg: hasOrg, onCreateMcpServer: onCreateMcpServer })] }) }));
168
168
  }
169
- function CopyField({ label, value }) {
169
+ export const AGENT_ACCESS_DOCS_HREF = {
170
+ mcp: "https://agent-native.com/docs/mcp-protocol",
171
+ a2a: "https://agent-native.com/docs/a2a-protocol",
172
+ };
173
+ function CopyField({ label, value, docsHref, docsLabel }) {
170
174
  const [copied, setCopied] = useState(false);
171
175
  const copy = async () => {
172
176
  try {
@@ -178,7 +182,7 @@ function CopyField({ label, value }) {
178
182
  setCopied(false);
179
183
  }
180
184
  };
181
- return (_jsxs("div", { className: "flex min-w-0 items-center gap-2 rounded-md border border-border bg-muted/20 p-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/70", children: label }), _jsx("code", { className: "mt-1 block truncate text-xs text-foreground", children: value })] }), _jsx("button", { type: "button", onClick: () => void copy(), className: "shrink-0 cursor-pointer rounded-md border border-border bg-background px-2.5 py-1.5 text-[11px] font-medium text-foreground hover:bg-accent", children: copied ? "Copied" : "Copy" })] }));
185
+ return (_jsxs("div", { className: "flex min-w-0 items-center gap-2 rounded-md border border-border bg-muted/20 p-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/70", children: [label, docsHref && (_jsx("a", { href: docsHref, target: "_blank", rel: "noopener noreferrer", "aria-label": docsLabel ?? `Open ${label} documentation`, title: docsLabel ?? `Open ${label} documentation`, className: "inline-flex size-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground", children: _jsx(IconHelpCircle, { className: "size-3" }) }))] }), _jsx("code", { className: "mt-1 block truncate text-xs text-foreground", children: value })] }), _jsx("button", { type: "button", onClick: () => void copy(), className: "shrink-0 cursor-pointer rounded-md border border-border bg-background px-2.5 py-1.5 text-[11px] font-medium text-foreground hover:bg-accent", children: copied ? "Copied" : "Copy" })] }));
182
186
  }
183
187
  function AccessTab({ appName: appNameProp, }) {
184
188
  const [urls, setUrls] = useState(null);
@@ -237,7 +241,7 @@ function AccessTab({ appName: appNameProp, }) {
237
241
  : null;
238
242
  const guide = MCP_CONNECT_GUIDES.find((item) => item.id === activeGuide) ??
239
243
  MCP_CONNECT_GUIDES[0];
240
- return (_jsx(AgentTabFrame, { title: "Access", description: "Choose which external clients can talk to this app's agent.", children: _jsx("div", { className: "space-y-6", children: urls ? (_jsxs(_Fragment, { children: [_jsx(CopyField, { label: "MCP URL", value: urls.mcpUrl }), agentCardAvailable && (_jsx(CopyField, { label: "A2A agent card", value: urls.agentCardUrl })), _jsxs("section", { className: "space-y-3 border-t border-border/70 pt-6", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold text-foreground", children: "Client setup" }), _jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: "These instructions are also available on the full connect page." })] }), _jsx("div", { className: "flex gap-1 overflow-x-auto border-b border-border pb-2", role: "tablist", "aria-label": "Choose your AI assistant", children: MCP_CONNECT_GUIDES.map((item) => (_jsx("button", { type: "button", role: "tab", "aria-selected": item.id === guide?.id, onClick: () => setActiveGuide(item.id), className: cn("shrink-0 cursor-pointer rounded-md px-2.5 py-1.5 text-xs font-medium", item.id === guide?.id
244
+ return (_jsx(AgentTabFrame, { title: "Access", description: "Choose which external clients can talk to this app's agent.", children: _jsx("div", { className: "space-y-6", children: urls ? (_jsxs(_Fragment, { children: [_jsx(CopyField, { label: "MCP URL", value: urls.mcpUrl, docsHref: AGENT_ACCESS_DOCS_HREF.mcp, docsLabel: "Open MCP documentation" }), agentCardAvailable && (_jsx(CopyField, { label: "A2A agent card", value: urls.agentCardUrl, docsHref: AGENT_ACCESS_DOCS_HREF.a2a, docsLabel: "Open A2A documentation" })), _jsxs("section", { className: "space-y-3 border-t border-border/70 pt-6", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold text-foreground", children: "Client setup" }), _jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: "These instructions are also available on the full connect page." })] }), _jsx("div", { className: "flex gap-1 overflow-x-auto border-b border-border pb-2", role: "tablist", "aria-label": "Choose your AI assistant", children: MCP_CONNECT_GUIDES.map((item) => (_jsx("button", { type: "button", role: "tab", "aria-selected": item.id === guide?.id, onClick: () => setActiveGuide(item.id), className: cn("shrink-0 cursor-pointer rounded-md px-2.5 py-1.5 text-xs font-medium", item.id === guide?.id
241
245
  ? "bg-accent text-foreground"
242
246
  : "text-muted-foreground hover:bg-accent/50 hover:text-foreground"), children: item.label }, item.id))) }), guide && templateValues && (_jsxs("div", { className: "space-y-3 pt-1", role: "tabpanel", children: [guide.steps?.length ? (_jsx("ol", { className: "list-decimal space-y-2 ps-5 text-xs leading-relaxed text-muted-foreground", children: guide.steps.map((step) => (_jsx("li", { children: interpolateMcpConnectTemplate(step, templateValues) }, step))) })) : null, guide.intro && (_jsx("p", { className: "text-xs text-muted-foreground", children: interpolateMcpConnectTemplate(guide.intro, templateValues) })), guide.commandTemplate && (_jsx(CopyField, { label: "Command", value: interpolateMcpConnectTemplate(guide.commandTemplate, templateValues) })), guide.configTemplate && (_jsx(CopyField, { label: "MCP config", value: interpolateMcpConnectTemplate(guide.configTemplate, templateValues) })), guide.action?.kind === "link" && guide.action.href && (_jsxs("a", { href: guide.action.href, target: "_blank", rel: "noopener noreferrer", className: "inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent", children: [guide.action.label, _jsx(IconExternalLink, { className: "size-3.5" })] })), guide.note && (_jsx("p", { className: "text-xs leading-relaxed text-muted-foreground", children: interpolateMcpConnectTemplate(guide.note, templateValues) }))] }))] }), _jsxs("section", { className: "border-t border-border/70 pt-6", children: [_jsx("h3", { className: "text-sm font-semibold text-foreground", children: MCP_STATIC_TOKEN_FALLBACK.title }), _jsxs("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: [MCP_STATIC_TOKEN_FALLBACK.state, ". Open the connect page to create a token for clients that cannot complete OAuth."] }), _jsxs("a", { href: urls.connectUrl, className: "mt-3 inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent", children: ["Open full connect page", _jsx(IconExternalLink, { className: "size-3.5" })] })] })] })) : (_jsx(TabLoading, {})) }) }));
243
247
  }