/**
 * ServiceRegistry — named service credential resolution.
 *
 * Reads service configs from .goodvibes/goodvibes/services.json.
 * Each service entry declares its authType and the SecretsManager key
 * that holds the credential.
 *
 * Example services.json:
 * {
 *   "openai": { "name": "openai", "baseUrl": "https://api.openai.com", "authType": "bearer", "tokenKey": "OPENAI_API_KEY" },
 *   "github":  { "name": "github",  "baseUrl": "https://api.github.com",  "authType": "bearer", "tokenKey": "GITHUB_TOKEN" },
 *   "slack":   { "name": "slack", "authType": "bearer", "tokenKey": "SLACK_BOT_TOKEN", "tokenRef": { "source": "vaultwarden", "item": "GoodVibes Slack", "field": "password", "server": "https://vault.example.test" } }
 * }
 */
import { SecretsManager } from './secrets.js';
import { type SecretRefInput } from '@pellux/goodvibes-sdk/platform/config/secret-refs';
import type { OAuthProviderConfig } from '@pellux/goodvibes-sdk/platform/config/subscriptions';
import { SubscriptionManager } from '@pellux/goodvibes-sdk/platform/config/subscriptions';
export interface ServiceConfig {
    /** Human-readable / lookup name. */
    name: string;
    /** Base URL for the service (informational). */
    baseUrl?: string;
    /** Auth type used by this service. */
    authType: 'bearer' | 'basic' | 'api-key' | 'oauth';
    /** SecretsManager key that holds the primary credential (token or API key). */
    tokenKey: string;
    /** Optional external/local secret reference for the primary credential. */
    tokenRef?: SecretRefInput;
    /** For basic auth: SecretsManager key that holds the password. */
    passwordKey?: string;
    /** Optional external/local secret reference for the basic-auth password. */
    passwordRef?: SecretRefInput;
    /** For api-key auth: the header name. Defaults to X-API-Key. */
    apiKeyHeader?: string;
    /** Optional secret key holding a webhook or callback URL for this service. */
    webhookUrlKey?: string;
    /** Optional external/local secret reference for a webhook or callback URL. */
    webhookUrlRef?: SecretRefInput;
    /** Optional secret key for inbound request signing/verification. */
    signingSecretKey?: string;
    /** Optional external/local secret reference for inbound request signing/verification. */
    signingSecretRef?: SecretRefInput;
    /** Optional public-key secret used for inbound signature verification. */
    publicKeyKey?: string;
    /** Optional external/local secret reference for inbound public-key verification. */
    publicKeyRef?: SecretRefInput;
    /** Optional provider ID used for subscription token override lookup. */
    providerId?: string;
    /** OAuth metadata for subscription-backed services. */
    oauth?: OAuthProviderConfig;
}
export type ServiceSecretField = 'primary' | 'password' | 'webhookUrl' | 'signingSecret' | 'publicKey';
export interface ServiceInspection {
    readonly config: ServiceConfig;
    readonly hasPrimaryCredential: boolean;
    readonly hasPasswordCredential: boolean;
    readonly hasWebhookUrl: boolean;
    readonly hasSigningSecret: boolean;
    readonly hasPublicKey: boolean;
}
export interface ServiceConnectionTestResult {
    readonly ok: boolean;
    readonly status: number | null;
    readonly testedUrl: string | null;
    readonly error?: string;
}
export interface ServiceRegistryOptions {
    readonly secretsManager: SecretsManager;
    readonly subscriptionManager: SubscriptionManager;
}
export declare class ServiceRegistry {
    private readonly servicesFilePath;
    private readonly secretsManager;
    private readonly subscriptionManager;
    constructor(servicesFilePath: string, options: ServiceRegistryOptions);
    /**
     * Return all registered service configs.
     */
    getAll(): Record<string, ServiceConfig>;
    /**
     * Return the config for a named service, or null if not found.
     */
    get(serviceName: string): ServiceConfig | null;
    private resolveConfiguredSecret;
    /**
     * Resolve auth headers for a named service.
     * Looks up the service config, fetches credential from SecretsManager,
     * and returns the appropriate HTTP headers.
     *
     * Returns null if the service is not registered or credential is unavailable.
     */
    resolveAuth(serviceName: string): Promise<Record<string, string> | null>;
    resolveSecret(serviceName: string, field: ServiceSecretField): Promise<string | null>;
    inspect(serviceName: string): Promise<ServiceInspection | null>;
    testConnection(serviceName: string): Promise<ServiceConnectionTestResult>;
}
//# sourceMappingURL=service-registry.d.ts.map