@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,20 +1,20 @@
1
1
  import { useCallback, useContext, useEffect, useMemo, useState, type ReactNode, } from 'react';
2
2
  import { LibraryContext } from './library-context';
3
- import { groupOfPath, isPersonalGroupFolder } from '@bevel-software/platform-shared';
3
+ import { pluginOfPath, isPersonalPluginFolder } from '@bevel-software/platform-shared';
4
4
 
5
5
  /**
6
- * The group a card files under — with personal folders mapped to `null`, the
7
- * "yours alone" bucket. A personal folder (`Groups/personal-<id>/`) is where
8
- * a person's own skills live; it is a place, not a group, and the only
6
+ * The plugin a card files under — with personal folders mapped to `null`, the
7
+ * "yours alone" bucket. A personal folder (`Plugins/personal-<id>/`) is where
8
+ * a person's own skills live; it is a place, not a plugin, and the only
9
9
  * personal items a caller can ever read are their own (the folder's seeded
10
10
  * access.md names nobody else), so `null` here always means "yours".
11
11
  */
12
- function displayGroupOf(path: string): string | null {
13
- const group = groupOfPath(path);
14
- return group !== null && isPersonalGroupFolder(group) ? null : group;
12
+ function displayPluginOf(path: string): string | null {
13
+ const plugin = pluginOfPath(path);
14
+ return plugin !== null && isPersonalPluginFolder(plugin) ? null : plugin;
15
15
  }
16
16
  import { useLibraryData, type LibraryData } from '../hooks/useLibraryData';
17
- import { listGroups, type GroupSummary } from '../services/groups.api';
17
+ import { listPlugins, type PluginSummary } from '../services/plugins.api';
18
18
  import {
19
19
  neededToolsFor,
20
20
  skillStatus,
@@ -25,8 +25,8 @@ import {
25
25
  /**
26
26
  * The Library's data host.
27
27
  *
28
- * Everything under `/skills-and-tools/*` — the gallery, the group pages, the
29
- * all-groups index — reads the SAME catalog, so it is fetched once here rather
28
+ * Everything under `/skills-and-tools/*` — the gallery, the plugin pages, the
29
+ * all-plugins index — reads the SAME catalog, so it is fetched once here rather
30
30
  * than once per page. That matters more than it looks: `useLibraryData` pays an
31
31
  * N+1 `getSkill` to read `allowed-tools` frontmatter, and mounting it per route
32
32
  * would re-pay it on every navigation.
@@ -34,8 +34,8 @@ import {
34
34
  * Two independent loads live side by side:
35
35
  * - the catalog (`useLibraryData`), whose failure IS surfaced (the gallery
36
36
  * shows a banner — an empty library is indistinguishable from a broken one);
37
- * - the group index (`GET /api/groups`), whose failure degrades to `[]` and is
38
- * reported through `groupsError` for the surfaces that want to say so.
37
+ * - the plugin index (`GET /api/plugins`), whose failure degrades to `[]` and is
38
+ * reported through `pluginsError` for the surfaces that want to say so.
39
39
  */
40
40
 
41
41
  /** One card in the gallery — a skill or an integration, already status-derived. */
@@ -46,8 +46,8 @@ export interface LibraryItem {
46
46
  description: string;
47
47
  owned: boolean;
48
48
  status: AttentionStatus;
49
- /** Folder group from the KB path, or null when the item is in none. */
50
- group: string | null;
49
+ /** Folder plugin from the KB path, or null when the item is in none. */
50
+ plugin: string | null;
51
51
  /** Repo-root-relative path — the skill's folder, or the `.tool` file. */
52
52
  path: string;
53
53
  /**
@@ -77,41 +77,41 @@ export interface LibraryItem {
77
77
  export interface LibraryContextValue extends LibraryData {
78
78
  items: LibraryItem[];
79
79
  /** `[]` until loaded, and on error. */
80
- groupSummaries: GroupSummary[];
81
- groupsLoading: boolean;
82
- groupsError: string | null;
83
- reloadGroups(): void;
80
+ pluginSummaries: PluginSummary[];
81
+ pluginsLoading: boolean;
82
+ pluginsError: string | null;
83
+ reloadPlugins(): void;
84
84
  }
85
85
 
86
86
 
87
87
  export function LibraryProvider({ children }: { children: ReactNode }) {
88
88
  const data = useLibraryData();
89
- const [groupSummaries, setGroupSummaries] = useState<GroupSummary[]>([]);
90
- const [groupsLoading, setGroupsLoading] = useState(true);
91
- const [groupsError, setGroupsError] = useState<string | null>(null);
92
- const [groupsRevision, setGroupsRevision] = useState(0);
89
+ const [pluginSummaries, setPluginSummaries] = useState<PluginSummary[]>([]);
90
+ const [pluginsLoading, setPluginsLoading] = useState(true);
91
+ const [pluginsError, setPluginsError] = useState<string | null>(null);
92
+ const [pluginsRevision, setPluginsRevision] = useState(0);
93
93
 
94
94
  useEffect(() => {
95
95
  let cancelled = false;
96
- listGroups()
97
- .then((groups) => {
96
+ listPlugins()
97
+ .then((plugins) => {
98
98
  if (cancelled) return;
99
- setGroupSummaries(groups);
100
- setGroupsError(null);
99
+ setPluginSummaries(plugins);
100
+ setPluginsError(null);
101
101
  })
102
102
  .catch((err: unknown) => {
103
103
  if (cancelled) return;
104
104
  // Keep whatever we had: a transient failure on a manual reload should
105
105
  // not blank a list the user is looking at.
106
- setGroupsError(err instanceof Error ? err.message : "Couldn't load groups.");
106
+ setPluginsError(err instanceof Error ? err.message : "Couldn't load plugins.");
107
107
  })
108
108
  .finally(() => {
109
- if (!cancelled) setGroupsLoading(false);
109
+ if (!cancelled) setPluginsLoading(false);
110
110
  });
111
111
  return () => {
112
112
  cancelled = true;
113
113
  };
114
- }, [groupsRevision]);
114
+ }, [pluginsRevision]);
115
115
 
116
116
  const items: LibraryItem[] = useMemo(() => {
117
117
  const skillItems: LibraryItem[] = data.skills.map((s) => ({
@@ -120,7 +120,7 @@ export function LibraryProvider({ children }: { children: ReactNode }) {
120
120
  name: s.name,
121
121
  description: s.description,
122
122
  owned: data.ownedSkills.has(s.name),
123
- group: displayGroupOf(s.path),
123
+ plugin: displayPluginOf(s.path),
124
124
  path: s.path,
125
125
  version: s.version,
126
126
  status: skillStatus(
@@ -130,13 +130,13 @@ export function LibraryProvider({ children }: { children: ReactNode }) {
130
130
  /**
131
131
  * Proposed skills, alongside the released ones rather than in a pile of
132
132
  * their own. The question "is this skill available?" is asked in the same
133
- * place as "does this group have one?", and a separate shelf answers the
133
+ * place as "does this plugin have one?", and a separate shelf answers the
134
134
  * second while hiding the first — which is exactly the failure this fixes:
135
135
  * a skill an agent proposed was nowhere at all until it merged.
136
136
  *
137
137
  * `status` is the neutral `ok`: a proposal has no integrations resolved
138
138
  * against it, and reporting `warn` would put it in the setup filter and the
139
- * group's amber count as though something were broken.
139
+ * plugin's amber count as though something were broken.
140
140
  */
141
141
  const pendingItems: LibraryItem[] = data.pendingSkills.map((s) => ({
142
142
  kind: 'skill',
@@ -144,7 +144,7 @@ export function LibraryProvider({ children }: { children: ReactNode }) {
144
144
  name: s.name,
145
145
  description: s.description,
146
146
  owned: false,
147
- group: displayGroupOf(s.path),
147
+ plugin: displayPluginOf(s.path),
148
148
  path: s.path,
149
149
  version: s.version,
150
150
  status: { state: 'ok', text: 'In review' },
@@ -163,7 +163,7 @@ export function LibraryProvider({ children }: { children: ReactNode }) {
163
163
  // manual yet (see report) — the card stays clean; detail lives behind it.
164
164
  description: '',
165
165
  owned: t.canWrite,
166
- group: displayGroupOf(t.path),
166
+ plugin: displayPluginOf(t.path),
167
167
  path: t.path,
168
168
  status: toolStatus(t),
169
169
  }));
@@ -180,21 +180,21 @@ export function LibraryProvider({ children }: { children: ReactNode }) {
180
180
  // already covers the first load, and flipping it from the event that asked
181
181
  // for the refetch keeps the effect body free of synchronous setState (which
182
182
  // costs a cascading render on every revision).
183
- const reloadGroups = useCallback(() => {
184
- setGroupsLoading(true);
185
- setGroupsRevision((r) => r + 1);
183
+ const reloadPlugins = useCallback(() => {
184
+ setPluginsLoading(true);
185
+ setPluginsRevision((r) => r + 1);
186
186
  }, []);
187
187
 
188
188
  const value = useMemo(
189
189
  (): LibraryContextValue => ({
190
190
  ...data,
191
191
  items,
192
- groupSummaries,
193
- groupsLoading,
194
- groupsError,
195
- reloadGroups,
192
+ pluginSummaries,
193
+ pluginsLoading,
194
+ pluginsError,
195
+ reloadPlugins,
196
196
  }),
197
- [data, items, groupSummaries, groupsLoading, groupsError, reloadGroups],
197
+ [data, items, pluginSummaries, pluginsLoading, pluginsError, reloadPlugins],
198
198
  );
199
199
 
200
200
  return <LibraryContext.Provider value={value}>{children}</LibraryContext.Provider>;
@@ -207,8 +207,29 @@ export function useLibrary(): LibraryContextValue {
207
207
  }
208
208
 
209
209
  /**
210
- * How many of a group's integrations need setup — the amber count on the
211
- * sidebar row and the group page's banner, computed from one place so the two
210
+ * "This workspace holds no plugins at all" — settled, and from both witnesses.
211
+ *
212
+ * One predicate for every surface that offers to create the FIRST plugin (the
213
+ * nav's spelled-out row, the index's CTA), so the two cannot drift into
214
+ * disagreeing about whether a workspace is untouched. Deliberately false while
215
+ * either source is still loading or has failed: an unanswered question is not
216
+ * "no plugins", and a first-plugin doorway shown on a guess points somebody at
217
+ * a decision that may already be taken.
218
+ */
219
+ export function workspaceHasNoPlugins(lib: LibraryContextValue): boolean {
220
+ return (
221
+ !lib.loading &&
222
+ !lib.pluginsLoading &&
223
+ !lib.error &&
224
+ !lib.pluginsError &&
225
+ lib.pluginSummaries.length === 0 &&
226
+ lib.items.every((item) => item.plugin === null)
227
+ );
228
+ }
229
+
230
+ /**
231
+ * How many of a plugin's integrations need setup — the amber count on the
232
+ * sidebar row and the plugin page's banner, computed from one place so the two
212
233
  * can never disagree.
213
234
  *
214
235
  * Only integrations count. A skill that reports `warn` is warning about the
@@ -216,8 +237,8 @@ export function useLibrary(): LibraryContextValue {
216
237
  * broken connection; pending change requests are a review concern, not a setup
217
238
  * one, and belong to a different surface.
218
239
  */
219
- export function attentionOf(items: LibraryItem[], group: string): number {
240
+ export function attentionOf(items: LibraryItem[], plugin: string): number {
220
241
  return items.filter(
221
- (i) => i.group === group && i.kind === 'integration' && i.status.state !== 'ok',
242
+ (i) => i.plugin === plugin && i.kind === 'integration' && i.status.state !== 'ok',
222
243
  ).length;
223
244
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Rendering people's names the way a person says them.
3
3
  *
4
- * Shared by the locked-group view (its request toast) and the owner-side
4
+ * Shared by the locked-plugin view (its request toast) and the owner-side
5
5
  * access-requests banner: both list requesters, and two copies of this drifted
6
6
  * into place once already.
7
7
  */
@@ -2,19 +2,19 @@
2
2
  * The name of a person's own space — the prototype's `MINE()` (line 2078),
3
3
  * which reads `me().name.split(' ')[0] + "'s List"`.
4
4
  *
5
- * It is called a GROUP here rather than a list because that is what it now is:
6
- * the same page, the same sections, the same card grid as `Groups/Engineering`.
5
+ * It is called a PLUGIN here rather than a list because that is what it now is:
6
+ * the same page, the same sections, the same card grid as `Plugins/Engineering`.
7
7
  * The only difference is which items it holds, and that is a query, not a kind.
8
8
  *
9
- * First name only, deliberately. "Juan's Group" is what a colleague would call
10
- * it out loud; "Juan Viera's Group" is what a directory would call it.
9
+ * First name only, deliberately. "Juan's Plugin" is what a colleague would call
10
+ * it out loud; "Juan Viera's Plugin" is what a directory would call it.
11
11
  */
12
- export function personalGroupName(displayName: string | null | undefined): string {
12
+ export function personalPluginName(displayName: string | null | undefined): string {
13
13
  const first = displayFirstName(displayName);
14
14
  // Nobody signed in, or a user record with no name: the space still exists and
15
15
  // still needs a heading, and "Yours" is true for whoever is reading it.
16
16
  if (!first) return 'Yours';
17
- return `${first}'s Group`;
17
+ return `${first}'s Plugin`;
18
18
  }
19
19
 
20
20
  /**
@@ -23,11 +23,11 @@ export function personalGroupName(displayName: string | null | undefined): strin
23
23
  * Sign-in records are not a style guide — an account created from a lowercase
24
24
  * email or a hastily typed name should still be greeted the way a person
25
25
  * writes their own name. The capital belongs HERE rather than at each call
26
- * site, so the welcome page and the group heading cannot disagree about how
26
+ * site, so the welcome page and the plugin heading cannot disagree about how
27
27
  * to spell the same person.
28
28
  *
29
29
  * Empty when there is no name to work with, and each caller picks its own
30
- * fallback: the group heading says "Yours", the welcome page says "there".
30
+ * fallback: the plugin heading says "Yours", the welcome page says "there".
31
31
  */
32
32
  export function displayFirstName(displayName: string | null | undefined): string {
33
33
  const first = (displayName ?? '').trim().split(/\s+/)[0] ?? '';
@@ -1,7 +1,7 @@
1
- import type { GroupPrincipals, GroupSummary } from '../services/groups.api';
1
+ import type { PluginPrincipals, PluginSummary } from '../services/plugins.api';
2
2
 
3
3
  /**
4
- * How a group describes its membership in prose.
4
+ * How a plugin describes its membership in prose.
5
5
  *
6
6
  * Membership is displayed as ACCESS-RULE PRINCIPALS — the roles and people
7
7
  * `access.md` names — and never as a head-count of who can read the folder.
@@ -9,7 +9,7 @@ import type { GroupPrincipals, GroupSummary } from '../services/groups.api';
9
9
  *
10
10
  * 1. Expanding a role to its people needs the roster endpoint, which is
11
11
  * admin-gated. A per-person list would render for admins and vanish for
12
- * everyone else, so the same group would describe itself differently
12
+ * everyone else, so the same plugin would describe itself differently
13
13
  * depending on who asked.
14
14
  * 2. Resolution is closeness-first with per-file overrides, so "who can read
15
15
  * this folder" is not well-defined AT folder granularity. A person list
@@ -21,25 +21,25 @@ import type { GroupPrincipals, GroupSummary } from '../services/groups.api';
21
21
  */
22
22
 
23
23
  /** Names as written, users before roles — the order the run-by line reads in. */
24
- function usersThenRoles(p: GroupPrincipals): string[] {
24
+ function usersThenRoles(p: PluginPrincipals): string[] {
25
25
  return [...p.users.map((u) => u.name), ...p.roles].filter((s) => s.length > 0);
26
26
  }
27
27
 
28
28
  /** Roles before people — the order a share list reads in. */
29
- function rolesThenUsers(p: GroupPrincipals): string[] {
29
+ function rolesThenUsers(p: PluginPrincipals): string[] {
30
30
  return [...p.roles, ...p.users.map((u) => u.name)].filter((s) => s.length > 0);
31
31
  }
32
32
 
33
33
  /**
34
- * Who runs the group: owners, falling back to writers, falling back to the
34
+ * Who runs the plugin: owners, falling back to writers, falling back to the
35
35
  * admins.
36
36
  *
37
37
  * The writer fallback is not a guess — owner ⊂ writer, and "who runs it" is
38
38
  * really "who can change it". The final fallback is a fact rather than a
39
39
  * placeholder: admin-rescue guarantees a platform Admin can always write an
40
- * `access.md`, so a group with no named principals genuinely is run by them.
40
+ * `access.md`, so a plugin with no named principals genuinely is run by them.
41
41
  */
42
- export function ownersTextOf(summary: Pick<GroupSummary, 'owners' | 'writers'>): string {
42
+ export function ownersTextOf(summary: Pick<PluginSummary, 'owners' | 'writers'>): string {
43
43
  const owners = usersThenRoles(summary.owners);
44
44
  if (owners.length > 0) return owners.join(', ');
45
45
  const writers = usersThenRoles(summary.writers);
@@ -48,13 +48,13 @@ export function ownersTextOf(summary: Pick<GroupSummary, 'owners' | 'writers'>):
48
48
  }
49
49
 
50
50
  /**
51
- * Who the group is shared with, or `null` when there is nothing honest to say
52
- * — either the reader list was withheld (the caller cannot read the group, and
53
- * a locked group never advertises its share list) or it resolved empty.
51
+ * Who the plugin is shared with, or `null` when there is nothing honest to say
52
+ * — either the reader list was withheld (the caller cannot read the plugin, and
53
+ * a locked plugin never advertises its share list) or it resolved empty.
54
54
  * Callers drop the whole `· shared with …` clause on null rather than printing
55
55
  * a dangling half-sentence.
56
56
  */
57
- export function readersTextOf(summary: Pick<GroupSummary, 'readers'>): string | null {
57
+ export function readersTextOf(summary: Pick<PluginSummary, 'readers'>): string | null {
58
58
  const readers = summary.readers;
59
59
  if (!readers) return null;
60
60
  if (!readers.restricted) return 'everyone here';
@@ -62,7 +62,7 @@ export function readersTextOf(summary: Pick<GroupSummary, 'readers'>): string |
62
62
  return named.length > 0 ? named.join(', ') : null;
63
63
  }
64
64
 
65
- /** The folder a group's writes and links point at — its single `Groups/<G>` folder. */
66
- export function primaryFolderOf(summary: Pick<GroupSummary, 'folders'>): string | null {
65
+ /** The folder a plugin's writes and links point at — its single `Plugins/<G>` folder. */
66
+ export function primaryFolderOf(summary: Pick<PluginSummary, 'folders'>): string | null {
67
67
  return summary.folders[0] ?? null;
68
68
  }
@@ -116,15 +116,15 @@ export function skillStatus(neededTools: ToolSecrets[]): AttentionStatus {
116
116
  * What the sidebar has selected.
117
117
  *
118
118
  * Note there is no 'skills' / 'integrations' member. The design does not split
119
- * the catalog by kind: a group owns its skills AND the tools those skills need,
120
- * so filtering to "just tools" would show a group's integrations detached from
119
+ * the catalog by kind: a plugin owns its skills AND the tools those skills need,
120
+ * so filtering to "just tools" would show a plugin's integrations detached from
121
121
  * the reason any of them are there. Kind is a property of a card, not a view.
122
122
  */
123
123
  export type LibraryFilter =
124
124
  | { kind: 'all' }
125
125
  | { kind: 'owned' }
126
- | { kind: 'group'; group: string }
127
- /** Owned by someone, in no group — the prototype calls these "yours alone". */
126
+ | { kind: 'group'; plugin: string }
127
+ /** Owned by someone, in no plugin — the prototype calls these "yours alone". */
128
128
  | { kind: 'ungrouped' };
129
129
 
130
130
  /**
@@ -150,8 +150,8 @@ export interface LibraryFilterable {
150
150
  name: string;
151
151
  description: string;
152
152
  owned: boolean;
153
- /** Folder group from the item's KB path, or null when it sits in none. */
154
- group: string | null;
153
+ /** Folder plugin from the item's KB path, or null when it sits in none. */
154
+ plugin: string | null;
155
155
  }
156
156
 
157
157
  /** Sidebar selection narrows; the query matches name/description within it. */
@@ -171,29 +171,29 @@ export function filterLibraryItems<T extends LibraryFilterable>(
171
171
  case 'owned':
172
172
  return item.owned;
173
173
  case 'group':
174
- return item.group === filter.group;
174
+ return item.plugin === filter.plugin;
175
175
  case 'ungrouped':
176
- return item.group === null;
176
+ return item.plugin === null;
177
177
  }
178
178
  });
179
179
  }
180
180
 
181
181
  /**
182
- * Group names present in the catalog, with how many items each holds.
182
+ * Plugin names present in the catalog, with how many items each holds.
183
183
  *
184
184
  * Sorted by name rather than by count so the sidebar does not reorder itself
185
- * when a group gains an item — a nav that moves under the pointer is worse
186
- * than one that buries the biggest group in the middle.
185
+ * when a plugin gains an item — a nav that moves under the pointer is worse
186
+ * than one that buries the biggest plugin in the middle.
187
187
  */
188
- export function groupCounts<T extends LibraryFilterable>(
188
+ export function pluginCounts<T extends LibraryFilterable>(
189
189
  items: T[],
190
- ): { group: string; count: number }[] {
190
+ ): { plugin: string; count: number }[] {
191
191
  const counts = new Map<string, number>();
192
192
  for (const item of items) {
193
- if (item.group === null) continue;
194
- counts.set(item.group, (counts.get(item.group) ?? 0) + 1);
193
+ if (item.plugin === null) continue;
194
+ counts.set(item.plugin, (counts.get(item.plugin) ?? 0) + 1);
195
195
  }
196
196
  return [...counts.entries()]
197
- .map(([group, count]) => ({ group, count }))
198
- .sort((a, b) => a.group.localeCompare(b.group));
197
+ .map(([plugin, count]) => ({ plugin, count }))
198
+ .sort((a, b) => a.plugin.localeCompare(b.plugin));
199
199
  }