import type { DriverContext } from "@skaile/workspaces/plugin-registry"; import { type PluginRegistry } from "@skaile/workspaces/plugin-registry"; import type { ModelEntry } from "./models.js"; import type { AgentConfig, AgentDriver, DriverInfo } from "./types.js"; /** * Static capability metadata for every built-in backend. * * Pure data — this object imports no driver module and references no backend * SDK. {@link listDrivers} returns it (merged with any third-party drivers) * so selection UIs can enumerate every backend without loading a single * driver module. The matching driver module's `DriverTarget` is registered * into the plugin registry by {@link registerBuiltinDrivers}. * * @docLink packages/bridge/api-reference#registry */ export declare const BUILTIN_DRIVER_CATALOG: Record; /** * Back-compat alias for {@link BUILTIN_DRIVER_CATALOG}. Consumers and tests that * predate the plugin-registry refactor still import `DRIVER_CATALOG`. * * @docLink packages/bridge/api-reference#registry */ export declare const DRIVER_CATALOG: Record; /** * Register every built-in driver's `DriverTarget` into the plugin registry. * * This is the single id → module map in bridge core. Every specifier is a * literal string so `bun --compile` can statically bundle the driver module * (and, transitively, its SDK). The in-process-SDK backends (`claude-sdk`, * `codex`) are wrapped in build-constant guards so an excluded backend's * `await import` folds to dead code in the compiled binary. `omp` and `echo` * carry no SDK weight and are always available. * * **Static import discipline.** Every `import()` specifier below must be a * string literal — never aliased through a variable. Indirection defeats * `bun --compile`'s static analysis and silently drops the module from the * binary. * * Idempotent: guarded by a module flag so a second call is a no-op (a duplicate * `register` would otherwise throw `RegistrationError`). * * @docLink packages/bridge/api-reference#registry */ export declare function registerBuiltinDrivers(registry?: PluginRegistry): Promise; /** * Creates a new driver instance for the given backend id. * * Ensures the built-in driver targets are registered (idempotent), then looks * up the target in the plugin registry and calls its `create()`. The returned * driver has not been started yet — call `driver.start()` before sending * prompts. * * @param id - Registered driver identifier (e.g. `"omp"`, `"claude-sdk"`). * @param config - Configuration forwarded to the driver constructor. * @param ctx - Optional driver context (logger / abort signal). Defaults to `{}`. * @returns A freshly constructed (not yet started) {@link AgentDriver}. * @throws {Error} When `id` is a known backend excluded from this build, or * when `id` does not match any registered driver at all. * @docLink packages/bridge/api-reference#registry */ export declare function createDriver(id: string, config: AgentConfig, ctx?: DriverContext): Promise; /** * Returns the capability metadata for every available driver. * * Enumerates every built-in backend from {@link BUILTIN_DRIVER_CATALOG} without * loading a single driver module or backend SDK, then merges in any third-party * driver targets registered into the plugin registry that are not already in * the catalog. Use this to populate driver selection UIs. * * @returns Array of {@link DriverInfo} objects, one per available driver. * @docLink packages/bridge/api-reference#registry */ export declare function listDrivers(): DriverInfo[]; /** * List models available to a specific driver without starting a full agent session. * * Ensures the built-in driver targets are registered (idempotent), then * delegates to the target's optional `listModels()`. API keys are forwarded so * drivers can authenticate against provider REST APIs if needed. Throws on an * unknown / not-bundled id (same contract as {@link createDriver}); returns `[]` * only when the target exists but exposes no `listModels`. * * @param driverId - Registered driver id (e.g. `"omp"`, `"claude-sdk"`, `"codex"`). * @param apiKeys - Provider API keys keyed by provider name (e.g. `{ anthropic: "sk-..." }`). * Pass `settings.apiKeys ?? {}` from forge-assistant's resolved settings. * @throws {Error} When `driverId` is unknown or excluded from this build. * @docLink packages/bridge/api-reference#registry */ export declare function listModelsForDriver(driverId: string, apiKeys: Record): Promise; //# sourceMappingURL=registry.d.ts.map