MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / detectEnvironmentFromNode

Function detectEnvironmentFromNode

packages/kaos/src/environment.ts:242–263  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

240let detectedEnvironment: Promise<Environment> | undefined;
241
242export function detectEnvironmentFromNode(): Promise<Environment> {
243 if (detectedEnvironment !== undefined) return detectedEnvironment;
244 const platform = process.platform;
245 const env = process.env as Record<string, string | undefined>;
246 const isFile = async (path: string): Promise<boolean> => {
247 try {
248 await access(path, fsConstants.F_OK);
249 return true;
250 } catch {
251 return false;
252 }
253 };
254 detectedEnvironment = detectEnvironment({
255 platform,
256 arch: process.arch,
257 release: nodeOs.release(),
258 env,
259 isFile,
260 execFileText,
261 });
262 return detectedEnvironment;
263}
264
265async function findExecutablesOnPath(
266 name: string,

Callers 1

createMethod · 0.90

Calls 2

detectEnvironmentFunction · 0.85
releaseMethod · 0.65

Tested by

no test coverage detected