@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.
- package/THIRD-PARTY-NOTICES.md +2 -2
- package/package.json +3 -3
- package/src/core/CoreAppShell.tsx +34 -26
- package/src/core/__tests__/AppChrome.test.tsx +0 -3
- package/src/core/__tests__/bootstrap.test.ts +33 -1
- package/src/core/__tests__/events.test.ts +43 -0
- package/src/core/bootstrap.ts +38 -1
- package/src/core/events.ts +85 -3
- package/src/core/registry.ts +1 -1
- package/src/lib/__tests__/api.test.ts +38 -0
- package/src/lib/__tests__/email.test.ts +44 -0
- package/src/lib/api.ts +19 -2
- package/src/lib/email.ts +37 -1
- package/src/lib/utils.ts +2 -0
- 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 +781 -76
- 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__/plugin-token.test.ts +21 -0
- package/src/modules/access/__tests__/tailwindDeclarations.ts +210 -0
- package/src/modules/access/api.ts +192 -10
- package/src/modules/access/components/ManageAccessDialog.tsx +1337 -570
- 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__/ConnectionKeysPage.test.tsx +266 -0
- 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/ConnectionKeysPage.tsx +269 -0
- package/src/modules/admin/components/DirectoryGroupsPage.tsx +91 -39
- package/src/modules/admin/components/UserAccountsPage.tsx +271 -37
- package/src/modules/admin/components/connection-keys-grouping.ts +43 -0
- package/src/modules/admin/components/group-members-path.ts +32 -0
- package/src/modules/admin/services/connection-keys.api.ts +47 -0
- package/src/modules/admin/services/roles.api.ts +12 -1
- 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/__tests__/GitSyncFailedBanner.test.tsx +65 -1
- package/src/modules/git/components/FileHistoryPanel.tsx +5 -0
- package/src/modules/git/components/GitSyncFailedBanner.tsx +68 -5
- 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 +109 -4
- 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 +104 -99
- package/src/modules/library/__tests__/LinkSkillPanel.test.tsx +136 -0
- package/src/modules/library/__tests__/LockedPluginView.test.tsx +103 -7
- package/src/modules/library/__tests__/NewPluginDialog.test.tsx +18 -8
- 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 +115 -9
- package/src/modules/library/__tests__/PluginJoinRequests.test.tsx +60 -1
- package/src/modules/library/__tests__/PluginPage.test.tsx +453 -7
- package/src/modules/library/__tests__/PluginsSidebar.contextmenu.test.tsx +17 -57
- package/src/modules/library/__tests__/PluginsSidebar.test.tsx +161 -97
- 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 +391 -78
- package/src/modules/library/__tests__/SkillsTree.test.tsx +461 -0
- package/src/modules/library/__tests__/ToolConnectionSection.test.tsx +582 -71
- package/src/modules/library/__tests__/ToolPage.test.tsx +94 -4
- package/src/modules/library/__tests__/WorkspaceItemRoute.test.tsx +279 -21
- 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 +183 -0
- package/src/modules/library/__tests__/library-data.test.ts +7 -0
- package/src/modules/library/__tests__/library-paths.test.ts +75 -0
- package/src/modules/library/__tests__/link-membership.test.ts +129 -0
- 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 +67 -0
- 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/__tests__/useJoinRequests.test.tsx +46 -0
- 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 +107 -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 +149 -34
- package/src/modules/library/components/LibraryLayout.tsx +120 -247
- package/src/modules/library/components/LibraryPage.tsx +172 -39
- package/src/modules/library/components/LinkSkillPanel.tsx +169 -0
- package/src/modules/library/components/LockedPluginView.tsx +63 -35
- package/src/modules/library/components/NameWithBadges.tsx +164 -0
- package/src/modules/library/components/NewPluginDialog.tsx +19 -5
- package/src/modules/library/components/PageActions.tsx +31 -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 +123 -23
- package/src/modules/library/components/PluginExtras.tsx +143 -18
- package/src/modules/library/components/PluginIndexRow.tsx +47 -12
- package/src/modules/library/components/PluginPage.tsx +234 -38
- package/src/modules/library/components/PluginRows.tsx +286 -0
- package/src/modules/library/components/PluginsSidebar.tsx +271 -238
- package/src/modules/library/components/PluginsSidebarMenu.tsx +26 -1
- package/src/modules/library/components/RenamePluginDialog.tsx +136 -0
- package/src/modules/library/components/ShareButton.tsx +17 -0
- package/src/modules/library/components/SkillsTree.tsx +204 -0
- package/src/modules/library/components/StatusDot.tsx +1 -0
- 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 +132 -23
- package/src/modules/library/components/skill-page/SharedViaPlugins.tsx +212 -0
- package/src/modules/library/components/skill-page/SkillFilePane.tsx +5 -0
- package/src/modules/library/components/skill-page/SkillPage.tsx +337 -121
- 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 +116 -17
- 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/useJoinRequests.ts +48 -18
- 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 +229 -82
- package/src/modules/library/routes/library-paths.ts +46 -35
- package/src/modules/library/services/library.api.ts +89 -17
- package/src/modules/library/services/plugins.api.ts +161 -9
- 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 +268 -37
- 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 +102 -0
- package/src/modules/library/utils/status.ts +204 -35
- package/src/modules/onboarding/__tests__/creator-welcome.test.tsx +11 -3
- 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 +154 -0
- package/src/modules/settings/components/ClaudeConnectionFields.tsx +23 -0
- package/src/modules/settings/components/DeploymentPage.tsx +16 -22
- package/src/modules/settings/components/MarketplaceSection.tsx +152 -0
- package/src/modules/settings/components/__tests__/ClaudeConnectionCard.test.tsx +63 -0
- package/src/modules/settings/components/__tests__/DeploymentPage.test.tsx +74 -1
- package/src/modules/settings/components/__tests__/MarketplaceSection.test.tsx +325 -0
- package/src/modules/settings/components/__tests__/SettingsLayout.test.tsx +5 -5
- package/src/modules/settings/services/github-facade.api.ts +66 -0
- package/src/modules/settings/settings-nav-items.tsx +10 -2
- 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 +615 -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 +711 -40
- package/src/modules/setup/hooks/useSetupStatus.ts +93 -0
- package/src/modules/setup/services/setup.api.ts +218 -3
- 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 +395 -124
- 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 +659 -36
- 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 +6 -3
- package/src/modules/workspace/components/FileExplorer.tsx +1527 -367
- package/src/modules/workspace/components/FileRoute.tsx +376 -22
- package/src/modules/workspace/components/FileViewer.tsx +166 -45
- 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 +2473 -129
- package/src/modules/workspace/components/__tests__/FileRoute.test.tsx +768 -16
- package/src/modules/workspace/components/__tests__/FileViewer.test.tsx +332 -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 +89 -0
- package/src/modules/workspace/hooks/useWorkspaceImageResolver.ts +55 -0
- package/src/modules/workspace/hooks/useWorkspaceState.ts +438 -66
- package/src/modules/workspace/routing/__tests__/kb-routes.test.tsx +279 -3
- package/src/modules/workspace/routing/kb-routes.ts +207 -30
- package/src/modules/workspace/services/__tests__/workspace.api.test.ts +57 -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 +130 -16
- package/src/modules/workspace/utils/__tests__/file-trace.test.ts +73 -0
- package/src/modules/workspace/utils/__tests__/fileTree.test.ts +234 -5
- 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 +126 -52
- 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 +59 -0
- package/src/shared/components/Badge.tsx +3 -1
- package/src/shared/components/Banner.tsx +5 -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 +118 -0
- 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 +34 -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 -265
- 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
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { cn } from '../../../lib/utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* How much of the name survives when something else is sharing its line.
|
|
6
|
+
*
|
|
7
|
+
* The bug this exists for: a card's header row put a `truncate` name next to
|
|
8
|
+
* `shrink-0` badges, so the badges took whatever width they wanted and the
|
|
9
|
+
* name paid for all of it — a 236px card showed "di…" beside four pills that
|
|
10
|
+
* each said less than the word they had crowded out.
|
|
11
|
+
*
|
|
12
|
+
* `ch` rather than a pixel count, because the thing being protected is a
|
|
13
|
+
* number of CHARACTERS: the floor has to mean the same amount of readable
|
|
14
|
+
* name whatever size the row is set in, and a card's name (`lede`) and a page
|
|
15
|
+
* title (`display`) are not the same size. 12 is the ticket's number. It does
|
|
16
|
+
* not promise a whole name — no floor can, against a name of any length — it
|
|
17
|
+
* promises enough of one to tell the cards in a grid apart, which is the
|
|
18
|
+
* question a grid is actually scanned for.
|
|
19
|
+
*
|
|
20
|
+
* Exported so the tests can name it rather than re-typing the class.
|
|
21
|
+
*/
|
|
22
|
+
export const NAME_MIN_WIDTH = 'min-w-[12ch]';
|
|
23
|
+
|
|
24
|
+
export interface NameWithBadgesProps {
|
|
25
|
+
/**
|
|
26
|
+
* The full name, as text. It is always in the DOM in full — the truncation
|
|
27
|
+
* is `text-overflow`, so a screen reader reads the whole thing — and it is
|
|
28
|
+
* repeated in `title` for the sighted reader who cannot.
|
|
29
|
+
*/
|
|
30
|
+
name: string;
|
|
31
|
+
/**
|
|
32
|
+
* The chips that qualify the name — `Owner`, `Linked`, `MCP server`.
|
|
33
|
+
* ABSENT, not an empty fragment, when there are none: whether anything is
|
|
34
|
+
* competing with the name for the row is what decides whether the name is
|
|
35
|
+
* given a floor, and `<></>` cannot be told apart from three pills.
|
|
36
|
+
*/
|
|
37
|
+
badges?: ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* A mark that belongs to the name — a tool's logo.
|
|
40
|
+
*
|
|
41
|
+
* It does NOT earn the name a floor, and the distinction is the one this
|
|
42
|
+
* component got wrong first time round. A badge can be moved: when the
|
|
43
|
+
* floor and the badges stop fitting, the badges take a second line and give
|
|
44
|
+
* the whole row back to the name. A mark cannot — it is fixed width, it sits
|
|
45
|
+
* on the name's own line, and no floor can conjure the space it is holding.
|
|
46
|
+
* A floor granted for a mark is therefore a floor with nothing to take the
|
|
47
|
+
* space back FROM, which is an overflow with extra steps.
|
|
48
|
+
*/
|
|
49
|
+
leading?: ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the badges may take a second line. True everywhere the row is
|
|
52
|
+
* allowed to grow, which is every list and every card.
|
|
53
|
+
*
|
|
54
|
+
* `false` is for a row whose height is a contract the row does not own —
|
|
55
|
+
* the tool page's title bar is `HEADER_BAND`, exactly as tall as the
|
|
56
|
+
* sidebar's header row beside it, and a second line there does not make the
|
|
57
|
+
* band taller, it hangs out of the bottom of it. Such a caller owes the row
|
|
58
|
+
* an `overflow-hidden`: with nowhere to wrap to, the only other way out is
|
|
59
|
+
* across whatever is beside it.
|
|
60
|
+
*/
|
|
61
|
+
wrap?: boolean;
|
|
62
|
+
/** Typography for the name itself — the caller's `text-lede`/`text-display`. */
|
|
63
|
+
nameClassName?: string;
|
|
64
|
+
/**
|
|
65
|
+
* The gap between everything on the row. A prop because the page header
|
|
66
|
+
* sets its band on `gap-4` and a card sets its row on `gap-2`, and the gap
|
|
67
|
+
* between a name and its badges is not a different measurement from the gap
|
|
68
|
+
* between a logo and its name.
|
|
69
|
+
*/
|
|
70
|
+
gap?: string;
|
|
71
|
+
className?: string;
|
|
72
|
+
/**
|
|
73
|
+
* What the name element is. A page's title is an `h1`; a card's and a row's
|
|
74
|
+
* name is a `span`, because the card is already a button with an accessible
|
|
75
|
+
* name and a heading inside it would announce a second one.
|
|
76
|
+
*/
|
|
77
|
+
as?: 'span' | 'h1';
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* A name, and the things that share its line, laid out so the NAME wins.
|
|
82
|
+
*
|
|
83
|
+
* Two rules, and the second is the one that was missing:
|
|
84
|
+
*
|
|
85
|
+
* 1. The name truncates with an ellipsis and carries its full self in
|
|
86
|
+
* `title` — which the card already did.
|
|
87
|
+
* 2. Below a floor it stops giving way and the badges WRAP UNDER IT instead
|
|
88
|
+
* — which nothing did, and which is why a narrow card said "di…".
|
|
89
|
+
*
|
|
90
|
+
* The mechanics, because they are not guessable from the class list:
|
|
91
|
+
*
|
|
92
|
+
* The row is `flex-wrap`, and its children are FLAT — mark, name, badge
|
|
93
|
+
* group, all siblings. The flatness is load-bearing. Wrapping the mark and
|
|
94
|
+
* the name in an intermediate group reads better and does not work: that
|
|
95
|
+
* group would be a flex item with `min-width: auto`, whose content-based
|
|
96
|
+
* minimum is the full width of a `whitespace-nowrap` name, so the group would
|
|
97
|
+
* refuse to shrink and the name would never truncate at all. The usual cure,
|
|
98
|
+
* `min-w-0` on the group, throws away the floor in the same breath — a floor
|
|
99
|
+
* IS a minimum width. Flat, the floor sits directly on the name and there is
|
|
100
|
+
* no wrapper left to lie about it.
|
|
101
|
+
*
|
|
102
|
+
* `flex-1` gives the name a flex base size of 0, so what flexbox measures it
|
|
103
|
+
* at when deciding where to break the line is exactly the floor. The break
|
|
104
|
+
* therefore happens the moment the floor plus the badges no longer fit:
|
|
105
|
+
* badges to line two, name alone on line one with the whole width to
|
|
106
|
+
* truncate into.
|
|
107
|
+
*
|
|
108
|
+
* Which is why the floor is spent on BADGES and on nothing else. A floor is
|
|
109
|
+
* a claim on space that something else has to give back, and a badge is the
|
|
110
|
+
* only thing on this row that can: it takes a second line and the name gets
|
|
111
|
+
* the first one whole. A mark cannot move and a back link is not even in this
|
|
112
|
+
* component, so a floor granted for either is a minimum width with no matching
|
|
113
|
+
* concession — the row simply becomes wider than the box it is in. That is
|
|
114
|
+
* exactly what it did on the tool page's title bar, where the band is one row
|
|
115
|
+
* tall by contract: the `<h1>` wrapped under the logo, the row grew to 86px
|
|
116
|
+
* inside a 48px band, and the title rendered outside it at every phone width.
|
|
117
|
+
* A name with nothing beside it gets no floor for the same reason.
|
|
118
|
+
*
|
|
119
|
+
* `wrap={false}` is the other half of that lesson, for a row whose height is
|
|
120
|
+
* not its own to spend. It is belt to the braces above: with the floor tied
|
|
121
|
+
* to badges, a header that has none cannot break a line anyway — but the day
|
|
122
|
+
* somebody adds one, the band should clip rather than silently grow.
|
|
123
|
+
*/
|
|
124
|
+
export function NameWithBadges({
|
|
125
|
+
name,
|
|
126
|
+
badges,
|
|
127
|
+
leading,
|
|
128
|
+
nameClassName,
|
|
129
|
+
gap = 'gap-2',
|
|
130
|
+
wrap = true,
|
|
131
|
+
className,
|
|
132
|
+
as: NameTag = 'span',
|
|
133
|
+
}: NameWithBadgesProps) {
|
|
134
|
+
// The row follows its name, because what may legally contain what runs both
|
|
135
|
+
// ways. A card and a plugin row are `<button>`s, whose content model is
|
|
136
|
+
// phrasing — a `<div>` inside one is not markup — so the row is a `<span>`.
|
|
137
|
+
// A page title is an `<h1>`, which a `<span>` may not contain for the same
|
|
138
|
+
// rule read the other way round, so that row is a `<div>`.
|
|
139
|
+
const Row = NameTag === 'h1' ? 'div' : 'span';
|
|
140
|
+
return (
|
|
141
|
+
<Row className={cn('flex min-w-0 items-center', wrap ? 'flex-wrap' : 'flex-nowrap', gap, className)}>
|
|
142
|
+
{leading}
|
|
143
|
+
<NameTag
|
|
144
|
+
// Omitted rather than `title=""`: a tooltip that opens on nothing is
|
|
145
|
+
// a tooltip that opens on nothing. A name can be missing — the row
|
|
146
|
+
// still has to render whatever is beside it around the hole.
|
|
147
|
+
title={name || undefined}
|
|
148
|
+
className={cn('flex-1 truncate', badges && NAME_MIN_WIDTH, nameClassName)}
|
|
149
|
+
>
|
|
150
|
+
{name}
|
|
151
|
+
</NameTag>
|
|
152
|
+
{badges && (
|
|
153
|
+
// `shrink-0`, so a badge is never squeezed into an unreadable pill —
|
|
154
|
+
// the group moves as a unit instead. `max-w-full` is the one thing it
|
|
155
|
+
// may not do: on its own line a group wider than the row would paint
|
|
156
|
+
// over whatever is beside the row, so past that width the badges wrap
|
|
157
|
+
// among THEMSELVES rather than overflow.
|
|
158
|
+
<span className={cn('flex max-w-full shrink-0 flex-wrap items-center', gap)}>
|
|
159
|
+
{badges}
|
|
160
|
+
</span>
|
|
161
|
+
)}
|
|
162
|
+
</Row>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
@@ -8,6 +8,12 @@ import { useLibraryToast } from '../state/toast.context';
|
|
|
8
8
|
export interface NewPluginDialogProps {
|
|
9
9
|
/** Names already taken — readable plugins AND locked ones. */
|
|
10
10
|
existing: string[];
|
|
11
|
+
/**
|
|
12
|
+
* The grouping folder below the plugins root to make the plugin in
|
|
13
|
+
* (`Teams`, `Teams/EU`) — where a person right-clicked in the Plugins tree.
|
|
14
|
+
* Empty or absent: the root. The dialog says where the plugin will go.
|
|
15
|
+
*/
|
|
16
|
+
parent?: string;
|
|
11
17
|
onClose(): void;
|
|
12
18
|
/** The catalog and the plugin index both have to hear about a new folder. */
|
|
13
19
|
onCreated(): void;
|
|
@@ -24,13 +30,15 @@ export interface NewPluginDialogProps {
|
|
|
24
30
|
* answering. So there is no access step in this dialog: by the time the
|
|
25
31
|
* response arrives, the plugin exists and it is yours.
|
|
26
32
|
*/
|
|
27
|
-
export function NewPluginDialog({ existing, onClose, onCreated }: NewPluginDialogProps) {
|
|
33
|
+
export function NewPluginDialog({ existing, parent = '', onClose, onCreated }: NewPluginDialogProps) {
|
|
28
34
|
const navigate = useNavigate();
|
|
29
35
|
const toast = useLibraryToast();
|
|
30
36
|
const [name, setName] = useState('');
|
|
31
37
|
const [busy, setBusy] = useState(false);
|
|
32
38
|
|
|
33
39
|
const trimmed = name.trim();
|
|
40
|
+
// The index's names are identities across the whole tree, so a clash with
|
|
41
|
+
// one is a clash anywhere; the server is still the judge of the folder.
|
|
34
42
|
const taken = existing.some((g) => g.toLowerCase() === trimmed.toLowerCase());
|
|
35
43
|
/**
|
|
36
44
|
* A plugin name becomes a folder name, so the characters a path cannot carry
|
|
@@ -50,12 +58,12 @@ export function NewPluginDialog({ existing, onClose, onCreated }: NewPluginDialo
|
|
|
50
58
|
if (!canCreate) return;
|
|
51
59
|
setBusy(true);
|
|
52
60
|
try {
|
|
53
|
-
// Navigate with the SERVER's
|
|
54
|
-
// endpoint owns the
|
|
55
|
-
const {
|
|
61
|
+
// Navigate with the SERVER's identity, not the typed name — the
|
|
62
|
+
// endpoint owns the identifier of what it created.
|
|
63
|
+
const { name } = await createPlugin(trimmed, parent);
|
|
56
64
|
onCreated();
|
|
57
65
|
onClose();
|
|
58
|
-
navigate(pathForPlugin(
|
|
66
|
+
navigate(pathForPlugin(name));
|
|
59
67
|
} catch (err) {
|
|
60
68
|
// The server's refusal names the problem (name taken, reserved
|
|
61
69
|
// prefix…) — worth more than a generic apology.
|
|
@@ -85,6 +93,12 @@ export function NewPluginDialog({ existing, onClose, onCreated }: NewPluginDialo
|
|
|
85
93
|
>
|
|
86
94
|
<p className="text-ui text-ink-muted">
|
|
87
95
|
A plugin carries skills and tools for the people in it. You run the ones you create.
|
|
96
|
+
{parent && (
|
|
97
|
+
<>
|
|
98
|
+
{' '}
|
|
99
|
+
This one goes in <span className="font-mono text-detail text-ink">{parent}/</span>.
|
|
100
|
+
</>
|
|
101
|
+
)}
|
|
88
102
|
</p>
|
|
89
103
|
|
|
90
104
|
<TextField
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useCallback, useRef, useState } from 'react';
|
|
2
|
-
import { Link2, Plus, Trash2,
|
|
2
|
+
import { Link2, Plus, Trash2, Pencil } from 'lucide-react';
|
|
3
3
|
import { cn } from '../../../lib/utils';
|
|
4
4
|
import {
|
|
5
|
-
Button,
|
|
6
5
|
IconButton,
|
|
7
6
|
MenuItem,
|
|
8
7
|
MenuPanel,
|
|
9
8
|
useDismissableMenu,
|
|
10
9
|
} from '../../../shared/components';
|
|
10
|
+
import { ShareButton } from './ShareButton';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* The three actions beside a place's title — the prototype's `spaceActs`
|
|
@@ -58,8 +58,19 @@ export interface PageActionsProps {
|
|
|
58
58
|
* 404s for everyone but the owner is a broken promise, not a consistency.
|
|
59
59
|
*/
|
|
60
60
|
onDelete?: () => void;
|
|
61
|
+
/**
|
|
62
|
+
* Opens the rename dialog. Present only for a MANAGER (the same write
|
|
63
|
+
* verdict that lets them link and answer join requests).
|
|
64
|
+
*/
|
|
65
|
+
onRename?: () => void;
|
|
61
66
|
/** Names the thing, for the `+` tooltip and the accessible names. */
|
|
62
67
|
addLabel?: string;
|
|
68
|
+
/**
|
|
69
|
+
* What the delete item CALLS the act. A place is deleted as a plugin; the
|
|
70
|
+
* tool page reuses this menu, and an item there reading "Delete plugin"
|
|
71
|
+
* would name the wrong thing entirely.
|
|
72
|
+
*/
|
|
73
|
+
deleteLabel?: string;
|
|
63
74
|
}
|
|
64
75
|
|
|
65
76
|
export function PageActions({
|
|
@@ -67,7 +78,9 @@ export function PageActions({
|
|
|
67
78
|
onAdd,
|
|
68
79
|
onCopyLink,
|
|
69
80
|
onDelete,
|
|
81
|
+
onRename,
|
|
70
82
|
addLabel = 'Add a skill or tool',
|
|
83
|
+
deleteLabel = 'Delete plugin',
|
|
71
84
|
}: PageActionsProps) {
|
|
72
85
|
const [open, setOpen] = useState(false);
|
|
73
86
|
const [copied, setCopied] = useState<null | 'ok' | 'fail'>(null);
|
|
@@ -88,12 +101,7 @@ export function PageActions({
|
|
|
88
101
|
|
|
89
102
|
return (
|
|
90
103
|
<div className="relative flex flex-none items-center gap-1.5">
|
|
91
|
-
{onShare &&
|
|
92
|
-
<Button variant="outline" size="sm" onClick={onShare}>
|
|
93
|
-
<Users size={13} />
|
|
94
|
-
Share
|
|
95
|
-
</Button>
|
|
96
|
-
)}
|
|
104
|
+
{onShare && <ShareButton onClick={onShare} />}
|
|
97
105
|
|
|
98
106
|
{onAdd && (
|
|
99
107
|
<IconButton aria-label={addLabel} title={addLabel} onClick={onAdd}>
|
|
@@ -128,6 +136,20 @@ export function PageActions({
|
|
|
128
136
|
item that cannot do its job is worse than one that is not
|
|
129
137
|
there. The menu exists so it drops in without moving
|
|
130
138
|
anything. */}
|
|
139
|
+
{onRename && (
|
|
140
|
+
<MenuItem
|
|
141
|
+
role="menuitem"
|
|
142
|
+
onClick={() => {
|
|
143
|
+
close();
|
|
144
|
+
onRename();
|
|
145
|
+
}}
|
|
146
|
+
>
|
|
147
|
+
<span className="flex items-center gap-2.5">
|
|
148
|
+
<Pencil size={14} />
|
|
149
|
+
Rename plugin
|
|
150
|
+
</span>
|
|
151
|
+
</MenuItem>
|
|
152
|
+
)}
|
|
131
153
|
{onDelete && (
|
|
132
154
|
<MenuItem
|
|
133
155
|
role="menuitem"
|
|
@@ -139,7 +161,7 @@ export function PageActions({
|
|
|
139
161
|
>
|
|
140
162
|
<span className="flex items-center gap-2.5">
|
|
141
163
|
<Trash2 size={14} />
|
|
142
|
-
|
|
164
|
+
{deleteLabel}
|
|
143
165
|
</span>
|
|
144
166
|
</MenuItem>
|
|
145
167
|
)}
|
|
@@ -3,13 +3,15 @@ import { ChangeRequestDialog } from '../../change-requests/components/ChangeRequ
|
|
|
3
3
|
import { useLibrary, type LibraryItem } from '../state/library-data';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* The review surface for a skill that does not exist yet.
|
|
6
|
+
* The review surface for a skill or a tool that does not exist yet.
|
|
7
7
|
*
|
|
8
|
-
* A released
|
|
9
|
-
* off the file they touch. A PROPOSED
|
|
10
|
-
* because there is
|
|
8
|
+
* A released item opens its own page, and the change requests against it hang
|
|
9
|
+
* off the file they touch. A PROPOSED one has neither — there is no page,
|
|
10
|
+
* because there is nothing on the default branch to build one from — so the
|
|
11
11
|
* card opens the change request itself, which is the whole of what there is to
|
|
12
|
-
* read and the only place the decision can be made.
|
|
12
|
+
* read and the only place the decision can be made. That is also what keeps a
|
|
13
|
+
* proposal from being OPENED AS THE THING: a tool page would try to probe a
|
|
14
|
+
* connection for a manual the catalog has never seen.
|
|
13
15
|
*
|
|
14
16
|
* `ChangeRequestDialog` needs no adapting for this: it always lists every file
|
|
15
17
|
* the request touches and diffs each against the default branch EXCEPT the
|
|
@@ -17,8 +19,13 @@ import { useLibrary, type LibraryItem } from '../state/library-data';
|
|
|
17
19
|
* the proposal as one green document and its Apply button records the
|
|
18
20
|
* approvals and merges. No scope either — a scope only ADDS a surface's
|
|
19
21
|
* released files to the list, and a proposal has none by definition.
|
|
22
|
+
*
|
|
23
|
+
* A proposed MCP SERVER is the one case whose file is not wholly new: the
|
|
24
|
+
* server is a key added to a plugin's `mcp.json`, which may already exist. The
|
|
25
|
+
* dialog handles that as it handles any other edit — the diff against the
|
|
26
|
+
* default branch — so the reader sees the added entry in its context.
|
|
20
27
|
*/
|
|
21
|
-
export function
|
|
28
|
+
export function PendingItemReview({
|
|
22
29
|
item,
|
|
23
30
|
onClose,
|
|
24
31
|
onResolved,
|
|
@@ -49,7 +56,7 @@ function standInFor(
|
|
|
49
56
|
): PullRequestSummary {
|
|
50
57
|
return {
|
|
51
58
|
number: pending.changeRequestNumber,
|
|
52
|
-
title: `New skill: ${item.name}`,
|
|
59
|
+
title: `New ${item.kind === 'skill' ? 'skill' : 'tool'}: ${item.name}`,
|
|
53
60
|
author: { login: '', name: pending.authorName },
|
|
54
61
|
appAuthor: { name: pending.authorName },
|
|
55
62
|
branch: pending.branch,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
1
2
|
import { Button, Dialog, Surface } from '../../../shared/components';
|
|
2
3
|
import { useAdmin } from '../../admin/state/admin.context';
|
|
3
4
|
import { NewSkillPanel } from './NewSkillPanel';
|
|
5
|
+
import { AddDialogTabs, type AddKind } from './AddDialogTabs';
|
|
4
6
|
import { useLibraryToast } from '../state/toast.context';
|
|
5
7
|
import { COPIED_TOAST, COPY_FAILED_TOAST, copyToClipboard } from '../utils/clipboard';
|
|
6
8
|
|
|
@@ -29,33 +31,28 @@ export interface PersonalAddDialogProps {
|
|
|
29
31
|
* first write. The folder's seeded access.md names you as its owner, so the
|
|
30
32
|
* write that follows passes the ordinary gate on its own merits — no
|
|
31
33
|
* permission special-case anywhere in this flow.
|
|
34
|
+
*
|
|
35
|
+
* Skills and tools are separate tabs, as in `AddToPluginDialog`: the Tools tab
|
|
36
|
+
* explains (a prompt, an MCP server, a `.tool` manual) rather than creates.
|
|
32
37
|
*/
|
|
33
38
|
export function PersonalAddDialog({ name, existingSkills, onClose }: PersonalAddDialogProps) {
|
|
34
39
|
const { isAdmin } = useAdmin();
|
|
35
40
|
const toast = useLibraryToast();
|
|
36
|
-
const
|
|
41
|
+
const [kind, setKind] = useState<AddKind>('skills');
|
|
42
|
+
const skillPrompt = `Help me build a new skill or tool at Bevel. Keep it to myself for now. It goes in my own list, not a plugin.`;
|
|
43
|
+
const toolPrompt = `Help me build a new tool at Bevel. Keep it to myself for now. It goes in my own list, not a plugin.`;
|
|
37
44
|
|
|
38
45
|
async function copyPrompt() {
|
|
46
|
+
const prompt = kind === 'tools' ? toolPrompt : skillPrompt;
|
|
39
47
|
const copied = await copyToClipboard(prompt);
|
|
40
48
|
toast(copied ? COPIED_TOAST : COPY_FAILED_TOAST, copied ? 'neutral' : 'danger');
|
|
41
49
|
}
|
|
42
50
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
footer={
|
|
49
|
-
<>
|
|
50
|
-
<Button variant="quiet" onClick={onClose}>
|
|
51
|
-
Close
|
|
52
|
-
</Button>
|
|
53
|
-
<Button variant="primary" onClick={() => void copyPrompt()}>
|
|
54
|
-
Copy prompt
|
|
55
|
-
</Button>
|
|
56
|
-
</>
|
|
57
|
-
}
|
|
58
|
-
>
|
|
51
|
+
// Both panels stay mounted (see `AddDialogTabs`): the Skills half holds the
|
|
52
|
+
// new-skill name an admin may already have typed, and a tab click is not a
|
|
53
|
+
// reason to lose it.
|
|
54
|
+
const skillsPanel = (
|
|
55
|
+
<>
|
|
59
56
|
<p className="text-ui text-ink-muted">
|
|
60
57
|
{`It lands in ${name}. Yours alone until you add it to a plugin.`}
|
|
61
58
|
</p>
|
|
@@ -81,8 +78,61 @@ export function PersonalAddDialog({ name, existingSkills, onClose }: PersonalAdd
|
|
|
81
78
|
</p>
|
|
82
79
|
|
|
83
80
|
<Surface tone="sunken" radius="md" elevation="none" padded className="mt-2.5">
|
|
84
|
-
<p className="font-mono text-detail text-ink">{
|
|
81
|
+
<p className="font-mono text-detail text-ink">{skillPrompt}</p>
|
|
82
|
+
</Surface>
|
|
83
|
+
</>
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const toolsPanel = (
|
|
87
|
+
<>
|
|
88
|
+
{/* The same note as the Skills tab: your own folder has no other
|
|
89
|
+
owner, so there is no change request to mention. */}
|
|
90
|
+
<p className="text-ui text-ink-muted">
|
|
91
|
+
{`It lands in ${name}. Yours alone until you add it to a plugin.`}
|
|
92
|
+
</p>
|
|
93
|
+
|
|
94
|
+
<p className="mt-3 text-ui text-ink-muted">
|
|
95
|
+
Tell your agent what the tool should do. It drafts the tool and puts it here.
|
|
96
|
+
</p>
|
|
97
|
+
|
|
98
|
+
<Surface tone="sunken" radius="md" elevation="none" padded className="mt-2.5">
|
|
99
|
+
<p className="font-mono text-detail text-ink">{toolPrompt}</p>
|
|
85
100
|
</Surface>
|
|
101
|
+
|
|
102
|
+
{/* A personal folder is an ordinary plugin folder on disk, so it uses the
|
|
103
|
+
same two locations as any other: `mcp.json` at its root, `.tool`
|
|
104
|
+
manuals under the reverse-DNS extension directory. */}
|
|
105
|
+
<p className="mt-3.5 text-ui text-ink-muted">
|
|
106
|
+
To connect an MCP server, add it to the mcp.json in your own folder.
|
|
107
|
+
</p>
|
|
108
|
+
<p className="mt-2 text-ui text-ink-muted">
|
|
109
|
+
To call an API without an MCP server, add a .tool manual describing it under
|
|
110
|
+
software.bevel.hexis/tools/ in your own folder.
|
|
111
|
+
</p>
|
|
112
|
+
</>
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<Dialog
|
|
117
|
+
open
|
|
118
|
+
onClose={onClose}
|
|
119
|
+
title="Add a skill or tool"
|
|
120
|
+
footer={
|
|
121
|
+
<>
|
|
122
|
+
<Button variant="quiet" onClick={onClose}>
|
|
123
|
+
Close
|
|
124
|
+
</Button>
|
|
125
|
+
<Button variant="primary" onClick={() => void copyPrompt()}>
|
|
126
|
+
Copy prompt
|
|
127
|
+
</Button>
|
|
128
|
+
</>
|
|
129
|
+
}
|
|
130
|
+
>
|
|
131
|
+
<AddDialogTabs
|
|
132
|
+
selected={kind}
|
|
133
|
+
onSelect={setKind}
|
|
134
|
+
panels={{ skills: skillsPanel, tools: toolsPanel }}
|
|
135
|
+
/>
|
|
86
136
|
</Dialog>
|
|
87
137
|
);
|
|
88
138
|
}
|