@posthog/agent 2.1.15 → 2.1.17

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.
@@ -1175,7 +1175,7 @@ var import_uuid = require("uuid");
1175
1175
  // package.json
1176
1176
  var package_default = {
1177
1177
  name: "@posthog/agent",
1178
- version: "2.1.15",
1178
+ version: "2.1.17",
1179
1179
  repository: "https://github.com/PostHog/twig",
1180
1180
  description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
1181
1181
  exports: {
@@ -3176,7 +3176,19 @@ function buildSpawnWrapper(sessionId, onProcessSpawned, onProcessExited) {
3176
3176
  };
3177
3177
  };
3178
3178
  }
3179
+ function ensureLocalSettings(cwd) {
3180
+ const claudeDir = path2.join(cwd, ".claude");
3181
+ const localSettingsPath = path2.join(claudeDir, "settings.local.json");
3182
+ try {
3183
+ if (!fs.existsSync(localSettingsPath)) {
3184
+ fs.mkdirSync(claudeDir, { recursive: true });
3185
+ fs.writeFileSync(localSettingsPath, "{}\n", { flag: "wx" });
3186
+ }
3187
+ } catch {
3188
+ }
3189
+ }
3179
3190
  function buildSessionOptions(params) {
3191
+ ensureLocalSettings(params.cwd);
3180
3192
  const options = {
3181
3193
  ...params.userProvidedOptions,
3182
3194
  systemPrompt: params.systemPrompt ?? buildSystemPrompt(),
@@ -3680,6 +3692,10 @@ function spawnCodexProcess(options) {
3680
3692
  env.POSTHOG_GATEWAY_API_KEY = options.apiKey;
3681
3693
  }
3682
3694
  const { command, args } = findCodexBinary(options);
3695
+ if (options.binaryPath && (0, import_node_fs.existsSync)(options.binaryPath)) {
3696
+ const binDir = options.binaryPath.replace(/\/[^/]+$/, "");
3697
+ env.PATH = `${binDir}:${env.PATH ?? ""}`;
3698
+ }
3683
3699
  logger.info("Spawning codex-acp process", {
3684
3700
  command,
3685
3701
  args,