@posthog/agent 2.1.114 → 2.1.115
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 +5 -5
- package/dist/agent.js.map +1 -1
- package/dist/posthog-api.d.ts +2 -1
- package/dist/posthog-api.js +5 -5
- package/dist/posthog-api.js.map +1 -1
- package/dist/server/agent-server.js +7 -6
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +7 -6
- package/dist/server/bin.cjs.map +1 -1
- package/package.json +1 -1
- package/src/server/agent-server.ts +4 -1
- package/src/utils/gateway.ts +9 -4
package/dist/server/bin.cjs
CHANGED
|
@@ -904,7 +904,7 @@ var import_hono = require("hono");
|
|
|
904
904
|
// package.json
|
|
905
905
|
var package_default = {
|
|
906
906
|
name: "@posthog/agent",
|
|
907
|
-
version: "2.1.
|
|
907
|
+
version: "2.1.115",
|
|
908
908
|
repository: "https://github.com/PostHog/twig",
|
|
909
909
|
description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
|
|
910
910
|
exports: {
|
|
@@ -4221,17 +4221,17 @@ function createCodexConnection(config) {
|
|
|
4221
4221
|
}
|
|
4222
4222
|
|
|
4223
4223
|
// src/utils/gateway.ts
|
|
4224
|
-
function getLlmGatewayUrl(posthogHost) {
|
|
4224
|
+
function getLlmGatewayUrl(posthogHost, product = "twig") {
|
|
4225
4225
|
const url = new URL(posthogHost);
|
|
4226
4226
|
const hostname = url.hostname;
|
|
4227
4227
|
if (hostname === "localhost" || hostname === "127.0.0.1") {
|
|
4228
|
-
return `${url.protocol}//localhost:3308
|
|
4228
|
+
return `${url.protocol}//localhost:3308/${product}`;
|
|
4229
4229
|
}
|
|
4230
4230
|
if (hostname === "host.docker.internal") {
|
|
4231
|
-
return `${url.protocol}//host.docker.internal:3308
|
|
4231
|
+
return `${url.protocol}//host.docker.internal:3308/${product}`;
|
|
4232
4232
|
}
|
|
4233
4233
|
const region = hostname.match(/^(us|eu)\.posthog\.com$/)?.[1] ?? "us";
|
|
4234
|
-
return `https://gateway.${region}.posthog.com
|
|
4234
|
+
return `https://gateway.${region}.posthog.com/${product}`;
|
|
4235
4235
|
}
|
|
4236
4236
|
|
|
4237
4237
|
// src/posthog-api.ts
|
|
@@ -10678,7 +10678,8 @@ Important:
|
|
|
10678
10678
|
}
|
|
10679
10679
|
configureEnvironment() {
|
|
10680
10680
|
const { apiKey, apiUrl, projectId } = this.config;
|
|
10681
|
-
const
|
|
10681
|
+
const product = this.config.mode === "background" ? "background_agents" : "twig";
|
|
10682
|
+
const gatewayUrl = process.env.LLM_GATEWAY_URL || getLlmGatewayUrl(apiUrl, product);
|
|
10682
10683
|
const openaiBaseUrl = gatewayUrl.endsWith("/v1") ? gatewayUrl : `${gatewayUrl}/v1`;
|
|
10683
10684
|
Object.assign(process.env, {
|
|
10684
10685
|
// PostHog
|