/** * @fileoverview Resolve a package's main entry point from its * `package.json` — shared between plugin discovery (project-local * `.runtime/plugins//node_modules/`) and tool-package discovery * (any installed `opensipTools.kind === 'tool'` package). * * The two discovery sites previously inlined the same exports-map walk, * each with its own `eslint-disable-next-line sonarjs/cognitive-complexity` * suppression. Extracting the resolver removes the duplication and keeps * each caller small enough to satisfy the rule on its own. * * Resolution order matches Node's: `exports['.']` (string or condition * object — `import` / `default` / `node` selected in that order) → * `pkg.main` → `./index.js`. Returns the joined absolute path of the * entry, plus the package name from `pkg.name`. Returns `undefined` * when `package.json` is missing, malformed, or has no resolvable * entry. */ export interface PackageEntryResolution { /** Package name from `pkg.name`. Falls back to caller-supplied default if absent. */ readonly name: string; /** Absolute path to the resolved entry point. */ readonly entry: string; /** Raw entry path before joining (for callers that want the relative form). */ readonly rawEntry: string; } /** * Resolve a package's entry-point from its directory. * * @param packageDir Absolute path to the package directory. * @param fallbackName Name to use if `pkg.name` is missing — typically * the directory entry the caller iterated over. * @returns The resolved entry plus name, or `undefined` if `package.json` * is absent, malformed, or has no resolvable entry. */ export declare function resolvePackageEntryPoint(packageDir: string, fallbackName?: string): PackageEntryResolution | undefined; //# sourceMappingURL=package-entry.d.ts.map