@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 +17 -1
- package/dist/agent.js.map +1 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/server/agent-server.js +17 -1
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +17 -1
- package/dist/server/bin.cjs.map +1 -1
- package/package.json +1 -1
- package/src/adapters/claude/session/options.ts +15 -0
- package/src/adapters/codex/spawn.ts +5 -1
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(),
|
|
@@ -63,7 +63,6 @@ export function spawnCodexProcess(options: CodexProcessOptions): CodexProcess {
|
|
|
63
63
|
|
|
64
64
|
const env: NodeJS.ProcessEnv = { ...process.env };
|
|
65
65
|
|
|
66
|
-
// Prevent Electron's GPU/Chromium processes from interfering with child
|
|
67
66
|
delete env.ELECTRON_RUN_AS_NODE;
|
|
68
67
|
delete env.ELECTRON_NO_ASAR;
|
|
69
68
|
|
|
@@ -73,6 +72,11 @@ export function spawnCodexProcess(options: CodexProcessOptions): CodexProcess {
|
|
|
73
72
|
|
|
74
73
|
const { command, args } = findCodexBinary(options);
|
|
75
74
|
|
|
75
|
+
if (options.binaryPath && existsSync(options.binaryPath)) {
|
|
76
|
+
const binDir = options.binaryPath.replace(/\/[^/]+$/, "");
|
|
77
|
+
env.PATH = `${binDir}:${env.PATH ?? ""}`;
|
|
78
|
+
}
|
|
79
|
+
|
|
76
80
|
logger.info("Spawning codex-acp process", {
|
|
77
81
|
command,
|
|
78
82
|
args,
|