The disambiguator takes a flat list ofDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/clyrisai/gitresolve/llms.txt
Use this file to discover all available pages before exploring further.
ExtractedGitLink objects — profiles, repos, PRs, and issues — and works out which profile is the candidate’s own. It then categorises every repo link as either owned by the candidate or external. scrapePortfolio and parseResume both call this internally, but you can invoke it directly when you have already collected links from a custom source.
resolveOwnerAndCategorize
Determines the candidate owner from a list of parsed git links and splits repo links into owned, contributed, and external buckets.
Parameters
The full list of parsed git links from a single source. Usually the
allLinks array produced by scrapePortfolio or parseResume. May be empty — the function handles the empty case by returning confidence: 'none'.An optional hint string used in warning messages to indicate where the links came from (e.g.
'portfolio', 'resume'). Does not affect the resolution algorithm.If you already know the candidate’s git profile (from a different source, or from a direct input), supply it here. When provided, the disambiguation algorithm is bypassed entirely —
ownerProfile is set to this value, confidence is forced to 'high', and a warning is added noting the bypass.Returns
An object with the following shape. The underlyingOwnerResolution interface is internal to the library — it is not exported from @clyrisai/gitresolve and cannot be imported by name. Use the field descriptions below as your type reference.
The resolved candidate git profile, or
null when no owner could be determined (Case 4).How confident the algorithm is in the resolved owner. See the four cases below.
Repo links (type
'repo') where username matches the resolved owner, case-insensitively. Duplicates (same URL) are removed.All
pull_request and issue links from the input, deduplicated by URL.Repo links whose
username does not match the resolved owner — third-party repos referenced on the page or in the document.Diagnostic strings describing how the owner was determined (or why it could not be).
knownOwnerProfile bypass
When knownOwnerProfile is supplied, the function skips all four disambiguation cases. The owner is accepted as given, confidence is set to 'high', and the following warning is added:
ownedRepos and externalRepos are computed relative to the supplied username.
The four disambiguation cases
Repo categorisation rules
After the owner is determined, every link in thelinks array is assigned to exactly one bucket:
| Bucket | Condition |
|---|---|
ownedRepos | link.type === 'repo' AND link.username.toLowerCase() === ownerUsername.toLowerCase() |
externalRepos | link.type === 'repo' AND username does NOT match owner |
contributions | link.type === 'pull_request' OR link.type === 'issue' |
'other' type links are not placed in any of the three buckets but remain in the input links array (accessible as allLinks on ResolverResult).
Duplicate repo URLs (case-insensitive) are deduplicated across ownedRepos and externalRepos — the first occurrence is kept.
When to call directly
In most cases you do not need to callresolveOwnerAndCategorize yourself — scrapePortfolio and parseResume call it internally. You should call it directly when:
- You have collected
ExtractedGitLinkobjects from a custom source not covered by the built-in functions. - You want to re-run disambiguation on a combined link list from multiple sources (e.g. merging
allLinksfrom a portfolio result and a resume result). - You are testing your own parsing logic and want to verify categorisation.
Examples
dedupeProfilesByUsername
Removes duplicate profile links from an array, keeping the first occurrence of each unique username. The comparison is case-insensitive so JaneDoe and janedoe are treated as the same person.
Parameters
An array of
ExtractedGitLink objects. Only username is used for deduplication — url, provider, and other fields are not compared.Returns
A new array containing only the first occurrence of each unique lowercased username. The original array is not mutated. Non-profile link types are passed through unchanged since onlyusername is used as the dedup key.