MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / classifyByPathHeuristic

Function classifyByPathHeuristic

apps/kimi-code/src/cli/update/source.ts:57–66  ·  view source on GitHub ↗
(packageRoot: string)

Source from the content-addressed store, hash-verified

55 * fall through to npm-prefix comparison).
56 */
57export function classifyByPathHeuristic(packageRoot: string): InstallSource | null {
58 const normalized = normalizeForHeuristic(packageRoot);
59 if (normalized.includes(PNPM_PATH_SEGMENT)) return 'pnpm-global';
60 for (const seg of YARN_PATH_SEGMENTS) {
61 if (normalized.includes(seg)) return 'yarn-global';
62 }
63 if (normalized.includes(BUN_PATH_SEGMENT)) return 'bun-global';
64 if (normalized.includes(HOMEBREW_PATH_SEGMENT)) return 'homebrew';
65 return null;
66}
67
68export interface DetectInstallSourceDeps {
69 readonly getPackageRoot: () => string;

Callers 2

source.test.tsFile · 0.90
detectInstallSourceFunction · 0.85

Calls 1

normalizeForHeuristicFunction · 0.85

Tested by

no test coverage detected