@agent-native/core 0.117.2 → 0.118.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 (524) hide show
  1. package/corpus/README.md +3 -3
  2. package/corpus/core/CHANGELOG.md +30 -0
  3. package/corpus/core/docs/content/custom-design-system.mdx +445 -0
  4. package/corpus/core/docs/content/toolkit-ui.mdx +16 -0
  5. package/corpus/core/package.json +1 -1
  6. package/corpus/core/src/a2a/types.ts +1 -0
  7. package/corpus/core/src/agent/types.ts +1 -1
  8. package/corpus/core/src/client/AgentPanel.tsx +90 -107
  9. package/corpus/core/src/client/AssistantChat.tsx +30 -13
  10. package/corpus/core/src/client/CommandMenu.tsx +68 -178
  11. package/corpus/core/src/client/agent-chat-adapter.ts +3 -1
  12. package/corpus/core/src/client/app-providers.tsx +1 -1
  13. package/corpus/core/src/client/chat/message-components.tsx +116 -10
  14. package/corpus/core/src/client/chat/tool-call-display.tsx +26 -5
  15. package/corpus/core/src/client/chat/widgets/InlineExtensionWidget.tsx +14 -40
  16. package/corpus/core/src/client/components/ui/message-scroller.tsx +15 -1
  17. package/corpus/core/src/client/i18n.tsx +22 -0
  18. package/corpus/core/src/client/index.ts +17 -0
  19. package/corpus/core/src/client/org/TeamPage.tsx +257 -153
  20. package/corpus/core/src/client/progress/RunsTray.tsx +89 -88
  21. package/corpus/core/src/client/resources/McpConnectionSuggestion.tsx +5 -2
  22. package/corpus/core/src/client/resources/McpIntegrationDialog.tsx +34 -13
  23. package/corpus/core/src/client/resources/mcp-integration-catalog.ts +13 -0
  24. package/corpus/core/src/client/settings/DemoModeSection.tsx +6 -18
  25. package/corpus/core/src/client/settings/SecretsSection.tsx +97 -52
  26. package/corpus/core/src/client/settings/SettingsPanel.tsx +202 -246
  27. package/corpus/core/src/client/settings/SettingsTabsPage.tsx +23 -2
  28. package/corpus/core/src/client/settings/VoiceTranscriptionSection.tsx +7 -18
  29. package/corpus/core/src/client/settings/index.ts +7 -0
  30. package/corpus/core/src/client/settings/useSettingsPanelController.ts +155 -0
  31. package/corpus/core/src/client/setup-connections/BuilderConnectCard.tsx +116 -51
  32. package/corpus/core/src/client/setup-connections/index.ts +10 -0
  33. package/corpus/core/src/client/setup-connections/useBuilderConnectCardController.ts +82 -0
  34. package/corpus/core/src/client/sharing/ShareButton.tsx +64 -586
  35. package/corpus/core/src/client/sharing/ShareDialog.tsx +299 -633
  36. package/corpus/core/src/client/sharing/index.ts +42 -0
  37. package/corpus/core/src/client/sharing/share-controller-helpers.ts +318 -0
  38. package/corpus/core/src/client/sharing/useShareButtonController.ts +600 -0
  39. package/corpus/core/src/client/sharing/useShareDialogController.ts +559 -0
  40. package/corpus/core/src/client/sse-event-processor.ts +23 -0
  41. package/corpus/core/src/client/tool-display.ts +71 -0
  42. package/corpus/core/src/client/use-agent-engine-configured.ts +12 -19
  43. package/corpus/core/src/client/use-chat-threads.ts +33 -12
  44. package/corpus/core/src/localization/default-messages.ts +5 -0
  45. package/corpus/core/src/mcp-client/oauth-routes.ts +16 -2
  46. package/corpus/core/src/scripts/call-agent.ts +5 -1
  47. package/corpus/core/src/server/realtime-voice.ts +1 -1
  48. package/corpus/core/src/styles/agent-native.css +0 -24
  49. package/corpus/core/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  50. package/corpus/core/src/templates/default/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  51. package/corpus/core/src/templates/default/.agents/skills/frontend-design/SKILL.md +22 -2
  52. package/corpus/core/src/templates/default/.agents/skills/shadcn-ui/SKILL.md +28 -4
  53. package/corpus/core/src/templates/default/app/components/ui/toolkit-provider.tsx +10 -0
  54. package/corpus/core/src/templates/default/app/design-system.ts +3 -0
  55. package/corpus/core/src/templates/default/app/root.tsx +5 -2
  56. package/corpus/core/src/templates/default/package.json +1 -0
  57. package/corpus/core/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  58. package/corpus/core/src/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  59. package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  60. package/corpus/core/src/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  61. package/corpus/core/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +22 -2
  62. package/corpus/core/src/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +28 -4
  63. package/corpus/core/src/vite/client.ts +39 -0
  64. package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  65. package/corpus/templates/analytics/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  66. package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +22 -2
  67. package/corpus/templates/analytics/.agents/skills/shadcn-ui/SKILL.md +28 -4
  68. package/corpus/templates/analytics/app/components/ui/toolkit-provider.tsx +6 -1
  69. package/corpus/templates/analytics/app/design-system.ts +3 -0
  70. package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  71. package/corpus/templates/assets/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  72. package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +22 -2
  73. package/corpus/templates/assets/.agents/skills/shadcn-ui/SKILL.md +28 -4
  74. package/corpus/templates/assets/app/components/ui/alert.tsx +1 -0
  75. package/corpus/templates/assets/app/components/ui/toolkit-provider.tsx +6 -1
  76. package/corpus/templates/assets/app/design-system.ts +3 -0
  77. package/corpus/templates/assets/app/routes/brand-kits.$id_.presets.$presetId.tsx +26 -30
  78. package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  79. package/corpus/templates/brain/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  80. package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +22 -2
  81. package/corpus/templates/brain/.agents/skills/shadcn-ui/SKILL.md +28 -4
  82. package/corpus/templates/brain/app/components/ui/dialog.tsx +1 -0
  83. package/corpus/templates/brain/app/components/ui/toolkit-provider.tsx +6 -1
  84. package/corpus/templates/brain/app/design-system.ts +3 -0
  85. package/corpus/templates/brain/app/routes/sources.tsx +8 -8
  86. package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  87. package/corpus/templates/calendar/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  88. package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +22 -2
  89. package/corpus/templates/calendar/.agents/skills/shadcn-ui/SKILL.md +28 -4
  90. package/corpus/templates/calendar/app/components/ui/toolkit-provider.tsx +6 -1
  91. package/corpus/templates/calendar/app/design-system.ts +3 -0
  92. package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  93. package/corpus/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  94. package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +22 -2
  95. package/corpus/templates/chat/.agents/skills/shadcn-ui/SKILL.md +28 -4
  96. package/corpus/templates/chat/app/components/ui/toolkit-provider.tsx +6 -1
  97. package/corpus/templates/chat/app/design-system.ts +3 -0
  98. package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  99. package/corpus/templates/clips/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  100. package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +22 -2
  101. package/corpus/templates/clips/.agents/skills/shadcn-ui/SKILL.md +28 -4
  102. package/corpus/templates/clips/app/components/ui/toolkit-provider.tsx +6 -1
  103. package/corpus/templates/clips/app/design-system.ts +3 -0
  104. package/corpus/templates/clips/app/routes/_app.library._index.tsx +1 -1
  105. package/corpus/templates/clips/changelog/2026-07-22-fixed-windows-recordings-aborting-during-the-countdown.md +6 -0
  106. package/corpus/templates/clips/changelog/2026-07-22-permissions-and-rewind-controls-are-now-grouped-with-clearer.md +6 -0
  107. package/corpus/templates/clips/changelog/2026-07-22-the-desktop-popover-opens-centered-under-the-menu-bar-icon-o.md +6 -0
  108. package/corpus/templates/clips/desktop/src/app.tsx +86 -82
  109. package/corpus/templates/clips/desktop/src/styles.css +13 -0
  110. package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +10 -1
  111. package/corpus/templates/clips/desktop/src-tauri/src/shortcuts.rs +37 -2
  112. package/corpus/templates/clips/desktop/src-tauri/src/tray.rs +18 -0
  113. package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  114. package/corpus/templates/content/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  115. package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +22 -2
  116. package/corpus/templates/content/.agents/skills/shadcn-ui/SKILL.md +28 -4
  117. package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +41 -59
  118. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +41 -41
  119. package/corpus/templates/content/app/components/editor/database/GalleryView.tsx +2 -1
  120. package/corpus/templates/content/app/components/editor/database/ListView.tsx +2 -1
  121. package/corpus/templates/content/app/components/editor/database/TimelineView.tsx +9 -9
  122. package/corpus/templates/content/app/components/editor/database/sidebar.tsx +7 -7
  123. package/corpus/templates/content/app/components/editor/database-sources/BuilderSourceReviewDialog.tsx +11 -11
  124. package/corpus/templates/content/app/components/ui/checkbox.tsx +1 -0
  125. package/corpus/templates/content/app/components/ui/collapsible.tsx +1 -0
  126. package/corpus/templates/content/app/components/ui/toolkit-provider.tsx +6 -1
  127. package/corpus/templates/content/app/design-system.ts +3 -0
  128. package/corpus/templates/content/app/global.css +29 -3
  129. package/corpus/templates/content/changelog/2026-07-22-page-actions-are-grouped-into-the-three-dots-menu-for-a-clea.md +6 -0
  130. package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  131. package/corpus/templates/crm/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  132. package/corpus/templates/crm/app/components/crm/CreateCrmRecordDialog.tsx +10 -10
  133. package/corpus/templates/crm/app/components/crm/CrmDashboardPanel.tsx +1 -6
  134. package/corpus/templates/crm/app/components/crm/CrmSignalsPanel.tsx +3 -2
  135. package/corpus/templates/crm/app/components/crm/IntelligenceSettings.tsx +13 -12
  136. package/corpus/templates/crm/app/components/crm/RecordActions.tsx +17 -17
  137. package/corpus/templates/crm/app/components/crm/RecordGrid.tsx +8 -8
  138. package/corpus/templates/crm/app/components/crm/RecordWorkspace.tsx +3 -8
  139. package/corpus/templates/crm/app/components/crm/SavedViewDataProgram.tsx +2 -1
  140. package/corpus/templates/crm/app/components/crm/Surface.tsx +3 -2
  141. package/corpus/templates/crm/app/components/crm/WorkOverview.tsx +2 -2
  142. package/corpus/templates/crm/app/components/layout/CrmLayout.tsx +7 -7
  143. package/corpus/templates/crm/app/components/layout/CrmSidebar.tsx +1 -1
  144. package/corpus/templates/crm/app/components/ui/alert-dialog.tsx +1 -0
  145. package/corpus/templates/crm/app/components/ui/badge.tsx +1 -0
  146. package/corpus/templates/crm/app/components/ui/button.tsx +1 -0
  147. package/corpus/templates/crm/app/components/ui/card.tsx +1 -0
  148. package/corpus/templates/crm/app/components/ui/dialog.tsx +1 -0
  149. package/corpus/templates/crm/app/components/ui/input.tsx +1 -0
  150. package/corpus/templates/crm/app/components/ui/label.tsx +1 -0
  151. package/corpus/templates/crm/app/components/ui/select.tsx +1 -0
  152. package/corpus/templates/crm/app/components/ui/sheet.tsx +1 -0
  153. package/corpus/templates/crm/app/components/ui/skeleton.tsx +1 -0
  154. package/corpus/templates/crm/app/components/ui/switch.tsx +1 -0
  155. package/corpus/templates/crm/app/components/ui/table.tsx +1 -0
  156. package/corpus/templates/crm/app/components/ui/tabs.tsx +1 -0
  157. package/corpus/templates/crm/app/components/ui/textarea.tsx +1 -0
  158. package/corpus/templates/crm/app/components/ui/toolkit-provider.tsx +17 -0
  159. package/corpus/templates/crm/app/design-system.ts +3 -0
  160. package/corpus/templates/crm/app/root.tsx +9 -6
  161. package/corpus/templates/crm/app/routes/dashboard.tsx +1 -1
  162. package/corpus/templates/crm/app/routes/proposals.tsx +13 -13
  163. package/corpus/templates/crm/app/routes/setup.tsx +9 -9
  164. package/corpus/templates/crm/app/routes/tasks.tsx +14 -14
  165. package/corpus/templates/crm/app/routes/views.tsx +16 -16
  166. package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  167. package/corpus/templates/design/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  168. package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +22 -2
  169. package/corpus/templates/design/.agents/skills/shadcn-ui/SKILL.md +28 -4
  170. package/corpus/templates/design/app/components/editor/PromptDialog.tsx +8 -8
  171. package/corpus/templates/design/app/components/ui/command.tsx +1 -0
  172. package/corpus/templates/design/app/components/ui/toolkit-provider.tsx +6 -1
  173. package/corpus/templates/design/app/design-system.ts +3 -0
  174. package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  175. package/corpus/templates/dispatch/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  176. package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +22 -2
  177. package/corpus/templates/dispatch/.agents/skills/shadcn-ui/SKILL.md +28 -4
  178. package/corpus/templates/dispatch/app/components/ui/button.tsx +1 -0
  179. package/corpus/templates/dispatch/app/components/ui/toolkit-provider.tsx +17 -0
  180. package/corpus/templates/dispatch/app/design-system.ts +3 -0
  181. package/corpus/templates/dispatch/app/root.tsx +10 -7
  182. package/corpus/templates/dispatch/package.json +1 -0
  183. package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  184. package/corpus/templates/forms/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  185. package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +22 -2
  186. package/corpus/templates/forms/.agents/skills/shadcn-ui/SKILL.md +28 -4
  187. package/corpus/templates/forms/app/components/ui/toolkit-provider.tsx +6 -1
  188. package/corpus/templates/forms/app/design-system.ts +3 -0
  189. package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  190. package/corpus/templates/macros/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  191. package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +22 -2
  192. package/corpus/templates/macros/.agents/skills/shadcn-ui/SKILL.md +28 -4
  193. package/corpus/templates/macros/app/components/ui/toolkit-provider.tsx +6 -1
  194. package/corpus/templates/macros/app/design-system.ts +3 -0
  195. package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  196. package/corpus/templates/mail/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  197. package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +22 -2
  198. package/corpus/templates/mail/.agents/skills/shadcn-ui/SKILL.md +28 -4
  199. package/corpus/templates/mail/app/components/email/EmailThread.tsx +134 -93
  200. package/corpus/templates/mail/app/components/email/email-iframe-document.ts +8 -2
  201. package/corpus/templates/mail/app/components/ui/textarea.tsx +1 -21
  202. package/corpus/templates/mail/app/components/ui/toolkit-provider.tsx +6 -1
  203. package/corpus/templates/mail/app/design-system.ts +3 -0
  204. package/corpus/templates/mail/changelog/2026-07-22-email-messages-no-longer-flash-with-an-unstyled-page-while-l.md +6 -0
  205. package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  206. package/corpus/templates/plan/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  207. package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +22 -2
  208. package/corpus/templates/plan/.agents/skills/shadcn-ui/SKILL.md +28 -4
  209. package/corpus/templates/plan/app/components/plan/PlanContentRenderer.tsx +1 -1
  210. package/corpus/templates/plan/app/components/ui/toolkit-provider.tsx +6 -1
  211. package/corpus/templates/plan/app/design-system.ts +3 -0
  212. package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  213. package/corpus/templates/slides/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  214. package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +22 -2
  215. package/corpus/templates/slides/.agents/skills/shadcn-ui/SKILL.md +28 -4
  216. package/corpus/templates/slides/app/components/ui/toolkit-provider.tsx +6 -1
  217. package/corpus/templates/slides/app/design-system.ts +3 -0
  218. package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  219. package/corpus/templates/tasks/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  220. package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +22 -2
  221. package/corpus/templates/tasks/.agents/skills/shadcn-ui/SKILL.md +28 -4
  222. package/corpus/templates/tasks/app/components/ui/toolkit-provider.tsx +17 -0
  223. package/corpus/templates/tasks/app/design-system.ts +3 -0
  224. package/corpus/templates/tasks/app/root.tsx +5 -2
  225. package/corpus/toolkit/CHANGELOG.md +14 -0
  226. package/corpus/toolkit/agent-native.eject.json +71 -0
  227. package/corpus/toolkit/package.json +31 -1
  228. package/corpus/toolkit/src/chat-history/ChatHistoryRail.tsx +100 -39
  229. package/corpus/toolkit/src/chat-history/index.ts +9 -0
  230. package/corpus/toolkit/src/chat-history/useChatHistoryRailController.ts +76 -0
  231. package/corpus/toolkit/src/chat-history.css +2 -0
  232. package/corpus/toolkit/src/composer/ComposerPlusMenu.tsx +11 -8
  233. package/corpus/toolkit/src/composer/PromptComposer.tsx +27 -6
  234. package/corpus/toolkit/src/composer/useRealtimeVoiceMode.tsx +107 -22
  235. package/corpus/toolkit/src/conformance/__fixtures__/css-in-js-adapter.tsx +401 -0
  236. package/corpus/toolkit/src/conformance/index.ts +3 -0
  237. package/corpus/toolkit/src/conformance/runner.tsx +710 -0
  238. package/corpus/toolkit/src/conformance/types.ts +45 -0
  239. package/corpus/toolkit/src/conformance/version.ts +22 -0
  240. package/corpus/toolkit/src/design-system/components.tsx +146 -0
  241. package/corpus/toolkit/src/design-system/context.tsx +31 -0
  242. package/corpus/toolkit/src/design-system/default-adapter.tsx +915 -0
  243. package/corpus/toolkit/src/design-system/definition.ts +14 -0
  244. package/corpus/toolkit/src/design-system/error-boundary.tsx +37 -0
  245. package/corpus/toolkit/src/design-system/index.ts +7 -0
  246. package/corpus/toolkit/src/design-system/theme.ts +145 -0
  247. package/corpus/toolkit/src/design-system/types.ts +363 -0
  248. package/corpus/toolkit/src/provider.tsx +98 -5
  249. package/corpus/toolkit/src/ui/button.tsx +95 -6
  250. package/corpus/toolkit/src/ui/dialog.tsx +48 -23
  251. package/corpus/toolkit/src/ui/popover.tsx +16 -2
  252. package/corpus/toolkit/src/ui/select.tsx +7 -3
  253. package/corpus/toolkit/src/ui/sidebar.tsx +47 -48
  254. package/corpus/toolkit/src/ui/tooltip.tsx +7 -3
  255. package/dist/a2a/types.d.ts +1 -1
  256. package/dist/a2a/types.d.ts.map +1 -1
  257. package/dist/a2a/types.js.map +1 -1
  258. package/dist/agent/types.d.ts +1 -1
  259. package/dist/agent/types.d.ts.map +1 -1
  260. package/dist/agent/types.js.map +1 -1
  261. package/dist/client/AgentPanel.d.ts.map +1 -1
  262. package/dist/client/AgentPanel.js +14 -14
  263. package/dist/client/AgentPanel.js.map +1 -1
  264. package/dist/client/AssistantChat.d.ts.map +1 -1
  265. package/dist/client/AssistantChat.js +26 -15
  266. package/dist/client/AssistantChat.js.map +1 -1
  267. package/dist/client/CommandMenu.d.ts.map +1 -1
  268. package/dist/client/CommandMenu.js +18 -106
  269. package/dist/client/CommandMenu.js.map +1 -1
  270. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  271. package/dist/client/agent-chat-adapter.js +2 -1
  272. package/dist/client/agent-chat-adapter.js.map +1 -1
  273. package/dist/client/app-providers.d.ts.map +1 -1
  274. package/dist/client/app-providers.js +1 -1
  275. package/dist/client/app-providers.js.map +1 -1
  276. package/dist/client/chat/message-components.d.ts +9 -1
  277. package/dist/client/chat/message-components.d.ts.map +1 -1
  278. package/dist/client/chat/message-components.js +62 -7
  279. package/dist/client/chat/message-components.js.map +1 -1
  280. package/dist/client/chat/tool-call-display.d.ts.map +1 -1
  281. package/dist/client/chat/tool-call-display.js +20 -5
  282. package/dist/client/chat/tool-call-display.js.map +1 -1
  283. package/dist/client/chat/widgets/InlineExtensionWidget.d.ts.map +1 -1
  284. package/dist/client/chat/widgets/InlineExtensionWidget.js +9 -12
  285. package/dist/client/chat/widgets/InlineExtensionWidget.js.map +1 -1
  286. package/dist/client/components/ui/message-scroller.d.ts +1 -1
  287. package/dist/client/components/ui/message-scroller.d.ts.map +1 -1
  288. package/dist/client/components/ui/message-scroller.js +4 -3
  289. package/dist/client/components/ui/message-scroller.js.map +1 -1
  290. package/dist/client/i18n.d.ts.map +1 -1
  291. package/dist/client/i18n.js +9 -0
  292. package/dist/client/i18n.js.map +1 -1
  293. package/dist/client/index.d.ts +2 -2
  294. package/dist/client/index.d.ts.map +1 -1
  295. package/dist/client/index.js +2 -2
  296. package/dist/client/index.js.map +1 -1
  297. package/dist/client/org/TeamPage.d.ts.map +1 -1
  298. package/dist/client/org/TeamPage.js +41 -33
  299. package/dist/client/org/TeamPage.js.map +1 -1
  300. package/dist/client/progress/RunsTray.d.ts.map +1 -1
  301. package/dist/client/progress/RunsTray.js +9 -10
  302. package/dist/client/progress/RunsTray.js.map +1 -1
  303. package/dist/client/resources/McpConnectionSuggestion.d.ts.map +1 -1
  304. package/dist/client/resources/McpConnectionSuggestion.js +5 -4
  305. package/dist/client/resources/McpConnectionSuggestion.js.map +1 -1
  306. package/dist/client/resources/McpIntegrationDialog.d.ts.map +1 -1
  307. package/dist/client/resources/McpIntegrationDialog.js +10 -8
  308. package/dist/client/resources/McpIntegrationDialog.js.map +1 -1
  309. package/dist/client/resources/mcp-integration-catalog.d.ts +1 -0
  310. package/dist/client/resources/mcp-integration-catalog.d.ts.map +1 -1
  311. package/dist/client/resources/mcp-integration-catalog.js +13 -0
  312. package/dist/client/resources/mcp-integration-catalog.js.map +1 -1
  313. package/dist/client/settings/DemoModeSection.d.ts.map +1 -1
  314. package/dist/client/settings/DemoModeSection.js +2 -5
  315. package/dist/client/settings/DemoModeSection.js.map +1 -1
  316. package/dist/client/settings/SecretsSection.d.ts.map +1 -1
  317. package/dist/client/settings/SecretsSection.js +18 -6
  318. package/dist/client/settings/SecretsSection.js.map +1 -1
  319. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  320. package/dist/client/settings/SettingsPanel.js +52 -117
  321. package/dist/client/settings/SettingsPanel.js.map +1 -1
  322. package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
  323. package/dist/client/settings/SettingsTabsPage.js +16 -1
  324. package/dist/client/settings/SettingsTabsPage.js.map +1 -1
  325. package/dist/client/settings/VoiceTranscriptionSection.d.ts.map +1 -1
  326. package/dist/client/settings/VoiceTranscriptionSection.js +2 -5
  327. package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
  328. package/dist/client/settings/index.d.ts +1 -0
  329. package/dist/client/settings/index.d.ts.map +1 -1
  330. package/dist/client/settings/index.js +1 -0
  331. package/dist/client/settings/index.js.map +1 -1
  332. package/dist/client/settings/useSettingsPanelController.d.ts +22 -0
  333. package/dist/client/settings/useSettingsPanelController.d.ts.map +1 -0
  334. package/dist/client/settings/useSettingsPanelController.js +103 -0
  335. package/dist/client/settings/useSettingsPanelController.js.map +1 -0
  336. package/dist/client/setup-connections/BuilderConnectCard.d.ts +14 -6
  337. package/dist/client/setup-connections/BuilderConnectCard.d.ts.map +1 -1
  338. package/dist/client/setup-connections/BuilderConnectCard.js +24 -16
  339. package/dist/client/setup-connections/BuilderConnectCard.js.map +1 -1
  340. package/dist/client/setup-connections/index.d.ts +2 -1
  341. package/dist/client/setup-connections/index.d.ts.map +1 -1
  342. package/dist/client/setup-connections/index.js +2 -1
  343. package/dist/client/setup-connections/index.js.map +1 -1
  344. package/dist/client/setup-connections/useBuilderConnectCardController.d.ts +34 -0
  345. package/dist/client/setup-connections/useBuilderConnectCardController.d.ts.map +1 -0
  346. package/dist/client/setup-connections/useBuilderConnectCardController.js +39 -0
  347. package/dist/client/setup-connections/useBuilderConnectCardController.js.map +1 -0
  348. package/dist/client/sharing/ShareButton.d.ts +2 -1
  349. package/dist/client/sharing/ShareButton.d.ts.map +1 -1
  350. package/dist/client/sharing/ShareButton.js +17 -463
  351. package/dist/client/sharing/ShareButton.js.map +1 -1
  352. package/dist/client/sharing/ShareDialog.d.ts +6 -6
  353. package/dist/client/sharing/ShareDialog.d.ts.map +1 -1
  354. package/dist/client/sharing/ShareDialog.js +69 -283
  355. package/dist/client/sharing/ShareDialog.js.map +1 -1
  356. package/dist/client/sharing/index.d.ts +3 -0
  357. package/dist/client/sharing/index.d.ts.map +1 -1
  358. package/dist/client/sharing/index.js +3 -0
  359. package/dist/client/sharing/index.js.map +1 -1
  360. package/dist/client/sharing/share-controller-helpers.d.ts +70 -0
  361. package/dist/client/sharing/share-controller-helpers.d.ts.map +1 -0
  362. package/dist/client/sharing/share-controller-helpers.js +224 -0
  363. package/dist/client/sharing/share-controller-helpers.js.map +1 -0
  364. package/dist/client/sharing/useShareButtonController.d.ts +91 -0
  365. package/dist/client/sharing/useShareButtonController.d.ts.map +1 -0
  366. package/dist/client/sharing/useShareButtonController.js +397 -0
  367. package/dist/client/sharing/useShareButtonController.js.map +1 -0
  368. package/dist/client/sharing/useShareDialogController.d.ts +109 -0
  369. package/dist/client/sharing/useShareDialogController.d.ts.map +1 -0
  370. package/dist/client/sharing/useShareDialogController.js +348 -0
  371. package/dist/client/sharing/useShareDialogController.js.map +1 -0
  372. package/dist/client/sse-event-processor.d.ts.map +1 -1
  373. package/dist/client/sse-event-processor.js +21 -0
  374. package/dist/client/sse-event-processor.js.map +1 -1
  375. package/dist/client/tool-display.d.ts +16 -0
  376. package/dist/client/tool-display.d.ts.map +1 -1
  377. package/dist/client/tool-display.js +52 -0
  378. package/dist/client/tool-display.js.map +1 -1
  379. package/dist/client/use-agent-engine-configured.d.ts +3 -2
  380. package/dist/client/use-agent-engine-configured.d.ts.map +1 -1
  381. package/dist/client/use-agent-engine-configured.js +7 -19
  382. package/dist/client/use-agent-engine-configured.js.map +1 -1
  383. package/dist/client/use-chat-threads.d.ts.map +1 -1
  384. package/dist/client/use-chat-threads.js +21 -8
  385. package/dist/client/use-chat-threads.js.map +1 -1
  386. package/dist/localization/default-messages.d.ts +4 -0
  387. package/dist/localization/default-messages.d.ts.map +1 -1
  388. package/dist/localization/default-messages.js +4 -0
  389. package/dist/localization/default-messages.js.map +1 -1
  390. package/dist/mcp-client/oauth-routes.d.ts +2 -0
  391. package/dist/mcp-client/oauth-routes.d.ts.map +1 -1
  392. package/dist/mcp-client/oauth-routes.js +12 -2
  393. package/dist/mcp-client/oauth-routes.js.map +1 -1
  394. package/dist/observability/routes.d.ts +3 -3
  395. package/dist/provider-api/actions/custom-provider-registration.d.ts +4 -4
  396. package/dist/scripts/call-agent.d.ts.map +1 -1
  397. package/dist/scripts/call-agent.js +5 -1
  398. package/dist/scripts/call-agent.js.map +1 -1
  399. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  400. package/dist/server/realtime-voice.js +1 -1
  401. package/dist/server/realtime-voice.js.map +1 -1
  402. package/dist/server/transcribe-voice.d.ts +1 -1
  403. package/dist/styles/agent-native.css +0 -24
  404. package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  405. package/dist/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  406. package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +22 -2
  407. package/dist/templates/chat/.agents/skills/shadcn-ui/SKILL.md +28 -4
  408. package/dist/templates/chat/app/components/ui/toolkit-provider.tsx +6 -1
  409. package/dist/templates/chat/app/design-system.ts +3 -0
  410. package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  411. package/dist/templates/default/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  412. package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +22 -2
  413. package/dist/templates/default/.agents/skills/shadcn-ui/SKILL.md +28 -4
  414. package/dist/templates/default/app/components/ui/toolkit-provider.tsx +10 -0
  415. package/dist/templates/default/app/design-system.ts +3 -0
  416. package/dist/templates/default/app/root.tsx +5 -2
  417. package/dist/templates/default/package.json +1 -0
  418. package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  419. package/dist/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  420. package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  421. package/dist/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  422. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +22 -2
  423. package/dist/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +28 -4
  424. package/dist/vite/client.d.ts +3 -0
  425. package/dist/vite/client.d.ts.map +1 -1
  426. package/dist/vite/client.js +31 -0
  427. package/dist/vite/client.js.map +1 -1
  428. package/docs/content/custom-design-system.mdx +445 -0
  429. package/docs/content/toolkit-ui.mdx +16 -0
  430. package/package.json +2 -2
  431. package/src/a2a/types.ts +1 -0
  432. package/src/agent/types.ts +1 -1
  433. package/src/client/AgentPanel.tsx +90 -107
  434. package/src/client/AssistantChat.tsx +30 -13
  435. package/src/client/CommandMenu.tsx +68 -178
  436. package/src/client/agent-chat-adapter.ts +3 -1
  437. package/src/client/app-providers.tsx +1 -1
  438. package/src/client/chat/message-components.tsx +116 -10
  439. package/src/client/chat/tool-call-display.tsx +26 -5
  440. package/src/client/chat/widgets/InlineExtensionWidget.tsx +14 -40
  441. package/src/client/components/ui/message-scroller.tsx +15 -1
  442. package/src/client/i18n.tsx +22 -0
  443. package/src/client/index.ts +17 -0
  444. package/src/client/org/TeamPage.tsx +257 -153
  445. package/src/client/progress/RunsTray.tsx +89 -88
  446. package/src/client/resources/McpConnectionSuggestion.tsx +5 -2
  447. package/src/client/resources/McpIntegrationDialog.tsx +34 -13
  448. package/src/client/resources/mcp-integration-catalog.ts +13 -0
  449. package/src/client/settings/DemoModeSection.tsx +6 -18
  450. package/src/client/settings/SecretsSection.tsx +97 -52
  451. package/src/client/settings/SettingsPanel.tsx +202 -246
  452. package/src/client/settings/SettingsTabsPage.tsx +23 -2
  453. package/src/client/settings/VoiceTranscriptionSection.tsx +7 -18
  454. package/src/client/settings/index.ts +7 -0
  455. package/src/client/settings/useSettingsPanelController.ts +155 -0
  456. package/src/client/setup-connections/BuilderConnectCard.tsx +116 -51
  457. package/src/client/setup-connections/index.ts +10 -0
  458. package/src/client/setup-connections/useBuilderConnectCardController.ts +82 -0
  459. package/src/client/sharing/ShareButton.tsx +64 -586
  460. package/src/client/sharing/ShareDialog.tsx +299 -633
  461. package/src/client/sharing/index.ts +42 -0
  462. package/src/client/sharing/share-controller-helpers.ts +318 -0
  463. package/src/client/sharing/useShareButtonController.ts +600 -0
  464. package/src/client/sharing/useShareDialogController.ts +559 -0
  465. package/src/client/sse-event-processor.ts +23 -0
  466. package/src/client/tool-display.ts +71 -0
  467. package/src/client/use-agent-engine-configured.ts +12 -19
  468. package/src/client/use-chat-threads.ts +33 -12
  469. package/src/localization/default-messages.ts +5 -0
  470. package/src/mcp-client/oauth-routes.ts +16 -2
  471. package/src/scripts/call-agent.ts +5 -1
  472. package/src/server/realtime-voice.ts +1 -1
  473. package/src/styles/agent-native.css +0 -24
  474. package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  475. package/src/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  476. package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +22 -2
  477. package/src/templates/chat/.agents/skills/shadcn-ui/SKILL.md +28 -4
  478. package/src/templates/chat/app/components/ui/toolkit-provider.tsx +6 -1
  479. package/src/templates/chat/app/design-system.ts +3 -0
  480. package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  481. package/src/templates/default/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  482. package/src/templates/default/.agents/skills/frontend-design/SKILL.md +22 -2
  483. package/src/templates/default/.agents/skills/shadcn-ui/SKILL.md +28 -4
  484. package/src/templates/default/app/components/ui/toolkit-provider.tsx +10 -0
  485. package/src/templates/default/app/design-system.ts +3 -0
  486. package/src/templates/default/app/root.tsx +5 -2
  487. package/src/templates/default/package.json +1 -0
  488. package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  489. package/src/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  490. package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +37 -2
  491. package/src/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +86 -11
  492. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +22 -2
  493. package/src/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +28 -4
  494. package/src/vite/client.ts +39 -0
  495. package/corpus/templates/analytics/app/components/ui/calendar.tsx +0 -70
  496. package/corpus/templates/analytics/app/components/ui/chart.tsx +0 -386
  497. package/corpus/templates/calendar/app/components/ui/sonner.tsx +0 -58
  498. package/corpus/templates/forms/app/components/ui/calendar.tsx +0 -214
  499. package/corpus/templates/forms/app/components/ui/chart.tsx +0 -379
  500. package/corpus/templates/forms/app/components/ui/command.tsx +0 -153
  501. package/corpus/templates/forms/app/components/ui/context-menu.tsx +0 -198
  502. package/corpus/templates/forms/app/components/ui/menubar.tsx +0 -254
  503. package/corpus/templates/macros/app/components/ui/menubar.tsx +0 -238
  504. package/corpus/templates/macros/app/components/ui/progress.tsx +0 -26
  505. package/corpus/templates/mail/app/components/ui/calendar.tsx +0 -211
  506. package/corpus/templates/mail/app/components/ui/chart.tsx +0 -379
  507. package/corpus/templates/mail/app/components/ui/command.tsx +0 -153
  508. package/corpus/templates/mail/app/components/ui/context-menu.tsx +0 -198
  509. package/corpus/templates/mail/app/components/ui/menubar.tsx +0 -254
  510. package/corpus/templates/tasks/app/components/ui/accordion.tsx +0 -56
  511. package/corpus/templates/tasks/app/components/ui/aspect-ratio.tsx +0 -5
  512. package/corpus/templates/tasks/app/components/ui/breadcrumb.tsx +0 -115
  513. package/corpus/templates/tasks/app/components/ui/calendar.tsx +0 -70
  514. package/corpus/templates/tasks/app/components/ui/carousel.tsx +0 -260
  515. package/corpus/templates/tasks/app/components/ui/chart.tsx +0 -379
  516. package/corpus/templates/tasks/app/components/ui/form.tsx +0 -177
  517. package/corpus/templates/tasks/app/components/ui/hover-card.tsx +0 -27
  518. package/corpus/templates/tasks/app/components/ui/input-otp.tsx +0 -69
  519. package/corpus/templates/tasks/app/components/ui/menubar.tsx +0 -254
  520. package/corpus/templates/tasks/app/components/ui/navigation-menu.tsx +0 -128
  521. package/corpus/templates/tasks/app/components/ui/pagination.tsx +0 -121
  522. package/corpus/templates/tasks/app/components/ui/resizable.tsx +0 -43
  523. package/corpus/templates/tasks/app/components/ui/sidebar.tsx +0 -782
  524. package/corpus/templates/tasks/app/components/ui/toggle.tsx +0 -43
