/** * Cross-shard boundary-call extraction (plan #2 — sharded build). * * When a shard worker resolves a shard's call sites, the calls that DON'T * land on one of the shard's own occurrences are candidate cross-package * edges — the target lives in another shard. This module identifies them * syntactically (local callee name + imported source alias + the raw import * specifier the name came from) so the engine's cross-shard pass can re-resolve * them against the global merged catalog, where the target is present. * * Detection is by RESOLUTION OUTCOME, not by name: a site is a boundary * candidate when its callee name is IMPORTED (carries an import specifier) AND * the in-shard resolver did NOT resolve THIS call site to a target. Keying on * the per-site outcome (not "does the callee name exist among the shard's * occurrences?") is what fixes the name-collision class: a name imported from * another package is a cross-shard call even when a DIFFERENT local function in * this shard happens to share the name (e.g. checks-universal has a local * `isTestFile`, but a call to the IMPORTED `@opensip-cli/fitness` `isTestFile` * still crosses the boundary). Conversely, a site the in-shard resolver already * resolved is skipped, so a recovered boundary edge never double-counts. */ import ts from 'typescript'; import type { CallSiteRecord } from '../walk.js'; import type { CallEdge, CrossBoundaryCall } from '@opensip-cli/graph'; /** * Resolve a method call's type-attested target SOURCE file (a cross-package * `recv.m()` whose `m` decl is in a workspace `dist/*.d.ts`), or null. Supplied * by the adapter (which owns the `ts.Program`/checker); absent in the fast tier. */ export type MethodTargetResolver = (node: ts.Node) => string | null; /** * Extract cross-boundary call descriptors from a shard's walked call sites. A * site is a boundary candidate when the in-shard resolver left it unresolved AND * either (a) its callee name is IMPORTED (a cross-package FUNCTION), or (b) it is * a METHOD call `recv.m()` whose callee the checker resolves to a workspace * `dist/*.d.ts` (`resolveMethodTarget` attests the target file — a cross-package * METHOD). Both route through the same post-merge linker. Keyed on the resolution * outcome (`resolvedEdgesByOwner`) — see the module doc. */ export declare function extractBoundaryCalls(callSites: readonly CallSiteRecord[], resolvedEdgesByOwner: ReadonlyMap, projectDirAbs: string, resolveMethodTarget?: MethodTargetResolver): CrossBoundaryCall[]; //# sourceMappingURL=boundary.d.ts.map