harden installers rendering and dependency hygiene

This commit is contained in:
Advait Paliwal
2026-04-09 10:27:23 -07:00
parent 3148f2e62b
commit 96234425ba
14 changed files with 138 additions and 75 deletions

View File

@@ -1,6 +1,7 @@
import { existsSync, readFileSync } from "node:fs";
import { homedir } from "node:os";
import { resolve } from "node:path";
import { getFeynmanHome } from "../config/paths.js";
export type PiWebSearchProvider = "auto" | "perplexity" | "exa" | "gemini";
@@ -26,8 +27,9 @@ export type PiWebAccessStatus = {
note: string;
};
export function getPiWebSearchConfigPath(home = process.env.HOME ?? homedir()): string {
return resolve(home, ".feynman", "web-search.json");
export function getPiWebSearchConfigPath(home?: string): string {
const feynmanHome = home ? resolve(home, ".feynman") : getFeynmanHome();
return resolve(feynmanHome, "web-search.json");
}
function normalizeProvider(value: unknown): PiWebSearchProvider | undefined {