@contractspec/integration.providers-impls 3.7.6 → 3.7.7
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/README.md +80 -241
- package/dist/impls/composio-fallback-resolver.d.ts +4 -4
- package/dist/impls/composio-fallback-resolver.js +73 -73
- package/dist/impls/composio-mcp.d.ts +1 -1
- package/dist/impls/composio-proxies.d.ts +5 -5
- package/dist/impls/composio-sdk.d.ts +1 -1
- package/dist/impls/elevenlabs-voice.d.ts +1 -1
- package/dist/impls/fal-voice.d.ts +1 -1
- package/dist/impls/gcs-storage.d.ts +1 -1
- package/dist/impls/gmail-inbound.d.ts +1 -1
- package/dist/impls/gradium-voice.d.ts +2 -2
- package/dist/impls/health/base-health-provider.d.ts +1 -1
- package/dist/impls/health/official-health-providers.d.ts +1 -1
- package/dist/impls/health/providers.d.ts +1 -1
- package/dist/impls/health-provider-factory.d.ts +1 -1
- package/dist/impls/index.d.ts +30 -30
- package/dist/impls/index.js +2150 -2150
- package/dist/impls/mistral-conversational.d.ts +1 -1
- package/dist/impls/mistral-conversational.js +159 -159
- package/dist/impls/posthog-reader.d.ts +1 -1
- package/dist/impls/provider-factory.d.ts +11 -11
- package/dist/impls/provider-factory.js +2073 -2073
- package/dist/index.d.ts +12 -12
- package/dist/index.js +2057 -2057
- package/dist/node/impls/composio-fallback-resolver.js +73 -73
- package/dist/node/impls/index.js +2150 -2150
- package/dist/node/impls/mistral-conversational.js +159 -159
- package/dist/node/impls/provider-factory.js +2073 -2073
- package/dist/node/index.js +2057 -2057
- package/dist/node/secrets/provider.js +2 -2
- package/dist/secrets/provider.d.ts +2 -2
- package/dist/secrets/provider.js +2 -2
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -1,243 +1,82 @@
|
|
|
1
1
|
# @contractspec/integration.providers-impls
|
|
2
2
|
|
|
3
|
-
Website: https://contractspec.io
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
Secret payload example (`secretRef` target value):
|
|
84
|
-
|
|
85
|
-
```json
|
|
86
|
-
{
|
|
87
|
-
"apiKey": "provider-api-key",
|
|
88
|
-
"accessToken": "oauth-access-token",
|
|
89
|
-
"refreshToken": "oauth-refresh-token",
|
|
90
|
-
"clientId": "oauth-client-id",
|
|
91
|
-
"clientSecret": "oauth-client-secret",
|
|
92
|
-
"tokenExpiresAt": "2026-02-01T00:00:00.000Z",
|
|
93
|
-
"mcpAccessToken": "mcp-access-token",
|
|
94
|
-
"webhookSecret": "webhook-signature-secret"
|
|
95
|
-
}
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Notes:
|
|
99
|
-
|
|
100
|
-
- Unofficial routing is disabled unless `allowUnofficial: true`.
|
|
101
|
-
- When `unofficialAllowList` is provided, only listed `health.*` keys can use unofficial routing.
|
|
102
|
-
- Unofficial routing expects MCP transport (`mcpUrl`) plus either `mcpAccessToken` or automation credentials.
|
|
103
|
-
- If a selected strategy is unavailable, the resolver falls through `strategyOrder`.
|
|
104
|
-
|
|
105
|
-
## Supabase integrations
|
|
106
|
-
|
|
107
|
-
This package now ships two Supabase providers:
|
|
108
|
-
|
|
109
|
-
- `vectordb.supabase` via `SupabaseVectorProvider`
|
|
110
|
-
- `database.supabase` via `SupabasePostgresProvider`
|
|
111
|
-
|
|
112
|
-
Both providers are available through `IntegrationProviderFactory` and can also be instantiated directly.
|
|
113
|
-
|
|
114
|
-
### 1) Connection shapes
|
|
115
|
-
|
|
116
|
-
#### Vector store (`vectordb.supabase`)
|
|
117
|
-
|
|
118
|
-
`IntegrationConnection.config` example:
|
|
119
|
-
|
|
120
|
-
```json
|
|
121
|
-
{
|
|
122
|
-
"schema": "public",
|
|
123
|
-
"table": "contractspec_vectors",
|
|
124
|
-
"createTableIfMissing": true,
|
|
125
|
-
"distanceMetric": "cosine",
|
|
126
|
-
"maxConnections": 5,
|
|
127
|
-
"sslMode": "require"
|
|
128
|
-
}
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
Secret payload example (`secretRef` target value):
|
|
132
|
-
|
|
133
|
-
```json
|
|
134
|
-
{
|
|
135
|
-
"databaseUrl": "postgresql://postgres.<project-ref>:<password>@aws-0-<region>.pooler.supabase.com:6543/postgres"
|
|
136
|
-
}
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
#### Database (`database.supabase`)
|
|
140
|
-
|
|
141
|
-
`IntegrationConnection.config` example:
|
|
142
|
-
|
|
143
|
-
```json
|
|
144
|
-
{
|
|
145
|
-
"maxConnections": 10,
|
|
146
|
-
"sslMode": "require"
|
|
147
|
-
}
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
Secret payload example (`secretRef` target value):
|
|
151
|
-
|
|
152
|
-
```json
|
|
153
|
-
{
|
|
154
|
-
"databaseUrl": "postgresql://postgres.<project-ref>:<password>@aws-0-<region>.pooler.supabase.com:6543/postgres"
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### 2) Factory usage
|
|
159
|
-
|
|
160
|
-
```ts
|
|
161
|
-
import { IntegrationProviderFactory } from '@contractspec/integration.providers-impls/impls/provider-factory';
|
|
162
|
-
|
|
163
|
-
const factory = new IntegrationProviderFactory();
|
|
164
|
-
|
|
165
|
-
const vectorProvider = await factory.createVectorStoreProvider(vectorContext); // key: vectordb.supabase
|
|
166
|
-
const dbProvider = await factory.createDatabaseProvider(databaseContext); // key: database.supabase
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### 3) Direct provider usage
|
|
170
|
-
|
|
171
|
-
```ts
|
|
172
|
-
import { SupabaseVectorProvider } from '@contractspec/integration.providers-impls/impls/supabase-vector';
|
|
173
|
-
import { SupabasePostgresProvider } from '@contractspec/integration.providers-impls/impls/supabase-psql';
|
|
174
|
-
|
|
175
|
-
const vector = new SupabaseVectorProvider({
|
|
176
|
-
connectionString: process.env.SUPABASE_DATABASE_URL,
|
|
177
|
-
schema: 'public',
|
|
178
|
-
table: 'contractspec_vectors',
|
|
179
|
-
distanceMetric: 'cosine',
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
const database = new SupabasePostgresProvider({
|
|
183
|
-
connectionString: process.env.SUPABASE_DATABASE_URL,
|
|
184
|
-
maxConnections: 10,
|
|
185
|
-
sslMode: 'require',
|
|
186
|
-
});
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
### 4) Notes
|
|
190
|
-
|
|
191
|
-
- `SupabaseVectorProvider` creates `vector` extension/table/indexes automatically when `createTableIfMissing=true`.
|
|
192
|
-
- `SupabaseVectorProvider` maps scores from pgvector distances (`cosine`, `l2`, `inner_product`) to `VectorSearchResult.score`.
|
|
193
|
-
- `SupabasePostgresProvider` supports `$1`, `$2`, ... placeholders, transactions, and clean connection shutdown through `close()`.
|
|
194
|
-
|
|
195
|
-
## Composio universal fallback
|
|
196
|
-
|
|
197
|
-
When an integration key has no native implementation, the factory can delegate to [Composio](https://composio.dev/) -- a platform providing 850+ toolkits (Slack, GitHub, Gmail, Jira, Salesforce, etc.) via MCP or native SDK.
|
|
198
|
-
|
|
199
|
-
### Enabling the fallback
|
|
200
|
-
|
|
201
|
-
Pass a `ComposioFallbackResolver` when constructing the factory:
|
|
202
|
-
|
|
203
|
-
```ts
|
|
204
|
-
import { IntegrationProviderFactory } from '@contractspec/integration.providers-impls/impls/provider-factory';
|
|
205
|
-
import { ComposioFallbackResolver } from '@contractspec/integration.providers-impls/impls/composio-fallback-resolver';
|
|
206
|
-
|
|
207
|
-
const resolver = new ComposioFallbackResolver({
|
|
208
|
-
apiKey: process.env.COMPOSIO_API_KEY!,
|
|
209
|
-
preferredTransport: 'mcp', // "mcp" (default) or "sdk"
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
const factory = new IntegrationProviderFactory({ composioFallback: resolver });
|
|
213
|
-
|
|
214
|
-
// Now any unsupported key falls through to Composio:
|
|
215
|
-
const messaging = await factory.createMessagingProvider(discordContext);
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
### Transport modes
|
|
219
|
-
|
|
220
|
-
| Mode | When to use | How it works |
|
|
221
|
-
| ----------------- | ------------------ | --------------------------------------------------------------- |
|
|
222
|
-
| **MCP** (default) | Standard fallback | Creates a Composio session, connects via MCP protocol |
|
|
223
|
-
| **SDK** | Advanced use cases | Uses `@composio/core` directly for tool search, auth management |
|
|
224
|
-
|
|
225
|
-
### Domain proxy adapters
|
|
226
|
-
|
|
227
|
-
For typed domains (messaging, email, payments, project management, calendar), the resolver returns proxy adapters that implement the ContractSpec interface and translate method calls to Composio tool executions. For untyped domains, a `ComposioGenericProxy` provides raw `executeTool()` access.
|
|
228
|
-
|
|
229
|
-
### Runtime configuration
|
|
230
|
-
|
|
231
|
-
Add `composio` to your `IntegrationRuntimeConfig`:
|
|
232
|
-
|
|
233
|
-
```ts
|
|
234
|
-
const runtimeConfig: IntegrationRuntimeConfig = {
|
|
235
|
-
secretProvider: mySecretProvider,
|
|
236
|
-
composio: {
|
|
237
|
-
apiKey: process.env.COMPOSIO_API_KEY!,
|
|
238
|
-
preferredTransport: 'mcp',
|
|
239
|
-
},
|
|
240
|
-
};
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
See `docs/tech/integrations/composio-fallback.md` for the full architecture.
|
|
3
|
+
Website: https://contractspec.io
|
|
4
|
+
|
|
5
|
+
**Integration provider implementations for email, payments, storage, and more.**
|
|
6
|
+
|
|
7
|
+
## What It Provides
|
|
8
|
+
|
|
9
|
+
- **Layer**: integration.
|
|
10
|
+
- **Consumers**: bundles, apps, modules that need concrete provider wiring.
|
|
11
|
+
- Related ContractSpec packages include `@contractspec/integration.runtime`, `@contractspec/lib.contracts-integrations`, `@contractspec/lib.contracts-spec`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
|
|
12
|
+
- Related ContractSpec packages include `@contractspec/integration.runtime`, `@contractspec/lib.contracts-integrations`, `@contractspec/lib.contracts-spec`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
`npm install @contractspec/integration.providers-impls`
|
|
17
|
+
|
|
18
|
+
or
|
|
19
|
+
|
|
20
|
+
`bun add @contractspec/integration.providers-impls`
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
Import the root entrypoint from `@contractspec/integration.providers-impls`, or choose a documented subpath when you only need one part of the package surface.
|
|
25
|
+
|
|
26
|
+
## Architecture
|
|
27
|
+
|
|
28
|
+
- `src/analytics.ts` is part of the package's public or composition surface.
|
|
29
|
+
- `src/calendar.ts` is part of the package's public or composition surface.
|
|
30
|
+
- `src/database.ts` is part of the package's public or composition surface.
|
|
31
|
+
- `src/email.ts` is part of the package's public or composition surface.
|
|
32
|
+
- `src/embedding.ts` is part of the package's public or composition surface.
|
|
33
|
+
- `src/health.ts` is part of the package's public or composition surface.
|
|
34
|
+
- `src/impls` is part of the package's public or composition surface.
|
|
35
|
+
- `src/index.ts` is the root public barrel and package entrypoint.
|
|
36
|
+
|
|
37
|
+
## Public Entry Points
|
|
38
|
+
|
|
39
|
+
- Export `.` resolves through `./src/index.ts`.
|
|
40
|
+
- Export `./analytics` resolves through `./src/analytics.ts`.
|
|
41
|
+
- Export `./calendar` resolves through `./src/calendar.ts`.
|
|
42
|
+
- Export `./database` resolves through `./src/database.ts`.
|
|
43
|
+
- Export `./email` resolves through `./src/email.ts`.
|
|
44
|
+
- Export `./embedding` resolves through `./src/embedding.ts`.
|
|
45
|
+
- Export `./health` resolves through `./src/health.ts`.
|
|
46
|
+
- Export `./impls` resolves through `./src/impls/index.ts`.
|
|
47
|
+
- Export `./impls/async-event-queue` resolves through `./src/impls/async-event-queue.ts`.
|
|
48
|
+
- Export `./impls/composio-fallback-resolver` resolves through `./src/impls/composio-fallback-resolver.ts`.
|
|
49
|
+
- The package publishes 76 total export subpaths; keep docs aligned with `package.json`.
|
|
50
|
+
|
|
51
|
+
## Local Commands
|
|
52
|
+
|
|
53
|
+
- `bun run dev` — contractspec-bun-build dev
|
|
54
|
+
- `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
|
|
55
|
+
- `bun run test` — bun test
|
|
56
|
+
- `bun run lint` — bun lint:fix
|
|
57
|
+
- `bun run lint:check` — biome check .
|
|
58
|
+
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
|
|
59
|
+
- `bun run typecheck` — tsc --noEmit
|
|
60
|
+
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
|
|
61
|
+
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
|
|
62
|
+
- `bun run clean` — rimraf dist .turbo
|
|
63
|
+
- `bun run build:bundle` — contractspec-bun-build transpile
|
|
64
|
+
- `bun run build:types` — contractspec-bun-build types
|
|
65
|
+
- `bun run prebuild` — contractspec-bun-build prebuild
|
|
66
|
+
|
|
67
|
+
## Recent Updates
|
|
68
|
+
|
|
69
|
+
- Missing dependencies (thanks to knip).
|
|
70
|
+
- Replace eslint+prettier by biomejs to optimize speed.
|
|
71
|
+
- Resolve lint, build, and type errors across nine packages.
|
|
72
|
+
- Resolve lint, build, and test failures across voice, workspace, library, and composio.
|
|
73
|
+
- Composio.
|
|
74
|
+
- Normalize formatting across contracts-integrations, composio, and observability.
|
|
75
|
+
|
|
76
|
+
## Notes
|
|
77
|
+
|
|
78
|
+
- Every implementation must satisfy a contract from `contracts-integrations`.
|
|
79
|
+
- Never import from apps or bundles.
|
|
80
|
+
- Secrets must flow through `@contractspec/integration.runtime`; never hard-code credentials.
|
|
81
|
+
- Composio fallback is opt-in; existing code paths are unchanged when config is absent.
|
|
82
|
+
- Composio proxy adapters must not leak Composio-specific types into domain interfaces.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { IntegrationContext } from '@contractspec/integration.runtime/runtime';
|
|
2
|
-
import type {
|
|
3
|
-
import { ComposioGenericProxy } from './composio-proxies';
|
|
4
|
-
import type { MessagingProvider } from '../messaging';
|
|
2
|
+
import type { CalendarProvider } from '../calendar';
|
|
5
3
|
import type { EmailOutboundProvider } from '../email';
|
|
4
|
+
import type { MessagingProvider } from '../messaging';
|
|
6
5
|
import type { PaymentsProvider } from '../payments';
|
|
7
6
|
import type { ProjectManagementProvider } from '../project-management';
|
|
8
|
-
import
|
|
7
|
+
import { ComposioGenericProxy } from './composio-proxies';
|
|
8
|
+
import type { ComposioConfig } from './composio-types';
|
|
9
9
|
/**
|
|
10
10
|
* Resolves unsupported integration keys to Composio-backed proxy providers.
|
|
11
11
|
*
|
|
@@ -160,79 +160,6 @@ class ComposioMcpProvider {
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
// src/impls/composio-sdk.ts
|
|
164
|
-
class ComposioSdkProvider {
|
|
165
|
-
config;
|
|
166
|
-
client;
|
|
167
|
-
constructor(config) {
|
|
168
|
-
this.config = config;
|
|
169
|
-
}
|
|
170
|
-
async executeTool(toolName, args) {
|
|
171
|
-
const client = await this.getClient();
|
|
172
|
-
const userId = args._userId ?? "default";
|
|
173
|
-
try {
|
|
174
|
-
const entity = await client.getEntity(userId);
|
|
175
|
-
const result = await entity.execute(toolName, args);
|
|
176
|
-
return { success: true, data: result };
|
|
177
|
-
} catch (error) {
|
|
178
|
-
return {
|
|
179
|
-
success: false,
|
|
180
|
-
error: error instanceof Error ? error.message : String(error)
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
async searchTools(query) {
|
|
185
|
-
const client = await this.getClient();
|
|
186
|
-
try {
|
|
187
|
-
const tools = await client.actions.list({ query, limit: 20 });
|
|
188
|
-
return tools.map((t) => ({
|
|
189
|
-
name: t.name,
|
|
190
|
-
description: t.description ?? "",
|
|
191
|
-
toolkit: t.appName ?? "",
|
|
192
|
-
parameters: t.parameters ?? {}
|
|
193
|
-
}));
|
|
194
|
-
} catch {
|
|
195
|
-
return [];
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
async getConnectedAccounts(userId) {
|
|
199
|
-
const client = await this.getClient();
|
|
200
|
-
try {
|
|
201
|
-
const entity = await client.getEntity(userId);
|
|
202
|
-
const connections = await entity.getConnections();
|
|
203
|
-
return connections.map((c) => ({
|
|
204
|
-
id: c.id,
|
|
205
|
-
appName: c.appName,
|
|
206
|
-
status: c.status
|
|
207
|
-
}));
|
|
208
|
-
} catch {
|
|
209
|
-
return [];
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
async getMcpConfig(userId) {
|
|
213
|
-
const client = await this.getClient();
|
|
214
|
-
try {
|
|
215
|
-
const entity = await client.getEntity(userId);
|
|
216
|
-
return {
|
|
217
|
-
url: entity.getMcpUrl(),
|
|
218
|
-
headers: entity.getMcpHeaders()
|
|
219
|
-
};
|
|
220
|
-
} catch {
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
async getClient() {
|
|
225
|
-
if (this.client)
|
|
226
|
-
return this.client;
|
|
227
|
-
const { Composio } = await import("@composio/core");
|
|
228
|
-
this.client = new Composio({
|
|
229
|
-
apiKey: this.config.apiKey,
|
|
230
|
-
...this.config.baseUrl ? { baseUrl: this.config.baseUrl } : {}
|
|
231
|
-
});
|
|
232
|
-
return this.client;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
163
|
// src/impls/composio-proxies.ts
|
|
237
164
|
function composioToolName(toolkit, action) {
|
|
238
165
|
return `${toolkit.toUpperCase()}_${action.toUpperCase()}`;
|
|
@@ -534,6 +461,79 @@ class ComposioGenericProxy {
|
|
|
534
461
|
}
|
|
535
462
|
}
|
|
536
463
|
|
|
464
|
+
// src/impls/composio-sdk.ts
|
|
465
|
+
class ComposioSdkProvider {
|
|
466
|
+
config;
|
|
467
|
+
client;
|
|
468
|
+
constructor(config) {
|
|
469
|
+
this.config = config;
|
|
470
|
+
}
|
|
471
|
+
async executeTool(toolName, args) {
|
|
472
|
+
const client = await this.getClient();
|
|
473
|
+
const userId = args._userId ?? "default";
|
|
474
|
+
try {
|
|
475
|
+
const entity = await client.getEntity(userId);
|
|
476
|
+
const result = await entity.execute(toolName, args);
|
|
477
|
+
return { success: true, data: result };
|
|
478
|
+
} catch (error) {
|
|
479
|
+
return {
|
|
480
|
+
success: false,
|
|
481
|
+
error: error instanceof Error ? error.message : String(error)
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
async searchTools(query) {
|
|
486
|
+
const client = await this.getClient();
|
|
487
|
+
try {
|
|
488
|
+
const tools = await client.actions.list({ query, limit: 20 });
|
|
489
|
+
return tools.map((t) => ({
|
|
490
|
+
name: t.name,
|
|
491
|
+
description: t.description ?? "",
|
|
492
|
+
toolkit: t.appName ?? "",
|
|
493
|
+
parameters: t.parameters ?? {}
|
|
494
|
+
}));
|
|
495
|
+
} catch {
|
|
496
|
+
return [];
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
async getConnectedAccounts(userId) {
|
|
500
|
+
const client = await this.getClient();
|
|
501
|
+
try {
|
|
502
|
+
const entity = await client.getEntity(userId);
|
|
503
|
+
const connections = await entity.getConnections();
|
|
504
|
+
return connections.map((c) => ({
|
|
505
|
+
id: c.id,
|
|
506
|
+
appName: c.appName,
|
|
507
|
+
status: c.status
|
|
508
|
+
}));
|
|
509
|
+
} catch {
|
|
510
|
+
return [];
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
async getMcpConfig(userId) {
|
|
514
|
+
const client = await this.getClient();
|
|
515
|
+
try {
|
|
516
|
+
const entity = await client.getEntity(userId);
|
|
517
|
+
return {
|
|
518
|
+
url: entity.getMcpUrl(),
|
|
519
|
+
headers: entity.getMcpHeaders()
|
|
520
|
+
};
|
|
521
|
+
} catch {
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
async getClient() {
|
|
526
|
+
if (this.client)
|
|
527
|
+
return this.client;
|
|
528
|
+
const { Composio } = await import("@composio/core");
|
|
529
|
+
this.client = new Composio({
|
|
530
|
+
apiKey: this.config.apiKey,
|
|
531
|
+
...this.config.baseUrl ? { baseUrl: this.config.baseUrl } : {}
|
|
532
|
+
});
|
|
533
|
+
return this.client;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
|
|
537
537
|
// src/impls/composio-fallback-resolver.ts
|
|
538
538
|
class ComposioFallbackResolver {
|
|
539
539
|
mcpProvider;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComposioConfig, ComposioToolProxy, ComposioToolResult
|
|
1
|
+
import type { ComposioConfig, ComposioToolDescriptor, ComposioToolProxy, ComposioToolResult } from './composio-types';
|
|
2
2
|
/**
|
|
3
3
|
* Composio MCP transport provider.
|
|
4
4
|
*
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CalendarEvent, CalendarEventInput, CalendarEventUpdateInput, CalendarListEventsQuery, CalendarListEventsResult, CalendarProvider } from '../calendar';
|
|
2
|
+
import type { EmailOutboundMessage, EmailOutboundProvider, EmailOutboundResult } from '../email';
|
|
2
3
|
import type { MessagingProvider, MessagingSendInput, MessagingSendResult, MessagingUpdateInput } from '../messaging';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type { CalendarProvider, CalendarListEventsQuery, CalendarListEventsResult, CalendarEventInput, CalendarEvent, CalendarEventUpdateInput } from '../calendar';
|
|
4
|
+
import type { CapturePaymentInput, CreateCustomerInput, CreatePaymentIntentInput, ListInvoicesQuery, ListTransactionsQuery, PaymentCustomer, PaymentIntent, PaymentInvoice, PaymentRefund, PaymentsProvider, PaymentTransaction, RefundPaymentInput } from '../payments';
|
|
5
|
+
import type { ProjectManagementProvider, ProjectManagementWorkItem, ProjectManagementWorkItemInput } from '../project-management';
|
|
6
|
+
import type { ComposioToolProxy, ComposioToolResult } from './composio-types';
|
|
7
7
|
export declare class ComposioMessagingProxy implements MessagingProvider {
|
|
8
8
|
private readonly proxy;
|
|
9
9
|
private readonly toolkit;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComposioConfig, ComposioToolProxy, ComposioToolResult
|
|
1
|
+
import type { ComposioConfig, ComposioToolDescriptor, ComposioToolProxy, ComposioToolResult } from './composio-types';
|
|
2
2
|
/**
|
|
3
3
|
* Composio Native SDK provider.
|
|
4
4
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElevenLabsClient } from '@elevenlabs/elevenlabs-js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TTSProvider, TTSSynthesisInput, TTSSynthesisResult, Voice } from '../voice';
|
|
3
3
|
export interface ElevenLabsVoiceProviderOptions {
|
|
4
4
|
apiKey: string;
|
|
5
5
|
defaultVoiceId?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FalClient } from '@fal-ai/client';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TTSProvider, TTSSynthesisInput, TTSSynthesisResult, Voice } from '../voice';
|
|
3
3
|
export interface FalVoiceProviderOptions {
|
|
4
4
|
apiKey: string;
|
|
5
5
|
modelId?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Storage, type StorageOptions } from '@google-cloud/storage';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DeleteObjectInput, GetObjectResult, ListObjectsQuery, ListObjectsResult, ObjectStorageProvider, PutObjectInput, SignedUrlOptions, StorageObjectMetadata } from '../storage';
|
|
3
3
|
export interface GoogleCloudStorageProviderOptions {
|
|
4
4
|
bucket: string;
|
|
5
5
|
storage?: Storage;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type gmail_v1 } from 'googleapis';
|
|
2
|
-
import type { EmailInboundProvider,
|
|
2
|
+
import type { EmailInboundProvider, EmailMessage, EmailMessagesSinceQuery, EmailThread, EmailThreadListQuery } from '../email';
|
|
3
3
|
export interface GmailInboundProviderOptions {
|
|
4
4
|
auth: gmail_v1.Options['auth'];
|
|
5
5
|
userId?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Gradium } from '@confiture-ai/gradium-sdk-js';
|
|
2
1
|
import type { Region, TTSOutputFormat } from '@confiture-ai/gradium-sdk-js';
|
|
3
|
-
import
|
|
2
|
+
import { Gradium } from '@confiture-ai/gradium-sdk-js';
|
|
3
|
+
import type { TTSProvider, TTSSynthesisInput, TTSSynthesisResult, Voice } from '../voice';
|
|
4
4
|
type GradiumClient = Gradium;
|
|
5
5
|
export interface GradiumVoiceProviderOptions {
|
|
6
6
|
apiKey: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { HealthActivity, HealthBiometric, HealthConnectionStatus, HealthDataSource, HealthListActivitiesParams, HealthListActivitiesResult, HealthListBiometricsParams, HealthListBiometricsResult, HealthListNutritionParams, HealthListNutritionResult, HealthListSleepParams, HealthListSleepResult, HealthListWorkoutsParams, HealthListWorkoutsResult, HealthNutrition, HealthProvider, HealthSleep, HealthSyncRequest, HealthSyncResult, HealthWebhookEvent, HealthWebhookRequest, HealthWorkout } from '../../health';
|
|
2
1
|
import type { HealthTransportStrategy } from '@contractspec/integration.runtime/runtime';
|
|
2
|
+
import type { HealthActivity, HealthBiometric, HealthConnectionStatus, HealthDataSource, HealthListActivitiesParams, HealthListActivitiesResult, HealthListBiometricsParams, HealthListBiometricsResult, HealthListNutritionParams, HealthListNutritionResult, HealthListSleepParams, HealthListSleepResult, HealthListWorkoutsParams, HealthListWorkoutsResult, HealthNutrition, HealthProvider, HealthSleep, HealthSyncRequest, HealthSyncResult, HealthWebhookEvent, HealthWebhookRequest, HealthWorkout } from '../../health';
|
|
3
3
|
type UnknownRecord = Record<string, unknown>;
|
|
4
4
|
interface OAuthOptions {
|
|
5
5
|
tokenUrl?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HealthListActivitiesParams, HealthListBiometricsResult,
|
|
1
|
+
import type { HealthListActivitiesParams, HealthListBiometricsParams, HealthListBiometricsResult, HealthListNutritionParams, HealthListNutritionResult, HealthListSleepParams, HealthListSleepResult, HealthListWorkoutsParams } from '../../health';
|
|
2
2
|
import { BaseHealthProvider, type BaseHealthProviderOptions } from './base-health-provider';
|
|
3
3
|
type ProviderOptions = Omit<BaseHealthProviderOptions, 'providerKey'>;
|
|
4
4
|
interface OpenWearablesOptions extends ProviderOptions {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AppleHealthBridgeProvider, FitbitHealthProvider, OpenWearablesHealthProvider, OuraHealthProvider, StravaHealthProvider, WhoopHealthProvider, } from './official-health-providers';
|
|
2
1
|
export { EightSleepHealthProvider, GarminHealthProvider, MyFitnessPalHealthProvider, PelotonHealthProvider, UnofficialHealthAutomationProvider, type UnofficialHealthAutomationProviderOptions, } from './hybrid-health-providers';
|
|
2
|
+
export { AppleHealthBridgeProvider, FitbitHealthProvider, OpenWearablesHealthProvider, OuraHealthProvider, StravaHealthProvider, WhoopHealthProvider, } from './official-health-providers';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { HealthProvider } from '../health';
|
|
2
1
|
import type { IntegrationContext } from '@contractspec/integration.runtime/runtime';
|
|
2
|
+
import type { HealthProvider } from '../health';
|
|
3
3
|
export declare function createHealthProviderFromContext(context: IntegrationContext, secrets: Record<string, unknown>): HealthProvider;
|