Skip to content

Commit f124485

Browse files
debug: log all events in default-deny test to inspect event structure
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2ade8c3 commit f124485

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

nodejs/test/e2e/permissions.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,22 @@ describe("Permission callbacks", async () => {
6363
await session.destroy();
6464
});
6565

66+
it("should deny tool operations by default when no handler is provided", async () => {
67+
const allEvents: unknown[] = [];
68+
69+
const session = await client.createSession();
70+
session.on((event) => {
71+
allEvents.push(event);
72+
console.log("EVENT:", JSON.stringify(event, null, 2));
73+
});
74+
75+
await session.sendAndWait({ prompt: "Run 'node --version'" });
76+
77+
console.log("ALL EVENTS:", JSON.stringify(allEvents, null, 2));
78+
79+
await session.destroy();
80+
});
81+
6682
it("should work without permission handler (default behavior)", async () => {
6783
// Create session without onPermissionRequest handler
6884
const session = await client.createSession();

0 commit comments

Comments
 (0)