@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.
Files changed (132) hide show
  1. package/LICENSE +202 -202
  2. package/THIRD-PARTY-NOTICES.md +344 -988
  3. package/package.json +5 -5
  4. package/src/core/CoreAppShell.tsx +4 -4
  5. package/src/core/__tests__/ShellRoutes.test.tsx +1 -1
  6. package/src/core/__tests__/bootstrap.test.ts +47 -2
  7. package/src/core/bootstrap.ts +20 -0
  8. package/src/core/registry.ts +16 -4
  9. package/src/css-side-effect-imports.d.ts +7 -7
  10. package/src/modules/access/__tests__/ManageAccessDialog.placement.test.tsx +1 -1
  11. package/src/modules/access/__tests__/ManageAccessDialog.test.tsx +5 -5
  12. package/src/modules/access/api.ts +5 -5
  13. package/src/modules/access/components/ManageAccessDialog.tsx +21 -20
  14. package/src/modules/admin/__tests__/AdminRolesPage.suggest.test.tsx +1 -1
  15. package/src/modules/admin/components/AdminRolesPage.tsx +1 -1
  16. package/src/modules/admin/state/admin.context.tsx +15 -0
  17. package/src/modules/change-requests/__tests__/useFileOnBranch.test.tsx +2 -2
  18. package/src/modules/change-requests/components/ChangeRequestDialog.tsx +1 -1
  19. package/src/modules/change-requests/hooks/useApplyChangeRequest.ts +1 -1
  20. package/src/modules/layout/__tests__/SidebarFrameResponsive.test.tsx +4 -4
  21. package/src/modules/layout/__tests__/SidebarToggle.test.tsx +4 -4
  22. package/src/modules/layout/__tests__/breakpoints.test.ts +1 -1
  23. package/src/modules/layout/components/SidebarFrame.tsx +2 -2
  24. package/src/modules/library/__tests__/{AddToGroupDialog.test.tsx → AddToPluginDialog.test.tsx} +34 -34
  25. package/src/modules/library/__tests__/LibraryCard.test.tsx +30 -11
  26. package/src/modules/library/__tests__/LibraryRoutes.test.tsx +84 -59
  27. package/src/modules/library/__tests__/LibrarySidebarMenu.test.tsx +51 -51
  28. package/src/modules/library/__tests__/{LockedGroupView.test.tsx → LockedPluginView.test.tsx} +33 -33
  29. package/src/modules/library/__tests__/McpServerSection.test.tsx +138 -0
  30. package/src/modules/library/__tests__/{NewGroupDialog.test.tsx → NewPluginDialog.test.tsx} +22 -22
  31. package/src/modules/library/__tests__/PersonalAddDialog.test.tsx +7 -7
  32. package/src/modules/library/__tests__/PluginExtras.test.tsx +131 -0
  33. package/src/modules/library/__tests__/{GroupJoinRequests.test.tsx → PluginJoinRequests.test.tsx} +24 -24
  34. package/src/modules/library/__tests__/{GroupPage.test.tsx → PluginPage.test.tsx} +197 -106
  35. package/src/modules/library/__tests__/PluginsIndexPage.test.tsx +363 -0
  36. package/src/modules/library/__tests__/{GroupsSidebar.contextmenu.test.tsx → PluginsSidebar.contextmenu.test.tsx} +32 -31
  37. package/src/modules/library/__tests__/{GroupsSidebar.locked.test.tsx → PluginsSidebar.locked.test.tsx} +29 -28
  38. package/src/modules/library/__tests__/PluginsSidebar.test.tsx +171 -0
  39. package/src/modules/library/__tests__/{GroupsSidebarMenu.test.tsx → PluginsSidebarMenu.test.tsx} +18 -18
  40. package/src/modules/library/__tests__/SkillPage.test.tsx +8 -8
  41. package/src/modules/library/__tests__/ToolConnectionSection.test.tsx +2 -2
  42. package/src/modules/library/__tests__/ToolPage.test.tsx +41 -12
  43. package/src/modules/library/__tests__/ToolSharePanel.test.tsx +1 -1
  44. package/src/modules/library/__tests__/WorkspaceItemRoute.test.tsx +57 -57
  45. package/src/modules/library/__tests__/auth-harness.tsx +4 -4
  46. package/src/modules/library/__tests__/library-data.test.ts +82 -0
  47. package/src/modules/library/__tests__/status.test.ts +19 -19
  48. package/src/modules/library/__tests__/tools.api.test.ts +70 -0
  49. package/src/modules/library/__tests__/useToolPage.test.tsx +4 -4
  50. package/src/modules/library/components/AccessRequestsBanner.tsx +8 -8
  51. package/src/modules/library/components/{AddToGroupDialog.tsx → AddToPluginDialog.tsx} +11 -11
  52. package/src/modules/library/components/ChangeRequestDock.tsx +1 -1
  53. package/src/modules/library/components/{DeleteGroupDialog.tsx → DeletePluginDialog.tsx} +9 -9
  54. package/src/modules/library/components/LibraryCard.tsx +26 -2
  55. package/src/modules/library/components/LibraryLayout.tsx +80 -71
  56. package/src/modules/library/components/LibraryPage.tsx +8 -8
  57. package/src/modules/library/components/LockGlyph.tsx +1 -1
  58. package/src/modules/library/components/{LockedGroupView.tsx → LockedPluginView.tsx} +35 -35
  59. package/src/modules/library/components/{ManagedGroupRequests.tsx → ManagedPluginRequests.tsx} +13 -13
  60. package/src/modules/library/components/{NewGroupDialog.tsx → NewPluginDialog.tsx} +24 -24
  61. package/src/modules/library/components/NewSkillPanel.tsx +23 -5
  62. package/src/modules/library/components/PageActions.tsx +34 -11
  63. package/src/modules/library/components/PersonalAddDialog.tsx +5 -5
  64. package/src/modules/library/components/{PersonalGroupPage.tsx → PersonalPluginPage.tsx} +29 -19
  65. package/src/modules/library/components/PluginExtras.tsx +195 -0
  66. package/src/modules/library/components/{GroupIndexRow.tsx → PluginIndexRow.tsx} +6 -6
  67. package/src/modules/library/components/PluginJoinRequests.tsx +77 -0
  68. package/src/modules/library/components/{GroupPage.tsx → PluginPage.tsx} +112 -72
  69. package/src/modules/library/components/{GroupsIndexPage.tsx → PluginsIndexPage.tsx} +91 -48
  70. package/src/modules/library/components/{GroupsSidebar.tsx → PluginsSidebar.tsx} +105 -55
  71. package/src/modules/library/components/{GroupsSidebarMenu.tsx → PluginsSidebarMenu.tsx} +15 -15
  72. package/src/modules/library/components/{group-page-parts.tsx → plugin-page-parts.tsx} +218 -27
  73. package/src/modules/library/components/skill-page/SkillPage.tsx +12 -12
  74. package/src/modules/library/components/tool-page/McpServerSection.tsx +380 -0
  75. package/src/modules/library/components/tool-page/ToolPage.tsx +22 -5
  76. package/src/modules/library/hooks/useJoinRequests.ts +8 -8
  77. package/src/modules/library/routes/LibraryRoutes.tsx +32 -19
  78. package/src/modules/library/routes/WorkspaceItemRoute.tsx +24 -24
  79. package/src/modules/library/routes/library-paths.ts +36 -36
  80. package/src/modules/library/services/library.api.ts +9 -9
  81. package/src/modules/library/services/{groups.api.ts → plugins.api.ts} +43 -43
  82. package/src/modules/library/services/tools.api.ts +54 -0
  83. package/src/modules/library/state/library-data.tsx +67 -46
  84. package/src/modules/library/utils/names.ts +1 -1
  85. package/src/modules/library/utils/{personal-group.ts → personal-plugin.ts} +8 -8
  86. package/src/modules/library/utils/{group-summary.ts → plugin-summary.ts} +14 -14
  87. package/src/modules/library/utils/status.ts +17 -17
  88. package/src/modules/onboarding/__tests__/creator-welcome.test.tsx +318 -0
  89. package/src/modules/onboarding/__tests__/onboarding.test.tsx +86 -8
  90. package/src/modules/onboarding/agent-clients.ts +18 -14
  91. package/src/modules/onboarding/components/CreatorWelcomePage.tsx +143 -0
  92. package/src/modules/onboarding/components/WelcomePage.tsx +30 -22
  93. package/src/modules/onboarding/components/WelcomeRoute.tsx +57 -0
  94. package/src/modules/onboarding/welcome-state.ts +36 -0
  95. package/src/modules/review/components/MarkdownDiffViewer.tsx +1 -1
  96. package/src/modules/review/components/ReviewPanel.tsx +11 -11
  97. package/src/modules/review/components/__tests__/{isGroupItemPath.test.ts → isPluginItemPath.test.ts} +24 -24
  98. package/src/modules/secrets-vault/components/ToolSecretsPanel.tsx +3 -3
  99. package/src/modules/secrets-vault/components/__tests__/SecretsPage.test.tsx +1 -1
  100. package/src/modules/settings/components/SettingsLayout.tsx +1 -1
  101. package/src/modules/settings/components/SettingsNav.tsx +5 -5
  102. package/src/modules/setup/__tests__/setup.test.tsx +203 -0
  103. package/src/modules/setup/components/SetupScreen.tsx +235 -68
  104. package/src/modules/toolbar/components/ExternalAgentAccessPage.tsx +29 -107
  105. package/src/modules/toolbar/components/__tests__/AppSwitcher.test.tsx +1 -1
  106. package/src/modules/toolbar/components/__tests__/ExternalAgentAccessPage.test.tsx +228 -0
  107. package/src/modules/toolbar/components/__tests__/Toolbar.test.tsx +3 -3
  108. package/src/modules/workspace/components/FileExplorer.tsx +12 -12
  109. package/src/modules/workspace/components/FileRoute.tsx +8 -1
  110. package/src/modules/workspace/components/FileViewer.tsx +95 -38
  111. package/src/modules/workspace/components/__tests__/FileExplorer.test.tsx +14 -14
  112. package/src/modules/workspace/components/__tests__/FileRoute.test.tsx +20 -0
  113. package/src/modules/workspace/components/__tests__/FileViewer.test.tsx +227 -18
  114. package/src/modules/workspace/components/renderers/ToolRenderer.tsx +7 -2
  115. package/src/modules/workspace/routing/__tests__/kb-routes.test.tsx +25 -0
  116. package/src/modules/workspace/routing/kb-routes.ts +23 -1
  117. package/src/modules/workspace/utils/__tests__/diff.test.ts +1 -1
  118. package/src/modules/workspace/utils/fileTree.ts +54 -3
  119. package/src/shared/components/Surface.tsx +15 -0
  120. package/src/shared/mcp/ClaudeInstallLink.tsx +88 -0
  121. package/src/shared/mcp/ConnectionInstructions.tsx +51 -0
  122. package/src/shared/mcp/CopyBlock.tsx +42 -0
  123. package/src/shared/mcp/__tests__/ClaudeInstallLink.test.tsx +40 -0
  124. package/src/shared/mcp/__tests__/connect-snippets.test.ts +431 -0
  125. package/src/shared/mcp/__tests__/useCopyFeedback.test.ts +112 -0
  126. package/src/shared/mcp/connect-snippets.ts +353 -0
  127. package/src/shared/mcp/index.ts +28 -0
  128. package/src/shared/mcp/useCopyFeedback.ts +46 -0
  129. package/src/test-setup.ts +11 -0
  130. package/src/modules/library/__tests__/GroupsIndexPage.test.tsx +0 -283
  131. package/src/modules/library/__tests__/GroupsSidebar.test.tsx +0 -142
  132. package/src/modules/library/components/GroupJoinRequests.tsx +0 -56
