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

Function buildDeviceLogic

src/mcp/tools/device/build_device.ts:110–137  ·  view source on GitHub ↗
(
  params: BuildDeviceParams,
  executor: CommandExecutor,
)

Source from the content-addressed store, hash-verified

108}
109
110export async function buildDeviceLogic(
111 params: BuildDeviceParams,
112 executor: CommandExecutor,
113): Promise<void> {
114 const ctx = getHandlerContext();
115 const invocationRequest = createBuildDeviceRequest(params);
116
117 ctx.emit(createBuildInvocationFragment('build-result', 'BUILD', invocationRequest));
118 const executionContext = createStreamingExecutionContext(ctx);
119 const executeBuildDevice = createBuildDeviceExecutor(executor);
120 const result = await executeBuildDevice(params, executionContext);
121
122 setXcodebuildStructuredOutput(ctx, 'build-result', result);
123
124 if (!result.didError) {
125 ctx.nextStepParams = {
126 get_device_app_path: {
127 scheme: params.scheme,
128 ...(params.derivedDataPath !== undefined
129 ? { derivedDataPath: params.derivedDataPath }
130 : {}),
131 ...(params.platform !== undefined
132 ? { platform: String(mapDevicePlatform(params.platform)) }
133 : {}),
134 },
135 };
136 }
137}
138
139export const schema = getSessionAwareToolSchemaShape({
140 sessionAware: publicSchemaObject,

Callers 1

Calls 8

getHandlerContextFunction · 0.90
mapDevicePlatformFunction · 0.90
createBuildDeviceRequestFunction · 0.85
emitMethod · 0.80

Tested by

no test coverage detected