@posthog/agent 2.3.285 → 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/dist/agent.js +8 -5
- package/dist/agent.js.map +1 -1
- package/dist/posthog-api.d.ts +2 -1
- package/dist/posthog-api.js +12 -5
- package/dist/posthog-api.js.map +1 -1
- package/dist/server/agent-server.d.ts +1 -1
- package/dist/server/agent-server.js +11 -7
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +11 -7
- package/dist/server/bin.cjs.map +1 -1
- package/package.json +3 -3
- package/src/posthog-api.ts +2 -2
- package/src/server/agent-server.test.ts +10 -0
- package/src/server/agent-server.ts +3 -2
- package/src/utils/gateway.ts +18 -10
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.293",
|
|
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: {
|
|
@@ -10683,17 +10683,20 @@ function selectRecentTurns(turns, maxTokens = DEFAULT_MAX_TOKENS) {
|
|
|
10683
10683
|
}
|
|
10684
10684
|
|
|
10685
10685
|
// src/utils/gateway.ts
|
|
10686
|
-
function
|
|
10686
|
+
function getGatewayBaseUrl(posthogHost) {
|
|
10687
10687
|
const url = new URL(posthogHost);
|
|
10688
10688
|
const hostname = url.hostname;
|
|
10689
10689
|
if (hostname === "localhost" || hostname === "127.0.0.1") {
|
|
10690
|
-
return `${url.protocol}//localhost:3308
|
|
10690
|
+
return `${url.protocol}//localhost:3308`;
|
|
10691
10691
|
}
|
|
10692
10692
|
if (hostname === "host.docker.internal") {
|
|
10693
|
-
return `${url.protocol}//host.docker.internal:3308
|
|
10693
|
+
return `${url.protocol}//host.docker.internal:3308`;
|
|
10694
10694
|
}
|
|
10695
10695
|
const region = hostname.match(/^(us|eu)\.posthog\.com$/)?.[1] ?? "us";
|
|
10696
|
-
return `https://gateway.${region}.posthog.com
|
|
10696
|
+
return `https://gateway.${region}.posthog.com`;
|
|
10697
|
+
}
|
|
10698
|
+
function getLlmGatewayUrl(posthogHost, product = "posthog_code") {
|
|
10699
|
+
return `${getGatewayBaseUrl(posthogHost)}/${product}`;
|
|
10697
10700
|
}
|
|
10698
10701
|
|
|
10699
10702
|
// src/posthog-api.ts
|
|
@@ -13294,12 +13297,13 @@ ${toolSummary}`);
|
|
|
13294
13297
|
return process.env.POSTHOG_CODE_INTERACTION_ORIGIN ?? process.env.CODE_INTERACTION_ORIGIN ?? process.env.TWIG_INTERACTION_ORIGIN;
|
|
13295
13298
|
}
|
|
13296
13299
|
/**
|
|
13297
|
-
*
|
|
13300
|
+
* Automated-origin cloud runs auto-publish by default. Every other origin is
|
|
13298
13301
|
* review-first unless the user explicitly asks, and createPr=false always
|
|
13299
13302
|
* disables publishing.
|
|
13300
13303
|
*/
|
|
13301
13304
|
shouldAutoPublishCloudChanges() {
|
|
13302
|
-
|
|
13305
|
+
const origin = this.getCloudInteractionOrigin();
|
|
13306
|
+
return (origin === "slack" || origin === "signal_report") && this.config.createPr !== false;
|
|
13303
13307
|
}
|
|
13304
13308
|
buildDetectedPrContext(prUrl) {
|
|
13305
13309
|
if (!this.shouldAutoPublishCloudChanges()) {
|