@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.
package/dist/agent.js CHANGED
@@ -276,7 +276,7 @@ import { v7 as uuidv7 } from "uuid";
276
276
  // package.json
277
277
  var package_default = {
278
278
  name: "@posthog/agent",
279
- version: "2.1.15",
279
+ version: "2.1.17",
280
280
  repository: "https://github.com/PostHog/twig",
281
281
  description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
282
282
  exports: {
@@ -2304,7 +2304,19 @@ function buildSpawnWrapper(sessionId, onProcessSpawned, onProcessExited) {
2304
2304
  };
2305
2305
  };
2306
2306
  }
2307
+ function ensureLocalSettings(cwd) {
2308
+ const claudeDir = path2.join(cwd, ".claude");
2309
+ const localSettingsPath = path2.join(claudeDir, "settings.local.json");
2310
+ try {
2311
+ if (!fs.existsSync(localSettingsPath)) {
2312
+ fs.mkdirSync(claudeDir, { recursive: true });
2313
+ fs.writeFileSync(localSettingsPath, "{}\n", { flag: "wx" });
2314
+ }
2315
+ } catch {
2316
+ }
2317
+ }
2307
2318
  function buildSessionOptions(params) {
2319
+ ensureLocalSettings(params.cwd);
2308
2320
  const options = {
2309
2321
  ...params.userProvidedOptions,
2310
2322
  systemPrompt: params.systemPrompt ?? buildSystemPrompt(),
@@ -2808,6 +2820,10 @@ function spawnCodexProcess(options) {
2808
2820
  env.POSTHOG_GATEWAY_API_KEY = options.apiKey;
2809
2821
  }
2810
2822
  const { command, args } = findCodexBinary(options);
2823
+ if (options.binaryPath && existsSync3(options.binaryPath)) {
2824
+ const binDir = options.binaryPath.replace(/\/[^/]+$/, "");
2825
+ env.PATH = `${binDir}:${env.PATH ?? ""}`;
2826
+ }
2811
2827
  logger.info("Spawning codex-acp process", {
2812
2828
  command,
2813
2829
  args,