@posthog/agent 2.1.16 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/agent",
3
- "version": "2.1.16",
3
+ "version": "2.1.17",
4
4
  "repository": "https://github.com/PostHog/twig",
5
5
  "description": "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
6
6
  "exports": {
@@ -175,7 +175,22 @@ function buildSpawnWrapper(
175
175
  };
176
176
  }
177
177
 
178
+ function ensureLocalSettings(cwd: string): void {
179
+ const claudeDir = path.join(cwd, ".claude");
180
+ const localSettingsPath = path.join(claudeDir, "settings.local.json");
181
+ try {
182
+ if (!fs.existsSync(localSettingsPath)) {
183
+ fs.mkdirSync(claudeDir, { recursive: true });
184
+ fs.writeFileSync(localSettingsPath, "{}\n", { flag: "wx" });
185
+ }
186
+ } catch {
187
+ // Best-effort — don't fail session creation if we can't write
188
+ }
189
+ }
190
+
178
191
  export function buildSessionOptions(params: BuildOptionsParams): Options {
192
+ ensureLocalSettings(params.cwd);
193
+
179
194
  const options: Options = {
180
195
  ...params.userProvidedOptions,
181
196
  systemPrompt: params.systemPrompt ?? buildSystemPrompt(),