/** * TypeScript cacheKey implementation. * * Produces `ts-${ts.version}-adapter-${adapterVersion}-${resolutionMode}-${resolvedTsconfigHash}`. * Stored in Catalog.cacheKey (v3 shape introduced by the language-pluggability * work). Replaces the v2 fields `tsCompilerVersion` and `tsConfigPath` that lived * as separate top-level catalog properties. * * The resolution mode is part of the key so a fast catalog and an exact catalog * for the same tsconfig occupy distinct `cache_key` rows in the datastore — * switching `--resolution` is a clean cache miss against the other tier, never a * wrong-tier reuse. No schema change is needed; the existing `cache_key` column * carries the mode. * * F2 — RESOLVED tsconfig (extends-aware). Earlier this hashed only the NAMED * tsconfig file's RAW content. But package tsconfigs `extends` a shared base * (`tsconfig.base.json`), and editing the base's `paths`/`baseUrl`/ * `moduleResolution` changes module resolution → different edges — WITHOUT * changing the named file's bytes. Every shard fragment would then cache-hit a * stale fragment → a silently-wrong graph (`--no-cache` recovers, but only if you * know to). We now hash the RESOLVED `compilerOptions` (TS walks the `extends` * chain for us via `parseJsonConfigFileContent`), stable-stringified, so any * extends-base edit that affects resolution invalidates the key. * * F5 — adapter package version. The engine version is folded in separately at * the engine boundary (`stampEngineVersion`, ADR-0015), but a * `@opensip-cli/graph-typescript` resolver fix shipped WITHOUT an engine * version bump (possible under independent versioning, ADR-0012) would reuse * stale fragments. Folding the adapter's OWN package version closes that: * belt-and-suspenders while engine + adapters ship in lockstep (3.0.0 today), * load-bearing the moment they diverge. * * Per contract invariant I-6 (cacheKey is stable for stable input): the function * is purely a function of * `(ts.version, adapterVersion, resolutionMode, resolvedTsconfigOptions)`. If the * tsconfig file is missing/unreadable on disk we fall back to a literal marker so * two calls without a (readable) tsconfig still match. */ import type { CacheKeyInput } from '@opensip-cli/graph'; export declare function cacheKey(input: CacheKeyInput): string; //# sourceMappingURL=cache-key.d.ts.map