mirror of
https://bitbucket.org/siakitem/my-pi.git
synced 2026-10-26 18:55:22 +00:00
refactor(permission-system): simplify policy and autoreview flow
This commit is contained in:
@@ -128,8 +128,6 @@ export function makeToolRegistry(
|
||||
): ToolRegistry {
|
||||
return {
|
||||
getAll: vi.fn().mockReturnValue([{ name: "read" }, { name: "bash" }]),
|
||||
getActive: vi.fn().mockReturnValue(["read", "bash"]),
|
||||
setActive: vi.fn(),
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
@@ -212,7 +210,7 @@ export function makeBashCommandCheck(opts: {
|
||||
*
|
||||
* The `session` override bag maps to the real collaborators:
|
||||
* - `checkPermission` → applied to `permissionManager.checkPermission`
|
||||
* - `getActiveSkillEntries`, `getInfrastructureReadDirs`, `getToolPreviewLimits`
|
||||
* - `getActiveSkillEntries`, `getToolPreviewLimits`
|
||||
* → applied as vi.spyOn overrides on the real session
|
||||
* - `resolveAgentName` → applied as a vi.spyOn override on the real session
|
||||
*
|
||||
@@ -283,11 +281,6 @@ export function makeHandler(overrides?: {
|
||||
so.getActiveSkillEntries,
|
||||
);
|
||||
}
|
||||
if (so?.getInfrastructureReadDirs) {
|
||||
vi.spyOn(session, "getInfrastructureReadDirs").mockImplementation(
|
||||
so.getInfrastructureReadDirs,
|
||||
);
|
||||
}
|
||||
if (so?.getToolPreviewLimits) {
|
||||
vi.spyOn(session, "getToolPreviewLimits").mockImplementation(
|
||||
so.getToolPreviewLimits,
|
||||
|
||||
Reference in New Issue
Block a user