@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.
@@ -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.187",
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
- const oldContent = options?.cachedFileContent && writeFilePath in options.cachedFileContent ? options.cachedFileContent[writeFilePath] : null;
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({ name: toolName, input: toolInput });
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,