fix(coding-agent): handle git/npm extension paths in CLI resolution (#2845)

This commit is contained in:
Aliou Diallo
2026-04-05 18:42:14 +02:00
committed by GitHub
parent 1a6a58eb05
commit 71e4436932
5 changed files with 29 additions and 13 deletions

View 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;
}