/** * Connector registry. * * Built-in connectors from `@skaile/workspaces/factory-assets` are registered here * via static ESM imports of their subpath exports so they are bundled into any * `bun --compile`'d agent binary AND any tsup-emitted ESM tarball. Each built-in * factory is wrapped in a `ConnectorTarget` and registered into the unified * `pluginRegistry` (`@skaile/workspaces/plugin-registry`). The public read * helpers (`getConnector` / `tryGetConnector` / `listConnectors`) are thin * kind-typed wrappers over that registry. * * The catalog path in `ConnectorManager.resolveConnector` * (`await import(connectorPath)` of raw TS) is a dev-only fallback for * project-local third-party connectors — it cannot work inside a compiled * binary because bun cannot share its bundled symbol graph with * externally-loaded TS files (the import silently hangs while trying to * resolve `@skaile/workspaces/connectors` against an absent `node_modules`). * * **Static import discipline.** Every subpath specifier below must be a * string-literal `from "@skaile/workspaces/factory-assets/connectors/"` — * never aliased through a variable. Indirection defeats `bun --compile`'s * static analysis and silently drops the module from the binary. * Regression test: `tests/connector-tools-regression.test.ts`. */ import { type PluginRegistry } from "@skaile/workspaces/plugin-registry"; import type { Connector } from "./connector-types.js"; /** * Static metadata for every built-in connector — pure data, no imports. * * Mirrors the ids registered by {@link registerBuiltinConnectors}; selection UIs * use it to enumerate the built-in set without loading any connector module * (parity with `BUILTIN_DRIVER_CATALOG`). * * @docLink packages/connectors/api-reference#builtin-connector-catalog */ export declare const BUILTIN_CONNECTOR_CATALOG: readonly { id: string; displayName: string; }[]; /** * Register every built-in connector into the plugin registry. * * **Static import discipline.** Every subpath specifier in this file must be a * string-literal `from "@skaile/workspaces/factory-assets/connectors/"` — * 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/connectors/api-reference#register-builtin-connectors */ export declare function registerBuiltinConnectors(registry?: PluginRegistry): void; /** * Get a connector by name, calling its target's factory to produce a fresh * instance. Ensures the built-ins are registered first (cheap, idempotent). * @param name - Connector key (e.g. `"postgres"`). * @returns A fresh `Connector` instance. * @throws {Error} when no connector is registered under `name`. * @docLink packages/connectors/api-reference#get-connector */ export declare function getConnector(name: string): Connector; /** * Get a connector by name, or return `undefined` if not registered. Ensures the * built-ins are registered first (cheap, idempotent). * @param name - Connector key. * @returns A fresh `Connector` instance or `undefined`. * @docLink packages/connectors/api-reference#try-get-connector */ export declare function tryGetConnector(name: string): Connector | undefined; /** * Return the names of all currently registered connectors. Ensures the built-ins * are registered first (cheap, idempotent). * @returns Array of connector keys. * @docLink packages/connectors/api-reference#list-connectors */ export declare function listConnectors(): string[]; //# sourceMappingURL=connector-registry.d.ts.map