mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-07 15:52:52 +03:00
This change modifies the instantiation of TLSClient in chatgptTlsClient, claudeTlsClient, grokTlsClient, lmarenaTlsClient, notionTlsClient, and perplexityTlsClient to utilize the new buildNativeTlsClientOptions function. This refactor enhances consistency and maintainability across the TLS client implementations.
24 lines
675 B
TypeScript
24 lines
675 B
TypeScript
import { join } from "node:path";
|
|
import { resolveDataDir } from "@/lib/dataPaths";
|
|
|
|
/**
|
|
* Writable cache directory for tls-client-node's native binary.
|
|
*
|
|
* Without an explicit `downloadDir`, the library defaults to its own package
|
|
* `node_modules/tls-client-node/bin`, which is root-owned on global installs
|
|
* and fails with EACCES for normal users (#8579).
|
|
*/
|
|
export function resolveTlsClientDownloadDir(): string {
|
|
return join(resolveDataDir(), "tls-client", "bin");
|
|
}
|
|
|
|
export function buildNativeTlsClientOptions(): {
|
|
runtimeMode: "native";
|
|
downloadDir: string;
|
|
} {
|
|
return {
|
|
runtimeMode: "native",
|
|
downloadDir: resolveTlsClientDownloadDir(),
|
|
};
|
|
}
|