/**
 * Per-source provider-bundle registration.
 *
 * Three call sites need this logic; the helper exists so they don't
 * each carry a copy of the `provider_type` / `git_config` dispatch:
 *
 *   1. `orchestrator-core.ts` startup, where it loops over every source
 *      already in `generic_webhook_sources` and registers the matching
 *      provider bundle into `ProviderRegistry`. Cold-boot path.
 *   2. The admin HTTP handlers in `admin-events.ts` —
 *      `POST /api/v1/admin/generic-sources` and the matching PATCH /
 *      DELETE / enable / disable endpoints. Calling the helper inline
 *      makes the API response self-consistent on the issuing peer (a
 *      webhook fired immediately after the 200 reaches the right
 *      normalizer without waiting for the `pg_notify` round-trip).
 *   3. `GenericSourcesChangeListener` (`webhook/generic-sources-listener.ts`),
 *      which listens for the migration-019 `pg_notify('generic_sources_change',
 *      routing_key)` and applies the change on every other peer in the
 *      HA cluster.
 *
 * `registerProviderBundleForSource` is the single source of truth. It
 * dispatches on `row.provider_type` and `row.git_config` so callers
 * don't have to know which bundle to build — they hand over the row +
 * the orchestrator's already-instantiated registry / config /
 * secret-resolver and we do the right thing.
 *
 * Failure semantics match the startup behaviour: internal-only-but-
 * unservable peers log + skip (no throw); universal-git config errors
 * bump the per-row metric + log but never propagate. The caller can
 * assume "returns normally" means "the right thing happened or we
 * recorded why it didn't".
 */
import type { AppConfig } from '../config.js';
import type { ProviderRegistry } from '../provider-registry.js';
import type { SecretResolver } from '../secrets/secret-resolver.js';
import type { GenericWebhookSource } from '../db/types.js';
export interface RegisterSourceBundleDeps {
    providerRegistry: ProviderRegistry;
    config: AppConfig;
    /** Required for universal-git source rows. Null is allowed; rows that
     *  carry `git_config` will be skipped with a metric bump. */
    secretResolver: SecretResolver | null;
}
/**
 * Register the per-routing-key provider bundle a source row needs.
 *
 *   - `provider_type='internal'`: registers an `InternalWebhookNormalizer`
 *     bundle when the peer can serve it (gated on
 *     `internalProviderRepoPath` per `canServeGenericProviderType`).
 *   - `git_config IS NOT NULL`: registers a universal-git bundle.
 *   - everything else: no-op — the default `'generic'` bundle handles it.
 *
 * Idempotent under `ProviderRegistry.registerByRoutingKey` semantics: a
 * second call with the same routing key replaces the prior bundle.
 */
export declare function registerProviderBundleForSource(row: GenericWebhookSource, deps: RegisterSourceBundleDeps): void;
//# sourceMappingURL=register-source-bundle.d.ts.map