@posthog/agent 2.3.187 → 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.js +14 -3
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +14 -3
- 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/package.json
CHANGED
|
@@ -226,11 +226,19 @@ export function toolInfoFromToolUse(
|
|
|
226
226
|
: undefined;
|
|
227
227
|
const contentStr = input?.content ? String(input.content) : undefined;
|
|
228
228
|
if (writeFilePath) {
|
|
229
|
-
|
|
229
|
+
let oldContent: string | null = null;
|
|
230
|
+
if (
|
|
230
231
|
options?.cachedFileContent &&
|
|
231
232
|
writeFilePath in options.cachedFileContent
|
|
232
|
-
|
|
233
|
-
|
|
233
|
+
) {
|
|
234
|
+
oldContent = options.cachedFileContent[writeFilePath];
|
|
235
|
+
} else {
|
|
236
|
+
try {
|
|
237
|
+
oldContent = fs.readFileSync(writeFilePath, "utf-8");
|
|
238
|
+
} catch {
|
|
239
|
+
// File doesn't exist — genuinely a new file
|
|
240
|
+
}
|
|
241
|
+
}
|
|
234
242
|
contentResult = toolContent()
|
|
235
243
|
.diff(writeFilePath, oldContent, contentStr ?? "")
|
|
236
244
|
.build();
|
|
@@ -338,7 +338,10 @@ async function handleDefaultPermissionFlow(
|
|
|
338
338
|
suggestions,
|
|
339
339
|
} = context;
|
|
340
340
|
|
|
341
|
-
const toolInfo = toolInfoFromToolUse(
|
|
341
|
+
const toolInfo = toolInfoFromToolUse(
|
|
342
|
+
{ name: toolName, input: toolInput },
|
|
343
|
+
{ cachedFileContent: context.fileContentCache, cwd: session?.cwd },
|
|
344
|
+
);
|
|
342
345
|
|
|
343
346
|
const options = buildPermissionOptions(
|
|
344
347
|
toolName,
|