@posthog/agent 2.3.286 → 2.3.293

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/agent",
3
- "version": "2.3.286",
3
+ "version": "2.3.293",
4
4
  "repository": "https://github.com/PostHog/code",
5
5
  "description": "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
6
6
  "exports": {
@@ -86,8 +86,8 @@
86
86
  "tsx": "^4.20.6",
87
87
  "typescript": "^5.5.0",
88
88
  "vitest": "^2.1.8",
89
- "@posthog/shared": "1.0.0",
90
- "@posthog/git": "1.0.0"
89
+ "@posthog/git": "1.0.0",
90
+ "@posthog/shared": "1.0.0"
91
91
  },
92
92
  "dependencies": {
93
93
  "@agentclientprotocol/sdk": "0.16.1",
@@ -489,6 +489,16 @@ describe("AgentServer HTTP Mode", () => {
489
489
  delete process.env.POSTHOG_CODE_INTERACTION_ORIGIN;
490
490
  });
491
491
 
492
+ it("returns auto-PR prompt for signal_report-origin runs", () => {
493
+ process.env.POSTHOG_CODE_INTERACTION_ORIGIN = "signal_report";
494
+ const s = createServer();
495
+ const prompt = (s as unknown as TestableServer).buildCloudSystemPrompt();
496
+ expect(prompt).toContain("posthog-code/");
497
+ expect(prompt).toContain("Create a draft pull request");
498
+ expect(prompt).toContain("gh pr create --draft");
499
+ delete process.env.POSTHOG_CODE_INTERACTION_ORIGIN;
500
+ });
501
+
492
502
  it("returns PR-update prompt for existing PRs on Slack-origin runs", () => {
493
503
  process.env.POSTHOG_CODE_INTERACTION_ORIGIN = "slack";
494
504
  const s = createServer();
@@ -1265,13 +1265,14 @@ export class AgentServer {
1265
1265
  }
1266
1266
 
1267
1267
  /**
1268
- * Slack-origin cloud runs auto-publish by default. Every other origin is
1268
+ * Automated-origin cloud runs auto-publish by default. Every other origin is
1269
1269
  * review-first unless the user explicitly asks, and createPr=false always
1270
1270
  * disables publishing.
1271
1271
  */
1272
1272
  private shouldAutoPublishCloudChanges(): boolean {
1273
+ const origin = this.getCloudInteractionOrigin();
1273
1274
  return (
1274
- this.getCloudInteractionOrigin() === "slack" &&
1275
+ (origin === "slack" || origin === "signal_report") &&
1275
1276
  this.config.createPr !== false
1276
1277
  );
1277
1278
  }