Skip to content

Commit 139fc23

Browse files
committed
fix(vfs); compiled check tool call natural language tool desc
1 parent b74f8da commit 139fc23

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

apps/sim/lib/copilot/tools/client/store-utils.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
110130
function getLeafResourceSegment(segments: string[]): string {
111131
const lastSegment = segments[segments.length - 1] || ''
112132
if (hasFileExtension(lastSegment) && segments.length > 1) {

0 commit comments

Comments
 (0)