@bevel-software/platform-core-frontend 0.7.5 → 0.9.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/LICENSE +202 -202
- package/THIRD-PARTY-NOTICES.md +344 -988
- package/package.json +5 -5
- package/src/core/CoreAppShell.tsx +4 -4
- package/src/core/__tests__/ShellRoutes.test.tsx +1 -1
- package/src/core/__tests__/bootstrap.test.ts +47 -2
- package/src/core/bootstrap.ts +20 -0
- package/src/core/registry.ts +16 -4
- package/src/css-side-effect-imports.d.ts +7 -7
- package/src/modules/access/__tests__/ManageAccessDialog.placement.test.tsx +1 -1
- package/src/modules/access/__tests__/ManageAccessDialog.test.tsx +5 -5
- package/src/modules/access/api.ts +5 -5
- package/src/modules/access/components/ManageAccessDialog.tsx +21 -20
- package/src/modules/admin/__tests__/AdminRolesPage.suggest.test.tsx +1 -1
- package/src/modules/admin/components/AdminRolesPage.tsx +1 -1
- package/src/modules/admin/state/admin.context.tsx +15 -0
- package/src/modules/change-requests/__tests__/useFileOnBranch.test.tsx +2 -2
- package/src/modules/change-requests/components/ChangeRequestDialog.tsx +1 -1
- package/src/modules/change-requests/hooks/useApplyChangeRequest.ts +1 -1
- package/src/modules/layout/__tests__/SidebarFrameResponsive.test.tsx +4 -4
- package/src/modules/layout/__tests__/SidebarToggle.test.tsx +4 -4
- package/src/modules/layout/__tests__/breakpoints.test.ts +1 -1
- package/src/modules/layout/components/SidebarFrame.tsx +2 -2
- package/src/modules/library/__tests__/{AddToGroupDialog.test.tsx → AddToPluginDialog.test.tsx} +34 -34
- package/src/modules/library/__tests__/LibraryCard.test.tsx +30 -11
- package/src/modules/library/__tests__/LibraryRoutes.test.tsx +84 -59
- package/src/modules/library/__tests__/LibrarySidebarMenu.test.tsx +51 -51
- package/src/modules/library/__tests__/{LockedGroupView.test.tsx → LockedPluginView.test.tsx} +33 -33
- package/src/modules/library/__tests__/McpServerSection.test.tsx +138 -0
- package/src/modules/library/__tests__/{NewGroupDialog.test.tsx → NewPluginDialog.test.tsx} +22 -22
- package/src/modules/library/__tests__/PersonalAddDialog.test.tsx +7 -7
- package/src/modules/library/__tests__/PluginExtras.test.tsx +131 -0
- package/src/modules/library/__tests__/{GroupJoinRequests.test.tsx → PluginJoinRequests.test.tsx} +24 -24
- package/src/modules/library/__tests__/{GroupPage.test.tsx → PluginPage.test.tsx} +197 -106
- package/src/modules/library/__tests__/PluginsIndexPage.test.tsx +363 -0
- package/src/modules/library/__tests__/{GroupsSidebar.contextmenu.test.tsx → PluginsSidebar.contextmenu.test.tsx} +32 -31
- package/src/modules/library/__tests__/{GroupsSidebar.locked.test.tsx → PluginsSidebar.locked.test.tsx} +29 -28
- package/src/modules/library/__tests__/PluginsSidebar.test.tsx +171 -0
- package/src/modules/library/__tests__/{GroupsSidebarMenu.test.tsx → PluginsSidebarMenu.test.tsx} +18 -18
- package/src/modules/library/__tests__/SkillPage.test.tsx +8 -8
- package/src/modules/library/__tests__/ToolConnectionSection.test.tsx +2 -2
- package/src/modules/library/__tests__/ToolPage.test.tsx +41 -12
- package/src/modules/library/__tests__/ToolSharePanel.test.tsx +1 -1
- package/src/modules/library/__tests__/WorkspaceItemRoute.test.tsx +57 -57
- package/src/modules/library/__tests__/auth-harness.tsx +4 -4
- package/src/modules/library/__tests__/library-data.test.ts +82 -0
- package/src/modules/library/__tests__/status.test.ts +19 -19
- package/src/modules/library/__tests__/tools.api.test.ts +70 -0
- package/src/modules/library/__tests__/useToolPage.test.tsx +4 -4
- package/src/modules/library/components/AccessRequestsBanner.tsx +8 -8
- package/src/modules/library/components/{AddToGroupDialog.tsx → AddToPluginDialog.tsx} +11 -11
- package/src/modules/library/components/ChangeRequestDock.tsx +1 -1
- package/src/modules/library/components/{DeleteGroupDialog.tsx → DeletePluginDialog.tsx} +9 -9
- package/src/modules/library/components/LibraryCard.tsx +26 -2
- package/src/modules/library/components/LibraryLayout.tsx +80 -71
- package/src/modules/library/components/LibraryPage.tsx +8 -8
- package/src/modules/library/components/LockGlyph.tsx +1 -1
- package/src/modules/library/components/{LockedGroupView.tsx → LockedPluginView.tsx} +35 -35
- package/src/modules/library/components/{ManagedGroupRequests.tsx → ManagedPluginRequests.tsx} +13 -13
- package/src/modules/library/components/{NewGroupDialog.tsx → NewPluginDialog.tsx} +24 -24
- package/src/modules/library/components/NewSkillPanel.tsx +23 -5
- package/src/modules/library/components/PageActions.tsx +34 -11
- package/src/modules/library/components/PersonalAddDialog.tsx +5 -5
- package/src/modules/library/components/{PersonalGroupPage.tsx → PersonalPluginPage.tsx} +29 -19
- package/src/modules/library/components/PluginExtras.tsx +195 -0
- package/src/modules/library/components/{GroupIndexRow.tsx → PluginIndexRow.tsx} +6 -6
- package/src/modules/library/components/PluginJoinRequests.tsx +77 -0
- package/src/modules/library/components/{GroupPage.tsx → PluginPage.tsx} +112 -72
- package/src/modules/library/components/{GroupsIndexPage.tsx → PluginsIndexPage.tsx} +91 -48
- package/src/modules/library/components/{GroupsSidebar.tsx → PluginsSidebar.tsx} +105 -55
- package/src/modules/library/components/{GroupsSidebarMenu.tsx → PluginsSidebarMenu.tsx} +15 -15
- package/src/modules/library/components/{group-page-parts.tsx → plugin-page-parts.tsx} +218 -27
- package/src/modules/library/components/skill-page/SkillPage.tsx +12 -12
- package/src/modules/library/components/tool-page/McpServerSection.tsx +380 -0
- package/src/modules/library/components/tool-page/ToolPage.tsx +22 -5
- package/src/modules/library/hooks/useJoinRequests.ts +8 -8
- package/src/modules/library/routes/LibraryRoutes.tsx +32 -19
- package/src/modules/library/routes/WorkspaceItemRoute.tsx +24 -24
- package/src/modules/library/routes/library-paths.ts +36 -36
- package/src/modules/library/services/library.api.ts +9 -9
- package/src/modules/library/services/{groups.api.ts → plugins.api.ts} +43 -43
- package/src/modules/library/services/tools.api.ts +54 -0
- package/src/modules/library/state/library-data.tsx +67 -46
- package/src/modules/library/utils/names.ts +1 -1
- package/src/modules/library/utils/{personal-group.ts → personal-plugin.ts} +8 -8
- package/src/modules/library/utils/{group-summary.ts → plugin-summary.ts} +14 -14
- package/src/modules/library/utils/status.ts +17 -17
- package/src/modules/onboarding/__tests__/creator-welcome.test.tsx +318 -0
- package/src/modules/onboarding/__tests__/onboarding.test.tsx +86 -8
- package/src/modules/onboarding/agent-clients.ts +18 -14
- package/src/modules/onboarding/components/CreatorWelcomePage.tsx +143 -0
- package/src/modules/onboarding/components/WelcomePage.tsx +30 -22
- package/src/modules/onboarding/components/WelcomeRoute.tsx +57 -0
- package/src/modules/onboarding/welcome-state.ts +36 -0
- package/src/modules/review/components/MarkdownDiffViewer.tsx +1 -1
- package/src/modules/review/components/ReviewPanel.tsx +11 -11
- package/src/modules/review/components/__tests__/{isGroupItemPath.test.ts → isPluginItemPath.test.ts} +24 -24
- package/src/modules/secrets-vault/components/ToolSecretsPanel.tsx +3 -3
- package/src/modules/secrets-vault/components/__tests__/SecretsPage.test.tsx +1 -1
- package/src/modules/settings/components/SettingsLayout.tsx +1 -1
- package/src/modules/settings/components/SettingsNav.tsx +5 -5
- package/src/modules/setup/__tests__/setup.test.tsx +203 -0
- package/src/modules/setup/components/SetupScreen.tsx +235 -68
- package/src/modules/toolbar/components/ExternalAgentAccessPage.tsx +29 -107
- package/src/modules/toolbar/components/__tests__/AppSwitcher.test.tsx +1 -1
- package/src/modules/toolbar/components/__tests__/ExternalAgentAccessPage.test.tsx +228 -0
- package/src/modules/toolbar/components/__tests__/Toolbar.test.tsx +3 -3
- package/src/modules/workspace/components/FileExplorer.tsx +12 -12
- package/src/modules/workspace/components/FileRoute.tsx +8 -1
- package/src/modules/workspace/components/FileViewer.tsx +95 -38
- package/src/modules/workspace/components/__tests__/FileExplorer.test.tsx +14 -14
- package/src/modules/workspace/components/__tests__/FileRoute.test.tsx +20 -0
- package/src/modules/workspace/components/__tests__/FileViewer.test.tsx +227 -18
- package/src/modules/workspace/components/renderers/ToolRenderer.tsx +7 -2
- package/src/modules/workspace/routing/__tests__/kb-routes.test.tsx +25 -0
- package/src/modules/workspace/routing/kb-routes.ts +23 -1
- package/src/modules/workspace/utils/__tests__/diff.test.ts +1 -1
- package/src/modules/workspace/utils/fileTree.ts +54 -3
- package/src/shared/components/Surface.tsx +15 -0
- package/src/shared/mcp/ClaudeInstallLink.tsx +88 -0
- package/src/shared/mcp/ConnectionInstructions.tsx +51 -0
- package/src/shared/mcp/CopyBlock.tsx +42 -0
- package/src/shared/mcp/__tests__/ClaudeInstallLink.test.tsx +40 -0
- package/src/shared/mcp/__tests__/connect-snippets.test.ts +431 -0
- package/src/shared/mcp/__tests__/useCopyFeedback.test.ts +112 -0
- package/src/shared/mcp/connect-snippets.ts +353 -0
- package/src/shared/mcp/index.ts +28 -0
- package/src/shared/mcp/useCopyFeedback.ts +46 -0
- package/src/test-setup.ts +11 -0
- package/src/modules/library/__tests__/GroupsIndexPage.test.tsx +0 -283
- package/src/modules/library/__tests__/GroupsSidebar.test.tsx +0 -142
- package/src/modules/library/components/GroupJoinRequests.tsx +0 -56
package/src/modules/library/__tests__/{GroupJoinRequests.test.tsx → PluginJoinRequests.test.tsx}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
2
2
|
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
|
|
3
3
|
import { DEFAULT_BRANCH } from '@bevel-software/platform-shared';
|
|
4
|
-
import type { JoinRequest } from '../services/
|
|
4
|
+
import type { JoinRequest } from '../services/plugins.api';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The manager-side join-request surface.
|
|
@@ -11,13 +11,13 @@ import type { JoinRequest } from '../services/groups.api';
|
|
|
11
11
|
* branch untouched. The request then settles itself server-side, which this
|
|
12
12
|
* surface only has to ask about.
|
|
13
13
|
*/
|
|
14
|
-
const
|
|
14
|
+
const pluginsMock = vi.hoisted(() => ({
|
|
15
15
|
listJoinRequests: vi.fn(),
|
|
16
16
|
reconcileJoinRequest: vi.fn(),
|
|
17
17
|
}));
|
|
18
|
-
vi.mock('../services/
|
|
19
|
-
listJoinRequests:
|
|
20
|
-
reconcileJoinRequest:
|
|
18
|
+
vi.mock('../services/plugins.api', () => ({
|
|
19
|
+
listJoinRequests: pluginsMock.listJoinRequests,
|
|
20
|
+
reconcileJoinRequest: pluginsMock.reconcileJoinRequest,
|
|
21
21
|
}));
|
|
22
22
|
|
|
23
23
|
const accessMock = vi.hoisted(() => ({ grantAccess: vi.fn() }));
|
|
@@ -29,7 +29,7 @@ vi.mock('../../pr/services/pr-cancel.api', () => ({
|
|
|
29
29
|
}));
|
|
30
30
|
|
|
31
31
|
import { LibraryToastProvider } from '../state/toast';
|
|
32
|
-
import {
|
|
32
|
+
import { PluginJoinRequests } from '../components/PluginJoinRequests';
|
|
33
33
|
|
|
34
34
|
const request = (over: Partial<JoinRequest> = {}): JoinRequest => ({
|
|
35
35
|
number: 7,
|
|
@@ -50,32 +50,32 @@ const request = (over: Partial<JoinRequest> = {}): JoinRequest => ({
|
|
|
50
50
|
function renderBanner(onManage = vi.fn()) {
|
|
51
51
|
render(
|
|
52
52
|
<LibraryToastProvider>
|
|
53
|
-
<
|
|
53
|
+
<PluginJoinRequests plugin="GTM" folders={['Plugins/GTM']} onManage={onManage} />
|
|
54
54
|
</LibraryToastProvider>,
|
|
55
55
|
);
|
|
56
56
|
return { onManage };
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
describe('
|
|
59
|
+
describe('PluginJoinRequests', () => {
|
|
60
60
|
beforeEach(() => {
|
|
61
61
|
vi.clearAllMocks();
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
pluginsMock.listJoinRequests.mockResolvedValue([request()]);
|
|
63
|
+
pluginsMock.reconcileJoinRequest.mockResolvedValue(true);
|
|
64
64
|
accessMock.grantAccess.mockResolvedValue({});
|
|
65
65
|
prMock.cancelPullRequest.mockResolvedValue({});
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
it('names the requester and the exact grant being proposed', async () => {
|
|
69
69
|
renderBanner();
|
|
70
|
-
expect(await screen.findByText(/Ali Baba asked to
|
|
70
|
+
expect(await screen.findByText(/Ali Baba asked for access to GTM/)).toBeInTheDocument();
|
|
71
71
|
expect(
|
|
72
72
|
screen.getByRole('button', { name: 'Grant read to Ali Baba' }),
|
|
73
73
|
).toBeInTheDocument();
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
it('states the VERB when a request asks for more than read', async () => {
|
|
77
|
-
// "asked to
|
|
78
|
-
|
|
77
|
+
// "asked for access to" must never hide a write/owner request.
|
|
78
|
+
pluginsMock.listJoinRequests.mockResolvedValue([
|
|
79
79
|
request({
|
|
80
80
|
proposals: [
|
|
81
81
|
{
|
|
@@ -99,18 +99,18 @@ describe('GroupJoinRequests', () => {
|
|
|
99
99
|
await waitFor(() => expect(accessMock.grantAccess).toHaveBeenCalledTimes(1));
|
|
100
100
|
// The grant lands on the DEFAULT branch — that is where "the list" lives.
|
|
101
101
|
expect(accessMock.grantAccess).toHaveBeenCalledWith(encodeURIComponent(DEFAULT_BRANCH), {
|
|
102
|
-
path: '
|
|
102
|
+
path: 'Plugins/GTM',
|
|
103
103
|
kind: 'folder',
|
|
104
104
|
verb: 'read',
|
|
105
105
|
principal: { kind: 'user', email: 'ali@bevel.software', displayName: 'Ali Baba' },
|
|
106
106
|
});
|
|
107
107
|
// Then it asks the server to settle the request now rather than waiting
|
|
108
108
|
// for the next listing.
|
|
109
|
-
await waitFor(() => expect(
|
|
109
|
+
await waitFor(() => expect(pluginsMock.reconcileJoinRequest).toHaveBeenCalledWith('GTM', 7));
|
|
110
110
|
});
|
|
111
111
|
|
|
112
112
|
it('offers each proposal separately, so one request can be answered in parts', async () => {
|
|
113
|
-
|
|
113
|
+
pluginsMock.listJoinRequests.mockResolvedValue([
|
|
114
114
|
request({
|
|
115
115
|
proposals: [
|
|
116
116
|
...request().proposals,
|
|
@@ -142,7 +142,7 @@ describe('GroupJoinRequests', () => {
|
|
|
142
142
|
expect(
|
|
143
143
|
await screen.findByRole('button', { name: 'Grant read to Ali Baba' }),
|
|
144
144
|
).toBeInTheDocument();
|
|
145
|
-
expect(
|
|
145
|
+
expect(pluginsMock.reconcileJoinRequest).not.toHaveBeenCalled();
|
|
146
146
|
});
|
|
147
147
|
|
|
148
148
|
it('declining rejects the change request', async () => {
|
|
@@ -155,24 +155,24 @@ describe('GroupJoinRequests', () => {
|
|
|
155
155
|
});
|
|
156
156
|
|
|
157
157
|
it('renders nothing when there is nothing pending', async () => {
|
|
158
|
-
|
|
158
|
+
pluginsMock.listJoinRequests.mockResolvedValue([]);
|
|
159
159
|
const { container } = render(
|
|
160
160
|
<LibraryToastProvider>
|
|
161
|
-
<
|
|
161
|
+
<PluginJoinRequests plugin="GTM" folders={['Plugins/GTM']} onManage={vi.fn()} />
|
|
162
162
|
</LibraryToastProvider>,
|
|
163
163
|
);
|
|
164
|
-
await waitFor(() => expect(
|
|
165
|
-
expect(container.textContent).not.toContain('asked to
|
|
164
|
+
await waitFor(() => expect(pluginsMock.listJoinRequests).toHaveBeenCalled());
|
|
165
|
+
expect(container.textContent).not.toContain('asked for access to');
|
|
166
166
|
});
|
|
167
167
|
|
|
168
168
|
it('stays silent when the listing fails. A manager surface must not break the page', async () => {
|
|
169
|
-
|
|
169
|
+
pluginsMock.listJoinRequests.mockRejectedValue(new Error('boom'));
|
|
170
170
|
const { container } = render(
|
|
171
171
|
<LibraryToastProvider>
|
|
172
|
-
<
|
|
172
|
+
<PluginJoinRequests plugin="GTM" folders={['Plugins/GTM']} onManage={vi.fn()} />
|
|
173
173
|
</LibraryToastProvider>,
|
|
174
174
|
);
|
|
175
|
-
await waitFor(() => expect(
|
|
175
|
+
await waitFor(() => expect(pluginsMock.listJoinRequests).toHaveBeenCalled());
|
|
176
176
|
expect(container.querySelector('[role="alert"]')).toBeNull();
|
|
177
177
|
});
|
|
178
178
|
});
|