/** * Graph language-adapter registry — per-RunScope. * * Each `RunScope` owns its own adapter registry (Item 1 / D7). The * graph tool's `contributeScope` hook constructs a fresh registry per CLI * invocation and attaches it to `scope.graph.adapters`. * * Built on the kernel's unified `Registry` with * `duplicatePolicy: 'overwrite'` — re-registering an adapter with the * same `id` overwrites the incumbent. That's intentional: a host * application can swap an adapter in tests, and the file's prior * incarnation documented this contract explicitly. * * Public API: * - `GraphAdapterRegistry` — the registry class. * - `createAdapterRegistry()` — factory used by `contributeScope`. * - `currentAdapterRegistry()` — reads the scope-bound instance. * - `pickAdapter()` — compatibility helper that routes the * scope-bound instance through GraphAdapterSelector. */ import { type Registerable } from '@opensip-cli/core'; import type { GraphLanguageAdapter } from './types.js'; export interface RegisterableAdapter extends Registerable { readonly id: string; readonly name: string; readonly adapter: GraphLanguageAdapter; } /** * Per-RunScope adapter registry. Wraps the kernel `Registry` with * the graph-specific `register` / `pick` surface. */ export declare class GraphAdapterRegistry { private readonly inner; /** * Register an adapter by its `id`. Re-registering an adapter with * the same `id` overwrites; that's intentional so a host application * can swap an adapter in tests. */ register(adapter: GraphLanguageAdapter): void; clear(): void; get size(): number; getAll(): readonly RegisterableAdapter[]; getById(id: string): RegisterableAdapter | undefined; } /** Factory used by the graph tool's `contributeScope` hook. */ export declare function createAdapterRegistry(): GraphAdapterRegistry; /** * Read the current scope's graph adapter registry. Throws when no * scope is active or when the graph subscope is missing — both * indicate the caller is running outside the CLI's pre-action-hook (or * the test fixture forgot to construct + enter a scope). * * @throws {Error} When called outside `runWithScope(...)`, or when the * active scope has no graph subscope. */ export declare function currentAdapterRegistry(): GraphAdapterRegistry; /** Pick the adapter for the current run. See `GraphAdapterRegistry.pick`. */ export declare function pickAdapter(cwd?: string, language?: string): GraphLanguageAdapter; //# sourceMappingURL=registry.d.ts.map