MCPcopy Create free account
hub / github.com/getsentry/XcodeBuildMCP / createLaunchMacAppExecutor

Function createLaunchMacAppExecutor

src/mcp/tools/macos/launch_mac_app.ts:45–84  ·  view source on GitHub ↗
(
  executor: CommandExecutor,
  fileSystem?: FileSystemExecutor,
)

Source from the content-addressed store, hash-verified

43}
44
45export function createLaunchMacAppExecutor(
46 executor: CommandExecutor,
47 fileSystem?: FileSystemExecutor,
48): NonStreamingExecutor<LaunchMacAppParams, LaunchMacAppResult> {
49 return async (params) => {
50 const baseArtifacts = { appPath: params.appPath };
51
52 const fileExistsValidation = validateFileExists(params.appPath, fileSystem);
53 if (!fileExistsValidation.isValid) {
54 return buildLaunchFailure(
55 baseArtifacts,
56 fileExistsValidation.errorMessage ?? `File not found: '${params.appPath}'`,
57 );
58 }
59
60 log('info', `Starting launch macOS app request for ${params.appPath}`);
61
62 try {
63 const result = await launchMacApp(params.appPath, executor, { args: params.launchArgs });
64
65 if (!result.success) {
66 return buildLaunchFailure(
67 baseArtifacts,
68 `Launch macOS app operation failed: ${result.error}`,
69 );
70 }
71
72 return buildLaunchSuccess({
73 ...baseArtifacts,
74 ...(result.bundleId ? { bundleId: result.bundleId } : {}),
75 ...(result.processId !== undefined ? { processId: result.processId } : {}),
76 });
77 } catch (error) {
78 return buildLaunchFailure(
79 baseArtifacts,
80 `Launch macOS app operation failed: ${toErrorMessage(error)}`,
81 );
82 }
83 };
84}
85
86export const schema = launchMacAppSchema.shape;
87

Callers 1

launch_mac_appLogicFunction · 0.85

Calls 6

validateFileExistsFunction · 0.90
buildLaunchFailureFunction · 0.90
logFunction · 0.90
launchMacAppFunction · 0.90
buildLaunchSuccessFunction · 0.90
toErrorMessageFunction · 0.90

Tested by

no test coverage detected