File tree Expand file tree Collapse file tree 5 files changed +28
-7
lines changed
Expand file tree Collapse file tree 5 files changed +28
-7
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ export async function get_coverage_reportLogic(
6565
6666 const fileExistsValidation = validateFileExists ( xcresultPath , context . fileSystem ) ;
6767 if ( ! fileExistsValidation . isValid ) {
68- return fileExistsValidation . errorResponse ! ;
68+ return { content : [ { type : 'text' , text : fileExistsValidation . errorMessage ! } ] , isError : true } ;
6969 }
7070
7171 log ( 'info' , `Getting coverage report from: ${ xcresultPath } ` ) ;
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ export async function get_file_coverageLogic(
7777
7878 const fileExistsValidation = validateFileExists ( xcresultPath , context . fileSystem ) ;
7979 if ( ! fileExistsValidation . isValid ) {
80- return fileExistsValidation . errorResponse ! ;
80+ return { content : [ { type : 'text' , text : fileExistsValidation . errorMessage ! } ] , isError : true } ;
8181 }
8282
8383 log ( 'info' , `Getting file coverage for "${ file } " from: ${ xcresultPath } ` ) ;
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export async function launch_mac_appLogic(
3030 // Validate that the app file exists
3131 const fileExistsValidation = validateFileExists ( params . appPath , fileSystem ) ;
3232 if ( ! fileExistsValidation . isValid ) {
33- return fileExistsValidation . errorResponse ! ;
33+ return { content : [ { type : 'text' , text : fileExistsValidation . errorMessage ! } ] , isError : true } ;
3434 }
3535
3636 log ( 'info' , `Starting launch macOS app request for ${ params . appPath } ` ) ;
Original file line number Diff line number Diff line change @@ -48,7 +48,10 @@ export async function install_app_simLogic(
4848) : Promise < ToolResponse > {
4949 const appPathExistsValidation = validateFileExists ( params . appPath , fileSystem ) ;
5050 if ( ! appPathExistsValidation . isValid ) {
51- return appPathExistsValidation . errorResponse ! ;
51+ return {
52+ content : [ { type : 'text' , text : appPathExistsValidation . errorMessage ! } ] ,
53+ isError : true ,
54+ } ;
5255 }
5356
5457 log ( 'info' , `Starting xcrun simctl install request for simulator ${ params . simulatorId } ` ) ;
Original file line number Diff line number Diff line change 1- export { createTextResponse } from '../validation.ts' ;
1+ import type { ToolResponse , NextStep , OutputStyle } from '../../types/common.ts' ;
2+
3+ // Shim: createErrorResponse was removed in the handler-contract refactor but
4+ // ~35 consumer files still import it. They will be migrated in PRs 6-9.
5+ export function createErrorResponse ( message : string , details ?: string ) : ToolResponse {
6+ const detailText = details ? `\nDetails: ${ details } ` : '' ;
7+ return {
8+ content : [ { type : 'text' , text : `Error: ${ message } ${ detailText } ` } ] ,
9+ isError : true ,
10+ } ;
11+ }
12+
13+ // Shim: createTextResponse was removed from validation.ts
14+ export function createTextResponse ( message : string , isError = false ) : ToolResponse {
15+ return {
16+ content : [ { type : 'text' , text : message } ] ,
17+ ...( isError ? { isError : true } : { } ) ,
18+ } ;
19+ }
20+
221export {
3- createErrorResponse ,
422 DependencyError ,
523 AxeError ,
624 SystemError ,
@@ -12,4 +30,4 @@ export {
1230 renderNextStepsSection ,
1331} from './next-steps-renderer.ts' ;
1432
15- export type { ToolResponse , NextStep , OutputStyle } from '../../types/common.ts' ;
33+ export type { ToolResponse , NextStep , OutputStyle } ;
You can’t perform that action at this time.
0 commit comments