@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/agent",
3
- "version": "2.3.356",
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/enricher": "1.0.0",
89
+ "@posthog/shared": "1.0.0",
90
90
  "@posthog/git": "1.0.0",
91
- "@posthog/shared": "1.0.0"
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, logger }: CreatePostToolUseHookParams): HookCallback =>
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, logger })];
122
+ const postToolUseHooks = [createPostToolUseHook({ onModeChange })];
123
123
  if (enrichmentDeps && enrichedReadCache) {
124
124
  postToolUseHooks.push(
125
125
  createReadEnrichmentHook(enrichmentDeps, enrichedReadCache),
@@ -7,9 +7,17 @@ import type {
7
7
  TaskRun,
8
8
  TaskRunArtifact,
9
9
  } from "./types";
10
- import { getGatewayUsageUrl, getLlmGatewayUrl } from "./utils/gateway";
11
-
12
- export { getGatewayUsageUrl, getLlmGatewayUrl };
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
 
@@ -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
+ }