/** * register-tools — populate the kernel ToolRegistry with bundled, installed, * and authored tools (ADR-0027 / ADR-0041). * * Merged registration cluster: manifest constants, bundled admission, * installed/authored admission, and discovery walkers. Command mounting lives * in register-tools-mount.ts. */ import { type ToolPluginManifest, type ToolProvenance, type ToolRegistry } from '@opensip-cli/core'; export { BUNDLED_CAPABILITY_PACKS, BUNDLED_TOOL_PACKAGES, EXPECTED_SCAFFOLDING_TOOL_IDS, } from './bundled-manifest.js'; /** * Resolve a bundled tool's PACKAGE DIR — the directory whose `package.json` * carries the `opensipTools` manifest. * * The `./package.json` subpath is not declared in each engine's `exports`, * so `require.resolve('/package.json')` throws. Instead we resolve the * package's MAIN entry (a bare-name resolve, always permitted by `exports`) * and walk up to the nearest ancestor directory that has a `package.json` * whose `name` matches `packageName`. That ancestor IS the tool's own * package dir under both the source layout and pnpm's workspace-injected * `node_modules` layout (verified against fitness/simulation/graph here). * * @returns the resolved package directory, or `undefined` when the package * cannot be resolved (should never happen for a bundled direct dep). */ export declare function resolveBundledPackageDir(packageName: string): string | undefined; /** * Resolve a bundled tool package's on-disk directory, requiring success. * * @throws {PluginIncompatibleError} when the package directory cannot be * resolved on disk (its manifest is unreadable). */ export declare function resolveRequiredBundledPackageDir(packageName: string): string; /** * Register the bundled first-party tools into the supplied registry, each one * flowing through the SAME admit → dynamic-import → register path the external * path uses (launch cutover — replaces the static-import + gate path). * * Per package name: `resolveBundledPackageDir` → `loadToolManifest('bundled')` * → `admitTool({ source: 'bundled', explicitlyRequested: true })` → * `importToolRuntime` (dynamic import + shape validation) → drift guard → * `registry.register`. A bundled tool ships with the CLI, so it is always * explicitly present: a missing/incompatible manifest or a runtime that fails * to load is FAIL-CLOSED (never a silent skip). The recorded `ToolProvenance` * (source `'bundled'`, trusted-by-shipping) and manifest are pushed onto the * optional collectors so the composition root can surface provenance * (`plugin list`) and seed the per-run capability registry (§5.3). * * @param registry The per-invocation tool registry to populate. * @param provenance Optional sink for the admitted tools' provenance records. * @param manifests Optional sink for the admitted tools' manifests (§5.3). * @param packages The bundled package names to load (defaults to * {@link BUNDLED_TOOL_PACKAGES}; injectable so the fail-closed paths are * testable with fixture packages). * @throws {PluginIncompatibleError} when a bundled tool cannot be resolved, * has no conformant manifest, is out of range, or its runtime fails to load * — mapped to `EXIT_CODES.PLUGIN_INCOMPATIBLE` (exit 5) by the CLI boundary. */ export declare function registerFirstPartyTools(registry: ToolRegistry, provenance?: ToolProvenance[], manifests?: ToolPluginManifest[], packages?: readonly string[]): Promise; export { admitProjectLocalTool, admitUserGlobalTool, discoverAndRegisterAuthoredTools, type AuthoredAdmission, } from './register-authored-tools.js'; export { buildToolDiscoverySources, discoverAndRegisterToolPackages, emitInstalledLoadFailure, type DiscoveryOptions, } from './register-tools-discovery.js'; export { mountAllToolCommands, mountOneTool } from './register-tools-mount.js'; //# sourceMappingURL=register-tools.d.ts.map