@bevel-software/platform-core-frontend 0.32.0 → 0.34.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 (207) hide show
  1. package/package.json +2 -2
  2. package/src/core/CoreAppShell.tsx +1 -1
  3. package/src/lib/__tests__/api.test.ts +28 -1
  4. package/src/lib/api.ts +4 -2
  5. package/src/modules/access/__tests__/ManageAccessDialog.add-row-picking.test.tsx +53 -1
  6. package/src/modules/access/api.ts +4 -5
  7. package/src/modules/access/components/ManageAccessDialog.tsx +11 -12
  8. package/src/modules/access/hooks/useAccessRequests.ts +1 -1
  9. package/src/modules/access/hooks/useFileAccess.ts +1 -1
  10. package/src/modules/access/index.ts +11 -0
  11. package/src/modules/access/requests.api.ts +1 -1
  12. package/src/modules/admin/__tests__/DirectoryGroupsPage.test.tsx +51 -0
  13. package/src/modules/admin/components/AddMemberInput.tsx +1 -1
  14. package/src/modules/admin/components/DirectoryGroupsPage.tsx +42 -5
  15. package/src/modules/admin/components/UserAccountsPage.tsx +3 -3
  16. package/src/modules/admin/index.ts +7 -0
  17. package/src/modules/admin/services/groups.api.ts +11 -1
  18. package/src/modules/admin/state/admin.context.tsx +1 -1
  19. package/src/modules/agents/__tests__/useConnectAsChoice.test.ts +56 -0
  20. package/src/modules/agents/components/ConnectAsChoice.tsx +81 -0
  21. package/src/modules/agents/connect-as.ts +15 -0
  22. package/src/modules/agents/index.ts +5 -0
  23. package/src/modules/agents/services/agent-choices.api.ts +39 -0
  24. package/src/modules/agents/useConnectAsChoice.ts +66 -0
  25. package/src/modules/audit/__tests__/AuditLogPage.test.tsx +13 -0
  26. package/src/modules/audit/components/AuditEventsPanel.tsx +1 -1
  27. package/src/modules/audit/components/AuditLogPage.tsx +11 -2
  28. package/src/modules/audit/services/audit.api.ts +5 -0
  29. package/src/modules/auth/__tests__/AccountPage.test.tsx +21 -0
  30. package/src/modules/auth/__tests__/account.api.test.ts +69 -0
  31. package/src/modules/auth/components/AccountPage.tsx +8 -2
  32. package/src/modules/auth/index.ts +12 -0
  33. package/src/modules/auth/services/account.api.ts +18 -2
  34. package/src/modules/change-requests/__tests__/ChangeRequestDialog.access-rules.test.tsx +0 -1
  35. package/src/modules/change-requests/__tests__/ChangeRequestDialog.binary.test.tsx +0 -1
  36. package/src/modules/change-requests/__tests__/ChangeRequestDialog.brings-itself-up-to-date.test.tsx +0 -1
  37. package/src/modules/change-requests/__tests__/ChangeRequestDialog.edit.test.tsx +166 -0
  38. package/src/modules/change-requests/__tests__/ChangeRequestDialog.fork-point.test.tsx +0 -1
  39. package/src/modules/change-requests/__tests__/ChangeRequestDialog.initial-file.test.tsx +0 -1
  40. package/src/modules/change-requests/__tests__/ChangeRequestDialog.moved.test.tsx +0 -1
  41. package/src/modules/change-requests/__tests__/ChangeRequestDialog.sync-banner.test.tsx +0 -1
  42. package/src/modules/change-requests/__tests__/ChangeRequestDialog.test.tsx +0 -2
  43. package/src/modules/change-requests/__tests__/ChangeRequestDialog.unreadable.test.tsx +0 -1
  44. package/src/modules/change-requests/__tests__/apply-outcome-for-every-viewer.test.tsx +0 -1
  45. package/src/modules/change-requests/components/BranchFilePreview.tsx +4 -12
  46. package/src/modules/change-requests/components/ChangeRequestDialog.tsx +138 -30
  47. package/src/modules/change-requests/components/ChangeRequestLink.tsx +2 -3
  48. package/src/modules/change-requests/components/CrFileTree.tsx +1 -1
  49. package/src/modules/change-requests/components/FileChangeBoxes.tsx +2 -3
  50. package/src/modules/change-requests/hooks/useApplyChangeRequest.ts +3 -5
  51. package/src/modules/change-requests/hooks/useCrFileDiffs.ts +1 -1
  52. package/src/modules/change-requests/index.ts +14 -0
  53. package/src/modules/change-requests/services/change-requests.api.ts +2 -2
  54. package/src/modules/change-requests/services/denied-file.api.ts +2 -2
  55. package/src/modules/change-requests/services/propose.api.ts +3 -4
  56. package/src/modules/change-requests/utils/diff.ts +1 -1
  57. package/src/modules/change-requests/utils/readFailure.ts +1 -1
  58. package/src/modules/embed/__tests__/EmbedView.test.tsx +19 -2
  59. package/src/modules/embed/components/EmbedLinkPage.tsx +1 -2
  60. package/src/modules/git/__tests__/BranchSwitcher.test.tsx +0 -14
  61. package/src/modules/git/__tests__/git.api.test.ts +2 -2
  62. package/src/modules/git/components/BranchSwitcher.tsx +3 -4
  63. package/src/modules/git/components/FileHistoryPanel.tsx +2 -2
  64. package/src/modules/git/components/GitSyncFailedBanner.tsx +2 -4
  65. package/src/modules/git/components/HistoryVersionPreview.tsx +4 -15
  66. package/src/modules/git/components/PullNeededBanner.tsx +1 -1
  67. package/src/modules/git/hooks/__tests__/useGitState.deleteBranch.test.tsx +1 -1
  68. package/src/modules/git/hooks/useAutoPullUpdates.ts +1 -1
  69. package/src/modules/git/index.ts +11 -0
  70. package/src/modules/layout/components/MobileChatLayout.tsx +1 -1
  71. package/src/modules/layout/index.ts +9 -0
  72. package/src/modules/library/__tests__/SkillPage.test.tsx +268 -24
  73. package/src/modules/library/__tests__/propose-change.test.ts +75 -0
  74. package/src/modules/library/components/AddToPluginDialog.tsx +1 -1
  75. package/src/modules/library/components/ChangeRequestDock.tsx +1 -1
  76. package/src/modules/library/components/LibraryLayout.tsx +2 -2
  77. package/src/modules/library/components/LibraryPage.tsx +3 -3
  78. package/src/modules/library/components/ManagedPluginRequests.tsx +1 -1
  79. package/src/modules/library/components/NewSkillPanel.tsx +2 -2
  80. package/src/modules/library/components/PersonalAddDialog.tsx +1 -1
  81. package/src/modules/library/components/PersonalPluginPage.tsx +1 -1
  82. package/src/modules/library/components/PluginExtras.tsx +1 -4
  83. package/src/modules/library/components/PluginPage.tsx +1 -1
  84. package/src/modules/library/components/PluginRows.tsx +1 -1
  85. package/src/modules/library/components/SkillsTree.tsx +1 -4
  86. package/src/modules/library/components/plugin-page-parts.tsx +1 -1
  87. package/src/modules/library/components/skill-page/SkillFilePane.tsx +74 -14
  88. package/src/modules/library/components/skill-page/SkillPage.tsx +80 -47
  89. package/src/modules/library/components/tool-page/ToolConnectionSection.tsx +2 -4
  90. package/src/modules/library/components/tool-page/ToolVarRow.tsx +2 -2
  91. package/src/modules/library/hooks/useJoinRequests.ts +1 -1
  92. package/src/modules/library/hooks/useLibraryData.ts +3 -3
  93. package/src/modules/library/hooks/useToolPage.ts +1 -1
  94. package/src/modules/library/hooks/useToolSource.ts +1 -1
  95. package/src/modules/library/index.ts +12 -0
  96. package/src/modules/library/routes/LibraryRoutes.tsx +1 -1
  97. package/src/modules/library/routes/WorkspaceItemRoute.tsx +1 -3
  98. package/src/modules/library/routes/library-paths.ts +1 -1
  99. package/src/modules/library/services/library.api.ts +10 -8
  100. package/src/modules/library/services/plugins.api.ts +1 -1
  101. package/src/modules/library/services/teams.api.ts +1 -1
  102. package/src/modules/library/utils/status.ts +2 -2
  103. package/src/modules/onboarding/components/ConnectAgentPill.tsx +1 -1
  104. package/src/modules/onboarding/components/CreatorWelcomePage.tsx +2 -3
  105. package/src/modules/onboarding/components/GetStartedColumn.tsx +6 -13
  106. package/src/modules/onboarding/components/InviteButton.tsx +2 -2
  107. package/src/modules/onboarding/components/InviteDialog.tsx +4 -6
  108. package/src/modules/onboarding/components/RootLanding.tsx +2 -2
  109. package/src/modules/onboarding/components/StarterPackCard.tsx +1 -1
  110. package/src/modules/onboarding/components/WelcomePage.tsx +2 -5
  111. package/src/modules/onboarding/index.ts +10 -0
  112. package/src/modules/onboarding/paths.ts +1 -1
  113. package/src/modules/onboarding/state/agent-connection.ts +2 -2
  114. package/src/modules/onboarding/state/onboarding.ts +1 -1
  115. package/src/modules/onboarding/state/starter-packs.ts +1 -1
  116. package/src/modules/pr/components/OpenChangeRequestDialog.tsx +1 -1
  117. package/src/modules/pr/index.ts +14 -0
  118. package/src/modules/pr/services/pr-approvals.api.ts +1 -1
  119. package/src/modules/pr/services/pr-cancel.api.ts +1 -1
  120. package/src/modules/pr/services/pr-detail.api.ts +2 -2
  121. package/src/modules/pr/services/pr-edit.api.ts +22 -0
  122. package/src/modules/pr/services/pr-merge.api.ts +1 -1
  123. package/src/modules/pr/services/pr-open.api.ts +1 -1
  124. package/src/modules/review/components/DiffViewer.tsx +1 -1
  125. package/src/modules/review/components/MarkdownDiffViewer.tsx +24 -3
  126. package/src/modules/review/components/ReviewPanel.tsx +10 -5
  127. package/src/modules/review/components/__tests__/MarkdownDiffViewer.test.tsx +31 -0
  128. package/src/modules/review/state/ReviewProvider.tsx +2 -2
  129. package/src/modules/secrets-vault/components/ConnectToolsPage.tsx +79 -16
  130. package/src/modules/secrets-vault/components/__tests__/ConnectToolsPage.test.tsx +112 -2
  131. package/src/modules/secrets-vault/index.ts +6 -0
  132. package/src/modules/secrets-vault/services/connect.api.ts +20 -5
  133. package/src/modules/settings/components/DeploymentPage.tsx +2 -2
  134. package/src/modules/settings/components/SettingsLayout.tsx +2 -2
  135. package/src/modules/settings/index.ts +8 -0
  136. package/src/modules/setup/components/FirstRunStorage.tsx +1 -1
  137. package/src/modules/setup/index.ts +6 -0
  138. package/src/modules/toolbar/commands/actions.tsx +3 -3
  139. package/src/modules/toolbar/commands/useCommandActions.ts +5 -9
  140. package/src/modules/toolbar/components/AgentInstructionsCard.tsx +2 -2
  141. package/src/modules/toolbar/components/AppSwitcher.tsx +1 -2
  142. package/src/modules/toolbar/components/CoworkSetupSteps.tsx +1 -1
  143. package/src/modules/toolbar/components/ExternalAgentAccessPage.tsx +39 -5
  144. package/src/modules/toolbar/components/ProfileMenu.tsx +3 -3
  145. package/src/modules/toolbar/components/SearchPalette.tsx +4 -8
  146. package/src/modules/toolbar/components/Toolbar.tsx +2 -5
  147. package/src/modules/toolbar/components/__tests__/ExternalAgentAccessPage.test.tsx +91 -2
  148. package/src/modules/toolbar/index.ts +6 -0
  149. package/src/modules/toolbar/search/sources.ts +4 -7
  150. package/src/modules/toolbar/services/agent-instructions.api.ts +1 -1
  151. package/src/modules/toolbar/services/external-api-keys.api.ts +5 -2
  152. package/src/modules/tools/ToolsExplorerPage.tsx +217 -18
  153. package/src/modules/tools/__tests__/ToolsExplorerPage.read-only.test.tsx +220 -0
  154. package/src/modules/tools/tool-hints.api.ts +44 -0
  155. package/src/modules/workflow/index.ts +7 -0
  156. package/src/modules/workflow/state/ChangeRequestStaleBinder.tsx +1 -0
  157. package/src/modules/workflow/state/EventBusFocusBinder.tsx +1 -1
  158. package/src/modules/workspace/components/FileExplorer.tsx +35 -8
  159. package/src/modules/workspace/components/FilePaneCard.tsx +37 -12
  160. package/src/modules/workspace/components/FileRoute.tsx +10 -3
  161. package/src/modules/workspace/components/FileViewer.tsx +169 -25
  162. package/src/modules/workspace/components/FullScreenView.tsx +93 -0
  163. package/src/modules/workspace/components/KbFileRail.tsx +1 -1
  164. package/src/modules/workspace/components/KbPageHeader.tsx +9 -0
  165. package/src/modules/workspace/components/__tests__/FileExplorer.test.tsx +163 -0
  166. package/src/modules/workspace/components/__tests__/FileRoute.test.tsx +11 -0
  167. package/src/modules/workspace/components/__tests__/FileViewer.test.tsx +487 -3
  168. package/src/modules/workspace/components/readingCarry.ts +59 -0
  169. package/src/modules/workspace/components/renderers/HtmlRenderer.tsx +74 -180
  170. package/src/modules/workspace/components/renderers/KbAppLink.tsx +56 -0
  171. package/src/modules/workspace/components/renderers/KbMarkdownView.tsx +30 -10
  172. package/src/modules/workspace/components/renderers/MarkdownRenderer.tsx +37 -40
  173. package/src/modules/workspace/components/renderers/ToolRenderer.tsx +1 -1
  174. package/src/modules/workspace/components/renderers/__tests__/HtmlRenderer.links.test.tsx +185 -0
  175. package/src/modules/workspace/components/renderers/__tests__/HtmlRenderer.tools.test.tsx +168 -42
  176. package/src/modules/workspace/components/renderers/__tests__/MarkdownRenderer.sectionReclick.test.tsx +88 -0
  177. package/src/modules/workspace/components/renderers/__tests__/MarkdownRenderer.test.tsx +199 -29
  178. package/src/modules/workspace/components/renderers/__tests__/bridgeHarness.ts +57 -7
  179. package/src/modules/workspace/components/renderers/__tests__/htmlSandbox.test.ts +122 -4
  180. package/src/modules/workspace/components/renderers/__tests__/htmlToolBridge.test.ts +235 -1
  181. package/src/modules/workspace/components/renderers/__tests__/htmlViewsGuide.test.ts +29 -4
  182. package/src/modules/workspace/components/renderers/__tests__/liveDataReferencePage.test.ts +397 -0
  183. package/src/modules/workspace/components/renderers/__tests__/pageToolsHarness.ts +79 -0
  184. package/src/modules/workspace/components/renderers/__tests__/useHtmlToolBridge.test.tsx +316 -0
  185. package/src/modules/workspace/components/renderers/htmlSandbox.ts +123 -28
  186. package/src/modules/workspace/components/renderers/htmlToolBridge.ts +215 -25
  187. package/src/modules/workspace/components/renderers/index.ts +10 -0
  188. package/src/modules/workspace/components/renderers/kbMarkdownPipeline.tsx +35 -28
  189. package/src/modules/workspace/components/renderers/scrollToHeading.ts +35 -0
  190. package/src/modules/workspace/components/renderers/useHtmlToolBridge.tsx +253 -0
  191. package/src/modules/workspace/hooks/__tests__/useLinksOut.test.ts +6 -0
  192. package/src/modules/workspace/hooks/useFullScreenView.ts +52 -0
  193. package/src/modules/workspace/hooks/useImageRevision.ts +1 -1
  194. package/src/modules/workspace/hooks/useKnowledgeWriteTarget.ts +1 -1
  195. package/src/modules/workspace/hooks/useLastCommit.ts +1 -1
  196. package/src/modules/workspace/hooks/useLinksOut.ts +12 -6
  197. package/src/modules/workspace/hooks/useWorkspaceState.ts +4 -4
  198. package/src/modules/workspace/index.ts +50 -2
  199. package/src/modules/workspace/routing/__tests__/kb-routes.test.tsx +262 -25
  200. package/src/modules/workspace/routing/kb-routes.ts +222 -54
  201. package/src/modules/workspace/state/__tests__/applied-request-clears-pending.test.tsx +0 -1
  202. package/src/modules/workspace/state/open-change-requests.tsx +1 -1
  203. package/src/modules/workspace/utils/fileTree.ts +1 -1
  204. package/src/modules/workspace/utils/frameEscape.ts +15 -0
  205. package/src/modules/workspace/utils/treeConfirm.ts +1 -1
  206. package/src/shared/theme/measure.ts +7 -0
  207. package/src/modules/pr/services/pr-comments.api.ts +0 -45
