MCPcopy Index your code
hub / github.com/Waishnav/devspace / formatAgentsPath

Function formatAgentsPath

src/workspaces.ts:290–304  ·  view source on GitHub ↗
(path: string, workspaceRoot: string | undefined)

Source from the content-addressed store, hash-verified

288]);
289
290export 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
306async function walkWorkspace(
307 directory: string,

Callers 1

createMcpServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected