{"version":3,"file":"paths.mjs","names":[],"sources":["../../src/files-touched/paths.ts"],"sourcesContent":["import * as fs from 'node:fs';\nimport path from 'node:path';\n\n// ---------------------------------------------------------------------------\n// String utilities\n// ---------------------------------------------------------------------------\n\nexport function uniqStrings(values: string[]): string[] {\n\tconst seen = new Set<string>();\n\tconst out: string[] = [];\n\tfor (const value of values) {\n\t\tconst trimmed = value.trim();\n\t\tif (!trimmed || seen.has(trimmed)) continue;\n\t\tseen.add(trimmed);\n\t\tout.push(trimmed);\n\t}\n\treturn out;\n}\n\nexport function normalizePathSeparators(value: string): string {\n\treturn value.replace(/\\\\/g, '/');\n}\n\nfunction normalizeSegments(value: string): string {\n\tconst normalized = normalizePathSeparators(value);\n\tconst segments: string[] = [];\n\tfor (const segment of normalized.split('/')) {\n\t\tif (!segment || segment === '.') continue;\n\t\tif (segment === '..') {\n\t\t\tif (segments.length > 0 && segments[segments.length - 1] !== '..') {\n\t\t\t\tsegments.pop();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tsegments.push(segment);\n\t}\n\treturn segments.join('/');\n}\n\nexport function normalizeRelativePath(value: string): string {\n\treturn normalizeSegments(value.trim());\n}\n\nexport function normalizeAbsolutePath(value: string): string {\n\tconst normalized = normalizePathSeparators(value.trim());\n\tconst windowsMatch = normalized.match(/^([A-Za-z]:)(?:\\/(.*))?$/);\n\tif (windowsMatch) {\n\t\tconst segments = normalizeSegments(windowsMatch[2] ?? '');\n\t\treturn segments ? `${windowsMatch[1]}/${segments}` : `${windowsMatch[1]}/`;\n\t}\n\tconst segments = normalizeSegments(normalized);\n\treturn segments ? `/${segments}` : '/';\n}\n\nexport function isAbsolutePath(value: string): boolean {\n\tconst normalized = normalizePathSeparators(value.trim());\n\treturn normalized.startsWith('/') || /^[A-Za-z]:\\//.test(normalized);\n}\n\nexport function stripReadSliceSuffix(value: string): string {\n\treturn value.replace(/:(\\d+)-(\\d+)$/, '');\n}\n\n// ---------------------------------------------------------------------------\n// Root-prefixed path parsing\n// ---------------------------------------------------------------------------\n\ntype ParsedRootPrefixedPath = {\n\troot: string;\n\trelativePath: string;\n};\n\ntype RootInfo = {\n\tabsolutePath: string;\n\tname: string;\n};\n\nexport function parseRootPrefixedPath(value: string): ParsedRootPrefixedPath | null {\n\tconst normalized = normalizePathSeparators(value.trim());\n\tif (!normalized || isAbsolutePath(normalized)) return null;\n\tconst match = normalized.match(/^([^/:]+):(.*)$/);\n\tif (!match) return null;\n\tconst relativePath = normalizeRelativePath(match[2] ?? '');\n\tif (!relativePath) return null;\n\treturn { root: match[1], relativePath };\n}\n\nfunction splitPathSegments(value: string): string[] {\n\treturn normalizePathSeparators(value).split('/').filter(Boolean);\n}\n\nfunction deriveRootFromAbsoluteAndRelative(absPath: string, relativePath: string): string | null {\n\tconst absSegments = splitPathSegments(normalizeAbsolutePath(absPath));\n\tconst relSegments = splitPathSegments(normalizeRelativePath(relativePath));\n\tif (relSegments.length === 0 || absSegments.length <= relSegments.length) return null;\n\tfor (let index = 1; index <= relSegments.length; index += 1) {\n\t\tif (absSegments[absSegments.length - index] !== relSegments[relSegments.length - index]) {\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn `/${absSegments.slice(0, absSegments.length - relSegments.length).join('/')}`;\n}\n\nexport function inferRootMappings(paths: string[]): Map<string, string> {\n\tconst absolutePaths = uniqStrings(\n\t\tpaths.filter((v) => isAbsolutePath(v)).map((v) => normalizeAbsolutePath(v)),\n\t);\n\tconst rootRefs = paths\n\t\t.map((v) => parseRootPrefixedPath(v))\n\t\t.filter((v): v is ParsedRootPrefixedPath => Boolean(v));\n\tconst scoresByRoot = new Map<string, Map<string, number>>();\n\n\tfor (const ref of rootRefs) {\n\t\tconst rootScores = scoresByRoot.get(ref.root) ?? new Map<string, number>();\n\t\tfor (const absolutePath of absolutePaths) {\n\t\t\tconst candidateRoot = deriveRootFromAbsoluteAndRelative(absolutePath, ref.relativePath);\n\t\t\tif (!candidateRoot) continue;\n\t\t\tconst bonus = path.basename(candidateRoot) === ref.root ? 2 : 1;\n\t\t\trootScores.set(candidateRoot, (rootScores.get(candidateRoot) ?? 0) + bonus);\n\t\t}\n\t\tscoresByRoot.set(ref.root, rootScores);\n\t}\n\n\tconst out = new Map<string, string>();\n\tfor (const [root, scores] of scoresByRoot) {\n\t\tconst ranked = [...scores.entries()].sort((left, right) => right[1] - left[1]);\n\t\tif (ranked.length === 0) continue;\n\t\tif (ranked.length > 1 && ranked[0][1] === ranked[1][1]) continue;\n\t\tout.set(root, ranked[0][0]);\n\t}\n\treturn out;\n}\n\nexport function getCurrentRootInfo(cwd: string | null | undefined): RootInfo | null {\n\tif (!cwd || !isAbsolutePath(cwd)) return null;\n\tconst absolutePath = normalizeAbsolutePath(cwd);\n\treturn { absolutePath, name: path.basename(absolutePath) };\n}\n\nexport function buildRootMappings(\n\tpaths: string[],\n\tcwd: string | null | undefined,\n): Map<string, string> {\n\tconst mappings = inferRootMappings(paths);\n\tconst currentRoot = getCurrentRootInfo(cwd);\n\tif (currentRoot) {\n\t\tmappings.set(currentRoot.name, currentRoot.absolutePath);\n\t}\n\treturn mappings;\n}\n\n// ---------------------------------------------------------------------------\n// Path normalization\n// ---------------------------------------------------------------------------\n\nfunction isWithinPath(filePath: string, rootPath: string): boolean {\n\treturn filePath === rootPath || filePath.startsWith(`${rootPath}/`);\n}\n\nfunction findRootForAbsolutePath(\n\tabsolutePath: string,\n\trootMappings: Map<string, string>,\n): { root: string; relativePath: string } | null {\n\tconst normalizedAbsolutePath = normalizeAbsolutePath(absolutePath);\n\tlet bestMatch: { root: string; relativePath: string; rootPathLength: number } | null = null;\n\tfor (const [root, rootPath] of rootMappings) {\n\t\tif (!isWithinPath(normalizedAbsolutePath, rootPath) || normalizedAbsolutePath === rootPath) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst relativePath = normalizedAbsolutePath.slice(rootPath.length + 1);\n\t\tif (!relativePath) continue;\n\t\tif (!bestMatch || rootPath.length > bestMatch.rootPathLength) {\n\t\t\tbestMatch = { root, relativePath, rootPathLength: rootPath.length };\n\t\t}\n\t}\n\treturn bestMatch ? { root: bestMatch.root, relativePath: bestMatch.relativePath } : null;\n}\n\nexport function normalizeTrackedPath(\n\tpathValue: string,\n\trootMappings: Map<string, string>,\n\tcwd: string | null | undefined,\n): string {\n\tconst strippedPath = stripReadSliceSuffix(pathValue.trim());\n\tif (!strippedPath) return '';\n\n\tconst rootPrefixed = parseRootPrefixedPath(strippedPath);\n\tif (rootPrefixed) return `${rootPrefixed.root}:${rootPrefixed.relativePath}`;\n\n\tif (isAbsolutePath(strippedPath)) {\n\t\tconst rooted = findRootForAbsolutePath(strippedPath, rootMappings);\n\t\treturn rooted ? `${rooted.root}:${rooted.relativePath}` : normalizeAbsolutePath(strippedPath);\n\t}\n\n\tconst currentRoot = getCurrentRootInfo(cwd);\n\tlet relativePath = strippedPath;\n\tif (\n\t\tcurrentRoot &&\n\t\t(relativePath === currentRoot.name || relativePath.startsWith(`${currentRoot.name}/`))\n\t) {\n\t\trelativePath =\n\t\t\trelativePath === currentRoot.name ? '' : relativePath.slice(currentRoot.name.length + 1);\n\t}\n\n\tconst normalizedRelativePath = normalizeRelativePath(relativePath);\n\tif (!normalizedRelativePath) return currentRoot?.absolutePath ?? '';\n\n\tconst rootedRelative = [...rootMappings.keys()]\n\t\t.sort((left, right) => right.length - left.length)\n\t\t.find((root) => normalizedRelativePath.startsWith(`${root}/`));\n\tif (rootedRelative) {\n\t\treturn `${rootedRelative}:${normalizedRelativePath.slice(rootedRelative.length + 1)}`;\n\t}\n\n\treturn currentRoot ? `${currentRoot.name}:${normalizedRelativePath}` : normalizedRelativePath;\n}\n\nexport function resolveCanonicalPath(\n\tcanonicalPath: string,\n\trootMappings: Map<string, string>,\n\tcwd: string | null | undefined,\n): string {\n\tif (!canonicalPath) return canonicalPath;\n\n\tif (isAbsolutePath(canonicalPath)) return normalizeAbsolutePath(canonicalPath);\n\n\tconst rootPrefixed = parseRootPrefixedPath(canonicalPath);\n\tif (rootPrefixed) {\n\t\tconst currentRoot = getCurrentRootInfo(cwd);\n\t\tconst rootPath =\n\t\t\trootMappings.get(rootPrefixed.root) ??\n\t\t\t(currentRoot?.name === rootPrefixed.root ? currentRoot.absolutePath : null);\n\t\tif (!rootPath) return canonicalPath;\n\t\treturn `${rootPath}/${rootPrefixed.relativePath}`;\n\t}\n\n\tconst normalizedRelativePath = normalizeRelativePath(canonicalPath);\n\tif (!normalizedRelativePath) return getCurrentRootInfo(cwd)?.absolutePath ?? canonicalPath;\n\n\tconst currentRoot = getCurrentRootInfo(cwd);\n\treturn currentRoot\n\t\t? `${currentRoot.absolutePath}/${normalizedRelativePath}`\n\t\t: normalizedRelativePath;\n}\n\nfunction fallbackDisplayPath(canonicalPath: string): string {\n\tconst rootPrefixed = parseRootPrefixedPath(canonicalPath);\n\tif (!rootPrefixed) return canonicalPath;\n\treturn `${rootPrefixed.root}/${rootPrefixed.relativePath}`;\n}\n\nfunction findRepoRootForDisplay(absolutePath: string, currentRoot: string | null): string | null {\n\tconst normalizedAbsolutePath = normalizeAbsolutePath(absolutePath);\n\tif (currentRoot && isWithinPath(normalizedAbsolutePath, currentRoot)) return currentRoot;\n\n\tlet candidate = normalizedAbsolutePath;\n\ttry {\n\t\tconst stats = fs.existsSync(candidate) ? fs.statSync(candidate) : null;\n\t\tif (stats?.isFile()) {\n\t\t\tcandidate = normalizeAbsolutePath(path.dirname(candidate));\n\t\t}\n\t} catch {\n\t\t// fall through with the original path-derived candidate\n\t}\n\n\twhile (true) {\n\t\tif (fs.existsSync(path.join(candidate, '.git'))) return candidate;\n\t\tconst parent = normalizeAbsolutePath(path.dirname(candidate));\n\t\tif (parent === candidate) return null;\n\t\tcandidate = parent;\n\t}\n}\n\nexport function displayPathForTrackedPath(\n\tcanonicalPath: string,\n\tresolvedPath: string,\n\tcwd: string | null | undefined,\n): string {\n\tif (!resolvedPath || !isAbsolutePath(resolvedPath)) {\n\t\treturn fallbackDisplayPath(canonicalPath);\n\t}\n\n\tconst currentRoot = getCurrentRootInfo(cwd);\n\tif (currentRoot && isWithinPath(resolvedPath, currentRoot.absolutePath)) {\n\t\treturn resolvedPath.slice(currentRoot.absolutePath.length + 1);\n\t}\n\n\tconst repoRoot = findRepoRootForDisplay(resolvedPath, currentRoot?.absolutePath ?? null);\n\tif (!repoRoot || !isWithinPath(resolvedPath, repoRoot)) {\n\t\treturn fallbackDisplayPath(canonicalPath) || resolvedPath;\n\t}\n\n\tconst relativePath = resolvedPath.slice(repoRoot.length + 1);\n\treturn relativePath ? `${path.basename(repoRoot)}/${relativePath}` : path.basename(repoRoot);\n}\n\nexport function resolveMoveRedirect(pathValue: string, redirects: Map<string, string>): string {\n\tlet current = pathValue;\n\tconst seen = new Set<string>();\n\twhile (redirects.has(current) && !seen.has(current)) {\n\t\tseen.add(current);\n\t\tcurrent = redirects.get(current) ?? current;\n\t}\n\treturn current;\n}\n"],"mappings":";;;AAOA,SAAgB,YAAY,QAA4B;CACvD,MAAM,uBAAO,IAAI,IAAY;CAC7B,MAAM,MAAgB,CAAC;CACvB,KAAK,MAAM,SAAS,QAAQ;EAC3B,MAAM,UAAU,MAAM,KAAK;EAC3B,IAAI,CAAC,WAAW,KAAK,IAAI,OAAO,GAAG;EACnC,KAAK,IAAI,OAAO;EAChB,IAAI,KAAK,OAAO;CACjB;CACA,OAAO;AACR;AAEA,SAAgB,wBAAwB,OAAuB;CAC9D,OAAO,MAAM,QAAQ,OAAO,GAAG;AAChC;AAEA,SAAS,kBAAkB,OAAuB;CACjD,MAAM,aAAa,wBAAwB,KAAK;CAChD,MAAM,WAAqB,CAAC;CAC5B,KAAK,MAAM,WAAW,WAAW,MAAM,GAAG,GAAG;EAC5C,IAAI,CAAC,WAAW,YAAY,KAAK;EACjC,IAAI,YAAY;OACX,SAAS,SAAS,KAAK,SAAS,SAAS,SAAS,OAAO,MAAM;IAClE,SAAS,IAAI;IACb;GACD;;EAED,SAAS,KAAK,OAAO;CACtB;CACA,OAAO,SAAS,KAAK,GAAG;AACzB;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