Skip to content

Commit 30258f7

Browse files
committed
Fix
1 parent 6974393 commit 30258f7

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

.smithery/index.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Future builds will use the generated Makefile for improved performance.
119119
3. Launch: launch_app_sim({ ${I}: '${N}', bundleId: 'BUNDLE_ID_FROM_STEP_2' })
120120
Or with logs: launch_app_logs_sim({ ${I}: '${N}', bundleId: 'BUNDLE_ID_FROM_STEP_2' })`}}let w={content:[...s,{type:"text",text:`\u2705 ${e.logPrefix} ${n} succeeded for scheme ${t.scheme}.`}]};return x&&w.content.push({type:"text",text:x}),Sp(w)}catch(p){let f=p instanceof Error?p.message:String(p),m=p instanceof Error&&"code"in p&&["ENOENT","EACCES","EPERM"].includes(p.code??"");return A("error",`Error during ${e.logPrefix} ${n}: ${f}`,{sentry:!m}),Sp(le(`Error during ${e.logPrefix} ${n}: ${f}`,!0))}}var x2,zre=O(()=>{"use strict";Go();Mre();Qh();b2();tg();x2=W(require("path"),1)});var Uc=O(()=>{"use strict";zre()});function pr(t){if(t&&typeof t=="object"&&!Array.isArray(t)){let e={...t};for(let r of Object.keys(e)){let n=e[r];typeof n=="string"&&n.trim()===""&&(e[r]=void 0)}return e}return t}var wo=O(()=>{"use strict"});var qre={};Y(qre,{buildDeviceLogic:()=>Fre,default:()=>RJe});async function Fre(t,e){let r={...t,configuration:t.configuration??"Debug"};return Ln(r,{platform:"iOS",logPrefix:"iOS Device Build"},t.preferXcodebuild??!1,"build",e)}var A2,AJe,wJe,RJe,Bre=O(()=>{"use strict";Te();Dn();Uc();ze();Le();wo();A2=k({projectPath:T().optional().describe("Path to the .xcodeproj file"),workspacePath:T().optional().describe("Path to the .xcworkspace file"),scheme:T().describe("The scheme to build"),configuration:T().optional().describe("Build configuration (Debug, Release)"),derivedDataPath:T().optional().describe("Path to derived data directory"),extraArgs:H(T()).optional().describe("Additional arguments to pass to xcodebuild"),preferXcodebuild:ue().optional().describe("Prefer xcodebuild over faster alternatives")}),AJe=Bt(pr,A2.refine(t=>t.projectPath!==void 0||t.workspacePath!==void 0,{error:"Either projectPath or workspacePath is required."}).refine(t=>!(t.projectPath!==void 0&&t.workspacePath!==void 0),{error:"projectPath and workspacePath are mutually exclusive. Provide only one."})),wJe=A2.omit({projectPath:!0,workspacePath:!0,scheme:!0,configuration:!0});RJe={name:"build_device",description:"Builds an app for a connected device.",schema:de({sessionAware:wJe,legacy:A2}),annotations:{title:"Build Device",destructiveHint:!0},handler:fe({internalSchema:AJe,logicFunction:Fre,getExecutor:z,requirements:[{allOf:["scheme"],message:"scheme is required"},{oneOf:["projectPath","workspacePath"],message:"Provide a project or workspace"}],exclusivePairs:[["projectPath","workspacePath"]]})}});var Vre={};Y(Vre,{cleanLogic:()=>Gre,default:()=>bf});async function Gre(t,e){if(t.workspacePath&&!t.scheme)return ge("Parameter validation failed",`Invalid parameters:
121121
scheme: scheme is required when workspacePath is provided.`);let r=t.platform??"iOS",o={macOS:"macOS",iOS:"iOS","iOS Simulator":"iOS Simulator",watchOS:"watchOS","watchOS Simulator":"watchOS Simulator",tvOS:"tvOS","tvOS Simulator":"tvOS Simulator",visionOS:"visionOS","visionOS Simulator":"visionOS Simulator"}[r];if(!o)return ge("Parameter validation failed",`Invalid parameters:
122-
platform: unsupported value "${r}".`);let s={...typeof t.projectPath=="string"?{projectPath:t.projectPath}:{workspacePath:t.workspacePath},scheme:t.scheme??"",configuration:t.configuration??"Debug",derivedDataPath:t.derivedDataPath,extraArgs:t.extraArgs},c={"iOS Simulator":"iOS","watchOS Simulator":"watchOS","tvOS Simulator":"tvOS","visionOS Simulator":"visionOS"}[o]??o;return Ln(s,{platform:c,logPrefix:"Clean"},!1,"clean",e)}var PJe,w2,IJe,OJe,bf,PE=O(()=>{"use strict";Te();Le();ze();Uc();Dn();hr();wo();PJe={scheme:T().optional().describe("Optional: The scheme to clean"),configuration:T().optional().describe("Optional: Build configuration to clean (Debug, Release, etc.)"),derivedDataPath:T().optional().describe("Optional: Path where derived data might be located"),extraArgs:H(T()).optional().describe("Additional xcodebuild arguments"),preferXcodebuild:ue().optional().describe("If true, prefers xcodebuild over the experimental incremental build system, useful for when incremental build system fails."),platform:Ze(["macOS","iOS","iOS Simulator","watchOS","watchOS Simulator","tvOS","tvOS Simulator","visionOS","visionOS Simulator"]).optional().describe("Optional: Platform to clean for (defaults to iOS). Choose from macOS, iOS, iOS Simulator, watchOS, watchOS Simulator, tvOS, tvOS Simulator, visionOS, visionOS Simulator")},w2=k({projectPath:T().optional().describe("Path to the .xcodeproj file"),workspacePath:T().optional().describe("Path to the .xcworkspace file"),...PJe}),IJe=Bt(pr,w2.refine(t=>t.projectPath!==void 0||t.workspacePath!==void 0,{error:"Either projectPath or workspacePath is required."}).refine(t=>!(t.projectPath!==void 0&&t.workspacePath!==void 0),{error:"projectPath and workspacePath are mutually exclusive. Provide only one."}).refine(t=>!(t.workspacePath&&!t.scheme),{error:"scheme is required when workspacePath is provided.",path:["scheme"]}));OJe=w2.omit({projectPath:!0,workspacePath:!0,scheme:!0,configuration:!0}),bf={name:"clean",description:"Cleans build products with xcodebuild.",schema:de({sessionAware:OJe,legacy:w2}),annotations:{title:"Clean",destructiveHint:!0},handler:fe({internalSchema:IJe,logicFunction:Gre,getExecutor:z,requirements:[{oneOf:["projectPath","workspacePath"],message:"Provide a project or workspace"}],exclusivePairs:[["projectPath","workspacePath"]]})}});var Hre={};Y(Hre,{default:()=>bf});var Wre=O(()=>{"use strict";PE()});var Xre={};Y(Xre,{default:()=>xf,discover_projsLogic:()=>Jre});async function Yre(t,e,r,n,o,i=Ir()){if(r>=n){A("debug",`Max depth ${n} reached at ${t}, stopping recursion.`);return}A("debug",`Scanning directory: ${t} at depth ${r}`);let s=Ya.normalize(e);try{let a=await i.readdir(t,{withFileTypes:!0});for(let c of a){let u=c,p=Ya.join(t,u.name),f=Ya.relative(e,p);if(u.isSymbolicLink()){A("debug",`Skipping symbolic link: ${f}`);continue}if(u.isDirectory()&&NJe.has(u.name)){A("debug",`Skipping standard directory: ${f}`);continue}if(!Ya.normalize(p).startsWith(s)){A("warn",`Skipping entry outside workspace root: ${p} (Workspace: ${e})`);continue}if(u.isDirectory()){let m=!1;u.name.endsWith(".xcodeproj")?(o.projects.push(p),A("debug",`Found project: ${p}`),m=!0):u.name.endsWith(".xcworkspace")&&(o.workspaces.push(p),A("debug",`Found workspace: ${p}`),m=!0),m||await Yre(p,e,r+1,n,o,i)}}}catch(a){let c,u="Unknown error";a instanceof Error?(u=a.message,"code"in a&&(c=a.code)):typeof a=="object"&&a!==null?("message"in a&&typeof a.message=="string"&&(u=a.message),"code"in a&&typeof a.code=="string"&&(c=a.code)):u=String(a),c==="EPERM"||c==="EACCES"?A("debug",`Permission denied scanning directory: ${t}`):A("warning",`Error scanning directory ${t}: ${u} (Code: ${c??"N/A"})`)}}async function Jre(t,e){let r=t.scanPath??".",n=t.maxDepth??Zre,o=t.workspaceRoot,i=r,a=Ya.resolve(o,i??"."),c=Ya.normalize(o);Ya.normalize(a).startsWith(c)||(A("warn",`Requested scan path '${i}' resolved outside workspace root '${o}'. Defaulting scan to workspace root.`),a=c);let u={projects:[],workspaces:[]};A("info",`Starting project discovery request: path=${a}, maxDepth=${n}, workspace=${o}`);try{if(!(await e.stat(a)).isDirectory()){let m=`Scan path is not a directory: ${a}`;return A("error",m),{content:[Lt(m)],isError:!0}}}catch(f){let m,h="Unknown error accessing scan path";f instanceof Error?(h=f.message,"code"in f&&(m=f.code)):typeof f=="object"&&f!==null?("message"in f&&typeof f.message=="string"&&(h=f.message),"code"in f&&typeof f.code=="string"&&(m=f.code)):h=String(f);let _=`Failed to access scan path: ${a}. Error: ${h}`;return A("error",`${_} - Code: ${m??"N/A"}`),{content:[Lt(_)],isError:!0}}await Yre(a,o,0,n,u,e),A("info",`Discovery finished. Found ${u.projects.length} projects and ${u.workspaces.length} workspaces.`);let p=[Lt(`Discovery finished. Found ${u.projects.length} projects and ${u.workspaces.length} workspaces.`)];return u.projects.sort(),u.workspaces.sort(),u.projects.length>0&&p.push(Lt(`Projects found:
122+
platform: unsupported value "${r}".`);let s={...typeof t.projectPath=="string"?{projectPath:t.projectPath}:{workspacePath:t.workspacePath},scheme:t.scheme??"",configuration:t.configuration??"Debug",derivedDataPath:t.derivedDataPath,extraArgs:t.extraArgs},c={"iOS Simulator":"iOS","watchOS Simulator":"watchOS","tvOS Simulator":"tvOS","visionOS Simulator":"visionOS"}[o]??o;return Ln(s,{platform:c,logPrefix:"Clean"},!1,"clean",e)}var PJe,w2,IJe,OJe,bf,PE=O(()=>{"use strict";Te();Le();ze();Uc();Dn();hr();wo();PJe={scheme:T().optional().describe("Optional: The scheme to clean"),configuration:T().optional().describe("Optional: Build configuration to clean (Debug, Release, etc.)"),derivedDataPath:T().optional().describe("Optional: Path where derived data might be located"),extraArgs:H(T()).optional().describe("Additional xcodebuild arguments"),preferXcodebuild:ue().optional().describe("If true, prefers xcodebuild over the experimental incremental build system, useful for when incremental build system fails."),platform:Ze(["macOS","iOS","iOS Simulator","watchOS","watchOS Simulator","tvOS","tvOS Simulator","visionOS","visionOS Simulator"]).optional().describe("Optional: Platform to clean for (defaults to iOS). Choose from macOS, iOS, iOS Simulator, watchOS, watchOS Simulator, tvOS, tvOS Simulator, visionOS, visionOS Simulator")},w2=k({projectPath:T().optional().describe("Path to the .xcodeproj file"),workspacePath:T().optional().describe("Path to the .xcworkspace file"),...PJe}),IJe=Bt(pr,w2.refine(t=>t.projectPath!==void 0||t.workspacePath!==void 0,{message:"Either projectPath or workspacePath is required."}).refine(t=>!(t.projectPath!==void 0&&t.workspacePath!==void 0),{message:"projectPath and workspacePath are mutually exclusive. Provide only one."}).refine(t=>!(t.workspacePath&&!t.scheme),{message:"scheme is required when workspacePath is provided.",path:["scheme"]}));OJe=w2.omit({projectPath:!0,workspacePath:!0,scheme:!0,configuration:!0}),bf={name:"clean",description:"Cleans build products with xcodebuild.",schema:de({sessionAware:OJe,legacy:w2}),annotations:{title:"Clean",destructiveHint:!0},handler:fe({internalSchema:IJe,logicFunction:Gre,getExecutor:z,requirements:[{oneOf:["projectPath","workspacePath"],message:"Provide a project or workspace"}],exclusivePairs:[["projectPath","workspacePath"]]})}});var Hre={};Y(Hre,{default:()=>bf});var Wre=O(()=>{"use strict";PE()});var Xre={};Y(Xre,{default:()=>xf,discover_projsLogic:()=>Jre});async function Yre(t,e,r,n,o,i=Ir()){if(r>=n){A("debug",`Max depth ${n} reached at ${t}, stopping recursion.`);return}A("debug",`Scanning directory: ${t} at depth ${r}`);let s=Ya.normalize(e);try{let a=await i.readdir(t,{withFileTypes:!0});for(let c of a){let u=c,p=Ya.join(t,u.name),f=Ya.relative(e,p);if(u.isSymbolicLink()){A("debug",`Skipping symbolic link: ${f}`);continue}if(u.isDirectory()&&NJe.has(u.name)){A("debug",`Skipping standard directory: ${f}`);continue}if(!Ya.normalize(p).startsWith(s)){A("warn",`Skipping entry outside workspace root: ${p} (Workspace: ${e})`);continue}if(u.isDirectory()){let m=!1;u.name.endsWith(".xcodeproj")?(o.projects.push(p),A("debug",`Found project: ${p}`),m=!0):u.name.endsWith(".xcworkspace")&&(o.workspaces.push(p),A("debug",`Found workspace: ${p}`),m=!0),m||await Yre(p,e,r+1,n,o,i)}}}catch(a){let c,u="Unknown error";a instanceof Error?(u=a.message,"code"in a&&(c=a.code)):typeof a=="object"&&a!==null?("message"in a&&typeof a.message=="string"&&(u=a.message),"code"in a&&typeof a.code=="string"&&(c=a.code)):u=String(a),c==="EPERM"||c==="EACCES"?A("debug",`Permission denied scanning directory: ${t}`):A("warning",`Error scanning directory ${t}: ${u} (Code: ${c??"N/A"})`)}}async function Jre(t,e){let r=t.scanPath??".",n=t.maxDepth??Zre,o=t.workspaceRoot,i=r,a=Ya.resolve(o,i??"."),c=Ya.normalize(o);Ya.normalize(a).startsWith(c)||(A("warn",`Requested scan path '${i}' resolved outside workspace root '${o}'. Defaulting scan to workspace root.`),a=c);let u={projects:[],workspaces:[]};A("info",`Starting project discovery request: path=${a}, maxDepth=${n}, workspace=${o}`);try{if(!(await e.stat(a)).isDirectory()){let m=`Scan path is not a directory: ${a}`;return A("error",m),{content:[Lt(m)],isError:!0}}}catch(f){let m,h="Unknown error accessing scan path";f instanceof Error?(h=f.message,"code"in f&&(m=f.code)):typeof f=="object"&&f!==null?("message"in f&&typeof f.message=="string"&&(h=f.message),"code"in f&&typeof f.code=="string"&&(m=f.code)):h=String(f);let _=`Failed to access scan path: ${a}. Error: ${h}`;return A("error",`${_} - Code: ${m??"N/A"}`),{content:[Lt(_)],isError:!0}}await Yre(a,o,0,n,u,e),A("info",`Discovery finished. Found ${u.projects.length} projects and ${u.workspaces.length} workspaces.`);let p=[Lt(`Discovery finished. Found ${u.projects.length} projects and ${u.workspaces.length} workspaces.`)];return u.projects.sort(),u.workspaces.sort(),u.projects.length>0&&p.push(Lt(`Projects found:
123123
- ${u.projects.join(`
124124
- `)}`)),u.workspaces.length>0&&p.push(Lt(`Workspaces found:
125125
- ${u.workspaces.join(`

src/mcp/tools/utilities/clean.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ const cleanSchema = z.preprocess(
6363
nullifyEmptyStrings,
6464
baseSchemaObject
6565
.refine((val) => val.projectPath !== undefined || val.workspacePath !== undefined, {
66-
error: 'Either projectPath or workspacePath is required.',
66+
message: 'Either projectPath or workspacePath is required.',
6767
})
6868
.refine((val) => !(val.projectPath !== undefined && val.workspacePath !== undefined), {
69-
error: 'projectPath and workspacePath are mutually exclusive. Provide only one.',
69+
message: 'projectPath and workspacePath are mutually exclusive. Provide only one.',
7070
})
7171
.refine((val) => !(val.workspacePath && !val.scheme), {
72-
error: 'scheme is required when workspacePath is provided.',
72+
message: 'scheme is required when workspacePath is provided.',
7373
path: ['scheme'],
7474
}),
7575
);

0 commit comments

Comments
 (0)