@inkeep/agents-core 0.58.21 → 0.59.1
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/auth/auth-config-utils.d.ts +49 -0
- package/dist/auth/auth-config-utils.js +133 -0
- package/dist/auth/auth-schema.d.ts +102 -85
- package/dist/auth/auth-schema.js +1 -0
- package/dist/auth/auth-types.d.ts +170 -0
- package/dist/auth/auth-types.js +53 -0
- package/dist/auth/auth-validation-schemas.d.ts +169 -135
- package/dist/auth/auth.d.ts +43 -1286
- package/dist/auth/auth.js +61 -70
- package/dist/auth/email-send-status-store.js +15 -3
- package/dist/auth/init.js +2 -1
- package/dist/auth/password-reset-link-store.js +8 -1
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/client-exports.d.ts +2 -2
- package/dist/client-exports.js +2 -2
- package/dist/constants/{allowed-image-formats.d.ts → allowed-file-formats.d.ts} +4 -3
- package/dist/constants/{allowed-image-formats.js → allowed-file-formats.js} +13 -10
- package/dist/credential-stores/composio-store.d.ts +28 -0
- package/dist/credential-stores/composio-store.js +53 -0
- package/dist/credential-stores/default-constants.d.ts +2 -1
- package/dist/credential-stores/default-constants.js +2 -1
- package/dist/credential-stores/defaults.js +3 -1
- package/dist/credential-stores/index.d.ts +3 -2
- package/dist/credential-stores/index.js +3 -2
- package/dist/data-access/index.d.ts +5 -4
- package/dist/data-access/index.js +4 -4
- package/dist/data-access/manage/agents.d.ts +30 -30
- package/dist/data-access/manage/artifactComponents.d.ts +10 -10
- package/dist/data-access/manage/contextConfigs.d.ts +8 -8
- package/dist/data-access/manage/dataComponents.d.ts +2 -2
- package/dist/data-access/manage/functionTools.d.ts +14 -14
- package/dist/data-access/manage/skills.d.ts +19 -19
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgentRelations.d.ts +22 -22
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgents.d.ts +18 -18
- package/dist/data-access/manage/tools.d.ts +30 -30
- package/dist/data-access/manage/tools.js +17 -5
- package/dist/data-access/manage/triggers.d.ts +1 -1
- package/dist/data-access/runtime/apiKeys.d.ts +16 -16
- package/dist/data-access/runtime/apps.d.ts +12 -12
- package/dist/data-access/runtime/auth.d.ts +9 -9
- package/dist/data-access/runtime/auth.js +19 -21
- package/dist/data-access/runtime/conversations.d.ts +24 -24
- package/dist/data-access/runtime/messages.d.ts +12 -12
- package/dist/data-access/runtime/organizations.d.ts +28 -4
- package/dist/data-access/runtime/organizations.js +131 -9
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +10 -1
- package/dist/data-access/runtime/scheduledTriggerInvocations.js +13 -1
- package/dist/data-access/runtime/tasks.d.ts +5 -5
- package/dist/db/manage/manage-schema.d.ts +359 -359
- package/dist/db/runtime/runtime-schema.d.ts +298 -298
- package/dist/index.d.ts +8 -6
- package/dist/index.js +8 -7
- package/dist/types/utility.d.ts +1 -0
- package/dist/types/utility.js +2 -1
- package/dist/utils/credential-store-utils.js +1 -0
- package/dist/utils/error.d.ts +51 -48
- package/dist/utils/error.js +3 -0
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +4 -4
- package/dist/utils/third-party-mcp-servers/composio-client.d.ts +20 -4
- package/dist/utils/third-party-mcp-servers/composio-client.js +51 -25
- package/dist/utils/third-party-mcp-servers/index.d.ts +2 -2
- package/dist/utils/third-party-mcp-servers/index.js +2 -2
- package/dist/utils/third-party-mcp-servers/third-party-check.d.ts +3 -4
- package/dist/utils/third-party-mcp-servers/third-party-check.js +1 -2
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas.d.ts +2026 -2005
- package/dist/validation/schemas.js +3 -1
- package/drizzle/runtime/0023_lazy_energizer.sql +1 -0
- package/drizzle/runtime/0024_moaning_kingpin.sql +1 -0
- package/drizzle/runtime/meta/0024_snapshot.json +4270 -0
- package/drizzle/runtime/meta/_journal.json +7 -0
- package/package.json +11 -6
package/dist/utils/error.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ declare const ErrorCode: z.ZodEnum<{
|
|
|
8
8
|
forbidden: "forbidden";
|
|
9
9
|
not_found: "not_found";
|
|
10
10
|
conflict: "conflict";
|
|
11
|
+
too_many_requests: "too_many_requests";
|
|
11
12
|
internal_server_error: "internal_server_error";
|
|
12
13
|
unprocessable_entity: "unprocessable_entity";
|
|
13
14
|
}>;
|
|
@@ -24,6 +25,7 @@ declare const problemDetailsSchema: z.ZodObject<{
|
|
|
24
25
|
forbidden: "forbidden";
|
|
25
26
|
not_found: "not_found";
|
|
26
27
|
conflict: "conflict";
|
|
28
|
+
too_many_requests: "too_many_requests";
|
|
27
29
|
internal_server_error: "internal_server_error";
|
|
28
30
|
unprocessable_entity: "unprocessable_entity";
|
|
29
31
|
}>;
|
|
@@ -38,6 +40,7 @@ declare const errorResponseSchema: z.ZodObject<{
|
|
|
38
40
|
forbidden: "forbidden";
|
|
39
41
|
not_found: "not_found";
|
|
40
42
|
conflict: "conflict";
|
|
43
|
+
too_many_requests: "too_many_requests";
|
|
41
44
|
internal_server_error: "internal_server_error";
|
|
42
45
|
unprocessable_entity: "unprocessable_entity";
|
|
43
46
|
}>;
|
|
@@ -71,12 +74,12 @@ declare const errorSchemaFactory: (code: ErrorCodes, description: string) => {
|
|
|
71
74
|
schema: z.ZodObject<{
|
|
72
75
|
instance: z.ZodOptional<z.ZodString>;
|
|
73
76
|
requestId: z.ZodOptional<z.ZodString>;
|
|
74
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
77
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
75
78
|
detail: z.ZodString;
|
|
76
79
|
title: z.ZodString;
|
|
77
80
|
status: z.ZodNumber;
|
|
78
81
|
error: z.ZodObject<{
|
|
79
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
82
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
80
83
|
message: z.ZodString;
|
|
81
84
|
}, z.core.$strip>;
|
|
82
85
|
}, z.core.$strip>;
|
|
@@ -93,12 +96,12 @@ declare const commonCreateErrorResponses: {
|
|
|
93
96
|
schema: z.ZodObject<{
|
|
94
97
|
instance: z.ZodOptional<z.ZodString>;
|
|
95
98
|
requestId: z.ZodOptional<z.ZodString>;
|
|
96
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
99
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
97
100
|
detail: z.ZodString;
|
|
98
101
|
title: z.ZodString;
|
|
99
102
|
status: z.ZodNumber;
|
|
100
103
|
error: z.ZodObject<{
|
|
101
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
104
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
102
105
|
message: z.ZodString;
|
|
103
106
|
}, z.core.$strip>;
|
|
104
107
|
}, z.core.$strip>;
|
|
@@ -112,12 +115,12 @@ declare const commonCreateErrorResponses: {
|
|
|
112
115
|
schema: z.ZodObject<{
|
|
113
116
|
instance: z.ZodOptional<z.ZodString>;
|
|
114
117
|
requestId: z.ZodOptional<z.ZodString>;
|
|
115
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
118
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
116
119
|
detail: z.ZodString;
|
|
117
120
|
title: z.ZodString;
|
|
118
121
|
status: z.ZodNumber;
|
|
119
122
|
error: z.ZodObject<{
|
|
120
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
123
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
121
124
|
message: z.ZodString;
|
|
122
125
|
}, z.core.$strip>;
|
|
123
126
|
}, z.core.$strip>;
|
|
@@ -131,12 +134,12 @@ declare const commonCreateErrorResponses: {
|
|
|
131
134
|
schema: z.ZodObject<{
|
|
132
135
|
instance: z.ZodOptional<z.ZodString>;
|
|
133
136
|
requestId: z.ZodOptional<z.ZodString>;
|
|
134
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
137
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
135
138
|
detail: z.ZodString;
|
|
136
139
|
title: z.ZodString;
|
|
137
140
|
status: z.ZodNumber;
|
|
138
141
|
error: z.ZodObject<{
|
|
139
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
142
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
140
143
|
message: z.ZodString;
|
|
141
144
|
}, z.core.$strip>;
|
|
142
145
|
}, z.core.$strip>;
|
|
@@ -150,12 +153,12 @@ declare const commonCreateErrorResponses: {
|
|
|
150
153
|
schema: z.ZodObject<{
|
|
151
154
|
instance: z.ZodOptional<z.ZodString>;
|
|
152
155
|
requestId: z.ZodOptional<z.ZodString>;
|
|
153
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
156
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
154
157
|
detail: z.ZodString;
|
|
155
158
|
title: z.ZodString;
|
|
156
159
|
status: z.ZodNumber;
|
|
157
160
|
error: z.ZodObject<{
|
|
158
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
161
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
159
162
|
message: z.ZodString;
|
|
160
163
|
}, z.core.$strip>;
|
|
161
164
|
}, z.core.$strip>;
|
|
@@ -169,12 +172,12 @@ declare const commonCreateErrorResponses: {
|
|
|
169
172
|
schema: z.ZodObject<{
|
|
170
173
|
instance: z.ZodOptional<z.ZodString>;
|
|
171
174
|
requestId: z.ZodOptional<z.ZodString>;
|
|
172
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
175
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
173
176
|
detail: z.ZodString;
|
|
174
177
|
title: z.ZodString;
|
|
175
178
|
status: z.ZodNumber;
|
|
176
179
|
error: z.ZodObject<{
|
|
177
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
180
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
178
181
|
message: z.ZodString;
|
|
179
182
|
}, z.core.$strip>;
|
|
180
183
|
}, z.core.$strip>;
|
|
@@ -190,12 +193,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
190
193
|
schema: z.ZodObject<{
|
|
191
194
|
instance: z.ZodOptional<z.ZodString>;
|
|
192
195
|
requestId: z.ZodOptional<z.ZodString>;
|
|
193
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
196
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
194
197
|
detail: z.ZodString;
|
|
195
198
|
title: z.ZodString;
|
|
196
199
|
status: z.ZodNumber;
|
|
197
200
|
error: z.ZodObject<{
|
|
198
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
201
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
199
202
|
message: z.ZodString;
|
|
200
203
|
}, z.core.$strip>;
|
|
201
204
|
}, z.core.$strip>;
|
|
@@ -209,12 +212,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
209
212
|
schema: z.ZodObject<{
|
|
210
213
|
instance: z.ZodOptional<z.ZodString>;
|
|
211
214
|
requestId: z.ZodOptional<z.ZodString>;
|
|
212
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
215
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
213
216
|
detail: z.ZodString;
|
|
214
217
|
title: z.ZodString;
|
|
215
218
|
status: z.ZodNumber;
|
|
216
219
|
error: z.ZodObject<{
|
|
217
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
220
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
218
221
|
message: z.ZodString;
|
|
219
222
|
}, z.core.$strip>;
|
|
220
223
|
}, z.core.$strip>;
|
|
@@ -228,12 +231,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
228
231
|
schema: z.ZodObject<{
|
|
229
232
|
instance: z.ZodOptional<z.ZodString>;
|
|
230
233
|
requestId: z.ZodOptional<z.ZodString>;
|
|
231
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
234
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
232
235
|
detail: z.ZodString;
|
|
233
236
|
title: z.ZodString;
|
|
234
237
|
status: z.ZodNumber;
|
|
235
238
|
error: z.ZodObject<{
|
|
236
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
239
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
237
240
|
message: z.ZodString;
|
|
238
241
|
}, z.core.$strip>;
|
|
239
242
|
}, z.core.$strip>;
|
|
@@ -247,12 +250,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
247
250
|
schema: z.ZodObject<{
|
|
248
251
|
instance: z.ZodOptional<z.ZodString>;
|
|
249
252
|
requestId: z.ZodOptional<z.ZodString>;
|
|
250
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
253
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
251
254
|
detail: z.ZodString;
|
|
252
255
|
title: z.ZodString;
|
|
253
256
|
status: z.ZodNumber;
|
|
254
257
|
error: z.ZodObject<{
|
|
255
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
258
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
256
259
|
message: z.ZodString;
|
|
257
260
|
}, z.core.$strip>;
|
|
258
261
|
}, z.core.$strip>;
|
|
@@ -266,12 +269,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
266
269
|
schema: z.ZodObject<{
|
|
267
270
|
instance: z.ZodOptional<z.ZodString>;
|
|
268
271
|
requestId: z.ZodOptional<z.ZodString>;
|
|
269
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
272
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
270
273
|
detail: z.ZodString;
|
|
271
274
|
title: z.ZodString;
|
|
272
275
|
status: z.ZodNumber;
|
|
273
276
|
error: z.ZodObject<{
|
|
274
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
277
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
275
278
|
message: z.ZodString;
|
|
276
279
|
}, z.core.$strip>;
|
|
277
280
|
}, z.core.$strip>;
|
|
@@ -285,12 +288,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
285
288
|
schema: z.ZodObject<{
|
|
286
289
|
instance: z.ZodOptional<z.ZodString>;
|
|
287
290
|
requestId: z.ZodOptional<z.ZodString>;
|
|
288
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
291
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
289
292
|
detail: z.ZodString;
|
|
290
293
|
title: z.ZodString;
|
|
291
294
|
status: z.ZodNumber;
|
|
292
295
|
error: z.ZodObject<{
|
|
293
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
296
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
294
297
|
message: z.ZodString;
|
|
295
298
|
}, z.core.$strip>;
|
|
296
299
|
}, z.core.$strip>;
|
|
@@ -306,12 +309,12 @@ declare const commonGetErrorResponses: {
|
|
|
306
309
|
schema: z.ZodObject<{
|
|
307
310
|
instance: z.ZodOptional<z.ZodString>;
|
|
308
311
|
requestId: z.ZodOptional<z.ZodString>;
|
|
309
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
312
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
310
313
|
detail: z.ZodString;
|
|
311
314
|
title: z.ZodString;
|
|
312
315
|
status: z.ZodNumber;
|
|
313
316
|
error: z.ZodObject<{
|
|
314
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
317
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
315
318
|
message: z.ZodString;
|
|
316
319
|
}, z.core.$strip>;
|
|
317
320
|
}, z.core.$strip>;
|
|
@@ -325,12 +328,12 @@ declare const commonGetErrorResponses: {
|
|
|
325
328
|
schema: z.ZodObject<{
|
|
326
329
|
instance: z.ZodOptional<z.ZodString>;
|
|
327
330
|
requestId: z.ZodOptional<z.ZodString>;
|
|
328
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
331
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
329
332
|
detail: z.ZodString;
|
|
330
333
|
title: z.ZodString;
|
|
331
334
|
status: z.ZodNumber;
|
|
332
335
|
error: z.ZodObject<{
|
|
333
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
336
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
334
337
|
message: z.ZodString;
|
|
335
338
|
}, z.core.$strip>;
|
|
336
339
|
}, z.core.$strip>;
|
|
@@ -344,12 +347,12 @@ declare const commonGetErrorResponses: {
|
|
|
344
347
|
schema: z.ZodObject<{
|
|
345
348
|
instance: z.ZodOptional<z.ZodString>;
|
|
346
349
|
requestId: z.ZodOptional<z.ZodString>;
|
|
347
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
350
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
348
351
|
detail: z.ZodString;
|
|
349
352
|
title: z.ZodString;
|
|
350
353
|
status: z.ZodNumber;
|
|
351
354
|
error: z.ZodObject<{
|
|
352
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
355
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
353
356
|
message: z.ZodString;
|
|
354
357
|
}, z.core.$strip>;
|
|
355
358
|
}, z.core.$strip>;
|
|
@@ -363,12 +366,12 @@ declare const commonGetErrorResponses: {
|
|
|
363
366
|
schema: z.ZodObject<{
|
|
364
367
|
instance: z.ZodOptional<z.ZodString>;
|
|
365
368
|
requestId: z.ZodOptional<z.ZodString>;
|
|
366
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
369
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
367
370
|
detail: z.ZodString;
|
|
368
371
|
title: z.ZodString;
|
|
369
372
|
status: z.ZodNumber;
|
|
370
373
|
error: z.ZodObject<{
|
|
371
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
374
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
372
375
|
message: z.ZodString;
|
|
373
376
|
}, z.core.$strip>;
|
|
374
377
|
}, z.core.$strip>;
|
|
@@ -382,12 +385,12 @@ declare const commonGetErrorResponses: {
|
|
|
382
385
|
schema: z.ZodObject<{
|
|
383
386
|
instance: z.ZodOptional<z.ZodString>;
|
|
384
387
|
requestId: z.ZodOptional<z.ZodString>;
|
|
385
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
388
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
386
389
|
detail: z.ZodString;
|
|
387
390
|
title: z.ZodString;
|
|
388
391
|
status: z.ZodNumber;
|
|
389
392
|
error: z.ZodObject<{
|
|
390
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
393
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
391
394
|
message: z.ZodString;
|
|
392
395
|
}, z.core.$strip>;
|
|
393
396
|
}, z.core.$strip>;
|
|
@@ -401,12 +404,12 @@ declare const commonGetErrorResponses: {
|
|
|
401
404
|
schema: z.ZodObject<{
|
|
402
405
|
instance: z.ZodOptional<z.ZodString>;
|
|
403
406
|
requestId: z.ZodOptional<z.ZodString>;
|
|
404
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
407
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
405
408
|
detail: z.ZodString;
|
|
406
409
|
title: z.ZodString;
|
|
407
410
|
status: z.ZodNumber;
|
|
408
411
|
error: z.ZodObject<{
|
|
409
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
412
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
410
413
|
message: z.ZodString;
|
|
411
414
|
}, z.core.$strip>;
|
|
412
415
|
}, z.core.$strip>;
|
|
@@ -422,12 +425,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
422
425
|
schema: z.ZodObject<{
|
|
423
426
|
instance: z.ZodOptional<z.ZodString>;
|
|
424
427
|
requestId: z.ZodOptional<z.ZodString>;
|
|
425
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
428
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
426
429
|
detail: z.ZodString;
|
|
427
430
|
title: z.ZodString;
|
|
428
431
|
status: z.ZodNumber;
|
|
429
432
|
error: z.ZodObject<{
|
|
430
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
433
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
431
434
|
message: z.ZodString;
|
|
432
435
|
}, z.core.$strip>;
|
|
433
436
|
}, z.core.$strip>;
|
|
@@ -441,12 +444,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
441
444
|
schema: z.ZodObject<{
|
|
442
445
|
instance: z.ZodOptional<z.ZodString>;
|
|
443
446
|
requestId: z.ZodOptional<z.ZodString>;
|
|
444
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
447
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
445
448
|
detail: z.ZodString;
|
|
446
449
|
title: z.ZodString;
|
|
447
450
|
status: z.ZodNumber;
|
|
448
451
|
error: z.ZodObject<{
|
|
449
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
452
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
450
453
|
message: z.ZodString;
|
|
451
454
|
}, z.core.$strip>;
|
|
452
455
|
}, z.core.$strip>;
|
|
@@ -460,12 +463,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
460
463
|
schema: z.ZodObject<{
|
|
461
464
|
instance: z.ZodOptional<z.ZodString>;
|
|
462
465
|
requestId: z.ZodOptional<z.ZodString>;
|
|
463
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
466
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
464
467
|
detail: z.ZodString;
|
|
465
468
|
title: z.ZodString;
|
|
466
469
|
status: z.ZodNumber;
|
|
467
470
|
error: z.ZodObject<{
|
|
468
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
471
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
469
472
|
message: z.ZodString;
|
|
470
473
|
}, z.core.$strip>;
|
|
471
474
|
}, z.core.$strip>;
|
|
@@ -479,12 +482,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
479
482
|
schema: z.ZodObject<{
|
|
480
483
|
instance: z.ZodOptional<z.ZodString>;
|
|
481
484
|
requestId: z.ZodOptional<z.ZodString>;
|
|
482
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
485
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
483
486
|
detail: z.ZodString;
|
|
484
487
|
title: z.ZodString;
|
|
485
488
|
status: z.ZodNumber;
|
|
486
489
|
error: z.ZodObject<{
|
|
487
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
490
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
488
491
|
message: z.ZodString;
|
|
489
492
|
}, z.core.$strip>;
|
|
490
493
|
}, z.core.$strip>;
|
|
@@ -498,12 +501,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
498
501
|
schema: z.ZodObject<{
|
|
499
502
|
instance: z.ZodOptional<z.ZodString>;
|
|
500
503
|
requestId: z.ZodOptional<z.ZodString>;
|
|
501
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
504
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
502
505
|
detail: z.ZodString;
|
|
503
506
|
title: z.ZodString;
|
|
504
507
|
status: z.ZodNumber;
|
|
505
508
|
error: z.ZodObject<{
|
|
506
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
509
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
507
510
|
message: z.ZodString;
|
|
508
511
|
}, z.core.$strip>;
|
|
509
512
|
}, z.core.$strip>;
|
|
@@ -517,12 +520,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
517
520
|
schema: z.ZodObject<{
|
|
518
521
|
instance: z.ZodOptional<z.ZodString>;
|
|
519
522
|
requestId: z.ZodOptional<z.ZodString>;
|
|
520
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
523
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
521
524
|
detail: z.ZodString;
|
|
522
525
|
title: z.ZodString;
|
|
523
526
|
status: z.ZodNumber;
|
|
524
527
|
error: z.ZodObject<{
|
|
525
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
528
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
526
529
|
message: z.ZodString;
|
|
527
530
|
}, z.core.$strip>;
|
|
528
531
|
}, z.core.$strip>;
|
package/dist/utils/error.js
CHANGED
|
@@ -9,6 +9,7 @@ const ErrorCode = z.enum([
|
|
|
9
9
|
"forbidden",
|
|
10
10
|
"not_found",
|
|
11
11
|
"conflict",
|
|
12
|
+
"too_many_requests",
|
|
12
13
|
"internal_server_error",
|
|
13
14
|
"unprocessable_entity"
|
|
14
15
|
]);
|
|
@@ -18,6 +19,7 @@ const errorCodeToHttpStatus = {
|
|
|
18
19
|
forbidden: 403,
|
|
19
20
|
not_found: 404,
|
|
20
21
|
conflict: 409,
|
|
22
|
+
too_many_requests: 429,
|
|
21
23
|
unprocessable_entity: 422,
|
|
22
24
|
internal_server_error: 500
|
|
23
25
|
};
|
|
@@ -154,6 +156,7 @@ function getTitleFromCode(code) {
|
|
|
154
156
|
case "forbidden": return "Forbidden";
|
|
155
157
|
case "not_found": return "Not Found";
|
|
156
158
|
case "conflict": return "Conflict";
|
|
159
|
+
case "too_many_requests": return "Too Many Requests";
|
|
157
160
|
case "unprocessable_entity": return "Unprocessable Entity";
|
|
158
161
|
case "internal_server_error": return "Internal Server Error";
|
|
159
162
|
default: return "Error";
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -25,11 +25,11 @@ import { SignSlackUserTokenParams, SlackAccessTokenPayload, SlackAccessTokenPayl
|
|
|
25
25
|
import { ParsedSSEResponse, parseSSEResponse } from "./sse-parser.js";
|
|
26
26
|
import { SignedTempToken, TempTokenPayload, signTempToken, verifyTempToken } from "./temp-jwt.js";
|
|
27
27
|
import { interpolateTemplate } from "./template-interpolation.js";
|
|
28
|
-
import { CredentialScope, configureComposioMCPServer, extractComposioServerId, fetchComposioServers, fetchSingleComposioServer, getComposioOAuthRedirectUrl, getComposioUserId, isComposioMCPServerAuthenticated } from "./third-party-mcp-servers/composio-client.js";
|
|
28
|
+
import { ComposioAuthResult, CredentialScope, configureComposioMCPServer, deleteComposioConnectedAccount, extractComposioServerId, fetchComposioServers, fetchSingleComposioServer, getComposioInstance, getComposioOAuthRedirectUrl, getComposioUserId, isComposioMCPServerAuthenticated } from "./third-party-mcp-servers/composio-client.js";
|
|
29
29
|
import { isThirdPartyMCPServerAuthenticated } from "./third-party-mcp-servers/third-party-check.js";
|
|
30
30
|
import "./third-party-mcp-servers/index.js";
|
|
31
31
|
import { flushTraces, getTracer, setSpanWithError, unwrapError } from "./tracer-factory.js";
|
|
32
32
|
import { HashedHeaderValue, SignatureVerificationErrorCode, SignatureVerificationResult, TriggerAuthResult, hashAuthenticationHeaders, hashTriggerHeaderValue, validateTriggerHeaderValue, verifySignatureWithConfig, verifyTriggerAuth } from "./trigger-auth.js";
|
|
33
33
|
import { _resetWaitUntilCache, getWaitUntil } from "./wait-until.js";
|
|
34
34
|
import { TRUSTED_WORK_APP_MCP_PATHS, isTrustedWorkAppMcpUrl } from "./work-app-mcp.js";
|
|
35
|
-
export { ApiKeyGenerationResult, AppCredentialResult, CommonCreateErrorResponses, CommonDeleteErrorResponses, CommonGetErrorResponses, CommonUpdateErrorResponses, CredentialScope, ERROR_DOCS_BASE_URL, ErrorCode, ErrorCodes, ErrorResponse, GenerateInternalServiceTokenParams, GenerateServiceTokenParams, HashedHeaderValue, InternalServiceId, InternalServiceTokenPayload, InternalServices, JsonTransformer, JwtVerifyResult, LLMMessage, LoggerFactoryConfig, McpClient, McpClientOptions, McpOAuthFlowResult, McpSSEConfig, McpServerConfig, McpStreamableHttpConfig, McpTokenExchangeResult, MockLanguageModel, ModelFactory, OAuthConfig, ParsedSSEResponse, PinoLogger, PinoLoggerConfig, PoWError, PoWResult, ProblemDetails, ServiceTokenPayload, SignJwtOptions, SignSlackLinkTokenParams, SignSlackUserTokenParams, SignatureVerificationErrorCode, SignatureVerificationResult, SignedTempToken, SlackAccessTokenPayload, SlackAccessTokenPayloadSchema, SlackLinkIntent, SlackLinkIntentSchema, SlackLinkTokenPayload, SlackLinkTokenPayloadSchema, TRUSTED_WORK_APP_MCP_PATHS, TempTokenPayload, TriggerAuthResult, VerifyInternalServiceTokenResult, VerifyJwtOptions, VerifyServiceTokenResult, VerifySlackLinkTokenResult, VerifySlackUserTokenResult, _resetWaitUntilCache, activeMcpClients, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, configureComposioMCPServer, convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, createApiError, createMockModel, decodeJwtPayload, detectAuthenticationRequired, errorResponseSchema, errorSchemaFactory, exchangeMcpAuthorizationCode, extractBearerToken, extractComposioServerId, extractPreviewFields, extractPublicId, fetchComposioServers, fetchSingleComposioServer, flushTraces, formatMessagesForLLM, formatMessagesForLLMContext, generateApiKey, generateAppCredential, generateId, generateInternalServiceToken, generateServiceToken, getComposioOAuthRedirectUrl, getComposioUserId, getConversationId, getCredentialStoreLookupKeyFromRetrievalParams, getInProcessFetch, getJwtSecret, getLogger, getMetadataFromApiKey, getPoWErrorMessage, getTracer, getWaitUntil, handleApiError, hasIssuer, hashApiKey, hashAuthenticationHeaders, hashTriggerHeaderValue, initiateMcpOAuthFlow, interpolateTemplate, isApiKeyExpired, isComposioMCPServerAuthenticated, isDevelopment, isInternalServiceToken, isPoWEnabled, isProduction, isSlackUserToken, isTest, isThirdPartyMCPServerAuthenticated, isTrustedWorkAppMcpUrl, isUniqueConstraintError, isZodSchema, loggerFactory, maskApiKey, normalizeDateString, parseEmbeddedJson, parseSSEResponse, preview, problemDetailsSchema, registerAppFetch, retryWithBackoff, sanitizeAppConfig, setSpanWithError, signJwt, signSlackLinkToken, signSlackUserToken, signTempToken, throwIfUniqueConstraintError, toISODateString, unwrapError, validateApiKey, validateInternalServiceProjectAccess, validateInternalServiceTenantAccess, validateOrigin, validateTargetAgent, validateTenantId, validateTriggerHeaderValue, verifyAuthorizationHeader, verifyInternalServiceAuthHeader, verifyInternalServiceToken, verifyJwt, verifyPoW, verifyServiceToken, verifySignatureWithConfig, verifySlackLinkToken, verifySlackUserToken, verifyTempToken, verifyTriggerAuth };
|
|
35
|
+
export { ApiKeyGenerationResult, AppCredentialResult, CommonCreateErrorResponses, CommonDeleteErrorResponses, CommonGetErrorResponses, CommonUpdateErrorResponses, ComposioAuthResult, CredentialScope, ERROR_DOCS_BASE_URL, ErrorCode, ErrorCodes, ErrorResponse, GenerateInternalServiceTokenParams, GenerateServiceTokenParams, HashedHeaderValue, InternalServiceId, InternalServiceTokenPayload, InternalServices, JsonTransformer, JwtVerifyResult, LLMMessage, LoggerFactoryConfig, McpClient, McpClientOptions, McpOAuthFlowResult, McpSSEConfig, McpServerConfig, McpStreamableHttpConfig, McpTokenExchangeResult, MockLanguageModel, ModelFactory, OAuthConfig, ParsedSSEResponse, PinoLogger, PinoLoggerConfig, PoWError, PoWResult, ProblemDetails, ServiceTokenPayload, SignJwtOptions, SignSlackLinkTokenParams, SignSlackUserTokenParams, SignatureVerificationErrorCode, SignatureVerificationResult, SignedTempToken, SlackAccessTokenPayload, SlackAccessTokenPayloadSchema, SlackLinkIntent, SlackLinkIntentSchema, SlackLinkTokenPayload, SlackLinkTokenPayloadSchema, TRUSTED_WORK_APP_MCP_PATHS, TempTokenPayload, TriggerAuthResult, VerifyInternalServiceTokenResult, VerifyJwtOptions, VerifyServiceTokenResult, VerifySlackLinkTokenResult, VerifySlackUserTokenResult, _resetWaitUntilCache, activeMcpClients, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, configureComposioMCPServer, convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, createApiError, createMockModel, decodeJwtPayload, deleteComposioConnectedAccount, detectAuthenticationRequired, errorResponseSchema, errorSchemaFactory, exchangeMcpAuthorizationCode, extractBearerToken, extractComposioServerId, extractPreviewFields, extractPublicId, fetchComposioServers, fetchSingleComposioServer, flushTraces, formatMessagesForLLM, formatMessagesForLLMContext, generateApiKey, generateAppCredential, generateId, generateInternalServiceToken, generateServiceToken, getComposioInstance, getComposioOAuthRedirectUrl, getComposioUserId, getConversationId, getCredentialStoreLookupKeyFromRetrievalParams, getInProcessFetch, getJwtSecret, getLogger, getMetadataFromApiKey, getPoWErrorMessage, getTracer, getWaitUntil, handleApiError, hasIssuer, hashApiKey, hashAuthenticationHeaders, hashTriggerHeaderValue, initiateMcpOAuthFlow, interpolateTemplate, isApiKeyExpired, isComposioMCPServerAuthenticated, isDevelopment, isInternalServiceToken, isPoWEnabled, isProduction, isSlackUserToken, isTest, isThirdPartyMCPServerAuthenticated, isTrustedWorkAppMcpUrl, isUniqueConstraintError, isZodSchema, loggerFactory, maskApiKey, normalizeDateString, parseEmbeddedJson, parseSSEResponse, preview, problemDetailsSchema, registerAppFetch, retryWithBackoff, sanitizeAppConfig, setSpanWithError, signJwt, signSlackLinkToken, signSlackUserToken, signTempToken, throwIfUniqueConstraintError, toISODateString, unwrapError, validateApiKey, validateInternalServiceProjectAccess, validateInternalServiceTenantAccess, validateOrigin, validateTargetAgent, validateTenantId, validateTriggerHeaderValue, verifyAuthorizationHeader, verifyInternalServiceAuthHeader, verifyInternalServiceToken, verifyJwt, verifyPoW, verifyServiceToken, verifySignatureWithConfig, verifySlackLinkToken, verifySlackUserToken, verifyTempToken, verifyTriggerAuth };
|
package/dist/utils/index.js
CHANGED
|
@@ -3,6 +3,9 @@ import { PinoLogger, getLogger, loggerFactory } from "./logger.js";
|
|
|
3
3
|
import { decodeJwtPayload, extractBearerToken, getJwtSecret, hasIssuer, signJwt, verifyJwt } from "./jwt-helpers.js";
|
|
4
4
|
import { InternalServices, generateInternalServiceToken, isInternalServiceToken, validateInternalServiceProjectAccess, validateInternalServiceTenantAccess, verifyInternalServiceAuthHeader, verifyInternalServiceToken } from "./internal-service-auth.js";
|
|
5
5
|
import { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, preview } from "./schema-conversion.js";
|
|
6
|
+
import { configureComposioMCPServer, deleteComposioConnectedAccount, extractComposioServerId, fetchComposioServers, fetchSingleComposioServer, getComposioInstance, getComposioOAuthRedirectUrl, getComposioUserId, isComposioMCPServerAuthenticated } from "./third-party-mcp-servers/composio-client.js";
|
|
7
|
+
import { isThirdPartyMCPServerAuthenticated } from "./third-party-mcp-servers/third-party-check.js";
|
|
8
|
+
import "./third-party-mcp-servers/index.js";
|
|
6
9
|
import { getCredentialStoreLookupKeyFromRetrievalParams } from "./credential-store-utils.js";
|
|
7
10
|
import { generateId, getConversationId } from "./conversations.js";
|
|
8
11
|
import { extractPublicId, generateApiKey, generateAppCredential, getMetadataFromApiKey, hashApiKey, isApiKeyExpired, maskApiKey, sanitizeAppConfig, validateApiKey } from "./apiKeys.js";
|
|
@@ -25,12 +28,9 @@ import { SlackAccessTokenPayloadSchema, isSlackUserToken, signSlackUserToken, ve
|
|
|
25
28
|
import { parseSSEResponse } from "./sse-parser.js";
|
|
26
29
|
import { signTempToken, verifyTempToken } from "./temp-jwt.js";
|
|
27
30
|
import { interpolateTemplate } from "./template-interpolation.js";
|
|
28
|
-
import { configureComposioMCPServer, extractComposioServerId, fetchComposioServers, fetchSingleComposioServer, getComposioOAuthRedirectUrl, getComposioUserId, isComposioMCPServerAuthenticated } from "./third-party-mcp-servers/composio-client.js";
|
|
29
|
-
import { isThirdPartyMCPServerAuthenticated } from "./third-party-mcp-servers/third-party-check.js";
|
|
30
|
-
import "./third-party-mcp-servers/index.js";
|
|
31
31
|
import { flushTraces, getTracer, setSpanWithError, unwrapError } from "./tracer-factory.js";
|
|
32
32
|
import { hashAuthenticationHeaders, hashTriggerHeaderValue, validateTriggerHeaderValue, verifySignatureWithConfig, verifyTriggerAuth } from "./trigger-auth.js";
|
|
33
33
|
import { _resetWaitUntilCache, getWaitUntil } from "./wait-until.js";
|
|
34
34
|
import { TRUSTED_WORK_APP_MCP_PATHS, isTrustedWorkAppMcpUrl } from "./work-app-mcp.js";
|
|
35
35
|
|
|
36
|
-
export { ERROR_DOCS_BASE_URL, ErrorCode, InternalServices, JsonTransformer, McpClient, MockLanguageModel, ModelFactory, PinoLogger, SlackAccessTokenPayloadSchema, SlackLinkIntentSchema, SlackLinkTokenPayloadSchema, TRUSTED_WORK_APP_MCP_PATHS, _resetWaitUntilCache, activeMcpClients, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, configureComposioMCPServer, convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, createApiError, createMockModel, decodeJwtPayload, detectAuthenticationRequired, errorResponseSchema, errorSchemaFactory, exchangeMcpAuthorizationCode, extractBearerToken, extractComposioServerId, extractPreviewFields, extractPublicId, fetchComposioServers, fetchSingleComposioServer, flushTraces, formatMessagesForLLM, formatMessagesForLLMContext, generateApiKey, generateAppCredential, generateId, generateInternalServiceToken, generateServiceToken, getComposioOAuthRedirectUrl, getComposioUserId, getConversationId, getCredentialStoreLookupKeyFromRetrievalParams, getInProcessFetch, getJwtSecret, getLogger, getMetadataFromApiKey, getPoWErrorMessage, getTracer, getWaitUntil, handleApiError, hasIssuer, hashApiKey, hashAuthenticationHeaders, hashTriggerHeaderValue, initiateMcpOAuthFlow, interpolateTemplate, isApiKeyExpired, isComposioMCPServerAuthenticated, isDevelopment, isInternalServiceToken, isPoWEnabled, isProduction, isSlackUserToken, isTest, isThirdPartyMCPServerAuthenticated, isTrustedWorkAppMcpUrl, isUniqueConstraintError, isZodSchema, loggerFactory, maskApiKey, normalizeDateString, parseEmbeddedJson, parseSSEResponse, preview, problemDetailsSchema, registerAppFetch, retryWithBackoff, sanitizeAppConfig, setSpanWithError, signJwt, signSlackLinkToken, signSlackUserToken, signTempToken, throwIfUniqueConstraintError, toISODateString, unwrapError, validateApiKey, validateInternalServiceProjectAccess, validateInternalServiceTenantAccess, validateOrigin, validateTargetAgent, validateTenantId, validateTriggerHeaderValue, verifyAuthorizationHeader, verifyInternalServiceAuthHeader, verifyInternalServiceToken, verifyJwt, verifyPoW, verifyServiceToken, verifySignatureWithConfig, verifySlackLinkToken, verifySlackUserToken, verifyTempToken, verifyTriggerAuth };
|
|
36
|
+
export { ERROR_DOCS_BASE_URL, ErrorCode, InternalServices, JsonTransformer, McpClient, MockLanguageModel, ModelFactory, PinoLogger, SlackAccessTokenPayloadSchema, SlackLinkIntentSchema, SlackLinkTokenPayloadSchema, TRUSTED_WORK_APP_MCP_PATHS, _resetWaitUntilCache, activeMcpClients, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, configureComposioMCPServer, convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, createApiError, createMockModel, decodeJwtPayload, deleteComposioConnectedAccount, detectAuthenticationRequired, errorResponseSchema, errorSchemaFactory, exchangeMcpAuthorizationCode, extractBearerToken, extractComposioServerId, extractPreviewFields, extractPublicId, fetchComposioServers, fetchSingleComposioServer, flushTraces, formatMessagesForLLM, formatMessagesForLLMContext, generateApiKey, generateAppCredential, generateId, generateInternalServiceToken, generateServiceToken, getComposioInstance, getComposioOAuthRedirectUrl, getComposioUserId, getConversationId, getCredentialStoreLookupKeyFromRetrievalParams, getInProcessFetch, getJwtSecret, getLogger, getMetadataFromApiKey, getPoWErrorMessage, getTracer, getWaitUntil, handleApiError, hasIssuer, hashApiKey, hashAuthenticationHeaders, hashTriggerHeaderValue, initiateMcpOAuthFlow, interpolateTemplate, isApiKeyExpired, isComposioMCPServerAuthenticated, isDevelopment, isInternalServiceToken, isPoWEnabled, isProduction, isSlackUserToken, isTest, isThirdPartyMCPServerAuthenticated, isTrustedWorkAppMcpUrl, isUniqueConstraintError, isZodSchema, loggerFactory, maskApiKey, normalizeDateString, parseEmbeddedJson, parseSSEResponse, preview, problemDetailsSchema, registerAppFetch, retryWithBackoff, sanitizeAppConfig, setSpanWithError, signJwt, signSlackLinkToken, signSlackUserToken, signTempToken, throwIfUniqueConstraintError, toISODateString, unwrapError, validateApiKey, validateInternalServiceProjectAccess, validateInternalServiceTenantAccess, validateOrigin, validateTargetAgent, validateTenantId, validateTriggerHeaderValue, verifyAuthorizationHeader, verifyInternalServiceAuthHeader, verifyInternalServiceToken, verifyJwt, verifyPoW, verifyServiceToken, verifySignatureWithConfig, verifySlackLinkToken, verifySlackUserToken, verifyTempToken, verifyTriggerAuth };
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { McpServerConfig } from "../mcp-client.js";
|
|
2
2
|
import { PrebuiltMCPServerSchema } from "../../validation/schemas.js";
|
|
3
3
|
import { z } from "@hono/zod-openapi";
|
|
4
|
+
import { Composio } from "@composio/core";
|
|
4
5
|
|
|
5
6
|
//#region src/utils/third-party-mcp-servers/composio-client.d.ts
|
|
6
7
|
|
|
7
8
|
type PrebuiltMCPServer = z.infer<typeof PrebuiltMCPServerSchema>;
|
|
9
|
+
/**
|
|
10
|
+
* Get or create a Composio instance
|
|
11
|
+
* Returns null if COMPOSIO_API_KEY is not configured
|
|
12
|
+
*/
|
|
13
|
+
declare function getComposioInstance(): Composio | null;
|
|
8
14
|
/**
|
|
9
15
|
* Credential scope type for MCP servers
|
|
10
16
|
*/
|
|
@@ -19,23 +25,33 @@ declare function getComposioUserId(tenantId: string, projectId: string, credenti
|
|
|
19
25
|
* Configure a Composio MCP server config with the appropriate user_id and x-api-key.
|
|
20
26
|
* Mutates serverConfig in place:
|
|
21
27
|
* - Injects user_id query param into the URL (scoped by tenant/project/user)
|
|
28
|
+
* - Injects connected_account_id query param if provided (pins to a specific account)
|
|
22
29
|
* - Injects x-api-key header from COMPOSIO_API_KEY env var
|
|
23
30
|
*
|
|
24
31
|
* No-op if the URL is not a composio.dev URL or already has a user_id.
|
|
25
32
|
*/
|
|
26
|
-
declare function configureComposioMCPServer(serverConfig: McpServerConfig, tenantId: string, projectId: string, credentialScope: CredentialScope, userId?: string): void;
|
|
33
|
+
declare function configureComposioMCPServer(serverConfig: McpServerConfig, tenantId: string, projectId: string, credentialScope: CredentialScope, userId?: string, connectedAccountId?: string): void;
|
|
27
34
|
/**
|
|
28
35
|
* Extract server ID from a Composio MCP URL
|
|
29
36
|
* Example: https://backend.composio.dev/v3/mcp/1234-1234-1234?user_id=... -> 1234-1234-1234
|
|
30
37
|
*/
|
|
31
38
|
declare function extractComposioServerId(mcpUrl: string): string | null;
|
|
39
|
+
/**
|
|
40
|
+
* Delete a Composio connected account
|
|
41
|
+
* Returns true if successful, false if failed (non-blocking)
|
|
42
|
+
*/
|
|
43
|
+
declare function deleteComposioConnectedAccount(accountId: string): Promise<boolean>;
|
|
44
|
+
interface ComposioAuthResult {
|
|
45
|
+
authenticated: boolean;
|
|
46
|
+
connectedAccountId?: string;
|
|
47
|
+
error?: boolean;
|
|
48
|
+
}
|
|
32
49
|
/**
|
|
33
50
|
* Check if a Composio MCP server is authenticated for the given tenant/project/user
|
|
34
|
-
* Returns true if authenticated, false otherwise
|
|
35
51
|
* @param credentialScope - 'project' for shared team credentials, 'user' for per-user credentials
|
|
36
52
|
* @param userId - The actual user ID (required if credentialScope is 'user')
|
|
37
53
|
*/
|
|
38
|
-
declare function isComposioMCPServerAuthenticated(tenantId: string, projectId: string, mcpServerUrl: string, credentialScope?: CredentialScope, userId?: string): Promise<
|
|
54
|
+
declare function isComposioMCPServerAuthenticated(tenantId: string, projectId: string, mcpServerUrl: string, credentialScope?: CredentialScope, userId?: string): Promise<ComposioAuthResult>;
|
|
39
55
|
/**
|
|
40
56
|
* Get the OAuth redirect URL for a Composio MCP server based on credential scope
|
|
41
57
|
* This should be called AFTER scope selection to get the correct URL
|
|
@@ -54,4 +70,4 @@ declare function fetchComposioServers(): Promise<PrebuiltMCPServer[]>;
|
|
|
54
70
|
*/
|
|
55
71
|
declare function fetchSingleComposioServer(tenantId: string, projectId: string, mcpServerUrl: string, credentialScope?: CredentialScope, userId?: string): Promise<PrebuiltMCPServer | null>;
|
|
56
72
|
//#endregion
|
|
57
|
-
export { CredentialScope, configureComposioMCPServer, extractComposioServerId, fetchComposioServers, fetchSingleComposioServer, getComposioOAuthRedirectUrl, getComposioUserId, isComposioMCPServerAuthenticated };
|
|
73
|
+
export { ComposioAuthResult, CredentialScope, configureComposioMCPServer, deleteComposioConnectedAccount, extractComposioServerId, fetchComposioServers, fetchSingleComposioServer, getComposioInstance, getComposioOAuthRedirectUrl, getComposioUserId, isComposioMCPServerAuthenticated };
|