MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / outsideCwdHint

Function outsideCwdHint

src/utils/path-hint.ts:10–16  ·  view source on GitHub ↗
(givenPath: string, resolved: string, cwd: string)

Source from the content-addressed store, hash-verified

8 * Returns '' for relative paths or paths inside cwd (no nudge needed).
9 */
10export function outsideCwdHint(givenPath: string, resolved: string, cwd: string): string {
11 if (!path.isAbsolute(givenPath)) return '';
12 const rel = path.relative(cwd, resolved);
13 const inside = rel === '' || (!rel.startsWith('..') && !path.isAbsolute(rel));
14 if (inside) return '';
15 return ` NOTE: that is an absolute path OUTSIDE your working directory. You are in \`${cwd}\` — use paths relative to it (e.g. \`src/...\`), not invented roots like /home/user or /tmp.`;
16}

Callers 3

executeMethod · 0.85
executeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected