fix(coding-agent): handle git/npm extension paths in CLI resolution (#2845)
This commit is contained in:
20
packages/coding-agent/src/utils/paths.ts
Normal file
20
packages/coding-agent/src/utils/paths.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Returns true if the value is NOT a package source (npm:, git:, etc.)
|
||||
* or a URL protocol. Bare names and relative paths without ./ prefix
|
||||
* are considered local.
|
||||
*/
|
||||
export function isLocalPath(value: string): boolean {
|
||||
const trimmed = value.trim();
|
||||
// Known non-local prefixes
|
||||
if (
|
||||
trimmed.startsWith("npm:") ||
|
||||
trimmed.startsWith("git:") ||
|
||||
trimmed.startsWith("github:") ||
|
||||
trimmed.startsWith("http:") ||
|
||||
trimmed.startsWith("https:") ||
|
||||
trimmed.startsWith("ssh:")
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user