MCPcopy Index your code
hub / github.com/callstack/agent-device / resolveLocalLinuxTool

Function resolveLocalLinuxTool

src/platforms/linux/tool-provider.ts:290–299  ·  view source on GitHub ↗
(
  whichCommand: LinuxToolAvailabilityChecker,
  config: LocalLinuxToolConfig<T>,
)

Source from the content-addressed store, hash-verified

288};
289
290async function resolveLocalLinuxTool<T extends string>(
291 whichCommand: LinuxToolAvailabilityChecker,
292 config: LocalLinuxToolConfig<T>,
293): Promise<T> {
294 const display = isLinuxWayland() ? 'wayland' : 'x11';
295 for (const candidate of config[display]) {
296 if (await whichCommand(candidate.command)) return candidate.tool;
297 }
298 throw new AppError('TOOL_MISSING', display === 'wayland' ? config.waylandError : config.x11Error);
299}
300
301function isLinuxWayland(): boolean {
302 return Boolean(process.env['WAYLAND_DISPLAY']) || process.env['XDG_SESSION_TYPE'] === 'wayland';

Callers 3

readTextFunction · 0.85
writeTextFunction · 0.85
captureFunction · 0.85

Calls 1

isLinuxWaylandFunction · 0.85

Tested by

no test coverage detected