mirror of
https://bitbucket.org/siakitem/my-pi.git
synced 2026-08-28 08:35:57 +00:00
feat: delegate external read-only tools to auto-review
This commit is contained in:
@@ -91,15 +91,20 @@ describe("encloseInDelegationEnvelope", () => {
|
||||
expect(verdict).toEqual({ kind: "allow" });
|
||||
});
|
||||
|
||||
it("keeps an allow on external_directory for the built-in read tool", async () => {
|
||||
const enclosed = encloseInDelegationEnvelope(makeLink({ kind: "allow" }));
|
||||
const verdict = await enclosed(
|
||||
makeDetails("external_directory", undefined, "read"),
|
||||
query,
|
||||
log,
|
||||
);
|
||||
expect(verdict).toEqual({ kind: "allow" });
|
||||
});
|
||||
it.each(["read", "find", "grep", "ls"] as const)(
|
||||
"keeps an allow on external_directory for the built-in read-only tool %s",
|
||||
async (toolName) => {
|
||||
const enclosed = encloseInDelegationEnvelope(
|
||||
makeLink({ kind: "allow" }),
|
||||
);
|
||||
const verdict = await enclosed(
|
||||
makeDetails("external_directory", undefined, toolName),
|
||||
query,
|
||||
log,
|
||||
);
|
||||
expect(verdict).toEqual({ kind: "allow" });
|
||||
},
|
||||
);
|
||||
|
||||
it("never caps a deny, even on an excluded surface", async () => {
|
||||
const enclosed = encloseInDelegationEnvelope(
|
||||
|
||||
Reference in New Issue
Block a user