@bevel-software/platform-core-frontend 0.7.5 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -202
- package/THIRD-PARTY-NOTICES.md +344 -988
- package/package.json +5 -5
- package/src/core/CoreAppShell.tsx +4 -4
- package/src/core/__tests__/ShellRoutes.test.tsx +1 -1
- package/src/core/__tests__/bootstrap.test.ts +47 -2
- package/src/core/bootstrap.ts +20 -0
- package/src/core/registry.ts +16 -4
- package/src/css-side-effect-imports.d.ts +7 -7
- package/src/modules/access/__tests__/ManageAccessDialog.placement.test.tsx +1 -1
- package/src/modules/access/__tests__/ManageAccessDialog.test.tsx +5 -5
- package/src/modules/access/api.ts +5 -5
- package/src/modules/access/components/ManageAccessDialog.tsx +21 -20
- package/src/modules/admin/__tests__/AdminRolesPage.suggest.test.tsx +1 -1
- package/src/modules/admin/components/AdminRolesPage.tsx +1 -1
- package/src/modules/admin/state/admin.context.tsx +15 -0
- package/src/modules/change-requests/__tests__/useFileOnBranch.test.tsx +2 -2
- package/src/modules/change-requests/components/ChangeRequestDialog.tsx +1 -1
- package/src/modules/change-requests/hooks/useApplyChangeRequest.ts +1 -1
- package/src/modules/layout/__tests__/SidebarFrameResponsive.test.tsx +4 -4
- package/src/modules/layout/__tests__/SidebarToggle.test.tsx +4 -4
- package/src/modules/layout/__tests__/breakpoints.test.ts +1 -1
- package/src/modules/layout/components/SidebarFrame.tsx +2 -2
- package/src/modules/library/__tests__/{AddToGroupDialog.test.tsx → AddToPluginDialog.test.tsx} +34 -34
- package/src/modules/library/__tests__/LibraryCard.test.tsx +30 -11
- package/src/modules/library/__tests__/LibraryRoutes.test.tsx +84 -59
- package/src/modules/library/__tests__/LibrarySidebarMenu.test.tsx +51 -51
- package/src/modules/library/__tests__/{LockedGroupView.test.tsx → LockedPluginView.test.tsx} +33 -33
- package/src/modules/library/__tests__/McpServerSection.test.tsx +138 -0
- package/src/modules/library/__tests__/{NewGroupDialog.test.tsx → NewPluginDialog.test.tsx} +22 -22
- package/src/modules/library/__tests__/PersonalAddDialog.test.tsx +7 -7
- package/src/modules/library/__tests__/PluginExtras.test.tsx +131 -0
- package/src/modules/library/__tests__/{GroupJoinRequests.test.tsx → PluginJoinRequests.test.tsx} +24 -24
- package/src/modules/library/__tests__/{GroupPage.test.tsx → PluginPage.test.tsx} +197 -106
- package/src/modules/library/__tests__/PluginsIndexPage.test.tsx +363 -0
- package/src/modules/library/__tests__/{GroupsSidebar.contextmenu.test.tsx → PluginsSidebar.contextmenu.test.tsx} +32 -31
- package/src/modules/library/__tests__/{GroupsSidebar.locked.test.tsx → PluginsSidebar.locked.test.tsx} +29 -28
- package/src/modules/library/__tests__/PluginsSidebar.test.tsx +171 -0
- package/src/modules/library/__tests__/{GroupsSidebarMenu.test.tsx → PluginsSidebarMenu.test.tsx} +18 -18
- package/src/modules/library/__tests__/SkillPage.test.tsx +8 -8
- package/src/modules/library/__tests__/ToolConnectionSection.test.tsx +2 -2
- package/src/modules/library/__tests__/ToolPage.test.tsx +41 -12
- package/src/modules/library/__tests__/ToolSharePanel.test.tsx +1 -1
- package/src/modules/library/__tests__/WorkspaceItemRoute.test.tsx +57 -57
- package/src/modules/library/__tests__/auth-harness.tsx +4 -4
- package/src/modules/library/__tests__/library-data.test.ts +82 -0
- package/src/modules/library/__tests__/status.test.ts +19 -19
- package/src/modules/library/__tests__/tools.api.test.ts +70 -0
- package/src/modules/library/__tests__/useToolPage.test.tsx +4 -4
- package/src/modules/library/components/AccessRequestsBanner.tsx +8 -8
- package/src/modules/library/components/{AddToGroupDialog.tsx → AddToPluginDialog.tsx} +11 -11
- package/src/modules/library/components/ChangeRequestDock.tsx +1 -1
- package/src/modules/library/components/{DeleteGroupDialog.tsx → DeletePluginDialog.tsx} +9 -9
- package/src/modules/library/components/LibraryCard.tsx +26 -2
- package/src/modules/library/components/LibraryLayout.tsx +80 -71
- package/src/modules/library/components/LibraryPage.tsx +8 -8
- package/src/modules/library/components/LockGlyph.tsx +1 -1
- package/src/modules/library/components/{LockedGroupView.tsx → LockedPluginView.tsx} +35 -35
- package/src/modules/library/components/{ManagedGroupRequests.tsx → ManagedPluginRequests.tsx} +13 -13
- package/src/modules/library/components/{NewGroupDialog.tsx → NewPluginDialog.tsx} +24 -24
- package/src/modules/library/components/NewSkillPanel.tsx +23 -5
- package/src/modules/library/components/PageActions.tsx +34 -11
- package/src/modules/library/components/PersonalAddDialog.tsx +5 -5
- package/src/modules/library/components/{PersonalGroupPage.tsx → PersonalPluginPage.tsx} +29 -19
- package/src/modules/library/components/PluginExtras.tsx +195 -0
- package/src/modules/library/components/{GroupIndexRow.tsx → PluginIndexRow.tsx} +6 -6
- package/src/modules/library/components/PluginJoinRequests.tsx +77 -0
- package/src/modules/library/components/{GroupPage.tsx → PluginPage.tsx} +112 -72
- package/src/modules/library/components/{GroupsIndexPage.tsx → PluginsIndexPage.tsx} +91 -48
- package/src/modules/library/components/{GroupsSidebar.tsx → PluginsSidebar.tsx} +105 -55
- package/src/modules/library/components/{GroupsSidebarMenu.tsx → PluginsSidebarMenu.tsx} +15 -15
- package/src/modules/library/components/{group-page-parts.tsx → plugin-page-parts.tsx} +218 -27
- package/src/modules/library/components/skill-page/SkillPage.tsx +12 -12
- package/src/modules/library/components/tool-page/McpServerSection.tsx +380 -0
- package/src/modules/library/components/tool-page/ToolPage.tsx +22 -5
- package/src/modules/library/hooks/useJoinRequests.ts +8 -8
- package/src/modules/library/routes/LibraryRoutes.tsx +32 -19
- package/src/modules/library/routes/WorkspaceItemRoute.tsx +24 -24
- package/src/modules/library/routes/library-paths.ts +36 -36
- package/src/modules/library/services/library.api.ts +9 -9
- package/src/modules/library/services/{groups.api.ts → plugins.api.ts} +43 -43
- package/src/modules/library/services/tools.api.ts +54 -0
- package/src/modules/library/state/library-data.tsx +67 -46
- package/src/modules/library/utils/names.ts +1 -1
- package/src/modules/library/utils/{personal-group.ts → personal-plugin.ts} +8 -8
- package/src/modules/library/utils/{group-summary.ts → plugin-summary.ts} +14 -14
- package/src/modules/library/utils/status.ts +17 -17
- package/src/modules/onboarding/__tests__/creator-welcome.test.tsx +318 -0
- package/src/modules/onboarding/__tests__/onboarding.test.tsx +86 -8
- package/src/modules/onboarding/agent-clients.ts +18 -14
- package/src/modules/onboarding/components/CreatorWelcomePage.tsx +143 -0
- package/src/modules/onboarding/components/WelcomePage.tsx +30 -22
- package/src/modules/onboarding/components/WelcomeRoute.tsx +57 -0
- package/src/modules/onboarding/welcome-state.ts +36 -0
- package/src/modules/review/components/MarkdownDiffViewer.tsx +1 -1
- package/src/modules/review/components/ReviewPanel.tsx +11 -11
- package/src/modules/review/components/__tests__/{isGroupItemPath.test.ts → isPluginItemPath.test.ts} +24 -24
- package/src/modules/secrets-vault/components/ToolSecretsPanel.tsx +3 -3
- package/src/modules/secrets-vault/components/__tests__/SecretsPage.test.tsx +1 -1
- package/src/modules/settings/components/SettingsLayout.tsx +1 -1
- package/src/modules/settings/components/SettingsNav.tsx +5 -5
- package/src/modules/setup/__tests__/setup.test.tsx +203 -0
- package/src/modules/setup/components/SetupScreen.tsx +235 -68
- package/src/modules/toolbar/components/ExternalAgentAccessPage.tsx +29 -107
- package/src/modules/toolbar/components/__tests__/AppSwitcher.test.tsx +1 -1
- package/src/modules/toolbar/components/__tests__/ExternalAgentAccessPage.test.tsx +228 -0
- package/src/modules/toolbar/components/__tests__/Toolbar.test.tsx +3 -3
- package/src/modules/workspace/components/FileExplorer.tsx +12 -12
- package/src/modules/workspace/components/FileRoute.tsx +8 -1
- package/src/modules/workspace/components/FileViewer.tsx +95 -38
- package/src/modules/workspace/components/__tests__/FileExplorer.test.tsx +14 -14
- package/src/modules/workspace/components/__tests__/FileRoute.test.tsx +20 -0
- package/src/modules/workspace/components/__tests__/FileViewer.test.tsx +227 -18
- package/src/modules/workspace/components/renderers/ToolRenderer.tsx +7 -2
- package/src/modules/workspace/routing/__tests__/kb-routes.test.tsx +25 -0
- package/src/modules/workspace/routing/kb-routes.ts +23 -1
- package/src/modules/workspace/utils/__tests__/diff.test.ts +1 -1
- package/src/modules/workspace/utils/fileTree.ts +54 -3
- package/src/shared/components/Surface.tsx +15 -0
- package/src/shared/mcp/ClaudeInstallLink.tsx +88 -0
- package/src/shared/mcp/ConnectionInstructions.tsx +51 -0
- package/src/shared/mcp/CopyBlock.tsx +42 -0
- package/src/shared/mcp/__tests__/ClaudeInstallLink.test.tsx +40 -0
- package/src/shared/mcp/__tests__/connect-snippets.test.ts +431 -0
- package/src/shared/mcp/__tests__/useCopyFeedback.test.ts +112 -0
- package/src/shared/mcp/connect-snippets.ts +353 -0
- package/src/shared/mcp/index.ts +28 -0
- package/src/shared/mcp/useCopyFeedback.ts +46 -0
- package/src/test-setup.ts +11 -0
- package/src/modules/library/__tests__/GroupsIndexPage.test.tsx +0 -283
- package/src/modules/library/__tests__/GroupsSidebar.test.tsx +0 -142
- package/src/modules/library/components/GroupJoinRequests.tsx +0 -56
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { useState, type ReactNode } from 'react';
|
|
1
|
+
import { useId, useState, type ReactNode } from 'react';
|
|
2
2
|
import { Link } from 'react-router-dom';
|
|
3
3
|
import { Funnel, RotateCw, Trash2 } from 'lucide-react';
|
|
4
|
+
import { useAdmin } from '../../admin/state/admin.context';
|
|
4
5
|
import { cn } from '../../../lib/utils';
|
|
5
6
|
import { Banner, Button, Dialog, IconButton } from '../../../shared/components';
|
|
6
|
-
import {
|
|
7
|
+
import { pathForPluginsIndex } from '../routes/library-paths';
|
|
7
8
|
import type { LibraryItem } from '../state/library-data';
|
|
8
9
|
import { removeLibraryItem } from '../services/library.api';
|
|
9
10
|
import { LibraryCard } from './LibraryCard';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
|
-
* The furniture a
|
|
13
|
+
* The furniture a plugin page is made of, shared by the two pages that are one.
|
|
13
14
|
*
|
|
14
|
-
* `
|
|
15
|
+
* `PluginPage` (a folder in the KB) and `PersonalPluginPage` (the items in no
|
|
15
16
|
* folder at all) are different QUERIES over the same catalog, and the user
|
|
16
17
|
* asked for the second to look like the first. Shared components rather than a
|
|
17
|
-
* copy: a
|
|
18
|
+
* copy: a plugin page is a promise about layout, and two implementations of one
|
|
18
19
|
* promise drift the first time either is touched.
|
|
19
20
|
*/
|
|
20
21
|
|
|
21
|
-
/** `All
|
|
22
|
-
export function
|
|
22
|
+
/** `All plugins › {name}` — the page's place in the Library, and the way back. */
|
|
23
|
+
export function PluginBreadcrumb({ name }: { name: string }) {
|
|
23
24
|
return (
|
|
24
25
|
<nav aria-label="Breadcrumb" className="flex items-center gap-1.5 text-detail text-ink-faint">
|
|
25
|
-
<Link to={
|
|
26
|
-
All
|
|
26
|
+
<Link to={pathForPluginsIndex()} className="rounded-xs hover:text-ink">
|
|
27
|
+
All plugins
|
|
27
28
|
</Link>
|
|
28
29
|
<span aria-hidden="true">›</span>
|
|
29
30
|
<span aria-current="page" className="truncate text-ink-muted">
|
|
@@ -50,7 +51,7 @@ export function GroupBreadcrumb({ name }: { name: string }) {
|
|
|
50
51
|
* switched on has to stay lit — a filter you cannot see is a page lying about
|
|
51
52
|
* what it is showing — so `controlsActive` lifts the whole wrapper instead.
|
|
52
53
|
*/
|
|
53
|
-
export function
|
|
54
|
+
export function PluginSection({
|
|
54
55
|
title,
|
|
55
56
|
count,
|
|
56
57
|
controls,
|
|
@@ -100,7 +101,7 @@ export function GroupSection({
|
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
/**
|
|
103
|
-
* The auto-filling card track a
|
|
104
|
+
* The auto-filling card track a plugin's contents sit in.
|
|
104
105
|
*
|
|
105
106
|
* The track floor is `min(236px, 100%)` rather than a flat 236px so a
|
|
106
107
|
* container narrower than one card still gets a single column that fits,
|
|
@@ -130,14 +131,25 @@ export function CardGrid({
|
|
|
130
131
|
>
|
|
131
132
|
{items.map((item) => {
|
|
132
133
|
// The change-request number is part of the key, not decoration: two
|
|
133
|
-
// people can propose a skill of the same name into different
|
|
134
|
+
// people can propose a skill of the same name into different plugins,
|
|
134
135
|
// and until one of them merges neither is in the catalog to collide
|
|
135
136
|
// with — so the name alone is not yet unique.
|
|
136
137
|
const key = `${item.kind}:${item.id}:${item.pending?.changeRequestNumber ?? ''}`;
|
|
138
|
+
// The flavor badge names the DECLARATION file — which file an owner
|
|
139
|
+
// edits — not the transport: a `.tool` manual whose call template is
|
|
140
|
+
// `type: mcp` still edits as a UTCP manual, so the path suffix is the
|
|
141
|
+
// authoritative signal, not the tool's `type` metadata.
|
|
142
|
+
const kindProps =
|
|
143
|
+
item.kind === 'integration'
|
|
144
|
+
? ({
|
|
145
|
+
kind: 'integration',
|
|
146
|
+
flavor: item.path.endsWith('/mcp.json') ? 'mcp' : 'utcp',
|
|
147
|
+
} as const)
|
|
148
|
+
: ({ kind: 'skill' } as const);
|
|
137
149
|
const card = (
|
|
138
150
|
<LibraryCard
|
|
139
151
|
key={key}
|
|
140
|
-
|
|
152
|
+
{...kindProps}
|
|
141
153
|
id={item.id}
|
|
142
154
|
name={item.name}
|
|
143
155
|
description={item.description}
|
|
@@ -185,7 +197,7 @@ export function CardGrid({
|
|
|
185
197
|
|
|
186
198
|
/**
|
|
187
199
|
* The "are you sure" a removal deserves: deleting a skill or tool from a
|
|
188
|
-
*
|
|
200
|
+
* plugin takes it from EVERYONE in the plugin, not from a personal shelf, and
|
|
189
201
|
* there is no undo shortcut — the content survives only in git history.
|
|
190
202
|
*/
|
|
191
203
|
export function RemoveLibraryItemDialog({
|
|
@@ -195,7 +207,7 @@ export function RemoveLibraryItemDialog({
|
|
|
195
207
|
onRemoved,
|
|
196
208
|
}: {
|
|
197
209
|
item: LibraryItem;
|
|
198
|
-
/** Where it is being removed from, for the copy: a
|
|
210
|
+
/** Where it is being removed from, for the copy: a plugin name, or "your space". */
|
|
199
211
|
place: string;
|
|
200
212
|
onClose(): void;
|
|
201
213
|
/** Fired after the delete lands; the host page reloads and says so. */
|
|
@@ -255,11 +267,11 @@ export function RemoveLibraryItemDialog({
|
|
|
255
267
|
/**
|
|
256
268
|
* The Skills and Tools bands, in that order, with their empty states.
|
|
257
269
|
*
|
|
258
|
-
* The empty copy differs per page (a
|
|
270
|
+
* The empty copy differs per page (a plugin can be filled by an agent; your own
|
|
259
271
|
* space is filled by you), so it arrives as props rather than being derived
|
|
260
272
|
* from a name here.
|
|
261
273
|
*/
|
|
262
|
-
export function
|
|
274
|
+
export function PluginItemSections({
|
|
263
275
|
skillItems,
|
|
264
276
|
toolItems,
|
|
265
277
|
onOpen,
|
|
@@ -275,7 +287,13 @@ export function GroupItemSections({
|
|
|
275
287
|
onOpen(item: LibraryItem): void;
|
|
276
288
|
/** See {@link CardGrid} — present only when the caller manages this place. */
|
|
277
289
|
onRemove?(item: LibraryItem): void;
|
|
278
|
-
|
|
290
|
+
/**
|
|
291
|
+
* A plain sentence, or an `EmptySkillsNudge`. A string still gets the band's
|
|
292
|
+
* standard paragraph; a node is trusted to bring its own — the nudge carries
|
|
293
|
+
* an absolutely-placed arrow, and wrapping it in a second `<p>` would nest
|
|
294
|
+
* flow content inside phrasing content.
|
|
295
|
+
*/
|
|
296
|
+
emptySkills: ReactNode;
|
|
279
297
|
emptyTools?: string;
|
|
280
298
|
/**
|
|
281
299
|
* Filter / refresh for the Skills band only. Tools deliberately gets none
|
|
@@ -284,13 +302,13 @@ export function GroupItemSections({
|
|
|
284
302
|
* already show.
|
|
285
303
|
*/
|
|
286
304
|
skillControls?: ReactNode;
|
|
287
|
-
/** One of `skillControls` is mid-act — keep the row visible. See `
|
|
305
|
+
/** One of `skillControls` is mid-act — keep the row visible. See `PluginSection`. */
|
|
288
306
|
skillControlsActive?: boolean;
|
|
289
307
|
/**
|
|
290
308
|
* Drop a band with nothing in it instead of showing its empty state.
|
|
291
309
|
*
|
|
292
|
-
* A
|
|
293
|
-
*
|
|
310
|
+
* A PLUGIN says "No skills yet" because the absence is a fact about that
|
|
311
|
+
* plugin and an invitation to fix it. A SEARCH RESULT says nothing, because
|
|
294
312
|
* "No tools yet" under a query for `rfi` is not a fact about your library.
|
|
295
313
|
*/
|
|
296
314
|
hideEmpty?: boolean;
|
|
@@ -298,28 +316,32 @@ export function GroupItemSections({
|
|
|
298
316
|
return (
|
|
299
317
|
<>
|
|
300
318
|
{!(hideEmpty && skillItems.length === 0) && (
|
|
301
|
-
<
|
|
319
|
+
<PluginSection
|
|
302
320
|
title="Skills"
|
|
303
321
|
count={skillItems.length}
|
|
304
322
|
controls={skillControls}
|
|
305
323
|
controlsActive={skillControlsActive}
|
|
306
324
|
>
|
|
307
325
|
{skillItems.length === 0 ? (
|
|
308
|
-
|
|
326
|
+
typeof emptySkills === 'string' ? (
|
|
327
|
+
<p className="text-ui text-ink-faint">{emptySkills}</p>
|
|
328
|
+
) : (
|
|
329
|
+
emptySkills
|
|
330
|
+
)
|
|
309
331
|
) : (
|
|
310
332
|
<CardGrid items={skillItems} onOpen={onOpen} onRemove={onRemove} />
|
|
311
333
|
)}
|
|
312
|
-
</
|
|
334
|
+
</PluginSection>
|
|
313
335
|
)}
|
|
314
336
|
|
|
315
337
|
{!(hideEmpty && toolItems.length === 0) && (
|
|
316
|
-
<
|
|
338
|
+
<PluginSection title="Tools" count={toolItems.length}>
|
|
317
339
|
{toolItems.length === 0 ? (
|
|
318
340
|
<p className="text-ui text-ink-faint">{emptyTools}</p>
|
|
319
341
|
) : (
|
|
320
342
|
<CardGrid items={toolItems} onOpen={onOpen} onRemove={onRemove} />
|
|
321
343
|
)}
|
|
322
|
-
</
|
|
344
|
+
</PluginSection>
|
|
323
345
|
)}
|
|
324
346
|
</>
|
|
325
347
|
);
|
|
@@ -334,6 +356,175 @@ export function PageNote({ children }: { children: ReactNode }) {
|
|
|
334
356
|
return <div className="py-16 text-center text-ui text-ink-faint">{children}</div>;
|
|
335
357
|
}
|
|
336
358
|
|
|
359
|
+
/**
|
|
360
|
+
* A hand-drawn arrow, chalk on the wall — the mark an empty page makes toward
|
|
361
|
+
* the control that fills it. Decorative on purpose: the sentence beside it
|
|
362
|
+
* carries the meaning, so the drawing is `aria-hidden`, takes no pointer, and
|
|
363
|
+
* inherits `currentColor` so it stays as faint as the ink around it.
|
|
364
|
+
*/
|
|
365
|
+
export function ChalkArrow({ className }: { className?: string }) {
|
|
366
|
+
// Colons stripped: `url(#…)` fragment references are unreliable with them.
|
|
367
|
+
const filterId = `chalk-${useId().replace(/[^a-zA-Z0-9_-]/g, '')}`;
|
|
368
|
+
return (
|
|
369
|
+
<svg
|
|
370
|
+
data-testid="chalk-arrow"
|
|
371
|
+
className={className}
|
|
372
|
+
aria-hidden="true"
|
|
373
|
+
focusable="false"
|
|
374
|
+
viewBox="0 0 88 72"
|
|
375
|
+
fill="none"
|
|
376
|
+
stroke="currentColor"
|
|
377
|
+
strokeLinecap="round"
|
|
378
|
+
strokeLinejoin="round"
|
|
379
|
+
>
|
|
380
|
+
<defs>
|
|
381
|
+
{/* What makes the line chalk instead of vector: a slow noise bends the
|
|
382
|
+
stroke the way a hand does, a fine noise frays its edge the way a
|
|
383
|
+
wall's tooth does, and a mid noise thins the ink where the chalk
|
|
384
|
+
skipped. Displacement can push ~2px past the paths, hence the
|
|
385
|
+
widened filter region. */}
|
|
386
|
+
<filter id={filterId} x="-15%" y="-15%" width="130%" height="130%">
|
|
387
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.04" numOctaves="1" seed="3" result="wobble" />
|
|
388
|
+
<feDisplacementMap in="SourceGraphic" in2="wobble" scale="2.5" result="bent" />
|
|
389
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="2" seed="11" result="grit" />
|
|
390
|
+
<feDisplacementMap in="bent" in2="grit" scale="1.4" result="rough" />
|
|
391
|
+
<feTurbulence type="fractalNoise" baseFrequency="0.3" numOctaves="3" seed="5" result="dust" />
|
|
392
|
+
<feColorMatrix
|
|
393
|
+
in="dust"
|
|
394
|
+
type="matrix"
|
|
395
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.7 0.55"
|
|
396
|
+
result="patch"
|
|
397
|
+
/>
|
|
398
|
+
<feComposite in="rough" in2="patch" operator="in" />
|
|
399
|
+
</filter>
|
|
400
|
+
</defs>
|
|
401
|
+
<g filter={`url(#${filterId})`}>
|
|
402
|
+
{/* One loose curve from the words up toward the `+` — tip stays at
|
|
403
|
+
(76,11), which is what the call sites' offsets aim — plus a short
|
|
404
|
+
second pass beside the shaft, the stroke a hand goes over twice. */}
|
|
405
|
+
<path strokeWidth="2.5" d="M6 66 C 30 63, 53 51, 67 32 C 71 26, 74 19, 76 11" />
|
|
406
|
+
<path strokeWidth="1.5" opacity="0.5" d="M17 64 C 34 61, 49 52.5, 61 40" />
|
|
407
|
+
{/* The head as two separate flicks, not a joined V: drawn strokes
|
|
408
|
+
land past each other at the tip, they do not meet in a corner. */}
|
|
409
|
+
<path strokeWidth="2.5" d="M64 18 Q 70.5 14, 76.4 10.6" />
|
|
410
|
+
<path strokeWidth="2.5" d="M79.6 24.6 Q 78.1 17.5, 76 10.7" />
|
|
411
|
+
</g>
|
|
412
|
+
</svg>
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* The inline verb inside an empty state's sentence — underlined, ink-strong
|
|
418
|
+
* against the faint prose around it, and a real `<button>` because it acts
|
|
419
|
+
* rather than navigates. One component so every empty state's doorway looks
|
|
420
|
+
* like the same kind of doorway.
|
|
421
|
+
*/
|
|
422
|
+
export function EmptyStateAction({
|
|
423
|
+
children,
|
|
424
|
+
onClick,
|
|
425
|
+
}: {
|
|
426
|
+
children: ReactNode;
|
|
427
|
+
onClick(): void;
|
|
428
|
+
}) {
|
|
429
|
+
return (
|
|
430
|
+
<button
|
|
431
|
+
type="button"
|
|
432
|
+
onClick={onClick}
|
|
433
|
+
// The same focus ring as `Button`/`IconButton`: an inline action is
|
|
434
|
+
// still a stop on the keyboard's path, and the underline alone does not
|
|
435
|
+
// say "you are here".
|
|
436
|
+
className="rounded-xs font-semibold text-ink underline underline-offset-2 hover:text-ink-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ink-muted"
|
|
437
|
+
>
|
|
438
|
+
{children}
|
|
439
|
+
</button>
|
|
440
|
+
);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Where the nudge's arrow sits so its TIP lands on the `+` icon-button's
|
|
445
|
+
* centre: from the column's right edge that centre sits behind the `⋯` button
|
|
446
|
+
* and two flex gaps (~54px), constant on every page that renders
|
|
447
|
+
* `PageActions` — Share sits on the far side of `+`, so its presence moves
|
|
448
|
+
* nothing.
|
|
449
|
+
*
|
|
450
|
+
* A named constant because these offsets are TUNED, together with the tip the
|
|
451
|
+
* `ChalkArrow` paths aim at (76,11 in its 88×72 viewBox): change the
|
|
452
|
+
* `PageActions` row — button size, gap, order — and this is the one place the
|
|
453
|
+
* aim gets re-tuned, rather than a magic literal scattered per call site.
|
|
454
|
+
*/
|
|
455
|
+
const ARROW_AT_PAGE_ACTIONS_PLUS =
|
|
456
|
+
'pointer-events-none absolute -top-[74px] right-[45px] h-[68px] w-[84px] text-ink-faint';
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* The empty Skills band as a doorway instead of a dead end. The sentence
|
|
460
|
+
* names the fact and hands over a button that DOES the thing — the same thing
|
|
461
|
+
* the title row's `+` does — while a chalk arrow points up at that `+`, so
|
|
462
|
+
* the page itself teaches where "add" lives. No separate tour, no overlay:
|
|
463
|
+
* the arrow exists only because this component only renders when the band is
|
|
464
|
+
* empty, and it leaves the moment the first skill arrives.
|
|
465
|
+
*
|
|
466
|
+
* The arrow overlaps the band heading on its way up. That is intended — it is
|
|
467
|
+
* background, not layout: absolutely placed, `pointer-events-none`, and faint
|
|
468
|
+
* enough to read as a margin note rather than a fourth piece of chrome.
|
|
469
|
+
*/
|
|
470
|
+
export function EmptySkillsNudge({
|
|
471
|
+
lead,
|
|
472
|
+
actionLabel,
|
|
473
|
+
tail,
|
|
474
|
+
agentOnly,
|
|
475
|
+
arrow = true,
|
|
476
|
+
onAction,
|
|
477
|
+
}: {
|
|
478
|
+
/** The fact: "No skills yet." */
|
|
479
|
+
lead: string;
|
|
480
|
+
/** The doorway's words, e.g. "Add the first skill". */
|
|
481
|
+
actionLabel: string;
|
|
482
|
+
/** The rest of the sentence — usually pointing at the agent as the other door. */
|
|
483
|
+
tail: string;
|
|
484
|
+
/**
|
|
485
|
+
* The whole sentence a non-admin reads instead — same fact, agent door only.
|
|
486
|
+
* Written out rather than assembled from `lead` + `tail`, because `tail` is
|
|
487
|
+
* a continuation (", or ask your agent…") and cannot stand on its own.
|
|
488
|
+
*/
|
|
489
|
+
agentOnly: string;
|
|
490
|
+
/**
|
|
491
|
+
* Whether the chalk arrow may be drawn. The arrow's aim is a fixed offset
|
|
492
|
+
* from THIS component to the title row's `+`, so it only tells the truth
|
|
493
|
+
* when nothing sits between them — a page that knows a banner intervenes
|
|
494
|
+
* (join requests, integration attention) passes false and keeps the
|
|
495
|
+
* sentence, which needs no geometry to be right.
|
|
496
|
+
*/
|
|
497
|
+
arrow?: boolean;
|
|
498
|
+
/** Exactly what the title row's `+` does. One intent, two doors. */
|
|
499
|
+
onAction(): void;
|
|
500
|
+
}) {
|
|
501
|
+
const { isAdmin, isAdminLoading = false } = useAdmin();
|
|
502
|
+
|
|
503
|
+
// While the admin verdict is still in flight, say only the fact. Committing
|
|
504
|
+
// to either door — the inline action or "ask your agent" — would flip the
|
|
505
|
+
// sentence (and the arrow) in front of the reader the moment the verdict
|
|
506
|
+
// lands, and the fact is the one part that is true either way.
|
|
507
|
+
if (isAdminLoading) return <p className="text-ui text-ink-faint">{lead}</p>;
|
|
508
|
+
|
|
509
|
+
// Starting a skill in place is an administrator's affordance — the add
|
|
510
|
+
// dialogs already refuse the empty-file half to everyone else. So the
|
|
511
|
+
// doorway, link and chalk arrow both, is admin-only. The band still states
|
|
512
|
+
// the fact and names the agent, which IS the door a non-admin has: the
|
|
513
|
+
// title row's `+` stays where it was for them, just without a mark
|
|
514
|
+
// pointing at it.
|
|
515
|
+
if (!isAdmin) return <p className="text-ui text-ink-faint">{agentOnly}</p>;
|
|
516
|
+
|
|
517
|
+
return (
|
|
518
|
+
<div className="relative">
|
|
519
|
+
{arrow && <ChalkArrow className={ARROW_AT_PAGE_ACTIONS_PLUS} />}
|
|
520
|
+
<p className="text-ui text-ink-faint">
|
|
521
|
+
{lead} <EmptyStateAction onClick={onAction}>{actionLabel}</EmptyStateAction>
|
|
522
|
+
{tail}
|
|
523
|
+
</p>
|
|
524
|
+
</div>
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
|
|
337
528
|
/**
|
|
338
529
|
* Three nodes and the lines between them — the prototype's `SHARE_SVG`
|
|
339
530
|
* (line 1640), unchanged. Inline for the same reason as `LockGlyph`: it
|
|
@@ -363,7 +554,7 @@ export function ShareGlyph({ className }: { className?: string }) {
|
|
|
363
554
|
*
|
|
364
555
|
* `filter` narrows the band to the items waiting on you, and it STAYS LIT when
|
|
365
556
|
* on — a filter you cannot see is a page lying about what it is showing. The
|
|
366
|
-
* opting-out is `
|
|
557
|
+
* opting-out is `PluginSection`'s `controlsActive`, because that is the element
|
|
367
558
|
* carrying the fade; an `opacity-100` on the button inside it would multiply
|
|
368
559
|
* against the wrapper's zero and do nothing.
|
|
369
560
|
*
|
|
@@ -2,7 +2,7 @@ import { useCallback, useEffect, useId, useMemo, useState, type ReactNode } from
|
|
|
2
2
|
import { useLocation, useNavigate, useParams } from 'react-router-dom';
|
|
3
3
|
import {
|
|
4
4
|
DEFAULT_BRANCH,
|
|
5
|
-
|
|
5
|
+
pluginOfPath,
|
|
6
6
|
type PullRequestSummary,
|
|
7
7
|
} from '@bevel-software/platform-shared';
|
|
8
8
|
import '../../library.css';
|
|
@@ -22,7 +22,7 @@ import { useLibrary } from '../../state/library-data';
|
|
|
22
22
|
import { useLibraryToast } from '../../state/toast.context';
|
|
23
23
|
import { libraryHomeForItemPath, urlForSkillFile } from '../../routes/library-paths';
|
|
24
24
|
import { changeAuthorName, formatWhen } from '../../../change-requests/utils/author';
|
|
25
|
-
import { ownersTextOf } from '../../utils/
|
|
25
|
+
import { ownersTextOf } from '../../utils/plugin-summary';
|
|
26
26
|
import { neededToolsFor, toolStatus } from '../../utils/status';
|
|
27
27
|
import { StatusDot } from '../StatusDot';
|
|
28
28
|
import { ChangeRequestDock } from '../ChangeRequestDock';
|
|
@@ -107,16 +107,16 @@ export function SkillPage({
|
|
|
107
107
|
const prefix = `${skillPath}/`;
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
|
-
* Who has to say yes. A skill has no owner of its own — it inherits its
|
|
110
|
+
* Who has to say yes. A skill has no owner of its own — it inherits its plugin
|
|
111
111
|
* folder's `access.md` — so the people who review a change to it are the
|
|
112
|
-
*
|
|
113
|
-
* the neutral fallback when the
|
|
112
|
+
* plugin's owners. Naming the wrong reviewer is worse than naming none, hence
|
|
113
|
+
* the neutral fallback when the plugin index hasn't resolved.
|
|
114
114
|
*/
|
|
115
115
|
const ownerName = useMemo(() => {
|
|
116
|
-
const
|
|
117
|
-
const summary =
|
|
116
|
+
const plugin = skill ? pluginOfPath(skill.path) : null;
|
|
117
|
+
const summary = plugin ? data.pluginSummaries.find((g) => g.name === plugin) : undefined;
|
|
118
118
|
return summary ? ownersTextOf(summary) : 'the owner';
|
|
119
|
-
}, [skill, data.
|
|
119
|
+
}, [skill, data.pluginSummaries]);
|
|
120
120
|
|
|
121
121
|
const files = useMemo(
|
|
122
122
|
() => ['SKILL.md', ...(skill?.files ?? []).map((f) => f.slice(prefix.length))],
|
|
@@ -377,7 +377,7 @@ export function SkillPage({
|
|
|
377
377
|
}
|
|
378
378
|
|
|
379
379
|
// The page the skill lives on, not the Library root: "back" from a skill
|
|
380
|
-
// you opened off its
|
|
380
|
+
// you opened off its plugin page must land on that plugin page. Derived from
|
|
381
381
|
// the path, so a deep link gets the same honest destination as a click.
|
|
382
382
|
const home = libraryHomeForItemPath(skillPath);
|
|
383
383
|
const backLink = (
|
|
@@ -391,7 +391,7 @@ export function SkillPage({
|
|
|
391
391
|
// just mean we asked with the wrong name. Only the catalog can correct that,
|
|
392
392
|
// and only a SUCCESSFUL catalog response counts — `loading: false` also
|
|
393
393
|
// describes a catalog that failed, which is "we couldn't ask", not "there is
|
|
394
|
-
// no such skill". The same distinction
|
|
394
|
+
// no such skill". The same distinction PluginPage draws a few files over.
|
|
395
395
|
//
|
|
396
396
|
// A confirmed name (the catalog resolved this URL to it) is unaffected: its
|
|
397
397
|
// detail error is real and gets reported immediately.
|
|
@@ -451,8 +451,8 @@ export function SkillPage({
|
|
|
451
451
|
and its frontmatter panel already says what the skill is for.
|
|
452
452
|
Repeating it above the pane said the same sentence twice on the
|
|
453
453
|
first screenful. */}
|
|
454
|
-
{/* No `Manage access` here, deliberately — a skill inherits its
|
|
455
|
-
folder's `access.md`, and the
|
|
454
|
+
{/* No `Manage access` here, deliberately — a skill inherits its plugin
|
|
455
|
+
folder's `access.md`, and the plugin's Share panel is the one place
|
|
456
456
|
those rules are decided. Same call the tool page made. */}
|
|
457
457
|
</header>
|
|
458
458
|
|