@inkeep/agents-core 0.59.2 → 0.59.4
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-schema.d.ts +86 -86
- package/dist/auth/auth-validation-schemas.d.ts +137 -137
- package/dist/auth/auth.js +2 -2
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/client-exports.d.ts +2 -2
- package/dist/client-exports.js +2 -2
- package/dist/constants/signoz-queries.d.ts +30 -106
- package/dist/constants/signoz-queries.js +55 -108
- package/dist/data-access/manage/credentialReferences.js +1 -1
- package/dist/data-access/manage/dataComponents.js +1 -1
- package/dist/data-access/manage/skills.d.ts +1 -1
- package/dist/data-access/manage/subAgentRelations.d.ts +6 -6
- package/dist/data-access/manage/triggers.d.ts +2 -2
- package/dist/data-access/runtime/apiKeys.d.ts +4 -4
- package/dist/data-access/runtime/apps.d.ts +4 -4
- package/dist/data-access/runtime/conversations.d.ts +11 -11
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +3 -3
- package/dist/data-access/runtime/tasks.d.ts +4 -4
- package/dist/data-access/runtime/triggerInvocations.d.ts +1 -1
- package/dist/db/manage/manage-schema.d.ts +361 -361
- package/dist/db/runtime/runtime-schema.d.ts +14 -14
- package/dist/db/runtime/test-runtime-client.js +1 -1
- package/dist/dolt/advisory-lock.d.ts +7 -0
- package/dist/dolt/advisory-lock.js +18 -0
- package/dist/dolt/branches-api.d.ts +19 -9
- package/dist/dolt/branches-api.js +58 -29
- package/dist/dolt/index.d.ts +7 -4
- package/dist/dolt/index.js +7 -4
- package/dist/dolt/merge.d.ts +41 -5
- package/dist/dolt/merge.js +161 -24
- package/dist/dolt/pk-map.d.ts +6 -0
- package/dist/dolt/pk-map.js +27 -0
- package/dist/dolt/ref-middleware.d.ts +2 -1
- package/dist/dolt/ref-middleware.js +18 -4
- package/dist/dolt/resolve-conflicts.d.ts +10 -0
- package/dist/dolt/resolve-conflicts.js +100 -0
- package/dist/dolt/schema-sync.js +17 -17
- package/dist/index.d.ts +10 -7
- package/dist/index.js +11 -8
- package/dist/utils/error.d.ts +51 -51
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +3 -3
- package/dist/utils/schema-conversion.d.ts +27 -1
- package/dist/utils/schema-conversion.js +68 -1
- package/dist/utils/work-app-mcp.js +4 -3
- package/dist/validation/dolt-schemas.d.ts +96 -3
- package/dist/validation/dolt-schemas.js +54 -2
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +2 -2
- package/dist/validation/schemas.d.ts +1425 -1425
- package/package.json +2 -2
package/dist/utils/error.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { HTTPException } from "hono/http-exception";
|
|
|
3
3
|
|
|
4
4
|
//#region src/utils/error.d.ts
|
|
5
5
|
declare const ErrorCode: z.ZodEnum<{
|
|
6
|
-
bad_request: "bad_request";
|
|
7
6
|
unauthorized: "unauthorized";
|
|
7
|
+
bad_request: "bad_request";
|
|
8
8
|
forbidden: "forbidden";
|
|
9
9
|
not_found: "not_found";
|
|
10
10
|
conflict: "conflict";
|
|
@@ -20,8 +20,8 @@ declare const problemDetailsSchema: z.ZodObject<{
|
|
|
20
20
|
instance: z.ZodOptional<z.ZodString>;
|
|
21
21
|
requestId: z.ZodOptional<z.ZodString>;
|
|
22
22
|
code: z.ZodEnum<{
|
|
23
|
-
bad_request: "bad_request";
|
|
24
23
|
unauthorized: "unauthorized";
|
|
24
|
+
bad_request: "bad_request";
|
|
25
25
|
forbidden: "forbidden";
|
|
26
26
|
not_found: "not_found";
|
|
27
27
|
conflict: "conflict";
|
|
@@ -35,8 +35,8 @@ type ErrorCodes = z.infer<typeof ErrorCode>;
|
|
|
35
35
|
declare const errorResponseSchema: z.ZodObject<{
|
|
36
36
|
error: z.ZodObject<{
|
|
37
37
|
code: z.ZodEnum<{
|
|
38
|
-
bad_request: "bad_request";
|
|
39
38
|
unauthorized: "unauthorized";
|
|
39
|
+
bad_request: "bad_request";
|
|
40
40
|
forbidden: "forbidden";
|
|
41
41
|
not_found: "not_found";
|
|
42
42
|
conflict: "conflict";
|
|
@@ -74,12 +74,12 @@ declare const errorSchemaFactory: (code: ErrorCodes, description: string) => {
|
|
|
74
74
|
schema: z.ZodObject<{
|
|
75
75
|
instance: z.ZodOptional<z.ZodString>;
|
|
76
76
|
requestId: z.ZodOptional<z.ZodString>;
|
|
77
|
-
code: z.ZodLiteral<"
|
|
77
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
78
78
|
detail: z.ZodString;
|
|
79
79
|
title: z.ZodString;
|
|
80
80
|
status: z.ZodNumber;
|
|
81
81
|
error: z.ZodObject<{
|
|
82
|
-
code: z.ZodLiteral<"
|
|
82
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
83
83
|
message: z.ZodString;
|
|
84
84
|
}, z.core.$strip>;
|
|
85
85
|
}, z.core.$strip>;
|
|
@@ -96,12 +96,12 @@ declare const commonCreateErrorResponses: {
|
|
|
96
96
|
schema: z.ZodObject<{
|
|
97
97
|
instance: z.ZodOptional<z.ZodString>;
|
|
98
98
|
requestId: z.ZodOptional<z.ZodString>;
|
|
99
|
-
code: z.ZodLiteral<"
|
|
99
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
100
100
|
detail: z.ZodString;
|
|
101
101
|
title: z.ZodString;
|
|
102
102
|
status: z.ZodNumber;
|
|
103
103
|
error: z.ZodObject<{
|
|
104
|
-
code: z.ZodLiteral<"
|
|
104
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
105
105
|
message: z.ZodString;
|
|
106
106
|
}, z.core.$strip>;
|
|
107
107
|
}, z.core.$strip>;
|
|
@@ -115,12 +115,12 @@ declare const commonCreateErrorResponses: {
|
|
|
115
115
|
schema: z.ZodObject<{
|
|
116
116
|
instance: z.ZodOptional<z.ZodString>;
|
|
117
117
|
requestId: z.ZodOptional<z.ZodString>;
|
|
118
|
-
code: z.ZodLiteral<"
|
|
118
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
119
119
|
detail: z.ZodString;
|
|
120
120
|
title: z.ZodString;
|
|
121
121
|
status: z.ZodNumber;
|
|
122
122
|
error: z.ZodObject<{
|
|
123
|
-
code: z.ZodLiteral<"
|
|
123
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
124
124
|
message: z.ZodString;
|
|
125
125
|
}, z.core.$strip>;
|
|
126
126
|
}, z.core.$strip>;
|
|
@@ -134,12 +134,12 @@ declare const commonCreateErrorResponses: {
|
|
|
134
134
|
schema: z.ZodObject<{
|
|
135
135
|
instance: z.ZodOptional<z.ZodString>;
|
|
136
136
|
requestId: z.ZodOptional<z.ZodString>;
|
|
137
|
-
code: z.ZodLiteral<"
|
|
137
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
138
138
|
detail: z.ZodString;
|
|
139
139
|
title: z.ZodString;
|
|
140
140
|
status: z.ZodNumber;
|
|
141
141
|
error: z.ZodObject<{
|
|
142
|
-
code: z.ZodLiteral<"
|
|
142
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
143
143
|
message: z.ZodString;
|
|
144
144
|
}, z.core.$strip>;
|
|
145
145
|
}, z.core.$strip>;
|
|
@@ -153,12 +153,12 @@ declare const commonCreateErrorResponses: {
|
|
|
153
153
|
schema: z.ZodObject<{
|
|
154
154
|
instance: z.ZodOptional<z.ZodString>;
|
|
155
155
|
requestId: z.ZodOptional<z.ZodString>;
|
|
156
|
-
code: z.ZodLiteral<"
|
|
156
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
157
157
|
detail: z.ZodString;
|
|
158
158
|
title: z.ZodString;
|
|
159
159
|
status: z.ZodNumber;
|
|
160
160
|
error: z.ZodObject<{
|
|
161
|
-
code: z.ZodLiteral<"
|
|
161
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
162
162
|
message: z.ZodString;
|
|
163
163
|
}, z.core.$strip>;
|
|
164
164
|
}, z.core.$strip>;
|
|
@@ -172,12 +172,12 @@ declare const commonCreateErrorResponses: {
|
|
|
172
172
|
schema: z.ZodObject<{
|
|
173
173
|
instance: z.ZodOptional<z.ZodString>;
|
|
174
174
|
requestId: z.ZodOptional<z.ZodString>;
|
|
175
|
-
code: z.ZodLiteral<"
|
|
175
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
176
176
|
detail: z.ZodString;
|
|
177
177
|
title: z.ZodString;
|
|
178
178
|
status: z.ZodNumber;
|
|
179
179
|
error: z.ZodObject<{
|
|
180
|
-
code: z.ZodLiteral<"
|
|
180
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
181
181
|
message: z.ZodString;
|
|
182
182
|
}, z.core.$strip>;
|
|
183
183
|
}, z.core.$strip>;
|
|
@@ -193,12 +193,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
193
193
|
schema: z.ZodObject<{
|
|
194
194
|
instance: z.ZodOptional<z.ZodString>;
|
|
195
195
|
requestId: z.ZodOptional<z.ZodString>;
|
|
196
|
-
code: z.ZodLiteral<"
|
|
196
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
197
197
|
detail: z.ZodString;
|
|
198
198
|
title: z.ZodString;
|
|
199
199
|
status: z.ZodNumber;
|
|
200
200
|
error: z.ZodObject<{
|
|
201
|
-
code: z.ZodLiteral<"
|
|
201
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
202
202
|
message: z.ZodString;
|
|
203
203
|
}, z.core.$strip>;
|
|
204
204
|
}, z.core.$strip>;
|
|
@@ -212,12 +212,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
212
212
|
schema: z.ZodObject<{
|
|
213
213
|
instance: z.ZodOptional<z.ZodString>;
|
|
214
214
|
requestId: z.ZodOptional<z.ZodString>;
|
|
215
|
-
code: z.ZodLiteral<"
|
|
215
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
216
216
|
detail: z.ZodString;
|
|
217
217
|
title: z.ZodString;
|
|
218
218
|
status: z.ZodNumber;
|
|
219
219
|
error: z.ZodObject<{
|
|
220
|
-
code: z.ZodLiteral<"
|
|
220
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
221
221
|
message: z.ZodString;
|
|
222
222
|
}, z.core.$strip>;
|
|
223
223
|
}, z.core.$strip>;
|
|
@@ -231,12 +231,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
231
231
|
schema: z.ZodObject<{
|
|
232
232
|
instance: z.ZodOptional<z.ZodString>;
|
|
233
233
|
requestId: z.ZodOptional<z.ZodString>;
|
|
234
|
-
code: z.ZodLiteral<"
|
|
234
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
235
235
|
detail: z.ZodString;
|
|
236
236
|
title: z.ZodString;
|
|
237
237
|
status: z.ZodNumber;
|
|
238
238
|
error: z.ZodObject<{
|
|
239
|
-
code: z.ZodLiteral<"
|
|
239
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
240
240
|
message: z.ZodString;
|
|
241
241
|
}, z.core.$strip>;
|
|
242
242
|
}, z.core.$strip>;
|
|
@@ -250,12 +250,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
250
250
|
schema: z.ZodObject<{
|
|
251
251
|
instance: z.ZodOptional<z.ZodString>;
|
|
252
252
|
requestId: z.ZodOptional<z.ZodString>;
|
|
253
|
-
code: z.ZodLiteral<"
|
|
253
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
254
254
|
detail: z.ZodString;
|
|
255
255
|
title: z.ZodString;
|
|
256
256
|
status: z.ZodNumber;
|
|
257
257
|
error: z.ZodObject<{
|
|
258
|
-
code: z.ZodLiteral<"
|
|
258
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
259
259
|
message: z.ZodString;
|
|
260
260
|
}, z.core.$strip>;
|
|
261
261
|
}, z.core.$strip>;
|
|
@@ -269,12 +269,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
269
269
|
schema: z.ZodObject<{
|
|
270
270
|
instance: z.ZodOptional<z.ZodString>;
|
|
271
271
|
requestId: z.ZodOptional<z.ZodString>;
|
|
272
|
-
code: z.ZodLiteral<"
|
|
272
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
273
273
|
detail: z.ZodString;
|
|
274
274
|
title: z.ZodString;
|
|
275
275
|
status: z.ZodNumber;
|
|
276
276
|
error: z.ZodObject<{
|
|
277
|
-
code: z.ZodLiteral<"
|
|
277
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
278
278
|
message: z.ZodString;
|
|
279
279
|
}, z.core.$strip>;
|
|
280
280
|
}, z.core.$strip>;
|
|
@@ -288,12 +288,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
288
288
|
schema: z.ZodObject<{
|
|
289
289
|
instance: z.ZodOptional<z.ZodString>;
|
|
290
290
|
requestId: z.ZodOptional<z.ZodString>;
|
|
291
|
-
code: z.ZodLiteral<"
|
|
291
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
292
292
|
detail: z.ZodString;
|
|
293
293
|
title: z.ZodString;
|
|
294
294
|
status: z.ZodNumber;
|
|
295
295
|
error: z.ZodObject<{
|
|
296
|
-
code: z.ZodLiteral<"
|
|
296
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
297
297
|
message: z.ZodString;
|
|
298
298
|
}, z.core.$strip>;
|
|
299
299
|
}, z.core.$strip>;
|
|
@@ -309,12 +309,12 @@ declare const commonGetErrorResponses: {
|
|
|
309
309
|
schema: z.ZodObject<{
|
|
310
310
|
instance: z.ZodOptional<z.ZodString>;
|
|
311
311
|
requestId: z.ZodOptional<z.ZodString>;
|
|
312
|
-
code: z.ZodLiteral<"
|
|
312
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
313
313
|
detail: z.ZodString;
|
|
314
314
|
title: z.ZodString;
|
|
315
315
|
status: z.ZodNumber;
|
|
316
316
|
error: z.ZodObject<{
|
|
317
|
-
code: z.ZodLiteral<"
|
|
317
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
318
318
|
message: z.ZodString;
|
|
319
319
|
}, z.core.$strip>;
|
|
320
320
|
}, z.core.$strip>;
|
|
@@ -328,12 +328,12 @@ declare const commonGetErrorResponses: {
|
|
|
328
328
|
schema: z.ZodObject<{
|
|
329
329
|
instance: z.ZodOptional<z.ZodString>;
|
|
330
330
|
requestId: z.ZodOptional<z.ZodString>;
|
|
331
|
-
code: z.ZodLiteral<"
|
|
331
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
332
332
|
detail: z.ZodString;
|
|
333
333
|
title: z.ZodString;
|
|
334
334
|
status: z.ZodNumber;
|
|
335
335
|
error: z.ZodObject<{
|
|
336
|
-
code: z.ZodLiteral<"
|
|
336
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
337
337
|
message: z.ZodString;
|
|
338
338
|
}, z.core.$strip>;
|
|
339
339
|
}, z.core.$strip>;
|
|
@@ -347,12 +347,12 @@ declare const commonGetErrorResponses: {
|
|
|
347
347
|
schema: z.ZodObject<{
|
|
348
348
|
instance: z.ZodOptional<z.ZodString>;
|
|
349
349
|
requestId: z.ZodOptional<z.ZodString>;
|
|
350
|
-
code: z.ZodLiteral<"
|
|
350
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
351
351
|
detail: z.ZodString;
|
|
352
352
|
title: z.ZodString;
|
|
353
353
|
status: z.ZodNumber;
|
|
354
354
|
error: z.ZodObject<{
|
|
355
|
-
code: z.ZodLiteral<"
|
|
355
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
356
356
|
message: z.ZodString;
|
|
357
357
|
}, z.core.$strip>;
|
|
358
358
|
}, z.core.$strip>;
|
|
@@ -366,12 +366,12 @@ declare const commonGetErrorResponses: {
|
|
|
366
366
|
schema: z.ZodObject<{
|
|
367
367
|
instance: z.ZodOptional<z.ZodString>;
|
|
368
368
|
requestId: z.ZodOptional<z.ZodString>;
|
|
369
|
-
code: z.ZodLiteral<"
|
|
369
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
370
370
|
detail: z.ZodString;
|
|
371
371
|
title: z.ZodString;
|
|
372
372
|
status: z.ZodNumber;
|
|
373
373
|
error: z.ZodObject<{
|
|
374
|
-
code: z.ZodLiteral<"
|
|
374
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
375
375
|
message: z.ZodString;
|
|
376
376
|
}, z.core.$strip>;
|
|
377
377
|
}, z.core.$strip>;
|
|
@@ -385,12 +385,12 @@ declare const commonGetErrorResponses: {
|
|
|
385
385
|
schema: z.ZodObject<{
|
|
386
386
|
instance: z.ZodOptional<z.ZodString>;
|
|
387
387
|
requestId: z.ZodOptional<z.ZodString>;
|
|
388
|
-
code: z.ZodLiteral<"
|
|
388
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
389
389
|
detail: z.ZodString;
|
|
390
390
|
title: z.ZodString;
|
|
391
391
|
status: z.ZodNumber;
|
|
392
392
|
error: z.ZodObject<{
|
|
393
|
-
code: z.ZodLiteral<"
|
|
393
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
394
394
|
message: z.ZodString;
|
|
395
395
|
}, z.core.$strip>;
|
|
396
396
|
}, z.core.$strip>;
|
|
@@ -404,12 +404,12 @@ declare const commonGetErrorResponses: {
|
|
|
404
404
|
schema: z.ZodObject<{
|
|
405
405
|
instance: z.ZodOptional<z.ZodString>;
|
|
406
406
|
requestId: z.ZodOptional<z.ZodString>;
|
|
407
|
-
code: z.ZodLiteral<"
|
|
407
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
408
408
|
detail: z.ZodString;
|
|
409
409
|
title: z.ZodString;
|
|
410
410
|
status: z.ZodNumber;
|
|
411
411
|
error: z.ZodObject<{
|
|
412
|
-
code: z.ZodLiteral<"
|
|
412
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
413
413
|
message: z.ZodString;
|
|
414
414
|
}, z.core.$strip>;
|
|
415
415
|
}, z.core.$strip>;
|
|
@@ -425,12 +425,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
425
425
|
schema: z.ZodObject<{
|
|
426
426
|
instance: z.ZodOptional<z.ZodString>;
|
|
427
427
|
requestId: z.ZodOptional<z.ZodString>;
|
|
428
|
-
code: z.ZodLiteral<"
|
|
428
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
429
429
|
detail: z.ZodString;
|
|
430
430
|
title: z.ZodString;
|
|
431
431
|
status: z.ZodNumber;
|
|
432
432
|
error: z.ZodObject<{
|
|
433
|
-
code: z.ZodLiteral<"
|
|
433
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
434
434
|
message: z.ZodString;
|
|
435
435
|
}, z.core.$strip>;
|
|
436
436
|
}, z.core.$strip>;
|
|
@@ -444,12 +444,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
444
444
|
schema: z.ZodObject<{
|
|
445
445
|
instance: z.ZodOptional<z.ZodString>;
|
|
446
446
|
requestId: z.ZodOptional<z.ZodString>;
|
|
447
|
-
code: z.ZodLiteral<"
|
|
447
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
448
448
|
detail: z.ZodString;
|
|
449
449
|
title: z.ZodString;
|
|
450
450
|
status: z.ZodNumber;
|
|
451
451
|
error: z.ZodObject<{
|
|
452
|
-
code: z.ZodLiteral<"
|
|
452
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
453
453
|
message: z.ZodString;
|
|
454
454
|
}, z.core.$strip>;
|
|
455
455
|
}, z.core.$strip>;
|
|
@@ -463,12 +463,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
463
463
|
schema: z.ZodObject<{
|
|
464
464
|
instance: z.ZodOptional<z.ZodString>;
|
|
465
465
|
requestId: z.ZodOptional<z.ZodString>;
|
|
466
|
-
code: z.ZodLiteral<"
|
|
466
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
467
467
|
detail: z.ZodString;
|
|
468
468
|
title: z.ZodString;
|
|
469
469
|
status: z.ZodNumber;
|
|
470
470
|
error: z.ZodObject<{
|
|
471
|
-
code: z.ZodLiteral<"
|
|
471
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
472
472
|
message: z.ZodString;
|
|
473
473
|
}, z.core.$strip>;
|
|
474
474
|
}, z.core.$strip>;
|
|
@@ -482,12 +482,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
482
482
|
schema: z.ZodObject<{
|
|
483
483
|
instance: z.ZodOptional<z.ZodString>;
|
|
484
484
|
requestId: z.ZodOptional<z.ZodString>;
|
|
485
|
-
code: z.ZodLiteral<"
|
|
485
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
486
486
|
detail: z.ZodString;
|
|
487
487
|
title: z.ZodString;
|
|
488
488
|
status: z.ZodNumber;
|
|
489
489
|
error: z.ZodObject<{
|
|
490
|
-
code: z.ZodLiteral<"
|
|
490
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
491
491
|
message: z.ZodString;
|
|
492
492
|
}, z.core.$strip>;
|
|
493
493
|
}, z.core.$strip>;
|
|
@@ -501,12 +501,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
501
501
|
schema: z.ZodObject<{
|
|
502
502
|
instance: z.ZodOptional<z.ZodString>;
|
|
503
503
|
requestId: z.ZodOptional<z.ZodString>;
|
|
504
|
-
code: z.ZodLiteral<"
|
|
504
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
505
505
|
detail: z.ZodString;
|
|
506
506
|
title: z.ZodString;
|
|
507
507
|
status: z.ZodNumber;
|
|
508
508
|
error: z.ZodObject<{
|
|
509
|
-
code: z.ZodLiteral<"
|
|
509
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
510
510
|
message: z.ZodString;
|
|
511
511
|
}, z.core.$strip>;
|
|
512
512
|
}, z.core.$strip>;
|
|
@@ -520,12 +520,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
520
520
|
schema: z.ZodObject<{
|
|
521
521
|
instance: z.ZodOptional<z.ZodString>;
|
|
522
522
|
requestId: z.ZodOptional<z.ZodString>;
|
|
523
|
-
code: z.ZodLiteral<"
|
|
523
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
524
524
|
detail: z.ZodString;
|
|
525
525
|
title: z.ZodString;
|
|
526
526
|
status: z.ZodNumber;
|
|
527
527
|
error: z.ZodObject<{
|
|
528
|
-
code: z.ZodLiteral<"
|
|
528
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
529
529
|
message: z.ZodString;
|
|
530
530
|
}, z.core.$strip>;
|
|
531
531
|
}, z.core.$strip>;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ import { MockLanguageModel, createMockModel } from "./mock-provider.js";
|
|
|
18
18
|
import { ModelFactory } from "./model-factory.js";
|
|
19
19
|
import { PoWError, PoWResult, getPoWErrorMessage, isPoWEnabled, verifyPoW } from "./pow.js";
|
|
20
20
|
import { retryWithBackoff } from "./retry.js";
|
|
21
|
-
import { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, preview } from "./schema-conversion.js";
|
|
21
|
+
import { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, makeAllPropertiesRequired, normalizeDataComponentSchema, preview, stripUnsupportedConstraints } from "./schema-conversion.js";
|
|
22
22
|
import { GenerateServiceTokenParams, ServiceTokenPayload, VerifyServiceTokenResult, generateServiceToken, validateTargetAgent, validateTenantId, verifyAuthorizationHeader, verifyServiceToken } from "./service-token-auth.js";
|
|
23
23
|
import { SignSlackLinkTokenParams, SlackLinkIntent, SlackLinkIntentSchema, SlackLinkTokenPayload, SlackLinkTokenPayloadSchema, VerifySlackLinkTokenResult, signSlackLinkToken, verifySlackLinkToken } from "./slack-link-token.js";
|
|
24
24
|
import { SignSlackUserTokenParams, SlackAccessTokenPayload, SlackAccessTokenPayloadSchema, VerifySlackUserTokenResult, isSlackUserToken, signSlackUserToken, verifySlackUserToken } from "./slack-user-token.js";
|
|
@@ -32,4 +32,4 @@ import { flushTraces, getTracer, setSpanWithError, unwrapError } from "./tracer-
|
|
|
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, 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 };
|
|
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, makeAllPropertiesRequired, maskApiKey, normalizeDataComponentSchema, normalizeDateString, parseEmbeddedJson, parseSSEResponse, preview, problemDetailsSchema, registerAppFetch, retryWithBackoff, sanitizeAppConfig, setSpanWithError, signJwt, signSlackLinkToken, signSlackUserToken, signTempToken, stripUnsupportedConstraints, 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
|
@@ -2,17 +2,17 @@ import { detectAuthenticationRequired, exchangeMcpAuthorizationCode, initiateMcp
|
|
|
2
2
|
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
|
-
import { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, preview } from "./schema-conversion.js";
|
|
5
|
+
import { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, makeAllPropertiesRequired, normalizeDataComponentSchema, preview, stripUnsupportedConstraints } from "./schema-conversion.js";
|
|
6
6
|
import { configureComposioMCPServer, deleteComposioConnectedAccount, extractComposioServerId, fetchComposioServers, fetchSingleComposioServer, getComposioInstance, getComposioOAuthRedirectUrl, getComposioUserId, isComposioMCPServerAuthenticated } from "./third-party-mcp-servers/composio-client.js";
|
|
7
7
|
import { isThirdPartyMCPServerAuthenticated } from "./third-party-mcp-servers/third-party-check.js";
|
|
8
8
|
import "./third-party-mcp-servers/index.js";
|
|
9
9
|
import { getCredentialStoreLookupKeyFromRetrievalParams } from "./credential-store-utils.js";
|
|
10
10
|
import { generateId, getConversationId } from "./conversations.js";
|
|
11
|
+
import { ERROR_DOCS_BASE_URL, ErrorCode, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, createApiError, errorResponseSchema, errorSchemaFactory, handleApiError, isUniqueConstraintError, problemDetailsSchema, throwIfUniqueConstraintError } from "./error.js";
|
|
11
12
|
import { extractPublicId, generateApiKey, generateAppCredential, getMetadataFromApiKey, hashApiKey, isApiKeyExpired, maskApiKey, sanitizeAppConfig, validateApiKey } from "./apiKeys.js";
|
|
12
13
|
import { normalizeDateString, toISODateString } from "./date.js";
|
|
13
14
|
import { validateOrigin } from "./domain-validation.js";
|
|
14
15
|
import { isDevelopment, isProduction, isTest } from "./env-detection.js";
|
|
15
|
-
import { ERROR_DOCS_BASE_URL, ErrorCode, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, createApiError, errorResponseSchema, errorSchemaFactory, handleApiError, isUniqueConstraintError, problemDetailsSchema, throwIfUniqueConstraintError } from "./error.js";
|
|
16
16
|
import { formatMessagesForLLM, formatMessagesForLLMContext } from "./format-messages.js";
|
|
17
17
|
import { getInProcessFetch, registerAppFetch } from "./in-process-fetch.js";
|
|
18
18
|
import { JsonTransformer } from "./JsonTransformer.js";
|
|
@@ -33,4 +33,4 @@ import { hashAuthenticationHeaders, hashTriggerHeaderValue, validateTriggerHeade
|
|
|
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, 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 };
|
|
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, makeAllPropertiesRequired, maskApiKey, normalizeDataComponentSchema, normalizeDateString, parseEmbeddedJson, parseSSEResponse, preview, problemDetailsSchema, registerAppFetch, retryWithBackoff, sanitizeAppConfig, setSpanWithError, signJwt, signSlackLinkToken, signSlackUserToken, signTempToken, stripUnsupportedConstraints, throwIfUniqueConstraintError, toISODateString, unwrapError, validateApiKey, validateInternalServiceProjectAccess, validateInternalServiceTenantAccess, validateOrigin, validateTargetAgent, validateTenantId, validateTriggerHeaderValue, verifyAuthorizationHeader, verifyInternalServiceAuthHeader, verifyInternalServiceToken, verifyJwt, verifyPoW, verifyServiceToken, verifySignatureWithConfig, verifySlackLinkToken, verifySlackUserToken, verifyTempToken, verifyTriggerAuth };
|
|
@@ -20,9 +20,35 @@ declare function convertZodToJsonSchemaWithPreview(zodSchema: z.ZodTypeAny): Rec
|
|
|
20
20
|
* Type guard to check if a value is a Zod schema
|
|
21
21
|
*/
|
|
22
22
|
declare function isZodSchema(value: any): value is z.ZodObject<any>;
|
|
23
|
+
/**
|
|
24
|
+
* Strips JSON Schema numeric constraints that are not supported by all LLM providers.
|
|
25
|
+
*
|
|
26
|
+
* Anthropic structured output rejects `minimum`, `maximum`, `exclusiveMinimum`,
|
|
27
|
+
* `exclusiveMaximum`, and `multipleOf` on `number`/`integer` types.
|
|
28
|
+
* Applied recursively to handle nested objects and arrays.
|
|
29
|
+
*/
|
|
30
|
+
declare function stripUnsupportedConstraints<T extends Record<string, unknown> | null | undefined>(schema: T): T;
|
|
31
|
+
/**
|
|
32
|
+
* Makes all properties required in an object schema, wrapping originally-optional
|
|
33
|
+
* fields as `{ anyOf: [<schema>, { type: 'null' }] }`.
|
|
34
|
+
*
|
|
35
|
+
* OpenAI strict-mode structured output requires every key in `properties` to also
|
|
36
|
+
* appear in `required`. Applied recursively to handle nested objects and arrays.
|
|
37
|
+
*/
|
|
38
|
+
declare function makeAllPropertiesRequired<T extends Record<string, unknown> | null | undefined>(schema: T): T;
|
|
39
|
+
/**
|
|
40
|
+
* Normalizes a data component JSON Schema for cross-provider LLM compatibility.
|
|
41
|
+
*
|
|
42
|
+
* Applies two transformations in order:
|
|
43
|
+
* 1. `stripUnsupportedConstraints` — removes `minimum`/`maximum`/etc. from numbers
|
|
44
|
+
* (Anthropic structured output rejects these)
|
|
45
|
+
* 2. `makeAllPropertiesRequired` — ensures every property appears in `required`,
|
|
46
|
+
* wrapping optional fields as nullable (OpenAI strict-mode requires this)
|
|
47
|
+
*/
|
|
48
|
+
declare function normalizeDataComponentSchema<T extends Record<string, unknown> | null | undefined>(schema: T): T;
|
|
23
49
|
/**
|
|
24
50
|
* Extract preview fields from either JSON Schema or Zod schema
|
|
25
51
|
*/
|
|
26
52
|
declare function extractPreviewFields(schema: any): string[];
|
|
27
53
|
//#endregion
|
|
28
|
-
export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, preview };
|
|
54
|
+
export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, makeAllPropertiesRequired, normalizeDataComponentSchema, preview, stripUnsupportedConstraints };
|
|
@@ -46,6 +46,73 @@ function isZodSchema(value) {
|
|
|
46
46
|
return value?._def?.type === "object";
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
+
* Strips JSON Schema numeric constraints that are not supported by all LLM providers.
|
|
50
|
+
*
|
|
51
|
+
* Anthropic structured output rejects `minimum`, `maximum`, `exclusiveMinimum`,
|
|
52
|
+
* `exclusiveMaximum`, and `multipleOf` on `number`/`integer` types.
|
|
53
|
+
* Applied recursively to handle nested objects and arrays.
|
|
54
|
+
*/
|
|
55
|
+
function stripUnsupportedConstraints(schema) {
|
|
56
|
+
if (!schema || typeof schema !== "object") return schema;
|
|
57
|
+
const stripped = { ...schema };
|
|
58
|
+
if (stripped.type === "number" || stripped.type === "integer") {
|
|
59
|
+
delete stripped.minimum;
|
|
60
|
+
delete stripped.maximum;
|
|
61
|
+
delete stripped.exclusiveMinimum;
|
|
62
|
+
delete stripped.exclusiveMaximum;
|
|
63
|
+
delete stripped.multipleOf;
|
|
64
|
+
}
|
|
65
|
+
if (stripped.properties && typeof stripped.properties === "object") {
|
|
66
|
+
const strippedProperties = {};
|
|
67
|
+
for (const [key, value] of Object.entries(stripped.properties)) strippedProperties[key] = stripUnsupportedConstraints(value);
|
|
68
|
+
stripped.properties = strippedProperties;
|
|
69
|
+
}
|
|
70
|
+
if (stripped.items) stripped.items = stripUnsupportedConstraints(stripped.items);
|
|
71
|
+
if (Array.isArray(stripped.anyOf)) stripped.anyOf = stripped.anyOf.map((s) => stripUnsupportedConstraints(s));
|
|
72
|
+
if (Array.isArray(stripped.oneOf)) stripped.oneOf = stripped.oneOf.map((s) => stripUnsupportedConstraints(s));
|
|
73
|
+
if (Array.isArray(stripped.allOf)) stripped.allOf = stripped.allOf.map((s) => stripUnsupportedConstraints(s));
|
|
74
|
+
return stripped;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Makes all properties required in an object schema, wrapping originally-optional
|
|
78
|
+
* fields as `{ anyOf: [<schema>, { type: 'null' }] }`.
|
|
79
|
+
*
|
|
80
|
+
* OpenAI strict-mode structured output requires every key in `properties` to also
|
|
81
|
+
* appear in `required`. Applied recursively to handle nested objects and arrays.
|
|
82
|
+
*/
|
|
83
|
+
function makeAllPropertiesRequired(schema) {
|
|
84
|
+
if (!schema || typeof schema !== "object") return schema;
|
|
85
|
+
const normalized = { ...schema };
|
|
86
|
+
if (normalized.properties && typeof normalized.properties === "object") {
|
|
87
|
+
const originalRequired = Array.isArray(normalized.required) ? normalized.required : [];
|
|
88
|
+
normalized.required = Object.keys(normalized.properties);
|
|
89
|
+
const normalizedProperties = {};
|
|
90
|
+
for (const [key, value] of Object.entries(normalized.properties)) {
|
|
91
|
+
const processed = makeAllPropertiesRequired(value);
|
|
92
|
+
const alreadyNullable = Array.isArray(processed.anyOf) && processed.anyOf.some((s) => s?.type === "null") || processed.nullable === true;
|
|
93
|
+
normalizedProperties[key] = originalRequired.includes(key) || alreadyNullable ? processed : { anyOf: [processed, { type: "null" }] };
|
|
94
|
+
}
|
|
95
|
+
normalized.properties = normalizedProperties;
|
|
96
|
+
}
|
|
97
|
+
if (normalized.items) normalized.items = makeAllPropertiesRequired(normalized.items);
|
|
98
|
+
if (Array.isArray(normalized.anyOf)) normalized.anyOf = normalized.anyOf.map((s) => makeAllPropertiesRequired(s));
|
|
99
|
+
if (Array.isArray(normalized.oneOf)) normalized.oneOf = normalized.oneOf.map((s) => makeAllPropertiesRequired(s));
|
|
100
|
+
if (Array.isArray(normalized.allOf)) normalized.allOf = normalized.allOf.map((s) => makeAllPropertiesRequired(s));
|
|
101
|
+
return normalized;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Normalizes a data component JSON Schema for cross-provider LLM compatibility.
|
|
105
|
+
*
|
|
106
|
+
* Applies two transformations in order:
|
|
107
|
+
* 1. `stripUnsupportedConstraints` — removes `minimum`/`maximum`/etc. from numbers
|
|
108
|
+
* (Anthropic structured output rejects these)
|
|
109
|
+
* 2. `makeAllPropertiesRequired` — ensures every property appears in `required`,
|
|
110
|
+
* wrapping optional fields as nullable (OpenAI strict-mode requires this)
|
|
111
|
+
*/
|
|
112
|
+
function normalizeDataComponentSchema(schema) {
|
|
113
|
+
return makeAllPropertiesRequired(stripUnsupportedConstraints(schema));
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
49
116
|
* Extract preview fields from either JSON Schema or Zod schema
|
|
50
117
|
*/
|
|
51
118
|
function extractPreviewFields(schema) {
|
|
@@ -62,4 +129,4 @@ function extractPreviewFields(schema) {
|
|
|
62
129
|
}
|
|
63
130
|
|
|
64
131
|
//#endregion
|
|
65
|
-
export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, preview };
|
|
132
|
+
export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, makeAllPropertiesRequired, normalizeDataComponentSchema, preview, stripUnsupportedConstraints };
|
|
@@ -6,9 +6,10 @@ const TRUSTED_WORK_APP_MCP_PATHS = {
|
|
|
6
6
|
const isTrustedWorkAppMcpUrl = (url, path, baseUrl) => {
|
|
7
7
|
if (!baseUrl) return false;
|
|
8
8
|
try {
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
9
|
+
const toolUrl = new URL(String(url));
|
|
10
|
+
const base = new URL(baseUrl);
|
|
11
|
+
const baseDomain = base.hostname.split(".").slice(-2).join(".");
|
|
12
|
+
return (toolUrl.hostname === base.hostname || toolUrl.hostname.endsWith(`.${baseDomain}`)) && toolUrl.pathname === path;
|
|
12
13
|
} catch {
|
|
13
14
|
return false;
|
|
14
15
|
}
|