@@ -1,15 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /** Browser-local presentation toggle. Backend and agent results stay real. */
3
+ import { Switch } from "@agent-native/toolkit/design-system";
3
4
  import { IconEyeOff } from "@tabler/icons-react";
4
5
  import { setBrowserDemoModeEnabled } from "../../demo/browser-state.js";
5
6
  import { useDemoModeStatus } from "../use-demo-mode-status.js";
6
7
  export function DemoModeSection() {
7
8
  const { enabled } = useDemoModeStatus();
8
- return (_jsxs("div", { className: "flex items-start justify-between gap-3 rounded-md border border-border bg-accent/30 px-2.5 py-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "text-[11px] font-medium text-foreground", children: "Enable demo mode" }), _jsx("p", { className: "text-[10px] text-muted-foreground mt-0.5", children: "Anonymize displayed emails in this browser and reshape supported dashboard charts for presentations. Backend, MCP, and agent results stay real and access-scoped." })] }), _jsx("button", { type: "button", role: "switch", "aria-checked": enabled, "aria-label": "Enable demo mode", onClick: () => setBrowserDemoModeEnabled(!enabled),
9
- // Theme tokens; streaming agent owns layout.
10
- className: `relative inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full transition-colors ${enabled
11
- ? "bg-primary"
12
- : "bg-muted-foreground/30 hover:bg-muted-foreground/50"}`, children: _jsx("span", { className: `inline-block h-3 w-3 transform rounded-full bg-background transition-transform ${enabled ? "translate-x-3.5" : "translate-x-0.5"}` }) })] }));
9
+ return (_jsxs("div", { className: "flex items-start justify-between gap-3 rounded-md border border-border bg-accent/30 px-2.5 py-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "text-[11px] font-medium text-foreground", children: "Enable demo mode" }), _jsx("p", { className: "text-[10px] text-muted-foreground mt-0.5", children: "Anonymize displayed emails in this browser and reshape supported dashboard charts for presentations. Backend, MCP, and agent results stay real and access-scoped." })] }), _jsx(Switch, { checked: enabled, onChange: (checked) => setBrowserDemoModeEnabled(checked), "aria-label": "Enable demo mode", className: "shrink-0" })] }));
13
10
  }
14
11
  export function DemoModeIcon() {
15
12
  return _jsx(IconEyeOff, { size: 14 });
@@ -1 +1 @@
1
- {"version":3,"file":"DemoModeSection.js","sourceRoot":"","sources":["../../../src/client/settings/DemoModeSection.tsx"],"names":[],"mappings":";AAAA,8EAA8E;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,UAAU,eAAe;IAC7B,MAAM,EAAE,OAAO,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAExC,OAAO,CACL,eAAK,SAAS,EAAC,iGAAiG,aAC9G,eAAK,SAAS,EAAC,SAAS,aACtB,cAAK,SAAS,EAAC,yCAAyC,iCAElD,EACN,YAAG,SAAS,EAAC,0CAA0C,kLAInD,IACA,EACN,iBACE,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,QAAQ,kBACC,OAAO,gBACV,kBAAkB,EAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAAC;gBAClD,6CAA6C;gBAC7C,SAAS,EAAE,oGACT,OAAO;oBACL,CAAC,CAAC,YAAY;oBACd,CAAC,CAAC,qDACN,EAAE,YAEF,eACE,SAAS,EAAE,kFACT,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,iBAChC,EAAE,GACF,GACK,IACL,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,KAAC,UAAU,IAAC,IAAI,EAAE,EAAE,GAAI,CAAC;AAClC,CAAC","sourcesContent":["/** Browser-local presentation toggle. Backend and agent results stay real. */\n\nimport { IconEyeOff } from \"@tabler/icons-react\";\n\nimport { setBrowserDemoModeEnabled } from \"../../demo/browser-state.js\";\nimport { useDemoModeStatus } from \"../use-demo-mode-status.js\";\n\nexport function DemoModeSection() {\n const { enabled } = useDemoModeStatus();\n\n return (\n <div className=\"flex items-start justify-between gap-3 rounded-md border border-border bg-accent/30 px-2.5 py-2\">\n <div className=\"min-w-0\">\n <div className=\"text-[11px] font-medium text-foreground\">\n Enable demo mode\n </div>\n <p className=\"text-[10px] text-muted-foreground mt-0.5\">\n Anonymize displayed emails in this browser and reshape supported\n dashboard charts for presentations. Backend, MCP, and agent results\n stay real and access-scoped.\n </p>\n </div>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={enabled}\n aria-label=\"Enable demo mode\"\n onClick={() => setBrowserDemoModeEnabled(!enabled)}\n // Theme tokens; streaming agent owns layout.\n className={`relative inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full transition-colors ${\n enabled\n ? \"bg-primary\"\n : \"bg-muted-foreground/30 hover:bg-muted-foreground/50\"\n }`}\n >\n <span\n className={`inline-block h-3 w-3 transform rounded-full bg-background transition-transform ${\n enabled ? \"translate-x-3.5\" : \"translate-x-0.5\"\n }`}\n />\n </button>\n </div>\n );\n}\n\nexport function DemoModeIcon() {\n return <IconEyeOff size={14} />;\n}\n"]}
1
+ {"version":3,"file":"DemoModeSection.js","sourceRoot":"","sources":["../../../src/client/settings/DemoModeSection.tsx"],"names":[],"mappings":";AAAA,8EAA8E;AAE9E,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,UAAU,eAAe;IAC7B,MAAM,EAAE,OAAO,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAExC,OAAO,CACL,eAAK,SAAS,EAAC,iGAAiG,aAC9G,eAAK,SAAS,EAAC,SAAS,aACtB,cAAK,SAAS,EAAC,yCAAyC,iCAElD,EACN,YAAG,SAAS,EAAC,0CAA0C,kLAInD,IACA,EACN,KAAC,MAAM,IACL,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,yBAAyB,CAAC,OAAO,CAAC,gBAC9C,kBAAkB,EAC7B,SAAS,EAAC,UAAU,GACpB,IACE,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,KAAC,UAAU,IAAC,IAAI,EAAE,EAAE,GAAI,CAAC;AAClC,CAAC","sourcesContent":["/** Browser-local presentation toggle. Backend and agent results stay real. */\n\nimport { Switch } from \"@agent-native/toolkit/design-system\";\nimport { IconEyeOff } from \"@tabler/icons-react\";\n\nimport { setBrowserDemoModeEnabled } from \"../../demo/browser-state.js\";\nimport { useDemoModeStatus } from \"../use-demo-mode-status.js\";\n\nexport function DemoModeSection() {\n const { enabled } = useDemoModeStatus();\n\n return (\n <div className=\"flex items-start justify-between gap-3 rounded-md border border-border bg-accent/30 px-2.5 py-2\">\n <div className=\"min-w-0\">\n <div className=\"text-[11px] font-medium text-foreground\">\n Enable demo mode\n </div>\n <p className=\"text-[10px] text-muted-foreground mt-0.5\">\n Anonymize displayed emails in this browser and reshape supported\n dashboard charts for presentations. Backend, MCP, and agent results\n stay real and access-scoped.\n </p>\n </div>\n <Switch\n checked={enabled}\n onChange={(checked) => setBrowserDemoModeEnabled(checked)}\n aria-label=\"Enable demo mode\"\n className=\"shrink-0\"\n />\n </div>\n );\n}\n\nexport function DemoModeIcon() {\n return <IconEyeOff size={14} />;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SecretsSection.d.ts","sourceRoot":"","sources":["../../../src/client/settings/SecretsSection.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,KAAoD,MAAM,OAAO,CAAC;AA4CzE,MAAM,WAAW,mBAAmB;IAClC,yFAAyF;IACzF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,mBAAmB,qBA8G/D"}
1
+ {"version":3,"file":"SecretsSection.d.ts","sourceRoot":"","sources":["../../../src/client/settings/SecretsSection.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH,OAAO,KAAoD,MAAM,OAAO,CAAC;AA6DzE,MAAM,WAAW,mBAAmB;IAClC,yFAAyF;IACzF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,mBAAmB,qBA8G/D"}
@@ -4,11 +4,16 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
4
4
  * secrets registry. Configured keys stay compact; adding or editing one
5
5
  * progressively discloses its controls.
6
6
  */
7
+ import { Picker, TextField } from "@agent-native/toolkit/design-system";
8
+ import { Button as ToolkitButton } from "@agent-native/toolkit/ui/button";
7
9
  import { IconCheck, IconChevronRight, IconExternalLink, IconLoader2, IconPlugConnected, IconPlus, IconTrash, IconRefresh, } from "@tabler/icons-react";
8
10
  import React, { useEffect, useMemo, useState, useCallback } from "react";
9
11
  import { agentNativePath } from "../api-path.js";
10
12
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "../components/ui/dropdown-menu.js";
11
13
  import { Tooltip, TooltipContent, TooltipTrigger, } from "../components/ui/tooltip.js";
14
+ import { cn } from "../utils.js";
15
+ const Button = React.forwardRef(({ className, ...props }, ref) => (_jsx(ToolkitButton, { ref: ref, variant: "ghost", className: cn("h-auto p-0 hover:bg-transparent hover:text-inherit active:scale-100 [&_svg]:!size-auto", className), ...props })));
16
+ Button.displayName = "SecretsPrimitiveButton";
12
17
  const ENDPOINT = agentNativePath("/_agent-native/secrets");
13
18
  function notifySecretsChanged() {
14
19
  if (typeof window === "undefined")
@@ -75,7 +80,7 @@ export function SecretsSection({ focusKey }) {
75
80
  }, focusInput: openSecretKey === secret.key }, secret.key))) })), _jsx(AdHocKeysSection, { showForm: customKeyOpen, onShowFormChange: setCustomKeyOpen, showEmptyState: visibleSecrets.length === 0 })] }));
