@bevel-software/platform-core-frontend 0.32.0 → 0.33.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/package.json +2 -2
- package/src/core/CoreAppShell.tsx +1 -1
- package/src/modules/access/api.ts +1 -1
- package/src/modules/access/components/ManageAccessDialog.tsx +4 -5
- package/src/modules/access/hooks/useAccessRequests.ts +1 -1
- package/src/modules/access/hooks/useFileAccess.ts +1 -1
- package/src/modules/access/index.ts +11 -0
- package/src/modules/access/requests.api.ts +1 -1
- package/src/modules/admin/components/AddMemberInput.tsx +1 -1
- package/src/modules/admin/components/UserAccountsPage.tsx +3 -3
- package/src/modules/admin/index.ts +7 -0
- package/src/modules/admin/state/admin.context.tsx +1 -1
- package/src/modules/audit/components/AuditEventsPanel.tsx +1 -1
- package/src/modules/audit/components/AuditLogPage.tsx +2 -2
- package/src/modules/auth/index.ts +12 -0
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.access-rules.test.tsx +0 -1
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.binary.test.tsx +0 -1
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.brings-itself-up-to-date.test.tsx +0 -1
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.edit.test.tsx +166 -0
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.fork-point.test.tsx +0 -1
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.initial-file.test.tsx +0 -1
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.moved.test.tsx +0 -1
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.sync-banner.test.tsx +0 -1
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.test.tsx +0 -2
- package/src/modules/change-requests/__tests__/ChangeRequestDialog.unreadable.test.tsx +0 -1
- package/src/modules/change-requests/__tests__/apply-outcome-for-every-viewer.test.tsx +0 -1
- package/src/modules/change-requests/components/BranchFilePreview.tsx +4 -12
- package/src/modules/change-requests/components/ChangeRequestDialog.tsx +138 -30
- package/src/modules/change-requests/components/ChangeRequestLink.tsx +2 -3
- package/src/modules/change-requests/components/CrFileTree.tsx +1 -1
- package/src/modules/change-requests/components/FileChangeBoxes.tsx +2 -3
- package/src/modules/change-requests/hooks/useApplyChangeRequest.ts +3 -5
- package/src/modules/change-requests/hooks/useCrFileDiffs.ts +1 -1
- package/src/modules/change-requests/index.ts +14 -0
- package/src/modules/change-requests/services/change-requests.api.ts +2 -2
- package/src/modules/change-requests/services/denied-file.api.ts +2 -2
- package/src/modules/change-requests/services/propose.api.ts +3 -4
- package/src/modules/change-requests/utils/diff.ts +1 -1
- package/src/modules/change-requests/utils/readFailure.ts +1 -1
- package/src/modules/embed/__tests__/EmbedView.test.tsx +19 -2
- package/src/modules/embed/components/EmbedLinkPage.tsx +1 -2
- package/src/modules/git/components/BranchSwitcher.tsx +3 -4
- package/src/modules/git/components/FileHistoryPanel.tsx +2 -2
- package/src/modules/git/components/GitSyncFailedBanner.tsx +2 -4
- package/src/modules/git/components/HistoryVersionPreview.tsx +4 -15
- package/src/modules/git/components/PullNeededBanner.tsx +1 -1
- package/src/modules/git/hooks/useAutoPullUpdates.ts +1 -1
- package/src/modules/git/index.ts +11 -0
- package/src/modules/layout/components/MobileChatLayout.tsx +1 -1
- package/src/modules/layout/index.ts +9 -0
- package/src/modules/library/__tests__/SkillPage.test.tsx +39 -0
- package/src/modules/library/__tests__/propose-change.test.ts +75 -0
- package/src/modules/library/components/AddToPluginDialog.tsx +1 -1
- package/src/modules/library/components/ChangeRequestDock.tsx +1 -1
- package/src/modules/library/components/LibraryLayout.tsx +2 -2
- package/src/modules/library/components/LibraryPage.tsx +3 -3
- package/src/modules/library/components/ManagedPluginRequests.tsx +1 -1
- package/src/modules/library/components/NewSkillPanel.tsx +2 -2
- package/src/modules/library/components/PersonalAddDialog.tsx +1 -1
- package/src/modules/library/components/PersonalPluginPage.tsx +1 -1
- package/src/modules/library/components/PluginExtras.tsx +1 -4
- package/src/modules/library/components/PluginPage.tsx +1 -1
- package/src/modules/library/components/PluginRows.tsx +1 -1
- package/src/modules/library/components/SkillsTree.tsx +1 -4
- package/src/modules/library/components/plugin-page-parts.tsx +1 -1
- package/src/modules/library/components/skill-page/SkillFilePane.tsx +19 -7
- package/src/modules/library/components/skill-page/SkillPage.tsx +19 -26
- package/src/modules/library/components/tool-page/ToolConnectionSection.tsx +2 -4
- package/src/modules/library/components/tool-page/ToolVarRow.tsx +2 -2
- package/src/modules/library/hooks/useJoinRequests.ts +1 -1
- package/src/modules/library/hooks/useLibraryData.ts +3 -3
- package/src/modules/library/hooks/useToolPage.ts +1 -1
- package/src/modules/library/hooks/useToolSource.ts +1 -1
- package/src/modules/library/index.ts +12 -0
- package/src/modules/library/routes/LibraryRoutes.tsx +1 -1
- package/src/modules/library/routes/WorkspaceItemRoute.tsx +1 -3
- package/src/modules/library/routes/library-paths.ts +1 -1
- package/src/modules/library/services/library.api.ts +10 -8
- package/src/modules/library/services/plugins.api.ts +1 -1
- package/src/modules/library/services/teams.api.ts +1 -1
- package/src/modules/library/utils/status.ts +2 -2
- package/src/modules/onboarding/components/ConnectAgentPill.tsx +1 -1
- package/src/modules/onboarding/components/CreatorWelcomePage.tsx +2 -3
- package/src/modules/onboarding/components/GetStartedColumn.tsx +6 -13
- package/src/modules/onboarding/components/InviteButton.tsx +2 -2
- package/src/modules/onboarding/components/InviteDialog.tsx +4 -6
- package/src/modules/onboarding/components/RootLanding.tsx +2 -2
- package/src/modules/onboarding/components/StarterPackCard.tsx +1 -1
- package/src/modules/onboarding/components/WelcomePage.tsx +2 -5
- package/src/modules/onboarding/index.ts +10 -0
- package/src/modules/onboarding/paths.ts +1 -1
- package/src/modules/onboarding/state/agent-connection.ts +2 -2
- package/src/modules/onboarding/state/onboarding.ts +1 -1
- package/src/modules/onboarding/state/starter-packs.ts +1 -1
- package/src/modules/pr/components/OpenChangeRequestDialog.tsx +1 -1
- package/src/modules/pr/index.ts +14 -0
- package/src/modules/pr/services/pr-approvals.api.ts +1 -1
- package/src/modules/pr/services/pr-cancel.api.ts +1 -1
- package/src/modules/pr/services/pr-detail.api.ts +2 -2
- package/src/modules/pr/services/pr-edit.api.ts +22 -0
- package/src/modules/pr/services/pr-merge.api.ts +1 -1
- package/src/modules/pr/services/pr-open.api.ts +1 -1
- package/src/modules/review/components/DiffViewer.tsx +1 -1
- package/src/modules/review/components/MarkdownDiffViewer.tsx +1 -2
- package/src/modules/review/components/ReviewPanel.tsx +2 -3
- package/src/modules/review/state/ReviewProvider.tsx +2 -2
- package/src/modules/secrets-vault/index.ts +6 -0
- package/src/modules/settings/components/DeploymentPage.tsx +2 -2
- package/src/modules/settings/components/SettingsLayout.tsx +2 -2
- package/src/modules/settings/index.ts +8 -0
- package/src/modules/setup/components/FirstRunStorage.tsx +1 -1
- package/src/modules/setup/index.ts +6 -0
- package/src/modules/toolbar/commands/actions.tsx +3 -3
- package/src/modules/toolbar/commands/useCommandActions.ts +5 -9
- package/src/modules/toolbar/components/AgentInstructionsCard.tsx +2 -2
- package/src/modules/toolbar/components/AppSwitcher.tsx +1 -2
- package/src/modules/toolbar/components/CoworkSetupSteps.tsx +1 -1
- package/src/modules/toolbar/components/ExternalAgentAccessPage.tsx +1 -1
- package/src/modules/toolbar/components/ProfileMenu.tsx +3 -3
- package/src/modules/toolbar/components/SearchPalette.tsx +4 -8
- package/src/modules/toolbar/components/Toolbar.tsx +2 -5
- package/src/modules/toolbar/index.ts +6 -0
- package/src/modules/toolbar/search/sources.ts +4 -7
- package/src/modules/toolbar/services/agent-instructions.api.ts +1 -1
- package/src/modules/tools/ToolsExplorerPage.tsx +217 -18
- package/src/modules/tools/__tests__/ToolsExplorerPage.read-only.test.tsx +220 -0
- package/src/modules/tools/tool-hints.api.ts +44 -0
- package/src/modules/workflow/index.ts +7 -0
- package/src/modules/workflow/state/ChangeRequestStaleBinder.tsx +1 -0
- package/src/modules/workflow/state/EventBusFocusBinder.tsx +1 -1
- package/src/modules/workspace/components/FileExplorer.tsx +35 -8
- package/src/modules/workspace/components/FilePaneCard.tsx +37 -12
- package/src/modules/workspace/components/FileRoute.tsx +10 -3
- package/src/modules/workspace/components/FileViewer.tsx +169 -25
- package/src/modules/workspace/components/FullScreenView.tsx +93 -0
- package/src/modules/workspace/components/KbFileRail.tsx +1 -1
- package/src/modules/workspace/components/KbPageHeader.tsx +9 -0
- package/src/modules/workspace/components/__tests__/FileExplorer.test.tsx +137 -0
- package/src/modules/workspace/components/__tests__/FileRoute.test.tsx +11 -0
- package/src/modules/workspace/components/__tests__/FileViewer.test.tsx +487 -3
- package/src/modules/workspace/components/readingCarry.ts +59 -0
- package/src/modules/workspace/components/renderers/HtmlRenderer.tsx +36 -175
- package/src/modules/workspace/components/renderers/ToolRenderer.tsx +1 -1
- package/src/modules/workspace/components/renderers/__tests__/HtmlRenderer.tools.test.tsx +168 -42
- package/src/modules/workspace/components/renderers/__tests__/bridgeHarness.ts +20 -3
- package/src/modules/workspace/components/renderers/__tests__/htmlSandbox.test.ts +63 -4
- package/src/modules/workspace/components/renderers/__tests__/htmlToolBridge.test.ts +235 -1
- package/src/modules/workspace/components/renderers/__tests__/htmlViewsGuide.test.ts +14 -3
- package/src/modules/workspace/components/renderers/__tests__/pageToolsHarness.ts +79 -0
- package/src/modules/workspace/components/renderers/__tests__/useHtmlToolBridge.test.tsx +316 -0
- package/src/modules/workspace/components/renderers/htmlSandbox.ts +75 -13
- package/src/modules/workspace/components/renderers/htmlToolBridge.ts +196 -25
- package/src/modules/workspace/components/renderers/index.ts +10 -0
- package/src/modules/workspace/components/renderers/useHtmlToolBridge.tsx +253 -0
- package/src/modules/workspace/hooks/useFullScreenView.ts +52 -0
- package/src/modules/workspace/hooks/useImageRevision.ts +1 -1
- package/src/modules/workspace/hooks/useKnowledgeWriteTarget.ts +1 -1
- package/src/modules/workspace/hooks/useLastCommit.ts +1 -1
- package/src/modules/workspace/hooks/useWorkspaceState.ts +4 -4
- package/src/modules/workspace/index.ts +30 -1
- package/src/modules/workspace/routing/kb-routes.ts +1 -1
- package/src/modules/workspace/state/__tests__/applied-request-clears-pending.test.tsx +0 -1
- package/src/modules/workspace/state/open-change-requests.tsx +1 -1
- package/src/modules/workspace/utils/frameEscape.ts +15 -0
- package/src/modules/workspace/utils/treeConfirm.ts +1 -1
- package/src/shared/theme/measure.ts +7 -0
- package/src/modules/pr/services/pr-comments.api.ts +0 -45
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
+
import type { PullRequestSummary } from '@bevel-software/platform-shared';
|
|
3
|
+
|
|
4
|
+
// `proposeChange`'s collaborators, mocked at the module boundary: what is
|
|
5
|
+
// pinned here is which change-request write each round makes.
|
|
6
|
+
vi.mock('../../git/services/git.api', () => ({
|
|
7
|
+
createBranch: vi.fn(),
|
|
8
|
+
handleApiResponse: vi.fn(),
|
|
9
|
+
}));
|
|
10
|
+
vi.mock('../../workspace/services/workspace.api', () => ({
|
|
11
|
+
getOrCreateWorkspace: vi.fn(),
|
|
12
|
+
writeFile: vi.fn(),
|
|
13
|
+
deleteFile: vi.fn(),
|
|
14
|
+
}));
|
|
15
|
+
vi.mock('../../pr/services/pr-open.api', () => ({ openChangeRequest: vi.fn() }));
|
|
16
|
+
vi.mock('../../pr/services/pr-edit.api', () => ({ updateChangeRequest: vi.fn() }));
|
|
17
|
+
vi.mock('../services/plugins.api', () => ({ ensurePersonalPlugin: vi.fn() }));
|
|
18
|
+
|
|
19
|
+
import { proposeChange } from '../services/library.api';
|
|
20
|
+
import { createBranch } from '../../git/services/git.api';
|
|
21
|
+
import { getOrCreateWorkspace, writeFile } from '../../workspace/services/workspace.api';
|
|
22
|
+
import { openChangeRequest } from '../../pr/services/pr-open.api';
|
|
23
|
+
import { updateChangeRequest } from '../../pr/services/pr-edit.api';
|
|
24
|
+
|
|
25
|
+
const existingCr = { number: 42, branch: 'suggestions/alice/deploy' } as PullRequestSummary;
|
|
26
|
+
|
|
27
|
+
const base = {
|
|
28
|
+
skillName: 'deploy',
|
|
29
|
+
repoRelativePath: 'Skills/deploy/SKILL.md',
|
|
30
|
+
content: 'new text',
|
|
31
|
+
userEmail: 'alice@example.com',
|
|
32
|
+
userName: 'Alice',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
describe('proposeChange', () => {
|
|
36
|
+
beforeEach(() => {
|
|
37
|
+
vi.clearAllMocks();
|
|
38
|
+
vi.mocked(getOrCreateWorkspace).mockResolvedValue({
|
|
39
|
+
workspace: { id: 'ws-branch', kbDirName: 'kb' },
|
|
40
|
+
} as Awaited<ReturnType<typeof getOrCreateWorkspace>>);
|
|
41
|
+
vi.mocked(writeFile).mockResolvedValue({} as Awaited<ReturnType<typeof writeFile>>);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("a later round's note is APPENDED to the open request's description, never a replacement", async () => {
|
|
45
|
+
const result = await proposeChange({ ...base, existingCr, note: 'Also fix the example.' });
|
|
46
|
+
|
|
47
|
+
expect(updateChangeRequest).toHaveBeenCalledTimes(1);
|
|
48
|
+
expect(updateChangeRequest).toHaveBeenCalledWith(42, { appendDescription: 'Also fix the example.' });
|
|
49
|
+
// The append is the whole edit: no title, no full description to overwrite
|
|
50
|
+
// a note or edit that landed meanwhile.
|
|
51
|
+
expect(vi.mocked(updateChangeRequest).mock.calls[0][1]).not.toHaveProperty('description');
|
|
52
|
+
expect(openChangeRequest).not.toHaveBeenCalled();
|
|
53
|
+
expect(createBranch).not.toHaveBeenCalled();
|
|
54
|
+
// The text is committed to the existing request's own branch.
|
|
55
|
+
expect(getOrCreateWorkspace).toHaveBeenCalledWith('suggestions/alice/deploy');
|
|
56
|
+
expect(writeFile).toHaveBeenCalledWith('ws-branch', 'kb/Skills/deploy/SKILL.md', 'new text');
|
|
57
|
+
expect(result.branch).toBe('suggestions/alice/deploy');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('a later round without a note leaves the description alone', async () => {
|
|
61
|
+
await proposeChange({ ...base, existingCr });
|
|
62
|
+
|
|
63
|
+
expect(updateChangeRequest).not.toHaveBeenCalled();
|
|
64
|
+
expect(openChangeRequest).not.toHaveBeenCalled();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("a first round opens a request carrying the note, and edits nothing", async () => {
|
|
68
|
+
await proposeChange({ ...base, existingCr: null, note: 'Why: the old step is wrong.' });
|
|
69
|
+
|
|
70
|
+
expect(openChangeRequest).toHaveBeenCalledWith(
|
|
71
|
+
expect.objectContaining({ description: 'Why: the old step is wrong.' }),
|
|
72
|
+
);
|
|
73
|
+
expect(updateChangeRequest).not.toHaveBeenCalled();
|
|
74
|
+
});
|
|
75
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { Button, Dialog, Surface } from '../../../shared/components';
|
|
3
|
-
import { useAdmin } from '../../admin
|
|
3
|
+
import { useAdmin } from '../../admin';
|
|
4
4
|
import { NewSkillPanel } from './NewSkillPanel';
|
|
5
5
|
import { LinkSkillPanel } from './LinkSkillPanel';
|
|
6
6
|
import { AddDialogTabs, type AddKind } from './AddDialogTabs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PullRequestSummary } from '@bevel-software/platform-shared';
|
|
2
2
|
import { Badge } from '../../../shared/components';
|
|
3
|
-
import { changeAuthorName } from '../../change-requests
|
|
3
|
+
import { changeAuthorName } from '../../change-requests';
|
|
4
4
|
|
|
5
5
|
interface ChangeRequestDockProps {
|
|
6
6
|
crs: PullRequestSummary[];
|
|
@@ -4,7 +4,7 @@ import { isPersonalPluginFolder } from '@bevel-software/platform-shared';
|
|
|
4
4
|
import { cn } from '../../../lib/utils';
|
|
5
5
|
import { DOCUMENT_COLUMN, documentGutters } from '../../../shared/theme/measure';
|
|
6
6
|
import { HEADER_COLUMN_TOP } from '../../../shared/theme/header';
|
|
7
|
-
import { useAdmin } from '../../admin
|
|
7
|
+
import { useAdmin } from '../../admin';
|
|
8
8
|
import { attentionOf, useLibrary, workspaceHasNoPlugins } from '../state/library-data';
|
|
9
9
|
import { personalPluginName } from '../utils/personal-plugin';
|
|
10
10
|
import { CONNECT_TOOLS_PATH, libraryFilterForPath, pathForLibraryFilter } from '../routes/library-paths';
|
|
@@ -13,7 +13,7 @@ import { pathForGroupMembers } from '../../admin/components/group-members-path';
|
|
|
13
13
|
import { ownedLensOf, pluginEntriesFor } from '../utils/plugin-entries';
|
|
14
14
|
import { LINK_COPIED_TOAST, LINK_COPY_FAILED_TOAST, copyToClipboard } from '../utils/clipboard';
|
|
15
15
|
import { useLibraryToast } from '../state/toast.context';
|
|
16
|
-
import { useSidebar } from '../../layout
|
|
16
|
+
import { useSidebar } from '../../layout';
|
|
17
17
|
import { SidebarFrame } from '../../layout/components/SidebarFrame';
|
|
18
18
|
import { ConnectAgentPill } from '../../onboarding/components/ConnectAgentPill';
|
|
19
19
|
import { PullRequestsForMe } from '../../git/components/PullRequestsForMe';
|
|
@@ -4,7 +4,7 @@ import { DEFAULT_BRANCH, type FileTreeEntry } from '@bevel-software/platform-sha
|
|
|
4
4
|
import '../library.css';
|
|
5
5
|
import { useLibrary, type LibraryItem } from '../state/library-data';
|
|
6
6
|
import { urlForLibraryItem } from '../routes/library-paths';
|
|
7
|
-
import { useWorkspace } from '../../workspace
|
|
7
|
+
import { useWorkspace } from '../../workspace';
|
|
8
8
|
import { EVERYONE_TEAM, emptyMessageFor, filterLibraryItems, type LibraryFilter } from '../utils/status';
|
|
9
9
|
import { pluginEntriesFor } from '../utils/plugin-entries';
|
|
10
10
|
import { personalPluginName } from '../utils/personal-plugin';
|
|
@@ -12,8 +12,8 @@ import { Banner, TextField } from '../../../shared/components';
|
|
|
12
12
|
import { cn } from '../../../lib/utils';
|
|
13
13
|
import { HEADER_BAND, PAGE_HEADER_TESTID, TITLE_INK_ROOM } from '../../../shared/theme/header';
|
|
14
14
|
import { ManageAccessDialog } from '../../access/components/ManageAccessDialog';
|
|
15
|
-
import { offersManageAccess } from '../../access
|
|
16
|
-
import { useAdmin } from '../../admin
|
|
15
|
+
import { offersManageAccess } from '../../access';
|
|
16
|
+
import { useAdmin } from '../../admin';
|
|
17
17
|
import { CreatorWelcomePage } from '../../onboarding/components/CreatorWelcomePage';
|
|
18
18
|
import { PluginItemSections } from './plugin-page-parts';
|
|
19
19
|
import { PluginRows } from './PluginRows';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo, useState } from 'react';
|
|
2
2
|
import { useLibrary } from '../state/library-data';
|
|
3
|
-
import { useWorkspace } from '../../workspace
|
|
3
|
+
import { useWorkspace } from '../../workspace';
|
|
4
4
|
import { ManageAccessDialog } from '../../access/components/ManageAccessDialog';
|
|
5
5
|
import { PluginJoinRequests } from './PluginJoinRequests';
|
|
6
6
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { useNavigate } from 'react-router-dom';
|
|
3
3
|
import { Button, Surface, TextField } from '../../../shared/components';
|
|
4
|
-
import { useAuth } from '../../auth
|
|
4
|
+
import { useAuth } from '../../auth';
|
|
5
5
|
import { DEFAULT_BRANCH } from '@bevel-software/platform-shared';
|
|
6
|
-
import { kbFileUrl } from '../../workspace
|
|
6
|
+
import { kbFileUrl } from '../../workspace';
|
|
7
7
|
import { createEmptySkill } from '../services/library.api';
|
|
8
8
|
import { useLibraryReload } from '../state/library-context';
|
|
9
9
|
import { useLibraryToast } from '../state/toast.context';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { Button, Dialog, Surface } from '../../../shared/components';
|
|
3
|
-
import { useAdmin } from '../../admin
|
|
3
|
+
import { useAdmin } from '../../admin';
|
|
4
4
|
import { NewSkillPanel } from './NewSkillPanel';
|
|
5
5
|
import { AddDialogTabs, type AddKind } from './AddDialogTabs';
|
|
6
6
|
import { useLibraryToast } from '../state/toast.context';
|
|
@@ -5,7 +5,7 @@ import { useNavigate } from 'react-router-dom';
|
|
|
5
5
|
import { useLibrary, type LibraryItem } from '../state/library-data';
|
|
6
6
|
import { useLibraryToast } from '../state/toast.context';
|
|
7
7
|
import { urlForLibraryItem } from '../routes/library-paths';
|
|
8
|
-
import { useWorkspace } from '../../workspace
|
|
8
|
+
import { useWorkspace } from '../../workspace';
|
|
9
9
|
import { personalPluginName } from '../utils/personal-plugin';
|
|
10
10
|
import { EmptySkillsNudge, PluginBreadcrumb, PluginItemSections, PageNote,
|
|
11
11
|
RemoveLibraryItemDialog,
|
|
@@ -4,10 +4,7 @@ import { ChevronRight } from 'lucide-react';
|
|
|
4
4
|
import { DEFAULT_BRANCH, PLUGINS_DIR, PLUGIN_MANIFEST_FILE, type FileTreeEntry } from '@bevel-software/platform-shared';
|
|
5
5
|
import { cn } from '../../../lib/utils';
|
|
6
6
|
import { Button } from '../../../shared/components';
|
|
7
|
-
import { listFiles, readFile } from '../../workspace
|
|
8
|
-
import { useWorkspace } from '../../workspace/state/workspace.context';
|
|
9
|
-
import { checkoutRoot } from '../../workspace/utils/fileTree';
|
|
10
|
-
import { kbFileUrl } from '../../workspace/routing/kb-routes';
|
|
7
|
+
import { listFiles, readFile, useWorkspace, checkoutRoot, kbFileUrl } from '../../workspace';
|
|
11
8
|
|
|
12
9
|
/**
|
|
13
10
|
* The plugin page's two smallest sections, both pure REUSE of the Knowledge
|
|
@@ -19,7 +19,7 @@ import { joinNames } from '../utils/names';
|
|
|
19
19
|
import { repairPluginLinks, type LinkRepairReport, type UnrepairedLink } from '../services/plugins.api';
|
|
20
20
|
import { RenamePluginDialog } from './RenamePluginDialog';
|
|
21
21
|
import { PluginJoinRequests } from './PluginJoinRequests';
|
|
22
|
-
import { useWorkspace } from '../../workspace
|
|
22
|
+
import { useWorkspace } from '../../workspace';
|
|
23
23
|
import { ManifestButton, ClientExtensionsSection, ManifestSection } from './PluginExtras';
|
|
24
24
|
import { ManageAccessDialog } from '../../access/components/ManageAccessDialog';
|
|
25
25
|
import { AddToPluginDialog } from './AddToPluginDialog';
|
|
@@ -2,7 +2,7 @@ import { useState, type ReactNode } from 'react';
|
|
|
2
2
|
import { useNavigate } from 'react-router-dom';
|
|
3
3
|
import { ExternalLink, UserPlus, Users } from 'lucide-react';
|
|
4
4
|
import { Badge, Banner } from '../../../shared/components';
|
|
5
|
-
import { useAdmin } from '../../admin
|
|
5
|
+
import { useAdmin } from '../../admin';
|
|
6
6
|
import { useLibrary, workspaceHasNoPlugins } from '../state/library-data';
|
|
7
7
|
import { LIBRARY_ROOT, pathForPlugin } from '../routes/library-paths';
|
|
8
8
|
import { adminNamesOf, ownersTextOf, primaryFolderOf } from '../utils/plugin-summary';
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { useLocation, useNavigate } from 'react-router-dom';
|
|
3
3
|
import { DEFAULT_BRANCH, PLUGINS_DIR, SKILLS_DIR, type FileTreeEntry } from '@bevel-software/platform-shared';
|
|
4
|
-
import { libraryUploadTarget, useWorkspace } from '../../workspace
|
|
5
|
-
import { checkoutRoot } from '../../workspace/utils/fileTree';
|
|
6
|
-
import { KB_ROUTE_PREFIX, kbFileUrl, safeDecode } from '../../workspace/routing/kb-routes';
|
|
7
|
-
import { useMergedWorkspaceTree } from '../../workspace/hooks/useMergedWorkspaceTree';
|
|
4
|
+
import { libraryUploadTarget, useWorkspace, checkoutRoot, kbFileUrl, KB_ROUTE_PREFIX, safeDecode, useMergedWorkspaceTree } from '../../workspace';
|
|
8
5
|
import { Puzzle } from 'lucide-react';
|
|
9
6
|
import {
|
|
10
7
|
EmptyTreeNotice,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
|
4
|
+
import { useAdmin } from '../../admin';
|
|
5
5
|
import { cn } from '../../../lib/utils';
|
|
6
6
|
import { Banner, Button, Dialog, IconButton } from '../../../shared/components';
|
|
7
7
|
import { pathForPluginsIndex } from '../routes/library-paths';
|
|
@@ -4,8 +4,8 @@ import { FilePaneCard } from '../../../workspace/components/FilePaneCard';
|
|
|
4
4
|
import { KbMarkdownView } from '../../../workspace/components/renderers/KbMarkdownView';
|
|
5
5
|
import type { KbImageResolver } from '../../../workspace/components/renderers/kbMarkdownPipeline';
|
|
6
6
|
import { HtmlRenderer } from '../../../workspace/components/renderers/HtmlRenderer';
|
|
7
|
-
import { OpenPageInPlatformContext } from '../../../workspace';
|
|
8
|
-
import type { DiffLine } from '../../../change-requests
|
|
7
|
+
import { OpenPageInPlatformContext, PageToolsContext } from '../../../workspace';
|
|
8
|
+
import type { DiffLine } from '../../../change-requests';
|
|
9
9
|
|
|
10
10
|
/** The pane never writes — editing goes through the page's Edit / Propose. */
|
|
11
11
|
const NOOP_SAVE = async () => {};
|
|
@@ -33,10 +33,18 @@ interface SkillFilePaneProps {
|
|
|
33
33
|
headingLink?(slug: string): string;
|
|
34
34
|
/** Image source resolver, same contract as `KbMarkdownView`; absent ⇒ plain `<img>` tags. */
|
|
35
35
|
resolveImage?: KbImageResolver;
|
|
36
|
+
/**
|
|
37
|
+
* The file's knowledge-base path (`Skills/review/view.html`) — the path the
|
|
38
|
+
* file page gives the page-tool bridge for the same file. Present, an HTML
|
|
39
|
+
* page here gets the viewer's tools, recorded under this path; absent (the
|
|
40
|
+
* skill's path has not resolved yet), it gets none.
|
|
41
|
+
*/
|
|
42
|
+
pagePath?: string;
|
|
36
43
|
/**
|
|
37
44
|
* Open this file on the app's file page — what an HTML page's "Open in the
|
|
38
45
|
* platform" does here, since `file` is relative to the skill, not a
|
|
39
|
-
* workspace path.
|
|
46
|
+
* workspace path. The renderer offers it only to a page without tools,
|
|
47
|
+
* i.e. while `pagePath` is absent.
|
|
40
48
|
*/
|
|
41
49
|
onOpenInPlatform?(): void;
|
|
42
50
|
}
|
|
@@ -62,6 +70,7 @@ export function SkillFilePane({
|
|
|
62
70
|
onOpenNodeId,
|
|
63
71
|
headingLink,
|
|
64
72
|
resolveImage,
|
|
73
|
+
pagePath,
|
|
65
74
|
onOpenInPlatform,
|
|
66
75
|
}: SkillFilePaneProps) {
|
|
67
76
|
return (
|
|
@@ -89,11 +98,14 @@ export function SkillFilePane({
|
|
|
89
98
|
// skill's bundled template (a deck, a report shell) is meant to be
|
|
90
99
|
// SEEN; the renderer's own Code tab keeps the source one click away.
|
|
91
100
|
// Sized wrapper because the renderer fills its parent, and this card
|
|
92
|
-
// has no height of its own.
|
|
101
|
+
// has no height of its own. The skill page is the platform: the
|
|
102
|
+
// page's `window.bevel.tools` is answered here as on its file page.
|
|
93
103
|
<div className="h-[70vh]">
|
|
94
|
-
<
|
|
95
|
-
<
|
|
96
|
-
|
|
104
|
+
<PageToolsContext.Provider value={pagePath ? { pagePath } : null}>
|
|
105
|
+
<OpenPageInPlatformContext.Provider value={onOpenInPlatform ?? null}>
|
|
106
|
+
<HtmlRenderer content={raw} filePath={file} readOnly onSave={NOOP_SAVE} />
|
|
107
|
+
</OpenPageInPlatformContext.Provider>
|
|
108
|
+
</PageToolsContext.Provider>
|
|
97
109
|
</div>
|
|
98
110
|
) : (
|
|
99
111
|
<pre className="whitespace-pre-wrap break-words font-mono text-detail leading-relaxed text-ink-muted">
|
|
@@ -17,45 +17,34 @@ import {
|
|
|
17
17
|
Surface,
|
|
18
18
|
useFocusHandoff,
|
|
19
19
|
} from '../../../../shared/components';
|
|
20
|
-
import { useAuth } from '../../../auth
|
|
21
|
-
import { useWorkspace } from '../../../workspace
|
|
22
|
-
import { useGit } from '../../../git
|
|
20
|
+
import { useAuth } from '../../../auth';
|
|
21
|
+
import { useWorkspace, kbFileUrl, resolveKbHref, openExternalHref, useNodeIdNav, useWorkspaceImageResolver } from '../../../workspace';
|
|
22
|
+
import { useGit } from '../../../git';
|
|
23
23
|
import { FileHistoryPanel } from '../../../git/components/FileHistoryPanel';
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
resolveKbHref,
|
|
28
|
-
useNodeIdNav,
|
|
29
|
-
} from '../../../workspace/routing/kb-routes';
|
|
30
|
-
import { useWorkspaceImageResolver } from '../../../workspace/hooks/useWorkspaceImageResolver';
|
|
31
|
-
import { cancelPullRequest } from '../../../pr/services/pr-cancel.api';
|
|
32
|
-
import { useFileAccess } from '../../../access/hooks/useFileAccess';
|
|
33
|
-
import { proposeChange, suggestionBranchFor } from '../../services/library.api';
|
|
24
|
+
import { cancelPullRequest } from '../../../pr';
|
|
25
|
+
import { useFileAccess, offersManageAccess } from '../../../access';
|
|
26
|
+
import { proposeChange, suggestionBranchFor, listSkillAccessRequests, reconcileSkillAccessRequest } from '../../services/library.api';
|
|
34
27
|
import {
|
|
35
28
|
getOrCreateWorkspace,
|
|
36
29
|
writeFile,
|
|
37
30
|
type SkillToolWarning,
|
|
38
|
-
} from '../../../workspace
|
|
31
|
+
} from '../../../workspace';
|
|
39
32
|
import { useSkillDetail } from '../../hooks/useSkillDetail';
|
|
40
33
|
import {
|
|
41
34
|
refusalLine,
|
|
42
35
|
useApplyChangeRequest,
|
|
43
|
-
} from '../../../change-requests
|
|
44
|
-
import { useCrFileDiffs } from '../../../change-requests
|
|
45
|
-
import { useDefaultBranchFile, useFileOnBranch } from '../../../change-requests/hooks/useFileOnBranch';
|
|
36
|
+
} from '../../../change-requests';
|
|
37
|
+
import { useCrFileDiffs, useDefaultBranchFile, useFileOnBranch, changeAuthorName, formatWhen, conflictResolutionPrompt } from '../../../change-requests';
|
|
46
38
|
import { useLibrary } from '../../state/library-data';
|
|
47
39
|
import { useLibraryToast } from '../../state/toast.context';
|
|
48
40
|
import { CONNECT_TOOLS_PATH, libraryHomeForItemPath, urlForSkillFile } from '../../routes/library-paths';
|
|
49
|
-
import { changeAuthorName, formatWhen } from '../../../change-requests/utils/author';
|
|
50
41
|
import { ownersTextOf, pluginLabel } from '../../utils/plugin-summary';
|
|
51
42
|
import { neededToolsFor, toolStatus } from '../../utils/status';
|
|
52
43
|
import { StatusDot } from '../StatusDot';
|
|
53
44
|
import { SharedViaPlugins } from './SharedViaPlugins';
|
|
54
45
|
import { AccessRequestsBanner } from '../../../access/components/AccessRequestsBanner';
|
|
55
46
|
import { useJoinRequests, type JoinRequestsApi } from '../../hooks/useJoinRequests';
|
|
56
|
-
import { listSkillAccessRequests, reconcileSkillAccessRequest } from '../../services/library.api';
|
|
57
47
|
import { ManageAccessDialog } from '../../../access/components/ManageAccessDialog';
|
|
58
|
-
import { offersManageAccess } from '../../../access/manage-access-affordance';
|
|
59
48
|
import { ShareButton } from '../ShareButton';
|
|
60
49
|
import { ChangeRequestDock } from '../ChangeRequestDock';
|
|
61
50
|
import { ChangeRequestDialog } from '../../../change-requests/components/ChangeRequestDialog';
|
|
@@ -64,7 +53,6 @@ import { skillPanelId, skillTabId } from './tab-ids';
|
|
|
64
53
|
import { SkillFilePane } from './SkillFilePane';
|
|
65
54
|
import { SkillFileEditor } from './SkillFileEditor';
|
|
66
55
|
import { ChangeBox } from '../../../change-requests/components/ChangeBox';
|
|
67
|
-
import { conflictResolutionPrompt } from '../../../change-requests/utils/conflict';
|
|
68
56
|
import { isBinaryFile } from '../../../workspace/components/renderers';
|
|
69
57
|
|
|
70
58
|
/**
|
|
@@ -853,11 +841,16 @@ export function SkillPage({
|
|
|
853
841
|
// No workspace yet means no base to resolve against: images render
|
|
854
842
|
// as plain tags, exactly as before the resolver existed.
|
|
855
843
|
resolveImage={fileWorkspacePath ? resolveImage : undefined}
|
|
856
|
-
//
|
|
857
|
-
//
|
|
858
|
-
//
|
|
859
|
-
//
|
|
860
|
-
|
|
844
|
+
// The page's tools are answered here, as on its file page, under
|
|
845
|
+
// the path the file page uses for it (repo-relative, kbDirName
|
|
846
|
+
// stripped): one identity per page in the Audit log and the
|
|
847
|
+
// consent card, never the skill-relative tab name.
|
|
848
|
+
pagePath={fileWorkspacePath ? fileRepoPath : undefined}
|
|
849
|
+
// The renderer's own target for Open in the platform, which it
|
|
850
|
+
// offers only to a page mounted without tools. The URL alone would
|
|
851
|
+
// route straight back here (every file under a skill's folder IS
|
|
852
|
+
// the skill page); `rawFile` asks the item route for the file route
|
|
853
|
+
// itself, as the plugin page's file links do.
|
|
861
854
|
onOpenInPlatform={
|
|
862
855
|
fileWorkspacePath
|
|
863
856
|
? () => navigate(kbFileUrl(DEFAULT_BRANCH, fileWorkspacePath), { state: { rawFile: true } })
|
|
@@ -2,10 +2,8 @@ import { Link, useNavigate } from 'react-router-dom';
|
|
|
2
2
|
import { DEFAULT_BRANCH } from '@bevel-software/platform-shared';
|
|
3
3
|
import { Banner, Button, buttonClasses } from '../../../../shared/components';
|
|
4
4
|
import { announceToolCredentialsChanged } from '../../../../core/events';
|
|
5
|
-
import { useWorkspace } from '../../../workspace
|
|
6
|
-
import {
|
|
7
|
-
import { useSavedKeyProbe } from '../../../secrets-vault/probe/useSavedKeyProbe';
|
|
8
|
-
import { type ToolSecrets } from '../../../secrets-vault/services/tool-secrets.api';
|
|
5
|
+
import { useWorkspace, kbFileUrl } from '../../../workspace';
|
|
6
|
+
import { useSavedKeyProbe, type ToolSecrets } from '../../../secrets-vault';
|
|
9
7
|
import { pathForTool } from '../../routes/library-paths';
|
|
10
8
|
import { toolStatus, toolVariableStatuses } from '../../utils/status';
|
|
11
9
|
import { ToolVarRow } from './ToolVarRow';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useState, type ReactNode } from 'react';
|
|
2
2
|
import { Badge, Button, ListRow, TextField } from '../../../../shared/components';
|
|
3
|
-
import { startToolOAuth } from '../../../secrets-vault
|
|
3
|
+
import { startToolOAuth } from '../../../secrets-vault';
|
|
4
4
|
import {
|
|
5
5
|
deleteAdminVar,
|
|
6
6
|
setAdminVar,
|
|
7
7
|
setOAuthClientSecret,
|
|
8
8
|
setUserVar,
|
|
9
9
|
type ToolVarStatus,
|
|
10
|
-
} from '../../../secrets-vault
|
|
10
|
+
} from '../../../secrets-vault';
|
|
11
11
|
import { navigateExternal } from '../../utils/navigate-external';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import type { PullRequestSummary } from '@bevel-software/platform-shared';
|
|
3
|
-
import { fetchFileAccessBatch } from '../../access
|
|
4
|
-
import { listToolSecrets, type ToolSecrets } from '../../secrets-vault
|
|
3
|
+
import { fetchFileAccessBatch } from '../../access';
|
|
4
|
+
import { listToolSecrets, type ToolSecrets } from '../../secrets-vault';
|
|
5
5
|
import { listPendingTools, type PendingToolSummary } from '../services/tools.api';
|
|
6
6
|
import {
|
|
7
7
|
defaultWorkspaceId,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
listMyChangeRequests,
|
|
16
16
|
listOpenChangeRequests,
|
|
17
|
-
} from '../../change-requests
|
|
17
|
+
} from '../../change-requests';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* All the list-level data the Library gallery needs, loaded in parallel:
|
|
@@ -2,7 +2,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
listToolSecrets,
|
|
4
4
|
type ToolSecrets,
|
|
5
|
-
} from '../../secrets-vault
|
|
5
|
+
} from '../../secrets-vault';
|
|
6
6
|
import { getSkill, listSkills, type LibrarySkillSummary } from '../services/library.api';
|
|
7
7
|
import { getToolDetail, type ToolManualDetail } from '../services/tools.api';
|
|
8
8
|
import { neededToolsFor } from '../utils/status';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { DEFAULT_BRANCH } from '@bevel-software/platform-shared';
|
|
3
|
-
import { readFileOnBranch } from '../../change-requests
|
|
3
|
+
import { readFileOnBranch } from '../../change-requests';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The raw bytes of a tool's definition file, read LAZILY — nothing is asked
|
|
@@ -16,3 +16,15 @@ export { pathForTool } from './routes/library-paths';
|
|
|
16
16
|
export { ToolLogo, type ToolLogoProps } from './components/ToolLogo';
|
|
17
17
|
/** The outcome a tool sign-in carries back in the fragment, read once on arrival. */
|
|
18
18
|
export { readOAuthFragment, type OAuthFragmentOutcome } from './utils/oauth-fragment';
|
|
19
|
+
// Reached by other modules; exported here so they stop importing the files.
|
|
20
|
+
export { LIBRARY_ROOT, isLibraryLocation, pathForLibraryFilter, pathForPlugin, pathForSkill, urlForLibraryItem } from './routes/library-paths';
|
|
21
|
+
export { listSkills } from './services/library.api';
|
|
22
|
+
export type { LibrarySkillSummary } from './services/library.api';
|
|
23
|
+
export { listPlugins } from './services/plugins.api';
|
|
24
|
+
export type { PluginSummary } from './services/plugins.api';
|
|
25
|
+
export { useLibrary } from './state/library-data';
|
|
26
|
+
export { usePluginsRevision } from './state/plugins-revision';
|
|
27
|
+
export { useLibraryToast } from './state/toast.context';
|
|
28
|
+
export { COPY_FAILED_TOAST, copyToClipboard } from './utils/clipboard';
|
|
29
|
+
export { PERSONAL_PLUGIN_NAME, displayFirstName } from './utils/personal-plugin';
|
|
30
|
+
export { pluginLabel, pluginNameForPath } from './utils/plugin-summary';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Navigate, Route, Routes, useLocation, useParams } from 'react-router-dom';
|
|
2
2
|
import { LibraryToastProvider } from '../state/toast';
|
|
3
3
|
import { LibraryProvider, useLibrary } from '../state/library-data';
|
|
4
|
-
import { useWorkspace } from '../../workspace
|
|
4
|
+
import { useWorkspace } from '../../workspace';
|
|
5
5
|
import { LibraryLayout } from '../components/LibraryLayout';
|
|
6
6
|
import { LibraryPage } from '../components/LibraryPage';
|
|
7
7
|
import { PluginPage } from '../components/PluginPage';
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Link, Navigate, useLocation, useParams, useSearchParams } from 'react-router-dom';
|
|
2
2
|
import { DEFAULT_BRANCH, PLUGINS_DIR, SKILLS_DIR, type FileTreeEntry } from '@bevel-software/platform-shared';
|
|
3
|
-
import { useWorkspace } from '../../workspace
|
|
4
|
-
import { safeDecode } from '../../workspace/routing/kb-routes';
|
|
5
|
-
import { asksForFilePage } from '../../workspace';
|
|
3
|
+
import { useWorkspace, safeDecode, asksForFilePage } from '../../workspace';
|
|
6
4
|
import { useLibrary } from '../state/library-data';
|
|
7
5
|
import type { PluginSummary } from '../services/plugins.api';
|
|
8
6
|
import { pluginHoldingPath } from '../utils/plugin-summary';
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
isPersonalPluginFolder,
|
|
8
8
|
} from '@bevel-software/platform-shared';
|
|
9
9
|
import { matchPath } from 'react-router-dom';
|
|
10
|
-
import { kbFileUrl } from '../../workspace
|
|
10
|
+
import { kbFileUrl } from '../../workspace';
|
|
11
11
|
import type { LibraryFilter } from '../utils/status';
|
|
12
12
|
import { PERSONAL_PLUGIN_NAME } from '../utils/personal-plugin';
|
|
13
13
|
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { DEFAULT_BRANCH, PLUGINS_DIR, type PullRequestSummary } from '@bevel-software/platform-shared';
|
|
2
2
|
import { authFetch } from '../../../lib/api';
|
|
3
|
-
import { handleApiResponse } from '../../git
|
|
4
|
-
import { createBranch } from '../../git/services/git.api';
|
|
3
|
+
import { handleApiResponse, createBranch } from '../../git';
|
|
5
4
|
import {
|
|
6
5
|
deleteFile,
|
|
7
6
|
getOrCreateWorkspace,
|
|
8
7
|
writeFile,
|
|
9
8
|
type SkillToolWarning,
|
|
10
|
-
} from '../../workspace
|
|
11
|
-
import { openChangeRequest } from '../../pr
|
|
12
|
-
import {
|
|
13
|
-
import { branchSegment } from '../../change-requests/services/propose.api';
|
|
9
|
+
} from '../../workspace';
|
|
10
|
+
import { openChangeRequest, updateChangeRequest } from '../../pr';
|
|
11
|
+
import { branchSegment } from '../../change-requests';
|
|
14
12
|
import { ensurePersonalPlugin, type JoinRequest } from './plugins.api';
|
|
15
13
|
|
|
16
14
|
/**
|
|
@@ -189,7 +187,7 @@ export interface ProposeChangeInput {
|
|
|
189
187
|
repoRelativePath: string;
|
|
190
188
|
/** The file's full new text — what the author typed in the editor. */
|
|
191
189
|
content: string;
|
|
192
|
-
/** Optional "why" — lands in the change-request description
|
|
190
|
+
/** Optional "why" — lands in the change-request description (appended on a later round). */
|
|
193
191
|
note?: string;
|
|
194
192
|
userEmail: string;
|
|
195
193
|
userName: string;
|
|
@@ -232,8 +230,12 @@ export async function proposeChange(
|
|
|
232
230
|
);
|
|
233
231
|
|
|
234
232
|
if (input.existingCr) {
|
|
233
|
+
// A later round's "why" joins the request's description, after what is
|
|
234
|
+
// already there — the author may edit their own request, and the
|
|
235
|
+
// description is what the reviewer reads. The server appends to the text
|
|
236
|
+
// as it holds it at the write, so a note or edit landing meanwhile stays.
|
|
235
237
|
if (input.note) {
|
|
236
|
-
await
|
|
238
|
+
await updateChangeRequest(input.existingCr.number, { appendDescription: input.note });
|
|
237
239
|
}
|
|
238
240
|
} else {
|
|
239
241
|
await openChangeRequest({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { skillUnderRoot } from '@bevel-software/platform-shared';
|
|
2
|
-
import { probeWords } from '../../secrets-vault
|
|
3
|
-
import type { ProbeVerdict, ToolSecrets, ToolVarStatus } from '../../secrets-vault
|
|
2
|
+
import { probeWords } from '../../secrets-vault';
|
|
3
|
+
import type { ProbeVerdict, ToolSecrets, ToolVarStatus } from '../../secrets-vault';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Status derivation for the Library. Everything the cards, gems and loadout
|
|
@@ -3,7 +3,7 @@ import { createPortal } from 'react-dom';
|
|
|
3
3
|
import { useInRouterContext, useLocation, useNavigate } from 'react-router-dom';
|
|
4
4
|
import { X } from 'lucide-react';
|
|
5
5
|
import { cn } from '../../../lib/utils';
|
|
6
|
-
import { useLibraryToast } from '../../library
|
|
6
|
+
import { useLibraryToast } from '../../library';
|
|
7
7
|
import { useOnboarding } from '../state/onboarding';
|
|
8
8
|
import { WELCOME_PATH } from '../paths';
|
|
9
9
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { useMemo, useState } from 'react';
|
|
2
2
|
import { Sparkles, Users } from 'lucide-react';
|
|
3
3
|
import { Button, Dialog, Surface } from '../../../shared/components';
|
|
4
|
-
import { useAuth } from '../../auth
|
|
4
|
+
import { useAuth } from '../../auth';
|
|
5
5
|
import { NewPluginDialog } from '../../library/components/NewPluginDialog';
|
|
6
6
|
import { NewSkillPanel } from '../../library/components/NewSkillPanel';
|
|
7
|
-
import { useLibrary } from '../../library
|
|
8
|
-
import { displayFirstName } from '../../library/utils/personal-plugin';
|
|
7
|
+
import { useLibrary, displayFirstName } from '../../library';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* The first useful screen in an empty deployment: Skills & Tools' empty state
|