@posthog/agent 2.3.173 → 2.3.202
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/adapters/claude/conversion/tool-use-to-acp.js +9 -1
- package/dist/adapters/claude/conversion/tool-use-to-acp.js.map +1 -1
- package/dist/agent.js +14 -3
- package/dist/agent.js.map +1 -1
- package/dist/posthog-api.js +1 -1
- package/dist/posthog-api.js.map +1 -1
- package/dist/server/agent-server.d.ts +1 -1
- package/dist/server/agent-server.js +15 -4
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +49 -38
- package/dist/server/bin.cjs.map +1 -1
- package/package.json +1 -1
- package/src/adapters/claude/conversion/tool-use-to-acp.ts +11 -3
- package/src/adapters/claude/permissions/permission-handlers.ts +4 -1
- package/src/server/bin.ts +1 -1
- package/src/server/schemas.ts +1 -1
package/dist/server/bin.cjs
CHANGED
|
@@ -894,7 +894,7 @@ var require_dist2 = __commonJS({
|
|
|
894
894
|
|
|
895
895
|
// src/server/bin.ts
|
|
896
896
|
var import_commander = require("commander");
|
|
897
|
-
var
|
|
897
|
+
var import_v42 = require("zod/v4");
|
|
898
898
|
|
|
899
899
|
// src/server/agent-server.ts
|
|
900
900
|
var import_sdk5 = require("@agentclientprotocol/sdk");
|
|
@@ -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.3.
|
|
907
|
+
version: "2.3.202",
|
|
908
908
|
repository: "https://github.com/PostHog/code",
|
|
909
909
|
description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
|
|
910
910
|
exports: {
|
|
@@ -1917,7 +1917,15 @@ function toolInfoFromToolUse(toolUse, options) {
|
|
|
1917
1917
|
const writeDisplayPath = writeFilePath ? toDisplayPath(writeFilePath, options?.cwd) : void 0;
|
|
1918
1918
|
const contentStr = input?.content ? String(input.content) : void 0;
|
|
1919
1919
|
if (writeFilePath) {
|
|
1920
|
-
|
|
1920
|
+
let oldContent = null;
|
|
1921
|
+
if (options?.cachedFileContent && writeFilePath in options.cachedFileContent) {
|
|
1922
|
+
oldContent = options.cachedFileContent[writeFilePath];
|
|
1923
|
+
} else {
|
|
1924
|
+
try {
|
|
1925
|
+
oldContent = import_node_fs.default.readFileSync(writeFilePath, "utf-8");
|
|
1926
|
+
} catch {
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1921
1929
|
contentResult = toolContent().diff(writeFilePath, oldContent, contentStr ?? "").build();
|
|
1922
1930
|
} else if (contentStr) {
|
|
1923
1931
|
contentResult = toolContent().text(contentStr).build();
|
|
@@ -3369,7 +3377,10 @@ async function handleDefaultPermissionFlow(context) {
|
|
|
3369
3377
|
sessionId,
|
|
3370
3378
|
suggestions
|
|
3371
3379
|
} = context;
|
|
3372
|
-
const toolInfo = toolInfoFromToolUse(
|
|
3380
|
+
const toolInfo = toolInfoFromToolUse(
|
|
3381
|
+
{ name: toolName, input: toolInput },
|
|
3382
|
+
{ cachedFileContent: context.fileContentCache, cwd: session?.cwd }
|
|
3383
|
+
);
|
|
3373
3384
|
const options = buildPermissionOptions(
|
|
3374
3385
|
toolName,
|
|
3375
3386
|
toolInput,
|
|
@@ -12102,45 +12113,45 @@ function validateJwt(token, publicKey) {
|
|
|
12102
12113
|
}
|
|
12103
12114
|
|
|
12104
12115
|
// src/server/schemas.ts
|
|
12105
|
-
var
|
|
12106
|
-
var httpHeaderSchema =
|
|
12107
|
-
name:
|
|
12108
|
-
value:
|
|
12116
|
+
var import_v4 = require("zod/v4");
|
|
12117
|
+
var httpHeaderSchema = import_v4.z.object({
|
|
12118
|
+
name: import_v4.z.string(),
|
|
12119
|
+
value: import_v4.z.string()
|
|
12109
12120
|
});
|
|
12110
|
-
var remoteMcpServerSchema =
|
|
12111
|
-
type:
|
|
12112
|
-
name:
|
|
12113
|
-
url:
|
|
12114
|
-
headers:
|
|
12121
|
+
var remoteMcpServerSchema = import_v4.z.object({
|
|
12122
|
+
type: import_v4.z.enum(["http", "sse"]),
|
|
12123
|
+
name: import_v4.z.string().min(1, "MCP server name is required"),
|
|
12124
|
+
url: import_v4.z.url({ error: "MCP server url must be a valid URL" }),
|
|
12125
|
+
headers: import_v4.z.array(httpHeaderSchema).default([])
|
|
12115
12126
|
});
|
|
12116
|
-
var mcpServersSchema =
|
|
12117
|
-
var claudeCodeConfigSchema =
|
|
12118
|
-
systemPrompt:
|
|
12119
|
-
|
|
12120
|
-
|
|
12121
|
-
type:
|
|
12122
|
-
preset:
|
|
12123
|
-
append:
|
|
12127
|
+
var mcpServersSchema = import_v4.z.array(remoteMcpServerSchema);
|
|
12128
|
+
var claudeCodeConfigSchema = import_v4.z.object({
|
|
12129
|
+
systemPrompt: import_v4.z.union([
|
|
12130
|
+
import_v4.z.string(),
|
|
12131
|
+
import_v4.z.object({
|
|
12132
|
+
type: import_v4.z.literal("preset"),
|
|
12133
|
+
preset: import_v4.z.literal("claude_code"),
|
|
12134
|
+
append: import_v4.z.string().optional()
|
|
12124
12135
|
})
|
|
12125
12136
|
]).optional(),
|
|
12126
|
-
plugins:
|
|
12137
|
+
plugins: import_v4.z.array(import_v4.z.object({ type: import_v4.z.literal("local"), path: import_v4.z.string() })).optional()
|
|
12127
12138
|
});
|
|
12128
|
-
var jsonRpcRequestSchema =
|
|
12129
|
-
jsonrpc:
|
|
12130
|
-
method:
|
|
12131
|
-
params:
|
|
12132
|
-
id:
|
|
12139
|
+
var jsonRpcRequestSchema = import_v4.z.object({
|
|
12140
|
+
jsonrpc: import_v4.z.literal("2.0"),
|
|
12141
|
+
method: import_v4.z.string(),
|
|
12142
|
+
params: import_v4.z.record(import_v4.z.string(), import_v4.z.unknown()).optional(),
|
|
12143
|
+
id: import_v4.z.union([import_v4.z.string(), import_v4.z.number()]).optional()
|
|
12133
12144
|
});
|
|
12134
|
-
var userMessageParamsSchema =
|
|
12135
|
-
content:
|
|
12145
|
+
var userMessageParamsSchema = import_v4.z.object({
|
|
12146
|
+
content: import_v4.z.string().min(1, "Content is required")
|
|
12136
12147
|
});
|
|
12137
12148
|
var commandParamsSchemas = {
|
|
12138
12149
|
user_message: userMessageParamsSchema,
|
|
12139
12150
|
"posthog/user_message": userMessageParamsSchema,
|
|
12140
|
-
cancel:
|
|
12141
|
-
"posthog/cancel":
|
|
12142
|
-
close:
|
|
12143
|
-
"posthog/close":
|
|
12151
|
+
cancel: import_v4.z.object({}).optional(),
|
|
12152
|
+
"posthog/cancel": import_v4.z.object({}).optional(),
|
|
12153
|
+
close: import_v4.z.object({}).optional(),
|
|
12154
|
+
"posthog/close": import_v4.z.object({}).optional()
|
|
12144
12155
|
};
|
|
12145
12156
|
function validateCommandParams(method, params) {
|
|
12146
12157
|
const schema = commandParamsSchemas[method] ?? commandParamsSchemas[method.replace("posthog/", "")];
|
|
@@ -13364,17 +13375,17 @@ ${attributionInstructions}
|
|
|
13364
13375
|
};
|
|
13365
13376
|
|
|
13366
13377
|
// src/server/bin.ts
|
|
13367
|
-
var envSchema =
|
|
13368
|
-
JWT_PUBLIC_KEY:
|
|
13378
|
+
var envSchema = import_v42.z.object({
|
|
13379
|
+
JWT_PUBLIC_KEY: import_v42.z.string({
|
|
13369
13380
|
error: "JWT_PUBLIC_KEY is required for authenticating client connections"
|
|
13370
13381
|
}).min(1, "JWT_PUBLIC_KEY cannot be empty"),
|
|
13371
|
-
POSTHOG_API_URL:
|
|
13382
|
+
POSTHOG_API_URL: import_v42.z.url({
|
|
13372
13383
|
error: "POSTHOG_API_URL is required for LLM gateway communication"
|
|
13373
13384
|
}),
|
|
13374
|
-
POSTHOG_PERSONAL_API_KEY:
|
|
13385
|
+
POSTHOG_PERSONAL_API_KEY: import_v42.z.string({
|
|
13375
13386
|
error: "POSTHOG_PERSONAL_API_KEY is required for authenticating with PostHog services"
|
|
13376
13387
|
}).min(1, "POSTHOG_PERSONAL_API_KEY cannot be empty"),
|
|
13377
|
-
POSTHOG_PROJECT_ID:
|
|
13388
|
+
POSTHOG_PROJECT_ID: import_v42.z.string({
|
|
13378
13389
|
error: "POSTHOG_PROJECT_ID is required for routing requests to the correct project"
|
|
13379
13390
|
}).regex(/^\d+$/, "POSTHOG_PROJECT_ID must be a numeric string").transform((val) => parseInt(val, 10))
|
|
13380
13391
|
});
|