76
81
  }
77
82
  function KeysHeader({ availableSecrets = [], onSecret, onCustomKey, }) {
78
- return (_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("p", { className: "text-[11px] font-medium text-foreground", children: "Keys" }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { type: "button", className: "inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground transition-colors hover:bg-accent/40 hover:text-foreground", children: [_jsx(IconPlus, { size: 11 }), "New"] }) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-60", children: [availableSecrets.length > 0 && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuLabel, { children: "Choose a key" }), availableSecrets.map((secret) => (_jsxs(DropdownMenuItem, { onSelect: () => onSecret?.(secret.key), className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "truncate", children: secret.label }), secret.required && (_jsx("span", { className: "text-[9px] font-semibold uppercase tracking-wide text-amber-600 dark:text-amber-400", children: "Required" }))] }, secret.key))), _jsx(DropdownMenuSeparator, {})] })), _jsxs(DropdownMenuItem, { onSelect: onCustomKey, children: [_jsx(IconPlus, { size: 14 }), "Custom"] })] })] })] }));
83
+ return (_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("p", { className: "text-[11px] font-medium text-foreground", children: "Keys" }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { type: "button", intent: "neutral", emphasis: "outline", className: "inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground transition-colors hover:bg-accent/40 hover:text-foreground", children: [_jsx(IconPlus, { size: 11 }), "New"] }) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-60", children: [availableSecrets.length > 0 && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuLabel, { children: "Choose a key" }), availableSecrets.map((secret) => (_jsxs(DropdownMenuItem, { onSelect: () => onSecret?.(secret.key), className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "truncate", children: secret.label }), secret.required && (_jsx("span", { className: "text-[9px] font-semibold uppercase tracking-wide text-amber-600 dark:text-amber-400", children: "Required" }))] }, secret.key))), _jsx(DropdownMenuSeparator, {})] })), _jsxs(DropdownMenuItem, { onSelect: onCustomKey, children: [_jsx(IconPlus, { size: 14 }), "Custom"] })] })] })] }));
79
84
  }
80
85
  function SecretCard({ secret, onChanged, open, onOpenChange, focusInput, }) {
81
86
  const [value, setValue] = useState("");
@@ -176,12 +181,12 @@ function SecretCard({ secret, onChanged, open, onOpenChange, focusInput, }) {
176
181
  return (_jsx("span", { className: "rounded-full bg-accent/60 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground", children: "Optional" }));
177
182
  }, [secret.status, secret.required]);
178
183
  const isOAuth = secret.kind === "oauth";
179
- return (_jsxs("div", { className: "border-b border-border last:border-b-0", children: [_jsxs("button", { type: "button", "aria-expanded": open, onClick: () => onOpenChange(!open), className: "flex w-full items-center gap-2 px-2.5 py-2 text-start transition-colors hover:bg-accent/30", children: [_jsx(IconChevronRight, { size: 13, className: `shrink-0 text-muted-foreground transition-transform ${open ? "rotate-90" : ""}` }), _jsx("span", { className: "min-w-0 flex-1 truncate text-[11px] font-medium text-foreground", children: secret.label }), secret.status === "set" && secret.last4 && (_jsxs("code", { className: "text-[10px] text-muted-foreground", children: ["\u2022\u2022\u2022\u2022", secret.last4] })), _jsx("span", { className: "shrink-0", children: pill })] }), open && (_jsxs("div", { className: "border-t border-border/60 bg-accent/20 px-3 pb-3 pt-2.5", children: [secret.description && (_jsx("p", { className: "mb-2 text-[10px] leading-relaxed text-muted-foreground", children: secret.description })), isOAuth ? (_jsxs("div", { className: "mt-2 flex items-center gap-1.5", children: [secret.oauthConnectUrl && (_jsxs("a", { href: secret.oauthConnectUrl, className: "inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium no-underline", style: { backgroundColor: "#00B5FF", color: "white" }, children: [_jsx(IconPlugConnected, { size: 10 }), secret.status === "set" ? "Reconnect" : "Connect"] })), secret.docsUrl && (_jsxs("a", { href: secret.docsUrl, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] no-underline text-muted-foreground hover:text-foreground", children: ["Docs", _jsx(IconExternalLink, { size: 10 })] }))] })) : (_jsxs("div", { className: "mt-2 space-y-1.5", children: [secret.status === "set" && (_jsxs("div", { className: "flex items-center gap-2 text-[10px] text-muted-foreground", children: [_jsx("span", { children: "Stored value ending in" }), _jsx("code", { className: "rounded bg-background px-1 py-0.5 text-foreground", children: secret.last4 })] })), _jsxs("div", { className: "flex gap-1.5", children: [_jsx("input", { ref: inputRef, type: "password", "aria-label": secret.label, value: value, onChange: (e) => setValue(e.target.value), onKeyDown: (e) => {
180
- if (e.key === "Enter")
184
+ return (_jsxs("div", { className: "border-b border-border last:border-b-0", children: [_jsxs(Button, { type: "button", intent: "neutral", emphasis: "ghost", "aria-expanded": open, onClick: () => onOpenChange(!open), className: "flex w-full items-center gap-2 px-2.5 py-2 text-start transition-colors hover:bg-accent/30", children: [_jsx(IconChevronRight, { size: 13, className: `shrink-0 text-muted-foreground transition-transform ${open ? "rotate-90" : ""}` }), _jsx("span", { className: "min-w-0 flex-1 truncate text-[11px] font-medium text-foreground", children: secret.label }), secret.status === "set" && secret.last4 && (_jsxs("code", { className: "text-[10px] text-muted-foreground", children: ["\u2022\u2022\u2022\u2022", secret.last4] })), _jsx("span", { className: "shrink-0", children: pill })] }), open && (_jsxs("div", { className: "border-t border-border/60 bg-accent/20 px-3 pb-3 pt-2.5", children: [secret.description && (_jsx("p", { className: "mb-2 text-[10px] leading-relaxed text-muted-foreground", children: secret.description })), isOAuth ? (_jsxs("div", { className: "mt-2 flex items-center gap-1.5", children: [secret.oauthConnectUrl && (_jsxs("a", { href: secret.oauthConnectUrl, className: "inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium no-underline", style: { backgroundColor: "#00B5FF", color: "white" }, children: [_jsx(IconPlugConnected, { size: 10 }), secret.status === "set" ? "Reconnect" : "Connect"] })), secret.docsUrl && (_jsxs("a", { href: secret.docsUrl, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] no-underline text-muted-foreground hover:text-foreground", children: ["Docs", _jsx(IconExternalLink, { size: 10 })] }))] })) : (_jsxs("div", { className: "mt-2 space-y-1.5", children: [secret.status === "set" && (_jsxs("div", { className: "flex items-center gap-2 text-[10px] text-muted-foreground", children: [_jsx("span", { children: "Stored value ending in" }), _jsx("code", { className: "rounded bg-background px-1 py-0.5 text-foreground", children: secret.last4 })] })), _jsxs("div", { className: "flex gap-1.5", children: [_jsx(TextField, { inputRef: inputRef, type: "password", "aria-label": secret.label, value: value, onChange: setValue, onKeyDown: (event) => {
185
+ if (event.key === "Enter")
181
186
  handleSave();
182
187
  }, placeholder: secret.status === "set"
183
188
  ? "Enter new value to rotate"
184
- : "Paste key", className: "flex-1 rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent" }), _jsx("button", { type: "button", onClick: handleSave, disabled: !value.trim() || busy !== null, className: "inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium disabled:opacity-40", style: { backgroundColor: "#00B5FF", color: "white" }, children: busy === "save" ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : secret.status === "set" ? (_jsxs(_Fragment, { children: [_jsx(IconRefresh, { size: 10 }), "Rotate"] })) : ("Save") })] }), _jsxs("div", { className: "flex items-center gap-1.5", children: [secret.status === "set" && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: handleTest, disabled: busy !== null, className: "inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-muted-foreground hover:text-foreground disabled:opacity-40", children: busy === "test" ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : ("Test") }), _jsxs("button", { type: "button", onClick: () => setConfirmDelete(true), disabled: busy !== null, className: "inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-muted-foreground hover:text-red-500 disabled:opacity-40", children: [_jsx(IconTrash, { size: 10 }), "Remove"] })] })), secret.docsUrl && (_jsxs("a", { href: secret.docsUrl, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] no-underline text-muted-foreground hover:text-foreground ms-auto", children: ["Get key", _jsx(IconExternalLink, { size: 10 })] }))] }), confirmDelete && (_jsxs("div", { className: "flex items-center gap-1.5 rounded border border-red-500/30 bg-red-500/10 px-2 py-1.5 text-[10px] text-red-500", children: [_jsx("span", { className: "min-w-0 flex-1", children: "Remove this saved value?" }), _jsx("button", { type: "button", onClick: handleDelete, disabled: busy !== null, className: "inline-flex items-center gap-1 rounded border border-red-500/40 px-1.5 py-0.5 font-medium disabled:opacity-40", children: busy === "delete" ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : ("Confirm") }), _jsx("button", { type: "button", onClick: () => setConfirmDelete(false), disabled: busy !== null, className: "rounded border border-border px-1.5 py-0.5 text-muted-foreground hover:text-foreground disabled:opacity-40", children: "Cancel" })] }))] })), toast && (_jsx("p", { className: `mt-1.5 text-[10px] ${toast.kind === "ok" ? "text-green-500" : "text-red-500"}`, children: toast.text }))] }))] }));
189
+ : "Paste key", className: "flex-1 text-[11px]" }), _jsx(Button, { type: "button", intent: "primary", emphasis: "solid", onClick: handleSave, disabled: !value.trim() || busy !== null, className: "inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium disabled:opacity-40", style: { backgroundColor: "#00B5FF", color: "white" }, children: busy === "save" ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : secret.status === "set" ? (_jsxs(_Fragment, { children: [_jsx(IconRefresh, { size: 10 }), "Rotate"] })) : ("Save") })] }), _jsxs("div", { className: "flex items-center gap-1.5", children: [secret.status === "set" && (_jsxs(_Fragment, { children: [_jsx(Button, { type: "button", intent: "neutral", emphasis: "outline", onClick: handleTest, disabled: busy !== null, className: "inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-muted-foreground hover:text-foreground disabled:opacity-40", children: busy === "test" ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : ("Test") }), _jsxs(Button, { type: "button", intent: "danger", emphasis: "outline", onClick: () => setConfirmDelete(true), disabled: busy !== null, className: "inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-muted-foreground hover:text-red-500 disabled:opacity-40", children: [_jsx(IconTrash, { size: 10 }), "Remove"] })] })), secret.docsUrl && (_jsxs("a", { href: secret.docsUrl, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] no-underline text-muted-foreground hover:text-foreground ms-auto", children: ["Get key", _jsx(IconExternalLink, { size: 10 })] }))] }), confirmDelete && (_jsxs("div", { className: "flex items-center gap-1.5 rounded border border-red-500/30 bg-red-500/10 px-2 py-1.5 text-[10px] text-red-500", children: [_jsx("span", { className: "min-w-0 flex-1", children: "Remove this saved value?" }), _jsx(Button, { type: "button", intent: "danger", emphasis: "solid", onClick: handleDelete, disabled: busy !== null, className: "inline-flex items-center gap-1 rounded border border-red-500/40 px-1.5 py-0.5 font-medium disabled:opacity-40", children: busy === "delete" ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : ("Confirm") }), _jsx(Button, { type: "button", intent: "neutral", emphasis: "outline", onClick: () => setConfirmDelete(false), disabled: busy !== null, className: "rounded border border-border px-1.5 py-0.5 text-muted-foreground hover:text-foreground disabled:opacity-40", children: "Cancel" })] }))] })), toast && (_jsx("p", { className: `mt-1.5 text-[10px] ${toast.kind === "ok" ? "text-green-500" : "text-red-500"}`, children: toast.text }))] }))] }));
185
190
  }
186
191
  const ADHOC_ENDPOINT = agentNativePath("/_agent-native/secrets/adhoc");
187
192
  function AdHocKeysSection({ showForm, onShowFormChange, showEmptyState, }) {
@@ -302,8 +307,15 @@ function AdHocKeysSection({ showForm, onShowFormChange, showEmptyState, }) {
302
307
  setDeletingName(null);
303
308
  }
304
309
  }, [showToast, reload]);
305
- return (_jsxs("div", { className: "space-y-2", children: [showForm && (_jsxs("div", { className: "rounded-md border border-border px-2.5 py-2 bg-accent/30 space-y-1.5", children: [_jsx("input", { value: formName, onChange: (e) => setFormName(e.target.value.toUpperCase().replace(/[^A-Z0-9_-]/g, "")), className: "w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent", "aria-label": "Key name", placeholder: "KEY_NAME" }), _jsx("input", { type: "password", "aria-label": "Secret value", value: formValue, onChange: (e) => setFormValue(e.target.value), className: "w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent", placeholder: "Secret value" }), _jsx("input", { value: formDescription, "aria-label": "Description", onChange: (e) => setFormDescription(e.target.value), className: "w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent", placeholder: "Description (optional)" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("select", { "aria-label": "Scope", value: formScope, onChange: (e) => setFormScope(e.target.value), className: "rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none focus:ring-1 focus:ring-accent", children: [_jsx("option", { value: "user", children: "Personal" }), _jsx("option", { value: "workspace", children: "Workspace" })] }), _jsxs("div", { className: "ms-auto flex items-center gap-1.5", children: [_jsx("button", { type: "button", onClick: resetForm, className: "rounded border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground hover:text-foreground", children: "Cancel" }), _jsx("button", { type: "button", onClick: handleAdd, disabled: !formName.trim() || !formValue.trim() || formBusy, className: "inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium disabled:opacity-40", style: { backgroundColor: "#00B5FF", color: "white" }, children: formBusy ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : ("Save") })] })] }), formError && _jsx("p", { className: "text-[10px] text-red-500", children: formError })] })), loading ? (_jsxs("div", { className: "flex items-center gap-1.5 text-[10px] text-muted-foreground", children: [_jsx(IconLoader2, { size: 10, className: "animate-spin" }), "Loading..."] })) : keys.length === 0 && !showForm && showEmptyState ? (_jsx("p", { className: "text-[10px] text-muted-foreground", children: "No keys added yet." })) : keys.length > 0 ? (_jsx("div", { className: "overflow-hidden rounded-md border border-border", children: keys.map((key) => (_jsx("div", { className: "border-b border-border px-2.5 py-2 last:border-b-0", children: _jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "text-[11px] font-medium text-foreground font-mono truncate", children: key.name }), _jsx("span", { className: `rounded-full px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide ${key.scope === "workspace"
310
+ return (_jsxs("div", { className: "space-y-2", children: [showForm && (_jsxs("div", { className: "rounded-md border border-border px-2.5 py-2 bg-accent/30 space-y-1.5", children: [_jsx(TextField, { value: formName, onChange: (value) => setFormName(value.toUpperCase().replace(/[^A-Z0-9_-]/g, "")), className: "w-full text-[11px]", "aria-label": "Key name", placeholder: "KEY_NAME" }), _jsx(TextField, { type: "password", "aria-label": "Secret value", value: formValue, onChange: setFormValue, className: "w-full text-[11px]", placeholder: "Secret value" }), _jsx(TextField, { value: formDescription, "aria-label": "Description", onChange: setFormDescription, className: "w-full text-[11px]", placeholder: "Description (optional)" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Picker, { mode: "select", options: [
311
+ { value: "user", label: "Personal" },
312
+ { value: "workspace", label: "Workspace" },
313
+ ], value: formScope, onChange: (value) => {
314
+ if (value === "user" || value === "workspace") {
315
+ setFormScope(value);
316
+ }
317
+ }, "aria-label": "Scope", className: "w-auto text-[11px]" }), _jsxs("div", { className: "ms-auto flex items-center gap-1.5", children: [_jsx(Button, { type: "button", intent: "neutral", emphasis: "outline", onClick: resetForm, className: "rounded border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground hover:text-foreground", children: "Cancel" }), _jsx(Button, { type: "button", intent: "primary", emphasis: "solid", onClick: handleAdd, disabled: !formName.trim() || !formValue.trim() || formBusy, className: "inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium disabled:opacity-40", style: { backgroundColor: "#00B5FF", color: "white" }, children: formBusy ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : ("Save") })] })] }), formError && _jsx("p", { className: "text-[10px] text-red-500", children: formError })] })), loading ? (_jsxs("div", { className: "flex items-center gap-1.5 text-[10px] text-muted-foreground", children: [_jsx(IconLoader2, { size: 10, className: "animate-spin" }), "Loading..."] })) : keys.length === 0 && !showForm && showEmptyState ? (_jsx("p", { className: "text-[10px] text-muted-foreground", children: "No keys added yet." })) : keys.length > 0 ? (_jsx("div", { className: "overflow-hidden rounded-md border border-border", children: keys.map((key) => (_jsx("div", { className: "border-b border-border px-2.5 py-2 last:border-b-0", children: _jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "text-[11px] font-medium text-foreground font-mono truncate", children: key.name }), _jsx("span", { className: `rounded-full px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide ${key.scope === "workspace"
306
318
  ? "bg-blue-500/15 text-blue-500"
307
- : "bg-accent/60 text-muted-foreground"}`, children: key.scope === "workspace" ? "workspace" : "personal" })] }), key.description && (_jsx("p", { className: "text-[10px] text-muted-foreground mt-0.5", children: key.description })), _jsx("div", { className: "flex items-center gap-2 text-[10px] text-muted-foreground mt-0.5", children: _jsxs("span", { children: ["Ending in", " ", _jsx("code", { className: "rounded bg-background px-1 py-0.5 text-foreground", children: key.last4 })] }) })] }), _jsx("div", { className: "shrink-0", children: confirmDeleteName === key.name ? (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("button", { type: "button", onClick: () => handleDelete(key.name), disabled: deletingName === key.name, className: "rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-red-500/15 text-red-500 hover:bg-red-500/25 disabled:opacity-40", children: deletingName === key.name ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : ("Confirm") }), _jsx("button", { type: "button", onClick: () => setConfirmDeleteName(null), className: "rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-accent/60 text-muted-foreground hover:text-foreground", children: "Cancel" })] })) : (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: () => setConfirmDeleteName(key.name), className: "text-muted-foreground hover:text-red-500", children: _jsx(IconTrash, { size: 12 }) }) }), _jsx(TooltipContent, { children: "Delete" })] })) })] }) }, `${key.scope}-${key.name}`))) })) : null, toast && (_jsx("p", { className: `text-[10px] ${toast.kind === "ok" ? "text-green-500" : "text-red-500"}`, children: toast.text }))] }));
319
+ : "bg-accent/60 text-muted-foreground"}`, children: key.scope === "workspace" ? "workspace" : "personal" })] }), key.description && (_jsx("p", { className: "text-[10px] text-muted-foreground mt-0.5", children: key.description })), _jsx("div", { className: "flex items-center gap-2 text-[10px] text-muted-foreground mt-0.5", children: _jsxs("span", { children: ["Ending in", " ", _jsx("code", { className: "rounded bg-background px-1 py-0.5 text-foreground", children: key.last4 })] }) })] }), _jsx("div", { className: "shrink-0", children: confirmDeleteName === key.name ? (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Button, { type: "button", intent: "danger", emphasis: "solid", onClick: () => handleDelete(key.name), disabled: deletingName === key.name, className: "rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-red-500/15 text-red-500 hover:bg-red-500/25 disabled:opacity-40", children: deletingName === key.name ? (_jsx(IconLoader2, { size: 10, className: "animate-spin" })) : ("Confirm") }), _jsx(Button, { type: "button", intent: "neutral", emphasis: "solid", onClick: () => setConfirmDeleteName(null), className: "rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-accent/60 text-muted-foreground hover:text-foreground", children: "Cancel" })] })) : (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { type: "button", intent: "danger", emphasis: "ghost", onClick: () => setConfirmDeleteName(key.name), className: "text-muted-foreground hover:text-red-500", children: _jsx(IconTrash, { size: 12 }) }) }), _jsx(TooltipContent, { children: "Delete" })] })) })] }) }, `${key.scope}-${key.name}`))) })) : null, toast && (_jsx("p", { className: `text-[10px] ${toast.kind === "ok" ? "text-green-500" : "text-red-500"}`, children: toast.text }))] }));
308
320
  }
