/** * Cross-package resolution context for the EXACT (single-program) engine. * * The sharded engine links a `@scope/pkg` call to its target by looking the * (import specifier + callee name) up in the imported package's export symbol * table ({@link buildExportIndex}) — never by following the type-checker alias * into the package's built `dist/*.d.ts` (which is bodiless, so its hash never * matches the SOURCE body in the catalog). The exact engine now resolves * cross-package calls the SAME way, through {@link resolveCrossPackageCall}; this * module assembles the two indexes that resolver needs from the data the exact * resolve stage already has — the merged catalog + the project root. * * - {@link ExportIndex} — built directly from the catalog (one pass). * - {@link PackageManifestIndex} — built by deriving each workspace package's * root (the nearest ancestor dir of a cataloged file that has a * `package.json`) and reading its manifest. Single-program builds have no * `Shard[]` to hand to `buildPackageManifestIndex`, so we synthesize one * shard per discovered package root; manifest reads that fail are skipped * (the package simply won't be specifier-resolvable), identical to the * sharded path's best-effort behavior. */ import { type Catalog, type ExportIndex, type PackageManifestIndex } from '@opensip-cli/graph'; /** The two indexes the shared {@link resolveCrossPackageCall} resolver links against. */ export interface CrossPackageContext { readonly exportIndex: ExportIndex; readonly manifestIndex: PackageManifestIndex; } /** * Assemble the exact engine's cross-package resolution context from the catalog * and the absolute project root. Built once per resolve stage and threaded onto * every resolver's {@link ResolverContext}. */ export declare function buildCrossPackageContext(catalog: Catalog, projectDirAbs: string): CrossPackageContext; /** * Derive each workspace package ROOT (absolute) present in the catalog. A * package root is the nearest ancestor directory of a cataloged file that * contains a `package.json`. Probing walks UP from each file's directory and * stops at the first `package.json` (or the project root) — so a monorepo with * `packages///package.json` resolves each leaf package, not the * workspace root. Deduped by root dir. * * Exported so a caller that needs ONLY the manifest index (dependency resolution) * can `buildPackageManifestIndexFromRoots(derivePackageRoots(...))` directly, * without building and discarding the (call-resolution-only) export index. */ export declare function derivePackageRoots(catalog: Catalog, projectDirAbs: string): string[]; //# sourceMappingURL=cross-package-context.d.ts.map