remove stale web access override
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { existsSync, readFileSync } from "node:fs";
|
||||
import { homedir } from "node:os";
|
||||
import { resolve } from "node:path";
|
||||
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { dirname, resolve } from "node:path";
|
||||
import { getFeynmanHome } from "../config/paths.js";
|
||||
|
||||
export type PiWebSearchProvider = "auto" | "perplexity" | "exa" | "gemini";
|
||||
@@ -53,6 +52,23 @@ export function loadPiWebAccessConfig(configPath = getPiWebSearchConfigPath()):
|
||||
}
|
||||
}
|
||||
|
||||
export function savePiWebAccessConfig(
|
||||
updates: Partial<Record<keyof PiWebAccessConfig, unknown>>,
|
||||
configPath = getPiWebSearchConfigPath(),
|
||||
): void {
|
||||
const merged: Record<string, unknown> = { ...loadPiWebAccessConfig(configPath) };
|
||||
for (const [key, value] of Object.entries(updates)) {
|
||||
if (value === undefined) {
|
||||
delete merged[key];
|
||||
} else {
|
||||
merged[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
mkdirSync(dirname(configPath), { recursive: true });
|
||||
writeFileSync(configPath, JSON.stringify(merged, null, 2) + "\n", "utf8");
|
||||
}
|
||||
|
||||
function formatRouteLabel(provider: PiWebSearchProvider): string {
|
||||
switch (provider) {
|
||||
case "perplexity":
|
||||
|
||||
Reference in New Issue
Block a user