@bevel-software/platform-core-frontend 0.33.0 → 0.35.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/lib/__tests__/api.test.ts +28 -1
- package/src/lib/api.ts +4 -2
- package/src/modules/access/__tests__/ManageAccessDialog.add-row-picking.test.tsx +53 -1
- package/src/modules/access/api.ts +27 -8
- package/src/modules/access/components/ManageAccessDialog.tsx +7 -7
- package/src/modules/access/index.ts +1 -1
- package/src/modules/admin/__tests__/DirectoryGroupsPage.test.tsx +51 -0
- package/src/modules/admin/components/DirectoryGroupsPage.tsx +42 -5
- package/src/modules/admin/index.ts +1 -1
- package/src/modules/admin/services/groups.api.ts +11 -1
- package/src/modules/agents/__tests__/useConnectAsChoice.test.ts +56 -0
- package/src/modules/agents/components/ConnectAsChoice.tsx +88 -0
- package/src/modules/agents/connect-as.ts +15 -0
- package/src/modules/agents/index.ts +5 -0
- package/src/modules/agents/services/agent-choices.api.ts +39 -0
- package/src/modules/agents/useConnectAsChoice.ts +66 -0
- package/src/modules/audit/__tests__/AuditLogPage.test.tsx +16 -2
- package/src/modules/audit/components/AuditLogPage.tsx +11 -0
- package/src/modules/audit/services/audit.api.ts +5 -0
- package/src/modules/auth/__tests__/AccountPage.test.tsx +21 -0
- package/src/modules/auth/__tests__/account.api.test.ts +69 -0
- package/src/modules/auth/components/AccountPage.tsx +8 -2
- package/src/modules/auth/index.ts +1 -1
- package/src/modules/auth/services/account.api.ts +18 -2
- package/src/modules/git/__tests__/BranchSwitcher.test.tsx +0 -14
- package/src/modules/git/__tests__/git.api.test.ts +2 -2
- package/src/modules/git/hooks/__tests__/useGitState.deleteBranch.test.tsx +1 -1
- package/src/modules/library/__tests__/SkillPage.test.tsx +229 -24
- package/src/modules/library/__tests__/ToolVarRow.test.tsx +51 -5
- package/src/modules/library/components/skill-page/SkillFilePane.tsx +57 -9
- package/src/modules/library/components/skill-page/SkillPage.tsx +65 -25
- package/src/modules/library/components/tool-page/ToolVarRow.tsx +22 -14
- package/src/modules/review/components/MarkdownDiffViewer.tsx +23 -1
- package/src/modules/review/components/ReviewPanel.tsx +8 -2
- package/src/modules/review/components/__tests__/MarkdownDiffViewer.test.tsx +31 -0
- package/src/modules/secrets-vault/components/ConnectToolsPage.tsx +79 -16
- package/src/modules/secrets-vault/components/__tests__/ConnectToolsPage.test.tsx +122 -2
- package/src/modules/secrets-vault/services/connect.api.ts +20 -5
- package/src/modules/toolbar/components/ExternalAgentAccessPage.tsx +45 -4
- package/src/modules/toolbar/components/__tests__/ExternalAgentAccessPage.test.tsx +127 -12
- package/src/modules/toolbar/services/external-api-keys.api.ts +5 -2
- package/src/modules/workspace/components/FileViewer.tsx +1 -1
- package/src/modules/workspace/components/__tests__/FileExplorer.test.tsx +58 -8
- package/src/modules/workspace/components/renderers/HtmlRenderer.tsx +40 -7
- package/src/modules/workspace/components/renderers/KbAppLink.tsx +56 -0
- package/src/modules/workspace/components/renderers/KbMarkdownView.tsx +30 -10
- package/src/modules/workspace/components/renderers/MarkdownRenderer.tsx +37 -40
- package/src/modules/workspace/components/renderers/__tests__/HtmlRenderer.links.test.tsx +185 -0
- package/src/modules/workspace/components/renderers/__tests__/MarkdownRenderer.sectionReclick.test.tsx +88 -0
- package/src/modules/workspace/components/renderers/__tests__/MarkdownRenderer.test.tsx +199 -29
- package/src/modules/workspace/components/renderers/__tests__/bridgeHarness.ts +37 -4
- package/src/modules/workspace/components/renderers/__tests__/htmlSandbox.test.ts +59 -0
- package/src/modules/workspace/components/renderers/__tests__/htmlViewsGuide.test.ts +15 -1
- package/src/modules/workspace/components/renderers/__tests__/liveDataReferencePage.test.ts +397 -0
- package/src/modules/workspace/components/renderers/htmlSandbox.ts +48 -15
- package/src/modules/workspace/components/renderers/htmlToolBridge.ts +19 -0
- package/src/modules/workspace/components/renderers/kbMarkdownPipeline.tsx +35 -28
- package/src/modules/workspace/components/renderers/scrollToHeading.ts +35 -0
- package/src/modules/workspace/hooks/__tests__/useLinksOut.test.ts +6 -0
- package/src/modules/workspace/hooks/useLinksOut.ts +12 -6
- package/src/modules/workspace/index.ts +21 -2
- package/src/modules/workspace/routing/__tests__/kb-routes.test.tsx +262 -25
- package/src/modules/workspace/routing/kb-routes.ts +221 -53
- package/src/modules/workspace/utils/__tests__/treeConfirm.test.ts +32 -48
- package/src/modules/workspace/utils/fileTree.ts +1 -1
- package/src/modules/workspace/utils/treeConfirm.ts +24 -28
|
@@ -12,7 +12,8 @@ import {
|
|
|
12
12
|
parsePluginPrincipalToken,
|
|
13
13
|
pluginPrincipalLabel,
|
|
14
14
|
type AccessPrincipalRef,
|
|
15
|
-
type
|
|
15
|
+
type HolderChangeRef,
|
|
16
|
+
type HolderChanges,
|
|
16
17
|
type ProspectiveAccess,
|
|
17
18
|
} from '../../access';
|
|
18
19
|
import { KB_ROOT_DIRS } from './fileTree';
|
|
@@ -238,44 +239,39 @@ function capped(lines: string[]): string[] {
|
|
|
238
239
|
}
|
|
239
240
|
|
|
240
241
|
/**
|
|
241
|
-
*
|
|
242
|
-
*
|
|
242
|
+
* The lines of who loses and who gains access in one move, from the
|
|
243
|
+
* resolver's own verdicts (`changes`, the server's `prospectiveHolderChanges`
|
|
244
|
+
* — the same answer the agent's `move_file` gives). Nothing is derived here
|
|
245
|
+
* from the holder lists: those name grants, so a diff of them misses a
|
|
246
|
+
* person the destination denies by name and shows a writer leaving a folder
|
|
247
|
+
* everyone reads as losing `read`.
|
|
243
248
|
*
|
|
244
|
-
* Lines are grouped by principal in the order the
|
|
245
|
-
* resolver's order, collectives before
|
|
246
|
-
*
|
|
247
|
-
*
|
|
249
|
+
* Lines are grouped by principal in the order the changes name them — the
|
|
250
|
+
* resolver's order, collectives before people — and within a principal,
|
|
251
|
+
* opening before editing. A principal that loses one verb and gains another
|
|
252
|
+
* appears in both blocks, which is what happened.
|
|
248
253
|
*/
|
|
249
|
-
export function accessChangeLines(
|
|
254
|
+
export function accessChangeLines(changes: HolderChanges): AccessChange {
|
|
250
255
|
const lose: string[] = [];
|
|
251
256
|
const gain: string[] = [];
|
|
252
|
-
// First-seen order over
|
|
257
|
+
// First-seen order over both lists, so a principal's lines sit together
|
|
253
258
|
// wherever the verb that introduced it came from.
|
|
254
259
|
const order: AccessPrincipalRef[] = [];
|
|
255
260
|
const seen = new Set<string>();
|
|
256
|
-
for (const
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
seen.add(key);
|
|
262
|
-
order.push(principal);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
261
|
+
for (const change of [...changes.lose, ...changes.gain]) {
|
|
262
|
+
const key = principalKey(change);
|
|
263
|
+
if (seen.has(key)) continue;
|
|
264
|
+
seen.add(key);
|
|
265
|
+
order.push(change);
|
|
265
266
|
}
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
before: { read: keysOf(before.read), write: keysOf(before.write) },
|
|
269
|
-
after: { read: keysOf(after.read), write: keysOf(after.write) },
|
|
270
|
-
};
|
|
267
|
+
const has = (list: HolderChangeRef[], key: string, verb: 'read' | 'write') =>
|
|
268
|
+
list.some((c) => c.verb === verb && principalKey(c) === key);
|
|
271
269
|
for (const principal of order) {
|
|
272
270
|
const key = principalKey(principal);
|
|
273
271
|
const label = principalLabel(principal);
|
|
274
272
|
for (const verb of ACCESS_VERBS) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
if (had && !has) lose.push(`${label}: can no longer ${VERB_WORD[verb]}`);
|
|
278
|
-
if (!had && has) gain.push(`${label}: can ${VERB_WORD[verb]}`);
|
|
273
|
+
if (has(changes.lose, key, verb)) lose.push(`${label}: can no longer ${VERB_WORD[verb]}`);
|
|
274
|
+
if (has(changes.gain, key, verb)) gain.push(`${label}: can ${VERB_WORD[verb]}`);
|
|
279
275
|
}
|
|
280
276
|
}
|
|
281
277
|
return { lose: capped(lose), gain: capped(gain) };
|
|
@@ -283,7 +279,7 @@ export function accessChangeLines(before: PathPrincipals, after: PathPrincipals)
|
|
|
283
279
|
|
|
284
280
|
/** {@link accessChangeLines} over a whole prospective-access answer. */
|
|
285
281
|
export function accessChangeOf(access: ProspectiveAccess): AccessChange {
|
|
286
|
-
return accessChangeLines(access.
|
|
282
|
+
return accessChangeLines(access.changes);
|
|
287
283
|
}
|
|
288
284
|
|
|
289
285
|
/**
|