makeForgeResolver
makeForgeResolver(
deps): (dir) =>GitForge|null
Defined in: src/forge/resolve.ts:34
Build the mode-aware resolveForge closure used in src/index.ts.
Per-call repoMode read (cheap PK lookup) means a runtime toggle propagates immediately — no restart required:
- “lightweight” → returns a cached LocalForge instance for
dir - “forge” (or absent) → returns the memoized detectForge result for
dir
Two separate caches keep the invariants clean:
localForgeCache: reuse the LocalForge instance across calls while the repo stays in lightweight mode. If the mode flips to “forge”, the local entry is simply skipped; if it flips back, the same instance is reused.forgeCache: the existing detectForge memoization (git shell-out is expensive — once per path is enough for forge repos).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”(dir) => GitForge | null