@@ -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/groups.api';
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 groupsMock = vi.hoisted(() => ({
14
+ const pluginsMock = vi.hoisted(() => ({
15
15
  listJoinRequests: vi.fn(),
16
16
  reconcileJoinRequest: vi.fn(),
17
17
  }));
18
- vi.mock('../services/groups.api', () => ({
19
- listJoinRequests: groupsMock.listJoinRequests,
20
- reconcileJoinRequest: groupsMock.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 { GroupJoinRequests } from '../components/GroupJoinRequests';
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
- <GroupJoinRequests group="GTM" folders={['Groups/GTM']} onManage={onManage} />
53
+ <PluginJoinRequests plugin="GTM" folders={['Plugins/GTM']} onManage={onManage} />
54
54
  </LibraryToastProvider>,
55
55
  );
56
56
  return { onManage };
57
57
  }
58
58
 
59
- describe('GroupJoinRequests', () => {
59
+ describe('PluginJoinRequests', () => {
60
60
  beforeEach(() => {
61
61
  vi.clearAllMocks();
62
- groupsMock.listJoinRequests.mockResolvedValue([request()]);
63
- groupsMock.reconcileJoinRequest.mockResolvedValue(true);
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 join GTM/)).toBeInTheDocument();
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 join" must never hide a write/owner request.
78
- groupsMock.listJoinRequests.mockResolvedValue([
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: 'Groups/GTM',
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(groupsMock.reconcileJoinRequest).toHaveBeenCalledWith('GTM', 7));
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
- groupsMock.listJoinRequests.mockResolvedValue([
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(groupsMock.reconcileJoinRequest).not.toHaveBeenCalled();
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
- groupsMock.listJoinRequests.mockResolvedValue([]);
158
+ pluginsMock.listJoinRequests.mockResolvedValue([]);
159
159
  const { container } = render(
160
160
  <LibraryToastProvider>
161
- <GroupJoinRequests group="GTM" folders={['Groups/GTM']} onManage={vi.fn()} />
161
+ <PluginJoinRequests plugin="GTM" folders={['Plugins/GTM']} onManage={vi.fn()} />
162
162
  </LibraryToastProvider>,
163
163
  );
164
- await waitFor(() => expect(groupsMock.listJoinRequests).toHaveBeenCalled());
165
- expect(container.textContent).not.toContain('asked to join');
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
- groupsMock.listJoinRequests.mockRejectedValue(new Error('boom'));
169
+ pluginsMock.listJoinRequests.mockRejectedValue(new Error('boom'));
170
170
  const { container } = render(
171
171
  <LibraryToastProvider>
172
- <GroupJoinRequests group="GTM" folders={['Groups/GTM']} onManage={vi.fn()} />
172
+ <PluginJoinRequests plugin="GTM" folders={['Plugins/GTM']} onManage={vi.fn()} />
173
173
  </LibraryToastProvider>,
174
174
  );
175
- await waitFor(() => expect(groupsMock.listJoinRequests).toHaveBeenCalled());
175
+ await waitFor(() => expect(pluginsMock.listJoinRequests).toHaveBeenCalled());
176
176
  expect(container.querySelector('[role="alert"]')).toBeNull();
177
177
  });
178
178
  });