import { type ConnectableToolkit, type InitiatedConnection, type Principal } from "./core/index.js"; export type { ConnectableToolkit, InitiatedConnection }; import type { Connector, ConnectorAccount, ConnectorConnections } from "./actions/index.js"; export interface InitiateOptions { connector?: string; toolkit: string; callbackUrl?: string; } /** 04-actions §3 (block-actions design §B) — the umbrella's per-principal * connected-accounts surface. Which implementation composes is decided at the * seam, never in here (adapter rule — see selectConnections in server.ts). * Composio is the sole broker; two postures: * - "byo": the host's own connector (its Composio key) carries connections; * - "cloud": connections ride the Vendo Cloud broker endpoint using Vendo's * Composio credentials — cloud users bring zero keys. * Subject scoping IS the security model: every call passes exactly the * resolved principal's subject; no caller-supplied subject exists on the wire. */ export interface ConnectionsService { posture: "byo" | "cloud" | false; list(principal: Principal): Promise; initiate(principal: Principal, options: InitiateOptions): Promise; status(principal: Principal, connector: string, connectionId: string): Promise; disconnect(principal: Principal, connector: string, connectionId: string): Promise; /** The connect dock's auto catalog — host-level (every principal sees the * same rows), unlike everything above. Empty when nothing is connectable. */ catalog(): Promise; } /** The BYO capability predicate — the same test the composition seam selects * on and byoConnections builds brokers from. */ export declare function hasConnections(connector: Connector): connector is Connector & { connections: ConnectorConnections; }; /** The BYO adapter: connections live on the host's own connector(s), because * they must live where the connector executes. Built from every passed * connector that carries a connections capability. */ export declare function byoConnections(connectors: Connector[]): ConnectionsService; export interface CloudConnectionsOptions { apiKey: string; /** Defaults to the Vendo console; the composition seam passes VENDO_CONSOLE_URL. */ baseUrl?: string; /** Catalog scoping, mirroring cloudTools' `apps`: a host that scopes its * cloud tools explicitly passes the same list here so the connect dock * never advertises a toolkit the agent cannot invoke. Unset = everything * the console's catalog serves. */ apps?: string[]; fetch?: typeof fetch; /** Per-request abort budget (default 30s, hosted-store's) — a hung console * must never wedge the connections surface. */ timeoutMs?: number; } /** The Cloud adapter — the OSS side of the zero-key cloud seam: same surface, * brokered by the Vendo Cloud console (which holds Vendo's Composio * credentials). The console implementation is out of scope here; this defines * the wire it must serve. */ export declare function cloudConnections(options: CloudConnectionsOptions): ConnectionsService; /** The no-broker fallback adapter: listing is honestly empty (the panel * renders an empty state), any mutation explains what to configure. The * composition seam may pass a sharper sentence when it knows exactly what this * config was missing (toolkit strings with no Cloud key). */ export declare function unconfiguredConnections(reason?: string): ConnectionsService;