chat-agent-toolkit 1.2.72 → 1.2.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,84 @@
1
+ /**
2
+ * OpenConnector Integration for OOMOL SaaS
3
+ *
4
+ * Multi-tenant connector platform for OAuth & credential management.
5
+ * Allows users to link external accounts (Gmail, Slack, GitHub, Airtable, etc.)
6
+ * securely managed by OOMOL Cloud.
7
+ *
8
+ * @module connectors
9
+ * @see {@link https://connector.oomol.com}
10
+ * @example
11
+ * ```ts
12
+ * import { ProjectConnector } from "chat-agent-toolkit/connectors";
13
+ *
14
+ * const project = new ProjectConnector({
15
+ * apiKey: process.env.OOMOL_PROJECT_API_KEY,
16
+ * });
17
+ *
18
+ * const user = project.forUser(userId);
19
+ * const oauth = await user.connect.oauth({
20
+ * service: "gmail",
21
+ * returnUri: "https://myapp.com/oauth-callback",
22
+ * });
23
+ * ```
24
+ */
25
+ export type { ConnectorError as OOMOLConnectorError, ProjectConnector as OOMOLProjectConnector, } from '@oomol-lab/connector';
26
+ export { ConnectorError, ProjectConnector } from '@oomol-lab/connector';
27
+ export type CatalogProvider = {
28
+ service: string;
29
+ displayName: string;
30
+ categories: string[];
31
+ authTypes: ("oauth2" | "api_key" | "custom_credential" | "no_auth")[];
32
+ actionCount: number;
33
+ };
34
+ export type ProviderIndexEntry = CatalogProvider & {
35
+ homepageUrl?: string;
36
+ actions?: string[];
37
+ };
38
+ /**
39
+ * Lightweight provider catalog (basic info: service, display name, auth types).
40
+ * ~900 providers, fast catalog search and picker UI.
41
+ */
42
+ export declare const catalog: CatalogProvider[];
43
+ /**
44
+ * Detailed provider index with action lists and metadata.
45
+ * Use for deep integration: listing available actions, mapping capabilities.
46
+ */
47
+ export declare const providerIndex: ProviderIndexEntry[];
48
+ /**
49
+ * Search the catalog by service name or display name.
50
+ * @param query Search term (case-insensitive)
51
+ * @param limit Max results
52
+ * @returns Matching providers
53
+ */
54
+ export declare function searchCatalog(query: string, limit?: number): CatalogProvider[];
55
+ /**
56
+ * Get a provider by service ID.
57
+ * @param serviceId The provider's service identifier (e.g., "gmail", "slack")
58
+ * @returns Provider info or undefined
59
+ */
60
+ export declare function getCatalogProvider(serviceId: string): CatalogProvider | undefined;
61
+ /**
62
+ * Get detailed provider info including actions.
63
+ * @param serviceId The provider's service identifier
64
+ * @returns Detailed provider entry or undefined
65
+ */
66
+ export declare function getProviderDetails(serviceId: string): ProviderIndexEntry | undefined;
67
+ /**
68
+ * Filter catalog by authentication type.
69
+ * @param authType The auth type to filter by
70
+ * @returns Providers supporting this auth type
71
+ */
72
+ export declare function getCatalogByAuthType(authType: "oauth2" | "api_key" | "custom_credential" | "no_auth"): CatalogProvider[];
73
+ /**
74
+ * Filter catalog by category.
75
+ * @param category The category to filter by (e.g., "Communication", "Productivity")
76
+ * @returns Providers in this category
77
+ */
78
+ export declare function getCatalogByCategory(category: string): CatalogProvider[];
79
+ /**
80
+ * Get all unique categories in the catalog.
81
+ * @returns Sorted list of category names
82
+ */
83
+ export declare function getCatalogCategories(): string[];
84
+ export type { Express } from 'express';
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Multi-tenant connector server on OOMOL Cloud.
3
+ *
4
+ * This is a standalone Node.js Express server that manages OAuth credentials
5
+ * and API key connections for your app's users. It's NOT for browser/client code.
6
+ *
7
+ * OOMOL handles everything server-side:
8
+ * - OAuth apps & client secrets
9
+ * - Credential vault (encrypted storage)
10
+ * - Token refresh
11
+ * - Provider API calls
12
+ *
13
+ * Your app's users link THEIR OWN accounts (Gmail, Slack, GitHub, ...) via
14
+ * ProjectConnector — similar to Composio or Pipedream's "managed auth" model.
15
+ *
16
+ * @fileoverview OOMOL SaaS Connector Server
17
+ * @module connectors/server
18
+ *
19
+ * Setup:
20
+ * 1. Create a project in the OOMOL console and copy its API key (oo_proj_...).
21
+ * 2. Set OOMOL_PROJECT_API_KEY=oo_proj_... and run:
22
+ * ```bash
23
+ * cd packages/agent-toolkit/src/connectors
24
+ * npm install
25
+ * npm start
26
+ * ```
27
+ *
28
+ * Environment variables:
29
+ * - OOMOL_PROJECT_API_KEY: Your OOMOL project API key (required)
30
+ * - PORT: Server port (default: 8787)
31
+ * - APP_ORIGIN: Your app's origin for OAuth redirect (default: http://localhost:8787)
32
+ *
33
+ * API Endpoints:
34
+ * GET /api/catalog - List/search providers
35
+ * POST /api/connections - Start OAuth or API-key connection
36
+ * GET /api/connections/requests/:id - Poll OAuth status
37
+ * POST /api/actions/:actionId - Execute a provider action
38
+ * GET /connected - OAuth redirect landing page
39
+ *
40
+ * SECURITY: externalUserId = your app's own user id (from auth/session layer).
41
+ * NEVER let the client pick another user's id — derive it server-side from
42
+ * the authenticated session.
43
+ */
44
+ declare const app: any;
45
+ declare const server: any;
46
+ export { app, server };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Build-time smoke test: verify the OOMOL SDK imports, client constructs, and routes register.
3
+ * Run with: npm run build (from the connectors directory)
4
+ */
5
+ export {};
package/dist/index.d.ts CHANGED
@@ -23,3 +23,5 @@ export { configManager, ModelRegistry, getEnv, getModelProvidersUIConfigSection
23
23
  export type { Config, ConfigModelProvider, MCPServerConfig, UIConfigSections, Model, ModelWithProvider } from './config';
24
24
  export { cropProvider, cropProviderAsBlob, cropProviderAsDataURL, getProviderImage, getProviderNames } from './utils/provider-image-cropper';
25
25
  export type { Provider } from './utils/provider-image-cropper';
26
+ export * from './connectors';
27
+ export * as connectors from './connectors';