@companion-ai/feynman 0.5.7 → 0.5.8
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/RELEASES.md +5 -0
- package/dist/config/paths.js +9 -2
- package/dist/pi/settings.js +13 -8
- package/package.json +1 -1
package/RELEASES.md
CHANGED
|
@@ -6,6 +6,11 @@ GitHub release notes are generated from the matching `## vX.Y.Z` section in this
|
|
|
6
6
|
|
|
7
7
|
## Unreleased
|
|
8
8
|
|
|
9
|
+
## v0.5.8 - 2026-09-26
|
|
10
|
+
|
|
11
|
+
- `FEYNMAN_HOME=~` or `~/path` now means your home folder. Unexpanded `~` (common in `.env` files, Docker `ENV`, and Windows shells) created a literal `~` folder in the current directory.
|
|
12
|
+
- Starting two Feynman sessions at the same moment no longer crashes one of them with "Subagent config changed during settings normalization". The second start keeps the subagent config the first one wrote.
|
|
13
|
+
|
|
9
14
|
## v0.5.7 - 2026-09-26
|
|
10
15
|
|
|
11
16
|
- When Feynman runs as a package inside another Pi setup, an extension error no longer appears on every turn ("Cannot set properties of undefined (setting 'current_date')") if another extension or the host leaves the system-prompt sections unset (#298, thanks @Oscar-Williams in #300).
|
package/dist/config/paths.js
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { mkdirSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
|
-
import { resolve } from "node:path";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
// Like Pi's own agent-dir variable: a leading ~ in FEYNMAN_HOME (unexpanded in
|
|
5
|
+
// .env files, Docker ENV, or Windows shells) means the home folder.
|
|
6
|
+
export function expandHomePath(path, home = homedir()) {
|
|
7
|
+
if (path === "~")
|
|
8
|
+
return home;
|
|
9
|
+
return /^~[\\/]/.test(path) ? join(home, path.slice(2)) : path;
|
|
10
|
+
}
|
|
4
11
|
export function getFeynmanHome() {
|
|
5
|
-
return resolve(process.env.FEYNMAN_HOME ?? homedir(), ".feynman");
|
|
12
|
+
return resolve(expandHomePath(process.env.FEYNMAN_HOME ?? homedir()), ".feynman");
|
|
6
13
|
}
|
|
7
14
|
export function getFeynmanAgentDir(home = getFeynmanHome()) {
|
|
8
15
|
return resolve(home, "agent");
|
package/dist/pi/settings.js
CHANGED
|
@@ -180,15 +180,20 @@ export async function ensureFeynmanSettings(settingsPath, bundledSettingsPath, a
|
|
|
180
180
|
settings.defaultModel = preferredModel.id;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
183
|
+
// If another process wrote the subagent config while models were being
|
|
184
|
+
// discovered, keep its version instead of overwriting it or failing startup.
|
|
185
|
+
const subagentCurrent = subagentDefaults && existsSync(subagentDefaults.path) ? readFileSync(subagentDefaults.path, "utf8") : undefined;
|
|
186
|
+
if (subagentDefaults && subagentCurrent === subagentDefaults.original) {
|
|
188
187
|
mkdirSync(dirname(subagentDefaults.path), { recursive: true });
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
try {
|
|
189
|
+
writeFileSync(subagentDefaults.path, subagentDefaults.content, {
|
|
190
|
+
encoding: "utf8", mode: 0o600, flag: subagentDefaults.original === undefined ? "wx" : "w",
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
if (error.code !== "EEXIST")
|
|
195
|
+
throw error;
|
|
196
|
+
}
|
|
192
197
|
}
|
|
193
198
|
const content = JSON.stringify(settings, null, 2) + "\n";
|
|
194
199
|
if (content === existing?.source)
|