@inkeep/agents-core 0.0.0-dev-20260407022655 → 0.0.0-dev-20260407034218
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 +108 -108
- package/dist/auth/auth-validation-schemas.d.ts +154 -154
- package/dist/auth/auth.d.ts +6 -6
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/data-access/manage/agents.d.ts +37 -37
- package/dist/data-access/manage/artifactComponents.d.ts +14 -14
- package/dist/data-access/manage/contextConfigs.d.ts +16 -16
- package/dist/data-access/manage/dataComponents.d.ts +6 -6
- package/dist/data-access/manage/dataComponents.js +1 -1
- package/dist/data-access/manage/functionTools.d.ts +14 -14
- package/dist/data-access/manage/skills.d.ts +11 -11
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgentRelations.d.ts +20 -20
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgents.d.ts +15 -15
- package/dist/data-access/manage/tools.d.ts +21 -21
- package/dist/data-access/manage/triggers.d.ts +2 -2
- package/dist/data-access/runtime/apiKeys.d.ts +12 -12
- package/dist/data-access/runtime/apps.d.ts +10 -10
- package/dist/data-access/runtime/conversations.d.ts +16 -16
- package/dist/data-access/runtime/feedback.d.ts +8 -8
- package/dist/data-access/runtime/messages.d.ts +15 -15
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +4 -4
- package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +1 -1
- package/dist/data-access/runtime/tasks.d.ts +5 -5
- package/dist/db/manage/dolt-safe-jsonb.d.ts +2 -2
- package/dist/db/manage/manage-client.js +15 -3
- package/dist/db/manage/manage-schema.d.ts +449 -449
- package/dist/db/runtime/runtime-client.js +7 -1
- package/dist/db/runtime/runtime-schema.d.ts +407 -407
- package/dist/dolt/merge.js +7 -9
- package/dist/dolt/ref-scope.js +8 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/utils/error.d.ts +58 -52
- package/dist/utils/error.js +54 -17
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +2 -2
- package/dist/utils/logger.js +5 -1
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas/skills.d.ts +44 -44
- package/dist/validation/schemas.d.ts +2080 -2080
- package/package.json +1 -1
package/dist/utils/error.d.ts
CHANGED
|
@@ -2,9 +2,15 @@ import { z } from "@hono/zod-openapi";
|
|
|
2
2
|
import { HTTPException } from "hono/http-exception";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/error.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Builds structured fields from an error chain (Drizzle → pg DatabaseError / Doltgres).
|
|
8
|
+
* Outer wrappers often omit SQLSTATE and server detail; those live on nested `.cause`.
|
|
9
|
+
*/
|
|
10
|
+
declare function getDatabaseErrorLogContext(error: unknown): Record<string, unknown>;
|
|
5
11
|
declare const ErrorCode: z.ZodEnum<{
|
|
6
|
-
unauthorized: "unauthorized";
|
|
7
12
|
bad_request: "bad_request";
|
|
13
|
+
unauthorized: "unauthorized";
|
|
8
14
|
payment_required: "payment_required";
|
|
9
15
|
forbidden: "forbidden";
|
|
10
16
|
not_found: "not_found";
|
|
@@ -21,8 +27,8 @@ declare const problemDetailsSchema: z.ZodObject<{
|
|
|
21
27
|
instance: z.ZodOptional<z.ZodString>;
|
|
22
28
|
requestId: z.ZodOptional<z.ZodString>;
|
|
23
29
|
code: z.ZodEnum<{
|
|
24
|
-
unauthorized: "unauthorized";
|
|
25
30
|
bad_request: "bad_request";
|
|
31
|
+
unauthorized: "unauthorized";
|
|
26
32
|
payment_required: "payment_required";
|
|
27
33
|
forbidden: "forbidden";
|
|
28
34
|
not_found: "not_found";
|
|
@@ -37,8 +43,8 @@ type ErrorCodes = z.infer<typeof ErrorCode>;
|
|
|
37
43
|
declare const errorResponseSchema: z.ZodObject<{
|
|
38
44
|
error: z.ZodObject<{
|
|
39
45
|
code: z.ZodEnum<{
|
|
40
|
-
unauthorized: "unauthorized";
|
|
41
46
|
bad_request: "bad_request";
|
|
47
|
+
unauthorized: "unauthorized";
|
|
42
48
|
payment_required: "payment_required";
|
|
43
49
|
forbidden: "forbidden";
|
|
44
50
|
not_found: "not_found";
|
|
@@ -77,12 +83,12 @@ declare const errorSchemaFactory: (code: ErrorCodes, description: string) => {
|
|
|
77
83
|
schema: z.ZodObject<{
|
|
78
84
|
instance: z.ZodOptional<z.ZodString>;
|
|
79
85
|
requestId: z.ZodOptional<z.ZodString>;
|
|
80
|
-
code: z.ZodLiteral<"
|
|
86
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
81
87
|
detail: z.ZodString;
|
|
82
88
|
title: z.ZodString;
|
|
83
89
|
status: z.ZodNumber;
|
|
84
90
|
error: z.ZodObject<{
|
|
85
|
-
code: z.ZodLiteral<"
|
|
91
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
86
92
|
message: z.ZodString;
|
|
87
93
|
}, z.core.$strip>;
|
|
88
94
|
}, z.core.$strip>;
|
|
@@ -99,12 +105,12 @@ declare const commonCreateErrorResponses: {
|
|
|
99
105
|
schema: z.ZodObject<{
|
|
100
106
|
instance: z.ZodOptional<z.ZodString>;
|
|
101
107
|
requestId: z.ZodOptional<z.ZodString>;
|
|
102
|
-
code: z.ZodLiteral<"
|
|
108
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
103
109
|
detail: z.ZodString;
|
|
104
110
|
title: z.ZodString;
|
|
105
111
|
status: z.ZodNumber;
|
|
106
112
|
error: z.ZodObject<{
|
|
107
|
-
code: z.ZodLiteral<"
|
|
113
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
108
114
|
message: z.ZodString;
|
|
109
115
|
}, z.core.$strip>;
|
|
110
116
|
}, z.core.$strip>;
|
|
@@ -118,12 +124,12 @@ declare const commonCreateErrorResponses: {
|
|
|
118
124
|
schema: z.ZodObject<{
|
|
119
125
|
instance: z.ZodOptional<z.ZodString>;
|
|
120
126
|
requestId: z.ZodOptional<z.ZodString>;
|
|
121
|
-
code: z.ZodLiteral<"
|
|
127
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
122
128
|
detail: z.ZodString;
|
|
123
129
|
title: z.ZodString;
|
|
124
130
|
status: z.ZodNumber;
|
|
125
131
|
error: z.ZodObject<{
|
|
126
|
-
code: z.ZodLiteral<"
|
|
132
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
127
133
|
message: z.ZodString;
|
|
128
134
|
}, z.core.$strip>;
|
|
129
135
|
}, z.core.$strip>;
|
|
@@ -137,12 +143,12 @@ declare const commonCreateErrorResponses: {
|
|
|
137
143
|
schema: z.ZodObject<{
|
|
138
144
|
instance: z.ZodOptional<z.ZodString>;
|
|
139
145
|
requestId: z.ZodOptional<z.ZodString>;
|
|
140
|
-
code: z.ZodLiteral<"
|
|
146
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
141
147
|
detail: z.ZodString;
|
|
142
148
|
title: z.ZodString;
|
|
143
149
|
status: z.ZodNumber;
|
|
144
150
|
error: z.ZodObject<{
|
|
145
|
-
code: z.ZodLiteral<"
|
|
151
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
146
152
|
message: z.ZodString;
|
|
147
153
|
}, z.core.$strip>;
|
|
148
154
|
}, z.core.$strip>;
|
|
@@ -156,12 +162,12 @@ declare const commonCreateErrorResponses: {
|
|
|
156
162
|
schema: z.ZodObject<{
|
|
157
163
|
instance: z.ZodOptional<z.ZodString>;
|
|
158
164
|
requestId: z.ZodOptional<z.ZodString>;
|
|
159
|
-
code: z.ZodLiteral<"
|
|
165
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
160
166
|
detail: z.ZodString;
|
|
161
167
|
title: z.ZodString;
|
|
162
168
|
status: z.ZodNumber;
|
|
163
169
|
error: z.ZodObject<{
|
|
164
|
-
code: z.ZodLiteral<"
|
|
170
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
165
171
|
message: z.ZodString;
|
|
166
172
|
}, z.core.$strip>;
|
|
167
173
|
}, z.core.$strip>;
|
|
@@ -175,12 +181,12 @@ declare const commonCreateErrorResponses: {
|
|
|
175
181
|
schema: z.ZodObject<{
|
|
176
182
|
instance: z.ZodOptional<z.ZodString>;
|
|
177
183
|
requestId: z.ZodOptional<z.ZodString>;
|
|
178
|
-
code: z.ZodLiteral<"
|
|
184
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
179
185
|
detail: z.ZodString;
|
|
180
186
|
title: z.ZodString;
|
|
181
187
|
status: z.ZodNumber;
|
|
182
188
|
error: z.ZodObject<{
|
|
183
|
-
code: z.ZodLiteral<"
|
|
189
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
184
190
|
message: z.ZodString;
|
|
185
191
|
}, z.core.$strip>;
|
|
186
192
|
}, z.core.$strip>;
|
|
@@ -196,12 +202,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
196
202
|
schema: z.ZodObject<{
|
|
197
203
|
instance: z.ZodOptional<z.ZodString>;
|
|
198
204
|
requestId: z.ZodOptional<z.ZodString>;
|
|
199
|
-
code: z.ZodLiteral<"
|
|
205
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
200
206
|
detail: z.ZodString;
|
|
201
207
|
title: z.ZodString;
|
|
202
208
|
status: z.ZodNumber;
|
|
203
209
|
error: z.ZodObject<{
|
|
204
|
-
code: z.ZodLiteral<"
|
|
210
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
205
211
|
message: z.ZodString;
|
|
206
212
|
}, z.core.$strip>;
|
|
207
213
|
}, z.core.$strip>;
|
|
@@ -215,12 +221,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
215
221
|
schema: z.ZodObject<{
|
|
216
222
|
instance: z.ZodOptional<z.ZodString>;
|
|
217
223
|
requestId: z.ZodOptional<z.ZodString>;
|
|
218
|
-
code: z.ZodLiteral<"
|
|
224
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
219
225
|
detail: z.ZodString;
|
|
220
226
|
title: z.ZodString;
|
|
221
227
|
status: z.ZodNumber;
|
|
222
228
|
error: z.ZodObject<{
|
|
223
|
-
code: z.ZodLiteral<"
|
|
229
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
224
230
|
message: z.ZodString;
|
|
225
231
|
}, z.core.$strip>;
|
|
226
232
|
}, z.core.$strip>;
|
|
@@ -234,12 +240,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
234
240
|
schema: z.ZodObject<{
|
|
235
241
|
instance: z.ZodOptional<z.ZodString>;
|
|
236
242
|
requestId: z.ZodOptional<z.ZodString>;
|
|
237
|
-
code: z.ZodLiteral<"
|
|
243
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
238
244
|
detail: z.ZodString;
|
|
239
245
|
title: z.ZodString;
|
|
240
246
|
status: z.ZodNumber;
|
|
241
247
|
error: z.ZodObject<{
|
|
242
|
-
code: z.ZodLiteral<"
|
|
248
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
243
249
|
message: z.ZodString;
|
|
244
250
|
}, z.core.$strip>;
|
|
245
251
|
}, z.core.$strip>;
|
|
@@ -253,12 +259,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
253
259
|
schema: z.ZodObject<{
|
|
254
260
|
instance: z.ZodOptional<z.ZodString>;
|
|
255
261
|
requestId: z.ZodOptional<z.ZodString>;
|
|
256
|
-
code: z.ZodLiteral<"
|
|
262
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
257
263
|
detail: z.ZodString;
|
|
258
264
|
title: z.ZodString;
|
|
259
265
|
status: z.ZodNumber;
|
|
260
266
|
error: z.ZodObject<{
|
|
261
|
-
code: z.ZodLiteral<"
|
|
267
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
262
268
|
message: z.ZodString;
|
|
263
269
|
}, z.core.$strip>;
|
|
264
270
|
}, z.core.$strip>;
|
|
@@ -272,12 +278,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
272
278
|
schema: z.ZodObject<{
|
|
273
279
|
instance: z.ZodOptional<z.ZodString>;
|
|
274
280
|
requestId: z.ZodOptional<z.ZodString>;
|
|
275
|
-
code: z.ZodLiteral<"
|
|
281
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
276
282
|
detail: z.ZodString;
|
|
277
283
|
title: z.ZodString;
|
|
278
284
|
status: z.ZodNumber;
|
|
279
285
|
error: z.ZodObject<{
|
|
280
|
-
code: z.ZodLiteral<"
|
|
286
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
281
287
|
message: z.ZodString;
|
|
282
288
|
}, z.core.$strip>;
|
|
283
289
|
}, z.core.$strip>;
|
|
@@ -291,12 +297,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
291
297
|
schema: z.ZodObject<{
|
|
292
298
|
instance: z.ZodOptional<z.ZodString>;
|
|
293
299
|
requestId: z.ZodOptional<z.ZodString>;
|
|
294
|
-
code: z.ZodLiteral<"
|
|
300
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
295
301
|
detail: z.ZodString;
|
|
296
302
|
title: z.ZodString;
|
|
297
303
|
status: z.ZodNumber;
|
|
298
304
|
error: z.ZodObject<{
|
|
299
|
-
code: z.ZodLiteral<"
|
|
305
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
300
306
|
message: z.ZodString;
|
|
301
307
|
}, z.core.$strip>;
|
|
302
308
|
}, z.core.$strip>;
|
|
@@ -312,12 +318,12 @@ declare const commonGetErrorResponses: {
|
|
|
312
318
|
schema: z.ZodObject<{
|
|
313
319
|
instance: z.ZodOptional<z.ZodString>;
|
|
314
320
|
requestId: z.ZodOptional<z.ZodString>;
|
|
315
|
-
code: z.ZodLiteral<"
|
|
321
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
316
322
|
detail: z.ZodString;
|
|
317
323
|
title: z.ZodString;
|
|
318
324
|
status: z.ZodNumber;
|
|
319
325
|
error: z.ZodObject<{
|
|
320
|
-
code: z.ZodLiteral<"
|
|
326
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
321
327
|
message: z.ZodString;
|
|
322
328
|
}, z.core.$strip>;
|
|
323
329
|
}, z.core.$strip>;
|
|
@@ -331,12 +337,12 @@ declare const commonGetErrorResponses: {
|
|
|
331
337
|
schema: z.ZodObject<{
|
|
332
338
|
instance: z.ZodOptional<z.ZodString>;
|
|
333
339
|
requestId: z.ZodOptional<z.ZodString>;
|
|
334
|
-
code: z.ZodLiteral<"
|
|
340
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
335
341
|
detail: z.ZodString;
|
|
336
342
|
title: z.ZodString;
|
|
337
343
|
status: z.ZodNumber;
|
|
338
344
|
error: z.ZodObject<{
|
|
339
|
-
code: z.ZodLiteral<"
|
|
345
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
340
346
|
message: z.ZodString;
|
|
341
347
|
}, z.core.$strip>;
|
|
342
348
|
}, z.core.$strip>;
|
|
@@ -350,12 +356,12 @@ declare const commonGetErrorResponses: {
|
|
|
350
356
|
schema: z.ZodObject<{
|
|
351
357
|
instance: z.ZodOptional<z.ZodString>;
|
|
352
358
|
requestId: z.ZodOptional<z.ZodString>;
|
|
353
|
-
code: z.ZodLiteral<"
|
|
359
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
354
360
|
detail: z.ZodString;
|
|
355
361
|
title: z.ZodString;
|
|
356
362
|
status: z.ZodNumber;
|
|
357
363
|
error: z.ZodObject<{
|
|
358
|
-
code: z.ZodLiteral<"
|
|
364
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
359
365
|
message: z.ZodString;
|
|
360
366
|
}, z.core.$strip>;
|
|
361
367
|
}, z.core.$strip>;
|
|
@@ -369,12 +375,12 @@ declare const commonGetErrorResponses: {
|
|
|
369
375
|
schema: z.ZodObject<{
|
|
370
376
|
instance: z.ZodOptional<z.ZodString>;
|
|
371
377
|
requestId: z.ZodOptional<z.ZodString>;
|
|
372
|
-
code: z.ZodLiteral<"
|
|
378
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
373
379
|
detail: z.ZodString;
|
|
374
380
|
title: z.ZodString;
|
|
375
381
|
status: z.ZodNumber;
|
|
376
382
|
error: z.ZodObject<{
|
|
377
|
-
code: z.ZodLiteral<"
|
|
383
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
378
384
|
message: z.ZodString;
|
|
379
385
|
}, z.core.$strip>;
|
|
380
386
|
}, z.core.$strip>;
|
|
@@ -388,12 +394,12 @@ declare const commonGetErrorResponses: {
|
|
|
388
394
|
schema: z.ZodObject<{
|
|
389
395
|
instance: z.ZodOptional<z.ZodString>;
|
|
390
396
|
requestId: z.ZodOptional<z.ZodString>;
|
|
391
|
-
code: z.ZodLiteral<"
|
|
397
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
392
398
|
detail: z.ZodString;
|
|
393
399
|
title: z.ZodString;
|
|
394
400
|
status: z.ZodNumber;
|
|
395
401
|
error: z.ZodObject<{
|
|
396
|
-
code: z.ZodLiteral<"
|
|
402
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
397
403
|
message: z.ZodString;
|
|
398
404
|
}, z.core.$strip>;
|
|
399
405
|
}, z.core.$strip>;
|
|
@@ -407,12 +413,12 @@ declare const commonGetErrorResponses: {
|
|
|
407
413
|
schema: z.ZodObject<{
|
|
408
414
|
instance: z.ZodOptional<z.ZodString>;
|
|
409
415
|
requestId: z.ZodOptional<z.ZodString>;
|
|
410
|
-
code: z.ZodLiteral<"
|
|
416
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
411
417
|
detail: z.ZodString;
|
|
412
418
|
title: z.ZodString;
|
|
413
419
|
status: z.ZodNumber;
|
|
414
420
|
error: z.ZodObject<{
|
|
415
|
-
code: z.ZodLiteral<"
|
|
421
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
416
422
|
message: z.ZodString;
|
|
417
423
|
}, z.core.$strip>;
|
|
418
424
|
}, z.core.$strip>;
|
|
@@ -428,12 +434,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
428
434
|
schema: z.ZodObject<{
|
|
429
435
|
instance: z.ZodOptional<z.ZodString>;
|
|
430
436
|
requestId: z.ZodOptional<z.ZodString>;
|
|
431
|
-
code: z.ZodLiteral<"
|
|
437
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
432
438
|
detail: z.ZodString;
|
|
433
439
|
title: z.ZodString;
|
|
434
440
|
status: z.ZodNumber;
|
|
435
441
|
error: z.ZodObject<{
|
|
436
|
-
code: z.ZodLiteral<"
|
|
442
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
437
443
|
message: z.ZodString;
|
|
438
444
|
}, z.core.$strip>;
|
|
439
445
|
}, z.core.$strip>;
|
|
@@ -447,12 +453,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
447
453
|
schema: z.ZodObject<{
|
|
448
454
|
instance: z.ZodOptional<z.ZodString>;
|
|
449
455
|
requestId: z.ZodOptional<z.ZodString>;
|
|
450
|
-
code: z.ZodLiteral<"
|
|
456
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
451
457
|
detail: z.ZodString;
|
|
452
458
|
title: z.ZodString;
|
|
453
459
|
status: z.ZodNumber;
|
|
454
460
|
error: z.ZodObject<{
|
|
455
|
-
code: z.ZodLiteral<"
|
|
461
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
456
462
|
message: z.ZodString;
|
|
457
463
|
}, z.core.$strip>;
|
|
458
464
|
}, z.core.$strip>;
|
|
@@ -466,12 +472,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
466
472
|
schema: z.ZodObject<{
|
|
467
473
|
instance: z.ZodOptional<z.ZodString>;
|
|
468
474
|
requestId: z.ZodOptional<z.ZodString>;
|
|
469
|
-
code: z.ZodLiteral<"
|
|
475
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
470
476
|
detail: z.ZodString;
|
|
471
477
|
title: z.ZodString;
|
|
472
478
|
status: z.ZodNumber;
|
|
473
479
|
error: z.ZodObject<{
|
|
474
|
-
code: z.ZodLiteral<"
|
|
480
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
475
481
|
message: z.ZodString;
|
|
476
482
|
}, z.core.$strip>;
|
|
477
483
|
}, z.core.$strip>;
|
|
@@ -485,12 +491,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
485
491
|
schema: z.ZodObject<{
|
|
486
492
|
instance: z.ZodOptional<z.ZodString>;
|
|
487
493
|
requestId: z.ZodOptional<z.ZodString>;
|
|
488
|
-
code: z.ZodLiteral<"
|
|
494
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
489
495
|
detail: z.ZodString;
|
|
490
496
|
title: z.ZodString;
|
|
491
497
|
status: z.ZodNumber;
|
|
492
498
|
error: z.ZodObject<{
|
|
493
|
-
code: z.ZodLiteral<"
|
|
499
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
494
500
|
message: z.ZodString;
|
|
495
501
|
}, z.core.$strip>;
|
|
496
502
|
}, z.core.$strip>;
|
|
@@ -504,12 +510,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
504
510
|
schema: z.ZodObject<{
|
|
505
511
|
instance: z.ZodOptional<z.ZodString>;
|
|
506
512
|
requestId: z.ZodOptional<z.ZodString>;
|
|
507
|
-
code: z.ZodLiteral<"
|
|
513
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
508
514
|
detail: z.ZodString;
|
|
509
515
|
title: z.ZodString;
|
|
510
516
|
status: z.ZodNumber;
|
|
511
517
|
error: z.ZodObject<{
|
|
512
|
-
code: z.ZodLiteral<"
|
|
518
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
513
519
|
message: z.ZodString;
|
|
514
520
|
}, z.core.$strip>;
|
|
515
521
|
}, z.core.$strip>;
|
|
@@ -523,12 +529,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
523
529
|
schema: z.ZodObject<{
|
|
524
530
|
instance: z.ZodOptional<z.ZodString>;
|
|
525
531
|
requestId: z.ZodOptional<z.ZodString>;
|
|
526
|
-
code: z.ZodLiteral<"
|
|
532
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
527
533
|
detail: z.ZodString;
|
|
528
534
|
title: z.ZodString;
|
|
529
535
|
status: z.ZodNumber;
|
|
530
536
|
error: z.ZodObject<{
|
|
531
|
-
code: z.ZodLiteral<"
|
|
537
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
532
538
|
message: z.ZodString;
|
|
533
539
|
}, z.core.$strip>;
|
|
534
540
|
}, z.core.$strip>;
|
|
@@ -541,4 +547,4 @@ type CommonUpdateErrorResponses = typeof commonUpdateErrorResponses;
|
|
|
541
547
|
type CommonGetErrorResponses = typeof commonGetErrorResponses;
|
|
542
548
|
type CommonDeleteErrorResponses = typeof commonDeleteErrorResponses;
|
|
543
549
|
//#endregion
|
|
544
|
-
export { CommonCreateErrorResponses, CommonDeleteErrorResponses, CommonGetErrorResponses, CommonUpdateErrorResponses, ERROR_DOCS_BASE_URL, ErrorCode, ErrorCodes, ErrorResponse, ProblemDetails, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, createApiError, errorResponseSchema, errorSchemaFactory, handleApiError, isUniqueConstraintError, problemDetailsSchema, throwIfUniqueConstraintError };
|
|
550
|
+
export { CommonCreateErrorResponses, CommonDeleteErrorResponses, CommonGetErrorResponses, CommonUpdateErrorResponses, ERROR_DOCS_BASE_URL, ErrorCode, ErrorCodes, ErrorResponse, ProblemDetails, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, createApiError, errorResponseSchema, errorSchemaFactory, getDatabaseErrorLogContext, handleApiError, isUniqueConstraintError, problemDetailsSchema, throwIfUniqueConstraintError };
|
package/dist/utils/error.js
CHANGED
|
@@ -3,6 +3,58 @@ import { z } from "@hono/zod-openapi";
|
|
|
3
3
|
import { HTTPException } from "hono/http-exception";
|
|
4
4
|
|
|
5
5
|
//#region src/utils/error.ts
|
|
6
|
+
const PG_ERROR_KEYS = [
|
|
7
|
+
"code",
|
|
8
|
+
"detail",
|
|
9
|
+
"hint",
|
|
10
|
+
"severity",
|
|
11
|
+
"schema",
|
|
12
|
+
"table",
|
|
13
|
+
"column",
|
|
14
|
+
"constraint",
|
|
15
|
+
"routine",
|
|
16
|
+
"position",
|
|
17
|
+
"internalPosition",
|
|
18
|
+
"internalQuery",
|
|
19
|
+
"where",
|
|
20
|
+
"dataType",
|
|
21
|
+
"line",
|
|
22
|
+
"file"
|
|
23
|
+
];
|
|
24
|
+
const DRIZZLE_EXTRA_KEYS = ["query", "params"];
|
|
25
|
+
/**
|
|
26
|
+
* Builds structured fields from an error chain (Drizzle → pg DatabaseError / Doltgres).
|
|
27
|
+
* Outer wrappers often omit SQLSTATE and server detail; those live on nested `.cause`.
|
|
28
|
+
*/
|
|
29
|
+
function getDatabaseErrorLogContext(error) {
|
|
30
|
+
const chain = [];
|
|
31
|
+
const seen = /* @__PURE__ */ new Set();
|
|
32
|
+
let current = error;
|
|
33
|
+
let depth = 0;
|
|
34
|
+
while (current != null && typeof current === "object" && !seen.has(current)) {
|
|
35
|
+
seen.add(current);
|
|
36
|
+
const e = current;
|
|
37
|
+
const slice = {};
|
|
38
|
+
if (typeof e.message === "string" && e.message.length > 0) slice.message = e.message;
|
|
39
|
+
if (depth === 0 && typeof e.stack === "string" && e.stack.length > 0) slice.stack = e.stack;
|
|
40
|
+
for (const k of PG_ERROR_KEYS) {
|
|
41
|
+
const v = e[k];
|
|
42
|
+
if (v !== void 0 && v !== null && v !== "") slice[k] = v;
|
|
43
|
+
}
|
|
44
|
+
for (const k of DRIZZLE_EXTRA_KEYS) if (e[k] !== void 0) slice[k] = k === "params" ? `[${Array.isArray(e[k]) ? e[k].length : "?"} params redacted]` : e[k];
|
|
45
|
+
if (Object.keys(slice).length > 0) chain.push(slice);
|
|
46
|
+
depth += 1;
|
|
47
|
+
current = "cause" in e ? e.cause : void 0;
|
|
48
|
+
}
|
|
49
|
+
if (chain.length === 0) return {};
|
|
50
|
+
const root = chain[chain.length - 1];
|
|
51
|
+
const out = { dbErrorChain: chain };
|
|
52
|
+
if (root.message !== void 0) out.dbRootMessage = root.message;
|
|
53
|
+
if (root.code !== void 0) out.dbRootCode = root.code;
|
|
54
|
+
if (root.detail !== void 0) out.dbRootDetail = root.detail;
|
|
55
|
+
if (root.hint !== void 0) out.dbRootHint = root.hint;
|
|
56
|
+
return out;
|
|
57
|
+
}
|
|
6
58
|
const ErrorCode = z.enum([
|
|
7
59
|
"bad_request",
|
|
8
60
|
"unauthorized",
|
|
@@ -115,13 +167,7 @@ async function handleApiError(error, requestId) {
|
|
|
115
167
|
}
|
|
116
168
|
};
|
|
117
169
|
}
|
|
118
|
-
if (error.status
|
|
119
|
-
error,
|
|
120
|
-
status: error.status,
|
|
121
|
-
message: responseJson.detail || responseJson.error.message,
|
|
122
|
-
requestId: responseJson.requestId || requestId || "unknown"
|
|
123
|
-
}, "API server error occurred");
|
|
124
|
-
else getLogger("core").info({
|
|
170
|
+
if (error.status < 500) getLogger("core").info({
|
|
125
171
|
error,
|
|
126
172
|
status: error.status,
|
|
127
173
|
code: responseJson.code,
|
|
@@ -130,15 +176,6 @@ async function handleApiError(error, requestId) {
|
|
|
130
176
|
}, "API client error occurred");
|
|
131
177
|
return responseJson;
|
|
132
178
|
}
|
|
133
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
134
|
-
const errorStack = error instanceof Error ? error.stack : void 0;
|
|
135
|
-
getLogger("core").error({
|
|
136
|
-
error,
|
|
137
|
-
message: errorMessage,
|
|
138
|
-
stack: errorStack,
|
|
139
|
-
status: 500,
|
|
140
|
-
requestId: requestId || "unknown"
|
|
141
|
-
}, "Unhandled API error occurred");
|
|
142
179
|
return {
|
|
143
180
|
title: "Internal Server Error",
|
|
144
181
|
status: 500,
|
|
@@ -240,4 +277,4 @@ const commonDeleteErrorResponses = {
|
|
|
240
277
|
};
|
|
241
278
|
|
|
242
279
|
//#endregion
|
|
243
|
-
export { ERROR_DOCS_BASE_URL, ErrorCode, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, createApiError, errorResponseSchema, errorSchemaFactory, handleApiError, isUniqueConstraintError, problemDetailsSchema, throwIfUniqueConstraintError };
|
|
280
|
+
export { ERROR_DOCS_BASE_URL, ErrorCode, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, createApiError, errorResponseSchema, errorSchemaFactory, getDatabaseErrorLogContext, handleApiError, isUniqueConstraintError, problemDetailsSchema, throwIfUniqueConstraintError };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { getCredentialStoreLookupKeyFromRetrievalParams } from "./credential-sto
|
|
|
11
11
|
import { normalizeDateString, toISODateString } from "./date.js";
|
|
12
12
|
import { validateOrigin } from "./domain-validation.js";
|
|
13
13
|
import { isDevelopment, isProduction, isTest } from "./env-detection.js";
|
|
14
|
-
import { CommonCreateErrorResponses, CommonDeleteErrorResponses, CommonGetErrorResponses, CommonUpdateErrorResponses, ERROR_DOCS_BASE_URL, ErrorCode, ErrorCodes, ErrorResponse, ProblemDetails, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, createApiError, errorResponseSchema, errorSchemaFactory, handleApiError, isUniqueConstraintError, problemDetailsSchema, throwIfUniqueConstraintError } from "./error.js";
|
|
14
|
+
import { CommonCreateErrorResponses, CommonDeleteErrorResponses, CommonGetErrorResponses, CommonUpdateErrorResponses, ERROR_DOCS_BASE_URL, ErrorCode, ErrorCodes, ErrorResponse, ProblemDetails, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, createApiError, errorResponseSchema, errorSchemaFactory, getDatabaseErrorLogContext, handleApiError, isUniqueConstraintError, problemDetailsSchema, throwIfUniqueConstraintError } from "./error.js";
|
|
15
15
|
import { LLMMessage, formatMessagesForLLM, formatMessagesForLLMContext } from "./format-messages.js";
|
|
16
16
|
import { getInProcessFetch, registerAppFetch } from "./in-process-fetch.js";
|
|
17
17
|
import { JsonTransformer } from "./JsonTransformer.js";
|
|
@@ -39,4 +39,4 @@ import "./usage-tracker.js";
|
|
|
39
39
|
import { ValidatePublicKeyResult, validatePublicKey } from "./validate-public-key.js";
|
|
40
40
|
import { _resetWaitUntilCache, getWaitUntil } from "./wait-until.js";
|
|
41
41
|
import { TRUSTED_WORK_APP_MCP_PATHS, isTrustedWorkAppMcpUrl } from "./work-app-mcp.js";
|
|
42
|
-
export { ApiKeyGenerationResult, AppCredentialResult, AssembleResult, CommonCreateErrorResponses, CommonDeleteErrorResponses, CommonGetErrorResponses, CommonUpdateErrorResponses, ComposioAuthResult, CredentialScope, ERROR_DOCS_BASE_URL, ErrorCode, ErrorCodes, ErrorResponse, GenerateInternalServiceTokenParams, GenerateServiceTokenParams, GenerationType, HashedHeaderValue, InternalServiceId, InternalServiceTokenPayload, InternalServices, JsonTransformer, JwtVerifyResult, LLMMessage, LoggerFactoryConfig, McpClient, McpClientOptions, McpOAuthFlowResult, McpSSEConfig, McpServerConfig, McpStreamableHttpConfig, McpTokenExchangeResult, MockLanguageModel, ModelFactory, OAuthConfig, ParsedSSEResponse, PinoLogger, PinoLoggerConfig, PoWError, PoWResult, ProblemDetails, SKILL_ENTRY_FILE_PATH, ServiceTokenPayload, SignJwtOptions, SignSlackLinkTokenParams, SignSlackUserTokenParams, SignatureVerificationErrorCode, SignatureVerificationResult, SlackAccessTokenPayload, SlackAccessTokenPayloadSchema, SlackLinkIntent, SlackLinkIntentSchema, SlackLinkTokenPayload, SlackLinkTokenPayloadSchema, TRUSTED_WORK_APP_MCP_PATHS, TempTokenPayload, TriggerAuthResult, ValidatePublicKeyResult, VerifyInternalServiceTokenResult, VerifyJwtOptions, VerifyServiceTokenResult, VerifySlackLinkTokenResult, VerifySlackUserTokenResult, _resetWaitUntilCache, activeMcpClients, buildConversationMetadata, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, computeNextRunAt, configureComposioMCPServer, convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, createApiError, createMockModel, decodeJwtPayload, deleteComposioConnectedAccount, deriveKidFromPublicKey, deriveRelationId, detectAuthenticationRequired, errorResponseSchema, errorSchemaFactory, estimateTokens, exchangeMcpAuthorizationCode, extractBearerToken, extractComposioServerId, extractPreviewFields, extractPublicId, extractUsageTokens, fetchComposioServers, fetchSingleComposioServer, flushTraces, formatMessagesForLLM, formatMessagesForLLMContext, gatewayCostMiddleware, 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, normalizeModelId, parseEmbeddedJson, parseSSEResponse, parseSkillFromMarkdown, preview, problemDetailsSchema, registerAppFetch, retryWithBackoff, sanitizeAppConfig, serializeSkillToMarkdown, setSpanWithError, signJwt, signSlackLinkToken, signSlackUserToken, stripUnsupportedConstraints, throwIfUniqueConstraintError, toISODateString, unwrapError, validateApiKey, validateInternalServiceProjectAccess, validateInternalServiceTenantAccess, validateOrigin, validatePublicKey, validateTargetAgent, validateTenantId, validateTriggerHeaderValue, verifyAuthorizationHeader, verifyInternalServiceAuthHeader, verifyInternalServiceToken, verifyJwt, verifyPoW, verifyServiceToken, verifySignatureWithConfig, verifySlackLinkToken, verifySlackUserToken, verifyTempToken, verifyTriggerAuth };
|
|
42
|
+
export { ApiKeyGenerationResult, AppCredentialResult, AssembleResult, CommonCreateErrorResponses, CommonDeleteErrorResponses, CommonGetErrorResponses, CommonUpdateErrorResponses, ComposioAuthResult, CredentialScope, ERROR_DOCS_BASE_URL, ErrorCode, ErrorCodes, ErrorResponse, GenerateInternalServiceTokenParams, GenerateServiceTokenParams, GenerationType, HashedHeaderValue, InternalServiceId, InternalServiceTokenPayload, InternalServices, JsonTransformer, JwtVerifyResult, LLMMessage, LoggerFactoryConfig, McpClient, McpClientOptions, McpOAuthFlowResult, McpSSEConfig, McpServerConfig, McpStreamableHttpConfig, McpTokenExchangeResult, MockLanguageModel, ModelFactory, OAuthConfig, ParsedSSEResponse, PinoLogger, PinoLoggerConfig, PoWError, PoWResult, ProblemDetails, SKILL_ENTRY_FILE_PATH, ServiceTokenPayload, SignJwtOptions, SignSlackLinkTokenParams, SignSlackUserTokenParams, SignatureVerificationErrorCode, SignatureVerificationResult, SlackAccessTokenPayload, SlackAccessTokenPayloadSchema, SlackLinkIntent, SlackLinkIntentSchema, SlackLinkTokenPayload, SlackLinkTokenPayloadSchema, TRUSTED_WORK_APP_MCP_PATHS, TempTokenPayload, TriggerAuthResult, ValidatePublicKeyResult, VerifyInternalServiceTokenResult, VerifyJwtOptions, VerifyServiceTokenResult, VerifySlackLinkTokenResult, VerifySlackUserTokenResult, _resetWaitUntilCache, activeMcpClients, buildConversationMetadata, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, computeNextRunAt, configureComposioMCPServer, convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, createApiError, createMockModel, decodeJwtPayload, deleteComposioConnectedAccount, deriveKidFromPublicKey, deriveRelationId, detectAuthenticationRequired, errorResponseSchema, errorSchemaFactory, estimateTokens, exchangeMcpAuthorizationCode, extractBearerToken, extractComposioServerId, extractPreviewFields, extractPublicId, extractUsageTokens, fetchComposioServers, fetchSingleComposioServer, flushTraces, formatMessagesForLLM, formatMessagesForLLMContext, gatewayCostMiddleware, generateApiKey, generateAppCredential, generateId, generateInternalServiceToken, generateServiceToken, getComposioInstance, getComposioOAuthRedirectUrl, getComposioUserId, getConversationId, getCredentialStoreLookupKeyFromRetrievalParams, getDatabaseErrorLogContext, 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, normalizeModelId, parseEmbeddedJson, parseSSEResponse, parseSkillFromMarkdown, preview, problemDetailsSchema, registerAppFetch, retryWithBackoff, sanitizeAppConfig, serializeSkillToMarkdown, setSpanWithError, signJwt, signSlackLinkToken, signSlackUserToken, stripUnsupportedConstraints, throwIfUniqueConstraintError, toISODateString, unwrapError, validateApiKey, validateInternalServiceProjectAccess, validateInternalServiceTenantAccess, validateOrigin, validatePublicKey, validateTargetAgent, validateTenantId, validateTriggerHeaderValue, verifyAuthorizationHeader, verifyInternalServiceAuthHeader, verifyInternalServiceToken, verifyJwt, verifyPoW, verifyServiceToken, verifySignatureWithConfig, verifySlackLinkToken, verifySlackUserToken, verifyTempToken, verifyTriggerAuth };
|
package/dist/utils/index.js
CHANGED
|
@@ -8,8 +8,8 @@ import { configureComposioMCPServer, deleteComposioConnectedAccount, extractComp
|
|
|
8
8
|
import { isThirdPartyMCPServerAuthenticated } from "./third-party-mcp-servers/third-party-check.js";
|
|
9
9
|
import "./third-party-mcp-servers/index.js";
|
|
10
10
|
import { getCredentialStoreLookupKeyFromRetrievalParams } from "./credential-store-utils.js";
|
|
11
|
+
import { ERROR_DOCS_BASE_URL, ErrorCode, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, createApiError, errorResponseSchema, errorSchemaFactory, getDatabaseErrorLogContext, handleApiError, isUniqueConstraintError, problemDetailsSchema, throwIfUniqueConstraintError } from "./error.js";
|
|
11
12
|
import { buildConversationMetadata, deriveRelationId, generateId, getConversationId } from "./conversations.js";
|
|
12
|
-
import { ERROR_DOCS_BASE_URL, ErrorCode, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, createApiError, errorResponseSchema, errorSchemaFactory, handleApiError, isUniqueConstraintError, problemDetailsSchema, throwIfUniqueConstraintError } from "./error.js";
|
|
13
13
|
import { extractPublicId, generateApiKey, generateAppCredential, getMetadataFromApiKey, hashApiKey, isApiKeyExpired, maskApiKey, sanitizeAppConfig, validateApiKey } from "./apiKeys.js";
|
|
14
14
|
import { computeNextRunAt } from "./compute-next-run-at.js";
|
|
15
15
|
import { normalizeDateString, toISODateString } from "./date.js";
|
|
@@ -38,4 +38,4 @@ import { validatePublicKey } from "./validate-public-key.js";
|
|
|
38
38
|
import { _resetWaitUntilCache, getWaitUntil } from "./wait-until.js";
|
|
39
39
|
import { TRUSTED_WORK_APP_MCP_PATHS, isTrustedWorkAppMcpUrl } from "./work-app-mcp.js";
|
|
40
40
|
|
|
41
|
-
export { ERROR_DOCS_BASE_URL, ErrorCode, InternalServices, JsonTransformer, McpClient, MockLanguageModel, ModelFactory, PinoLogger, SKILL_ENTRY_FILE_PATH, SlackAccessTokenPayloadSchema, SlackLinkIntentSchema, SlackLinkTokenPayloadSchema, TRUSTED_WORK_APP_MCP_PATHS, _resetWaitUntilCache, activeMcpClients, buildConversationMetadata, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, computeNextRunAt, configureComposioMCPServer, convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, createApiError, createMockModel, decodeJwtPayload, deleteComposioConnectedAccount, deriveKidFromPublicKey, deriveRelationId, detectAuthenticationRequired, errorResponseSchema, errorSchemaFactory, estimateTokens, exchangeMcpAuthorizationCode, extractBearerToken, extractComposioServerId, extractPreviewFields, extractPublicId, extractUsageTokens, fetchComposioServers, fetchSingleComposioServer, flushTraces, formatMessagesForLLM, formatMessagesForLLMContext, gatewayCostMiddleware, 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, normalizeModelId, parseEmbeddedJson, parseSSEResponse, parseSkillFromMarkdown, preview, problemDetailsSchema, registerAppFetch, retryWithBackoff, sanitizeAppConfig, serializeSkillToMarkdown, setSpanWithError, signJwt, signSlackLinkToken, signSlackUserToken, stripUnsupportedConstraints, throwIfUniqueConstraintError, toISODateString, unwrapError, validateApiKey, validateInternalServiceProjectAccess, validateInternalServiceTenantAccess, validateOrigin, validatePublicKey, validateTargetAgent, validateTenantId, validateTriggerHeaderValue, verifyAuthorizationHeader, verifyInternalServiceAuthHeader, verifyInternalServiceToken, verifyJwt, verifyPoW, verifyServiceToken, verifySignatureWithConfig, verifySlackLinkToken, verifySlackUserToken, verifyTempToken, verifyTriggerAuth };
|
|
41
|
+
export { ERROR_DOCS_BASE_URL, ErrorCode, InternalServices, JsonTransformer, McpClient, MockLanguageModel, ModelFactory, PinoLogger, SKILL_ENTRY_FILE_PATH, SlackAccessTokenPayloadSchema, SlackLinkIntentSchema, SlackLinkTokenPayloadSchema, TRUSTED_WORK_APP_MCP_PATHS, _resetWaitUntilCache, activeMcpClients, buildConversationMetadata, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, computeNextRunAt, configureComposioMCPServer, convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, createApiError, createMockModel, decodeJwtPayload, deleteComposioConnectedAccount, deriveKidFromPublicKey, deriveRelationId, detectAuthenticationRequired, errorResponseSchema, errorSchemaFactory, estimateTokens, exchangeMcpAuthorizationCode, extractBearerToken, extractComposioServerId, extractPreviewFields, extractPublicId, extractUsageTokens, fetchComposioServers, fetchSingleComposioServer, flushTraces, formatMessagesForLLM, formatMessagesForLLMContext, gatewayCostMiddleware, generateApiKey, generateAppCredential, generateId, generateInternalServiceToken, generateServiceToken, getComposioInstance, getComposioOAuthRedirectUrl, getComposioUserId, getConversationId, getCredentialStoreLookupKeyFromRetrievalParams, getDatabaseErrorLogContext, 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, normalizeModelId, parseEmbeddedJson, parseSSEResponse, parseSkillFromMarkdown, preview, problemDetailsSchema, registerAppFetch, retryWithBackoff, sanitizeAppConfig, serializeSkillToMarkdown, setSpanWithError, signJwt, signSlackLinkToken, signSlackUserToken, stripUnsupportedConstraints, throwIfUniqueConstraintError, toISODateString, unwrapError, validateApiKey, validateInternalServiceProjectAccess, validateInternalServiceTenantAccess, validateOrigin, validatePublicKey, validateTargetAgent, validateTenantId, validateTriggerHeaderValue, verifyAuthorizationHeader, verifyInternalServiceAuthHeader, verifyInternalServiceToken, verifyJwt, verifyPoW, verifyServiceToken, verifySignatureWithConfig, verifySlackLinkToken, verifySlackUserToken, verifyTempToken, verifyTriggerAuth };
|
package/dist/utils/logger.js
CHANGED
|
@@ -25,7 +25,11 @@ var PinoLogger = class {
|
|
|
25
25
|
this.options = {
|
|
26
26
|
name: this.name,
|
|
27
27
|
level: process.env.LOG_LEVEL || (process.env.ENVIRONMENT === "test" ? "silent" : "info"),
|
|
28
|
-
serializers: {
|
|
28
|
+
serializers: {
|
|
29
|
+
err: pino.stdSerializers.err,
|
|
30
|
+
error: pino.stdSerializers.err,
|
|
31
|
+
obj: (value) => ({ ...value })
|
|
32
|
+
},
|
|
29
33
|
redact: [
|
|
30
34
|
"req.headers.authorization",
|
|
31
35
|
"req.headers[\"x-inkeep-admin-authentication\"]",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as drizzle_zod0 from "drizzle-zod";
|
|
3
3
|
import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
|
4
4
|
|
|
5
5
|
//#region src/validation/drizzle-schema-helpers.d.ts
|
|
6
|
-
declare function createSelectSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>):
|
|
7
|
-
declare function createInsertSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>):
|
|
6
|
+
declare function createSelectSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod0.BuildSchema<"select", T["_"]["columns"], drizzle_zod0.BuildRefine<T["_"]["columns"], undefined>, undefined>;
|
|
7
|
+
declare function createInsertSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod0.BuildSchema<"insert", T["_"]["columns"], drizzle_zod0.BuildRefine<Pick<T["_"]["columns"], keyof T["$inferInsert"]>, undefined>, undefined>;
|
|
8
8
|
declare const createSelectSchema: typeof createSelectSchemaWithModifiers;
|
|
9
9
|
declare const createInsertSchema: typeof createInsertSchemaWithModifiers;
|
|
10
10
|
/**
|