@posthog/agent 2.3.159 → 2.3.163

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.159",
3
+ "version": "2.3.163",
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": {
@@ -103,7 +103,7 @@
103
103
  "tar": "^7.5.0",
104
104
  "uuid": "13.0.0",
105
105
  "yoga-wasm-web": "^0.3.3",
106
- "zod": "^3.24.1"
106
+ "zod": "^4.2.0"
107
107
  },
108
108
  "files": [
109
109
  "dist/**/*",
package/src/server/bin.ts CHANGED
@@ -7,25 +7,21 @@ import { claudeCodeConfigSchema, mcpServersSchema } from "./schemas";
7
7
  const envSchema = z.object({
8
8
  JWT_PUBLIC_KEY: z
9
9
  .string({
10
- required_error:
11
- "JWT_PUBLIC_KEY is required for authenticating client connections",
10
+ error: "JWT_PUBLIC_KEY is required for authenticating client connections",
12
11
  })
13
12
  .min(1, "JWT_PUBLIC_KEY cannot be empty"),
14
- POSTHOG_API_URL: z
15
- .string({
16
- required_error:
17
- "POSTHOG_API_URL is required for LLM gateway communication",
18
- })
19
- .url("POSTHOG_API_URL must be a valid URL"),
13
+ POSTHOG_API_URL: z.url({
14
+ error: "POSTHOG_API_URL is required for LLM gateway communication",
15
+ }),
20
16
  POSTHOG_PERSONAL_API_KEY: z
21
17
  .string({
22
- required_error:
18
+ error:
23
19
  "POSTHOG_PERSONAL_API_KEY is required for authenticating with PostHog services",
24
20
  })
25
21
  .min(1, "POSTHOG_PERSONAL_API_KEY cannot be empty"),
26
22
  POSTHOG_PROJECT_ID: z
27
23
  .string({
28
- required_error:
24
+ error:
29
25
  "POSTHOG_PROJECT_ID is required for routing requests to the correct project",
30
26
  })
31
27
  .regex(/^\d+$/, "POSTHOG_PROJECT_ID must be a numeric string")
@@ -34,7 +30,7 @@ const envSchema = z.object({
34
30
 
35
31
  const program = new Command();
36
32
 
37
- function parseJsonOption<S extends z.ZodTypeAny>(
33
+ function parseJsonOption<S extends z.ZodType>(
38
34
  raw: string | undefined,
39
35
  schema: S,
40
36
  flag: string,
@@ -8,7 +8,7 @@ const httpHeaderSchema = z.object({
8
8
  const remoteMcpServerSchema = z.object({
9
9
  type: z.enum(["http", "sse"]),
10
10
  name: z.string().min(1, "MCP server name is required"),
11
- url: z.string().url("MCP server url must be a valid URL"),
11
+ url: z.url({ error: "MCP server url must be a valid URL" }),
12
12
  headers: z.array(httpHeaderSchema).default([]),
13
13
  });
14
14
 
@@ -35,7 +35,7 @@ export const claudeCodeConfigSchema = z.object({
35
35
  export const jsonRpcRequestSchema = z.object({
36
36
  jsonrpc: z.literal("2.0"),
37
37
  method: z.string(),
38
- params: z.record(z.unknown()).optional(),
38
+ params: z.record(z.string(), z.unknown()).optional(),
39
39
  id: z.union([z.string(), z.number()]).optional(),
40
40
  });
41
41