@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/dist/agent.js +13 -1
- package/dist/agent.js.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/server/agent-server.js +13 -1
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +13 -1
- package/dist/server/bin.cjs.map +1 -1
- package/package.json +1 -1
- package/src/adapters/claude/session/options.ts +15 -0
package/package.json
CHANGED
|
@@ -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(),
|