apteva 0.2.8 → 0.2.10
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.
- package/dist/App.44ge5b89.js +218 -0
- package/dist/index.html +2 -2
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/binary.ts +36 -36
- package/src/db.ts +130 -16
- package/src/integrations/composio.ts +437 -0
- package/src/integrations/index.ts +80 -0
- package/src/openapi.ts +1724 -0
- package/src/routes/api.ts +599 -107
- package/src/server.ts +82 -8
- package/src/web/App.tsx +3 -0
- package/src/web/components/agents/AgentPanel.tsx +84 -38
- package/src/web/components/api/ApiDocsPage.tsx +583 -0
- package/src/web/components/common/Icons.tsx +8 -0
- package/src/web/components/common/Modal.tsx +183 -0
- package/src/web/components/layout/Sidebar.tsx +7 -1
- package/src/web/components/mcp/IntegrationsPanel.tsx +743 -0
- package/src/web/components/mcp/McpPage.tsx +242 -83
- package/src/web/components/settings/SettingsPage.tsx +24 -9
- package/src/web/components/tasks/TasksPage.tsx +1 -1
- package/src/web/index.html +1 -1
- package/src/web/types.ts +4 -1
- package/dist/App.hzbfeg94.js +0 -217
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Generic Integration Provider Interface
|
|
2
|
+
// Allows multiple providers (Composio, Smithery, etc.) to offer OAuth app connections
|
|
3
|
+
|
|
4
|
+
export interface IntegrationApp {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
slug: string;
|
|
8
|
+
description: string | null;
|
|
9
|
+
logo: string | null;
|
|
10
|
+
categories: string[];
|
|
11
|
+
authSchemes: string[]; // e.g., ["OAUTH2", "API_KEY"]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ConnectedAccount {
|
|
15
|
+
id: string;
|
|
16
|
+
appId: string;
|
|
17
|
+
appName: string;
|
|
18
|
+
status: "active" | "pending" | "failed" | "expired";
|
|
19
|
+
createdAt: string;
|
|
20
|
+
metadata?: Record<string, unknown>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ConnectionRequest {
|
|
24
|
+
redirectUrl: string | null; // null for API_KEY auth (no redirect needed)
|
|
25
|
+
connectionId?: string;
|
|
26
|
+
status?: "active" | "pending"; // API_KEY connections are immediately active
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ConnectionCredentials {
|
|
30
|
+
authScheme: "OAUTH2" | "API_KEY" | "BEARER_TOKEN" | "BASIC";
|
|
31
|
+
apiKey?: string;
|
|
32
|
+
bearerToken?: string;
|
|
33
|
+
username?: string;
|
|
34
|
+
password?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface IntegrationProvider {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
|
|
41
|
+
// List available apps/toolkits
|
|
42
|
+
listApps(apiKey: string): Promise<IntegrationApp[]>;
|
|
43
|
+
|
|
44
|
+
// List user's connected accounts
|
|
45
|
+
listConnectedAccounts(apiKey: string, userId: string): Promise<ConnectedAccount[]>;
|
|
46
|
+
|
|
47
|
+
// Initiate connection (OAuth or API Key)
|
|
48
|
+
initiateConnection(
|
|
49
|
+
apiKey: string,
|
|
50
|
+
userId: string,
|
|
51
|
+
appSlug: string,
|
|
52
|
+
redirectUrl: string,
|
|
53
|
+
credentials?: ConnectionCredentials
|
|
54
|
+
): Promise<ConnectionRequest>;
|
|
55
|
+
|
|
56
|
+
// Check connection status
|
|
57
|
+
getConnectionStatus(apiKey: string, connectionId: string): Promise<ConnectedAccount | null>;
|
|
58
|
+
|
|
59
|
+
// Disconnect/revoke
|
|
60
|
+
disconnect(apiKey: string, connectionId: string): Promise<boolean>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Provider registry
|
|
64
|
+
const providers: Map<string, IntegrationProvider> = new Map();
|
|
65
|
+
|
|
66
|
+
export function registerProvider(provider: IntegrationProvider) {
|
|
67
|
+
providers.set(provider.id, provider);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function getProvider(id: string): IntegrationProvider | undefined {
|
|
71
|
+
return providers.get(id);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function getAllProviders(): IntegrationProvider[] {
|
|
75
|
+
return Array.from(providers.values());
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function getProviderIds(): string[] {
|
|
79
|
+
return Array.from(providers.keys());
|
|
80
|
+
}
|