import type { IntegrationSlug } from "./ids";
export interface IntegrationDisplayDescriptor {
    /** Non-secret URL suitable for display metadata such as favicons. */
    readonly url?: string;
}
/** Where a credential value is carried on the outbound request. Mirrors the
 *  client's `Placement`. */
export interface AuthPlacementDescriptor {
    readonly carrier: "header" | "query";
    readonly name: string;
    /** Literal prepended to the value (e.g. `"Bearer "`). Empty when bare. */
    readonly prefix: string;
    /** The input variable this placement renders from. `token` for single-input
     *  methods; a distinct name per input for multi-input ones (e.g. Datadog).
     *  Absent → treated as `token`. */
    readonly variable?: string;
    /** Set when the placement renders this exact value instead of a credential
     *  (a static header/param the method carries). Such placements reference no
     *  input variable. */
    readonly literal?: string;
}
/** OAuth specifics for an `oauth` auth method. For probe-at-connect providers
 *  (MCP) only `discoveryUrl` + `supportsDynamicRegistration` are known up front;
 *  the authorize/token endpoints are discovered live at connect time. For
 *  providers that store endpoints (OpenAPI) the resolved URLs are carried. */
export interface AuthMethodOAuthDescriptor {
    /** For probe-at-connect providers (MCP): the endpoint to discover metadata
     *  from (RFC 9728 PRM → RFC 8414 AS metadata). */
    readonly discoveryUrl?: string;
    readonly authorizationUrl?: string;
    readonly tokenUrl?: string;
    readonly scopes?: readonly string[];
    readonly registrationEndpoint?: string;
    /** True when the integration is known to support RFC 7591 dynamic client
     *  registration (drives the transparent auto-register connect flow). */
    readonly supportsDynamicRegistration?: boolean;
}
/** A single declared auth method on an integration's catalog response. */
export interface AuthMethodDescriptor {
    /** Stable id within the integration (e.g. the auth template slug). */
    readonly id: string;
    readonly label: string;
    readonly kind: "oauth" | "apikey" | "header" | "none";
    /** The auth-template slug a connection binds against. */
    readonly template: string;
    readonly placements?: readonly AuthPlacementDescriptor[];
    readonly oauth?: AuthMethodOAuthDescriptor;
}
/** Public projection of an integration — what `integrations.list/get` return.
 *  Carries no credentials and no plugin-internal config. */
export interface Integration {
    readonly slug: IntegrationSlug;
    /** Display name. Pre-split rows stored the name in `description`; readers
     *  fall back, so this is always populated. */
    readonly name: string;
    /** Agent-visible context ("what this API is and when to reach for it").
     *  Distinct from the display name; may equal it on legacy rows. */
    readonly description: string;
    /** The plugin that owns this integration kind (e.g. "openapi", "mcp"). */
    readonly kind: string;
    /** Whether the user can remove this integration from the catalog. `false`
     *  for static / built-in integrations declared by a plugin at startup. */
    readonly canRemove: boolean;
    /** Whether the owning plugin supports re-resolving a connection's tools
     *  (`connections.refresh`). */
    readonly canRefresh: boolean;
    /** Declared auth methods derived from the owning plugin's stored config (a
     *  derived projection, not a DB column). Always present, possibly empty. */
    readonly authMethods: readonly AuthMethodDescriptor[];
    /** Non-secret display URL derived by the owning plugin from opaque config.
     *  Used for catalog favicons; never includes credentials or plugin config. */
    readonly displayUrl?: string;
}
/** Plugin-owned, opaque-to-core configuration stored on the integration row. The
 *  owning plugin writes it at register time and reads it back at execute time to
 *  render auth / produce tools. Core treats it as an opaque JSON blob. */
export type IntegrationConfig = unknown;
export declare const freshCustomAuthSlug: (taken: ReadonlySet<string>) => string;
export declare const mergeAuthTemplates: <T extends {
    readonly slug: string;
}>(existing: readonly T[], incoming: readonly T[]) => readonly T[];
/** What a plugin's extension method passes to `ctx.core.integrations.register`.
 *  The v2 analog of v1's `SourceInput`, minus the per-source tool list (tools are
 *  produced per-connection now). */
export interface RegisterIntegrationInput {
    readonly slug: IntegrationSlug;
    /** Display name. Falls back to `description` then the slug when omitted
     *  (legacy callers registered with description-as-name). */
    readonly name?: string;
    readonly description: string;
    /** Opaque plugin config (auth templates, spec ref, mcp url, …). */
    readonly config: IntegrationConfig;
    readonly canRemove?: boolean;
    readonly canRefresh?: boolean;
}
//# sourceMappingURL=integration.d.ts.map