MCPcopy Create free account
hub / github.com/code-with-antonio/nightcode / resolveInsideCwd

Function resolveInsideCwd

packages/cli/src/lib/local-tools.ts:11–21  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

9const DEFAULT_TIMEOUT = 30_000;
10
11function resolveInsideCwd(path: string) {
12 const cwd = process.cwd();
13 const resolved = resolve(cwd, path);
14 const rel = relative(cwd, resolved);
15
16 if (rel.startsWith("..") || isAbsolute(rel)) {
17 throw new Error("Path is outside the project directory");
18 }
19
20 return { cwd, resolved };
21}
22
23function truncate(value: string, limit: number) {
24 return value.length > limit

Callers 1

executeLocalToolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected