@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
@@ -21,8 +21,8 @@ import type { LibraryData } from '../hooks/useLibraryData';
21
21
  const dataMock = vi.hoisted(() => ({ useLibraryData: vi.fn() }));
22
22
  vi.mock('../hooks/useLibraryData', () => ({ useLibraryData: dataMock.useLibraryData }));
23
23
 
24
- vi.mock('../services/groups.api', () => ({
25
- listGroups: vi.fn().mockResolvedValue([]),
24
+ vi.mock('../services/plugins.api', () => ({
25
+ listPlugins: vi.fn().mockResolvedValue([]),
26
26
  listJoinRequests: vi.fn().mockResolvedValue([]),
27
27
  }));
28
28
 
@@ -43,14 +43,14 @@ const CATALOG: LibraryData = {
43
43
  loading: false,
44
44
  error: null,
45
45
  skills: [
46
- { name: 'create-sales-deck', description: '', path: 'Groups/Sales/create-sales-deck' },
46
+ { name: 'create-sales-deck', description: '', path: 'Plugins/Sales/create-sales-deck' },
47
47
  ],
48
48
  pendingSkills: [],
49
49
  tools: [
50
50
  {
51
51
  slug: 'notion',
52
52
  name: 'notion',
53
- path: 'Groups/Support/notion.tool',
53
+ path: 'Plugins/Support/notion.tool',
54
54
  type: 'mcp',
55
55
  setup: null,
56
56
  canWrite: false,
@@ -122,23 +122,23 @@ beforeEach(() => {
122
122
 
123
123
  describe('WorkspaceItemRoute', () => {
124
124
  it("a skill file's URL renders the skill page on that file's tab, inside the library nav", async () => {
125
- renderAt(itemUrl('Groups/Sales/create-sales-deck/reference/LESSONS.md'));
125
+ renderAt(itemUrl('Plugins/Sales/create-sales-deck/reference/LESSONS.md'));
126
126
  expect(await screen.findByLabelText('skill-page')).toHaveTextContent(
127
127
  'create-sales-deck::reference/LESSONS.md',
128
128
  );
129
129
  // The ONE library sidebar is on screen with it — same surface, not a copy.
130
- expect(screen.getByRole('button', { name: /^All groups/ })).toBeInTheDocument();
130
+ expect(screen.getByRole('button', { name: /^All plugins/ })).toBeInTheDocument();
131
131
  });
132
132
 
133
133
  it('a bare skill-folder URL opens SKILL.md', async () => {
134
- renderAt(itemUrl('Groups/Sales/create-sales-deck'));
134
+ renderAt(itemUrl('Plugins/Sales/create-sales-deck'));
135
135
  expect(await screen.findByLabelText('skill-page')).toHaveTextContent(
136
136
  'create-sales-deck::SKILL.md',
137
137
  );
138
138
  });
139
139
 
140
140
  it("a `.tool` manual's URL renders the tool page", async () => {
141
- renderAt(itemUrl('Groups/Support/notion.tool'));
141
+ renderAt(itemUrl('Plugins/Support/notion.tool'));
142
142
  expect(await screen.findByLabelText('tool-page')).toHaveTextContent('notion');
143
143
  });
144
144
 
@@ -147,33 +147,33 @@ describe('WorkspaceItemRoute', () => {
147
147
  // catalog reload hasn't landed. Resolution is structural (the folder name
148
148
  // IS the skill id), so the page opens instantly anyway.
149
149
  dataMock.useLibraryData.mockReturnValue({ ...CATALOG, loading: true, skills: [], tools: [] });
150
- renderAt(itemUrl('Groups/Sales/brand-new-skill/SKILL.md'));
150
+ renderAt(itemUrl('Plugins/Sales/brand-new-skill/SKILL.md'));
151
151
  expect(await screen.findByLabelText('skill-page')).toHaveTextContent(
152
152
  'brand-new-skill::SKILL.md',
153
153
  );
154
154
  // …inside the library surface, never the Knowledge view.
155
- expect(screen.getByRole('button', { name: /^All groups/ })).toBeInTheDocument();
155
+ expect(screen.getByRole('button', { name: /^All plugins/ })).toBeInTheDocument();
156
156
  });
157
157
 
158
158
  it("a `.tool` URL falls back to the filename slug when the catalog hasn't loaded", async () => {
159
159
  dataMock.useLibraryData.mockReturnValue({ ...CATALOG, loading: true, skills: [], tools: [] });
160
- renderAt(itemUrl('Groups/Support/notion.tool'));
160
+ renderAt(itemUrl('Plugins/Support/notion.tool'));
161
161
  expect(await screen.findByLabelText('tool-page')).toHaveTextContent('notion');
162
162
  });
163
163
 
164
- it("a Groups path that is no item lands on its group's page", async () => {
165
- renderAt(itemUrl('Groups/Sales/access.md'));
164
+ it("a Plugins path that is no item lands on its plugin's page", async () => {
165
+ renderAt(itemUrl('Plugins/Sales/access.md'));
166
166
  await waitFor(() =>
167
- expect(screen.getByLabelText('pathname')).toHaveTextContent('/skills-and-tools/groups/Sales'),
167
+ expect(screen.getByLabelText('pathname')).toHaveTextContent('/skills-and-tools/plugins/Sales'),
168
168
  );
169
169
  });
170
170
 
171
171
  /**
172
- * A group may carry CATEGORY folders: `skills.service` walks until it finds
173
- * a `SKILL.md` and treats that folder as the skill, so `Groups/Engineering/
172
+ * A plugin may carry CATEGORY folders: `skills.service` walks until it finds
173
+ * a `SKILL.md` and treats that folder as the skill, so `Plugins/Engineering/
174
174
  * coding/create-ticket/SKILL.md` is a skill named `create-ticket`.
175
175
  *
176
- * Reading the first segment below the group asked for the category —
176
+ * Reading the first segment below the plugin asked for the category —
177
177
  * "coding", which no skill answers to — so every nested skill listed
178
178
  * perfectly and then reported "doesn't exist, or you don't have access to
179
179
  * it" on click. Every fixture here used to be flat, which is exactly why
@@ -183,11 +183,11 @@ describe('WorkspaceItemRoute', () => {
183
183
  const NESTED: LibraryData = {
184
184
  ...CATALOG,
185
185
  skills: [
186
- { name: 'create-ticket', description: '', path: 'Groups/Engineering/coding/create-ticket' },
186
+ { name: 'create-ticket', description: '', path: 'Plugins/Engineering/coding/create-ticket' },
187
187
  {
188
188
  name: 'architecture-review',
189
189
  description: '',
190
- path: 'Groups/Engineering/review/architecture-review',
190
+ path: 'Plugins/Engineering/review/architecture-review',
191
191
  },
192
192
  ],
193
193
  };
@@ -197,21 +197,21 @@ describe('WorkspaceItemRoute', () => {
197
197
  });
198
198
 
199
199
  it('resolves its SKILL.md to the folder holding it, not the category', async () => {
200
- renderAt(itemUrl('Groups/Engineering/coding/create-ticket/SKILL.md'));
200
+ renderAt(itemUrl('Plugins/Engineering/coding/create-ticket/SKILL.md'));
201
201
  expect(await screen.findByLabelText('skill-page')).toHaveTextContent(
202
202
  'create-ticket::SKILL.md',
203
203
  );
204
204
  });
205
205
 
206
206
  it('resolves a bundled file below a category folder', async () => {
207
- renderAt(itemUrl('Groups/Engineering/review/architecture-review/check-vocab.mjs'));
207
+ renderAt(itemUrl('Plugins/Engineering/review/architecture-review/check-vocab.mjs'));
208
208
  expect(await screen.findByLabelText('skill-page')).toHaveTextContent(
209
209
  'architecture-review::check-vocab.mjs',
210
210
  );
211
211
  });
212
212
 
213
213
  it('resolves a bare nested skill folder to SKILL.md', async () => {
214
- renderAt(itemUrl('Groups/Engineering/coding/create-ticket'));
214
+ renderAt(itemUrl('Plugins/Engineering/coding/create-ticket'));
215
215
  expect(await screen.findByLabelText('skill-page')).toHaveTextContent(
216
216
  'create-ticket::SKILL.md',
217
217
  );
@@ -221,7 +221,7 @@ describe('WorkspaceItemRoute', () => {
221
221
  // The SKILL.md rule reads the URL alone, so the just-created case above
222
222
  // keeps working at depth: the folder holding SKILL.md IS the skill.
223
223
  dataMock.useLibraryData.mockReturnValue({ ...CATALOG, loading: true, skills: [], tools: [] });
224
- renderAt(itemUrl('Groups/Engineering/coding/brand-new-skill/SKILL.md'));
224
+ renderAt(itemUrl('Plugins/Engineering/coding/brand-new-skill/SKILL.md'));
225
225
  expect(await screen.findByLabelText('skill-page')).toHaveTextContent(
226
226
  'brand-new-skill::SKILL.md',
227
227
  );
@@ -229,7 +229,7 @@ describe('WorkspaceItemRoute', () => {
229
229
 
230
230
  it('resolves a `.tool` filed under a category folder, by its catalog slug', async () => {
231
231
  // `walkFiles` finds manuals at ANY depth, so this is a real listed tool;
232
- // matching only the group's top level listed it and 404'd the click. The
232
+ // matching only the plugin's top level listed it and 404'd the click. The
233
233
  // slug is the manual's declared `id`, which need not match the filename —
234
234
  // so a fixture whose slug equals its filename would prove nothing.
235
235
  dataMock.useLibraryData.mockReturnValue({
@@ -238,7 +238,7 @@ describe('WorkspaceItemRoute', () => {
238
238
  {
239
239
  slug: 'internal_deploy',
240
240
  name: 'internal_deploy',
241
- path: 'Groups/Engineering/coding/deploy.tool',
241
+ path: 'Plugins/Engineering/coding/deploy.tool',
242
242
  type: 'mcp' as const,
243
243
  setup: null,
244
244
  canWrite: false,
@@ -246,17 +246,17 @@ describe('WorkspaceItemRoute', () => {
246
246
  },
247
247
  ],
248
248
  });
249
- renderAt(itemUrl('Groups/Engineering/coding/deploy.tool'));
249
+ renderAt(itemUrl('Plugins/Engineering/coding/deploy.tool'));
250
250
  expect(await screen.findByLabelText('tool-page')).toHaveTextContent('internal_deploy');
251
251
  });
252
252
 
253
- it("sends a category folder's own access.md to the group page", async () => {
254
- // The same answer a stray file at the group's top level gets. Before, it
253
+ it("sends a category folder's own access.md to the plugin page", async () => {
254
+ // The same answer a stray file at the plugin's top level gets. Before, it
255
255
  // fell through to a SkillPage named after the category.
256
- renderAt(itemUrl('Groups/Engineering/coding/access.md'));
256
+ renderAt(itemUrl('Plugins/Engineering/coding/access.md'));
257
257
  await waitFor(() =>
258
258
  expect(screen.getByLabelText('pathname')).toHaveTextContent(
259
- '/skills-and-tools/groups/Engineering',
259
+ '/skills-and-tools/plugins/Engineering',
260
260
  ),
261
261
  );
262
262
  });
@@ -266,26 +266,26 @@ describe('WorkspaceItemRoute', () => {
266
266
  // SkillPage after a skill named "coding" and flashed a not-found error;
267
267
  // the catalog is what settles it, so hold the slot until it lands.
268
268
  dataMock.useLibraryData.mockReturnValue({ ...NESTED, loading: true, skills: [], tools: [] });
269
- renderAt(itemUrl('Groups/Engineering/coding/create-ticket'));
270
- expect(await screen.findByRole('button', { name: /^All groups/ })).toBeInTheDocument();
269
+ renderAt(itemUrl('Plugins/Engineering/coding/create-ticket'));
270
+ expect(await screen.findByRole('button', { name: /^All plugins/ })).toBeInTheDocument();
271
271
  expect(screen.queryByLabelText('skill-page')).toBeNull();
272
272
  });
273
273
 
274
- it('sends a bare CATEGORY folder to its group, not to a skill page', async () => {
274
+ it('sends a bare CATEGORY folder to its plugin, not to a skill page', async () => {
275
275
  // A category is not a skill, and `coding` names none. What tells it apart
276
276
  // from a just-created skill the catalog hasn't caught up with is that the
277
277
  // catalog knows skills UNDER it.
278
- renderAt(itemUrl('Groups/Engineering/coding'));
278
+ renderAt(itemUrl('Plugins/Engineering/coding'));
279
279
  await waitFor(() =>
280
280
  expect(screen.getByLabelText('pathname')).toHaveTextContent(
281
- '/skills-and-tools/groups/Engineering',
281
+ '/skills-and-tools/plugins/Engineering',
282
282
  ),
283
283
  );
284
284
  expect(screen.queryByLabelText('skill-page')).toBeNull();
285
285
  });
286
286
 
287
287
  it('still opens a folder the catalog has no skills under — a stale new skill', async () => {
288
- renderAt(itemUrl('Groups/Engineering/coding/brand-new-skill'));
288
+ renderAt(itemUrl('Plugins/Engineering/coding/brand-new-skill'));
289
289
  expect(await screen.findByLabelText('skill-page')).toHaveTextContent(
290
290
  'brand-new-skill::SKILL.md',
291
291
  );
@@ -294,10 +294,10 @@ describe('WorkspaceItemRoute', () => {
294
294
  it('opens a bundled file of a skill the catalog has not caught up with', async () => {
295
295
  // STALE, not failed: the catalog loaded fine, it just predates the skill.
296
296
  // Concluding "nothing owns this file, so it is not a page" bounced the
297
- // reader to the group — the very symptom this change exists to remove,
297
+ // reader to the plugin — the very symptom this change exists to remove,
298
298
  // reached through a different unsettled state. Absence proves nothing;
299
299
  // only positive evidence (a known category above it) redirects.
300
- renderAt(itemUrl('Groups/Engineering/coding/brand-new-skill/notes.md'));
300
+ renderAt(itemUrl('Plugins/Engineering/coding/brand-new-skill/notes.md'));
301
301
  expect(await screen.findByLabelText('skill-page')).toHaveTextContent(
302
302
  'brand-new-skill::notes.md',
303
303
  );
@@ -310,10 +310,10 @@ describe('WorkspaceItemRoute', () => {
310
310
  ...NESTED,
311
311
  error: "Couldn't refresh the catalog.",
312
312
  });
313
- renderAt(itemUrl('Groups/Engineering/coding'));
313
+ renderAt(itemUrl('Plugins/Engineering/coding'));
314
314
  await waitFor(() =>
315
315
  expect(screen.getByLabelText('pathname')).toHaveTextContent(
316
- '/skills-and-tools/groups/Engineering',
316
+ '/skills-and-tools/plugins/Engineering',
317
317
  ),
318
318
  );
319
319
  });
@@ -328,11 +328,11 @@ describe('WorkspaceItemRoute', () => {
328
328
  {
329
329
  name: 'create-ticket-v2',
330
330
  description: '',
331
- path: 'Groups/Engineering/coding/create-ticket-v2',
331
+ path: 'Plugins/Engineering/coding/create-ticket-v2',
332
332
  },
333
333
  ],
334
334
  });
335
- renderAt(itemUrl('Groups/Engineering/coding/create-ticket-v2/notes.md'));
335
+ renderAt(itemUrl('Plugins/Engineering/coding/create-ticket-v2/notes.md'));
336
336
  expect(await screen.findByLabelText('skill-page')).toHaveTextContent(
337
337
  'create-ticket-v2::notes.md',
338
338
  );
@@ -346,9 +346,9 @@ describe('WorkspaceItemRoute', () => {
346
346
  it('resolves a skill whose declared id differs from its folder name', async () => {
347
347
  dataMock.useLibraryData.mockReturnValue({
348
348
  ...CATALOG,
349
- skills: [{ name: 'deck-builder', description: '', path: 'Groups/Sales/create-sales-deck' }],
349
+ skills: [{ name: 'deck-builder', description: '', path: 'Plugins/Sales/create-sales-deck' }],
350
350
  });
351
- renderAt(itemUrl('Groups/Sales/create-sales-deck/SKILL.md'));
351
+ renderAt(itemUrl('Plugins/Sales/create-sales-deck/SKILL.md'));
352
352
  expect(await screen.findByLabelText('skill-page')).toHaveTextContent('deck-builder::SKILL.md');
353
353
  });
354
354
 
@@ -356,7 +356,7 @@ describe('WorkspaceItemRoute', () => {
356
356
  // `skills.service` stops at the first `SKILL.md` and treats that folder as
357
357
  // the skill, so a nested one is a bundled asset — never a skill called
358
358
  // `examples`.
359
- renderAt(itemUrl('Groups/Sales/create-sales-deck/examples/SKILL.md'));
359
+ renderAt(itemUrl('Plugins/Sales/create-sales-deck/examples/SKILL.md'));
360
360
  expect(await screen.findByLabelText('skill-page')).toHaveTextContent(
361
361
  'create-sales-deck::examples/SKILL.md',
362
362
  );
@@ -364,8 +364,8 @@ describe('WorkspaceItemRoute', () => {
364
364
 
365
365
  /**
366
366
  * A failed catalog is "we couldn't ask", not "no such item" — the same
367
- * distinction GroupPage draws. Reading it as proof that nothing owns the
368
- * file would bounce every bundled-file deep link to the group page during a
367
+ * distinction PluginPage draws. Reading it as proof that nothing owns the
368
+ * file would bounce every bundled-file deep link to the plugin page during a
369
369
  * transient outage, losing the URL; the skill detail comes from a different
370
370
  * endpoint and can still answer.
371
371
  */
@@ -379,15 +379,15 @@ describe('WorkspaceItemRoute', () => {
379
379
  });
380
380
  // The file's own folder is the best available reading without a catalog
381
381
  // (an asset nested deeper simply cannot be attributed) — the point is that
382
- // the reader stays on a skill page instead of being bounced to the group.
383
- renderAt(itemUrl('Groups/Sales/create-sales-deck/notes.md'));
382
+ // the reader stays on a skill page instead of being bounced to the plugin.
383
+ renderAt(itemUrl('Plugins/Sales/create-sales-deck/notes.md'));
384
384
  expect(await screen.findByLabelText('skill-page')).toHaveTextContent(
385
385
  'create-sales-deck::notes.md',
386
386
  );
387
387
  });
388
388
 
389
389
  it('a non-default branch never renders an item page', async () => {
390
- renderAt(itemUrl('Groups/Sales/create-sales-deck/SKILL.md', 'razvan/some-draft'));
390
+ renderAt(itemUrl('Plugins/Sales/create-sales-deck/SKILL.md', 'razvan/some-draft'));
391
391
  await waitFor(() =>
392
392
  expect(screen.getByLabelText('pathname')).toHaveTextContent(/^\/skills-and-tools$/),
393
393
  );
@@ -397,16 +397,16 @@ describe('WorkspaceItemRoute', () => {
397
397
  describe('isLibraryLocation — the surface rule', () => {
398
398
  it.each([
399
399
  ['/skills-and-tools', true],
400
- ['/skills-and-tools/groups/Sales', true],
401
- [itemUrl('Groups/Sales/create-sales-deck/SKILL.md'), true],
402
- [itemUrl('Groups/Support/notion.tool'), true],
400
+ ['/skills-and-tools/plugins/Sales', true],
401
+ [itemUrl('Plugins/Sales/create-sales-deck/SKILL.md'), true],
402
+ [itemUrl('Plugins/Support/notion.tool'), true],
403
403
  // KnowledgeBase paths are the Knowledge app's, whatever the file.
404
404
  [`/workspace/${DEFAULT_BRANCH}/${KB}/KnowledgeBase/Handbook/Tone of voice.md`, false],
405
405
  // Drafts review raw, in Knowledge — the library speaks the default branch.
406
- [itemUrl('Groups/Sales/create-sales-deck/SKILL.md', 'razvan/draft'), false],
407
- // Too shallow to name an item (`Groups/` itself, a group folder alone).
408
- [`/workspace/${DEFAULT_BRANCH}/${KB}/Groups`, false],
409
- [`/workspace/${DEFAULT_BRANCH}/${KB}/Groups/Sales`, false],
406
+ [itemUrl('Plugins/Sales/create-sales-deck/SKILL.md', 'razvan/draft'), false],
407
+ // Too shallow to name an item (`Plugins/` itself, a plugin folder alone).
408
+ [`/workspace/${DEFAULT_BRANCH}/${KB}/Plugins`, false],
409
+ [`/workspace/${DEFAULT_BRANCH}/${KB}/Plugins/Sales`, false],
410
410
  ['/workspace', false],
411
411
  ['/secrets', false],
412
412
  ])('%s → %s', (pathname, expected) => {
@@ -5,8 +5,8 @@ import { AuthContext, type AuthContextValue } from '../../auth/state/auth.contex
5
5
  /**
6
6
  * The signed-in user, for tests that render a Library surface.
7
7
  *
8
- * The Library names a person's own space after them ("Juan's Group"), so the
9
- * sidebar and the all-groups index now read `useAuth`. In production that is
8
+ * The Library names a person's own space after them ("Juan's Plugin"), so the
9
+ * sidebar and the all-plugins index now read `useAuth`. In production that is
10
10
  * free — nothing under `CoreAppShell` renders before a user exists — but a
11
11
  * test that mounts a page in isolation has no provider above it, and `useAuth`
12
12
  * throws rather than returning null.
@@ -18,8 +18,8 @@ import { AuthContext, type AuthContextValue } from '../../auth/state/auth.contex
18
18
  /** The name every Library suite expects to see reflected back. */
19
19
  export const TEST_USER_NAME = 'Juan Viera';
20
20
 
21
- /** What `personalGroupName(TEST_USER_NAME)` produces — assert against this. */
22
- export const TEST_PERSONAL_GROUP = "Juan's Group";
21
+ /** What `personalPluginName(TEST_USER_NAME)` produces — assert against this. */
22
+ export const TEST_PERSONAL_GROUP = "Juan's Plugin";
23
23
 
24
24
  export function authValue(over: Partial<AuthContextValue> = {}): AuthContextValue {
25
25
  return {
@@ -0,0 +1,82 @@
1
+ import { describe, expect, it, vi } from 'vitest';
2
+ import {
3
+ workspaceHasNoPlugins,
4
+ type LibraryContextValue,
5
+ type LibraryItem,
6
+ } from '../state/library-data';
7
+
8
+ /**
9
+ * The one predicate behind every "create the FIRST plugin" doorway — the nav's
10
+ * spelled-out row and the index's CTA both. What these tests pin is that the
11
+ * verdict is SETTLED: an empty answer while either witness is loading or has
12
+ * failed must read as "unknown", never as "untouched".
13
+ */
14
+
15
+ function item(plugin: string | null): LibraryItem {
16
+ return {
17
+ kind: 'skill',
18
+ id: 'scratch',
19
+ name: 'scratch',
20
+ description: '',
21
+ owned: false,
22
+ plugin,
23
+ path: plugin ? `Plugins/${plugin}/scratch` : 'Skills/scratch',
24
+ status: { state: 'ok', text: 'Ready' },
25
+ };
26
+ }
27
+
28
+ function lib(over: Partial<LibraryContextValue> = {}): LibraryContextValue {
29
+ return {
30
+ loading: false,
31
+ error: null,
32
+ skills: [],
33
+ pendingSkills: [],
34
+ tools: [],
35
+ ownedSkills: new Set(),
36
+ allowedToolsBySkill: new Map(),
37
+ crs: [],
38
+ myCrNumbers: new Set(),
39
+ reload: vi.fn(),
40
+ items: [],
41
+ pluginSummaries: [],
42
+ pluginsLoading: false,
43
+ pluginsError: null,
44
+ reloadPlugins: vi.fn(),
45
+ ...over,
46
+ };
47
+ }
48
+
49
+ describe('workspaceHasNoPlugins', () => {
50
+ it('is true only for a settled, plugin-less workspace', () => {
51
+ expect(workspaceHasNoPlugins(lib())).toBe(true);
52
+ expect(workspaceHasNoPlugins(lib({ items: [item(null)] }))).toBe(true);
53
+ });
54
+
55
+ it('treats a still-loading source as an unanswered question', () => {
56
+ expect(workspaceHasNoPlugins(lib({ loading: true }))).toBe(false);
57
+ expect(workspaceHasNoPlugins(lib({ pluginsLoading: true }))).toBe(false);
58
+ });
59
+
60
+ it('treats a failed source as an unanswered question', () => {
61
+ expect(workspaceHasNoPlugins(lib({ error: 'boom' }))).toBe(false);
62
+ expect(workspaceHasNoPlugins(lib({ pluginsError: "Couldn't load plugins." }))).toBe(false);
63
+ });
64
+
65
+ it('counts a plugin from either witness — a summary, or a catalog item', () => {
66
+ expect(
67
+ workspaceHasNoPlugins(
68
+ lib({
69
+ pluginSummaries: [
70
+ {
71
+ name: 'GTM',
72
+ folders: ['Plugins/GTM'],
73
+ canRead: false,
74
+ canWrite: false,
75
+ } as LibraryContextValue['pluginSummaries'][number],
76
+ ],
77
+ }),
78
+ ),
79
+ ).toBe(false);
80
+ expect(workspaceHasNoPlugins(lib({ items: [item('GTM')] }))).toBe(false);
81
+ });
82
+ });
@@ -3,7 +3,7 @@ import type { ToolSecrets } from '../../secrets-vault/services/tool-secrets.api'
3
3
  import {
4
4
  emptyMessageFor,
5
5
  filterLibraryItems,
6
- groupCounts,
6
+ pluginCounts,
7
7
  neededToolsFor,
8
8
  skillStatus,
9
9
  toolStatus,
@@ -94,14 +94,14 @@ describe('neededToolsFor / skillStatus', () => {
94
94
 
95
95
  describe('filterLibraryItems (sidebar selection + search)', () => {
96
96
  const items: LibraryFilterable[] = [
97
- { kind: 'skill', name: 'Weekly newsletter', description: 'drafts the Friday newsletter', owned: true, group: 'Everyone' },
98
- { kind: 'skill', name: 'RFI responder', description: 'answers requests', owned: false, group: 'GTM' },
99
- { kind: 'integration', name: 'Slack', description: 'messages', owned: false, group: 'Everyone' },
100
- { kind: 'integration', name: 'GitHub', description: 'code and change requests', owned: true, group: null },
97
+ { kind: 'skill', name: 'Weekly newsletter', description: 'drafts the Friday newsletter', owned: true, plugin: 'Everyone' },
98
+ { kind: 'skill', name: 'RFI responder', description: 'answers requests', owned: false, plugin: 'GTM' },
99
+ { kind: 'integration', name: 'Slack', description: 'messages', owned: false, plugin: 'Everyone' },
100
+ { kind: 'integration', name: 'GitHub', description: 'code and change requests', owned: true, plugin: null },
101
101
  ];
102
102
 
103
- it('narrows to a group. Skills and tools together, not split by kind', () => {
104
- expect(filterLibraryItems(items, { kind: 'group', group: 'Everyone' }, '').map((i) => i.name)).toEqual([
103
+ it('narrows to a plugin. Skills and tools together, not split by kind', () => {
104
+ expect(filterLibraryItems(items, { kind: 'group', plugin: 'Everyone' }, '').map((i) => i.name)).toEqual([
105
105
  'Weekly newsletter',
106
106
  'Slack',
107
107
  ]);
@@ -129,28 +129,28 @@ describe('filterLibraryItems (sidebar selection + search)', () => {
129
129
  'GitHub',
130
130
  ]);
131
131
  // The query is applied INSIDE the selection, so a match outside it stays out.
132
- expect(filterLibraryItems(items, { kind: 'group', group: 'GTM' }, 'slack')).toEqual([]);
132
+ expect(filterLibraryItems(items, { kind: 'group', plugin: 'GTM' }, 'slack')).toEqual([]);
133
133
  });
134
134
  });
135
135
 
136
- describe('groupCounts', () => {
137
- it('counts per group, skips ungrouped, and sorts by name not by count', () => {
136
+ describe('pluginCounts', () => {
137
+ it('counts per plugin, skips ungrouped, and sorts by name not by count', () => {
138
138
  const items: LibraryFilterable[] = [
139
- { kind: 'skill', name: 'a', description: '', owned: false, group: 'Zeta' },
140
- { kind: 'skill', name: 'b', description: '', owned: false, group: 'Alpha' },
141
- { kind: 'integration', name: 'c', description: '', owned: false, group: 'Zeta' },
142
- { kind: 'skill', name: 'd', description: '', owned: false, group: null },
139
+ { kind: 'skill', name: 'a', description: '', owned: false, plugin: 'Zeta' },
140
+ { kind: 'skill', name: 'b', description: '', owned: false, plugin: 'Alpha' },
141
+ { kind: 'integration', name: 'c', description: '', owned: false, plugin: 'Zeta' },
142
+ { kind: 'skill', name: 'd', description: '', owned: false, plugin: null },
143
143
  ];
144
144
  // Alpha first despite having fewer items — a nav that reorders itself when
145
- // a group gains an item moves under the pointer.
146
- expect(groupCounts(items)).toEqual([
147
- { group: 'Alpha', count: 1 },
148
- { group: 'Zeta', count: 2 },
145
+ // a plugin gains an item moves under the pointer.
146
+ expect(pluginCounts(items)).toEqual([
147
+ { plugin: 'Alpha', count: 1 },
148
+ { plugin: 'Zeta', count: 2 },
149
149
  ]);
150
150
  });
151
151
 
152
152
  it('is empty when nothing is grouped', () => {
153
- expect(groupCounts([{ kind: 'skill', name: 'a', description: '', owned: true, group: null }])).toEqual([]);
153
+ expect(pluginCounts([{ kind: 'skill', name: 'a', description: '', owned: true, plugin: null }])).toEqual([]);
154
154
  });
155
155
  });
156
156
 
@@ -0,0 +1,70 @@
1
+ import { describe, it, expect, vi, beforeEach } from 'vitest';
2
+
3
+ // Mock the shared auth fetch so we can drive arbitrary responses without a
4
+ // real network call. The module under test binds to this import at load.
5
+ vi.mock('../../../lib/api', () => ({ authFetch: vi.fn() }));
6
+
7
+ import { getMcpServer } from '../services/tools.api';
8
+ import { authFetch } from '../../../lib/api';
9
+
10
+ const mockedFetch = vi.mocked(authFetch);
11
+
12
+ /**
13
+ * The GET `/server` 404 split: the backend answers 404 for BOTH the expected
14
+ * absence (`Not found` — a `.tool`-backed manual has no server pair) and a
15
+ * deployment fault (`Not available` — the edit service isn't wired). Only the
16
+ * first may become `null`; folding both would render a misconfigured backend
17
+ * as a quietly server-less page.
18
+ */
19
+
20
+ function jsonRes(status: number, body: unknown): Response {
21
+ return {
22
+ ok: status >= 200 && status < 300,
23
+ status,
24
+ json: async () => body,
25
+ } as unknown as Response;
26
+ }
27
+
28
+ describe('getMcpServer', () => {
29
+ beforeEach(() => {
30
+ vi.clearAllMocks();
31
+ });
32
+
33
+ it('maps the expected Not found 404 (a .tool-backed manual) to null', async () => {
34
+ mockedFetch.mockResolvedValueOnce(jsonRes(404, { error: 'Not found' }));
35
+ await expect(getMcpServer('files')).resolves.toBeNull();
36
+ });
37
+
38
+ it('surfaces a Not available 404 (edit service not wired) as an error', async () => {
39
+ mockedFetch.mockResolvedValueOnce(jsonRes(404, { error: 'Not available' }));
40
+ await expect(getMcpServer('vendor')).rejects.toThrow('Not available');
41
+ });
42
+
43
+ it('surfaces a bodyless 404 as an error, not a silent absence', async () => {
44
+ mockedFetch.mockResolvedValueOnce({
45
+ ok: false,
46
+ status: 404,
47
+ json: async () => {
48
+ throw new Error('not json');
49
+ },
50
+ } as unknown as Response);
51
+ await expect(getMcpServer('vendor')).rejects.toThrow(
52
+ "Couldn't load the server configuration.",
53
+ );
54
+ });
55
+
56
+ it('returns the view on 200', async () => {
57
+ const view = {
58
+ name: 'vendor',
59
+ transport: 'streamable-http',
60
+ url: 'https://v.example/mcp',
61
+ literalHeaders: {},
62
+ authHeaders: {},
63
+ variables: [],
64
+ local: false,
65
+ canWrite: true,
66
+ };
67
+ mockedFetch.mockResolvedValueOnce(jsonRes(200, view));
68
+ await expect(getMcpServer('vendor')).resolves.toEqual(view);
69
+ });
70
+ });
@@ -28,7 +28,7 @@ import { useToolPage } from '../hooks/useToolPage';
28
28
  const GITHUB: ToolSecrets = {
29
29
  slug: 'github',
30
30
  name: 'github',
31
- path: 'Groups/Engineering/github.tool',
31
+ path: 'Plugins/Engineering/github.tool',
32
32
  type: 'inline',
33
33
  setup: null,
34
34
  canWrite: false,
@@ -38,7 +38,7 @@ const GITHUB: ToolSecrets = {
38
38
  const DETAIL: ToolManualDetail = {
39
39
  slug: 'github',
40
40
  name: 'github',
41
- path: 'Groups/Engineering/github.tool',
41
+ path: 'Plugins/Engineering/github.tool',
42
42
  type: 'inline',
43
43
  description: 'Read and write GitHub issues.',
44
44
  capabilities: [{ name: 'create_issue', description: 'Open an issue.' }],
@@ -96,7 +96,7 @@ describe('useToolPage', () => {
96
96
 
97
97
  it('builds the reverse index from allowed-tools frontmatter', async () => {
98
98
  libraryMock.listSkills.mockResolvedValue([
99
- { name: 'triage', description: '', path: 'Groups/Engineering/triage' },
99
+ { name: 'triage', description: '', path: 'Plugins/Engineering/triage' },
100
100
  { name: 'newsletter', description: '', path: 'Skills/newsletter' },
101
101
  ]);
102
102
  libraryMock.getSkill.mockImplementation(async (name: string) =>
@@ -110,7 +110,7 @@ describe('useToolPage', () => {
110
110
 
111
111
  it('keeps one skill failing from emptying the whole index', async () => {
112
112
  libraryMock.listSkills.mockResolvedValue([
113
- { name: 'triage', description: '', path: 'Groups/Engineering/triage' },
113
+ { name: 'triage', description: '', path: 'Plugins/Engineering/triage' },
114
114
  { name: 'broken', description: '', path: 'Skills/broken' },
115
115
  ]);
116
116
  libraryMock.getSkill.mockImplementation(async (name: string) => {