File tree Expand file tree Collapse file tree
apps/sim/lib/copilot/tools/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,6 +96,9 @@ function describeReadTarget(path: string | undefined): string | undefined {
9696 }
9797
9898 if ( resourceType === 'file' ) {
99+ const compiledCheckTarget = describeCompiledCheckTarget ( segments )
100+ if ( compiledCheckTarget ) return compiledCheckTarget
101+
99102 return segments . slice ( 1 ) . join ( '/' ) || segments [ segments . length - 1 ]
100103 }
101104
@@ -107,6 +110,23 @@ function describeReadTarget(path: string | undefined): string | undefined {
107110 return stripExtension ( resourceName )
108111}
109112
113+ function describeCompiledCheckTarget ( segments : string [ ] ) : string | undefined {
114+ if ( segments [ segments . length - 1 ] !== 'compiled-check' ) return undefined
115+
116+ const byIdIndex = segments . indexOf ( 'by-id' )
117+ if ( byIdIndex >= 0 ) {
118+ const fileName = segments [ byIdIndex + 2 ]
119+ if ( fileName && fileName !== 'compiled-check' ) {
120+ return `the compile check for ${ fileName } `
121+ }
122+ return 'the compile check for this file'
123+ }
124+
125+ const fileName = segments . slice ( 1 , - 1 ) . join ( '/' )
126+ if ( ! fileName ) return 'the compile check for this file'
127+ return `the compile check for ${ fileName } `
128+ }
129+
110130function getLeafResourceSegment ( segments : string [ ] ) : string {
111131 const lastSegment = segments [ segments . length - 1 ] || ''
112132 if ( hasFileExtension ( lastSegment ) && segments . length > 1 ) {
You can’t perform that action at this time.
0 commit comments