forked from getsentry/XcodeBuildMCP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.ts
More file actions
91 lines (84 loc) · 2.28 KB
/
common.ts
File metadata and controls
91 lines (84 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/**
* Common type definitions used across the server
*
* This module provides core type definitions and interfaces used throughout the codebase.
* It establishes a consistent type system for platform identification, tool responses,
* and other shared concepts.
*
* Responsibilities:
* - Defining the XcodePlatform enum for platform identification
* - Establishing the ToolResponse interface for standardized tool outputs
* - Providing ToolResponseContent types for different response formats
* - Supporting error handling with standardized error response types
*/
/**
* Enum representing Xcode build platforms.
*/
export enum XcodePlatform {
macOS = 'macOS',
iOS = 'iOS',
iOSSimulator = 'iOS Simulator',
watchOS = 'watchOS',
watchOSSimulator = 'watchOS Simulator',
tvOS = 'tvOS',
tvOSSimulator = 'tvOS Simulator',
visionOS = 'visionOS',
visionOSSimulator = 'visionOS Simulator',
}
/**
* ToolResponse - Standard response format for tools
* Compatible with MCP CallToolResult interface from the SDK
*/
export interface ToolResponse {
content: ToolResponseContent[];
isError?: boolean;
_meta?: Record<string, unknown>;
rawOutput?: string; // Raw output from command execution
[key: string]: unknown; // Index signature to match CallToolResult
}
/**
* Contents that can be included in a tool response
*/
export type ToolResponseContent = {
type: 'text';
text: string;
[key: string]: unknown; // Index signature to match ContentItem
};
/**
* ValidationResult - Result of parameter validation operations
*/
export interface ValidationResult {
isValid: boolean;
errorResponse?: ToolResponse;
warningResponse?: ToolResponse;
}
/**
* XcodeCommandResponse - Result of xcodebuild command execution
*/
export interface XcodeCommandResponse {
success: boolean;
output: string;
error?: string;
}
/**
* Interface for shared build parameters
*/
export interface SharedBuildParams {
workspacePath?: string;
projectPath?: string;
scheme: string;
configuration: string;
derivedDataPath?: string;
extraArgs?: string[];
}
/**
* Interface for platform-specific build options
*/
export interface PlatformBuildOptions {
platform: XcodePlatform;
simulatorName?: string;
simulatorId?: string;
useLatestOS?: boolean;
arch?: string;
logPrefix: string;
}