@@ -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/state/admin.context';
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';
@@ -1,11 +1,17 @@
1
- import type { ReactNode } from 'react';
1
+ import { useEffect, useRef, type ReactNode } from 'react';
2
2
  import '../../../change-requests/change-requests.css';
3
3
  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/utils/diff';
7
+ import {
8
+ OpenPageInPlatformContext,
9
+ PageLinkHomeContext,
10
+ PageToolsContext,
11
+ scrollToHeading,
12
+ type KbLinkTarget,
13
+ } from '../../../workspace';
14
+ import type { DiffLine } from '../../../change-requests';
9
15
 
10
16
  /** The pane never writes — editing goes through the page's Edit / Propose. */
11
17
  const NOOP_SAVE = async () => {};
@@ -25,20 +31,52 @@ interface SkillFilePaneProps {
25
31
  actions?: ReactNode;
26
32
  /** Sits between the bar and the body: the "your suggestions are inline" strip. */
27
33
  notice?: ReactNode;
28
- /** Follow a relative link out of rendered markdown. */
29
- onOpenLink?(href: string): void;
30
- /** Resolve a bare `[text](node-id)` link — same contract as `KbMarkdownView`. */
31
- onOpenNodeId?(id: string): void;
34
+ /**
35
+ * Follow a link out of rendered markdown. `scrollToSection` takes this
36
+ * file to one of its own headings (`#steps`), for a link to a section of
37
+ * the file on screen: the page's address has no heading scroll of its own.
38
+ */
39
+ onOpenLink?(href: string, scrollToSection: (hash: string) => void): void;
40
+ /** Where a file link leads, for its anchor — same contract as `KbMarkdownView`. */
41
+ fileLinkTarget?(href: string): KbLinkTarget | null;
42
+ /**
43
+ * Resolve a bare `[text](node-id)` link — same contract as `KbMarkdownView`,
44
+ * plus `scrollToSection` as for `onOpenLink`, for a link to this file's node.
45
+ */
46
+ onOpenNodeId?(id: string, scrollToSection: (hash: string) => void): void;
47
+ /** Where an id-link leads, for its anchor — same contract as `KbMarkdownView`. */
48
+ nodeIdLinkTarget?(id: string): KbLinkTarget | null;
32
49
  /** Heading deep-link builder; present ⇒ headings get the copy-anchor button. */
33
50
  headingLink?(slug: string): string;
51
+ /**
52
+ * The fragment the page's address arrived with (`#steps`), or empty. The
53
+ * page's address has no heading scroll of its own, so the pane scrolls a
54
+ * rendered markdown file to the heading it names — which is what makes a
55
+ * section link's own address (a middle-click on it, a copied heading link)
56
+ * land where the click does.
57
+ */
58
+ sectionHash?: string;
34
59
  /** Image source resolver, same contract as `KbMarkdownView`; absent ⇒ plain `<img>` tags. */
35
60
  resolveImage?: KbImageResolver;
61
+ /**
62
+ * The file's knowledge-base path (`Skills/review/view.html`) — the path the
63
+ * file page gives the page-tool bridge for the same file. Present, an HTML
64
+ * page here gets the viewer's tools, recorded under this path; absent (the
65
+ * skill's path has not resolved yet), it gets none.
66
+ */
67
+ pagePath?: string;
36
68
  /**
37
69
  * Open this file on the app's file page — what an HTML page's "Open in the
38
70
  * platform" does here, since `file` is relative to the skill, not a
39
- * workspace path.
71
+ * workspace path. The renderer offers it only to a page without tools,
72
+ * i.e. while `pagePath` is absent.
40
73
  */
41
74
  onOpenInPlatform?(): void;
75
+ /**
76
+ * The file an HTML page's links resolve against — its workspace path and
77
+ * the branch it was read from — since `file` is relative to the skill.
78
+ */
79
+ linkHome?: { path: string; branch: string };
42
80
  }
