@posthog/agent 2.1.89 → 2.1.105
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 -2
- package/dist/agent.js.map +1 -1
- package/dist/posthog-api.js +120 -1
- package/dist/posthog-api.js.map +1 -1
- package/dist/server/agent-server.d.ts +1 -0
- package/dist/server/agent-server.js +125 -120
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +125 -120
- package/dist/server/bin.cjs.map +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/adapters/claude/session/models.ts +1 -0
- package/src/posthog-api.ts +4 -0
- package/src/server/agent-server.ts +3 -0
- package/src/server/types.ts +1 -0
- package/src/types.ts +1 -0
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
package/src/posthog-api.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import packageJson from "../package.json" with { type: "json" };
|
|
1
2
|
import type {
|
|
2
3
|
ArtifactType,
|
|
3
4
|
PostHogAPIConfig,
|
|
@@ -10,6 +11,8 @@ import { getLlmGatewayUrl } from "./utils/gateway.js";
|
|
|
10
11
|
|
|
11
12
|
export { getLlmGatewayUrl };
|
|
12
13
|
|
|
14
|
+
const DEFAULT_USER_AGENT = `posthog/agent.hog.dev; version: ${packageJson.version}`;
|
|
15
|
+
|
|
13
16
|
export interface TaskArtifactUploadPayload {
|
|
14
17
|
name: string;
|
|
15
18
|
type: ArtifactType;
|
|
@@ -48,6 +51,7 @@ export class PostHogAPIClient {
|
|
|
48
51
|
return {
|
|
49
52
|
Authorization: `Bearer ${this.config.getApiKey()}`,
|
|
50
53
|
"Content-Type": "application/json",
|
|
54
|
+
"User-Agent": this.config.userAgent ?? DEFAULT_USER_AGENT,
|
|
51
55
|
};
|
|
52
56
|
}
|
|
53
57
|
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
} from "@agentclientprotocol/sdk";
|
|
6
6
|
import { type ServerType, serve } from "@hono/node-server";
|
|
7
7
|
import { Hono } from "hono";
|
|
8
|
+
import packageJson from "../../package.json" with { type: "json" };
|
|
8
9
|
import { POSTHOG_NOTIFICATIONS } from "../acp-extensions.js";
|
|
9
10
|
import {
|
|
10
11
|
createAcpConnection,
|
|
@@ -154,6 +155,7 @@ export class AgentServer {
|
|
|
154
155
|
apiUrl: config.apiUrl,
|
|
155
156
|
projectId: config.projectId,
|
|
156
157
|
getApiKey: () => config.apiKey,
|
|
158
|
+
userAgent: `posthog/cloud.hog.dev; version: ${config.version ?? packageJson.version}`,
|
|
157
159
|
});
|
|
158
160
|
this.app = this.createApp();
|
|
159
161
|
}
|
|
@@ -471,6 +473,7 @@ export class AgentServer {
|
|
|
471
473
|
apiUrl: this.config.apiUrl,
|
|
472
474
|
projectId: this.config.projectId,
|
|
473
475
|
getApiKey: () => this.config.apiKey,
|
|
476
|
+
userAgent: `posthog/cloud.hog.dev; version: ${this.config.version ?? packageJson.version}`,
|
|
474
477
|
});
|
|
475
478
|
|
|
476
479
|
const logWriter = new SessionLogWriter({
|
package/src/server/types.ts
CHANGED