309
321
  //# sourceMappingURL=SecretsSection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SecretsSection.js","sourceRoot":"","sources":["../../../src/client/settings/SecretsSection.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EA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C,CAAC,cAAc,EAAE,YAElF,KAAK,CAAC,IAAI,GACT,CACL,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["/**\n * <SecretsSection /> — renders the registered secrets from the framework\n * secrets registry. Configured keys stay compact; adding or editing one\n * progressively discloses its controls.\n */\n\nimport {\n IconCheck,\n IconChevronRight,\n IconExternalLink,\n IconLoader2,\n IconPlugConnected,\n IconPlus,\n IconTrash,\n IconRefresh,\n} from \"@tabler/icons-react\";\nimport React, { useEffect, useMemo, useState, useCallback } from \"react\";\n\nimport { agentNativePath } from \"../api-path.js\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"../components/ui/dropdown-menu.js\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\n\ninterface SecretStatus {\n key: string;\n label: string;\n description?: string;\n docsUrl?: string;\n scope: \"user\" | \"workspace\";\n kind: \"api-key\" | \"oauth\";\n required: boolean;\n status: \"set\" | \"unset\" | \"invalid\";\n last4?: string;\n updatedAt?: number;\n oauthProvider?: string;\n oauthConnectUrl?: string;\n error?: string;\n}\n\nconst ENDPOINT = agentNativePath(\"/_agent-native/secrets\");\n\nfunction notifySecretsChanged() {\n if (typeof window === \"undefined\") return;\n window.dispatchEvent(\n new CustomEvent(\"agent-engine:configured-changed\", {\n detail: { source: \"secrets\" },\n }),\n );\n}\n\nexport interface SecretsSectionProps {\n /** Optional hash fragment to focus a specific secret (e.g. \"secrets:OPENAI_API_KEY\"). */\n focusKey?: string;\n}\n\nexport function SecretsSection({ focusKey }: SecretsSectionProps) {\n const [secrets, setSecrets] = useState<SecretStatus[] | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [reloadToken, setReloadToken] = useState(0);\n const [openSecretKey, setOpenSecretKey] = useState<string | null>(\n focusKey ?? null,\n );\n const [customKeyOpen, setCustomKeyOpen] = useState(false);\n\n useEffect(() => {\n let cancelled = false;\n fetch(ENDPOINT)\n .then(async (r) => {\n if (!r.ok) {\n throw new Error(`Failed to load secrets (${r.status})`);\n }\n return (await r.json()) as SecretStatus[];\n })\n .then((data) => {\n if (!cancelled) setSecrets(data);\n })\n .catch((err) => {\n if (!cancelled) setError(err?.message ?? \"Failed to load\");\n });\n return () => {\n cancelled = true;\n };\n }, [reloadToken]);\n\n const reload = useCallback(() => setReloadToken((t) => t + 1), []);\n\n useEffect(() => {\n if (focusKey) {\n setCustomKeyOpen(false);\n setOpenSecretKey(focusKey);\n }\n }, [focusKey]);\n\n if (error) {\n return (\n <p className=\"text-[10px] text-red-500\">\n Failed to load secrets: {error}\n </p>\n );\n }\n if (secrets === null) {\n return (\n <div className=\"flex items-center gap-1.5 text-[10px] text-muted-foreground\">\n <IconLoader2 size={10} className=\"animate-spin\" />\n Loading…\n </div>\n );\n }\n if (secrets.length === 0) {\n return (\n <div className=\"space-y-3\">\n <KeysHeader onCustomKey={() => setCustomKeyOpen(true)} />\n <AdHocKeysSection\n showForm={customKeyOpen}\n onShowFormChange={setCustomKeyOpen}\n showEmptyState\n />\n </div>\n );\n }\n\n const visibleSecrets = secrets.filter(\n (secret) => secret.status !== \"unset\" || secret.key === openSecretKey,\n );\n const availableSecrets = secrets.filter(\n (secret) => secret.status === \"unset\" && secret.key !== openSecretKey,\n );\n\n return (\n <div className=\"space-y-3\">\n <KeysHeader\n availableSecrets={availableSecrets}\n onSecret={(key) => {\n setCustomKeyOpen(false);\n setOpenSecretKey(key);\n }}\n onCustomKey={() => {\n setOpenSecretKey(null);\n setCustomKeyOpen(true);\n }}\n />\n {visibleSecrets.length > 0 && (\n <div className=\"overflow-hidden rounded-md border border-border\">\n {visibleSecrets.map((secret) => (\n <SecretCard\n key={secret.key}\n secret={secret}\n onChanged={reload}\n open={openSecretKey === secret.key}\n onOpenChange={(open) => {\n if (open) setCustomKeyOpen(false);\n setOpenSecretKey(open ? secret.key : null);\n }}\n focusInput={openSecretKey === secret.key}\n />\n ))}\n </div>\n )}\n <AdHocKeysSection\n showForm={customKeyOpen}\n onShowFormChange={setCustomKeyOpen}\n showEmptyState={visibleSecrets.length === 0}\n />\n </div>\n );\n}\n\nfunction KeysHeader({\n availableSecrets = [],\n onSecret,\n onCustomKey,\n}: {\n availableSecrets?: SecretStatus[];\n onSecret?: (key: string) => void;\n onCustomKey: () => void;\n}) {\n return (\n <div className=\"flex items-center justify-between gap-3\">\n <p className=\"text-[11px] font-medium text-foreground\">Keys</p>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n className=\"inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground transition-colors hover:bg-accent/40 hover:text-foreground\"\n >\n <IconPlus size={11} />\n New\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-60\">\n {availableSecrets.length > 0 && (\n <>\n <DropdownMenuLabel>Choose a key</DropdownMenuLabel>\n {availableSecrets.map((secret) => (\n <DropdownMenuItem\n key={secret.key}\n onSelect={() => onSecret?.(secret.key)}\n className=\"flex items-center justify-between gap-3\"\n >\n <span className=\"truncate\">{secret.label}</span>\n {secret.required && (\n <span className=\"text-[9px] font-semibold uppercase tracking-wide text-amber-600 dark:text-amber-400\">\n Required\n </span>\n )}\n </DropdownMenuItem>\n ))}\n <DropdownMenuSeparator />\n </>\n )}\n <DropdownMenuItem onSelect={onCustomKey}>\n <IconPlus size={14} />\n Custom\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n}\n\ninterface SecretCardProps {\n secret: SecretStatus;\n onChanged: () => void;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n focusInput?: boolean;\n}\n\nfunction SecretCard({\n secret,\n onChanged,\n open,\n onOpenChange,\n focusInput,\n}: SecretCardProps) {\n const [value, setValue] = useState(\"\");\n const [busy, setBusy] = useState<null | \"save\" | \"delete\" | \"test\">(null);\n const [confirmDelete, setConfirmDelete] = useState(false);\n const [toast, setToast] = useState<{\n kind: \"ok\" | \"err\";\n text: string;\n } | null>(null);\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (open && focusInput && inputRef.current) {\n inputRef.current.focus();\n }\n }, [focusInput, open]);\n\n const setToastAndClear = (kind: \"ok\" | \"err\", text: string, ms = 2500) => {\n setToast({ kind, text });\n setTimeout(() => setToast(null), ms);\n };\n\n const handleSave = async () => {\n if (!value.trim() || busy) return;\n setBusy(\"save\");\n try {\n const res = await fetch(`${ENDPOINT}/${encodeURIComponent(secret.key)}`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ value: value.trim() }),\n });\n if (!res.ok) {\n const err = await res\n .json()\n .then((j: { error?: string }) => j.error)\n .catch(() => null);\n setToastAndClear(\"err\", err ?? `Save failed (${res.status})`);\n return;\n }\n setValue(\"\");\n setConfirmDelete(false);\n setToastAndClear(\"ok\", \"Saved\");\n notifySecretsChanged();\n onChanged();\n } finally {\n setBusy(null);\n }\n };\n\n const handleDelete = async () => {\n if (busy) return;\n setBusy(\"delete\");\n try {\n const res = await fetch(`${ENDPOINT}/${encodeURIComponent(secret.key)}`, {\n method: \"DELETE\",\n headers: { \"Content-Type\": \"application/json\" },\n });\n if (!res.ok) {\n const err = await res\n .json()\n .then((j: { error?: string }) => j.error)\n .catch(() => null);\n setToastAndClear(\"err\", err ?? `Delete failed (${res.status})`);\n return;\n }\n setToastAndClear(\"ok\", \"Removed\");\n setConfirmDelete(false);\n notifySecretsChanged();\n onChanged();\n } finally {\n setBusy(null);\n }\n };\n\n const handleTest = async () => {\n if (busy) return;\n setBusy(\"test\");\n try {\n const res = await fetch(\n `${ENDPOINT}/${encodeURIComponent(secret.key)}/test`,\n {\n method: \"POST\",\n },\n );\n const body = (await res.json().catch(() => ({}))) as {\n ok?: boolean;\n error?: string;\n };\n if (res.ok && body.ok) {\n setToastAndClear(\"ok\", \"Working\");\n } else {\n setToastAndClear(\n \"err\",\n body.error ?? (body.ok === false ? \"Invalid\" : `Test failed`),\n );\n }\n } finally {\n setBusy(null);\n }\n };\n\n const pill = useMemo(() => {\n if (secret.status === \"set\") {\n return (\n <span className=\"flex items-center gap-1 text-[10px] text-green-500\">\n <IconCheck size={10} />\n Set\n </span>\n );\n }\n if (secret.required) {\n return (\n <span className=\"rounded-full bg-red-500/15 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-red-500\">\n Required\n </span>\n );\n }\n return (\n <span className=\"rounded-full bg-accent/60 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground\">\n Optional\n </span>\n );\n }, [secret.status, secret.required]);\n\n const isOAuth = secret.kind === \"oauth\";\n\n return (\n <div className=\"border-b border-border last:border-b-0\">\n <button\n type=\"button\"\n aria-expanded={open}\n onClick={() => onOpenChange(!open)}\n className=\"flex w-full items-center gap-2 px-2.5 py-2 text-start transition-colors hover:bg-accent/30\"\n >\n <IconChevronRight\n size={13}\n className={`shrink-0 text-muted-foreground transition-transform ${open ? \"rotate-90\" : \"\"}`}\n />\n <span className=\"min-w-0 flex-1 truncate text-[11px] font-medium text-foreground\">\n {secret.label}\n </span>\n {secret.status === \"set\" && secret.last4 && (\n <code className=\"text-[10px] text-muted-foreground\">\n ••••{secret.last4}\n </code>\n )}\n <span className=\"shrink-0\">{pill}</span>\n </button>\n\n {open && (\n <div className=\"border-t border-border/60 bg-accent/20 px-3 pb-3 pt-2.5\">\n {secret.description && (\n <p className=\"mb-2 text-[10px] leading-relaxed text-muted-foreground\">\n {secret.description}\n </p>\n )}\n {isOAuth ? (\n <div className=\"mt-2 flex items-center gap-1.5\">\n {secret.oauthConnectUrl && (\n <a\n href={secret.oauthConnectUrl}\n className=\"inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium no-underline\"\n style={{ backgroundColor: \"#00B5FF\", color: \"white\" }}\n >\n <IconPlugConnected size={10} />\n {secret.status === \"set\" ? \"Reconnect\" : \"Connect\"}\n </a>\n )}\n {secret.docsUrl && (\n <a\n href={secret.docsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] no-underline text-muted-foreground hover:text-foreground\"\n >\n Docs\n <IconExternalLink size={10} />\n </a>\n )}\n </div>\n ) : (\n <div className=\"mt-2 space-y-1.5\">\n {secret.status === \"set\" && (\n <div className=\"flex items-center gap-2 text-[10px] text-muted-foreground\">\n <span>Stored value ending in</span>\n <code className=\"rounded bg-background px-1 py-0.5 text-foreground\">\n {secret.last4}\n </code>\n </div>\n )}\n <div className=\"flex gap-1.5\">\n <input\n ref={inputRef}\n type=\"password\"\n aria-label={secret.label}\n value={value}\n onChange={(e) => setValue(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") handleSave();\n }}\n placeholder={\n secret.status === \"set\"\n ? \"Enter new value to rotate\"\n : \"Paste key\"\n }\n className=\"flex-1 rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n />\n <button\n type=\"button\"\n onClick={handleSave}\n disabled={!value.trim() || busy !== null}\n className=\"inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium disabled:opacity-40\"\n style={{ backgroundColor: \"#00B5FF\", color: \"white\" }}\n >\n {busy === \"save\" ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : secret.status === \"set\" ? (\n <>\n <IconRefresh size={10} />\n Rotate\n </>\n ) : (\n \"Save\"\n )}\n </button>\n </div>\n <div className=\"flex items-center gap-1.5\">\n {secret.status === \"set\" && (\n <>\n <button\n type=\"button\"\n onClick={handleTest}\n disabled={busy !== null}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-muted-foreground hover:text-foreground disabled:opacity-40\"\n >\n {busy === \"test\" ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Test\"\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => setConfirmDelete(true)}\n disabled={busy !== null}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-muted-foreground hover:text-red-500 disabled:opacity-40\"\n >\n <IconTrash size={10} />\n Remove\n </button>\n </>\n )}\n {secret.docsUrl && (\n <a\n href={secret.docsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] no-underline text-muted-foreground hover:text-foreground ms-auto\"\n >\n Get key\n <IconExternalLink size={10} />\n </a>\n )}\n </div>\n {confirmDelete && (\n <div className=\"flex items-center gap-1.5 rounded border border-red-500/30 bg-red-500/10 px-2 py-1.5 text-[10px] text-red-500\">\n <span className=\"min-w-0 flex-1\">\n Remove this saved value?\n </span>\n <button\n type=\"button\"\n onClick={handleDelete}\n disabled={busy !== null}\n className=\"inline-flex items-center gap-1 rounded border border-red-500/40 px-1.5 py-0.5 font-medium disabled:opacity-40\"\n >\n {busy === \"delete\" ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Confirm\"\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => setConfirmDelete(false)}\n disabled={busy !== null}\n className=\"rounded border border-border px-1.5 py-0.5 text-muted-foreground hover:text-foreground disabled:opacity-40\"\n >\n Cancel\n </button>\n </div>\n )}\n </div>\n )}\n\n {toast && (\n <p\n className={`mt-1.5 text-[10px] ${\n toast.kind === \"ok\" ? \"text-green-500\" : \"text-red-500\"\n }`}\n >\n {toast.text}\n </p>\n )}\n </div>\n )}\n </div>\n );\n}\n\n// ─── Ad-hoc Keys Section ──────────────────────────────────────────────────\n\ninterface AdHocKey {\n name: string;\n scope: \"user\" | \"workspace\";\n scopeId: string;\n description: string | null;\n last4: string;\n createdAt: number;\n updatedAt: number;\n}\n\nconst ADHOC_ENDPOINT = agentNativePath(\"/_agent-native/secrets/adhoc\");\n\nfunction AdHocKeysSection({\n showForm,\n onShowFormChange,\n showEmptyState,\n}: {\n showForm: boolean;\n onShowFormChange: (show: boolean) => void;\n showEmptyState: boolean;\n}) {\n const [keys, setKeys] = useState<AdHocKey[]>([]);\n const [loading, setLoading] = useState(true);\n const [reloadToken, setReloadToken] = useState(0);\n const [formName, setFormName] = useState(\"\");\n const [formValue, setFormValue] = useState(\"\");\n const [formDescription, setFormDescription] = useState(\"\");\n const [formScope, setFormScope] = useState<\"user\" | \"workspace\">(\"user\");\n const [formBusy, setFormBusy] = useState(false);\n const [formError, setFormError] = useState<string | null>(null);\n const [confirmDeleteName, setConfirmDeleteName] = useState<string | null>(\n null,\n );\n const [deletingName, setDeletingName] = useState<string | null>(null);\n const [toast, setToast] = useState<{\n kind: \"ok\" | \"err\";\n text: string;\n } | null>(null);\n\n const showToast = useCallback(\n (kind: \"ok\" | \"err\", text: string, ms = 2500) => {\n setToast({ kind, text });\n setTimeout(() => setToast(null), ms);\n },\n [],\n );\n\n const reload = useCallback(() => setReloadToken((t) => t + 1), []);\n\n useEffect(() => {\n let cancelled = false;\n setLoading(true);\n fetch(ADHOC_ENDPOINT)\n .then(async (r) => {\n if (!r.ok) throw new Error(`Failed to load (${r.status})`);\n return (await r.json()) as AdHocKey[];\n })\n .then((data) => {\n if (!cancelled) {\n setKeys(data);\n setLoading(false);\n }\n })\n .catch(() => {\n if (!cancelled) {\n setKeys([]);\n setLoading(false);\n }\n });\n return () => {\n cancelled = true;\n };\n }, [reloadToken]);\n\n const resetForm = useCallback(() => {\n onShowFormChange(false);\n setFormName(\"\");\n setFormValue(\"\");\n setFormDescription(\"\");\n setFormScope(\"user\");\n setFormError(null);\n }, [onShowFormChange]);\n\n const handleAdd = useCallback(async () => {\n const name = formName.trim();\n const value = formValue.trim();\n if (!name || !value || formBusy) return;\n setFormBusy(true);\n setFormError(null);\n try {\n const res = await fetch(ADHOC_ENDPOINT, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n name,\n value,\n description: formDescription.trim() || undefined,\n scope: formScope,\n }),\n });\n if (!res.ok) {\n const body = await res\n .json()\n .then((j: { error?: string }) => j.error)\n .catch(() => null);\n setFormError(body ?? `Save failed (${res.status})`);\n return;\n }\n resetForm();\n showToast(\"ok\", \"Key saved\");\n notifySecretsChanged();\n reload();\n } catch (err: any) {\n setFormError(err?.message ?? \"Failed to save\");\n } finally {\n setFormBusy(false);\n }\n }, [\n formName,\n formValue,\n formDescription,\n formScope,\n formBusy,\n resetForm,\n showToast,\n reload,\n ]);\n\n const handleDelete = useCallback(\n async (name: string) => {\n setDeletingName(name);\n try {\n const res = await fetch(\n `${ADHOC_ENDPOINT}/${encodeURIComponent(name)}`,\n {\n method: \"DELETE\",\n headers: { \"Content-Type\": \"application/json\" },\n },\n );\n if (!res.ok) {\n showToast(\"err\", \"Failed to delete key\");\n return;\n }\n showToast(\"ok\", \"Key deleted\");\n setConfirmDeleteName(null);\n notifySecretsChanged();\n reload();\n } finally {\n setDeletingName(null);\n }\n },\n [showToast, reload],\n );\n\n return (\n <div className=\"space-y-2\">\n {showForm && (\n <div className=\"rounded-md border border-border px-2.5 py-2 bg-accent/30 space-y-1.5\">\n <input\n value={formName}\n onChange={(e) =>\n setFormName(\n e.target.value.toUpperCase().replace(/[^A-Z0-9_-]/g, \"\"),\n )\n }\n className=\"w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n aria-label=\"Key name\"\n placeholder=\"KEY_NAME\"\n />\n <input\n type=\"password\"\n aria-label=\"Secret value\"\n value={formValue}\n onChange={(e) => setFormValue(e.target.value)}\n className=\"w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n placeholder=\"Secret value\"\n />\n <input\n value={formDescription}\n aria-label=\"Description\"\n onChange={(e) => setFormDescription(e.target.value)}\n className=\"w-full rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n placeholder=\"Description (optional)\"\n />\n <div className=\"flex items-center gap-2\">\n <select\n aria-label=\"Scope\"\n value={formScope}\n onChange={(e) =>\n setFormScope(e.target.value as \"user\" | \"workspace\")\n }\n className=\"rounded border border-border bg-background px-2 py-1 text-[11px] text-foreground outline-none focus:ring-1 focus:ring-accent\"\n >\n <option value=\"user\">Personal</option>\n <option value=\"workspace\">Workspace</option>\n </select>\n <div className=\"ms-auto flex items-center gap-1.5\">\n <button\n type=\"button\"\n onClick={resetForm}\n className=\"rounded border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground hover:text-foreground\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={handleAdd}\n disabled={!formName.trim() || !formValue.trim() || formBusy}\n className=\"inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium disabled:opacity-40\"\n style={{ backgroundColor: \"#00B5FF\", color: \"white\" }}\n >\n {formBusy ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Save\"\n )}\n </button>\n </div>\n </div>\n {formError && <p className=\"text-[10px] text-red-500\">{formError}</p>}\n </div>\n )}\n\n {loading ? (\n <div className=\"flex items-center gap-1.5 text-[10px] text-muted-foreground\">\n <IconLoader2 size={10} className=\"animate-spin\" />\n Loading...\n </div>\n ) : keys.length === 0 && !showForm && showEmptyState ? (\n <p className=\"text-[10px] text-muted-foreground\">No keys added yet.</p>\n ) : keys.length > 0 ? (\n <div className=\"overflow-hidden rounded-md border border-border\">\n {keys.map((key) => (\n <div\n key={`${key.scope}-${key.name}`}\n className=\"border-b border-border px-2.5 py-2 last:border-b-0\"\n >\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-[11px] font-medium text-foreground font-mono truncate\">\n {key.name}\n </span>\n <span\n className={`rounded-full px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide ${\n key.scope === \"workspace\"\n ? \"bg-blue-500/15 text-blue-500\"\n : \"bg-accent/60 text-muted-foreground\"\n }`}\n >\n {key.scope === \"workspace\" ? \"workspace\" : \"personal\"}\n </span>\n </div>\n {key.description && (\n <p className=\"text-[10px] text-muted-foreground mt-0.5\">\n {key.description}\n </p>\n )}\n <div className=\"flex items-center gap-2 text-[10px] text-muted-foreground mt-0.5\">\n <span>\n Ending in{\" \"}\n <code className=\"rounded bg-background px-1 py-0.5 text-foreground\">\n {key.last4}\n </code>\n </span>\n </div>\n </div>\n <div className=\"shrink-0\">\n {confirmDeleteName === key.name ? (\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => handleDelete(key.name)}\n disabled={deletingName === key.name}\n className=\"rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-red-500/15 text-red-500 hover:bg-red-500/25 disabled:opacity-40\"\n >\n {deletingName === key.name ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Confirm\"\n )}\n </button>\n <button\n type=\"button\"\n onClick={() => setConfirmDeleteName(null)}\n className=\"rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-accent/60 text-muted-foreground hover:text-foreground\"\n >\n Cancel\n </button>\n </div>\n ) : (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={() => setConfirmDeleteName(key.name)}\n className=\"text-muted-foreground hover:text-red-500\"\n >\n <IconTrash size={12} />\n </button>\n </TooltipTrigger>\n <TooltipContent>Delete</TooltipContent>\n </Tooltip>\n )}\n </div>\n </div>\n </div>\n ))}\n </div>\n ) : null}\n\n {toast && (\n <p\n className={`text-[10px] ${toast.kind === \"ok\" ? \"text-green-500\" : \"text-red-500\"}`}\n >\n {toast.text}\n </p>\n )}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"SecretsSection.js","sourceRoot":"","sources":["../../../src/client/settings/SecretsSection.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,SAA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CACP,CAAC,CAAC,CAAC,IAAI,EAEP,KAAK,IAAI,CACR,YACE,SAAS,EAAE,eAAe,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,cAAc,EAAE,YAElF,KAAK,CAAC,IAAI,GACT,CACL,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["/**\n * <SecretsSection /> — renders the registered secrets from the framework\n * secrets registry. Configured keys stay compact; adding or editing one\n * progressively discloses its controls.\n */\n\nimport { Picker, TextField } from \"@agent-native/toolkit/design-system\";\nimport { Button as ToolkitButton } from \"@agent-native/toolkit/ui/button\";\nimport {\n IconCheck,\n IconChevronRight,\n IconExternalLink,\n IconLoader2,\n IconPlugConnected,\n IconPlus,\n IconTrash,\n IconRefresh,\n} from \"@tabler/icons-react\";\nimport React, { useEffect, useMemo, useState, useCallback } from \"react\";\n\nimport { agentNativePath } from \"../api-path.js\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"../components/ui/dropdown-menu.js\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\nimport { cn } from \"../utils.js\";\n\nconst Button = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof ToolkitButton>\n>(({ className, ...props }, ref) => (\n <ToolkitButton\n ref={ref}\n variant=\"ghost\"\n className={cn(\n \"h-auto p-0 hover:bg-transparent hover:text-inherit active:scale-100 [&_svg]:!size-auto\",\n className,\n )}\n {...props}\n />\n));\nButton.displayName = \"SecretsPrimitiveButton\";\n\ninterface SecretStatus {\n key: string;\n label: string;\n description?: string;\n docsUrl?: string;\n scope: \"user\" | \"workspace\";\n kind: \"api-key\" | \"oauth\";\n required: boolean;\n status: \"set\" | \"unset\" | \"invalid\";\n last4?: string;\n updatedAt?: number;\n oauthProvider?: string;\n oauthConnectUrl?: string;\n error?: string;\n}\n\nconst ENDPOINT = agentNativePath(\"/_agent-native/secrets\");\n\nfunction notifySecretsChanged() {\n if (typeof window === \"undefined\") return;\n window.dispatchEvent(\n new CustomEvent(\"agent-engine:configured-changed\", {\n detail: { source: \"secrets\" },\n }),\n );\n}\n\nexport interface SecretsSectionProps {\n /** Optional hash fragment to focus a specific secret (e.g. \"secrets:OPENAI_API_KEY\"). */\n focusKey?: string;\n}\n\nexport function SecretsSection({ focusKey }: SecretsSectionProps) {\n const [secrets, setSecrets] = useState<SecretStatus[] | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [reloadToken, setReloadToken] = useState(0);\n const [openSecretKey, setOpenSecretKey] = useState<string | null>(\n focusKey ?? null,\n );\n const [customKeyOpen, setCustomKeyOpen] = useState(false);\n\n useEffect(() => {\n let cancelled = false;\n fetch(ENDPOINT)\n .then(async (r) => {\n if (!r.ok) {\n throw new Error(`Failed to load secrets (${r.status})`);\n }\n return (await r.json()) as SecretStatus[];\n })\n .then((data) => {\n if (!cancelled) setSecrets(data);\n })\n .catch((err) => {\n if (!cancelled) setError(err?.message ?? \"Failed to load\");\n });\n return () => {\n cancelled = true;\n };\n }, [reloadToken]);\n\n const reload = useCallback(() => setReloadToken((t) => t + 1), []);\n\n useEffect(() => {\n if (focusKey) {\n setCustomKeyOpen(false);\n setOpenSecretKey(focusKey);\n }\n }, [focusKey]);\n\n if (error) {\n return (\n <p className=\"text-[10px] text-red-500\">\n Failed to load secrets: {error}\n </p>\n );\n }\n if (secrets === null) {\n return (\n <div className=\"flex items-center gap-1.5 text-[10px] text-muted-foreground\">\n <IconLoader2 size={10} className=\"animate-spin\" />\n Loading…\n </div>\n );\n }\n if (secrets.length === 0) {\n return (\n <div className=\"space-y-3\">\n <KeysHeader onCustomKey={() => setCustomKeyOpen(true)} />\n <AdHocKeysSection\n showForm={customKeyOpen}\n onShowFormChange={setCustomKeyOpen}\n showEmptyState\n />\n </div>\n );\n }\n\n const visibleSecrets = secrets.filter(\n (secret) => secret.status !== \"unset\" || secret.key === openSecretKey,\n );\n const availableSecrets = secrets.filter(\n (secret) => secret.status === \"unset\" && secret.key !== openSecretKey,\n );\n\n return (\n <div className=\"space-y-3\">\n <KeysHeader\n availableSecrets={availableSecrets}\n onSecret={(key) => {\n setCustomKeyOpen(false);\n setOpenSecretKey(key);\n }}\n onCustomKey={() => {\n setOpenSecretKey(null);\n setCustomKeyOpen(true);\n }}\n />\n {visibleSecrets.length > 0 && (\n <div className=\"overflow-hidden rounded-md border border-border\">\n {visibleSecrets.map((secret) => (\n <SecretCard\n key={secret.key}\n secret={secret}\n onChanged={reload}\n open={openSecretKey === secret.key}\n onOpenChange={(open) => {\n if (open) setCustomKeyOpen(false);\n setOpenSecretKey(open ? secret.key : null);\n }}\n focusInput={openSecretKey === secret.key}\n />\n ))}\n </div>\n )}\n <AdHocKeysSection\n showForm={customKeyOpen}\n onShowFormChange={setCustomKeyOpen}\n showEmptyState={visibleSecrets.length === 0}\n />\n </div>\n );\n}\n\nfunction KeysHeader({\n availableSecrets = [],\n onSecret,\n onCustomKey,\n}: {\n availableSecrets?: SecretStatus[];\n onSecret?: (key: string) => void;\n onCustomKey: () => void;\n}) {\n return (\n <div className=\"flex items-center justify-between gap-3\">\n <p className=\"text-[11px] font-medium text-foreground\">Keys</p>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n type=\"button\"\n intent=\"neutral\"\n emphasis=\"outline\"\n className=\"inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground transition-colors hover:bg-accent/40 hover:text-foreground\"\n >\n <IconPlus size={11} />\n New\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-60\">\n {availableSecrets.length > 0 && (\n <>\n <DropdownMenuLabel>Choose a key</DropdownMenuLabel>\n {availableSecrets.map((secret) => (\n <DropdownMenuItem\n key={secret.key}\n onSelect={() => onSecret?.(secret.key)}\n className=\"flex items-center justify-between gap-3\"\n >\n <span className=\"truncate\">{secret.label}</span>\n {secret.required && (\n <span className=\"text-[9px] font-semibold uppercase tracking-wide text-amber-600 dark:text-amber-400\">\n Required\n </span>\n )}\n </DropdownMenuItem>\n ))}\n <DropdownMenuSeparator />\n </>\n )}\n <DropdownMenuItem onSelect={onCustomKey}>\n <IconPlus size={14} />\n Custom\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n}\n\ninterface SecretCardProps {\n secret: SecretStatus;\n onChanged: () => void;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n focusInput?: boolean;\n}\n\nfunction SecretCard({\n secret,\n onChanged,\n open,\n onOpenChange,\n focusInput,\n}: SecretCardProps) {\n const [value, setValue] = useState(\"\");\n const [busy, setBusy] = useState<null | \"save\" | \"delete\" | \"test\">(null);\n const [confirmDelete, setConfirmDelete] = useState(false);\n const [toast, setToast] = useState<{\n kind: \"ok\" | \"err\";\n text: string;\n } | null>(null);\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (open && focusInput && inputRef.current) {\n inputRef.current.focus();\n }\n }, [focusInput, open]);\n\n const setToastAndClear = (kind: \"ok\" | \"err\", text: string, ms = 2500) => {\n setToast({ kind, text });\n setTimeout(() => setToast(null), ms);\n };\n\n const handleSave = async () => {\n if (!value.trim() || busy) return;\n setBusy(\"save\");\n try {\n const res = await fetch(`${ENDPOINT}/${encodeURIComponent(secret.key)}`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ value: value.trim() }),\n });\n if (!res.ok) {\n const err = await res\n .json()\n .then((j: { error?: string }) => j.error)\n .catch(() => null);\n setToastAndClear(\"err\", err ?? `Save failed (${res.status})`);\n return;\n }\n setValue(\"\");\n setConfirmDelete(false);\n setToastAndClear(\"ok\", \"Saved\");\n notifySecretsChanged();\n onChanged();\n } finally {\n setBusy(null);\n }\n };\n\n const handleDelete = async () => {\n if (busy) return;\n setBusy(\"delete\");\n try {\n const res = await fetch(`${ENDPOINT}/${encodeURIComponent(secret.key)}`, {\n method: \"DELETE\",\n headers: { \"Content-Type\": \"application/json\" },\n });\n if (!res.ok) {\n const err = await res\n .json()\n .then((j: { error?: string }) => j.error)\n .catch(() => null);\n setToastAndClear(\"err\", err ?? `Delete failed (${res.status})`);\n return;\n }\n setToastAndClear(\"ok\", \"Removed\");\n setConfirmDelete(false);\n notifySecretsChanged();\n onChanged();\n } finally {\n setBusy(null);\n }\n };\n\n const handleTest = async () => {\n if (busy) return;\n setBusy(\"test\");\n try {\n const res = await fetch(\n `${ENDPOINT}/${encodeURIComponent(secret.key)}/test`,\n {\n method: \"POST\",\n },\n );\n const body = (await res.json().catch(() => ({}))) as {\n ok?: boolean;\n error?: string;\n };\n if (res.ok && body.ok) {\n setToastAndClear(\"ok\", \"Working\");\n } else {\n setToastAndClear(\n \"err\",\n body.error ?? (body.ok === false ? \"Invalid\" : `Test failed`),\n );\n }\n } finally {\n setBusy(null);\n }\n };\n\n const pill = useMemo(() => {\n if (secret.status === \"set\") {\n return (\n <span className=\"flex items-center gap-1 text-[10px] text-green-500\">\n <IconCheck size={10} />\n Set\n </span>\n );\n }\n if (secret.required) {\n return (\n <span className=\"rounded-full bg-red-500/15 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-red-500\">\n Required\n </span>\n );\n }\n return (\n <span className=\"rounded-full bg-accent/60 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground\">\n Optional\n </span>\n );\n }, [secret.status, secret.required]);\n\n const isOAuth = secret.kind === \"oauth\";\n\n return (\n <div className=\"border-b border-border last:border-b-0\">\n <Button\n type=\"button\"\n intent=\"neutral\"\n emphasis=\"ghost\"\n aria-expanded={open}\n onClick={() => onOpenChange(!open)}\n className=\"flex w-full items-center gap-2 px-2.5 py-2 text-start transition-colors hover:bg-accent/30\"\n >\n <IconChevronRight\n size={13}\n className={`shrink-0 text-muted-foreground transition-transform ${open ? \"rotate-90\" : \"\"}`}\n />\n <span className=\"min-w-0 flex-1 truncate text-[11px] font-medium text-foreground\">\n {secret.label}\n </span>\n {secret.status === \"set\" && secret.last4 && (\n <code className=\"text-[10px] text-muted-foreground\">\n ••••{secret.last4}\n </code>\n )}\n <span className=\"shrink-0\">{pill}</span>\n </Button>\n\n {open && (\n <div className=\"border-t border-border/60 bg-accent/20 px-3 pb-3 pt-2.5\">\n {secret.description && (\n <p className=\"mb-2 text-[10px] leading-relaxed text-muted-foreground\">\n {secret.description}\n </p>\n )}\n {isOAuth ? (\n <div className=\"mt-2 flex items-center gap-1.5\">\n {secret.oauthConnectUrl && (\n <a\n href={secret.oauthConnectUrl}\n className=\"inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium no-underline\"\n style={{ backgroundColor: \"#00B5FF\", color: \"white\" }}\n >\n <IconPlugConnected size={10} />\n {secret.status === \"set\" ? \"Reconnect\" : \"Connect\"}\n </a>\n )}\n {secret.docsUrl && (\n <a\n href={secret.docsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] no-underline text-muted-foreground hover:text-foreground\"\n >\n Docs\n <IconExternalLink size={10} />\n </a>\n )}\n </div>\n ) : (\n <div className=\"mt-2 space-y-1.5\">\n {secret.status === \"set\" && (\n <div className=\"flex items-center gap-2 text-[10px] text-muted-foreground\">\n <span>Stored value ending in</span>\n <code className=\"rounded bg-background px-1 py-0.5 text-foreground\">\n {secret.last4}\n </code>\n </div>\n )}\n <div className=\"flex gap-1.5\">\n <TextField\n inputRef={inputRef}\n type=\"password\"\n aria-label={secret.label}\n value={value}\n onChange={setValue}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") handleSave();\n }}\n placeholder={\n secret.status === \"set\"\n ? \"Enter new value to rotate\"\n : \"Paste key\"\n }\n className=\"flex-1 text-[11px]\"\n />\n <Button\n type=\"button\"\n intent=\"primary\"\n emphasis=\"solid\"\n onClick={handleSave}\n disabled={!value.trim() || busy !== null}\n className=\"inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium disabled:opacity-40\"\n style={{ backgroundColor: \"#00B5FF\", color: \"white\" }}\n >\n {busy === \"save\" ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : secret.status === \"set\" ? (\n <>\n <IconRefresh size={10} />\n Rotate\n </>\n ) : (\n \"Save\"\n )}\n </Button>\n </div>\n <div className=\"flex items-center gap-1.5\">\n {secret.status === \"set\" && (\n <>\n <Button\n type=\"button\"\n intent=\"neutral\"\n emphasis=\"outline\"\n onClick={handleTest}\n disabled={busy !== null}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-muted-foreground hover:text-foreground disabled:opacity-40\"\n >\n {busy === \"test\" ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Test\"\n )}\n </Button>\n <Button\n type=\"button\"\n intent=\"danger\"\n emphasis=\"outline\"\n onClick={() => setConfirmDelete(true)}\n disabled={busy !== null}\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-muted-foreground hover:text-red-500 disabled:opacity-40\"\n >\n <IconTrash size={10} />\n Remove\n </Button>\n </>\n )}\n {secret.docsUrl && (\n <a\n href={secret.docsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] no-underline text-muted-foreground hover:text-foreground ms-auto\"\n >\n Get key\n <IconExternalLink size={10} />\n </a>\n )}\n </div>\n {confirmDelete && (\n <div className=\"flex items-center gap-1.5 rounded border border-red-500/30 bg-red-500/10 px-2 py-1.5 text-[10px] text-red-500\">\n <span className=\"min-w-0 flex-1\">\n Remove this saved value?\n </span>\n <Button\n type=\"button\"\n intent=\"danger\"\n emphasis=\"solid\"\n onClick={handleDelete}\n disabled={busy !== null}\n className=\"inline-flex items-center gap-1 rounded border border-red-500/40 px-1.5 py-0.5 font-medium disabled:opacity-40\"\n >\n {busy === \"delete\" ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Confirm\"\n )}\n </Button>\n <Button\n type=\"button\"\n intent=\"neutral\"\n emphasis=\"outline\"\n onClick={() => setConfirmDelete(false)}\n disabled={busy !== null}\n className=\"rounded border border-border px-1.5 py-0.5 text-muted-foreground hover:text-foreground disabled:opacity-40\"\n >\n Cancel\n </Button>\n </div>\n )}\n </div>\n )}\n\n {toast && (\n <p\n className={`mt-1.5 text-[10px] ${\n toast.kind === \"ok\" ? \"text-green-500\" : \"text-red-500\"\n }`}\n >\n {toast.text}\n </p>\n )}\n </div>\n )}\n </div>\n );\n}\n\n// ─── Ad-hoc Keys Section ──────────────────────────────────────────────────\n\ninterface AdHocKey {\n name: string;\n scope: \"user\" | \"workspace\";\n scopeId: string;\n description: string | null;\n last4: string;\n createdAt: number;\n updatedAt: number;\n}\n\nconst ADHOC_ENDPOINT = agentNativePath(\"/_agent-native/secrets/adhoc\");\n\nfunction AdHocKeysSection({\n showForm,\n onShowFormChange,\n showEmptyState,\n}: {\n showForm: boolean;\n onShowFormChange: (show: boolean) => void;\n showEmptyState: boolean;\n}) {\n const [keys, setKeys] = useState<AdHocKey[]>([]);\n const [loading, setLoading] = useState(true);\n const [reloadToken, setReloadToken] = useState(0);\n const [formName, setFormName] = useState(\"\");\n const [formValue, setFormValue] = useState(\"\");\n const [formDescription, setFormDescription] = useState(\"\");\n const [formScope, setFormScope] = useState<\"user\" | \"workspace\">(\"user\");\n const [formBusy, setFormBusy] = useState(false);\n const [formError, setFormError] = useState<string | null>(null);\n const [confirmDeleteName, setConfirmDeleteName] = useState<string | null>(\n null,\n );\n const [deletingName, setDeletingName] = useState<string | null>(null);\n const [toast, setToast] = useState<{\n kind: \"ok\" | \"err\";\n text: string;\n } | null>(null);\n\n const showToast = useCallback(\n (kind: \"ok\" | \"err\", text: string, ms = 2500) => {\n setToast({ kind, text });\n setTimeout(() => setToast(null), ms);\n },\n [],\n );\n\n const reload = useCallback(() => setReloadToken((t) => t + 1), []);\n\n useEffect(() => {\n let cancelled = false;\n setLoading(true);\n fetch(ADHOC_ENDPOINT)\n .then(async (r) => {\n if (!r.ok) throw new Error(`Failed to load (${r.status})`);\n return (await r.json()) as AdHocKey[];\n })\n .then((data) => {\n if (!cancelled) {\n setKeys(data);\n setLoading(false);\n }\n })\n .catch(() => {\n if (!cancelled) {\n setKeys([]);\n setLoading(false);\n }\n });\n return () => {\n cancelled = true;\n };\n }, [reloadToken]);\n\n const resetForm = useCallback(() => {\n onShowFormChange(false);\n setFormName(\"\");\n setFormValue(\"\");\n setFormDescription(\"\");\n setFormScope(\"user\");\n setFormError(null);\n }, [onShowFormChange]);\n\n const handleAdd = useCallback(async () => {\n const name = formName.trim();\n const value = formValue.trim();\n if (!name || !value || formBusy) return;\n setFormBusy(true);\n setFormError(null);\n try {\n const res = await fetch(ADHOC_ENDPOINT, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n name,\n value,\n description: formDescription.trim() || undefined,\n scope: formScope,\n }),\n });\n if (!res.ok) {\n const body = await res\n .json()\n .then((j: { error?: string }) => j.error)\n .catch(() => null);\n setFormError(body ?? `Save failed (${res.status})`);\n return;\n }\n resetForm();\n showToast(\"ok\", \"Key saved\");\n notifySecretsChanged();\n reload();\n } catch (err: any) {\n setFormError(err?.message ?? \"Failed to save\");\n } finally {\n setFormBusy(false);\n }\n }, [\n formName,\n formValue,\n formDescription,\n formScope,\n formBusy,\n resetForm,\n showToast,\n reload,\n ]);\n\n const handleDelete = useCallback(\n async (name: string) => {\n setDeletingName(name);\n try {\n const res = await fetch(\n `${ADHOC_ENDPOINT}/${encodeURIComponent(name)}`,\n {\n method: \"DELETE\",\n headers: { \"Content-Type\": \"application/json\" },\n },\n );\n if (!res.ok) {\n showToast(\"err\", \"Failed to delete key\");\n return;\n }\n showToast(\"ok\", \"Key deleted\");\n setConfirmDeleteName(null);\n notifySecretsChanged();\n reload();\n } finally {\n setDeletingName(null);\n }\n },\n [showToast, reload],\n );\n\n return (\n <div className=\"space-y-2\">\n {showForm && (\n <div className=\"rounded-md border border-border px-2.5 py-2 bg-accent/30 space-y-1.5\">\n <TextField\n value={formName}\n onChange={(value) =>\n setFormName(value.toUpperCase().replace(/[^A-Z0-9_-]/g, \"\"))\n }\n className=\"w-full text-[11px]\"\n aria-label=\"Key name\"\n placeholder=\"KEY_NAME\"\n />\n <TextField\n type=\"password\"\n aria-label=\"Secret value\"\n value={formValue}\n onChange={setFormValue}\n className=\"w-full text-[11px]\"\n placeholder=\"Secret value\"\n />\n <TextField\n value={formDescription}\n aria-label=\"Description\"\n onChange={setFormDescription}\n className=\"w-full text-[11px]\"\n placeholder=\"Description (optional)\"\n />\n <div className=\"flex items-center gap-2\">\n <Picker\n mode=\"select\"\n options={[\n { value: \"user\", label: \"Personal\" },\n { value: \"workspace\", label: \"Workspace\" },\n ]}\n value={formScope}\n onChange={(value) => {\n if (value === \"user\" || value === \"workspace\") {\n setFormScope(value);\n }\n }}\n aria-label=\"Scope\"\n className=\"w-auto text-[11px]\"\n />\n <div className=\"ms-auto flex items-center gap-1.5\">\n <Button\n type=\"button\"\n intent=\"neutral\"\n emphasis=\"outline\"\n onClick={resetForm}\n className=\"rounded border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground hover:text-foreground\"\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n intent=\"primary\"\n emphasis=\"solid\"\n onClick={handleAdd}\n disabled={!formName.trim() || !formValue.trim() || formBusy}\n className=\"inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium disabled:opacity-40\"\n style={{ backgroundColor: \"#00B5FF\", color: \"white\" }}\n >\n {formBusy ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Save\"\n )}\n </Button>\n </div>\n </div>\n {formError && <p className=\"text-[10px] text-red-500\">{formError}</p>}\n </div>\n )}\n\n {loading ? (\n <div className=\"flex items-center gap-1.5 text-[10px] text-muted-foreground\">\n <IconLoader2 size={10} className=\"animate-spin\" />\n Loading...\n </div>\n ) : keys.length === 0 && !showForm && showEmptyState ? (\n <p className=\"text-[10px] text-muted-foreground\">No keys added yet.</p>\n ) : keys.length > 0 ? (\n <div className=\"overflow-hidden rounded-md border border-border\">\n {keys.map((key) => (\n <div\n key={`${key.scope}-${key.name}`}\n className=\"border-b border-border px-2.5 py-2 last:border-b-0\"\n >\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-[11px] font-medium text-foreground font-mono truncate\">\n {key.name}\n </span>\n <span\n className={`rounded-full px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide ${\n key.scope === \"workspace\"\n ? \"bg-blue-500/15 text-blue-500\"\n : \"bg-accent/60 text-muted-foreground\"\n }`}\n >\n {key.scope === \"workspace\" ? \"workspace\" : \"personal\"}\n </span>\n </div>\n {key.description && (\n <p className=\"text-[10px] text-muted-foreground mt-0.5\">\n {key.description}\n </p>\n )}\n <div className=\"flex items-center gap-2 text-[10px] text-muted-foreground mt-0.5\">\n <span>\n Ending in{\" \"}\n <code className=\"rounded bg-background px-1 py-0.5 text-foreground\">\n {key.last4}\n </code>\n </span>\n </div>\n </div>\n <div className=\"shrink-0\">\n {confirmDeleteName === key.name ? (\n <div className=\"flex items-center gap-1\">\n <Button\n type=\"button\"\n intent=\"danger\"\n emphasis=\"solid\"\n onClick={() => handleDelete(key.name)}\n disabled={deletingName === key.name}\n className=\"rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-red-500/15 text-red-500 hover:bg-red-500/25 disabled:opacity-40\"\n >\n {deletingName === key.name ? (\n <IconLoader2 size={10} className=\"animate-spin\" />\n ) : (\n \"Confirm\"\n )}\n </Button>\n <Button\n type=\"button\"\n intent=\"neutral\"\n emphasis=\"solid\"\n onClick={() => setConfirmDeleteName(null)}\n className=\"rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide bg-accent/60 text-muted-foreground hover:text-foreground\"\n >\n Cancel\n </Button>\n </div>\n ) : (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n intent=\"danger\"\n emphasis=\"ghost\"\n onClick={() => setConfirmDeleteName(key.name)}\n className=\"text-muted-foreground hover:text-red-500\"\n >\n <IconTrash size={12} />\n </Button>\n </TooltipTrigger>\n <TooltipContent>Delete</TooltipContent>\n </Tooltip>\n )}\n </div>\n </div>\n </div>\n ))}\n </div>\n ) : null}\n\n {toast && (\n <p\n className={`text-[10px] ${toast.kind === \"ok\" ? \"text-green-500\" : \"text-red-500\"}`}\n >\n {toast.text}\n </p>\n )}\n </div>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsPanel.d.ts","sourceRoot":"","sources":["../../../src/client/settings/SettingsPanel.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAQN,MAAM,OAAO,CAAC;AA2Cf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAwoB7D,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,MAAM,EACN,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,OAAO,GACR,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,qBAqDA;AAs+CD,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,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