@posthog/agent 2.3.535 → 2.3.548
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/dist/agent.js +3 -2
- package/dist/agent.js.map +1 -1
- package/dist/posthog-api.js +1 -1
- package/dist/posthog-api.js.map +1 -1
- package/dist/server/agent-server.js +3 -2
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +3 -2
- package/dist/server/bin.cjs.map +1 -1
- package/package.json +1 -1
- package/src/adapters/claude/permissions/permission-handlers.test.ts +1 -0
- package/src/adapters/claude/permissions/permission-handlers.ts +1 -0
- package/src/server/agent-server.test.ts +34 -4
package/package.json
CHANGED
|
@@ -237,6 +237,7 @@ describe("canUseTool MCP approval enforcement", () => {
|
|
|
237
237
|
expect.objectContaining({
|
|
238
238
|
toolCall: expect.objectContaining({
|
|
239
239
|
title: "The agent wants to run `notebooks-destroy` on PostHog",
|
|
240
|
+
_meta: { claudeCode: { toolName: "mcp__posthog__exec" } },
|
|
240
241
|
}),
|
|
241
242
|
}),
|
|
242
243
|
);
|
|
@@ -303,12 +303,41 @@ describe("AgentServer HTTP Mode", () => {
|
|
|
303
303
|
|
|
304
304
|
let reader: ReadableStreamDefaultReader<Uint8Array> | null = null;
|
|
305
305
|
try {
|
|
306
|
-
|
|
306
|
+
const testServer = createServer() as unknown as {
|
|
307
|
+
app: {
|
|
308
|
+
fetch: (request: Request) => Promise<Response> | Response;
|
|
309
|
+
};
|
|
310
|
+
session: unknown;
|
|
311
|
+
};
|
|
312
|
+
testServer.session = {
|
|
313
|
+
payload: {
|
|
314
|
+
run_id: "test-run-id",
|
|
315
|
+
task_id: "test-task-id",
|
|
316
|
+
team_id: 1,
|
|
317
|
+
user_id: 1,
|
|
318
|
+
distinct_id: "test-distinct-id",
|
|
319
|
+
mode: "interactive",
|
|
320
|
+
},
|
|
321
|
+
acpSessionId: "session-1",
|
|
322
|
+
acpConnection: { cleanup: vi.fn().mockResolvedValue(undefined) },
|
|
323
|
+
clientConnection: {},
|
|
324
|
+
sseController: null,
|
|
325
|
+
deviceInfo: { type: "cloud" },
|
|
326
|
+
logWriter: {
|
|
327
|
+
appendRawLine: vi.fn(),
|
|
328
|
+
flush: vi.fn().mockResolvedValue(undefined),
|
|
329
|
+
},
|
|
330
|
+
permissionMode: "default",
|
|
331
|
+
hasDesktopConnected: false,
|
|
332
|
+
};
|
|
333
|
+
|
|
307
334
|
const token = createToken();
|
|
308
335
|
|
|
309
|
-
const response = await fetch(
|
|
310
|
-
|
|
311
|
-
|
|
336
|
+
const response = await testServer.app.fetch(
|
|
337
|
+
new Request(`http://localhost:${port}/events`, {
|
|
338
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
339
|
+
}),
|
|
340
|
+
);
|
|
312
341
|
|
|
313
342
|
expect(response.status).toBe(200);
|
|
314
343
|
expect(response.body).not.toBeNull();
|
|
@@ -341,6 +370,7 @@ describe("AgentServer HTTP Mode", () => {
|
|
|
341
370
|
expect(streamText).not.toContain('"type":"keepalive"');
|
|
342
371
|
} finally {
|
|
343
372
|
await reader?.cancel();
|
|
373
|
+
server = undefined;
|
|
344
374
|
setIntervalSpy.mockRestore();
|
|
345
375
|
}
|
|
346
376
|
}, 30000);
|