| 288 | ]); |
| 289 | |
| 290 | export function formatAgentsPath(path: string, workspaceRoot: string | undefined): string { |
| 291 | if (!workspaceRoot) return path.split(sep).join("/"); |
| 292 | |
| 293 | const relationship = relative(workspaceRoot, path); |
| 294 | if ( |
| 295 | relationship === "" || |
| 296 | relationship.startsWith("..") || |
| 297 | relationship === ".." || |
| 298 | relationship.includes(`..${sep}`) |
| 299 | ) { |
| 300 | return path.split(sep).join("/"); |
| 301 | } |
| 302 | |
| 303 | return relationship.split(sep).join("/"); |
| 304 | } |
| 305 | |
| 306 | async function walkWorkspace( |
| 307 | directory: string, |