@bevel-software/platform-core-frontend 0.14.0 → 0.19.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 (360) hide show
  1. package/THIRD-PARTY-NOTICES.md +2 -2
  2. package/package.json +3 -3
  3. package/src/core/CoreAppShell.tsx +34 -26
  4. package/src/core/__tests__/AppChrome.test.tsx +0 -3
  5. package/src/core/__tests__/bootstrap.test.ts +33 -1
  6. package/src/core/__tests__/events.test.ts +43 -0
  7. package/src/core/bootstrap.ts +38 -1
  8. package/src/core/events.ts +85 -3
  9. package/src/core/registry.ts +1 -1
  10. package/src/lib/__tests__/api.test.ts +38 -0
  11. package/src/lib/__tests__/email.test.ts +44 -0
  12. package/src/lib/api.ts +19 -2
  13. package/src/lib/email.ts +37 -1
  14. package/src/lib/utils.ts +2 -0
  15. package/src/modules/access/__tests__/ManageAccessDialog.add-row-picking.test.tsx +141 -0
  16. package/src/modules/access/__tests__/ManageAccessDialog.chip-truncation.test.tsx +204 -0
  17. package/src/modules/access/__tests__/ManageAccessDialog.download-read.test.tsx +234 -0
  18. package/src/modules/access/__tests__/ManageAccessDialog.edited-row-visible.test.tsx +160 -0
  19. package/src/modules/access/__tests__/ManageAccessDialog.placement.test.tsx +2 -2
  20. package/src/modules/access/__tests__/ManageAccessDialog.proposal.test.tsx +166 -0
  21. package/src/modules/access/__tests__/ManageAccessDialog.restrict.test.tsx +510 -0
  22. package/src/modules/access/__tests__/ManageAccessDialog.row-menu-axes.test.tsx +299 -0
  23. package/src/modules/access/__tests__/ManageAccessDialog.row-menu-width.test.tsx +226 -0
  24. package/src/modules/access/__tests__/ManageAccessDialog.test.tsx +781 -76
  25. package/src/modules/access/__tests__/ManageAccessDialog.unknown-email.test.tsx +314 -0
  26. package/src/modules/access/__tests__/manage-access-affordance.test.ts +14 -0
  27. package/src/modules/access/__tests__/plugin-token.test.ts +21 -0
  28. package/src/modules/access/__tests__/tailwindDeclarations.ts +210 -0
  29. package/src/modules/access/api.ts +192 -10
  30. package/src/modules/access/components/ManageAccessDialog.tsx +1337 -570
  31. package/src/modules/access/manage-access-affordance.ts +17 -0
  32. package/src/modules/admin/__tests__/AddMemberInput.test.tsx +297 -0
  33. package/src/modules/admin/__tests__/AdminRolesPage.capabilities.test.tsx +2 -2
  34. package/src/modules/admin/__tests__/AdminRolesPage.fixed-admin.test.tsx +189 -0
  35. package/src/modules/admin/__tests__/AdminRolesPage.suggest.test.tsx +1 -1
  36. package/src/modules/admin/__tests__/ConnectionKeysPage.test.tsx +266 -0
  37. package/src/modules/admin/__tests__/DirectoryGroupsPage.suggest.test.tsx +182 -0
  38. package/src/modules/admin/__tests__/DirectoryGroupsPage.test.tsx +165 -14
  39. package/src/modules/admin/__tests__/UserAccountsPage.test.tsx +401 -4
  40. package/src/modules/admin/__tests__/group-members-path.test.ts +27 -0
  41. package/src/modules/admin/components/AddMemberInput.tsx +268 -0
  42. package/src/modules/admin/components/AdminRolesPage.tsx +97 -132
  43. package/src/modules/admin/components/ConnectionKeysPage.tsx +269 -0
  44. package/src/modules/admin/components/DirectoryGroupsPage.tsx +91 -39
  45. package/src/modules/admin/components/UserAccountsPage.tsx +271 -37
  46. package/src/modules/admin/components/connection-keys-grouping.ts +43 -0
  47. package/src/modules/admin/components/group-members-path.ts +32 -0
  48. package/src/modules/admin/services/connection-keys.api.ts +47 -0
  49. package/src/modules/admin/services/roles.api.ts +12 -1
  50. package/src/modules/auth/__tests__/AccountPage.test.tsx +50 -2
  51. package/src/modules/auth/components/AccountPage.tsx +73 -54
  52. package/src/modules/auth/components/LoginScreen.tsx +1 -0
  53. package/src/modules/auth/services/account.api.ts +78 -4
  54. package/src/modules/change-requests/__tests__/ChangeRequestDialog.access-rules.test.tsx +144 -0
  55. package/src/modules/change-requests/__tests__/ChangeRequestDialog.binary.test.tsx +422 -0
  56. package/src/modules/change-requests/__tests__/ChangeRequestDialog.brings-itself-up-to-date.test.tsx +431 -0
  57. package/src/modules/change-requests/__tests__/ChangeRequestDialog.fork-point.test.tsx +193 -0
  58. package/src/modules/change-requests/__tests__/ChangeRequestDialog.initial-file.test.tsx +142 -0
  59. package/src/modules/change-requests/__tests__/ChangeRequestDialog.moved.test.tsx +202 -0
  60. package/src/modules/change-requests/__tests__/ChangeRequestDialog.test.tsx +205 -13
  61. package/src/modules/change-requests/__tests__/ChangeRequestDialog.unreadable.test.tsx +271 -0
  62. package/src/modules/change-requests/__tests__/FileChangeBoxes.test.tsx +208 -0
  63. package/src/modules/change-requests/__tests__/apply-outcome-for-every-viewer.test.tsx +286 -0
  64. package/src/modules/change-requests/__tests__/propose.concurrent.test.ts +273 -0
  65. package/src/modules/change-requests/__tests__/readFailure.test.ts +122 -0
  66. package/src/modules/change-requests/__tests__/useCrFileDiffs.test.tsx +238 -0
  67. package/src/modules/change-requests/__tests__/useFileOnBranch.test.tsx +56 -1
  68. package/src/modules/change-requests/__tests__/useForkPointFile.test.tsx +79 -0
  69. package/src/modules/change-requests/components/BranchFilePreview.tsx +357 -0
  70. package/src/modules/change-requests/components/ChangeBox.tsx +31 -2
  71. package/src/modules/change-requests/components/ChangeRequestDialog.tsx +862 -72
  72. package/src/modules/change-requests/components/CrFileTree.tsx +74 -58
  73. package/src/modules/change-requests/components/FileChangeBoxes.tsx +19 -15
  74. package/src/modules/change-requests/hooks/useApplyChangeRequest.ts +41 -7
  75. package/src/modules/change-requests/hooks/useCrFileDiffs.ts +181 -23
  76. package/src/modules/change-requests/hooks/useFileOnBranch.ts +70 -7
  77. package/src/modules/change-requests/hooks/useForkPointFile.ts +77 -0
  78. package/src/modules/change-requests/services/change-requests.api.ts +57 -1
  79. package/src/modules/change-requests/services/denied-file.api.ts +53 -0
  80. package/src/modules/change-requests/services/propose.api.ts +97 -8
  81. package/src/modules/change-requests/utils/approval.ts +15 -0
  82. package/src/modules/change-requests/utils/author.ts +32 -0
  83. package/src/modules/change-requests/utils/readFailure.ts +110 -0
  84. package/src/modules/git/__tests__/FileHistoryPanel.test.tsx +20 -0
  85. package/src/modules/git/__tests__/GitSyncFailedBanner.test.tsx +65 -1
  86. package/src/modules/git/components/FileHistoryPanel.tsx +5 -0
  87. package/src/modules/git/components/GitSyncFailedBanner.tsx +68 -5
  88. package/src/modules/git/components/PullRequestsForMe.tsx +51 -24
  89. package/src/modules/git/services/__tests__/error-messages.test.ts +29 -0
  90. package/src/modules/git/services/error-messages.ts +12 -0
  91. package/src/modules/git/services/pr-prompts.ts +5 -5
  92. package/src/modules/layout/__tests__/HeaderAlignment.test.tsx +401 -0
  93. package/src/modules/layout/__tests__/SidebarFooterGrid.test.tsx +286 -0
  94. package/src/modules/layout/__tests__/SidebarFrameResponsive.test.tsx +61 -0
  95. package/src/modules/layout/components/AppLayout.tsx +2 -0
  96. package/src/modules/layout/components/MobileChatLayout.tsx +4 -1
  97. package/src/modules/layout/components/ResizableThreePaneLayout.tsx +4 -1
  98. package/src/modules/layout/components/SidebarFrame.tsx +109 -4
  99. package/src/modules/library/__tests__/AddToPluginDialog.test.tsx +171 -5
  100. package/src/modules/library/__tests__/DeleteToolDialog.test.tsx +356 -0
  101. package/src/modules/library/__tests__/IntegrationsSetupReminder.test.tsx +60 -0
  102. package/src/modules/library/__tests__/LibraryCard.test.tsx +91 -10
  103. package/src/modules/library/__tests__/LibraryRoutes.test.tsx +242 -107
  104. package/src/modules/library/__tests__/LibrarySidebarMenu.test.tsx +104 -99
  105. package/src/modules/library/__tests__/LinkSkillPanel.test.tsx +136 -0
  106. package/src/modules/library/__tests__/LockedPluginView.test.tsx +103 -7
  107. package/src/modules/library/__tests__/NewPluginDialog.test.tsx +18 -8
  108. package/src/modules/library/__tests__/PersonalAddDialog.test.tsx +79 -3
  109. package/src/modules/library/__tests__/PersonalPluginPage.test.tsx +201 -0
  110. package/src/modules/library/__tests__/PluginExtras.test.tsx +115 -9
  111. package/src/modules/library/__tests__/PluginJoinRequests.test.tsx +60 -1
  112. package/src/modules/library/__tests__/PluginPage.test.tsx +453 -7
  113. package/src/modules/library/__tests__/PluginsSidebar.contextmenu.test.tsx +17 -57
  114. package/src/modules/library/__tests__/PluginsSidebar.test.tsx +161 -97
  115. package/src/modules/library/__tests__/PluginsSidebarMenu.test.tsx +16 -0
  116. package/src/modules/library/__tests__/SharedViaPlugins.test.tsx +106 -0
  117. package/src/modules/library/__tests__/SkillPage.test.tsx +391 -78
  118. package/src/modules/library/__tests__/SkillsTree.test.tsx +461 -0
  119. package/src/modules/library/__tests__/ToolConnectionSection.test.tsx +582 -71
  120. package/src/modules/library/__tests__/ToolPage.test.tsx +94 -4
  121. package/src/modules/library/__tests__/WorkspaceItemRoute.test.tsx +279 -21
  122. package/src/modules/library/__tests__/auth-harness.tsx +9 -9
  123. package/src/modules/library/__tests__/card-row-menu.test.tsx +320 -0
  124. package/src/modules/library/__tests__/library-data.mapping.test.tsx +98 -0
  125. package/src/modules/library/__tests__/library-data.stale.test.tsx +183 -0
  126. package/src/modules/library/__tests__/library-data.test.ts +7 -0
  127. package/src/modules/library/__tests__/library-paths.test.ts +75 -0
  128. package/src/modules/library/__tests__/link-membership.test.ts +129 -0
  129. package/src/modules/library/__tests__/name-with-badges.test.tsx +273 -0
  130. package/src/modules/library/__tests__/newSkillMarkdown.test.ts +30 -0
  131. package/src/modules/library/__tests__/owner-pill.test.tsx +357 -0
  132. package/src/modules/library/__tests__/pending-tools.test.tsx +400 -0
  133. package/src/modules/library/__tests__/plugin-entries.test.ts +122 -0
  134. package/src/modules/library/__tests__/plugin-summary.test.ts +67 -0
  135. package/src/modules/library/__tests__/status.test.ts +82 -2
  136. package/src/modules/library/__tests__/tools.api.test.ts +44 -1
  137. package/src/modules/library/__tests__/useJoinRequests.test.tsx +46 -0
  138. package/src/modules/library/components/AccessRequestsBanner.tsx +85 -47
  139. package/src/modules/library/components/AddDialogTabs.tsx +103 -0
  140. package/src/modules/library/components/AddToPluginDialog.tsx +107 -18
  141. package/src/modules/library/components/IntegrationsSetupReminder.tsx +59 -0
  142. package/src/modules/library/components/ItemActionsMenu.tsx +288 -0
  143. package/src/modules/library/components/LibraryCard.tsx +149 -34
  144. package/src/modules/library/components/LibraryLayout.tsx +120 -247
  145. package/src/modules/library/components/LibraryPage.tsx +172 -39
  146. package/src/modules/library/components/LinkSkillPanel.tsx +169 -0
  147. package/src/modules/library/components/LockedPluginView.tsx +63 -35
  148. package/src/modules/library/components/NameWithBadges.tsx +164 -0
  149. package/src/modules/library/components/NewPluginDialog.tsx +19 -5
  150. package/src/modules/library/components/PageActions.tsx +31 -9
  151. package/src/modules/library/components/{PendingSkillReview.tsx → PendingItemReview.tsx} +14 -7
  152. package/src/modules/library/components/PersonalAddDialog.tsx +68 -18
  153. package/src/modules/library/components/PersonalPluginPage.tsx +123 -23
  154. package/src/modules/library/components/PluginExtras.tsx +143 -18
  155. package/src/modules/library/components/PluginIndexRow.tsx +47 -12
  156. package/src/modules/library/components/PluginPage.tsx +234 -38
  157. package/src/modules/library/components/PluginRows.tsx +286 -0
  158. package/src/modules/library/components/PluginsSidebar.tsx +271 -238
  159. package/src/modules/library/components/PluginsSidebarMenu.tsx +26 -1
  160. package/src/modules/library/components/RenamePluginDialog.tsx +136 -0
  161. package/src/modules/library/components/ShareButton.tsx +17 -0
  162. package/src/modules/library/components/SkillsTree.tsx +204 -0
  163. package/src/modules/library/components/StatusDot.tsx +1 -0
  164. package/src/modules/library/components/TeamRoute.tsx +15 -0
  165. package/src/modules/library/components/__tests__/upload-notices-once-per-page.test.tsx +144 -0
  166. package/src/modules/library/components/plugin-page-parts.tsx +132 -23
  167. package/src/modules/library/components/skill-page/SharedViaPlugins.tsx +212 -0
  168. package/src/modules/library/components/skill-page/SkillFilePane.tsx +5 -0
  169. package/src/modules/library/components/skill-page/SkillPage.tsx +337 -121
  170. package/src/modules/library/components/tool-page/DeleteToolDialog.tsx +218 -0
  171. package/src/modules/library/components/tool-page/ToolConnectionSection.tsx +79 -178
  172. package/src/modules/library/components/tool-page/ToolPage.tsx +116 -17
  173. package/src/modules/library/components/tool-page/ToolVarRow.tsx +42 -41
  174. package/src/modules/library/hooks/__tests__/useLibraryData.test.ts +98 -0
  175. package/src/modules/library/hooks/useJoinRequests.ts +48 -18
  176. package/src/modules/library/hooks/useLibraryData.ts +92 -19
  177. package/src/modules/library/routes/LibraryRoutes.tsx +14 -11
  178. package/src/modules/library/routes/WorkspaceItemRoute.tsx +229 -82
  179. package/src/modules/library/routes/library-paths.ts +46 -35
  180. package/src/modules/library/services/library.api.ts +89 -17
  181. package/src/modules/library/services/plugins.api.ts +161 -9
  182. package/src/modules/library/services/teams.api.ts +15 -0
  183. package/src/modules/library/services/tools.api.ts +78 -0
  184. package/src/modules/library/state/library-data.tsx +268 -37
  185. package/src/modules/library/utils/personal-plugin.ts +13 -15
  186. package/src/modules/library/utils/plugin-entries.ts +134 -0
  187. package/src/modules/library/utils/plugin-summary.ts +102 -0
  188. package/src/modules/library/utils/status.ts +204 -35
  189. package/src/modules/onboarding/__tests__/creator-welcome.test.tsx +11 -3
  190. package/src/modules/onboarding/__tests__/onboarding.test.tsx +853 -760
  191. package/src/modules/onboarding/agent-clients.ts +55 -23
  192. package/src/modules/onboarding/components/ConnectAgentPill.tsx +5 -1
  193. package/src/modules/onboarding/components/WelcomePage.tsx +98 -62
  194. package/src/modules/pr/services/pr-merge.api.ts +2 -1
  195. package/src/modules/review/components/MarkdownDiffViewer.tsx +53 -8
  196. package/src/modules/review/components/ReviewPanel.tsx +15 -17
  197. package/src/modules/review/components/__tests__/MarkdownDiffViewer.test.tsx +64 -0
  198. package/src/modules/review/components/__tests__/ReviewPanel.test.tsx +25 -1
  199. package/src/modules/secrets-vault/components/ConnectToolsPage.tsx +454 -117
  200. package/src/modules/secrets-vault/components/SecretsPage.tsx +48 -7
  201. package/src/modules/secrets-vault/components/ToolSecretsPanel.tsx +84 -5
  202. package/src/modules/secrets-vault/components/__tests__/ConnectToolsPage.test.tsx +425 -0
  203. package/src/modules/secrets-vault/components/__tests__/SecretsPage.test.tsx +417 -82
  204. package/src/modules/secrets-vault/components/__tests__/ToolSecretsPanel.test.tsx +105 -0
  205. package/src/modules/secrets-vault/components/__tests__/connect-lists-what-the-banner-counted.test.tsx +407 -0
  206. package/src/modules/secrets-vault/probe/SavedKeyProbeResult.tsx +98 -0
  207. package/src/modules/secrets-vault/probe/__tests__/probe-verdict.test.ts +160 -0
  208. package/src/modules/secrets-vault/probe/probe-verdict.ts +108 -0
  209. package/src/modules/secrets-vault/probe/useSavedKeyProbe.ts +228 -0
  210. package/src/modules/secrets-vault/services/connect.api.ts +36 -5
  211. package/src/modules/secrets-vault/utils/connect-status.ts +98 -0
  212. package/src/modules/settings/components/ClaudeConnectionCard.tsx +154 -0
  213. package/src/modules/settings/components/ClaudeConnectionFields.tsx +23 -0
  214. package/src/modules/settings/components/DeploymentPage.tsx +16 -22
  215. package/src/modules/settings/components/MarketplaceSection.tsx +152 -0
  216. package/src/modules/settings/components/__tests__/ClaudeConnectionCard.test.tsx +63 -0
  217. package/src/modules/settings/components/__tests__/DeploymentPage.test.tsx +74 -1
  218. package/src/modules/settings/components/__tests__/MarketplaceSection.test.tsx +325 -0
  219. package/src/modules/settings/components/__tests__/SettingsLayout.test.tsx +5 -5
  220. package/src/modules/settings/services/github-facade.api.ts +66 -0
  221. package/src/modules/settings/settings-nav-items.tsx +10 -2
  222. package/src/modules/setup/__tests__/setup.oidc.test.tsx +172 -0
  223. package/src/modules/setup/__tests__/setup.probe-refusal.test.tsx +123 -0
  224. package/src/modules/setup/__tests__/setup.test.tsx +615 -4
  225. package/src/modules/setup/__tests__/useSetupStatus.test.tsx +130 -0
  226. package/src/modules/setup/components/SetupGate.tsx +16 -16
  227. package/src/modules/setup/components/SetupScreen.tsx +711 -40
  228. package/src/modules/setup/hooks/useSetupStatus.ts +93 -0
  229. package/src/modules/setup/services/setup.api.ts +218 -3
  230. package/src/modules/setup/utils/__tests__/root-folders.test.ts +72 -0
  231. package/src/modules/setup/utils/root-folders.ts +46 -0
  232. package/src/modules/toolbar/assets/claude-setup/01-add-manually.webp +0 -0
  233. package/src/modules/toolbar/assets/claude-setup/02-add-configuration.webp +0 -0
  234. package/src/modules/toolbar/assets/claude-setup/03-connect-account.webp +0 -0
  235. package/src/modules/toolbar/assets/claude-setup/04-pick-instance.webp +0 -0
  236. package/src/modules/toolbar/assets/claude-setup/05-plugins-add.webp +0 -0
  237. package/src/modules/toolbar/assets/claude-setup/06-add-marketplace.webp +0 -0
  238. package/src/modules/toolbar/assets/claude-setup/07-paste-url-sync.webp +0 -0
  239. package/src/modules/toolbar/assets/claude-setup/08-install-plugins.webp +0 -0
  240. package/src/modules/toolbar/assets/claude-setup/09-select-repository.webp +0 -0
  241. package/src/modules/toolbar/assets/claude-setup/10-connector-not-added.webp +0 -0
  242. package/src/modules/toolbar/assets/claude-setup/11-add-custom-connector.webp +0 -0
  243. package/src/modules/toolbar/assets/claude-setup/README.md +68 -0
  244. package/src/modules/toolbar/components/AgentInstructionsCard.tsx +296 -0
  245. package/src/modules/toolbar/components/ClaudeMarketplaceCarousel.tsx +107 -0
  246. package/src/modules/toolbar/components/ClaudeRegistrationSteps.tsx +127 -0
  247. package/src/modules/toolbar/components/CoworkSetupSteps.tsx +100 -0
  248. package/src/modules/toolbar/components/ExternalAgentAccessPage.tsx +395 -124
  249. package/src/modules/toolbar/components/ScreenshotStep.tsx +77 -0
  250. package/src/modules/toolbar/components/SetupCarousel.tsx +177 -0
  251. package/src/modules/toolbar/components/__tests__/AgentInstructionsCard.test.tsx +370 -0
  252. package/src/modules/toolbar/components/__tests__/ExternalAgentAccessPage.test.tsx +659 -36
  253. package/src/modules/toolbar/components/__tests__/Toolbar.test.tsx +2 -2
  254. package/src/modules/toolbar/components/__tests__/claude-setup-shots.test.ts +104 -0
  255. package/src/modules/toolbar/components/claude-connector-slide.tsx +38 -0
  256. package/src/modules/toolbar/components/claude-setup-shots.ts +167 -0
  257. package/src/modules/toolbar/components/deployment-address.ts +29 -0
  258. package/src/modules/toolbar/components/setup-step-parts.tsx +35 -0
  259. package/src/modules/toolbar/services/__tests__/agent-instructions.api.test.ts +89 -0
  260. package/src/modules/toolbar/services/agent-instructions.api.ts +167 -0
  261. package/src/modules/toolbar/services/external-api-keys.api.ts +8 -0
  262. package/src/modules/workflow/state/ChangeRequestStaleBinder.tsx +43 -0
  263. package/src/modules/workflow/state/EventBusProvider.tsx +122 -11
  264. package/src/modules/workflow/state/__tests__/EventBusProvider.storage.test.tsx +87 -0
  265. package/src/modules/workflow/state/__tests__/EventBusProvider.watch.test.tsx +223 -0
  266. package/src/modules/workflow/state/event-bus.context.ts +10 -0
  267. package/src/modules/workspace/__tests__/testFixtures.ts +6 -3
  268. package/src/modules/workspace/components/FileExplorer.tsx +1527 -367
  269. package/src/modules/workspace/components/FileRoute.tsx +376 -22
  270. package/src/modules/workspace/components/FileViewer.tsx +166 -45
  271. package/src/modules/workspace/components/KbDocumentShell.tsx +50 -6
  272. package/src/modules/workspace/components/KbPageHeader.tsx +120 -55
  273. package/src/modules/workspace/components/TreeActionConfirm.tsx +350 -0
  274. package/src/modules/workspace/components/__tests__/FileExplorer.test.tsx +2473 -129
  275. package/src/modules/workspace/components/__tests__/FileRoute.test.tsx +768 -16
  276. package/src/modules/workspace/components/__tests__/FileViewer.test.tsx +332 -12
  277. package/src/modules/workspace/components/__tests__/KbDocumentShell.test.tsx +39 -0
  278. package/src/modules/workspace/components/__tests__/KbPageHeader.test.tsx +33 -20
  279. package/src/modules/workspace/components/renderers/DocxRenderer.tsx +4 -5
  280. package/src/modules/workspace/components/renderers/DownloadFileButton.tsx +13 -4
  281. package/src/modules/workspace/components/renderers/EmailRenderer.tsx +4 -3
  282. package/src/modules/workspace/components/renderers/HtmlRenderer.tsx +8 -14
  283. package/src/modules/workspace/components/renderers/ImageRenderer.tsx +75 -16
  284. package/src/modules/workspace/components/renderers/KbImage.tsx +180 -0
  285. package/src/modules/workspace/components/renderers/KbMarkdownView.tsx +22 -6
  286. package/src/modules/workspace/components/renderers/MarkdownRenderer.tsx +48 -22
  287. package/src/modules/workspace/components/renderers/PdfRenderer.tsx +4 -5
  288. package/src/modules/workspace/components/renderers/PptxRenderer.tsx +4 -3
  289. package/src/modules/workspace/components/renderers/XlsxRenderer.tsx +4 -3
  290. package/src/modules/workspace/components/renderers/__tests__/DocxRenderer.test.tsx +12 -0
  291. package/src/modules/workspace/components/renderers/__tests__/DownloadFileButton.test.tsx +57 -9
  292. package/src/modules/workspace/components/renderers/__tests__/EmailRenderer.test.tsx +13 -1
  293. package/src/modules/workspace/components/renderers/__tests__/ImageRenderer.test.tsx +163 -0
  294. package/src/modules/workspace/components/renderers/__tests__/KbMarkdownView.test.tsx +237 -0
  295. package/src/modules/workspace/components/renderers/__tests__/MarkdownRenderer.test.tsx +108 -14
  296. package/src/modules/workspace/components/renderers/__tests__/PptxRenderer.test.tsx +14 -1
  297. package/src/modules/workspace/components/renderers/__tests__/XlsxRenderer.test.tsx +16 -1
  298. package/src/modules/workspace/components/renderers/__tests__/rendererSelection.test.tsx +66 -1
  299. package/src/modules/workspace/components/renderers/index.ts +53 -2
  300. package/src/modules/workspace/components/renderers/kbMarkdownPipeline.tsx +25 -4
  301. package/src/modules/workspace/components/renderers/rendererWorkspace.ts +40 -0
  302. package/src/modules/workspace/hooks/__tests__/useImageRevision.test.tsx +174 -0
  303. package/src/modules/workspace/hooks/__tests__/useOpenChangeRequests.test.tsx +179 -1
  304. package/src/modules/workspace/hooks/__tests__/useWorkspaceImageResolver.test.tsx +122 -0
  305. package/src/modules/workspace/hooks/__tests__/useWorkspaceState.test.tsx +892 -7
  306. package/src/modules/workspace/hooks/useImageRevision.ts +101 -0
  307. package/src/modules/workspace/hooks/useMergedWorkspaceTree.ts +89 -0
  308. package/src/modules/workspace/hooks/useWorkspaceImageResolver.ts +55 -0
  309. package/src/modules/workspace/hooks/useWorkspaceState.ts +438 -66
  310. package/src/modules/workspace/routing/__tests__/kb-routes.test.tsx +279 -3
  311. package/src/modules/workspace/routing/kb-routes.ts +207 -30
  312. package/src/modules/workspace/services/__tests__/workspace.api.test.ts +57 -1
  313. package/src/modules/workspace/services/workspace.api.ts +57 -4
  314. package/src/modules/workspace/state/__tests__/applied-request-clears-pending.test.tsx +343 -0
  315. package/src/modules/workspace/state/__tests__/upload-lands-where-it-was-dropped.test.tsx +158 -0
  316. package/src/modules/workspace/state/open-change-requests.tsx +100 -12
  317. package/src/modules/workspace/state/workspace.context.ts +130 -16
  318. package/src/modules/workspace/utils/__tests__/file-trace.test.ts +73 -0
  319. package/src/modules/workspace/utils/__tests__/fileTree.test.ts +234 -5
  320. package/src/modules/workspace/utils/__tests__/pasteLink.test.ts +76 -0
  321. package/src/modules/workspace/utils/__tests__/treeConfirm.test.ts +364 -0
  322. package/src/modules/workspace/utils/__tests__/uploadError.test.ts +35 -0
  323. package/src/modules/workspace/utils/file-trace.ts +50 -0
  324. package/src/modules/workspace/utils/fileTree.ts +126 -52
  325. package/src/modules/workspace/utils/frontmatter.ts +8 -4
  326. package/src/modules/workspace/utils/pasteLink.ts +90 -0
  327. package/src/modules/workspace/utils/treeConfirm.ts +338 -0
  328. package/src/modules/workspace/utils/uploadError.ts +29 -0
  329. package/src/shared/__tests__/marketplace-url.test.ts +59 -0
  330. package/src/shared/components/Badge.tsx +3 -1
  331. package/src/shared/components/Banner.tsx +5 -1
  332. package/src/shared/components/Button.tsx +16 -2
  333. package/src/shared/components/Dialog.tsx +27 -11
  334. package/src/shared/components/Menu.tsx +13 -1
  335. package/src/shared/components/PageShell.tsx +13 -8
  336. package/src/shared/components/__tests__/primitives.test.tsx +116 -2
  337. package/src/shared/components/__tests__/useFocusHandoff.test.tsx +192 -0
  338. package/src/shared/components/index.ts +2 -0
  339. package/src/shared/components/useDismissableMenu.ts +32 -10
  340. package/src/shared/components/useFocusHandoff.ts +51 -0
  341. package/src/shared/components/useLatestRef.ts +28 -0
  342. package/src/shared/markdown/Markdown.tsx +12 -3
  343. package/src/shared/markdown/__tests__/escapeSpacesInLinkDestinations.test.ts +39 -0
  344. package/src/shared/markdown/hrefs.ts +50 -0
  345. package/src/shared/marketplace-url.ts +118 -0
  346. package/src/shared/mcp/ChatGptInstallLink.tsx +3 -3
  347. package/src/shared/mcp/ConnectionInstructions.tsx +38 -27
  348. package/src/shared/mcp/__tests__/connect-snippets.test.ts +3 -3
  349. package/src/shared/mcp/connect-snippets.ts +14 -9
  350. package/src/shared/mcp/index.ts +1 -1
  351. package/src/shared/theme/__tests__/header-band.test.ts +197 -0
  352. package/src/shared/theme/header.ts +75 -0
  353. package/src/shared/theme/measure.ts +7 -4
  354. package/src/shared/theme/tokens.css +34 -0
  355. package/src/modules/library/__tests__/PluginsIndexPage.test.tsx +0 -363
  356. package/src/modules/library/__tests__/PluginsSidebar.locked.test.tsx +0 -97
  357. package/src/modules/library/components/PluginsIndexPage.tsx +0 -265
  358. package/src/modules/update-check/__tests__/UpdateBanner.test.tsx +0 -126
  359. package/src/modules/update-check/components/UpdateBanner.tsx +0 -92
  360. package/src/modules/update-check/services/update-check.api.ts +0 -24
