@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
@@ -10,7 +10,7 @@ import {
10
10
  import { AdminContext } from '../../admin/state/admin.context';
11
11
  import type { LibraryData } from '../hooks/useLibraryData';
12
12
  import type { ToolSecrets } from '../../secrets-vault/services/tool-secrets.api';
13
- import type { GroupSummary } from '../services/groups.api';
13
+ import type { PluginSummary } from '../services/plugins.api';
14
14
  import type { ToolPageState } from '../hooks/useToolPage';
15
15
 
16
16
  /**
@@ -24,22 +24,22 @@ import type { ToolPageState } from '../hooks/useToolPage';
24
24
  const dataMock = vi.hoisted(() => ({ useLibraryData: vi.fn() }));
25
25
  vi.mock('../hooks/useLibraryData', () => ({ useLibraryData: dataMock.useLibraryData }));
26
26
 
27
- const groupsMock = vi.hoisted(() => ({
28
- listGroups: vi.fn(),
27
+ const pluginsMock = vi.hoisted(() => ({
28
+ listPlugins: vi.fn(),
29
29
  listJoinRequests: vi.fn(),
30
30
  }));
31
- vi.mock('../services/groups.api', () => ({
32
- listGroups: groupsMock.listGroups,
33
- listJoinRequests: groupsMock.listJoinRequests,
31
+ vi.mock('../services/plugins.api', () => ({
32
+ listPlugins: pluginsMock.listPlugins,
33
+ listJoinRequests: pluginsMock.listJoinRequests,
34
34
  reconcileJoinRequest: vi.fn(),
35
- requestGroupAccess: vi.fn(),
35
+ requestPluginAccess: vi.fn(),
36
36
  AlreadyReadableError: class AlreadyReadableError extends Error {},
37
37
  }));
38
38
 
39
39
  const toolPageMock = vi.hoisted(() => ({ useToolPage: vi.fn() }));
40
40
  vi.mock('../hooks/useToolPage', () => ({ useToolPage: toolPageMock.useToolPage }));
41
41
 
42
- // ManageAccessDialog (reachable from the group page's Share) fetches through
42
+ // ManageAccessDialog (reachable from the plugin page's Share) fetches through
43
43
  // this module. Nothing opens it in a routing test, but the stub keeps any
44
44
  // accidental mount from waiting on a refused connection.
45
45
  vi.mock('../../access/api', async (importOriginal) => {
@@ -67,7 +67,7 @@ import { withAuth, TEST_PERSONAL_GROUP } from './auth-harness';
67
67
  const tool = (over: Partial<ToolSecrets>): ToolSecrets => ({
68
68
  slug: 'heyreach',
69
69
  name: 'heyreach',
70
- path: 'Groups/GTM/heyreach.tool',
70
+ path: 'Plugins/GTM/heyreach.tool',
71
71
  type: 'inline',
72
72
  setup: null,
73
73
  canWrite: false,
@@ -79,9 +79,9 @@ const CATALOG: LibraryData = {
79
79
  loading: false,
80
80
  error: null,
81
81
  skills: [
82
- { name: 'outreach', description: 'Runs the GTM outreach.', path: 'Groups/GTM/outreach' },
83
- { name: 'roadmap', description: 'Keeps the roadmap.', path: 'Groups/Product/roadmap' },
84
- { name: 'scratch', description: 'A skill in no group.', path: 'Skills/scratch' },
82
+ { name: 'outreach', description: 'Runs the GTM outreach.', path: 'Plugins/GTM/outreach' },
83
+ { name: 'roadmap', description: 'Keeps the roadmap.', path: 'Plugins/Product/roadmap' },
84
+ { name: 'scratch', description: 'A skill in no plugin.', path: 'Skills/scratch' },
85
85
  ],
86
86
  pendingSkills: [],
87
87
  tools: [
@@ -96,10 +96,10 @@ const CATALOG: LibraryData = {
96
96
  reload: vi.fn(),
97
97
  };
98
98
 
99
- const GROUPS: GroupSummary[] = [
99
+ const PLUGINS: PluginSummary[] = [
100
100
  {
101
101
  name: 'GTM',
102
- folders: ['Groups/GTM'],
102
+ folders: ['Plugins/GTM'],
103
103
  canRead: true,
104
104
  canWrite: true,
105
105
  isOwner: false,
@@ -135,7 +135,7 @@ function LocationProbe() {
135
135
  /**
136
136
  * The shell's providers, which the Library sits inside for real
137
137
  * (`CoreAppShell` mounts both above every app surface). The tool page reads
138
- * `isAdmin` and `kbDirName` from them; the locked-group and request surfaces
138
+ * `isAdmin` and `kbDirName` from them; the locked-plugin and request surfaces
139
139
  * read `kbDirName` to address `access.md`.
140
140
  */
141
141
  function wrap(children: ReactNode) {
@@ -181,17 +181,17 @@ const pathname = () => screen.getByLabelText('pathname').textContent;
181
181
  describe('LibraryRoutes', () => {
182
182
  beforeEach(() => {
183
183
  dataMock.useLibraryData.mockReturnValue(CATALOG);
184
- groupsMock.listGroups.mockResolvedValue(GROUPS);
184
+ pluginsMock.listPlugins.mockResolvedValue(PLUGINS);
185
185
  toolPageMock.useToolPage.mockReturnValue(TOOL_PAGE_STATE);
186
- groupsMock.listJoinRequests.mockResolvedValue([]);
186
+ pluginsMock.listJoinRequests.mockResolvedValue([]);
187
187
  });
188
188
 
189
- it('opens on the all-groups index at /skills-and-tools', async () => {
189
+ it('opens on the all-plugins index at /skills-and-tools', async () => {
190
190
  renderAt('/skills-and-tools');
191
191
  expect(
192
- await screen.findByRole('heading', { name: 'All groups', level: 1 }),
192
+ await screen.findByRole('heading', { name: 'All plugins', level: 1 }),
193
193
  ).toBeInTheDocument();
194
- expect(screen.getByRole('button', { name: /^All groups/ })).toHaveAttribute(
194
+ expect(screen.getByRole('button', { name: /^All plugins/ })).toHaveAttribute(
195
195
  'aria-current',
196
196
  'true',
197
197
  );
@@ -222,7 +222,7 @@ describe('LibraryRoutes', () => {
222
222
  expect(screen.getByRole('button', { name: /^Owned by me/ })).toHaveAttribute('aria-current', 'true');
223
223
  });
224
224
 
225
- it("/skills-and-tools/yours is the caller's own group, as a group page", async () => {
225
+ it("/skills-and-tools/yours is the caller's own plugin, as a plugin page", async () => {
226
226
  renderAt('/skills-and-tools/yours');
227
227
  expect(
228
228
  await screen.findByRole('heading', { name: TEST_PERSONAL_GROUP, level: 1 }),
@@ -231,21 +231,21 @@ describe('LibraryRoutes', () => {
231
231
  'aria-current',
232
232
  'true',
233
233
  );
234
- // The group-page furniture, not a filtered gallery: sections and a trail.
234
+ // The plugin-page furniture, not a filtered gallery: sections and a trail.
235
235
  expect(screen.getByRole('heading', { name: 'Skills', level: 2 })).toBeInTheDocument();
236
236
  expect(screen.getByRole('heading', { name: 'Tools', level: 2 })).toBeInTheDocument();
237
237
  expect(screen.getByRole('navigation', { name: 'Breadcrumb' })).toBeInTheDocument();
238
238
  });
239
239
 
240
- it('a group you are in appears in the nav even when it is EMPTY', async () => {
241
- // Membership is what puts a group in your MCP; content is not. Deriving
242
- // the member rows from catalog items alone made a freshly created group
240
+ it('a plugin you are in appears in the nav even when it is EMPTY', async () => {
241
+ // Membership is what puts a plugin in your MCP; content is not. Deriving
242
+ // the member rows from catalog items alone made a freshly created plugin
243
243
  // vanish from the very list headed "Included in your MCP".
244
- groupsMock.listGroups.mockResolvedValue([
245
- ...GROUPS,
244
+ pluginsMock.listPlugins.mockResolvedValue([
245
+ ...PLUGINS,
246
246
  {
247
247
  name: 'Fresh',
248
- folders: ['Groups/Fresh'],
248
+ folders: ['Plugins/Fresh'],
249
249
  canRead: true,
250
250
  canWrite: true,
251
251
  skillCount: 0,
@@ -258,32 +258,32 @@ describe('LibraryRoutes', () => {
258
258
  },
259
259
  ]);
260
260
  renderAt('/skills-and-tools');
261
- const nav = await screen.findByRole('navigation', { name: 'Library groups' });
261
+ const nav = await screen.findByRole('navigation', { name: 'Library plugins' });
262
262
  // In the member half, with a zero count — never below the gap as locked.
263
263
  expect(await within(nav).findByRole('button', { name: /^Fresh/ })).toBeInTheDocument();
264
264
  expect(within(nav).queryByRole('button', { name: 'Fresh (locked)' })).toBeNull();
265
265
  });
266
266
 
267
- it('a sidebar group click navigates to /skills-and-tools/groups/<name>', async () => {
267
+ it('a sidebar plugin click navigates to /skills-and-tools/plugins/<name>', async () => {
268
268
  renderAt('/skills-and-tools');
269
269
  fireEvent.click(await screen.findByRole('button', { name: /^GTM/ }));
270
- await waitFor(() => expect(pathname()).toBe('/skills-and-tools/groups/GTM'));
271
- // The group page itself lands in a later work package; the ROUTE resolves
270
+ await waitFor(() => expect(pathname()).toBe('/skills-and-tools/plugins/GTM'));
271
+ // The plugin page itself lands in a later work package; the ROUTE resolves
272
272
  // now, which is why the sidebar can already point at it.
273
273
  expect(screen.getByRole('button', { name: /^GTM/ })).toHaveAttribute('aria-current', 'true');
274
- expect(screen.queryByRole('heading', { name: 'All groups', level: 1 })).not.toBeInTheDocument();
274
+ expect(screen.queryByRole('heading', { name: 'All plugins', level: 1 })).not.toBeInTheDocument();
275
275
  });
276
276
 
277
- it('sends the old /groups index path home, where the index lives now', async () => {
278
- renderAt('/skills-and-tools/groups');
277
+ it('sends the old /plugins index path home, where the index lives now', async () => {
278
+ renderAt('/skills-and-tools/plugins');
279
279
  await waitFor(() => expect(pathname()).toBe('/skills-and-tools'));
280
280
  expect(
281
- await screen.findByRole('heading', { name: 'All groups', level: 1 }),
281
+ await screen.findByRole('heading', { name: 'All plugins', level: 1 }),
282
282
  ).toBeInTheDocument();
283
283
  });
284
284
 
285
- it("a group deep link renders that group's cards and no others", async () => {
286
- renderAt('/skills-and-tools/groups/GTM');
285
+ it("a plugin deep link renders that plugin's cards and no others", async () => {
286
+ renderAt('/skills-and-tools/plugins/GTM');
287
287
  expect(await screen.findByRole('heading', { name: 'GTM', level: 1 })).toBeInTheDocument();
288
288
  expect(screen.getByTestId('library-card-skill-outreach')).toBeInTheDocument();
289
289
  expect(screen.getByTestId('library-card-integration-heyreach')).toBeInTheDocument();
@@ -293,50 +293,75 @@ describe('LibraryRoutes', () => {
293
293
  // `/propose` was retired with the role fork it served. An unknown path under
294
294
  // the Library falls back to the root, which is what this now asserts.
295
295
  it('sends the retired propose path back home', async () => {
296
- renderAt('/skills-and-tools/propose?group=GTM');
296
+ renderAt('/skills-and-tools/propose?plugin=GTM');
297
297
  await waitFor(() => expect(pathname()).toBe('/skills-and-tools'));
298
298
  });
299
299
 
300
- it("reaches the index from a group page breadcrumb, at the root it lives at", async () => {
301
- renderAt('/skills-and-tools/groups/GTM');
302
- fireEvent.click(await screen.findByRole('link', { name: 'All groups' }));
300
+ it("reaches the index from a plugin page breadcrumb, at the root it lives at", async () => {
301
+ renderAt('/skills-and-tools/plugins/GTM');
302
+ fireEvent.click(await screen.findByRole('link', { name: 'All plugins' }));
303
303
  await waitFor(() => expect(pathname()).toBe('/skills-and-tools'));
304
304
  expect(
305
- await screen.findByRole('heading', { name: 'All groups', level: 1 }),
305
+ await screen.findByRole('heading', { name: 'All plugins', level: 1 }),
306
306
  ).toBeInTheDocument();
307
307
  });
308
308
 
309
- it('leads the sidebar with All groups, from anywhere in the Library', async () => {
310
- renderAt('/skills-and-tools/groups/GTM');
311
- const allGroups = await screen.findByRole('button', { name: /^All groups/ });
312
- expect(allGroups).toHaveAttribute('aria-current', 'false');
313
- fireEvent.click(allGroups);
309
+ it('leads the sidebar with All plugins, from anywhere in the Library', async () => {
310
+ renderAt('/skills-and-tools/plugins/GTM');
311
+ const allPlugins = await screen.findByRole('button', { name: /^All plugins/ });
312
+ expect(allPlugins).toHaveAttribute('aria-current', 'false');
313
+ fireEvent.click(allPlugins);
314
314
  await waitFor(() => expect(pathname()).toBe('/skills-and-tools'));
315
- expect(screen.getByRole('button', { name: /^All groups/ })).toHaveAttribute(
315
+ expect(screen.getByRole('button', { name: /^All plugins/ })).toHaveAttribute(
316
316
  'aria-current',
317
317
  'true',
318
318
  );
319
319
  });
320
320
 
321
- it('a group deep link with a URL-hostile name round-trips', async () => {
321
+ it('a plugin deep link with a URL-hostile name round-trips', async () => {
322
322
  dataMock.useLibraryData.mockReturnValue({
323
323
  ...CATALOG,
324
- skills: [{ name: 'pricing', description: '', path: 'Groups/Sales & Ops/pricing' }],
324
+ skills: [{ name: 'pricing', description: '', path: 'Plugins/Sales & Ops/pricing' }],
325
325
  tools: [],
326
326
  });
327
- renderAt(`/skills-and-tools/groups/${encodeURIComponent('Sales & Ops')}`);
327
+ renderAt(`/skills-and-tools/plugins/${encodeURIComponent('Sales & Ops')}`);
328
328
  await waitFor(() =>
329
329
  expect(screen.getByRole('button', { name: /^Sales & Ops/ })).toHaveAttribute('aria-current', 'true'),
330
330
  );
331
331
  });
332
332
 
333
+ it('redirects a legacy /groups/:plugin deep link to the plugin page', async () => {
334
+ // The pre-rename URL shape. Links to it exist in the wild; without the
335
+ // alias the `*` fallback would send them home instead of to the plugin.
336
+ renderAt('/skills-and-tools/groups/GTM');
337
+ await waitFor(() => expect(pathname()).toBe('/skills-and-tools/plugins/GTM'));
338
+ expect(await screen.findByRole('heading', { name: 'GTM', level: 1 })).toBeInTheDocument();
339
+ });
340
+
341
+ it('redirects a legacy /groups link with a URL-hostile name, encoding intact', async () => {
342
+ dataMock.useLibraryData.mockReturnValue({
343
+ ...CATALOG,
344
+ skills: [{ name: 'pricing', description: '', path: 'Plugins/Sales & Ops/pricing' }],
345
+ tools: [],
346
+ });
347
+ renderAt(`/skills-and-tools/groups/${encodeURIComponent('Sales & Ops')}`);
348
+ await waitFor(() =>
349
+ expect(pathname()).toBe(`/skills-and-tools/plugins/${encodeURIComponent('Sales & Ops')}`),
350
+ );
351
+ });
352
+
353
+ it('sends the legacy /groups index home, like /plugins', async () => {
354
+ renderAt('/skills-and-tools/groups');
355
+ await waitFor(() => expect(pathname()).toBe('/skills-and-tools'));
356
+ });
357
+
333
358
  it('/skills-and-tools/tools/:slug redirects to the canonical workspace URL, hash intact', async () => {
334
359
  // The legacy address is the OAuth callback's landing target, so the
335
360
  // redirect must carry the `#…` outcome fragment to the canonical page.
336
361
  renderAt('/skills-and-tools/tools/heyreach#authorized');
337
362
  await waitFor(() =>
338
363
  expect(pathname()).toBe(
339
- `/workspace/${DEFAULT_BRANCH}/knowledge-base/Groups/GTM/heyreach.tool#authorized`,
364
+ `/workspace/${DEFAULT_BRANCH}/knowledge-base/Plugins/GTM/heyreach.tool#authorized`,
340
365
  ),
341
366
  );
342
367
  });
@@ -345,7 +370,7 @@ describe('LibraryRoutes', () => {
345
370
  renderAt('/skills-and-tools/skills/outreach');
346
371
  await waitFor(() =>
347
372
  expect(pathname()).toBe(
348
- `/workspace/${DEFAULT_BRANCH}/knowledge-base/Groups/GTM/outreach/SKILL.md`,
373
+ `/workspace/${DEFAULT_BRANCH}/knowledge-base/Plugins/GTM/outreach/SKILL.md`,
349
374
  ),
350
375
  );
351
376
  });
@@ -355,7 +380,7 @@ describe('LibraryRoutes', () => {
355
380
  fireEvent.click(await screen.findByRole('button', { name: /^heyreach/ }));
356
381
 
357
382
  await waitFor(() =>
358
- expect(pathname()).toBe(`/workspace/${DEFAULT_BRANCH}/knowledge-base/Groups/GTM/heyreach.tool`),
383
+ expect(pathname()).toBe(`/workspace/${DEFAULT_BRANCH}/knowledge-base/Plugins/GTM/heyreach.tool`),
359
384
  );
360
385
  expect(screen.queryByRole('dialog')).toBeNull();
361
386
  });
@@ -364,15 +389,15 @@ describe('LibraryRoutes', () => {
364
389
  renderAt('/skills-and-tools/nope');
365
390
  await waitFor(() => expect(pathname()).toBe('/skills-and-tools'));
366
391
  expect(
367
- await screen.findByRole('heading', { name: 'All groups', level: 1 }),
392
+ await screen.findByRole('heading', { name: 'All plugins', level: 1 }),
368
393
  ).toBeInTheDocument();
369
394
  });
370
395
 
371
- it('renders the gallery even when the groups endpoint fails', async () => {
372
- groupsMock.listGroups.mockRejectedValue(new Error("Couldn't load groups."));
396
+ it('renders the gallery even when the plugins endpoint fails', async () => {
397
+ pluginsMock.listPlugins.mockRejectedValue(new Error("Couldn't load plugins."));
373
398
  renderAt('/skills-and-tools/everything');
374
399
  expect(await screen.findByRole('heading', { name: 'Everything', level: 1 })).toBeInTheDocument();
375
- // Sidebar groups are catalog-derived, so they survive the endpoint being down.
400
+ // Sidebar plugins are catalog-derived, so they survive the endpoint being down.
376
401
  expect(screen.getByRole('button', { name: /^GTM/ })).toBeInTheDocument();
377
402
  });
378
403
  });
@@ -8,37 +8,37 @@ import {
8
8
  } from '../../workspace/state/workspace.context';
9
9
  import { AdminContext } from '../../admin/state/admin.context';
10
10
  import type { LibraryData } from '../hooks/useLibraryData';
11
- import type { GroupSummary } from '../services/groups.api';
11
+ import type { PluginSummary } from '../services/plugins.api';
12
12
 
13
13
  /**
14
14
  * The Library nav's right-click menu, wired up for real.
15
15
  *
16
- * `GroupsSidebar.contextmenu` proves the nav REPORTS the gesture and
17
- * `GroupsSidebarMenu` proves the panel behaves; neither can prove the thing
16
+ * `PluginsSidebar.contextmenu` proves the nav REPORTS the gesture and
17
+ * `PluginsSidebarMenu` proves the panel behaves; neither can prove the thing
18
18
  * that actually matters, which is that the layout hands each kind of row the
19
- * verbs that are true of it. That decision needs the group summaries and the
19
+ * verbs that are true of it. That decision needs the plugin summaries and the
20
20
  * workspace's KB dir, so it only exists once the whole surface is mounted —
21
21
  * hence this file.
22
22
  *
23
23
  * Same seams as `LibraryRoutes.test.tsx`: the catalog is mocked at its hook and
24
- * the group index at its API, because what is under test is the menu, not the
24
+ * the plugin index at its API, because what is under test is the menu, not the
25
25
  * fetching.
26
26
  */
27
27
 
28
28
  const dataMock = vi.hoisted(() => ({ useLibraryData: vi.fn() }));
29
29
  vi.mock('../hooks/useLibraryData', () => ({ useLibraryData: dataMock.useLibraryData }));
30
30
 
31
- const groupsMock = vi.hoisted(() => ({
32
- listGroups: vi.fn(),
31
+ const pluginsMock = vi.hoisted(() => ({
32
+ listPlugins: vi.fn(),
33
33
  listJoinRequests: vi.fn(),
34
- deleteGroup: vi.fn(),
34
+ deletePlugin: vi.fn(),
35
35
  }));
36
- vi.mock('../services/groups.api', () => ({
37
- listGroups: groupsMock.listGroups,
38
- listJoinRequests: groupsMock.listJoinRequests,
39
- deleteGroup: groupsMock.deleteGroup,
36
+ vi.mock('../services/plugins.api', () => ({
37
+ listPlugins: pluginsMock.listPlugins,
38
+ listJoinRequests: pluginsMock.listJoinRequests,
39
+ deletePlugin: pluginsMock.deletePlugin,
40
40
  reconcileJoinRequest: vi.fn(),
41
- requestGroupAccess: vi.fn(),
41
+ requestPluginAccess: vi.fn(),
42
42
  AlreadyReadableError: class AlreadyReadableError extends Error {},
43
43
  }));
44
44
 
@@ -70,8 +70,8 @@ const CATALOG: LibraryData = {
70
70
  loading: false,
71
71
  error: null,
72
72
  skills: [
73
- { name: 'outreach', description: 'Runs the GTM outreach.', path: 'Groups/GTM/outreach' },
74
- { name: 'scratch', description: 'A skill in no group.', path: 'Skills/scratch' },
73
+ { name: 'outreach', description: 'Runs the GTM outreach.', path: 'Plugins/GTM/outreach' },
74
+ { name: 'scratch', description: 'A skill in no plugin.', path: 'Skills/scratch' },
75
75
  ],
76
76
  tools: [],
77
77
  ownedSkills: new Set(['outreach']),
@@ -82,9 +82,9 @@ const CATALOG: LibraryData = {
82
82
  reload: vi.fn(),
83
83
  };
84
84
 
85
- const summary = (over: Partial<GroupSummary>): GroupSummary => ({
85
+ const summary = (over: Partial<PluginSummary>): PluginSummary => ({
86
86
  name: 'GTM',
87
- folders: ['Groups/GTM'],
87
+ folders: ['Plugins/GTM'],
88
88
  canRead: true,
89
89
  canWrite: true,
90
90
  isOwner: false,
@@ -98,11 +98,11 @@ const summary = (over: Partial<GroupSummary>): GroupSummary => ({
98
98
  ...over,
99
99
  });
100
100
 
101
- const GROUPS: GroupSummary[] = [
101
+ const PLUGINS: PluginSummary[] = [
102
102
  summary({}),
103
103
  // Not readable and not writable, and no item of it reaches the catalog — the
104
104
  // sidebar's locked half.
105
- summary({ name: 'Finance', folders: ['Groups/Finance'], canRead: false, canWrite: false }),
105
+ summary({ name: 'Finance', folders: ['Plugins/Finance'], canRead: false, canWrite: false }),
106
106
  ];
107
107
 
108
108
  function wrap(children: ReactNode) {
@@ -142,7 +142,7 @@ function renderLibrary(path = '/skills-and-tools') {
142
142
  );
143
143
  }
144
144
 
145
- const nav = () => screen.getByRole('navigation', { name: 'Library groups' });
145
+ const nav = () => screen.getByRole('navigation', { name: 'Library plugins' });
146
146
  const menuItems = () =>
147
147
  within(screen.getByRole('menu'))
148
148
  .getAllByRole('menuitem')
@@ -150,7 +150,7 @@ const menuItems = () =>
150
150
 
151
151
  /**
152
152
  * A row in the NAV, by name. Scoped rather than global because the Library
153
- * opens on the all-groups index, whose rows name the same groups the nav does —
153
+ * opens on the all-plugins index, whose rows name the same plugins the nav does —
154
154
  * `GTM` is two buttons on this screen, and only one of them is the nav's.
155
155
  */
156
156
  const navRow = (name: RegExp | string) => within(nav()).findByRole('button', { name });
@@ -166,9 +166,9 @@ async function openMenuOn(name: RegExp | string) {
166
166
  describe('Library sidebar: right-click, end to end', () => {
167
167
  beforeEach(() => {
168
168
  dataMock.useLibraryData.mockReturnValue(CATALOG);
169
- groupsMock.listGroups.mockResolvedValue(GROUPS);
170
- groupsMock.listJoinRequests.mockResolvedValue([]);
171
- groupsMock.deleteGroup.mockResolvedValue(undefined);
169
+ pluginsMock.listPlugins.mockResolvedValue(PLUGINS);
170
+ pluginsMock.listJoinRequests.mockResolvedValue([]);
171
+ pluginsMock.deletePlugin.mockResolvedValue(undefined);
172
172
  });
173
173
 
174
174
  // Only the globals this file stubs — NOT `restoreAllMocks`, which would strip
@@ -176,37 +176,37 @@ describe('Library sidebar: right-click, end to end', () => {
176
176
  // returning undefined for whichever test happens to run next.
177
177
  afterEach(() => vi.unstubAllGlobals());
178
178
 
179
- it('gives a group row the full menu, titled after the group', async () => {
179
+ it('gives a plugin row the full menu, titled after the plugin', async () => {
180
180
  renderLibrary();
181
181
  await openMenuOn(/^GTM/);
182
182
  expect(screen.getByRole('menu', { name: 'Actions for GTM' })).toBeInTheDocument();
183
- expect(menuItems()).toEqual(['Add a skill or tool', 'New group', 'Copy link', 'Manage access']);
183
+ expect(menuItems()).toEqual(['Add a skill or tool', 'New plugin', 'Copy link', 'Manage access']);
184
184
  });
185
185
 
186
186
  /**
187
187
  * A lens is a slice of the catalog, not a folder — there is nothing to add a
188
- * skill TO and no `access.md` behind it. The same call the group page's
188
+ * skill TO and no `access.md` behind it. The same call the plugin page's
189
189
  * `PageActions` makes when it hides `Share` on the personal page.
190
190
  */
191
191
  it('gives a lens row only the verbs a slice of the catalog can answer', async () => {
192
192
  renderLibrary();
193
193
  await openMenuOn(/^Owned by me/);
194
- expect(menuItems()).toEqual(['New group', 'Copy link']);
194
+ expect(menuItems()).toEqual(['New plugin', 'Copy link']);
195
195
 
196
196
  fireEvent.keyDown(document, { key: 'Escape' });
197
197
  await waitFor(() => expect(screen.queryByRole('menu')).toBeNull());
198
198
 
199
199
  await openMenuOn(new RegExp(`^${TEST_PERSONAL_GROUP}`));
200
- expect(menuItems()).toEqual(['New group', 'Copy link']);
200
+ expect(menuItems()).toEqual(['New plugin', 'Copy link']);
201
201
  });
202
202
 
203
203
  /**
204
- * `Manage access` is UNGATED on `canWrite`, exactly as the group page's
204
+ * `Manage access` is UNGATED on `canWrite`, exactly as the plugin page's
205
205
  * `Share` is: for a non-writer the dialog renders read-only, which is
206
206
  * precisely what "who is this shared with?" should answer — and for an admin
207
- * locked out of a group it is the self-service way back in.
207
+ * locked out of a plugin it is the self-service way back in.
208
208
  */
209
- it('offers Manage access on a locked group too', async () => {
209
+ it('offers Manage access on a locked plugin too', async () => {
210
210
  renderLibrary();
211
211
  await openMenuOn('Finance (locked)');
212
212
  expect(screen.getByRole('menu', { name: 'Actions for Finance' })).toBeInTheDocument();
@@ -220,26 +220,26 @@ describe('Library sidebar: right-click, end to end', () => {
220
220
  * `canWrite: true, isOwner: false` — the full-menu test above is therefore
221
221
  * also the proof that a mere MANAGER does not see the item.
222
222
  */
223
- it('offers Delete group to an owner, and drives the confirm → delete round-trip', async () => {
224
- groupsMock.listGroups.mockResolvedValue([summary({ isOwner: true })]);
223
+ it('offers Delete plugin to an owner, and drives the confirm → delete round-trip', async () => {
224
+ pluginsMock.listPlugins.mockResolvedValue([summary({ isOwner: true })]);
225
225
  renderLibrary();
226
226
  await openMenuOn(/^GTM/);
227
227
  expect(menuItems()).toEqual([
228
228
  'Add a skill or tool',
229
- 'New group',
229
+ 'New plugin',
230
230
  'Copy link',
231
231
  'Manage access',
232
- 'Delete group',
232
+ 'Delete plugin',
233
233
  ]);
234
234
 
235
- fireEvent.click(screen.getByRole('menuitem', { name: 'Delete group' }));
235
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Delete plugin' }));
236
236
  // The menu hands over to the confirmation — nothing is deleted yet.
237
237
  const dialog = await screen.findByRole('dialog');
238
238
  expect(screen.queryByRole('menu')).toBeNull();
239
- expect(groupsMock.deleteGroup).not.toHaveBeenCalled();
239
+ expect(pluginsMock.deletePlugin).not.toHaveBeenCalled();
240
240
 
241
- fireEvent.click(within(dialog).getByRole('button', { name: 'Delete group' }));
242
- await waitFor(() => expect(groupsMock.deleteGroup).toHaveBeenCalledWith('GTM'));
241
+ fireEvent.click(within(dialog).getByRole('button', { name: 'Delete plugin' }));
242
+ await waitFor(() => expect(pluginsMock.deletePlugin).toHaveBeenCalledWith('GTM'));
243
243
  // The layout says so — same voice as every other completed verb here.
244
244
  expect(await screen.findByText('Deleted GTM.')).toBeInTheDocument();
245
245
  });
@@ -249,28 +249,28 @@ describe('Library sidebar: right-click, end to end', () => {
249
249
  await navRow(/^GTM/);
250
250
  fireEvent.contextMenu(nav(), { clientX: 40, clientY: 400 });
251
251
  await screen.findByRole('menu');
252
- expect(menuItems()).toEqual(['New group']);
252
+ expect(menuItems()).toEqual(['New plugin']);
253
253
  });
254
254
 
255
- it('opens the new-group dialog from the menu', async () => {
255
+ it('opens the new-plugin dialog from the menu', async () => {
256
256
  renderLibrary();
257
257
  await openMenuOn(/^GTM/);
258
- fireEvent.click(screen.getByRole('menuitem', { name: 'New group' }));
258
+ fireEvent.click(screen.getByRole('menuitem', { name: 'New plugin' }));
259
259
  expect(await screen.findByRole('dialog')).toBeInTheDocument();
260
260
  expect(screen.queryByRole('menu')).toBeNull();
261
261
  });
262
262
 
263
- it('opens the add dialog for the group that was clicked, not the page you are on', async () => {
263
+ it('opens the add dialog for the plugin that was clicked, not the page you are on', async () => {
264
264
  renderLibrary('/skills-and-tools/owned');
265
265
  await openMenuOn(/^GTM/);
266
266
  fireEvent.click(screen.getByRole('menuitem', { name: 'Add a skill or tool' }));
267
- // The dialog titles itself with its group — proof the layout captured the
268
- // ROW's group, and not the route it happened to be sitting on.
267
+ // The dialog titles itself with its plugin — proof the layout captured the
268
+ // ROW's plugin, and not the route it happened to be sitting on.
269
269
  const dialog = await screen.findByRole('dialog');
270
270
  expect(within(dialog).getByText('Add a skill or tool to GTM')).toBeInTheDocument();
271
271
  });
272
272
 
273
- it('opens Manage access on the group folder, under the KB dir', async () => {
273
+ it('opens Manage access on the plugin folder, under the KB dir', async () => {
274
274
  const access = await import('../../access/api');
275
275
  renderLibrary();
276
276
  await openMenuOn(/^GTM/);
@@ -282,11 +282,11 @@ describe('Library sidebar: right-click, end to end', () => {
282
282
  * WORKSPACE path (`<kbDirName>/<folder>`), the dialog strips that prefix
283
283
  * back off, and what reaches the resolver is the REPO-relative folder —
284
284
  * which is the only address `access.md` is written at. Get either half
285
- * wrong and this is `undefined/Groups/GTM` or `knowledge-base/Groups/GTM`,
285
+ * wrong and this is `undefined/Plugins/GTM` or `knowledge-base/Plugins/GTM`,
286
286
  * and the dialog silently resolves a folder that does not exist. It is the
287
- * same handoff `GroupPage` makes, which is why it has to match exactly.
287
+ * same handoff `PluginPage` makes, which is why it has to match exactly.
288
288
  */
289
- expect(vi.mocked(access.fetchFileAccess).mock.calls[0][1]).toBe('Groups/GTM');
289
+ expect(vi.mocked(access.fetchFileAccess).mock.calls[0][1]).toBe('Plugins/GTM');
290
290
  });
291
291
 
292
292
  it("copies the clicked row's own URL, not the one you are standing on", async () => {
@@ -299,7 +299,7 @@ describe('Library sidebar: right-click, end to end', () => {
299
299
 
300
300
  await waitFor(() =>
301
301
  expect(writeText).toHaveBeenCalledWith(
302
- `${window.location.origin}/skills-and-tools/groups/GTM`,
302
+ `${window.location.origin}/skills-and-tools/plugins/GTM`,
303
303
  ),
304
304
  );
305
305
  expect(await screen.findByText('Link copied.')).toBeInTheDocument();