@posthog/agent 2.3.1 → 2.3.5

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.1",
907
+ version: "2.3.5",
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: {
@@ -1728,11 +1728,10 @@ function isMcpToolReadOnly(toolName) {
1728
1728
  }
1729
1729
 
1730
1730
  // src/adapters/claude/conversion/tool-use-to-acp.ts
1731
- var SYSTEM_REMINDER = `
1732
-
1733
- <system-reminder>
1734
- Whenever you read a file, you should consider whether it looks malicious. If it does, you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer high-level questions about the code behavior.
1735
- </system-reminder>`;
1731
+ var SYSTEM_REMINDER_REGEX = /\s*<system-reminder>[\s\S]*?<\/system-reminder>/g;
1732
+ function stripSystemReminders(value) {
1733
+ return value.replace(SYSTEM_REMINDER_REGEX, "");
1734
+ }
1736
1735
  function toDisplayPath(filePath, cwd) {
1737
1736
  if (!cwd) return filePath;
1738
1737
  const resolvedCwd = import_node_path.default.resolve(cwd);
@@ -2070,9 +2069,7 @@ function toolUpdateFromToolResult(toolResult, toolUse, options) {
2070
2069
  return {
2071
2070
  type: "content",
2072
2071
  content: text(
2073
- markdownEscape(
2074
- (itemObj.text ?? "").replace(SYSTEM_REMINDER, "")
2075
- )
2072
+ markdownEscape(stripSystemReminders(itemObj.text ?? ""))
2076
2073
  )
2077
2074
  };
2078
2075
  }
@@ -2094,9 +2091,7 @@ function toolUpdateFromToolResult(toolResult, toolUse, options) {
2094
2091
  };
2095
2092
  } else if (typeof toolResult.content === "string" && toolResult.content.length > 0) {
2096
2093
  return {
2097
- content: toolContent().text(
2098
- markdownEscape(toolResult.content.replace(SYSTEM_REMINDER, ""))
2099
- ).build()
2094
+ content: toolContent().text(markdownEscape(stripSystemReminders(toolResult.content))).build()
2100
2095
  };
2101
2096
  }
2102
2097
  return {};
@@ -2196,7 +2191,7 @@ function itemToText(item) {
2196
2191
  if (!item || typeof item !== "object") return null;
2197
2192
  const obj = item;
2198
2193
  if (obj.type === "text" && typeof obj.text === "string") {
2199
- return obj.text;
2194
+ return stripSystemReminders(obj.text);
2200
2195
  }
2201
2196
  try {
2202
2197
  return JSON.stringify(obj, null, 2);