@posthog/agent 2.3.356 → 2.3.366
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 +4 -3
- package/dist/agent.js.map +1 -1
- package/dist/posthog-api.d.ts +2 -1
- package/dist/posthog-api.js +5 -1
- package/dist/posthog-api.js.map +1 -1
- package/dist/server/agent-server.js +4 -3
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +4 -3
- package/dist/server/bin.cjs.map +1 -1
- package/package.json +3 -3
- package/src/adapters/claude/hooks.ts +1 -2
- package/src/adapters/claude/session/options.ts +1 -1
- package/src/posthog-api.ts +11 -3
- package/src/utils/gateway.ts +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@posthog/agent",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.366",
|
|
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,9 +86,9 @@
|
|
|
86
86
|
"tsx": "^4.20.6",
|
|
87
87
|
"typescript": "^5.5.0",
|
|
88
88
|
"vitest": "^2.1.8",
|
|
89
|
-
"@posthog/
|
|
89
|
+
"@posthog/shared": "1.0.0",
|
|
90
90
|
"@posthog/git": "1.0.0",
|
|
91
|
-
"@posthog/
|
|
91
|
+
"@posthog/enricher": "1.0.0"
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
94
|
"@agentclientprotocol/sdk": "0.19.0",
|
|
@@ -127,11 +127,10 @@ export type OnModeChange = (mode: CodeExecutionMode) => Promise<void>;
|
|
|
127
127
|
|
|
128
128
|
interface CreatePostToolUseHookParams {
|
|
129
129
|
onModeChange?: OnModeChange;
|
|
130
|
-
logger?: Logger;
|
|
131
130
|
}
|
|
132
131
|
|
|
133
132
|
export const createPostToolUseHook =
|
|
134
|
-
({ onModeChange
|
|
133
|
+
({ onModeChange }: CreatePostToolUseHookParams): HookCallback =>
|
|
135
134
|
async (
|
|
136
135
|
input: HookInput,
|
|
137
136
|
toolUseID: string | undefined,
|
|
@@ -119,7 +119,7 @@ function buildHooks(
|
|
|
119
119
|
enrichedReadCache: EnrichedReadCache | undefined,
|
|
120
120
|
registeredAgents: ReadonlySet<string>,
|
|
121
121
|
): Options["hooks"] {
|
|
122
|
-
const postToolUseHooks = [createPostToolUseHook({ onModeChange
|
|
122
|
+
const postToolUseHooks = [createPostToolUseHook({ onModeChange })];
|
|
123
123
|
if (enrichmentDeps && enrichedReadCache) {
|
|
124
124
|
postToolUseHooks.push(
|
|
125
125
|
createReadEnrichmentHook(enrichmentDeps, enrichedReadCache),
|
package/src/posthog-api.ts
CHANGED
|
@@ -7,9 +7,17 @@ import type {
|
|
|
7
7
|
TaskRun,
|
|
8
8
|
TaskRunArtifact,
|
|
9
9
|
} from "./types";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
import {
|
|
11
|
+
getGatewayInvalidatePlanCacheUrl,
|
|
12
|
+
getGatewayUsageUrl,
|
|
13
|
+
getLlmGatewayUrl,
|
|
14
|
+
} from "./utils/gateway";
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
getGatewayInvalidatePlanCacheUrl,
|
|
18
|
+
getGatewayUsageUrl,
|
|
19
|
+
getLlmGatewayUrl,
|
|
20
|
+
};
|
|
13
21
|
|
|
14
22
|
const DEFAULT_USER_AGENT = `posthog/agent.hog.dev; version: ${packageJson.version}`;
|
|
15
23
|
|
package/src/utils/gateway.ts
CHANGED
|
@@ -29,3 +29,10 @@ export function getGatewayUsageUrl(
|
|
|
29
29
|
): string {
|
|
30
30
|
return `${getGatewayBaseUrl(posthogHost)}/v1/usage/${product}`;
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
export function getGatewayInvalidatePlanCacheUrl(
|
|
34
|
+
posthogHost: string,
|
|
35
|
+
product: GatewayProduct = "posthog_code",
|
|
36
|
+
): string {
|
|
37
|
+
return `${getGatewayBaseUrl(posthogHost)}/v1/usage/${product}/invalidate-plan-cache`;
|
|
38
|
+
}
|