43
81
 
44
82
  /**
@@ -59,11 +97,21 @@ export function SkillFilePane({
59
97
  actions,
60
98
  notice,
61
99
  onOpenLink,
100
+ fileLinkTarget,
62
101
  onOpenNodeId,
102
+ nodeIdLinkTarget,
63
103
  headingLink,
104
+ sectionHash,
64
105
  resolveImage,
106
+ pagePath,
65
107
  onOpenInPlatform,
108
+ linkHome,
66
109
  }: SkillFilePaneProps) {
110
+ const markdownRef = useRef<HTMLDivElement | null>(null);
111
+ const showsMarkdown = raw !== null && !suggestion && file.endsWith('.md');
112
+ useEffect(() => {
113
+ if (showsMarkdown && sectionHash) scrollToHeading(markdownRef.current, sectionHash);
114
+ }, [showsMarkdown, sectionHash, file]);
67
115
  return (
68
116
  <FilePaneCard file={file} actions={actions} notice={notice} className="mt-4">
69
117
  {raw === null ? (
@@ -76,24 +124,36 @@ export function SkillFilePane({
76
124
  // id-link resolution, heading copy-anchors. `scroll={false}`
77
125
  // because the library page is the scroller — a nested scrollbox
78
126
  // here would trap the wheel inside the pane.
127
+ <div ref={markdownRef}>
79
128
  <KbMarkdownView
80
129
  source={raw}
81
- onOpenFile={(href) => onOpenLink?.(href)}
82
- onOpenNodeId={onOpenNodeId}
130
+ onOpenFile={(href) => onOpenLink?.(href, (hash) => scrollToHeading(markdownRef.current, hash))}
131
+ fileLinkTarget={fileLinkTarget}
132
+ onOpenNodeId={
133
+ onOpenNodeId &&
134
+ ((id) => onOpenNodeId(id, (hash) => scrollToHeading(markdownRef.current, hash)))
135
+ }
136
+ nodeIdLinkTarget={nodeIdLinkTarget}
83
137
  headingLink={headingLink}
84
138
  resolveImage={resolveImage}
85
139
  scroll={false}
86
140
  />
141
+ </div>
87
142
  ) : /\.html?$/i.test(file) ? (
88
143
  // The same sandboxed preview the Knowledge viewer gives `.html` — a
89
144
  // skill's bundled template (a deck, a report shell) is meant to be
90
145
  // SEEN; the renderer's own Code tab keeps the source one click away.
91
146
  // Sized wrapper because the renderer fills its parent, and this card
92
- // has no height of its own.
147
+ // has no height of its own. The skill page is the platform: the
148
+ // page's `window.bevel.tools` is answered here as on its file page.
93
149
  <div className="h-[70vh]">
94
- <OpenPageInPlatformContext.Provider value={onOpenInPlatform ?? null}>
95
- <HtmlRenderer content={raw} filePath={file} readOnly onSave={NOOP_SAVE} />
96
- </OpenPageInPlatformContext.Provider>
150
+ <PageToolsContext.Provider value={pagePath ? { pagePath } : null}>
151
+ <OpenPageInPlatformContext.Provider value={onOpenInPlatform ?? null}>
152
+ <PageLinkHomeContext.Provider value={linkHome ?? null}>
153
+ <HtmlRenderer content={raw} filePath={file} readOnly onSave={NOOP_SAVE} />
154
+ </PageLinkHomeContext.Provider>
155
+ </OpenPageInPlatformContext.Provider>
156
+ </PageToolsContext.Provider>
97
157
  </div>
98
158
  ) : (
99
159
  <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/state/auth.context';
21
- import { useWorkspace } from '../../../workspace/state/workspace.context';
22
- import { useGit } from '../../../git/state/git.context';
20
+ import { useAuth } from '../../../auth';
21
+ import { useWorkspace, kbFileUrl, useFileNav, useFileNodeId, useNodeIdNav, useWorkspaceImageResolver } from '../../../workspace';
22
+ import { useGit } from '../../../git';
23
23
  import { FileHistoryPanel } from '../../../git/components/FileHistoryPanel';
24
- import {
25
- kbFileUrl,
26
- openExternalHref,
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/services/workspace.api';
31
+ } from '../../../workspace';
39
32
  import { useSkillDetail } from '../../hooks/useSkillDetail';
40
33
  import {
41
34
  refusalLine,
42
35
  useApplyChangeRequest,
43
- } from '../../../change-requests/hooks/useApplyChangeRequest';
44
- import { useCrFileDiffs } from '../../../change-requests/hooks/useCrFileDiffs';
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
  /**
@@ -118,7 +106,8 @@ export function SkillPage({
118
106
  const detail = useSkillDetail(name);
119
107
  // The same id-link resolver the Knowledge renderer uses — a `[text](node-id)`
120
108
  // link inside a skill file navigates to that node, not to a dead span.
121
- const { openNodeId } = useNodeIdNav();
109
+ const { openNodeId, nodeIdTarget } = useNodeIdNav();
110
+ const { openLink, linkTarget, openFilePage } = useFileNav();
122
111
 
123
112
  const [selectedState, setSelected] = useState('SKILL.md');
124
113
  const selected = activeFile ?? selectedState;
@@ -489,26 +478,59 @@ export function SkillPage({
489
478
  const editorBase = !canEditDirectly && ownCr ? ownBranchBase : rawOnMain;
490
479
 
491
480
  /**
492
- * Follow a link out of the rendered file. The same grammar as the Knowledge
493
- * view (`resolveKbHref`): the destination is decoded, so a link to
494
- * `Some File.md` opens `Some File.md` and not `Some%20File.md`; an absolute
495
- * app URL keeps its own branch; anything else opens on the default branch,
496
- * where skills live.
481
+ * Follow a link out of the rendered file — the Knowledge view's rule, from
482
+ * the same hook (`useFileNav().openLink`): the destination is decoded, an
483
+ * absolute app URL keeps its own branch, an external one opens in a new
484
+ * tab, another file of the knowledge base opens in a NEW TAB and this page
485
+ * stays where it is, and a link to this file's own sections moves only the
486
+ * fragment. A relative link resolves on the default branch, where skills
487
+ * live, whatever is checked out. `fileLinkTarget` is the same answer for the
488
+ * anchor to carry, so a middle-click goes where the click does.
489
+ *
490
+ * A link to a section of this file scrolls the pane to that heading
491
+ * (`scrollToSection`, from the pane) and leaves this page's address alone:
492
+ * the skill page has no heading scroll on its address, so moving the
493
+ * fragment there would change the URL and nothing on screen.
497
494
  */
