import type { Integrations } from "@cargo-ai/workflow-sdk"; import { type Token } from "../core.js"; import type { ConnectorActionRef } from "../refs.js"; export type RateLimitSpec = { unit: "day" | "hour" | "minute" | "second"; max: number; strategy: "spread" | "burst"; }; export interface ConnectorConfigs { } type ConnectorConfigFor = S extends keyof ConnectorConfigs ? ConnectorConfigs[S] : Record; export type ConnectorSpec = { integration: S; name?: string; config?: ConnectorConfigFor; rateLimit?: RateLimitSpec; cacheTtlMilliseconds?: number; /** * Bind the integration's DEFAULT connector instead of creating one — the * escape hatch for OAuth integrations whose tokens can't live in a repo. * Falls back to a slug match when the integration has no default. * * Leave it off to bind by slug: a connector authored without `config` resolves * to the existing connector with this slug, and an undeclared `config` is * never cleared, so the credentials it already holds survive. */ default?: boolean; /** @deprecated Renamed to `default`, which is what it actually resolves. */ adopt?: boolean; }; type ConnectorActions = S extends keyof Integrations ? { readonly [A in keyof Integrations[S] & string]: ConnectorActionRef; } : { readonly [actionSlug: string]: ConnectorActionRef; }; export type ConnectorHandle = { readonly slug: string; readonly integrationSlug: S; readonly uuid: Token; readonly datasetUuid: Token; /** Discriminator so a connector handle can be passed where a connector (or its * dataset, via `defineModel`) is referenced. Carries the integration slug `S` * so `defineModel({ dataset })` can type extractor config. */ readonly resource: "connector"; /** This connector's actions — `connector.actions.` — for an * agent's / MCP server's `uses`. */ readonly actions: ConnectorActions; }; export declare function defineConnector(slug: string, spec: ConnectorSpec): ConnectorHandle; export {}; //# sourceMappingURL=connector.d.ts.map