@bevel-software/platform-core-frontend 0.15.1 → 0.20.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.
- package/THIRD-PARTY-NOTICES.md +2 -2
- package/package.json +3 -3
- package/src/core/CoreAppShell.tsx +20 -9
- package/src/core/__tests__/AppChrome.test.tsx +0 -3
- package/src/core/__tests__/events.test.ts +43 -0
- package/src/core/bootstrap.ts +11 -3
- package/src/core/events.ts +85 -3
- package/src/core/registry.ts +1 -1
- package/src/lib/__tests__/email.test.ts +44 -0
- package/src/lib/email.ts +37 -1
- package/src/modules/access/__tests__/ManageAccessDialog.add-row-picking.test.tsx +141 -0
- package/src/modules/access/__tests__/ManageAccessDialog.chip-truncation.test.tsx +204 -0
- package/src/modules/access/__tests__/ManageAccessDialog.download-read.test.tsx +234 -0
- package/src/modules/access/__tests__/ManageAccessDialog.edited-row-visible.test.tsx +160 -0
- package/src/modules/access/__tests__/ManageAccessDialog.placement.test.tsx +2 -2
- package/src/modules/access/__tests__/ManageAccessDialog.proposal.test.tsx +166 -0
- package/src/modules/access/__tests__/ManageAccessDialog.restrict.test.tsx +510 -0
- package/src/modules/access/__tests__/ManageAccessDialog.row-menu-axes.test.tsx +299 -0
- package/src/modules/access/__tests__/ManageAccessDialog.row-menu-width.test.tsx +226 -0
- package/src/modules/access/__tests__/ManageAccessDialog.test.tsx +721 -126
- package/src/modules/access/__tests__/ManageAccessDialog.unknown-email.test.tsx +314 -0
- package/src/modules/access/__tests__/manage-access-affordance.test.ts +14 -0
- package/src/modules/access/__tests__/tailwindDeclarations.ts +210 -0
- package/src/modules/access/api.ts +140 -6
- package/src/modules/access/components/ManageAccessDialog.tsx +1299 -561
- package/src/modules/access/manage-access-affordance.ts +17 -0
- package/src/modules/admin/__tests__/AddMemberInput.test.tsx +297 -0
- package/src/modules/admin/__tests__/AdminRolesPage.capabilities.test.tsx +2 -2
- package/src/modules/admin/__tests__/AdminRolesPage.fixed-admin.test.tsx +189 -0
- package/src/modules/admin/__tests__/AdminRolesPage.suggest.test.tsx +1 -1
- package/src/modules/admin/__tests__/DirectoryGroupsPage.suggest.test.tsx +182 -0
- package/src/modules/admin/__tests__/DirectoryGroupsPage.test.tsx +165 -14
- package/src/modules/admin/__tests__/UserAccountsPage.test.tsx +401 -4
- package/src/modules/admin/__tests__/group-members-path.test.ts +27 -0
- package/src/modules/admin/components/AddMemberInput.tsx +268 -0
- package/src/modules/admin/components/AdminRolesPage.tsx +97 -132
- package/src/modules/admin/components/DirectoryGroupsPage.tsx +91 -39
- package/src/modules/admin/components/UserAccountsPage.tsx +271 -37
- package/src/modules/admin/components/group-members-path.ts +32 -0
- package/src/modules/admin/services/roles.api.ts +12 -1
- package/src/modules/audit/__tests__/AuditLogPage.test.tsx +312 -0
- package/src/modules/audit/components/AuditEventsPanel.tsx +319 -0
- package/src/modules/audit/components/AuditLogPage.tsx +373 -0
- package/src/modules/audit/components/principal-grouping.ts +49 -0
- package/src/modules/audit/services/audit.api.ts +98 -0
- package/src/modules/auth/__tests__/AccountPage.test.tsx +50 -2
- package/src/modules/auth/components/AccountPage.tsx +73 -54
- package/src/modules/auth/components/LoginScreen.tsx +1 -0
- package/src/modules/auth/services/account.api.ts +78 -4
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.access-rules.test.tsx +144 -0
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.binary.test.tsx +422 -0
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.brings-itself-up-to-date.test.tsx +431 -0
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.fork-point.test.tsx +193 -0
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.initial-file.test.tsx +142 -0
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.moved.test.tsx +202 -0
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.test.tsx +205 -13
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.unreadable.test.tsx +271 -0
- package/src/modules/change-requests/__tests__/FileChangeBoxes.test.tsx +208 -0
- package/src/modules/change-requests/__tests__/apply-outcome-for-every-viewer.test.tsx +286 -0
- package/src/modules/change-requests/__tests__/propose.concurrent.test.ts +273 -0
- package/src/modules/change-requests/__tests__/readFailure.test.ts +122 -0
- package/src/modules/change-requests/__tests__/useCrFileDiffs.test.tsx +238 -0
- package/src/modules/change-requests/__tests__/useFileOnBranch.test.tsx +56 -1
- package/src/modules/change-requests/__tests__/useForkPointFile.test.tsx +79 -0
- package/src/modules/change-requests/components/BranchFilePreview.tsx +357 -0
- package/src/modules/change-requests/components/ChangeBox.tsx +31 -2
- package/src/modules/change-requests/components/ChangeRequestDialog.tsx +862 -72
- package/src/modules/change-requests/components/CrFileTree.tsx +74 -58
- package/src/modules/change-requests/components/FileChangeBoxes.tsx +19 -15
- package/src/modules/change-requests/hooks/useApplyChangeRequest.ts +41 -7
- package/src/modules/change-requests/hooks/useCrFileDiffs.ts +181 -23
- package/src/modules/change-requests/hooks/useFileOnBranch.ts +70 -7
- package/src/modules/change-requests/hooks/useForkPointFile.ts +77 -0
- package/src/modules/change-requests/services/change-requests.api.ts +57 -1
- package/src/modules/change-requests/services/denied-file.api.ts +53 -0
- package/src/modules/change-requests/services/propose.api.ts +97 -8
- package/src/modules/change-requests/utils/approval.ts +15 -0
- package/src/modules/change-requests/utils/author.ts +32 -0
- package/src/modules/change-requests/utils/readFailure.ts +110 -0
- package/src/modules/git/__tests__/FileHistoryPanel.test.tsx +20 -0
- package/src/modules/git/components/FileHistoryPanel.tsx +5 -0
- package/src/modules/git/components/PullRequestsForMe.tsx +51 -24
- package/src/modules/git/services/__tests__/error-messages.test.ts +29 -0
- package/src/modules/git/services/error-messages.ts +12 -0
- package/src/modules/git/services/pr-prompts.ts +5 -5
- package/src/modules/layout/__tests__/HeaderAlignment.test.tsx +401 -0
- package/src/modules/layout/__tests__/SidebarFooterGrid.test.tsx +286 -0
- package/src/modules/layout/__tests__/SidebarFrameResponsive.test.tsx +61 -0
- package/src/modules/layout/components/AppLayout.tsx +2 -0
- package/src/modules/layout/components/MobileChatLayout.tsx +4 -1
- package/src/modules/layout/components/ResizableThreePaneLayout.tsx +4 -1
- package/src/modules/layout/components/SidebarFrame.tsx +108 -3
- package/src/modules/library/__tests__/AddToPluginDialog.test.tsx +171 -5
- package/src/modules/library/__tests__/DeleteToolDialog.test.tsx +356 -0
- package/src/modules/library/__tests__/IntegrationsSetupReminder.test.tsx +60 -0
- package/src/modules/library/__tests__/LibraryCard.test.tsx +91 -10
- package/src/modules/library/__tests__/LibraryRoutes.test.tsx +242 -107
- package/src/modules/library/__tests__/LibrarySidebarMenu.test.tsx +103 -98
- package/src/modules/library/__tests__/LinkSkillPanel.test.tsx +20 -5
- package/src/modules/library/__tests__/LockedPluginView.test.tsx +97 -7
- package/src/modules/library/__tests__/NewPluginDialog.test.tsx +13 -4
- package/src/modules/library/__tests__/PersonalAddDialog.test.tsx +79 -3
- package/src/modules/library/__tests__/PersonalPluginPage.test.tsx +201 -0
- package/src/modules/library/__tests__/PluginExtras.test.tsx +100 -9
- package/src/modules/library/__tests__/PluginJoinRequests.test.tsx +60 -1
- package/src/modules/library/__tests__/PluginPage.test.tsx +258 -6
- package/src/modules/library/__tests__/PluginsSidebar.contextmenu.test.tsx +16 -56
- package/src/modules/library/__tests__/PluginsSidebar.test.tsx +155 -152
- package/src/modules/library/__tests__/PluginsSidebarMenu.test.tsx +16 -0
- package/src/modules/library/__tests__/SharedViaPlugins.test.tsx +106 -0
- package/src/modules/library/__tests__/SkillPage.test.tsx +386 -80
- package/src/modules/library/__tests__/SkillsTree.test.tsx +293 -4
- package/src/modules/library/__tests__/ToolConnectionSection.test.tsx +582 -71
- package/src/modules/library/__tests__/ToolPage.test.tsx +87 -4
- package/src/modules/library/__tests__/WorkspaceItemRoute.test.tsx +173 -26
- package/src/modules/library/__tests__/auth-harness.tsx +9 -9
- package/src/modules/library/__tests__/card-row-menu.test.tsx +320 -0
- package/src/modules/library/__tests__/library-data.mapping.test.tsx +98 -0
- package/src/modules/library/__tests__/library-data.stale.test.tsx +121 -28
- package/src/modules/library/__tests__/library-data.test.ts +7 -0
- package/src/modules/library/__tests__/library-paths.test.ts +47 -4
- package/src/modules/library/__tests__/link-membership.test.ts +13 -4
- package/src/modules/library/__tests__/name-with-badges.test.tsx +273 -0
- package/src/modules/library/__tests__/newSkillMarkdown.test.ts +30 -0
- package/src/modules/library/__tests__/owner-pill.test.tsx +357 -0
- package/src/modules/library/__tests__/pending-tools.test.tsx +400 -0
- package/src/modules/library/__tests__/plugin-entries.test.ts +122 -0
- package/src/modules/library/__tests__/plugin-summary.test.ts +36 -1
- package/src/modules/library/__tests__/status.test.ts +82 -2
- package/src/modules/library/__tests__/tools.api.test.ts +44 -1
- package/src/modules/library/components/AccessRequestsBanner.tsx +85 -47
- package/src/modules/library/components/AddDialogTabs.tsx +103 -0
- package/src/modules/library/components/AddToPluginDialog.tsx +74 -18
- package/src/modules/library/components/IntegrationsSetupReminder.tsx +59 -0
- package/src/modules/library/components/ItemActionsMenu.tsx +288 -0
- package/src/modules/library/components/LibraryCard.tsx +146 -45
- package/src/modules/library/components/LibraryLayout.tsx +119 -256
- package/src/modules/library/components/LibraryPage.tsx +172 -39
- package/src/modules/library/components/LinkSkillPanel.tsx +1 -3
- package/src/modules/library/components/LockedPluginView.tsx +62 -34
- package/src/modules/library/components/NameWithBadges.tsx +164 -0
- package/src/modules/library/components/NewPluginDialog.tsx +16 -2
- package/src/modules/library/components/PageActions.tsx +11 -9
- package/src/modules/library/components/{PendingSkillReview.tsx → PendingItemReview.tsx} +14 -7
- package/src/modules/library/components/PersonalAddDialog.tsx +68 -18
- package/src/modules/library/components/PersonalPluginPage.tsx +121 -22
- package/src/modules/library/components/PluginExtras.tsx +140 -17
- package/src/modules/library/components/PluginIndexRow.tsx +47 -12
- package/src/modules/library/components/PluginPage.tsx +157 -41
- package/src/modules/library/components/PluginRows.tsx +286 -0
- package/src/modules/library/components/PluginsSidebar.tsx +239 -263
- package/src/modules/library/components/PluginsSidebarMenu.tsx +26 -1
- package/src/modules/library/components/ShareButton.tsx +17 -0
- package/src/modules/library/components/SkillsTree.tsx +141 -28
- package/src/modules/library/components/TeamRoute.tsx +15 -0
- package/src/modules/library/components/__tests__/upload-notices-once-per-page.test.tsx +144 -0
- package/src/modules/library/components/plugin-page-parts.tsx +103 -17
- package/src/modules/library/components/skill-page/SharedViaPlugins.tsx +6 -12
- package/src/modules/library/components/skill-page/SkillFilePane.tsx +5 -0
- package/src/modules/library/components/skill-page/SkillPage.tsx +274 -122
- package/src/modules/library/components/tool-page/DeleteToolDialog.tsx +218 -0
- package/src/modules/library/components/tool-page/ToolConnectionSection.tsx +79 -178
- package/src/modules/library/components/tool-page/ToolPage.tsx +106 -16
- package/src/modules/library/components/tool-page/ToolVarRow.tsx +42 -41
- package/src/modules/library/hooks/__tests__/useLibraryData.test.ts +98 -0
- package/src/modules/library/hooks/useLibraryData.ts +92 -19
- package/src/modules/library/routes/LibraryRoutes.tsx +14 -11
- package/src/modules/library/routes/WorkspaceItemRoute.tsx +77 -27
- package/src/modules/library/routes/library-paths.ts +26 -28
- package/src/modules/library/services/library.api.ts +38 -20
- package/src/modules/library/services/plugins.api.ts +69 -8
- package/src/modules/library/services/teams.api.ts +15 -0
- package/src/modules/library/services/tools.api.ts +78 -0
- package/src/modules/library/state/library-data.tsx +170 -32
- package/src/modules/library/utils/personal-plugin.ts +13 -15
- package/src/modules/library/utils/plugin-entries.ts +134 -0
- package/src/modules/library/utils/plugin-summary.ts +75 -9
- package/src/modules/library/utils/status.ts +135 -33
- package/src/modules/onboarding/__tests__/creator-welcome.test.tsx +8 -1
- package/src/modules/onboarding/__tests__/onboarding.test.tsx +853 -760
- package/src/modules/onboarding/agent-clients.ts +55 -23
- package/src/modules/onboarding/components/ConnectAgentPill.tsx +5 -1
- package/src/modules/onboarding/components/WelcomePage.tsx +98 -62
- package/src/modules/pr/services/pr-merge.api.ts +2 -1
- package/src/modules/review/components/MarkdownDiffViewer.tsx +53 -8
- package/src/modules/review/components/ReviewPanel.tsx +15 -17
- package/src/modules/review/components/__tests__/MarkdownDiffViewer.test.tsx +64 -0
- package/src/modules/review/components/__tests__/ReviewPanel.test.tsx +25 -1
- package/src/modules/secrets-vault/components/ConnectToolsPage.tsx +454 -117
- package/src/modules/secrets-vault/components/SecretsPage.tsx +48 -7
- package/src/modules/secrets-vault/components/ToolSecretsPanel.tsx +84 -5
- package/src/modules/secrets-vault/components/__tests__/ConnectToolsPage.test.tsx +425 -0
- package/src/modules/secrets-vault/components/__tests__/SecretsPage.test.tsx +417 -82
- package/src/modules/secrets-vault/components/__tests__/ToolSecretsPanel.test.tsx +105 -0
- package/src/modules/secrets-vault/components/__tests__/connect-lists-what-the-banner-counted.test.tsx +407 -0
- package/src/modules/secrets-vault/probe/SavedKeyProbeResult.tsx +98 -0
- package/src/modules/secrets-vault/probe/__tests__/probe-verdict.test.ts +160 -0
- package/src/modules/secrets-vault/probe/probe-verdict.ts +108 -0
- package/src/modules/secrets-vault/probe/useSavedKeyProbe.ts +228 -0
- package/src/modules/secrets-vault/services/connect.api.ts +36 -5
- package/src/modules/secrets-vault/utils/connect-status.ts +98 -0
- package/src/modules/settings/components/ClaudeConnectionCard.tsx +9 -24
- package/src/modules/settings/components/ClaudeConnectionFields.tsx +23 -0
- package/src/modules/settings/components/DeploymentPage.tsx +10 -30
- package/src/modules/settings/components/MarketplaceSection.tsx +152 -0
- package/src/modules/settings/components/__tests__/DeploymentPage.test.tsx +67 -4
- package/src/modules/settings/components/__tests__/MarketplaceSection.test.tsx +325 -0
- package/src/modules/settings/components/__tests__/SettingsLayout.test.tsx +7 -6
- package/src/modules/settings/services/github-facade.api.ts +23 -0
- package/src/modules/settings/settings-nav-items.tsx +13 -3
- package/src/modules/setup/__tests__/setup.oidc.test.tsx +172 -0
- package/src/modules/setup/__tests__/setup.probe-refusal.test.tsx +123 -0
- package/src/modules/setup/__tests__/setup.test.tsx +497 -4
- package/src/modules/setup/__tests__/useSetupStatus.test.tsx +130 -0
- package/src/modules/setup/components/SetupGate.tsx +16 -16
- package/src/modules/setup/components/SetupScreen.tsx +532 -43
- package/src/modules/setup/hooks/useSetupStatus.ts +93 -0
- package/src/modules/setup/services/setup.api.ts +141 -4
- package/src/modules/setup/utils/__tests__/root-folders.test.ts +72 -0
- package/src/modules/setup/utils/root-folders.ts +46 -0
- package/src/modules/toolbar/assets/claude-setup/01-add-manually.webp +0 -0
- package/src/modules/toolbar/assets/claude-setup/02-add-configuration.webp +0 -0
- package/src/modules/toolbar/assets/claude-setup/03-connect-account.webp +0 -0
- package/src/modules/toolbar/assets/claude-setup/04-pick-instance.webp +0 -0
- package/src/modules/toolbar/assets/claude-setup/05-plugins-add.webp +0 -0
- package/src/modules/toolbar/assets/claude-setup/06-add-marketplace.webp +0 -0
- package/src/modules/toolbar/assets/claude-setup/07-paste-url-sync.webp +0 -0
- package/src/modules/toolbar/assets/claude-setup/08-install-plugins.webp +0 -0
- package/src/modules/toolbar/assets/claude-setup/09-select-repository.webp +0 -0
- package/src/modules/toolbar/assets/claude-setup/10-connector-not-added.webp +0 -0
- package/src/modules/toolbar/assets/claude-setup/11-add-custom-connector.webp +0 -0
- package/src/modules/toolbar/assets/claude-setup/README.md +68 -0
- package/src/modules/toolbar/components/AgentInstructionsCard.tsx +296 -0
- package/src/modules/toolbar/components/ClaudeMarketplaceCarousel.tsx +107 -0
- package/src/modules/toolbar/components/ClaudeRegistrationSteps.tsx +127 -0
- package/src/modules/toolbar/components/CoworkSetupSteps.tsx +100 -0
- package/src/modules/toolbar/components/ExternalAgentAccessPage.tsx +177 -118
- package/src/modules/toolbar/components/ScreenshotStep.tsx +77 -0
- package/src/modules/toolbar/components/SetupCarousel.tsx +177 -0
- package/src/modules/toolbar/components/__tests__/AgentInstructionsCard.test.tsx +370 -0
- package/src/modules/toolbar/components/__tests__/ExternalAgentAccessPage.test.tsx +542 -42
- package/src/modules/toolbar/components/__tests__/Toolbar.test.tsx +2 -2
- package/src/modules/toolbar/components/__tests__/claude-setup-shots.test.ts +104 -0
- package/src/modules/toolbar/components/claude-connector-slide.tsx +38 -0
- package/src/modules/toolbar/components/claude-setup-shots.ts +167 -0
- package/src/modules/toolbar/components/deployment-address.ts +29 -0
- package/src/modules/toolbar/components/setup-step-parts.tsx +35 -0
- package/src/modules/toolbar/services/__tests__/agent-instructions.api.test.ts +89 -0
- package/src/modules/toolbar/services/agent-instructions.api.ts +167 -0
- package/src/modules/toolbar/services/external-api-keys.api.ts +8 -0
- package/src/modules/workflow/state/ChangeRequestStaleBinder.tsx +43 -0
- package/src/modules/workflow/state/EventBusProvider.tsx +122 -11
- package/src/modules/workflow/state/__tests__/EventBusProvider.storage.test.tsx +87 -0
- package/src/modules/workflow/state/__tests__/EventBusProvider.watch.test.tsx +223 -0
- package/src/modules/workflow/state/event-bus.context.ts +10 -0
- package/src/modules/workspace/__tests__/testFixtures.ts +5 -3
- package/src/modules/workspace/components/FileExplorer.tsx +1295 -191
- package/src/modules/workspace/components/FileRoute.tsx +353 -36
- package/src/modules/workspace/components/FileViewer.tsx +172 -46
- package/src/modules/workspace/components/KbDocumentShell.tsx +50 -6
- package/src/modules/workspace/components/KbPageHeader.tsx +120 -55
- package/src/modules/workspace/components/TreeActionConfirm.tsx +350 -0
- package/src/modules/workspace/components/__tests__/FileExplorer.test.tsx +2533 -129
- package/src/modules/workspace/components/__tests__/FileRoute.test.tsx +731 -18
- package/src/modules/workspace/components/__tests__/FileViewer.test.tsx +381 -12
- package/src/modules/workspace/components/__tests__/KbDocumentShell.test.tsx +39 -0
- package/src/modules/workspace/components/__tests__/KbPageHeader.test.tsx +33 -20
- package/src/modules/workspace/components/renderers/DocxRenderer.tsx +4 -5
- package/src/modules/workspace/components/renderers/DownloadFileButton.tsx +13 -4
- package/src/modules/workspace/components/renderers/EmailRenderer.tsx +4 -3
- package/src/modules/workspace/components/renderers/HtmlRenderer.tsx +8 -14
- package/src/modules/workspace/components/renderers/ImageRenderer.tsx +75 -16
- package/src/modules/workspace/components/renderers/KbImage.tsx +180 -0
- package/src/modules/workspace/components/renderers/KbMarkdownView.tsx +22 -6
- package/src/modules/workspace/components/renderers/MarkdownRenderer.tsx +48 -22
- package/src/modules/workspace/components/renderers/PdfRenderer.tsx +4 -5
- package/src/modules/workspace/components/renderers/PptxRenderer.tsx +4 -3
- package/src/modules/workspace/components/renderers/XlsxRenderer.tsx +4 -3
- package/src/modules/workspace/components/renderers/__tests__/DocxRenderer.test.tsx +12 -0
- package/src/modules/workspace/components/renderers/__tests__/DownloadFileButton.test.tsx +57 -9
- package/src/modules/workspace/components/renderers/__tests__/EmailRenderer.test.tsx +13 -1
- package/src/modules/workspace/components/renderers/__tests__/ImageRenderer.test.tsx +163 -0
- package/src/modules/workspace/components/renderers/__tests__/KbMarkdownView.test.tsx +237 -0
- package/src/modules/workspace/components/renderers/__tests__/MarkdownRenderer.test.tsx +108 -14
- package/src/modules/workspace/components/renderers/__tests__/PptxRenderer.test.tsx +14 -1
- package/src/modules/workspace/components/renderers/__tests__/XlsxRenderer.test.tsx +16 -1
- package/src/modules/workspace/components/renderers/__tests__/rendererSelection.test.tsx +66 -1
- package/src/modules/workspace/components/renderers/index.ts +53 -2
- package/src/modules/workspace/components/renderers/kbMarkdownPipeline.tsx +25 -4
- package/src/modules/workspace/components/renderers/rendererWorkspace.ts +40 -0
- package/src/modules/workspace/hooks/__tests__/useImageRevision.test.tsx +174 -0
- package/src/modules/workspace/hooks/__tests__/useOpenChangeRequests.test.tsx +179 -1
- package/src/modules/workspace/hooks/__tests__/useWorkspaceImageResolver.test.tsx +122 -0
- package/src/modules/workspace/hooks/__tests__/useWorkspaceState.test.tsx +892 -7
- package/src/modules/workspace/hooks/useImageRevision.ts +101 -0
- package/src/modules/workspace/hooks/useMergedWorkspaceTree.ts +22 -3
- package/src/modules/workspace/hooks/useWorkspaceImageResolver.ts +55 -0
- package/src/modules/workspace/hooks/useWorkspaceState.ts +424 -66
- package/src/modules/workspace/routing/__tests__/kb-routes.test.tsx +279 -3
- package/src/modules/workspace/routing/kb-routes.ts +206 -29
- package/src/modules/workspace/services/__tests__/workspace.api.test.ts +134 -1
- package/src/modules/workspace/services/workspace.api.ts +57 -4
- package/src/modules/workspace/state/__tests__/applied-request-clears-pending.test.tsx +343 -0
- package/src/modules/workspace/state/__tests__/upload-lands-where-it-was-dropped.test.tsx +158 -0
- package/src/modules/workspace/state/open-change-requests.tsx +100 -12
- package/src/modules/workspace/state/workspace.context.ts +125 -19
- package/src/modules/workspace/utils/__tests__/file-trace.test.ts +73 -0
- package/src/modules/workspace/utils/__tests__/fileTree.test.ts +220 -6
- package/src/modules/workspace/utils/__tests__/pasteLink.test.ts +76 -0
- package/src/modules/workspace/utils/__tests__/treeConfirm.test.ts +364 -0
- package/src/modules/workspace/utils/__tests__/uploadError.test.ts +35 -0
- package/src/modules/workspace/utils/file-trace.ts +50 -0
- package/src/modules/workspace/utils/fileTree.ts +112 -36
- package/src/modules/workspace/utils/frontmatter.ts +8 -4
- package/src/modules/workspace/utils/pasteLink.ts +90 -0
- package/src/modules/workspace/utils/treeConfirm.ts +338 -0
- package/src/modules/workspace/utils/uploadError.ts +29 -0
- package/src/shared/__tests__/marketplace-url.test.ts +6 -1
- package/src/shared/components/Button.tsx +16 -2
- package/src/shared/components/Dialog.tsx +27 -11
- package/src/shared/components/Menu.tsx +13 -1
- package/src/shared/components/PageShell.tsx +13 -8
- package/src/shared/components/__tests__/primitives.test.tsx +116 -2
- package/src/shared/components/__tests__/useFocusHandoff.test.tsx +192 -0
- package/src/shared/components/index.ts +2 -0
- package/src/shared/components/useDismissableMenu.ts +32 -10
- package/src/shared/components/useFocusHandoff.ts +51 -0
- package/src/shared/components/useLatestRef.ts +28 -0
- package/src/shared/markdown/Markdown.tsx +12 -3
- package/src/shared/markdown/__tests__/escapeSpacesInLinkDestinations.test.ts +39 -0
- package/src/shared/markdown/hrefs.ts +50 -0
- package/src/shared/marketplace-url.ts +33 -5
- package/src/shared/mcp/ChatGptInstallLink.tsx +3 -3
- package/src/shared/mcp/ConnectionInstructions.tsx +38 -27
- package/src/shared/mcp/__tests__/connect-snippets.test.ts +3 -3
- package/src/shared/mcp/connect-snippets.ts +14 -9
- package/src/shared/mcp/index.ts +1 -1
- package/src/shared/theme/__tests__/header-band.test.ts +197 -0
- package/src/shared/theme/header.ts +75 -0
- package/src/shared/theme/measure.ts +7 -4
- package/src/shared/theme/tokens.css +25 -0
- package/src/modules/library/__tests__/PluginsIndexPage.test.tsx +0 -363
- package/src/modules/library/__tests__/PluginsSidebar.locked.test.tsx +0 -97
- package/src/modules/library/components/PluginsIndexPage.tsx +0 -270
- package/src/modules/update-check/__tests__/UpdateBanner.test.tsx +0 -126
- package/src/modules/update-check/components/UpdateBanner.tsx +0 -92
- package/src/modules/update-check/services/update-check.api.ts +0 -24
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { Link } from 'react-router-dom';
|
|
3
3
|
import { Badge, Banner, Button, Surface, TextField } from '../../../shared/components';
|
|
4
4
|
import { PageShell } from '../../../shared/components/PageShell';
|
|
@@ -49,23 +49,54 @@ export function SecretsPage() {
|
|
|
49
49
|
const [tools, setTools] = useState<ToolSecrets[]>([]);
|
|
50
50
|
const [secrets, setSecrets] = useState<SecretSummary[]>([]);
|
|
51
51
|
const [loading, setLoading] = useState(true);
|
|
52
|
+
/** A refetch is in flight over a list that is already on screen. */
|
|
53
|
+
const [refreshing, setRefreshing] = useState(false);
|
|
52
54
|
const [error, setError] = useState<string | null>(null);
|
|
53
55
|
// Read ONCE, synchronously, before the fragment is stripped below. Kept in
|
|
54
56
|
// its own slot (not the API `error` above) so the initial refresh() — whose
|
|
55
57
|
// success path clears the API error — can't race the outcome away.
|
|
56
58
|
const [oauthOutcome] = useState(readHashOutcome);
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Which load is allowed to publish. Saving two rows in quick succession
|
|
62
|
+
* starts two refetches, and the first can answer last: its list still says
|
|
63
|
+
* the second variable needs a key, so the row that was just saved flips back
|
|
64
|
+
* to `Needs a key` and stays there. The same newest-wins rule the probe
|
|
65
|
+
* itself follows, for the same reason — a late answer describing an earlier
|
|
66
|
+
* state is worse than no answer.
|
|
67
|
+
*/
|
|
68
|
+
const loadSeq = useRef(0);
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @param quiet keep the panels on screen while they refetch.
|
|
72
|
+
*
|
|
73
|
+
* The loud refresh drops the page to "Loading…", which UNMOUNTS every panel
|
|
74
|
+
* — and a panel row holds the verdict of the probe its own save just
|
|
75
|
+
* started. Nothing persists a verdict, so a loud refetch after a save throws
|
|
76
|
+
* away the only copy of the answer the save was waiting for. Same fix
|
|
77
|
+
* `useToolPage` made for the tool page, for the same reason.
|
|
78
|
+
*/
|
|
79
|
+
const refresh = useCallback(async (quiet = false) => {
|
|
80
|
+
const mine = ++loadSeq.current;
|
|
81
|
+
if (!quiet) setLoading(true);
|
|
82
|
+
setRefreshing(true);
|
|
60
83
|
try {
|
|
61
84
|
const [t, s] = await Promise.all([listToolSecrets(), listSecrets()]);
|
|
85
|
+
if (loadSeq.current !== mine) return;
|
|
62
86
|
setTools(t);
|
|
63
87
|
setSecrets(s);
|
|
64
88
|
setError(null);
|
|
65
89
|
} catch (err) {
|
|
66
|
-
|
|
90
|
+
// Inside the guard too: an older load failing after a newer one
|
|
91
|
+
// succeeded would raise an alert about a request nobody is waiting on.
|
|
92
|
+
if (loadSeq.current === mine) setError(err instanceof Error ? err.message : String(err));
|
|
67
93
|
} finally {
|
|
68
|
-
|
|
94
|
+
// `loading` is the FIRST paint's spinner, and only the newest load may
|
|
95
|
+
// take it down — an orphan clearing it would uncover an empty page.
|
|
96
|
+
if (loadSeq.current === mine) {
|
|
97
|
+
setLoading(false);
|
|
98
|
+
setRefreshing(false);
|
|
99
|
+
}
|
|
69
100
|
}
|
|
70
101
|
}, []);
|
|
71
102
|
|
|
@@ -106,8 +137,18 @@ export function SecretsPage() {
|
|
|
106
137
|
return (
|
|
107
138
|
<PageShell
|
|
108
139
|
title="Secrets"
|
|
140
|
+
// The header's Refresh is QUIET, like the refetch a save triggers: a loud
|
|
141
|
+
// one drops the page to "Loading…", which unmounts the panel holding the
|
|
142
|
+
// verdict of a probe still in flight and throws away the only copy of it.
|
|
143
|
+
// Disabling the button is the feedback instead — the list it would
|
|
144
|
+
// replace with a spinner is already on screen.
|
|
109
145
|
actions={
|
|
110
|
-
<Button
|
|
146
|
+
<Button
|
|
147
|
+
variant="quiet"
|
|
148
|
+
size="sm"
|
|
149
|
+
disabled={loading || refreshing}
|
|
150
|
+
onClick={() => void refresh(true)}
|
|
151
|
+
>
|
|
111
152
|
Refresh
|
|
112
153
|
</Button>
|
|
113
154
|
}
|
|
@@ -163,7 +204,7 @@ export function SecretsPage() {
|
|
|
163
204
|
</Badge>
|
|
164
205
|
)}
|
|
165
206
|
</div>
|
|
166
|
-
<ToolSecretsPanel tool={tool} onChanged={() => void refresh()} />
|
|
207
|
+
<ToolSecretsPanel tool={tool} onChanged={() => void refresh(true)} />
|
|
167
208
|
</Surface>
|
|
168
209
|
</li>
|
|
169
210
|
))}
|
|
@@ -11,6 +11,9 @@ import {
|
|
|
11
11
|
deleteUserVar,
|
|
12
12
|
} from '../services/tool-secrets.api';
|
|
13
13
|
import { startToolOAuth } from '../services/connect.api';
|
|
14
|
+
import { SavedKeyProbeResult } from '../probe/SavedKeyProbeResult';
|
|
15
|
+
import { useSavedKeyProbe, type SavedKeyProbe } from '../probe/useSavedKeyProbe';
|
|
16
|
+
import { announceToolCredentialsChanged } from '../../../core/events';
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
19
|
* Configure one tool's secrets, split by who provisions each variable:
|
|
@@ -23,11 +26,44 @@ import { startToolOAuth } from '../services/connect.api';
|
|
|
23
26
|
* because a person arrives here FROM a card or a tool page that used those
|
|
24
27
|
* words, and the fix-it surface must not describe the same state differently.
|
|
25
28
|
* Values are write-only throughout: fields start empty, saving replaces.
|
|
29
|
+
*
|
|
30
|
+
* Every save here is followed by the manual's health check, and the answer
|
|
31
|
+
* lands on the row that was saved (`SavedKeyProbeResult`). The vault used to
|
|
32
|
+
* store a value and stop, which made it the quietest place in the app to
|
|
33
|
+
* install a key the provider would refuse.
|
|
26
34
|
*/
|
|
27
35
|
export function ToolSecretsPanel({ tool, onChanged }: { tool: ToolSecrets; onChanged: () => void }) {
|
|
28
36
|
const adminVars = tool.variables.filter((v) => v.scope === 'admin');
|
|
29
37
|
const userVars = tool.variables.filter((v) => v.scope === 'user');
|
|
30
38
|
|
|
39
|
+
/**
|
|
40
|
+
* ONE probe for the whole panel, shared by every row.
|
|
41
|
+
*
|
|
42
|
+
* That is what a probe is: a single call carrying the tool's whole
|
|
43
|
+
* credential set, not a test of one `${VAR}`. Giving each row its own would
|
|
44
|
+
* leave the admin key's row still saying `Connected` after the user key
|
|
45
|
+
* below it changed the very credentials that answer was about.
|
|
46
|
+
*
|
|
47
|
+
* The slug is not merely WHAT to call: it is part of the identity of every
|
|
48
|
+
* answer the hook holds. This panel is not always remounted when the tool
|
|
49
|
+
* under it changes — the workspace's `.tool` renderer swaps `tool` on a
|
|
50
|
+
* mounted panel — and the hook is where that is handled, so no host of this
|
|
51
|
+
* component has to remember to key it.
|
|
52
|
+
*/
|
|
53
|
+
const probe = useSavedKeyProbe(tool.slug);
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Every write in this panel funnels through here, which is why the Library
|
|
57
|
+
* is told from the panel rather than from each of its three hosts (the
|
|
58
|
+
* Secrets page, the `.tool` editor's sidebar, and whatever mounts it next):
|
|
59
|
+
* a host that forgot would leave the cards and the plugin banners reading
|
|
60
|
+
* the state from before the save until a browser reload.
|
|
61
|
+
*/
|
|
62
|
+
const changed = () => {
|
|
63
|
+
announceToolCredentialsChanged();
|
|
64
|
+
onChanged();
|
|
65
|
+
};
|
|
66
|
+
|
|
31
67
|
if (tool.variables.length === 0) {
|
|
32
68
|
return (
|
|
33
69
|
<div className="flex flex-col gap-3">
|
|
@@ -62,7 +98,8 @@ export function ToolSecretsPanel({ tool, onChanged }: { tool: ToolSecrets; onCha
|
|
|
62
98
|
configured={(v) => v.adminConfigured}
|
|
63
99
|
onSave={(v, value) => setAdminVar(tool.slug, v.name, value)}
|
|
64
100
|
onDelete={(v) => deleteAdminVar(tool.slug, v.name)}
|
|
65
|
-
onChanged={
|
|
101
|
+
onChanged={changed}
|
|
102
|
+
probe={probe}
|
|
66
103
|
/>
|
|
67
104
|
)}
|
|
68
105
|
{userVars.length > 0 && (
|
|
@@ -80,7 +117,8 @@ export function ToolSecretsPanel({ tool, onChanged }: { tool: ToolSecrets; onCha
|
|
|
80
117
|
configured={(v) => v.userConfigured}
|
|
81
118
|
onSave={(v, value) => setUserVar(tool.slug, v.name, value)}
|
|
82
119
|
onDelete={(v) => deleteUserVar(tool.slug, v.name)}
|
|
83
|
-
onChanged={
|
|
120
|
+
onChanged={changed}
|
|
121
|
+
probe={probe}
|
|
84
122
|
/>
|
|
85
123
|
)}
|
|
86
124
|
</div>
|
|
@@ -135,6 +173,7 @@ function VarPlugin({
|
|
|
135
173
|
onSave,
|
|
136
174
|
onDelete,
|
|
137
175
|
onChanged,
|
|
176
|
+
probe,
|
|
138
177
|
}: {
|
|
139
178
|
title: string;
|
|
140
179
|
hint: string;
|
|
@@ -147,6 +186,8 @@ function VarPlugin({
|
|
|
147
186
|
onSave: (v: ToolVarStatus, value: string) => Promise<void>;
|
|
148
187
|
onDelete: (v: ToolVarStatus) => Promise<void>;
|
|
149
188
|
onChanged: () => void;
|
|
189
|
+
/** The panel's one probe — both groups of rows share it. */
|
|
190
|
+
probe: SavedKeyProbe;
|
|
150
191
|
}) {
|
|
151
192
|
return (
|
|
152
193
|
<div>
|
|
@@ -155,7 +196,14 @@ function VarPlugin({
|
|
|
155
196
|
<ul className="flex flex-col gap-1.5">
|
|
156
197
|
{vars.map((v) =>
|
|
157
198
|
v.oauth ? (
|
|
158
|
-
<OAuthVarRow
|
|
199
|
+
<OAuthVarRow
|
|
200
|
+
key={v.name}
|
|
201
|
+
v={v}
|
|
202
|
+
slug={slug}
|
|
203
|
+
ownerCanWrite={ownerCanWrite}
|
|
204
|
+
onChanged={onChanged}
|
|
205
|
+
probe={probe}
|
|
206
|
+
/>
|
|
159
207
|
) : (
|
|
160
208
|
<VarRow
|
|
161
209
|
key={v.name}
|
|
@@ -165,6 +213,7 @@ function VarPlugin({
|
|
|
165
213
|
onSave={(value) => onSave(v, value)}
|
|
166
214
|
onDelete={() => onDelete(v)}
|
|
167
215
|
onChanged={onChanged}
|
|
216
|
+
probe={probe}
|
|
168
217
|
/>
|
|
169
218
|
),
|
|
170
219
|
)}
|
|
@@ -180,6 +229,7 @@ function VarRow({
|
|
|
180
229
|
onSave,
|
|
181
230
|
onDelete,
|
|
182
231
|
onChanged,
|
|
232
|
+
probe,
|
|
183
233
|
}: {
|
|
184
234
|
v: ToolVarStatus;
|
|
185
235
|
editable: boolean;
|
|
@@ -187,23 +237,38 @@ function VarRow({
|
|
|
187
237
|
onSave: (value: string) => Promise<void>;
|
|
188
238
|
onDelete: () => Promise<void>;
|
|
189
239
|
onChanged: () => void;
|
|
240
|
+
/** Shared with the panel's other rows; it answers for whichever saved last. */
|
|
241
|
+
probe: SavedKeyProbe;
|
|
190
242
|
}) {
|
|
191
243
|
const [value, setValue] = useState('');
|
|
192
244
|
const [busy, setBusy] = useState(false);
|
|
193
245
|
const [error, setError] = useState<string | null>(null);
|
|
194
246
|
|
|
195
|
-
|
|
247
|
+
/**
|
|
248
|
+
* @param saved a value was WRITTEN, so there is something to test. A delete
|
|
249
|
+
* goes through here too and has nothing to prove — it only orphans
|
|
250
|
+
* whatever the last probe was about to say, since that described a value
|
|
251
|
+
* this row no longer holds.
|
|
252
|
+
*/
|
|
253
|
+
const run = async (fn: () => Promise<void>, saved = false) => {
|
|
196
254
|
setBusy(true);
|
|
197
255
|
setError(null);
|
|
198
256
|
try {
|
|
199
257
|
await fn();
|
|
258
|
+
// Stored and cleared first; the probe cannot fail or delay any of this.
|
|
200
259
|
setValue('');
|
|
201
260
|
onChanged();
|
|
202
261
|
} catch (err) {
|
|
203
262
|
setError(err instanceof Error ? err.message : String(err));
|
|
263
|
+
return;
|
|
204
264
|
} finally {
|
|
205
265
|
setBusy(false);
|
|
206
266
|
}
|
|
267
|
+
// Outside the try: a probe's trouble is never reported as the save's, and
|
|
268
|
+
// the save is already done by the time either is decided. Naming the
|
|
269
|
+
// variable moves the panel's shared answer onto THIS row.
|
|
270
|
+
if (saved) probe.probeSaved(v.name);
|
|
271
|
+
else probe.forget();
|
|
207
272
|
};
|
|
208
273
|
|
|
209
274
|
return (
|
|
@@ -242,12 +307,16 @@ function VarRow({
|
|
|
242
307
|
variant="primary"
|
|
243
308
|
size="sm"
|
|
244
309
|
disabled={busy || !value}
|
|
245
|
-
onClick={() => void run(() => onSave(value))}
|
|
310
|
+
onClick={() => void run(() => onSave(value), true)}
|
|
246
311
|
>
|
|
247
312
|
Save
|
|
248
313
|
</Button>
|
|
249
314
|
</div>
|
|
250
315
|
)}
|
|
316
|
+
{/* What the provider made of the value just saved here. Only on the row
|
|
317
|
+
that asked: the answer is the tool's, and the newest save is the only
|
|
318
|
+
place it is still current. */}
|
|
319
|
+
{probe.subject === v.name && <SavedKeyProbeResult probe={probe} className="mt-1.5" />}
|
|
251
320
|
{error && (
|
|
252
321
|
<p role="alert" className="mt-1 text-detail text-danger">
|
|
253
322
|
{error}
|
|
@@ -274,11 +343,14 @@ function OAuthVarRow({
|
|
|
274
343
|
slug,
|
|
275
344
|
ownerCanWrite,
|
|
276
345
|
onChanged,
|
|
346
|
+
probe,
|
|
277
347
|
}: {
|
|
278
348
|
v: ToolVarStatus;
|
|
279
349
|
slug: string;
|
|
280
350
|
ownerCanWrite: boolean;
|
|
281
351
|
onChanged: () => void;
|
|
352
|
+
/** Shared with the panel's other rows; it answers for whichever saved last. */
|
|
353
|
+
probe: SavedKeyProbe;
|
|
282
354
|
}) {
|
|
283
355
|
const [busy, setBusy] = useState(false);
|
|
284
356
|
const [error, setError] = useState<string | null>(null);
|
|
@@ -306,9 +378,14 @@ function OAuthVarRow({
|
|
|
306
378
|
onChanged();
|
|
307
379
|
} catch (err) {
|
|
308
380
|
setError(err instanceof Error ? err.message : String(err));
|
|
381
|
+
return;
|
|
309
382
|
} finally {
|
|
310
383
|
setBusy(false);
|
|
311
384
|
}
|
|
385
|
+
// Also a credential change: a replaced client secret can invalidate the
|
|
386
|
+
// tokens minted under the old one, so the tool's health is now unknown and
|
|
387
|
+
// worth testing — the same rule the tool page's rows follow.
|
|
388
|
+
probe.probeSaved(v.name);
|
|
312
389
|
};
|
|
313
390
|
|
|
314
391
|
return (
|
|
@@ -381,6 +458,8 @@ function OAuthVarRow({
|
|
|
381
458
|
</div>
|
|
382
459
|
</div>
|
|
383
460
|
)}
|
|
461
|
+
{/* What the provider made of the client secret just saved here. */}
|
|
462
|
+
{probe.subject === v.name && <SavedKeyProbeResult probe={probe} className="mt-1.5" />}
|
|
384
463
|
{error && (
|
|
385
464
|
<p role="alert" className="mt-1 text-detail text-danger">
|
|
386
465
|
{error}
|