@inkeep/agents-core 0.56.1 → 0.57.0
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 +85 -85
- package/dist/auth/auth-validation-schemas.d.ts +152 -152
- package/dist/auth/auth.d.ts +9 -9
- package/dist/auth/auth.js +6 -0
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/client-exports.d.ts +4 -4
- package/dist/client-exports.js +2 -2
- package/dist/data-access/index.d.ts +2 -1
- package/dist/data-access/index.js +2 -1
- package/dist/data-access/manage/agents.d.ts +31 -31
- package/dist/data-access/manage/artifactComponents.d.ts +8 -8
- package/dist/data-access/manage/contextConfigs.d.ts +4 -4
- package/dist/data-access/manage/dataComponents.d.ts +2 -2
- package/dist/data-access/manage/functionTools.d.ts +8 -8
- package/dist/data-access/manage/skills.d.ts +14 -14
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +6 -6
- package/dist/data-access/manage/subAgentRelations.d.ts +8 -8
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +6 -6
- package/dist/data-access/manage/subAgents.d.ts +21 -21
- package/dist/data-access/manage/tools.d.ts +12 -12
- 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/conversations.d.ts +31 -31
- package/dist/data-access/runtime/messages.d.ts +21 -21
- package/dist/data-access/runtime/tasks.d.ts +9 -9
- package/dist/data-access/runtime/userProfiles.d.ts +14 -0
- package/dist/data-access/runtime/userProfiles.js +45 -0
- package/dist/db/manage/manage-schema.d.ts +453 -453
- package/dist/db/runtime/runtime-schema.d.ts +416 -302
- package/dist/db/runtime/runtime-schema.js +14 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +4 -3
- package/dist/types/entities.d.ts +7 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/error.d.ts +51 -51
- package/dist/utils/model-factory.d.ts +10 -2
- package/dist/utils/model-factory.js +21 -13
- package/dist/validation/dolt-schemas.d.ts +1 -1
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +2 -2
- package/dist/validation/schemas.d.ts +2218 -1973
- package/dist/validation/schemas.js +16 -2
- package/drizzle/runtime/0019_easy_bedlam.sql +24 -0
- package/drizzle/runtime/meta/0019_snapshot.json +4003 -0
- package/drizzle/runtime/meta/_journal.json +7 -0
- package/package.json +1 -1
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
|
-
unauthorized: "unauthorized";
|
|
7
6
|
bad_request: "bad_request";
|
|
7
|
+
unauthorized: "unauthorized";
|
|
8
8
|
forbidden: "forbidden";
|
|
9
9
|
not_found: "not_found";
|
|
10
10
|
conflict: "conflict";
|
|
@@ -19,8 +19,8 @@ declare const problemDetailsSchema: z.ZodObject<{
|
|
|
19
19
|
instance: z.ZodOptional<z.ZodString>;
|
|
20
20
|
requestId: z.ZodOptional<z.ZodString>;
|
|
21
21
|
code: z.ZodEnum<{
|
|
22
|
-
unauthorized: "unauthorized";
|
|
23
22
|
bad_request: "bad_request";
|
|
23
|
+
unauthorized: "unauthorized";
|
|
24
24
|
forbidden: "forbidden";
|
|
25
25
|
not_found: "not_found";
|
|
26
26
|
conflict: "conflict";
|
|
@@ -33,8 +33,8 @@ type ErrorCodes = z.infer<typeof ErrorCode>;
|
|
|
33
33
|
declare const errorResponseSchema: z.ZodObject<{
|
|
34
34
|
error: z.ZodObject<{
|
|
35
35
|
code: z.ZodEnum<{
|
|
36
|
-
unauthorized: "unauthorized";
|
|
37
36
|
bad_request: "bad_request";
|
|
37
|
+
unauthorized: "unauthorized";
|
|
38
38
|
forbidden: "forbidden";
|
|
39
39
|
not_found: "not_found";
|
|
40
40
|
conflict: "conflict";
|
|
@@ -71,12 +71,12 @@ declare const errorSchemaFactory: (code: ErrorCodes, description: string) => {
|
|
|
71
71
|
schema: z.ZodObject<{
|
|
72
72
|
instance: z.ZodOptional<z.ZodString>;
|
|
73
73
|
requestId: z.ZodOptional<z.ZodString>;
|
|
74
|
-
code: z.ZodLiteral<"
|
|
74
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
75
75
|
detail: z.ZodString;
|
|
76
76
|
title: z.ZodString;
|
|
77
77
|
status: z.ZodNumber;
|
|
78
78
|
error: z.ZodObject<{
|
|
79
|
-
code: z.ZodLiteral<"
|
|
79
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
80
80
|
message: z.ZodString;
|
|
81
81
|
}, z.core.$strip>;
|
|
82
82
|
}, z.core.$strip>;
|
|
@@ -93,12 +93,12 @@ declare const commonCreateErrorResponses: {
|
|
|
93
93
|
schema: z.ZodObject<{
|
|
94
94
|
instance: z.ZodOptional<z.ZodString>;
|
|
95
95
|
requestId: z.ZodOptional<z.ZodString>;
|
|
96
|
-
code: z.ZodLiteral<"
|
|
96
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
97
97
|
detail: z.ZodString;
|
|
98
98
|
title: z.ZodString;
|
|
99
99
|
status: z.ZodNumber;
|
|
100
100
|
error: z.ZodObject<{
|
|
101
|
-
code: z.ZodLiteral<"
|
|
101
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
102
102
|
message: z.ZodString;
|
|
103
103
|
}, z.core.$strip>;
|
|
104
104
|
}, z.core.$strip>;
|
|
@@ -112,12 +112,12 @@ declare const commonCreateErrorResponses: {
|
|
|
112
112
|
schema: z.ZodObject<{
|
|
113
113
|
instance: z.ZodOptional<z.ZodString>;
|
|
114
114
|
requestId: z.ZodOptional<z.ZodString>;
|
|
115
|
-
code: z.ZodLiteral<"
|
|
115
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
116
116
|
detail: z.ZodString;
|
|
117
117
|
title: z.ZodString;
|
|
118
118
|
status: z.ZodNumber;
|
|
119
119
|
error: z.ZodObject<{
|
|
120
|
-
code: z.ZodLiteral<"
|
|
120
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
121
121
|
message: z.ZodString;
|
|
122
122
|
}, z.core.$strip>;
|
|
123
123
|
}, z.core.$strip>;
|
|
@@ -131,12 +131,12 @@ declare const commonCreateErrorResponses: {
|
|
|
131
131
|
schema: z.ZodObject<{
|
|
132
132
|
instance: z.ZodOptional<z.ZodString>;
|
|
133
133
|
requestId: z.ZodOptional<z.ZodString>;
|
|
134
|
-
code: z.ZodLiteral<"
|
|
134
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
135
135
|
detail: z.ZodString;
|
|
136
136
|
title: z.ZodString;
|
|
137
137
|
status: z.ZodNumber;
|
|
138
138
|
error: z.ZodObject<{
|
|
139
|
-
code: z.ZodLiteral<"
|
|
139
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
140
140
|
message: z.ZodString;
|
|
141
141
|
}, z.core.$strip>;
|
|
142
142
|
}, z.core.$strip>;
|
|
@@ -150,12 +150,12 @@ declare const commonCreateErrorResponses: {
|
|
|
150
150
|
schema: z.ZodObject<{
|
|
151
151
|
instance: z.ZodOptional<z.ZodString>;
|
|
152
152
|
requestId: z.ZodOptional<z.ZodString>;
|
|
153
|
-
code: z.ZodLiteral<"
|
|
153
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
154
154
|
detail: z.ZodString;
|
|
155
155
|
title: z.ZodString;
|
|
156
156
|
status: z.ZodNumber;
|
|
157
157
|
error: z.ZodObject<{
|
|
158
|
-
code: z.ZodLiteral<"
|
|
158
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
159
159
|
message: z.ZodString;
|
|
160
160
|
}, z.core.$strip>;
|
|
161
161
|
}, z.core.$strip>;
|
|
@@ -169,12 +169,12 @@ declare const commonCreateErrorResponses: {
|
|
|
169
169
|
schema: z.ZodObject<{
|
|
170
170
|
instance: z.ZodOptional<z.ZodString>;
|
|
171
171
|
requestId: z.ZodOptional<z.ZodString>;
|
|
172
|
-
code: z.ZodLiteral<"
|
|
172
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
173
173
|
detail: z.ZodString;
|
|
174
174
|
title: z.ZodString;
|
|
175
175
|
status: z.ZodNumber;
|
|
176
176
|
error: z.ZodObject<{
|
|
177
|
-
code: z.ZodLiteral<"
|
|
177
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
178
178
|
message: z.ZodString;
|
|
179
179
|
}, z.core.$strip>;
|
|
180
180
|
}, z.core.$strip>;
|
|
@@ -190,12 +190,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
190
190
|
schema: z.ZodObject<{
|
|
191
191
|
instance: z.ZodOptional<z.ZodString>;
|
|
192
192
|
requestId: z.ZodOptional<z.ZodString>;
|
|
193
|
-
code: z.ZodLiteral<"
|
|
193
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
194
194
|
detail: z.ZodString;
|
|
195
195
|
title: z.ZodString;
|
|
196
196
|
status: z.ZodNumber;
|
|
197
197
|
error: z.ZodObject<{
|
|
198
|
-
code: z.ZodLiteral<"
|
|
198
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
199
199
|
message: z.ZodString;
|
|
200
200
|
}, z.core.$strip>;
|
|
201
201
|
}, z.core.$strip>;
|
|
@@ -209,12 +209,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
209
209
|
schema: z.ZodObject<{
|
|
210
210
|
instance: z.ZodOptional<z.ZodString>;
|
|
211
211
|
requestId: z.ZodOptional<z.ZodString>;
|
|
212
|
-
code: z.ZodLiteral<"
|
|
212
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
213
213
|
detail: z.ZodString;
|
|
214
214
|
title: z.ZodString;
|
|
215
215
|
status: z.ZodNumber;
|
|
216
216
|
error: z.ZodObject<{
|
|
217
|
-
code: z.ZodLiteral<"
|
|
217
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
218
218
|
message: z.ZodString;
|
|
219
219
|
}, z.core.$strip>;
|
|
220
220
|
}, z.core.$strip>;
|
|
@@ -228,12 +228,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
228
228
|
schema: z.ZodObject<{
|
|
229
229
|
instance: z.ZodOptional<z.ZodString>;
|
|
230
230
|
requestId: z.ZodOptional<z.ZodString>;
|
|
231
|
-
code: z.ZodLiteral<"
|
|
231
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
232
232
|
detail: z.ZodString;
|
|
233
233
|
title: z.ZodString;
|
|
234
234
|
status: z.ZodNumber;
|
|
235
235
|
error: z.ZodObject<{
|
|
236
|
-
code: z.ZodLiteral<"
|
|
236
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
237
237
|
message: z.ZodString;
|
|
238
238
|
}, z.core.$strip>;
|
|
239
239
|
}, z.core.$strip>;
|
|
@@ -247,12 +247,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
247
247
|
schema: z.ZodObject<{
|
|
248
248
|
instance: z.ZodOptional<z.ZodString>;
|
|
249
249
|
requestId: z.ZodOptional<z.ZodString>;
|
|
250
|
-
code: z.ZodLiteral<"
|
|
250
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
251
251
|
detail: z.ZodString;
|
|
252
252
|
title: z.ZodString;
|
|
253
253
|
status: z.ZodNumber;
|
|
254
254
|
error: z.ZodObject<{
|
|
255
|
-
code: z.ZodLiteral<"
|
|
255
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
256
256
|
message: z.ZodString;
|
|
257
257
|
}, z.core.$strip>;
|
|
258
258
|
}, z.core.$strip>;
|
|
@@ -266,12 +266,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
266
266
|
schema: z.ZodObject<{
|
|
267
267
|
instance: z.ZodOptional<z.ZodString>;
|
|
268
268
|
requestId: z.ZodOptional<z.ZodString>;
|
|
269
|
-
code: z.ZodLiteral<"
|
|
269
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
270
270
|
detail: z.ZodString;
|
|
271
271
|
title: z.ZodString;
|
|
272
272
|
status: z.ZodNumber;
|
|
273
273
|
error: z.ZodObject<{
|
|
274
|
-
code: z.ZodLiteral<"
|
|
274
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
275
275
|
message: z.ZodString;
|
|
276
276
|
}, z.core.$strip>;
|
|
277
277
|
}, z.core.$strip>;
|
|
@@ -285,12 +285,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
285
285
|
schema: z.ZodObject<{
|
|
286
286
|
instance: z.ZodOptional<z.ZodString>;
|
|
287
287
|
requestId: z.ZodOptional<z.ZodString>;
|
|
288
|
-
code: z.ZodLiteral<"
|
|
288
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
289
289
|
detail: z.ZodString;
|
|
290
290
|
title: z.ZodString;
|
|
291
291
|
status: z.ZodNumber;
|
|
292
292
|
error: z.ZodObject<{
|
|
293
|
-
code: z.ZodLiteral<"
|
|
293
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
294
294
|
message: z.ZodString;
|
|
295
295
|
}, z.core.$strip>;
|
|
296
296
|
}, z.core.$strip>;
|
|
@@ -306,12 +306,12 @@ declare const commonGetErrorResponses: {
|
|
|
306
306
|
schema: z.ZodObject<{
|
|
307
307
|
instance: z.ZodOptional<z.ZodString>;
|
|
308
308
|
requestId: z.ZodOptional<z.ZodString>;
|
|
309
|
-
code: z.ZodLiteral<"
|
|
309
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
310
310
|
detail: z.ZodString;
|
|
311
311
|
title: z.ZodString;
|
|
312
312
|
status: z.ZodNumber;
|
|
313
313
|
error: z.ZodObject<{
|
|
314
|
-
code: z.ZodLiteral<"
|
|
314
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
315
315
|
message: z.ZodString;
|
|
316
316
|
}, z.core.$strip>;
|
|
317
317
|
}, z.core.$strip>;
|
|
@@ -325,12 +325,12 @@ declare const commonGetErrorResponses: {
|
|
|
325
325
|
schema: z.ZodObject<{
|
|
326
326
|
instance: z.ZodOptional<z.ZodString>;
|
|
327
327
|
requestId: z.ZodOptional<z.ZodString>;
|
|
328
|
-
code: z.ZodLiteral<"
|
|
328
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
329
329
|
detail: z.ZodString;
|
|
330
330
|
title: z.ZodString;
|
|
331
331
|
status: z.ZodNumber;
|
|
332
332
|
error: z.ZodObject<{
|
|
333
|
-
code: z.ZodLiteral<"
|
|
333
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
334
334
|
message: z.ZodString;
|
|
335
335
|
}, z.core.$strip>;
|
|
336
336
|
}, z.core.$strip>;
|
|
@@ -344,12 +344,12 @@ declare const commonGetErrorResponses: {
|
|
|
344
344
|
schema: z.ZodObject<{
|
|
345
345
|
instance: z.ZodOptional<z.ZodString>;
|
|
346
346
|
requestId: z.ZodOptional<z.ZodString>;
|
|
347
|
-
code: z.ZodLiteral<"
|
|
347
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
348
348
|
detail: z.ZodString;
|
|
349
349
|
title: z.ZodString;
|
|
350
350
|
status: z.ZodNumber;
|
|
351
351
|
error: z.ZodObject<{
|
|
352
|
-
code: z.ZodLiteral<"
|
|
352
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
353
353
|
message: z.ZodString;
|
|
354
354
|
}, z.core.$strip>;
|
|
355
355
|
}, z.core.$strip>;
|
|
@@ -363,12 +363,12 @@ declare const commonGetErrorResponses: {
|
|
|
363
363
|
schema: z.ZodObject<{
|
|
364
364
|
instance: z.ZodOptional<z.ZodString>;
|
|
365
365
|
requestId: z.ZodOptional<z.ZodString>;
|
|
366
|
-
code: z.ZodLiteral<"
|
|
366
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
367
367
|
detail: z.ZodString;
|
|
368
368
|
title: z.ZodString;
|
|
369
369
|
status: z.ZodNumber;
|
|
370
370
|
error: z.ZodObject<{
|
|
371
|
-
code: z.ZodLiteral<"
|
|
371
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
372
372
|
message: z.ZodString;
|
|
373
373
|
}, z.core.$strip>;
|
|
374
374
|
}, z.core.$strip>;
|
|
@@ -382,12 +382,12 @@ declare const commonGetErrorResponses: {
|
|
|
382
382
|
schema: z.ZodObject<{
|
|
383
383
|
instance: z.ZodOptional<z.ZodString>;
|
|
384
384
|
requestId: z.ZodOptional<z.ZodString>;
|
|
385
|
-
code: z.ZodLiteral<"
|
|
385
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
386
386
|
detail: z.ZodString;
|
|
387
387
|
title: z.ZodString;
|
|
388
388
|
status: z.ZodNumber;
|
|
389
389
|
error: z.ZodObject<{
|
|
390
|
-
code: z.ZodLiteral<"
|
|
390
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
391
391
|
message: z.ZodString;
|
|
392
392
|
}, z.core.$strip>;
|
|
393
393
|
}, z.core.$strip>;
|
|
@@ -401,12 +401,12 @@ declare const commonGetErrorResponses: {
|
|
|
401
401
|
schema: z.ZodObject<{
|
|
402
402
|
instance: z.ZodOptional<z.ZodString>;
|
|
403
403
|
requestId: z.ZodOptional<z.ZodString>;
|
|
404
|
-
code: z.ZodLiteral<"
|
|
404
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
405
405
|
detail: z.ZodString;
|
|
406
406
|
title: z.ZodString;
|
|
407
407
|
status: z.ZodNumber;
|
|
408
408
|
error: z.ZodObject<{
|
|
409
|
-
code: z.ZodLiteral<"
|
|
409
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
410
410
|
message: z.ZodString;
|
|
411
411
|
}, z.core.$strip>;
|
|
412
412
|
}, z.core.$strip>;
|
|
@@ -422,12 +422,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
422
422
|
schema: z.ZodObject<{
|
|
423
423
|
instance: z.ZodOptional<z.ZodString>;
|
|
424
424
|
requestId: z.ZodOptional<z.ZodString>;
|
|
425
|
-
code: z.ZodLiteral<"
|
|
425
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
426
426
|
detail: z.ZodString;
|
|
427
427
|
title: z.ZodString;
|
|
428
428
|
status: z.ZodNumber;
|
|
429
429
|
error: z.ZodObject<{
|
|
430
|
-
code: z.ZodLiteral<"
|
|
430
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
431
431
|
message: z.ZodString;
|
|
432
432
|
}, z.core.$strip>;
|
|
433
433
|
}, z.core.$strip>;
|
|
@@ -441,12 +441,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
441
441
|
schema: z.ZodObject<{
|
|
442
442
|
instance: z.ZodOptional<z.ZodString>;
|
|
443
443
|
requestId: z.ZodOptional<z.ZodString>;
|
|
444
|
-
code: z.ZodLiteral<"
|
|
444
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
445
445
|
detail: z.ZodString;
|
|
446
446
|
title: z.ZodString;
|
|
447
447
|
status: z.ZodNumber;
|
|
448
448
|
error: z.ZodObject<{
|
|
449
|
-
code: z.ZodLiteral<"
|
|
449
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
450
450
|
message: z.ZodString;
|
|
451
451
|
}, z.core.$strip>;
|
|
452
452
|
}, z.core.$strip>;
|
|
@@ -460,12 +460,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
460
460
|
schema: z.ZodObject<{
|
|
461
461
|
instance: z.ZodOptional<z.ZodString>;
|
|
462
462
|
requestId: z.ZodOptional<z.ZodString>;
|
|
463
|
-
code: z.ZodLiteral<"
|
|
463
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
464
464
|
detail: z.ZodString;
|
|
465
465
|
title: z.ZodString;
|
|
466
466
|
status: z.ZodNumber;
|
|
467
467
|
error: z.ZodObject<{
|
|
468
|
-
code: z.ZodLiteral<"
|
|
468
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
469
469
|
message: z.ZodString;
|
|
470
470
|
}, z.core.$strip>;
|
|
471
471
|
}, z.core.$strip>;
|
|
@@ -479,12 +479,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
479
479
|
schema: z.ZodObject<{
|
|
480
480
|
instance: z.ZodOptional<z.ZodString>;
|
|
481
481
|
requestId: z.ZodOptional<z.ZodString>;
|
|
482
|
-
code: z.ZodLiteral<"
|
|
482
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
483
483
|
detail: z.ZodString;
|
|
484
484
|
title: z.ZodString;
|
|
485
485
|
status: z.ZodNumber;
|
|
486
486
|
error: z.ZodObject<{
|
|
487
|
-
code: z.ZodLiteral<"
|
|
487
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
488
488
|
message: z.ZodString;
|
|
489
489
|
}, z.core.$strip>;
|
|
490
490
|
}, z.core.$strip>;
|
|
@@ -498,12 +498,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
498
498
|
schema: z.ZodObject<{
|
|
499
499
|
instance: z.ZodOptional<z.ZodString>;
|
|
500
500
|
requestId: z.ZodOptional<z.ZodString>;
|
|
501
|
-
code: z.ZodLiteral<"
|
|
501
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
502
502
|
detail: z.ZodString;
|
|
503
503
|
title: z.ZodString;
|
|
504
504
|
status: z.ZodNumber;
|
|
505
505
|
error: z.ZodObject<{
|
|
506
|
-
code: z.ZodLiteral<"
|
|
506
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
507
507
|
message: z.ZodString;
|
|
508
508
|
}, z.core.$strip>;
|
|
509
509
|
}, z.core.$strip>;
|
|
@@ -517,12 +517,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
517
517
|
schema: z.ZodObject<{
|
|
518
518
|
instance: z.ZodOptional<z.ZodString>;
|
|
519
519
|
requestId: z.ZodOptional<z.ZodString>;
|
|
520
|
-
code: z.ZodLiteral<"
|
|
520
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
521
521
|
detail: z.ZodString;
|
|
522
522
|
title: z.ZodString;
|
|
523
523
|
status: z.ZodNumber;
|
|
524
524
|
error: z.ZodObject<{
|
|
525
|
-
code: z.ZodLiteral<"
|
|
525
|
+
code: z.ZodLiteral<"bad_request" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
526
526
|
message: z.ZodString;
|
|
527
527
|
}, z.core.$strip>;
|
|
528
528
|
}, z.core.$strip>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ModelSettings } from "../validation/schemas.js";
|
|
2
2
|
import { LanguageModel } from "ai";
|
|
3
|
+
import { JSONObject } from "@ai-sdk/provider";
|
|
3
4
|
|
|
4
5
|
//#region src/utils/model-factory.d.ts
|
|
5
6
|
|
|
@@ -15,9 +16,15 @@ declare class ModelFactory {
|
|
|
15
16
|
private static createProvider;
|
|
16
17
|
/**
|
|
17
18
|
* Extract provider configuration from providerOptions
|
|
18
|
-
* Only includes settings that go to the provider constructor (baseURL,
|
|
19
|
+
* Only includes settings that go to the provider constructor (baseURL, headers, etc.)
|
|
19
20
|
*/
|
|
20
21
|
private static extractProviderConfig;
|
|
22
|
+
/**
|
|
23
|
+
* Extract per-call provider options to pass as providerOptions in streamText/generateText.
|
|
24
|
+
* Any object-valued key (except constructor config keys like headers) is treated as
|
|
25
|
+
* a provider-specific per-call option, e.g. anthropic.thinking, gateway.models.
|
|
26
|
+
*/
|
|
27
|
+
static extractStreamProviderOptions(providerOptions?: Record<string, unknown>): Record<string, JSONObject> | undefined;
|
|
21
28
|
/**
|
|
22
29
|
* Create a language model instance from configuration
|
|
23
30
|
* Throws error if no config provided - models must be configured at project level
|
|
@@ -50,7 +57,8 @@ declare class ModelFactory {
|
|
|
50
57
|
static prepareGenerationConfig(modelSettings?: ModelSettings): {
|
|
51
58
|
model: LanguageModel;
|
|
52
59
|
maxDuration?: number;
|
|
53
|
-
|
|
60
|
+
providerOptions?: Record<string, JSONObject>;
|
|
61
|
+
};
|
|
54
62
|
/**
|
|
55
63
|
* Validate model settingsuration
|
|
56
64
|
* Basic validation only - let AI SDK handle parameter-specific validation
|
|
@@ -67,7 +67,7 @@ var ModelFactory = class ModelFactory {
|
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
69
|
* Extract provider configuration from providerOptions
|
|
70
|
-
* Only includes settings that go to the provider constructor (baseURL,
|
|
70
|
+
* Only includes settings that go to the provider constructor (baseURL, headers, etc.)
|
|
71
71
|
*/
|
|
72
72
|
static extractProviderConfig(providerOptions) {
|
|
73
73
|
if (!providerOptions) return {};
|
|
@@ -76,12 +76,21 @@ var ModelFactory = class ModelFactory {
|
|
|
76
76
|
if (providerOptions.headers) providerConfig.headers = providerOptions.headers;
|
|
77
77
|
if (providerOptions.resourceName) providerConfig.resourceName = providerOptions.resourceName;
|
|
78
78
|
if (providerOptions.apiVersion) providerConfig.apiVersion = providerOptions.apiVersion;
|
|
79
|
-
if (providerOptions.gateway) Object.assign(providerConfig, providerOptions.gateway);
|
|
80
|
-
if (providerOptions.nim) Object.assign(providerConfig, providerOptions.nim);
|
|
81
|
-
if (providerOptions.custom) Object.assign(providerConfig, providerOptions.custom);
|
|
82
79
|
return providerConfig;
|
|
83
80
|
}
|
|
84
81
|
/**
|
|
82
|
+
* Extract per-call provider options to pass as providerOptions in streamText/generateText.
|
|
83
|
+
* Any object-valued key (except constructor config keys like headers) is treated as
|
|
84
|
+
* a provider-specific per-call option, e.g. anthropic.thinking, gateway.models.
|
|
85
|
+
*/
|
|
86
|
+
static extractStreamProviderOptions(providerOptions) {
|
|
87
|
+
if (!providerOptions) return;
|
|
88
|
+
const constructorObjectKeys = new Set(["headers"]);
|
|
89
|
+
const result = {};
|
|
90
|
+
for (const [key, value] of Object.entries(providerOptions)) if (value !== null && typeof value === "object" && !Array.isArray(value) && !constructorObjectKeys.has(key)) result[key] = value;
|
|
91
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
85
94
|
* Create a language model instance from configuration
|
|
86
95
|
* Throws error if no config provided - models must be configured at project level
|
|
87
96
|
*/
|
|
@@ -110,7 +119,7 @@ var ModelFactory = class ModelFactory {
|
|
|
110
119
|
case "gateway": return gateway(modelName);
|
|
111
120
|
case "nim": return nimDefault(modelName);
|
|
112
121
|
case "mock": return createMockModel(modelName);
|
|
113
|
-
case "custom": throw new Error("Custom provider requires configuration. Please provide baseURL in providerOptions.
|
|
122
|
+
case "custom": throw new Error("Custom provider requires configuration. Please provide baseURL in providerOptions.baseURL");
|
|
114
123
|
default: throw new Error(`Unsupported provider: ${provider}. Supported providers are: ${ModelFactory.BUILT_IN_PROVIDERS.join(", ")}. To access other models, use OpenRouter (openrouter/model-id), Vercel AI Gateway (gateway/model-id), NVIDIA NIM (nim/model-id), or Custom OpenAI-compatible (custom/model-id).`);
|
|
115
124
|
}
|
|
116
125
|
}
|
|
@@ -152,20 +161,17 @@ var ModelFactory = class ModelFactory {
|
|
|
152
161
|
*/
|
|
153
162
|
static getGenerationParams(providerOptions) {
|
|
154
163
|
if (!providerOptions) return {};
|
|
155
|
-
const excludedKeys = [
|
|
164
|
+
const excludedKeys = new Set([
|
|
156
165
|
"apiKey",
|
|
157
166
|
"baseURL",
|
|
158
167
|
"baseUrl",
|
|
159
168
|
"resourceName",
|
|
160
169
|
"apiVersion",
|
|
161
170
|
"maxDuration",
|
|
162
|
-
"headers"
|
|
163
|
-
|
|
164
|
-
"nim",
|
|
165
|
-
"custom"
|
|
166
|
-
];
|
|
171
|
+
"headers"
|
|
172
|
+
]);
|
|
167
173
|
const params = {};
|
|
168
|
-
for (const [key, value] of Object.entries(providerOptions)) if (!excludedKeys.
|
|
174
|
+
for (const [key, value] of Object.entries(providerOptions)) if (!excludedKeys.has(key) && value !== void 0 && typeof value !== "object") params[key] = value;
|
|
169
175
|
return params;
|
|
170
176
|
}
|
|
171
177
|
/**
|
|
@@ -180,11 +186,13 @@ var ModelFactory = class ModelFactory {
|
|
|
180
186
|
providerOptions: modelSettings?.providerOptions
|
|
181
187
|
});
|
|
182
188
|
const generationParams = ModelFactory.getGenerationParams(modelSettings?.providerOptions);
|
|
189
|
+
const streamProviderOptions = ModelFactory.extractStreamProviderOptions(modelSettings?.providerOptions);
|
|
183
190
|
const maxDuration = modelSettings?.providerOptions?.maxDuration;
|
|
184
191
|
return {
|
|
185
192
|
model,
|
|
186
193
|
...generationParams,
|
|
187
|
-
...maxDuration !== void 0 && { maxDuration }
|
|
194
|
+
...maxDuration !== void 0 && { maxDuration },
|
|
195
|
+
...streamProviderOptions !== void 0 && { providerOptions: streamProviderOptions }
|
|
188
196
|
};
|
|
189
197
|
}
|
|
190
198
|
/**
|
|
@@ -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
|
/**
|