498
495
  const openLinkInEditor = useCallback(
499
- (href: string) => {
500
- if (!fileWorkspacePath) return;
501
- const target = resolveKbHref(href, { basePath: fileWorkspacePath, kbDirName });
502
- // Same rule as `openLink`: the anchor's default was cancelled to get
503
- // here, so an external destination has nobody left to open it.
504
- if (target?.kind === 'external') {
505
- openExternalHref(href);
506
- return;
496
+ (href: string, scrollToSection: (hash: string) => void) => {
497
+ if (fileWorkspacePath) {
498
+ openLink(href, fileWorkspacePath, { homeBranch: DEFAULT_BRANCH, onSection: scrollToSection });
507
499
  }
508
- if (target?.kind !== 'workspace') return;
509
- navigate(kbFileUrl(target.branch ?? DEFAULT_BRANCH, target.path) + target.hash);
510
500
  },
511
- [fileWorkspacePath, kbDirName, navigate],
501
+ [fileWorkspacePath, openLink],
502
+ );
503
+ /**
504
+ * An HTML page's links resolve against its real home — the workspace path
505
+ * and the default branch — not `active`, which names the file relative to
506
+ * the skill.
507
+ */
508
+ const pageLinkHome = useMemo(
509
+ () => (fileWorkspacePath ? { path: fileWorkspacePath, branch: DEFAULT_BRANCH } : undefined),
510
+ [fileWorkspacePath],
511
+ );
512
+ const fileLinkTarget = useCallback(
513
+ (href: string) => (fileWorkspacePath ? linkTarget(href, fileWorkspacePath, DEFAULT_BRANCH) : null),
514
+ [fileWorkspacePath, linkTarget],
515
+ );
516
+ /**
517
+ * An id-link follows the same rule, told which node is on screen — the id
518
+ * of the file in the pane, on the default branch it was read from — so a
519
+ * link to this node's own heading (`[Steps](newsletter#steps)`) scrolls
520
+ * the pane like a section link, instead of opening this skill again in a
521
+ * new tab. This page's address is not the node's id URL, so the hook could
522
+ * not tell from the address. Any other id names a node on the default
523
+ * branch too, where this file was read from, whatever is checked out.
524
+ */
525
+ const ownNodeId = useFileNodeId(fileWorkspacePath, DEFAULT_BRANCH);
526
+ const openNodeIdInFile = useCallback(
527
+ (idOrLink: string, scrollToSection: (hash: string) => void) =>
528
+ openNodeId(idOrLink, ownNodeId, { homeBranch: DEFAULT_BRANCH, onSection: scrollToSection }),
529
+ [openNodeId, ownNodeId],
530
+ );
531
+ const nodeIdLinkTarget = useCallback(
532
+ (idOrLink: string) => nodeIdTarget(idOrLink, ownNodeId, DEFAULT_BRANCH),
533
+ [nodeIdTarget, ownNodeId],
512
534
  );
513
535
 
514
536
  /**
@@ -848,21 +870,32 @@ export function SkillPage({
848
870
  raw={raw}
849
871
  suggestion={null}
850
872
  onOpenLink={openLinkInEditor}
851
- onOpenNodeId={openNodeId}
873
+ fileLinkTarget={fileLinkTarget}
874
+ onOpenNodeId={openNodeIdInFile}
875
+ nodeIdLinkTarget={nodeIdLinkTarget}
876
+ // A section link's own address (a modified click on it, a copied
877
+ // heading link) carries the heading as its fragment: arriving with
878
+ // one scrolls the pane to it.
879
+ sectionHash={location.hash}
852
880
  headingLink={headingLink}
853
881
  // No workspace yet means no base to resolve against: images render
854
882
  // as plain tags, exactly as before the resolver existed.
855
883
  resolveImage={fileWorkspacePath ? resolveImage : undefined}
856
- // A page of the skill opens on the Knowledge file page, where its
857
- // tools are. The URL alone would route straight back here (every
858
- // file under a skill's folder IS the skill page); `rawFile` asks the
859
- // item route for the file route itself, as the plugin page's file
860
- // links do.
884
+ // The page's tools are answered here, as on its file page, under
885
+ // the path the file page uses for it (repo-relative, kbDirName
886
+ // stripped): one identity per page in the Audit log and the
887
+ // consent card, never the skill-relative tab name.
888
+ pagePath={fileWorkspacePath ? fileRepoPath : undefined}
889
+ // The renderer's own target for Open in the platform, which it
890
+ // offers only to a page mounted without tools: the Knowledge file
891
+ // page, in a new tab, as the page asked from inside itself
892
+ // (`openFilePage`, the Knowledge view's own). The plain URL would
893
+ // route straight back here (every file under a skill's folder IS
894
+ // the skill page); the file-page URL asks for the file route.
861
895
  onOpenInPlatform={
862
- fileWorkspacePath
863
- ? () => navigate(kbFileUrl(DEFAULT_BRANCH, fileWorkspacePath), { state: { rawFile: true } })
864
- : undefined
896
+ fileWorkspacePath ? () => openFilePage(fileWorkspacePath, DEFAULT_BRANCH) : undefined
865
897
  }
898
+ linkHome={pageLinkHome}
866
899
  /*
867
900
  * ONE action, decided by the ACL. An `Edit` used to sit beside
868
901
  * `Propose changes` for EVERYONE and jump to the Knowledge editor —
@@ -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/state/workspace.context';
6
- import { kbFileUrl } from '../../../workspace/routing/kb-routes';
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/services/connect.api';
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/services/tool-secrets.api';
10
+ } from '../../../secrets-vault';
11
11
  import { navigateExternal } from '../../utils/navigate-external';
12
12
 
13
13
  /**
@@ -2,7 +2,7 @@ import { useMemo } from 'react';
2
2
  import {
3
3
  useAccessRequests,
4
4
  type AccessRequestsState,
5
- } from '../../access/hooks/useAccessRequests';
5
+ } from '../../access';
6
6
  import {
7
7
  listJoinRequests,
8
8
  reconcileJoinRequest,
@@ -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/api';
4
- import { listToolSecrets, type ToolSecrets } from '../../secrets-vault/services/tool-secrets.api';
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/services/change-requests.api';
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/services/tool-secrets.api';
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/services/change-requests.api';
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/state/workspace.context';
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/state/workspace.context';
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/routing/kb-routes';
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/services/git.api';
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/services/workspace.api';
11
- import { openChangeRequest } from '../../pr/services/pr-open.api';
12
- import { postPrComment } from '../../pr/services/pr-comments.api';
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 / a comment. */
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 postPrComment(input.existingCr.number, { body: input.note });
238
+ await updateChangeRequest(input.existingCr.number, { appendDescription: input.note });
237
239
  }
238
240
  } else {
239
241
  await openChangeRequest({
@@ -1,5 +1,5 @@
1
1
  import { authFetch } from '../../../lib/api';
2
- import { handleApiResponse } from '../../git/services/git.api';
2
+ import { handleApiResponse } from '../../git';
3
3
  import { notePluginCreated } from '../state/plugins-revision';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { authFetch } from '../../../lib/api';
2
- import { handleApiResponse } from '../../git/services/git.api';
2
+ import { handleApiResponse } from '../../git';
3
3
  import type { TeamAccess } from '../utils/status';
4
4
 
5
5
  export type { TeamAccess } from '../utils/status';
@@ -1,6 +1,6 @@
1
1
  import { skillUnderRoot } from '@bevel-software/platform-shared';
2
- import { probeWords } from '../../secrets-vault/probe/probe-verdict';
3
- import type { ProbeVerdict, ToolSecrets, ToolVarStatus } from '../../secrets-vault/services/tool-secrets.api';
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/state/toast.context';
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/state/auth.context';
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/state/library-data';
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
@@ -11,18 +11,11 @@ import {
11
11
  import { Button, IconButton, buttonClasses } from '../../../shared/components';
12
12
  import { cn } from '../../../lib/utils';
13
13
  import { copyToClipboard } from '../../../lib/clipboard';
14
- import { useAdmin } from '../../admin/state/admin.context';
15
- import { listAccounts } from '../../auth/services/account.api';
16
- import { listPlugins, type PluginSummary } from '../../library/services/plugins.api';
17
- import { LIBRARY_ROOT, isLibraryLocation } from '../../library/routes/library-paths';
18
- import { usePluginsRevision } from '../../library/state/plugins-revision';
19
- import { useMediaQuery } from '../../layout/hooks/useMediaQuery';
20
- import { SETUP_COLUMN_HIDDEN_QUERY } from '../../layout/breakpoints';
21
- import { useWorkspace } from '../../workspace/state/workspace.context';
22
- import { useMergedWorkspaceTree } from '../../workspace/hooks/useMergedWorkspaceTree';
23
- import { useFileNav } from '../../workspace/routing/kb-routes';
24
- import { useCreatePage } from '../../workspace/hooks/useCreatePage';
25
- import { findEntryByPath, pathExistsInTree } from '../../workspace/utils/fileTree';
14
+ import { useAdmin } from '../../admin';
15
+ import { listAccounts } from '../../auth';
16
+ import { listPlugins, type PluginSummary, LIBRARY_ROOT, isLibraryLocation, usePluginsRevision } from '../../library';
17
+ import { useMediaQuery, SETUP_COLUMN_HIDDEN_QUERY } from '../../layout';
18
+ import { useWorkspace, useMergedWorkspaceTree, useFileNav, useCreatePage, findEntryByPath, pathExistsInTree } from '../../workspace';
26
19
  import { useOnboarding, useSetupChecklist } from '../state/onboarding';
27
20
  import { useAgentConnection } from '../state/agent-connection';
28
21
  import {
@@ -35,7 +28,7 @@ import {
35
28
  import { useStarterPacks } from '../state/starter-packs';
36
29
  import { useInviteDialog } from '../state/invite-dialog.context';
37
30
  import { WELCOME_PATH } from '../paths';
38
- import { COMMAND_MENU_SHORTCUT_LABEL, openCommandMenu } from '../../toolbar/commands/command-menu';
31
+ import { COMMAND_MENU_SHORTCUT_LABEL, openCommandMenu } from '../../toolbar';
39
32
 
40
33
  /** The starter page every new knowledge base is seeded with (`kb-template/`). */
41
34
  const GUIDE_FILE = 'How to get started.md';
@@ -1,8 +1,8 @@
1
1
  import { useEffect, useRef, useState } from 'react';
2
2
  import { Users } from 'lucide-react';
3
3
  import { Button, IconButton, MenuPanel, buttonClasses, useDismissableMenu } from '../../../shared/components';
4
- import { useAdmin } from '../../admin/state/admin.context';
5
- import { fetchAdmins, type AdminContact } from '../../access/api';
4
+ import { useAdmin } from '../../admin';
5
+ import { fetchAdmins, type AdminContact } from '../../access';
6
6
  import { useInviteDialog } from '../state/invite-dialog.context';
7
7
 
8
8
  /**