@posthog/agent 2.3.286 → 2.3.297
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 +1 -1
- 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.d.ts +1 -1
- package/dist/server/agent-server.js +9 -6
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +9 -6
- package/dist/server/bin.cjs.map +1 -1
- package/package.json +1 -1
- package/src/server/agent-server.test.ts +10 -0
- package/src/server/agent-server.ts +16 -9
package/dist/server/bin.cjs
CHANGED
|
@@ -5805,7 +5805,7 @@ var import_hono = require("hono");
|
|
|
5805
5805
|
// package.json
|
|
5806
5806
|
var package_default = {
|
|
5807
5807
|
name: "@posthog/agent",
|
|
5808
|
-
version: "2.3.
|
|
5808
|
+
version: "2.3.297",
|
|
5809
5809
|
repository: "https://github.com/PostHog/code",
|
|
5810
5810
|
description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
|
|
5811
5811
|
exports: {
|
|
@@ -12865,6 +12865,7 @@ var AgentServer = class _AgentServer {
|
|
|
12865
12865
|
await this.initializationPromise;
|
|
12866
12866
|
if (this.session && sseController) {
|
|
12867
12867
|
this.session.sseController = sseController;
|
|
12868
|
+
this.session.hasDesktopConnected = true;
|
|
12868
12869
|
this.replayPendingEvents();
|
|
12869
12870
|
}
|
|
12870
12871
|
return;
|
|
@@ -13297,12 +13298,13 @@ ${toolSummary}`);
|
|
|
13297
13298
|
return process.env.POSTHOG_CODE_INTERACTION_ORIGIN ?? process.env.CODE_INTERACTION_ORIGIN ?? process.env.TWIG_INTERACTION_ORIGIN;
|
|
13298
13299
|
}
|
|
13299
13300
|
/**
|
|
13300
|
-
*
|
|
13301
|
+
* Automated-origin cloud runs auto-publish by default. Every other origin is
|
|
13301
13302
|
* review-first unless the user explicitly asks, and createPr=false always
|
|
13302
13303
|
* disables publishing.
|
|
13303
13304
|
*/
|
|
13304
13305
|
shouldAutoPublishCloudChanges() {
|
|
13305
|
-
|
|
13306
|
+
const origin = this.getCloudInteractionOrigin();
|
|
13307
|
+
return (origin === "slack" || origin === "signal_report") && this.config.createPr !== false;
|
|
13306
13308
|
}
|
|
13307
13309
|
buildDetectedPrContext(prUrl) {
|
|
13308
13310
|
if (!this.shouldAutoPublishCloudChanges()) {
|
|
@@ -13554,11 +13556,12 @@ ${attributionInstructions}
|
|
|
13554
13556
|
{
|
|
13555
13557
|
const isQuestion = codeToolKind === "question";
|
|
13556
13558
|
const sessionPermissionMode = this.getSessionPermissionMode();
|
|
13557
|
-
const
|
|
13558
|
-
if (
|
|
13559
|
-
this.logger.info("Relaying permission
|
|
13559
|
+
const needsDesktopApproval = isQuestion || this.shouldRelayPermissionToClient(sessionPermissionMode);
|
|
13560
|
+
if (isPlanApproval || needsDesktopApproval && this.session?.hasDesktopConnected) {
|
|
13561
|
+
this.logger.info("Relaying permission request", {
|
|
13560
13562
|
kind: params.toolCall?.kind,
|
|
13561
13563
|
isQuestion,
|
|
13564
|
+
hasDesktopConnected: this.session?.hasDesktopConnected ?? false,
|
|
13562
13565
|
sessionPermissionMode
|
|
13563
13566
|
});
|
|
13564
13567
|
return this.relayPermissionToClient(params);
|