@@ -6,7 +6,8 @@ import { PageShell } from '../../../shared/components/PageShell';
6
6
  import { buttonClasses } from '../../../shared/components';
7
7
  import { formatRelativeTime } from '../../../lib/utils';
8
8
  import {
9
- ConnectionInstructions,
9
+ AssistantConnectionInstructions,
10
+ OtherAgentConnectionInstructions,
10
11
  CopyBlock,
11
12
  claudeCodeCommand,
12
13
  hexisMcpClaudeCommand,
@@ -17,6 +18,10 @@ import {
17
18
  useCopyFeedback,
18
19
  workspaceBaseUrl,
19
20
  } from '../../../shared/mcp';
21
+ import { CODEX_LOGIN_NOTE, GITHUB_LINK_KIND, marketplaceCommands, marketplaceGitUrl } from '../../../shared/marketplace-url';
22
+ import { AgentInstructionsCard } from './AgentInstructionsCard';
23
+ import { CoworkSetupSteps } from './CoworkSetupSteps';
24
+ import { useAdmin } from '../../admin/state/admin.context';
20
25
  import {
21
26
  type ExternalApiKeySummary,
22
27
  type MintedExternalApiKey,
@@ -38,12 +43,17 @@ function formatRelative(ts: number | null): string {
38
43
 
39
44
  /**
40
45
  * The External agent access page, routed standalone at
41
- * `/external-agent-access` (below the persistent toolbar), in two tabs:
46
+ * `/external-agent-access` (below the persistent toolbar), in three tabs:
42
47
  *
43
48
  * - "Your agent" (default) — connecting the user's own interactive agent
44
- * (Claude Code, Claude Desktop, Cursor…). No key: the agent gets only the
49
+ * (Claude, ChatGPT, Claude Code, Cursor…). No key: the agent gets only the
45
50
  * server URL, and on first connect the browser opens our authorization
46
51
  * flow (sign in + choose tools on /connect). Copy-paste configs only.
52
+ * - "Marketplaces" — skills as native plugins rather than through the MCP
53
+ * server: the git remote Claude Code and Codex install from (with a key
54
+ * from the autonomous tab), and the Cowork / claude.ai route, where the
55
+ * person connects their Claude account and gets the marketplace compiled
56
+ * for what they may read. Their Claude links are listed here.
47
57
  * - "Autonomous agents" — the external-API-key surface for pipelines/CI
48
58
  * that can't open a browser: lists existing keys, mints new ones,
49
59
  * disconnects revoked ones, permanently deletes disconnected ones. The
@@ -73,7 +83,13 @@ export function ExternalAgentAccessPage() {
73
83
  */
74
84
  const workspaceUrl = workspaceBaseUrl();
75
85
 
76
- const [tab, setTab] = useState<'agent' | 'autonomous'>('agent');
86
+ const [tab, setTab] = useState<'agent' | 'marketplace' | 'autonomous'>('agent');
87
+ // Whether the Cowork drawer is expanded. Only the registration state waits
88
+ // on it; everything else in the drawer renders either way.
89
+ const [coworkOpen, setCoworkOpen] = useState(false);
90
+ // Only the wording of the "not set up yet" notice depends on this; the
91
+ // tutorial itself is the same for everyone.
92
+ const { isAdmin } = useAdmin();
77
93
  const [keys, setKeys] = useState<ExternalApiKeySummary[]>([]);
78
94
  const [loading, setLoading] = useState(false);
79
95
  const [loadError, setLoadError] = useState<string | null>(null);
@@ -160,7 +176,14 @@ export function ExternalAgentAccessPage() {
160
176
  // top, never-used ones last among the active), with disconnected keys sunk
161
177
  // to the bottom. Non-destructive — nothing is hidden or deleted, just ordered
162
178
  // so a long list of stale/test keys doesn't bury the ones in use.
163
- const sortedKeys = [...keys].sort((a, b) => {
179
+ // ONE list from the server, two views of it: live Claude links belong to
180
+ // the Marketplaces tab (they were minted by a connection, not created
181
+ // here), everything else — hand-made keys, and Claude links once
182
+ // disconnected, so they can be deleted — to the autonomous tab. Told
183
+ // apart by the stored kind, never the label.
184
+ const isClaudeLink = (k: ExternalApiKeySummary) => k.kind === GITHUB_LINK_KIND;
185
+ const claudeLinks = keys.filter((k) => isClaudeLink(k) && k.revokedAt === null);
186
+ const sortedKeys = keys.filter((k) => !isClaudeLink(k) || k.revokedAt !== null).sort((a, b) => {
164
187
  const aRevoked = a.revokedAt !== null;
165
188
  const bRevoked = b.revokedAt !== null;
166
189
  if (aRevoked !== bRevoked) return aRevoked ? 1 : -1;
@@ -169,11 +192,17 @@ export function ExternalAgentAccessPage() {
169
192
 
170
193
  return (
171
194
  <>
172
- <PageShell title="External agent access" padded={false}>
173
- <div className="flex border-b border-line px-4 shrink-0" role="tablist">
195
+ <PageShell title="External agent access" padded={false} card={false}>
196
+ <div className="space-y-4">
197
+ <section
198
+ className="bg-white border border-line rounded-lg overflow-hidden"
199
+ data-testid="agent-connection-section"
200
+ >
201
+ <div className="flex border-b border-line px-4 shrink-0" role="tablist">
174
202
  {(
175
203
  [
176
204
  ['agent', 'Your agent'],
205
+ ['marketplace', 'Marketplaces'],
177
206
  ['autonomous', 'Autonomous agents'],
178
207
  ] as const
179
208
  ).map(([id, name]) => (
@@ -191,28 +220,62 @@ export function ExternalAgentAccessPage() {
191
220
  {name}
192
221
  </button>
193
222
  ))}
194
- </div>
223
+ </div>
195
224
 
196
- {tab === 'agent' && (
225
+ {tab === 'agent' && (
197
226
  <div className="px-4 py-3 space-y-4">
198
227
  <p className="text-xs text-ink-muted leading-snug">
199
228
  Pick where your agent runs. Everything it saves appears under your name.
200
229
  </p>
201
- {/* LOCAL FIRST. The local server is the recommended connection for
202
- every agent that can run it — it serves everything the hosted
203
- endpoint does PLUS the plugins' local-only tools — so its drawer
204
- leads, and the hosted URL follows for the agents that cannot
205
- (web assistants, cloud platforms). Two CLOSED drawers, native
206
- <details> (the SecretsPage "Advanced" precedent): the choice is
207
- the headline, and neither config wall is worth reading until
208
- the reader has picked their side of it. */}
230
+ {/* CLAUDE AND CHATGPT FIRST, and OPEN. They are what most people
231
+ arriving here already use, and Claude's is the one connection
232
+ that is a single click — so the page opens on its button and
233
+ the address to paste, with nothing to expand first. The local
234
+ server follows for agents that run on your machine (it still
235
+ serves everything the hosted endpoint does PLUS the plugins'
236
+ local-only tools), then the configs for everything else. Native
237
+ <details> (the SecretsPage "Advanced" precedent); the second
238
+ and third stay closed, because neither config wall is worth
239
+ reading until the reader has picked their side of it.
240
+
241
+ `open` is a default, not controlled state: nothing here waits
242
+ on it, and a drawer that reopens on a tab switch is the page
243
+ returning to where it starts. */}
244
+ <details className="border border-line rounded" open>
245
+ <summary className="cursor-pointer px-3 py-2 text-xs font-medium text-ink">
246
+ Claude and ChatGPT
247
+ </summary>
248
+ <div className="px-3 pb-3 space-y-3">
249
+ <p className="text-meta text-ink-muted leading-snug">
250
+ claude.ai, Claude Desktop and ChatGPT connect to the hosted endpoint. No key
251
+ needed: the first time the agent connects, your browser opens so you can sign
252
+ in and choose which tools to share with it.
253
+ </p>
254
+ <AssistantConnectionInstructions mcpUrl={mcpUrl} />
255
+ {/* `buttonClasses`, not a hand-rolled class string — the one
256
+ button primitive exists because 171 sites once shared 153
257
+ variants between them, and its docstring prescribes exactly
258
+ this shape for links. */}
259
+ <Link
260
+ to="/connect"
261
+ target="_blank"
262
+ rel="noopener noreferrer"
263
+ className={buttonClasses({ variant: 'outline', size: 'sm', className: 'w-full' })}
264
+ >
265
+ <Wrench size={12} />
266
+ Configure your tools
267
+ <ExternalLink size={11} className="opacity-60" aria-hidden="true" />
268
+ </Link>
269
+ </div>
270
+ </details>
271
+
209
272
  <details className="border border-line rounded">
210
273
  <summary className="cursor-pointer px-3 py-2 text-xs font-medium text-ink">
211
274
  Desktop agents: Claude Code, Claude Desktop, Cursor, Windsurf, Cline and similar
212
275
  </summary>
213
276
  <div className="px-3 pb-3 space-y-2">
214
277
  <p className="text-meta text-ink-muted leading-snug">
215
- Recommended: runs this workspace as a local MCP server (needs Node), so the
278
+ Runs this workspace as a local MCP server (needs Node), so the
216
279
  agent gets everything the hosted endpoint serves, plus your plugins'
217
280
  local-only tools — the ones{' '}
218
281
  <span className="font-mono">list_local_tools</span> names. No key needed: the
@@ -227,8 +290,8 @@ export function ExternalAgentAccessPage() {
227
290
  </button>{' '}
228
291
  tab shows that setup.)
229
292
  </p>
230
- {/* "(local server)" disambiguates from the hosted drawer's
231
- ConnectionInstructions block, which labels ITS command
293
+ {/* "(local server)" disambiguates from the "Any other agent"
294
+ drawer's hosted block, which labels ITS command
232
295
  "Connect Claude Code" — two identically named blocks on one
233
296
  page with different commands is a paste-the-wrong-one trap. */}
234
297
  <CopyBlock
@@ -248,6 +311,36 @@ export function ExternalAgentAccessPage() {
248
311
  </p>
249
312
  <CopyBlock label={null} value={hexisMcpJsonSnippet(workspaceUrl)} rows={12} />
250
313
  </div>
314
+ {/* The same note the welcome page's Desktop agents hint carries,
315
+ and for the same reason: this is the config a GUI-launched
316
+ client reads, and that client was started by the window
317
+ server rather than by a login shell, so it never sourced the
318
+ profile that put Homebrew's or nvm's `npx` on PATH. The
319
+ snippet above stays plain `npx` — it is right for every
320
+ client launched from a terminal — and this says what to
321
+ substitute in the copy that is not. Both halves of the gap,
322
+ because an absolute `npx` is a script whose
323
+ `#!/usr/bin/env node` line looks `node` up on that same
324
+ PATH; and `where.exe npx`, because this paragraph sits under
325
+ "on Windows, prefer the JSON config", `which` is not a
326
+ command there, and a bare `where` is PowerShell's alias for
327
+ Where-Object. The path it prints holds backslashes, which
328
+ JSON needs doubled — said here, since the field is JSON. */}
329
+ <p className="text-meta text-ink-muted leading-snug">
330
+ Needs Node 22.13+ or 24 on the machine. If the client reports that{' '}
331
+ <span className="font-mono">npx</span> was not found, it was launched from the
332
+ Dock or a desktop icon and cannot see your shell's PATH: run{' '}
333
+ <span className="font-mono">which npx</span> in a terminal (
334
+ <span className="font-mono">where.exe npx</span> in PowerShell) and use the full
335
+ path it prints as the <span className="font-mono">"command"</span> above — on
336
+ Windows with each backslash doubled, or with forward slashes, since the field is
337
+ JSON. If it then reports{' '}
338
+ <span className="font-mono">env: node: No such file or directory</span>, that
339
+ same folder holds <span className="font-mono">node</span>: add it to the
340
+ config's <span className="font-mono">"env"</span> PATH, in front of the usual
341
+ system folders rather than instead of them — the sign-in opens your browser
342
+ through those.
343
+ </p>
251
344
  </div>
252
345
  </details>
253
346
 
@@ -257,29 +350,27 @@ export function ExternalAgentAccessPage() {
257
350
  </summary>
258
351
  <div className="px-3 pb-3 space-y-3">
259
352
  <p className="text-meta text-ink-muted leading-snug">
260
- claude.ai, ChatGPT and other agents that can't run a process on your machine
261
- connect to the hosted endpoint. No key needed: the first time the agent
262
- connects, your browser opens so you can sign in and choose which tools to
263
- share with it.
353
+ Claude Code, cloud platforms and other agents can connect to the same hosted
354
+ endpoint, without running anything on your machine. No key needed here
355
+ either: your browser opens to sign in the first time.
264
356
  </p>
265
- {/* `buttonClasses`, not a hand-rolled class string — the one
266
- button primitive exists because 171 sites once shared 153
267
- variants between them, and its docstring prescribes exactly
268
- this shape for links. */}
269
- <Link
270
- to="/connect"
271
- target="_blank"
272
- rel="noopener noreferrer"
273
- className={buttonClasses({ variant: 'outline', size: 'sm', className: 'w-full' })}
274
- >
275
- <Wrench size={12} />
276
- Configure your tools
277
- <ExternalLink size={11} className="opacity-60" aria-hidden="true" />
278
- </Link>
279
- <ConnectionInstructions mcpUrl={mcpUrl} />
357
+ <OtherAgentConnectionInstructions mcpUrl={mcpUrl} />
280
358
  </div>
281
359
  </details>
282
360
 
361
+ <p className="text-meta text-ink-muted leading-snug">
362
+ Prefer your skills installed as native plugins rather than read through the MCP
363
+ server? The{' '}
364
+ <button
365
+ type="button"
366
+ onClick={() => setTab('marketplace')}
367
+ className="underline text-ink-muted hover:text-ink"
368
+ >
369
+ Marketplaces
370
+ </button>{' '}
371
+ tab has the git remote for Claude Code and Codex, and the Cowork route.
372
+ </p>
373
+
283
374
  <p className="text-[11px] text-ink-muted leading-snug">
284
375
  Running an unattended pipeline or CI agent that can't open a browser? Use the{' '}
285
376
  <button
@@ -294,7 +385,122 @@ export function ExternalAgentAccessPage() {
294
385
  </div>
295
386
  )}
296
387
 
297
- {tab === 'autonomous' && (
388
+ {tab === 'marketplace' && (
389
+ <div className="px-4 py-3 space-y-4">
390
+ <p className="text-xs text-ink-muted leading-snug">
391
+ Every skill you may read, compiled into a plugin marketplace. One address serves
392
+ every Claude surface: Claude Code and Codex clone it as a git remote, Cowork and
393
+ claude.ai fetch it as a repository once your account is connected.
394
+ </p>
395
+
396
+ {/* CONTROLLED, both attributes together. A closed <details> still
397
+ MOUNTS its children, so the registration state waits on
398
+ `coworkOpen` and is read again each time the drawer opens.
399
+ `onToggle` alone is not enough: this subtree unmounts on a tab
400
+ switch and the fresh <details> comes back closed while the
401
+ state stayed true. With `open` bound too, the element cannot
402
+ disagree with the state that gates the read. */}
403
+ <details
404
+ className="border border-line rounded"
405
+ data-testid="cowork-section"
406
+ open={coworkOpen}
407
+ onToggle={(e) => setCoworkOpen(e.currentTarget.open)}
408
+ >
409
+ <summary className="cursor-pointer px-3 py-2 text-xs font-medium text-ink">
410
+ Cowork and claude.ai
411
+ </summary>
412
+ <div className="px-3 pb-3 space-y-3">
413
+ <CoworkSetupSteps isAdmin={isAdmin} opened={coworkOpen} />
414
+ <div className="space-y-1">
415
+ <div className="text-xs font-medium text-ink">Your Claude connections</div>
416
+ {loadError && (
417
+ <div className="text-xs text-red-600 bg-red-50 border border-red-200 rounded px-2 py-1.5">
418
+ {loadError}
419
+ </div>
420
+ )}
421
+ {loading ? (
422
+ <div className="text-meta text-ink-muted">Loading…</div>
423
+ ) : loadError ? null : claudeLinks.length === 0 ? (
424
+ <div className="text-meta text-ink-muted">
425
+ None yet. One appears here after you connect from Cowork or claude.ai.
426
+ </div>
427
+ ) : (
428
+ <ul className="divide-y divide-line border border-line rounded">
429
+ {claudeLinks.map((k) => (
430
+ <li key={k.id} className="flex items-center gap-3 px-3 py-2 text-sm">
431
+ <div className="flex-1 min-w-0">
432
+ <div className="font-medium truncate">{k.label}</div>
433
+ <div className="text-meta text-ink-muted">
434
+ Connected {formatRelative(k.createdAt)} · Last used {formatRelative(k.lastUsedAt)}
435
+ </div>
436
+ </div>
437
+ <button
438
+ onClick={() => handleDisconnect(k.id)}
439
+ className="text-xs px-2 py-1 rounded text-ink hover:bg-hover border border-line"
440
+ title="Disconnect this Claude account. Its marketplace stops updating; connect again from Claude to resume."
441
+ >
442
+ Disconnect
443
+ </button>
444
+ </li>
445
+ ))}
446
+ </ul>
447
+ )}
448
+ </div>
449
+ </div>
450
+ </details>
451
+
452
+ <details className="border border-line rounded" data-testid="marketplace-section">
453
+ <summary className="cursor-pointer px-3 py-2 text-xs font-medium text-ink">
454
+ Claude Code, Codex and the skills CLI
455
+ </summary>
456
+ <div className="px-3 pb-3 space-y-3">
457
+ <p className="text-meta text-ink-muted leading-snug">
458
+ These clone the marketplace as a git remote. The URL carries an external API
459
+ key from the{' '}
460
+ <button
461
+ type="button"
462
+ onClick={() => setTab('autonomous')}
463
+ className="underline text-ink-muted hover:text-ink"
464
+ >
465
+ Autonomous agents
466
+ </button>{' '}
467
+ tab — the key dialog there shows these commands filled in.
468
+ </p>
469
+ <CopyBlock label="Marketplace git remote" value={marketplaceGitUrl()} rows={2} />
470
+ <CopyBlock
471
+ label="Claude Code (one install, everything you may read)"
472
+ value={marketplaceCommands('<external-api-key>').claude}
473
+ rows={2}
474
+ />
475
+ <CopyBlock
476
+ label="Codex"
477
+ value={marketplaceCommands('<external-api-key>').codex}
478
+ rows={5}
479
+ />
480
+ <p className="text-meta text-ink-muted leading-snug">{CODEX_LOGIN_NOTE}</p>
481
+ <CopyBlock
482
+ label="Any other agent, via the skills CLI"
483
+ value={marketplaceCommands('<external-api-key>').skills}
484
+ rows={2}
485
+ />
486
+ <p className="text-meta text-ink-muted leading-snug">
487
+ The key stays in the URL: Claude Code refreshes marketplaces in the background
488
+ without credential helpers. Revoke the key to cut the agent off. In Claude Code
489
+ add it through the CLI or the Claude Code section of the Desktop app's
490
+ Customize screen; the Chat and Cowork screens use the route above instead.
491
+ </p>
492
+ <p className="text-meta text-ink-muted leading-snug">
493
+ Add it through Claude Code: the CLI, or the Claude Code section of the
494
+ Desktop app's Customize screen. The Chat and Cowork plugin screens accept
495
+ only GitHub, GitLab and Bitbucket remotes and refuse this one as an
496
+ unsupported host.
497
+ </p>
498
+ </div>
499
+ </details>
500
+ </div>
501
+ )}
502
+
503
+ {tab === 'autonomous' && (
298
504
  <div className="px-4 py-3 space-y-4">
299
505
  <p className="text-xs text-ink-muted leading-snug">
300
506
  For autonomous agents and pipelines (CI, scheduled jobs) that can't open a browser to
@@ -343,8 +549,11 @@ export function ExternalAgentAccessPage() {
343
549
  )}
344
550
  {loading ? (
345
551
  <div className="text-xs text-ink-muted">Loading…</div>
346
- ) : keys.length === 0 ? (
347
- <div className="text-xs text-ink-muted">No external API keys yet.</div>
552
+ ) : sortedKeys.length === 0 ? (
553
+ <div className="text-xs text-ink-muted">
554
+ No external API keys yet.
555
+ {claudeLinks.length > 0 && ' Your Claude connections are on the Marketplaces tab.'}
556
+ </div>
348
557
  ) : (
349
558
  <ul className="divide-y divide-line border border-line rounded">
350
559
  {sortedKeys.map((k) => {
@@ -365,7 +574,10 @@ export function ExternalAgentAccessPage() {
365
574
  <div className="font-medium truncate">{k.label}</div>
366
575
  <div className="text-[11px] text-ink-muted">
367
576
  Created {formatRelative(k.createdAt)} · Last used {formatRelative(k.lastUsedAt)}
368
- {revoked && ' · Disconnected'}
577
+ {/* A key an admin took is not one you can reconnect — say so,
578
+ or people try. Your own disconnect keeps its word. */}
579
+ {revoked &&
580
+ (k.revokedBy === 'admin' ? ' · Revoked by an admin' : ' · Disconnected')}
369
581
  </div>
370
582
  {usage && (
371
583
  <div className="mt-1 max-w-xs">
@@ -412,7 +624,11 @@ export function ExternalAgentAccessPage() {
412
624
  )}
413
625
  </div>
414
626
  </div>
415
- )}
627
+ )}
628
+ </section>
629
+
630
+ <AgentInstructionsCard />
631
+ </div>
416
632
  </PageShell>
417
633
 
418
634
  <Dialog
@@ -481,89 +697,144 @@ export function ExternalAgentAccessPage() {
481
697
  {copied ? <Check size={14} /> : <Copy size={14} />}
482
698
  </button>
483
699
  </div>
484
- <div>
485
- <div className="text-xs font-medium text-ink mb-1">
486
- Desktop agents — the local server (recommended)
700
+ {/* Three drawers in the interactive tab's order — the hosted
701
+ endpoint Claude and ChatGPT use, then the local server, then
702
+ the marketplace — all CLOSED, with the key filled in. The key
703
+ is the news here; which config the reader needs is their
704
+ call, and five config walls in a row buried the one thing the
705
+ dialog exists to hand over. */}
706
+ <details className="border border-line rounded">
707
+ <summary className="cursor-pointer px-3 py-2 text-xs font-medium text-ink">
708
+ Claude, ChatGPT and pipelines — the hosted endpoint
709
+ </summary>
710
+ <div className="px-3 pb-3 space-y-3">
711
+ <div>
712
+ <p className="text-meta text-ink-muted mb-1 leading-snug">
713
+ The address Claude and ChatGPT connect to — they sign in through the
714
+ browser, from the Your agent tab, and need no key. With this key it
715
+ serves agents that can't run a process on your machine, and CI where
716
+ installing Node is unwanted. Claude Code, via the hosted endpoint:
717
+ </p>
718
+ <textarea
719
+ readOnly
720
+ value={claudeCodeCommand(mcpUrl, reveal.plaintext)}
721
+ rows={3}
722
+ className="w-full font-mono text-meta bg-sunken border border-line rounded px-2 py-1.5 resize-none"
723
+ onFocus={(e) => e.currentTarget.select()}
724
+ />
725
+ </div>
726
+ <div>
727
+ <div className="text-xs font-medium text-ink mb-1">Connect Langdock</div>
728
+ <ol className="text-meta text-ink-muted mb-1 leading-snug list-decimal pl-4 space-y-0.5">
729
+ <li>In Langdock, open your workspace settings and go to MCP servers → Add server.</li>
730
+ <li>Choose <span className="font-medium">HTTP</span> (Streamable HTTP) as the transport.</li>
731
+ <li>Give it a name (e.g. <span className="font-medium">Bevel</span>), paste the URL below into the server URL field, and add the Authorization header under custom headers.</li>
732
+ <li>Save, then enable the server in any assistant you want it available in.</li>
733
+ </ol>
734
+ <textarea
735
+ readOnly
736
+ value={langdockSnippet(mcpUrl, reveal.plaintext)}
737
+ rows={3}
738
+ className="w-full font-mono text-meta bg-sunken border border-line rounded px-2 py-1.5 resize-none"
739
+ onFocus={(e) => e.currentTarget.select()}
740
+ />
741
+ </div>
742
+ <div>
743
+ <div className="text-xs font-medium text-ink mb-1">Other agents (JSON config)</div>
744
+ <p className="text-meta text-ink-muted mb-1 leading-snug">
745
+ The hosted endpoint for most clients that load servers from a JSON config —
746
+ when the local server below isn't wanted.
747
+ </p>
748
+ <textarea
749
+ readOnly
750
+ value={jsonConfigSnippet(mcpUrl, reveal.plaintext)}
751
+ rows={11}
752
+ className="w-full font-mono text-meta bg-sunken border border-line rounded px-2 py-1.5 resize-none"
753
+ onFocus={(e) => e.currentTarget.select()}
754
+ />
755
+ </div>
487
756
  </div>
488
- <p className="text-meta text-ink-muted mb-1 leading-snug">
489
- For agents that run on your machine: Claude Code, Claude Desktop, Cursor,
490
- Windsurf, Cline and similar. Runs this workspace as a local MCP server (needs
491
- Node): the agent gets everything the hosted endpoint serves, plus your
492
- plugins' local-only tools. In Claude Code:
493
- </p>
494
- <textarea
495
- readOnly
496
- value={hexisMcpClaudeCommand(workspaceUrl, reveal.plaintext)}
497
- rows={3}
498
- className="w-full font-mono text-meta bg-sunken border border-line rounded px-2 py-1.5 resize-none"
499
- onFocus={(e) => e.currentTarget.select()}
500
- />
501
- <p className="text-meta text-ink-muted mt-1 leading-snug">
502
- On Windows, prefer the JSON config below — this one-liner assumes a POSIX
503
- shell (macOS, Linux, WSL or Git Bash).
504
- </p>
505
- <p className="text-meta text-ink-muted mt-2 mb-1 leading-snug">
506
- Or as a JSON config, for Claude Desktop, Cursor, Windsurf, Cline and
507
- similar:
508
- </p>
509
- <textarea
510
- readOnly
511
- value={hexisMcpJsonSnippet(workspaceUrl, reveal.plaintext)}
512
- rows={13}
513
- className="w-full font-mono text-meta bg-sunken border border-line rounded px-2 py-1.5 resize-none"
514
- onFocus={(e) => e.currentTarget.select()}
515
- />
516
- </div>
517
- <div>
518
- <div className="text-xs font-medium text-ink mb-1">
519
- Web agents and pipelines — the hosted endpoint
520
- </div>
521
- <p className="text-meta text-ink-muted mb-1 leading-snug">
522
- For agents that can't run a process on your machine, and for CI where
523
- installing Node is unwanted. Claude Code, via the hosted endpoint:
524
- </p>
525
- <textarea
526
- readOnly
527
- value={claudeCodeCommand(mcpUrl, reveal.plaintext)}
528
- rows={3}
529
- className="w-full font-mono text-[11px] bg-sunken border border-line rounded px-2 py-1.5 resize-none"
530
- onFocus={(e) => e.currentTarget.select()}
531
- />
532
- </div>
533
- <div>
534
- <div className="text-xs font-medium text-ink mb-1">
535
- Connect Langdock
757
+ </details>
758
+
759
+ <details className="border border-line rounded">
760
+ <summary className="cursor-pointer px-3 py-2 text-xs font-medium text-ink">
761
+ Desktop agents — the local server
762
+ </summary>
763
+ <div className="px-3 pb-3 space-y-2">
764
+ <p className="text-meta text-ink-muted leading-snug">
765
+ For agents that run on your machine: Claude Code, Claude Desktop, Cursor,
766
+ Windsurf, Cline and similar. Runs this workspace as a local MCP server (needs
767
+ Node): the agent gets everything the hosted endpoint serves, plus your
768
+ plugins' local-only tools. In Claude Code:
769
+ </p>
770
+ <textarea
771
+ readOnly
772
+ value={hexisMcpClaudeCommand(workspaceUrl, reveal.plaintext)}
773
+ rows={3}
774
+ className="w-full font-mono text-meta bg-sunken border border-line rounded px-2 py-1.5 resize-none"
775
+ onFocus={(e) => e.currentTarget.select()}
776
+ />
777
+ <p className="text-meta text-ink-muted leading-snug">
778
+ On Windows, prefer the JSON config below — this one-liner assumes a POSIX
779
+ shell (macOS, Linux, WSL or Git Bash).
780
+ </p>
781
+ <p className="text-meta text-ink-muted leading-snug">
782
+ Or as a JSON config, for Claude Desktop, Cursor, Windsurf, Cline and
783
+ similar:
784
+ </p>
785
+ <textarea
786
+ readOnly
787
+ value={hexisMcpJsonSnippet(workspaceUrl, reveal.plaintext)}
788
+ rows={13}
789
+ className="w-full font-mono text-meta bg-sunken border border-line rounded px-2 py-1.5 resize-none"
790
+ onFocus={(e) => e.currentTarget.select()}
791
+ />
536
792
  </div>
537
- <ol className="text-[11px] text-ink-muted mb-1 leading-snug list-decimal pl-4 space-y-0.5">
538
- <li>In Langdock, open your workspace settings and go to MCP servers → Add server.</li>
539
- <li>Choose <span className="font-medium">HTTP</span> (Streamable HTTP) as the transport.</li>
540
- <li>Give it a name (e.g. <span className="font-medium">Bevel</span>), paste the URL below into the server URL field, and add the Authorization header under custom headers.</li>
541
- <li>Save, then enable the server in any assistant you want it available in.</li>
542
- </ol>
543
- <textarea
544
- readOnly
545
- value={langdockSnippet(mcpUrl, reveal.plaintext)}
546
- rows={3}
547
- className="w-full font-mono text-[11px] bg-sunken border border-line rounded px-2 py-1.5 resize-none"
548
- onFocus={(e) => e.currentTarget.select()}
549
- />
550
- </div>
551
- <div>
552
- <div className="text-xs font-medium text-ink mb-1">
553
- Other agents (JSON config)
793
+ </details>
794
+
795
+ <details className="border border-line rounded">
796
+ <summary className="cursor-pointer px-3 py-2 text-xs font-medium text-ink">
797
+ Skills as native plugins — the marketplace
798
+ </summary>
799
+ <div className="px-3 pb-3 space-y-2">
800
+ <p className="text-meta text-ink-muted leading-snug">
801
+ Every skill you may read, compiled into a plugin marketplace served as a git
802
+ remote. One install brings all of it; a later update fetches what changed.
803
+ The key stays in the URL because Claude Code refreshes marketplaces without
804
+ credential helpers. Add it through Claude Code (the CLI, or the Claude
805
+ Code section of the Desktop app's Customize screen): the Chat and Cowork
806
+ plugin screens accept only GitHub, GitLab and Bitbucket remotes.
807
+ </p>
808
+ <textarea
809
+ readOnly
810
+ aria-label="Claude Code marketplace command"
811
+ value={marketplaceCommands(reveal.plaintext).claude}
812
+ rows={2}
813
+ className="w-full font-mono text-meta bg-sunken border border-line rounded px-2 py-1.5 resize-none"
814
+ onFocus={(e) => e.currentTarget.select()}
815
+ />
816
+ <p className="text-meta text-ink-muted leading-snug">
817
+ Codex — add the marketplace, install the plugin, sign in, check. {CODEX_LOGIN_NOTE}
818
+ </p>
819
+ <textarea
820
+ readOnly
821
+ aria-label="Codex marketplace command"
822
+ value={marketplaceCommands(reveal.plaintext).codex}
823
+ rows={5}
824
+ className="w-full font-mono text-meta bg-sunken border border-line rounded px-2 py-1.5 resize-none"
825
+ onFocus={(e) => e.currentTarget.select()}
826
+ />
827
+ <p className="text-meta text-ink-muted leading-snug">Any other agent, through the skills CLI:</p>
828
+ <textarea
829
+ readOnly
830
+ aria-label="skills CLI command"
831
+ value={marketplaceCommands(reveal.plaintext).skills}
832
+ rows={2}
833
+ className="w-full font-mono text-meta bg-sunken border border-line rounded px-2 py-1.5 resize-none"
834
+ onFocus={(e) => e.currentTarget.select()}
835
+ />
554
836
  </div>
555
- <p className="text-[11px] text-ink-muted mb-1 leading-snug">
556
- The hosted endpoint for most clients that load servers from a JSON config —
557
- when the local server above isn't wanted.
558
- </p>
559
- <textarea
560
- readOnly
561
- value={jsonConfigSnippet(mcpUrl, reveal.plaintext)}
562
- rows={11}
563
- className="w-full font-mono text-[11px] bg-sunken border border-line rounded px-2 py-1.5 resize-none"
564
- onFocus={(e) => e.currentTarget.select()}
565
- />
566
- </div>
837
+ </details>
567
838
  </div>
568
839
  <div className="flex justify-end px-4 py-3 border-t border-line">
569
840
  <button