MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / query

Function query

src/mcp/process-identity.ts:50–59  ·  view source on GitHub ↗

Runs a short OS query and resolves its stdout, or null when it fails or times out.

(file: string, args: string[])

Source from the content-addressed store, hash-verified

48
49/** Runs a short OS query and resolves its stdout, or null when it fails or times out. */
50function query(file: string, args: string[]): Promise<string | null> {
51 return new Promise((resolve) => {
52 try {
53 execFile(file, args, { encoding: 'utf8', timeout: lookupTimeoutMs(), windowsHide: true, maxBuffer: 1 << 20 },
54 (error, stdout) => resolve(error ? null : stdout));
55 } catch {
56 resolve(null);
57 }
58 });
59}
60
61function windowsTool(...parts: string[]): string {
62 return path.join(process.env.SystemRoot || process.env.windir || 'C:\\Windows', 'System32', ...parts);

Callers 2

describeWindowsProcessFunction · 0.70
describePsProcessFunction · 0.70

Calls 2

lookupTimeoutMsFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected