@llmops/core 0.6.10 → 1.0.0-beta.10
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/index.cjs +4751 -3744
- package/dist/index.d.cts +9 -2821
- package/dist/index.d.mts +9 -2821
- package/dist/index.mjs +4490 -3450
- package/package.json +2 -19
- package/dist/bun-sqlite-dialect-C06VxkTn.cjs +0 -156
- package/dist/bun-sqlite-dialect-CHpTFgAo.mjs +0 -155
- package/dist/db/index.cjs +0 -40
- package/dist/db/index.d.cts +0 -2
- package/dist/db/index.d.mts +0 -2
- package/dist/db/index.mjs +0 -4
- package/dist/db-CdAtHHw5.mjs +0 -14740
- package/dist/db-D8otWwZL.cjs +0 -15063
- package/dist/index-CyVFWq76.d.cts +0 -3663
- package/dist/index-D3onb7gK.d.mts +0 -3663
- package/dist/neon-dialect-DIuEesTA.cjs +0 -3
- package/dist/neon-dialect-DySGBYUi.mjs +0 -30
- package/dist/neon-dialect-Hmo08nUq.mjs +0 -3
- package/dist/neon-dialect-ccr-mLKR.cjs +0 -42
- package/dist/node-sqlite-dialect-AU81Qz0n.cjs +0 -156
- package/dist/node-sqlite-dialect-B5oKhOm1.mjs +0 -155
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { $ as SCHEMA_METADATA, A as DatasetsTable, At as playgroundsSchema, B as LLMRequest, Bt as workspaceSettingsSchema, C as Dataset, Ct as environmentSecretsSchema, D as DatasetVersionRecord, Dt as playgroundColumnSchema, E as DatasetVersion, Et as llmRequestsSchema, F as GuardrailConfig, Ft as spansSchema, G as PlaygroundResultsTable, H as Playground, I as GuardrailConfigsTable, It as targetingRulesSchema, J as PlaygroundsTable, K as PlaygroundRun, L as GuardrailResult, Lt as tracesSchema, M as EnvironmentSecret, Mt as providerGuardrailOverridesSchema, N as EnvironmentSecretsTable, Nt as schemas, O as DatasetVersionRecordsTable, Ot as playgroundResultsSchema, P as EnvironmentsTable, Pt as spanEventsSchema, Q as ProviderGuardrailOverridesTable, R as GuardrailResults, Rt as variantVersionsSchema, S as Database, St as datasetsSchema, T as DatasetRecordsTable, Tt as guardrailConfigsSchema, U as PlaygroundColumn, V as LLMRequestsTable, W as PlaygroundResult, X as ProviderConfigsTable, Y as ProviderConfig, Z as ProviderGuardrailOverride, _ as validateTableData, _t as configVariantsSchema, a as createDatabaseFromConnection, at as TableName, b as ConfigVariantsTable, bt as datasetVersionRecordsSchema, c as executeWithSchema, ct as Trace, d as getMigrations, dt as Variant, et as Selectable, f as matchType, ft as VariantVersion, g as validatePartialTableData, gt as WorkspaceSettingsTable, h as parseTableData, ht as WorkspaceSettings, i as createDatabase, it as SpansTable, j as Environment, jt as providerConfigsSchema, k as DatasetVersionsTable, kt as playgroundRunsSchema, l as MigrationOptions, lt as TracesTable, m as parsePartialTableData, mt as VariantsTable, n as DatabaseOptions, nt as SpanEvent, o as detectDatabaseType, ot as TargetingRule, p as runAutoMigrations, pt as VariantVersionsTable, q as PlaygroundRunsTable, r as DatabaseType, rt as SpanEventsTable, s as createNeonDialect, st as TargetingRulesTable, t as DatabaseConnection, tt as Span, u as MigrationResult, ut as Updateable, v as Config, vt as configsSchema, w as DatasetRecord, wt as environmentsSchema, x as ConfigsTable, xt as datasetVersionsSchema, y as ConfigVariant, yt as datasetRecordsSchema, z as Insertable, zt as variantsSchema } from "./index-D3onb7gK.mjs";
|
|
2
1
|
import gateway from "@llmops/gateway";
|
|
3
|
-
import * as kysely0 from "kysely";
|
|
4
|
-
import { Kysely } from "kysely";
|
|
5
2
|
import pino from "pino";
|
|
6
|
-
import {
|
|
7
|
-
import z$1, { z } from "zod";
|
|
8
|
-
import { BetterAuthOptions } from "better-auth";
|
|
3
|
+
import { z } from "zod";
|
|
9
4
|
|
|
10
5
|
//#region src/constants/headers.d.ts
|
|
11
6
|
/**
|
|
@@ -484,9 +479,8 @@ declare const DEFAULT_PROVIDER_ENV_VARS: string[];
|
|
|
484
479
|
//#endregion
|
|
485
480
|
//#region src/schemas/config.d.ts
|
|
486
481
|
declare const llmopsConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
487
|
-
|
|
482
|
+
telemetry: z.ZodOptional<z.ZodAny>;
|
|
488
483
|
basePath: z.ZodDefault<z.ZodString>;
|
|
489
|
-
schema: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
490
484
|
providers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
491
485
|
provider: z.ZodString;
|
|
492
486
|
slug: z.ZodString;
|
|
@@ -498,12 +492,10 @@ declare const llmopsConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
498
492
|
}, z.core.$strip>, z.ZodTransform<{
|
|
499
493
|
providers: InlineProviderConfig[];
|
|
500
494
|
basePath: string;
|
|
501
|
-
|
|
502
|
-
database?: any;
|
|
495
|
+
telemetry?: any;
|
|
503
496
|
}, {
|
|
504
497
|
basePath: string;
|
|
505
|
-
|
|
506
|
-
database?: any;
|
|
498
|
+
telemetry?: any;
|
|
507
499
|
providers?: {
|
|
508
500
|
[x: string]: unknown;
|
|
509
501
|
provider: string;
|
|
@@ -521,20 +513,16 @@ declare const llmopsConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
521
513
|
* Either database or providers must be present (enforced by schema)
|
|
522
514
|
*/
|
|
523
515
|
type ValidatedLLMOpsConfig = {
|
|
524
|
-
|
|
516
|
+
telemetry?: unknown;
|
|
525
517
|
basePath: string;
|
|
526
|
-
schema: string;
|
|
527
518
|
providers?: InlineProvidersConfig;
|
|
528
519
|
};
|
|
529
520
|
/**
|
|
530
521
|
* Input type for LLMOps configuration (before validation)
|
|
531
|
-
* Users can omit optional fields like schema and providers
|
|
532
|
-
* Either database or providers must be provided
|
|
533
522
|
*/
|
|
534
523
|
type LLMOpsConfigInput = {
|
|
535
|
-
|
|
524
|
+
telemetry?: unknown;
|
|
536
525
|
basePath?: string;
|
|
537
|
-
schema?: string;
|
|
538
526
|
providers?: InlineProvidersConfig;
|
|
539
527
|
};
|
|
540
528
|
declare function validateLLMOpsConfig(config?: unknown): ValidatedLLMOpsConfig;
|
|
@@ -726,10 +714,10 @@ declare const chatCompletionCreateParamsBaseSchema: z.ZodObject<{
|
|
|
726
714
|
seed: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
727
715
|
service_tier: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
728
716
|
default: "default";
|
|
729
|
-
priority: "priority";
|
|
730
717
|
auto: "auto";
|
|
731
718
|
flex: "flex";
|
|
732
719
|
scale: "scale";
|
|
720
|
+
priority: "priority";
|
|
733
721
|
}>>>;
|
|
734
722
|
stop: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
735
723
|
store: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -915,10 +903,10 @@ declare const variantJsonDataSchema: z.ZodObject<{
|
|
|
915
903
|
seed: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
916
904
|
service_tier: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
917
905
|
default: "default";
|
|
918
|
-
priority: "priority";
|
|
919
906
|
auto: "auto";
|
|
920
907
|
flex: "flex";
|
|
921
908
|
scale: "scale";
|
|
909
|
+
priority: "priority";
|
|
922
910
|
}>>>;
|
|
923
911
|
stop: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
924
912
|
store: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -1197,2578 +1185,6 @@ declare const logger: pino.Logger<never, boolean>;
|
|
|
1197
1185
|
//#region src/utils/id.d.ts
|
|
1198
1186
|
declare const generateId: (size?: number) => string;
|
|
1199
1187
|
//#endregion
|
|
1200
|
-
//#region src/datalayer/configs.d.ts
|
|
1201
|
-
declare const createNewConfig: z$1.ZodObject<{
|
|
1202
|
-
name: z$1.ZodString;
|
|
1203
|
-
}, z$1.core.$strip>;
|
|
1204
|
-
declare const updateConfigName: z$1.ZodObject<{
|
|
1205
|
-
configId: z$1.ZodUUID;
|
|
1206
|
-
newName: z$1.ZodString;
|
|
1207
|
-
}, z$1.core.$strip>;
|
|
1208
|
-
declare const getConfigById: z$1.ZodObject<{
|
|
1209
|
-
configId: z$1.ZodUUID;
|
|
1210
|
-
}, z$1.core.$strip>;
|
|
1211
|
-
declare const deleteConfig: z$1.ZodObject<{
|
|
1212
|
-
configId: z$1.ZodUUID;
|
|
1213
|
-
}, z$1.core.$strip>;
|
|
1214
|
-
declare const listConfigs: z$1.ZodObject<{
|
|
1215
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1216
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1217
|
-
}, z$1.core.$strip>;
|
|
1218
|
-
declare const createConfigDataLayer: (db: Kysely<Database>) => {
|
|
1219
|
-
createNewConfig: (params: z$1.infer<typeof createNewConfig>) => Promise<{
|
|
1220
|
-
slug: string;
|
|
1221
|
-
name: string | undefined;
|
|
1222
|
-
id: string;
|
|
1223
|
-
createdAt: Date;
|
|
1224
|
-
updatedAt: Date;
|
|
1225
|
-
} | undefined>;
|
|
1226
|
-
updateConfigName: (params: z$1.infer<typeof updateConfigName>) => Promise<{
|
|
1227
|
-
slug: string;
|
|
1228
|
-
name: string | undefined;
|
|
1229
|
-
id: string;
|
|
1230
|
-
createdAt: Date;
|
|
1231
|
-
updatedAt: Date;
|
|
1232
|
-
} | undefined>;
|
|
1233
|
-
getConfigById: (params: z$1.infer<typeof getConfigById>) => Promise<{
|
|
1234
|
-
slug: string;
|
|
1235
|
-
name: string | undefined;
|
|
1236
|
-
id: string;
|
|
1237
|
-
createdAt: Date;
|
|
1238
|
-
updatedAt: Date;
|
|
1239
|
-
} | undefined>;
|
|
1240
|
-
deleteConfig: (params: z$1.infer<typeof deleteConfig>) => Promise<{
|
|
1241
|
-
slug: string;
|
|
1242
|
-
name: string | undefined;
|
|
1243
|
-
id: string;
|
|
1244
|
-
createdAt: Date;
|
|
1245
|
-
updatedAt: Date;
|
|
1246
|
-
} | undefined>;
|
|
1247
|
-
listConfigs: (params?: z$1.infer<typeof listConfigs>) => Promise<{
|
|
1248
|
-
slug: string;
|
|
1249
|
-
name: string | undefined;
|
|
1250
|
-
id: string;
|
|
1251
|
-
createdAt: Date;
|
|
1252
|
-
updatedAt: Date;
|
|
1253
|
-
}[]>;
|
|
1254
|
-
/**
|
|
1255
|
-
* Get config with its variants and their latest versions
|
|
1256
|
-
*/
|
|
1257
|
-
getConfigWithVariants: (params: z$1.infer<typeof getConfigById>) => Promise<{
|
|
1258
|
-
provider: string | null;
|
|
1259
|
-
modelName: string | null;
|
|
1260
|
-
jsonData: Record<string, unknown> | null;
|
|
1261
|
-
variantVersionId: string | null;
|
|
1262
|
-
slug: string;
|
|
1263
|
-
name: string | undefined;
|
|
1264
|
-
id: string;
|
|
1265
|
-
createdAt: Date;
|
|
1266
|
-
updatedAt: Date;
|
|
1267
|
-
variantId: string | null;
|
|
1268
|
-
variantName: string | null;
|
|
1269
|
-
}[]>;
|
|
1270
|
-
};
|
|
1271
|
-
//#endregion
|
|
1272
|
-
//#region src/datalayer/configVariants.d.ts
|
|
1273
|
-
declare const createConfigVariant: z$1.ZodObject<{
|
|
1274
|
-
configId: z$1.ZodString;
|
|
1275
|
-
variantId: z$1.ZodString;
|
|
1276
|
-
}, z$1.core.$strip>;
|
|
1277
|
-
declare const getConfigVariantById: z$1.ZodObject<{
|
|
1278
|
-
id: z$1.ZodString;
|
|
1279
|
-
}, z$1.core.$strip>;
|
|
1280
|
-
declare const getConfigVariantsByConfigId: z$1.ZodObject<{
|
|
1281
|
-
configId: z$1.ZodString;
|
|
1282
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1283
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1284
|
-
}, z$1.core.$strip>;
|
|
1285
|
-
declare const getConfigVariantsByVariantId: z$1.ZodObject<{
|
|
1286
|
-
variantId: z$1.ZodString;
|
|
1287
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1288
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1289
|
-
}, z$1.core.$strip>;
|
|
1290
|
-
declare const deleteConfigVariant: z$1.ZodObject<{
|
|
1291
|
-
id: z$1.ZodString;
|
|
1292
|
-
}, z$1.core.$strip>;
|
|
1293
|
-
declare const deleteConfigVariantByIds: z$1.ZodObject<{
|
|
1294
|
-
configId: z$1.ZodString;
|
|
1295
|
-
variantId: z$1.ZodString;
|
|
1296
|
-
}, z$1.core.$strip>;
|
|
1297
|
-
declare const listConfigVariants: z$1.ZodObject<{
|
|
1298
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1299
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1300
|
-
}, z$1.core.$strip>;
|
|
1301
|
-
declare const createVariantAndLinkToConfig: z$1.ZodObject<{
|
|
1302
|
-
configId: z$1.ZodString;
|
|
1303
|
-
name: z$1.ZodString;
|
|
1304
|
-
provider: z$1.ZodString;
|
|
1305
|
-
modelName: z$1.ZodString;
|
|
1306
|
-
jsonData: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1307
|
-
}, z$1.core.$strip>;
|
|
1308
|
-
declare const getVariantJsonDataForConfig: z$1.ZodObject<{
|
|
1309
|
-
configId: z$1.ZodString;
|
|
1310
|
-
envSecret: z$1.ZodOptional<z$1.ZodString>;
|
|
1311
|
-
}, z$1.core.$strip>;
|
|
1312
|
-
declare const createConfigVariantDataLayer: (db: Kysely<Database>) => {
|
|
1313
|
-
createConfigVariant: (params: z$1.infer<typeof createConfigVariant>) => Promise<{
|
|
1314
|
-
id: string;
|
|
1315
|
-
createdAt: Date;
|
|
1316
|
-
updatedAt: Date;
|
|
1317
|
-
variantId: string;
|
|
1318
|
-
configId: string;
|
|
1319
|
-
} | undefined>;
|
|
1320
|
-
getConfigVariantById: (params: z$1.infer<typeof getConfigVariantById>) => Promise<{
|
|
1321
|
-
id: string;
|
|
1322
|
-
createdAt: Date;
|
|
1323
|
-
updatedAt: Date;
|
|
1324
|
-
variantId: string;
|
|
1325
|
-
configId: string;
|
|
1326
|
-
} | undefined>;
|
|
1327
|
-
getConfigVariantsByConfigId: (params: z$1.infer<typeof getConfigVariantsByConfigId>) => Promise<{
|
|
1328
|
-
id: string;
|
|
1329
|
-
createdAt: Date;
|
|
1330
|
-
updatedAt: Date;
|
|
1331
|
-
variantId: string;
|
|
1332
|
-
configId: string;
|
|
1333
|
-
}[]>;
|
|
1334
|
-
getConfigVariantsByVariantId: (params: z$1.infer<typeof getConfigVariantsByVariantId>) => Promise<{
|
|
1335
|
-
id: string;
|
|
1336
|
-
createdAt: Date;
|
|
1337
|
-
updatedAt: Date;
|
|
1338
|
-
variantId: string;
|
|
1339
|
-
configId: string;
|
|
1340
|
-
}[]>;
|
|
1341
|
-
deleteConfigVariant: (params: z$1.infer<typeof deleteConfigVariant>) => Promise<{
|
|
1342
|
-
id: string;
|
|
1343
|
-
createdAt: Date;
|
|
1344
|
-
updatedAt: Date;
|
|
1345
|
-
variantId: string;
|
|
1346
|
-
configId: string;
|
|
1347
|
-
} | undefined>;
|
|
1348
|
-
deleteConfigVariantByIds: (params: z$1.infer<typeof deleteConfigVariantByIds>) => Promise<{
|
|
1349
|
-
id: string;
|
|
1350
|
-
createdAt: Date;
|
|
1351
|
-
updatedAt: Date;
|
|
1352
|
-
variantId: string;
|
|
1353
|
-
configId: string;
|
|
1354
|
-
} | undefined>;
|
|
1355
|
-
listConfigVariants: (params?: z$1.infer<typeof listConfigVariants>) => Promise<{
|
|
1356
|
-
id: string;
|
|
1357
|
-
createdAt: Date;
|
|
1358
|
-
updatedAt: Date;
|
|
1359
|
-
variantId: string;
|
|
1360
|
-
configId: string;
|
|
1361
|
-
}[]>;
|
|
1362
|
-
getConfigVariantWithDetails: (params: z$1.infer<typeof getConfigVariantById>) => Promise<{
|
|
1363
|
-
latestVersion: {
|
|
1364
|
-
version: number;
|
|
1365
|
-
id: string;
|
|
1366
|
-
createdAt: Date;
|
|
1367
|
-
updatedAt: Date;
|
|
1368
|
-
variantId: string;
|
|
1369
|
-
provider: string;
|
|
1370
|
-
modelName: string;
|
|
1371
|
-
jsonData: Record<string, unknown>;
|
|
1372
|
-
} | null;
|
|
1373
|
-
configId: string;
|
|
1374
|
-
id: string;
|
|
1375
|
-
createdAt: Date;
|
|
1376
|
-
updatedAt: Date;
|
|
1377
|
-
variantId: string;
|
|
1378
|
-
variantName: string | null;
|
|
1379
|
-
configName: string | null | undefined;
|
|
1380
|
-
} | undefined>;
|
|
1381
|
-
/**
|
|
1382
|
-
* Get config variants with details including latest version data
|
|
1383
|
-
*/
|
|
1384
|
-
getConfigVariantsWithDetailsByConfigId: (params: z$1.infer<typeof getConfigVariantsByConfigId>) => Promise<{
|
|
1385
|
-
provider: string | null;
|
|
1386
|
-
modelName: string | null;
|
|
1387
|
-
jsonData: Record<string, unknown> | null;
|
|
1388
|
-
latestVersion: {
|
|
1389
|
-
version: number;
|
|
1390
|
-
id: string;
|
|
1391
|
-
createdAt: Date;
|
|
1392
|
-
updatedAt: Date;
|
|
1393
|
-
variantId: string;
|
|
1394
|
-
provider: string;
|
|
1395
|
-
modelName: string;
|
|
1396
|
-
jsonData: Record<string, unknown>;
|
|
1397
|
-
} | null;
|
|
1398
|
-
configId: string;
|
|
1399
|
-
id: string;
|
|
1400
|
-
createdAt: Date;
|
|
1401
|
-
updatedAt: Date;
|
|
1402
|
-
variantId: string;
|
|
1403
|
-
name: string | null;
|
|
1404
|
-
}[]>;
|
|
1405
|
-
/**
|
|
1406
|
-
* Create a new variant with its first version and link to config
|
|
1407
|
-
*/
|
|
1408
|
-
createVariantAndLinkToConfig: (params: z$1.infer<typeof createVariantAndLinkToConfig>) => Promise<{
|
|
1409
|
-
variant: {
|
|
1410
|
-
name: string;
|
|
1411
|
-
id: string;
|
|
1412
|
-
createdAt: Date;
|
|
1413
|
-
updatedAt: Date;
|
|
1414
|
-
};
|
|
1415
|
-
version: {
|
|
1416
|
-
version: number;
|
|
1417
|
-
id: string;
|
|
1418
|
-
createdAt: Date;
|
|
1419
|
-
updatedAt: Date;
|
|
1420
|
-
variantId: string;
|
|
1421
|
-
provider: string;
|
|
1422
|
-
modelName: string;
|
|
1423
|
-
jsonData: Record<string, unknown>;
|
|
1424
|
-
};
|
|
1425
|
-
configVariant: {
|
|
1426
|
-
id: string;
|
|
1427
|
-
createdAt: Date;
|
|
1428
|
-
updatedAt: Date;
|
|
1429
|
-
variantId: string;
|
|
1430
|
-
configId: string;
|
|
1431
|
-
};
|
|
1432
|
-
}>;
|
|
1433
|
-
/**
|
|
1434
|
-
* Get the variant version data for a config based on targeting rules.
|
|
1435
|
-
* If variantVersionId is specified in the targeting rule, use that specific version.
|
|
1436
|
-
* Otherwise, use the latest version.
|
|
1437
|
-
*
|
|
1438
|
-
* configId can be either a UUID or a short slug.
|
|
1439
|
-
*/
|
|
1440
|
-
getVariantJsonDataForConfig: (params: z$1.infer<typeof getVariantJsonDataForConfig>) => Promise<{
|
|
1441
|
-
provider: string;
|
|
1442
|
-
providerConfigId: string | null;
|
|
1443
|
-
configId: string;
|
|
1444
|
-
variantId: string;
|
|
1445
|
-
environmentId: string;
|
|
1446
|
-
version: number;
|
|
1447
|
-
modelName: string;
|
|
1448
|
-
jsonData: Record<string, unknown>;
|
|
1449
|
-
}>;
|
|
1450
|
-
};
|
|
1451
|
-
//#endregion
|
|
1452
|
-
//#region src/datalayer/datasets.d.ts
|
|
1453
|
-
declare const createDataset: z$1.ZodObject<{
|
|
1454
|
-
name: z$1.ZodString;
|
|
1455
|
-
description: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1456
|
-
}, z$1.core.$strip>;
|
|
1457
|
-
declare const updateDataset: z$1.ZodObject<{
|
|
1458
|
-
datasetId: z$1.ZodString;
|
|
1459
|
-
name: z$1.ZodOptional<z$1.ZodString>;
|
|
1460
|
-
description: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1461
|
-
}, z$1.core.$strip>;
|
|
1462
|
-
declare const getDatasetById: z$1.ZodObject<{
|
|
1463
|
-
datasetId: z$1.ZodString;
|
|
1464
|
-
}, z$1.core.$strip>;
|
|
1465
|
-
declare const deleteDataset: z$1.ZodObject<{
|
|
1466
|
-
datasetId: z$1.ZodString;
|
|
1467
|
-
}, z$1.core.$strip>;
|
|
1468
|
-
declare const listDatasets: z$1.ZodObject<{
|
|
1469
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1470
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1471
|
-
}, z$1.core.$strip>;
|
|
1472
|
-
declare const createRecord: z$1.ZodObject<{
|
|
1473
|
-
datasetId: z$1.ZodString;
|
|
1474
|
-
input: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
1475
|
-
expected: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1476
|
-
metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1477
|
-
}, z$1.core.$strip>;
|
|
1478
|
-
declare const updateRecord: z$1.ZodObject<{
|
|
1479
|
-
recordId: z$1.ZodString;
|
|
1480
|
-
input: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1481
|
-
expected: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1482
|
-
metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1483
|
-
}, z$1.core.$strip>;
|
|
1484
|
-
declare const deleteRecord: z$1.ZodObject<{
|
|
1485
|
-
recordId: z$1.ZodString;
|
|
1486
|
-
}, z$1.core.$strip>;
|
|
1487
|
-
declare const listRecords: z$1.ZodObject<{
|
|
1488
|
-
datasetId: z$1.ZodString;
|
|
1489
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1490
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1491
|
-
}, z$1.core.$strip>;
|
|
1492
|
-
declare const createVersion: z$1.ZodObject<{
|
|
1493
|
-
datasetId: z$1.ZodString;
|
|
1494
|
-
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1495
|
-
description: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1496
|
-
}, z$1.core.$strip>;
|
|
1497
|
-
declare const getVersionById: z$1.ZodObject<{
|
|
1498
|
-
versionId: z$1.ZodString;
|
|
1499
|
-
}, z$1.core.$strip>;
|
|
1500
|
-
declare const listVersions: z$1.ZodObject<{
|
|
1501
|
-
datasetId: z$1.ZodString;
|
|
1502
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1503
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1504
|
-
}, z$1.core.$strip>;
|
|
1505
|
-
declare const getVersionRecords: z$1.ZodObject<{
|
|
1506
|
-
versionId: z$1.ZodString;
|
|
1507
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1508
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1509
|
-
}, z$1.core.$strip>;
|
|
1510
|
-
declare const createDatasetsDataLayer: (db: Kysely<Database>) => {
|
|
1511
|
-
createDataset: (params: z$1.infer<typeof createDataset>) => Promise<{
|
|
1512
|
-
name: string;
|
|
1513
|
-
id: string;
|
|
1514
|
-
createdAt: Date;
|
|
1515
|
-
updatedAt: Date;
|
|
1516
|
-
description: string | null;
|
|
1517
|
-
recordCount: number;
|
|
1518
|
-
latestVersionNumber: number;
|
|
1519
|
-
} | undefined>;
|
|
1520
|
-
updateDataset: (params: z$1.infer<typeof updateDataset>) => Promise<{
|
|
1521
|
-
name: string;
|
|
1522
|
-
id: string;
|
|
1523
|
-
createdAt: Date;
|
|
1524
|
-
updatedAt: Date;
|
|
1525
|
-
description: string | null;
|
|
1526
|
-
recordCount: number;
|
|
1527
|
-
latestVersionNumber: number;
|
|
1528
|
-
} | undefined>;
|
|
1529
|
-
getDatasetById: (params: z$1.infer<typeof getDatasetById>) => Promise<{
|
|
1530
|
-
name: string;
|
|
1531
|
-
id: string;
|
|
1532
|
-
createdAt: Date;
|
|
1533
|
-
updatedAt: Date;
|
|
1534
|
-
description: string | null;
|
|
1535
|
-
recordCount: number;
|
|
1536
|
-
latestVersionNumber: number;
|
|
1537
|
-
} | undefined>;
|
|
1538
|
-
deleteDataset: (params: z$1.infer<typeof deleteDataset>) => Promise<{
|
|
1539
|
-
name: string;
|
|
1540
|
-
id: string;
|
|
1541
|
-
createdAt: Date;
|
|
1542
|
-
updatedAt: Date;
|
|
1543
|
-
description: string | null;
|
|
1544
|
-
recordCount: number;
|
|
1545
|
-
latestVersionNumber: number;
|
|
1546
|
-
} | undefined>;
|
|
1547
|
-
listDatasets: (params?: z$1.infer<typeof listDatasets>) => Promise<{
|
|
1548
|
-
name: string;
|
|
1549
|
-
id: string;
|
|
1550
|
-
createdAt: Date;
|
|
1551
|
-
updatedAt: Date;
|
|
1552
|
-
description: string | null;
|
|
1553
|
-
recordCount: number;
|
|
1554
|
-
latestVersionNumber: number;
|
|
1555
|
-
}[]>;
|
|
1556
|
-
countDatasets: () => Promise<number>;
|
|
1557
|
-
createRecord: (params: z$1.infer<typeof createRecord>) => Promise<{
|
|
1558
|
-
id: string;
|
|
1559
|
-
createdAt: Date;
|
|
1560
|
-
updatedAt: Date;
|
|
1561
|
-
input: Record<string, unknown>;
|
|
1562
|
-
datasetId: string;
|
|
1563
|
-
expected: Record<string, unknown> | null;
|
|
1564
|
-
metadata: Record<string, unknown>;
|
|
1565
|
-
} | undefined>;
|
|
1566
|
-
updateRecord: (params: z$1.infer<typeof updateRecord>) => Promise<{
|
|
1567
|
-
id: string;
|
|
1568
|
-
createdAt: Date;
|
|
1569
|
-
updatedAt: Date;
|
|
1570
|
-
input: Record<string, unknown>;
|
|
1571
|
-
datasetId: string;
|
|
1572
|
-
expected: Record<string, unknown> | null;
|
|
1573
|
-
metadata: Record<string, unknown>;
|
|
1574
|
-
} | undefined>;
|
|
1575
|
-
deleteRecord: (params: z$1.infer<typeof deleteRecord>) => Promise<{
|
|
1576
|
-
id: string;
|
|
1577
|
-
createdAt: Date;
|
|
1578
|
-
updatedAt: Date;
|
|
1579
|
-
input: Record<string, unknown>;
|
|
1580
|
-
datasetId: string;
|
|
1581
|
-
expected: Record<string, unknown> | null;
|
|
1582
|
-
metadata: Record<string, unknown>;
|
|
1583
|
-
} | undefined>;
|
|
1584
|
-
listRecords: (params: z$1.infer<typeof listRecords>) => Promise<{
|
|
1585
|
-
id: string;
|
|
1586
|
-
createdAt: Date;
|
|
1587
|
-
updatedAt: Date;
|
|
1588
|
-
input: Record<string, unknown>;
|
|
1589
|
-
datasetId: string;
|
|
1590
|
-
expected: Record<string, unknown> | null;
|
|
1591
|
-
metadata: Record<string, unknown>;
|
|
1592
|
-
}[]>;
|
|
1593
|
-
getRecordById: (recordId: string) => Promise<{
|
|
1594
|
-
id: string;
|
|
1595
|
-
createdAt: Date;
|
|
1596
|
-
updatedAt: Date;
|
|
1597
|
-
input: Record<string, unknown>;
|
|
1598
|
-
datasetId: string;
|
|
1599
|
-
expected: Record<string, unknown> | null;
|
|
1600
|
-
metadata: Record<string, unknown>;
|
|
1601
|
-
} | undefined>;
|
|
1602
|
-
createVersion: (params: z$1.infer<typeof createVersion>) => Promise<{
|
|
1603
|
-
name: string | null;
|
|
1604
|
-
id: string;
|
|
1605
|
-
createdAt: Date;
|
|
1606
|
-
updatedAt: Date;
|
|
1607
|
-
datasetId: string;
|
|
1608
|
-
description: string | null;
|
|
1609
|
-
recordCount: number;
|
|
1610
|
-
versionNumber: number;
|
|
1611
|
-
snapshotHash: string;
|
|
1612
|
-
} | undefined>;
|
|
1613
|
-
getVersionById: (params: z$1.infer<typeof getVersionById>) => Promise<{
|
|
1614
|
-
name: string | null;
|
|
1615
|
-
id: string;
|
|
1616
|
-
createdAt: Date;
|
|
1617
|
-
updatedAt: Date;
|
|
1618
|
-
datasetId: string;
|
|
1619
|
-
description: string | null;
|
|
1620
|
-
recordCount: number;
|
|
1621
|
-
versionNumber: number;
|
|
1622
|
-
snapshotHash: string;
|
|
1623
|
-
} | undefined>;
|
|
1624
|
-
listVersions: (params: z$1.infer<typeof listVersions>) => Promise<{
|
|
1625
|
-
name: string | null;
|
|
1626
|
-
id: string;
|
|
1627
|
-
createdAt: Date;
|
|
1628
|
-
updatedAt: Date;
|
|
1629
|
-
datasetId: string;
|
|
1630
|
-
description: string | null;
|
|
1631
|
-
recordCount: number;
|
|
1632
|
-
versionNumber: number;
|
|
1633
|
-
snapshotHash: string;
|
|
1634
|
-
}[]>;
|
|
1635
|
-
getVersionRecords: (params: z$1.infer<typeof getVersionRecords>) => Promise<{
|
|
1636
|
-
id: string;
|
|
1637
|
-
createdAt: Date;
|
|
1638
|
-
updatedAt: Date;
|
|
1639
|
-
input: Record<string, unknown>;
|
|
1640
|
-
datasetId: string;
|
|
1641
|
-
expected: Record<string, unknown> | null;
|
|
1642
|
-
metadata: Record<string, unknown>;
|
|
1643
|
-
position: number;
|
|
1644
|
-
}[]>;
|
|
1645
|
-
};
|
|
1646
|
-
//#endregion
|
|
1647
|
-
//#region src/datalayer/environments.d.ts
|
|
1648
|
-
declare const createNewEnvironment: z$1.ZodObject<{
|
|
1649
|
-
name: z$1.ZodString;
|
|
1650
|
-
slug: z$1.ZodString;
|
|
1651
|
-
isProd: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
1652
|
-
}, z$1.core.$strip>;
|
|
1653
|
-
declare const updateEnvironment: z$1.ZodObject<{
|
|
1654
|
-
environmentId: z$1.ZodUUID;
|
|
1655
|
-
name: z$1.ZodOptional<z$1.ZodString>;
|
|
1656
|
-
slug: z$1.ZodOptional<z$1.ZodString>;
|
|
1657
|
-
}, z$1.core.$strip>;
|
|
1658
|
-
declare const getEnvironmentById: z$1.ZodObject<{
|
|
1659
|
-
environmentId: z$1.ZodUUID;
|
|
1660
|
-
}, z$1.core.$strip>;
|
|
1661
|
-
declare const getEnvironmentBySlug: z$1.ZodObject<{
|
|
1662
|
-
slug: z$1.ZodString;
|
|
1663
|
-
}, z$1.core.$strip>;
|
|
1664
|
-
declare const deleteEnvironment: z$1.ZodObject<{
|
|
1665
|
-
environmentId: z$1.ZodUUID;
|
|
1666
|
-
}, z$1.core.$strip>;
|
|
1667
|
-
declare const listEnvironments: z$1.ZodObject<{
|
|
1668
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1669
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1670
|
-
}, z$1.core.$strip>;
|
|
1671
|
-
declare const createEnvironmentDataLayer: (db: Kysely<Database>) => {
|
|
1672
|
-
createNewEnvironment: (params: z$1.infer<typeof createNewEnvironment>) => Promise<{
|
|
1673
|
-
slug: string;
|
|
1674
|
-
name: string;
|
|
1675
|
-
id: string;
|
|
1676
|
-
createdAt: Date;
|
|
1677
|
-
updatedAt: Date;
|
|
1678
|
-
isProd: boolean;
|
|
1679
|
-
} | undefined>;
|
|
1680
|
-
updateEnvironment: (params: z$1.infer<typeof updateEnvironment>) => Promise<{
|
|
1681
|
-
slug: string;
|
|
1682
|
-
name: string;
|
|
1683
|
-
id: string;
|
|
1684
|
-
createdAt: Date;
|
|
1685
|
-
updatedAt: Date;
|
|
1686
|
-
isProd: boolean;
|
|
1687
|
-
} | undefined>;
|
|
1688
|
-
getEnvironmentById: (params: z$1.infer<typeof getEnvironmentById>) => Promise<{
|
|
1689
|
-
slug: string;
|
|
1690
|
-
name: string;
|
|
1691
|
-
id: string;
|
|
1692
|
-
createdAt: Date;
|
|
1693
|
-
updatedAt: Date;
|
|
1694
|
-
isProd: boolean;
|
|
1695
|
-
} | undefined>;
|
|
1696
|
-
getEnvironmentBySlug: (params: z$1.infer<typeof getEnvironmentBySlug>) => Promise<{
|
|
1697
|
-
slug: string;
|
|
1698
|
-
name: string;
|
|
1699
|
-
id: string;
|
|
1700
|
-
createdAt: Date;
|
|
1701
|
-
updatedAt: Date;
|
|
1702
|
-
isProd: boolean;
|
|
1703
|
-
} | undefined>;
|
|
1704
|
-
deleteEnvironment: (params: z$1.infer<typeof deleteEnvironment>) => Promise<{
|
|
1705
|
-
slug: string;
|
|
1706
|
-
name: string;
|
|
1707
|
-
id: string;
|
|
1708
|
-
createdAt: Date;
|
|
1709
|
-
updatedAt: Date;
|
|
1710
|
-
isProd: boolean;
|
|
1711
|
-
} | undefined>;
|
|
1712
|
-
listEnvironments: (params?: z$1.infer<typeof listEnvironments>) => Promise<{
|
|
1713
|
-
slug: string;
|
|
1714
|
-
name: string;
|
|
1715
|
-
id: string;
|
|
1716
|
-
createdAt: Date;
|
|
1717
|
-
updatedAt: Date;
|
|
1718
|
-
isProd: boolean;
|
|
1719
|
-
}[]>;
|
|
1720
|
-
countEnvironments: () => Promise<number>;
|
|
1721
|
-
};
|
|
1722
|
-
//#endregion
|
|
1723
|
-
//#region src/datalayer/environmentSecrets.d.ts
|
|
1724
|
-
declare const createEnvironmentSecret: z$1.ZodObject<{
|
|
1725
|
-
environmentId: z$1.ZodUUID;
|
|
1726
|
-
keyName: z$1.ZodString;
|
|
1727
|
-
keyValue: z$1.ZodString;
|
|
1728
|
-
}, z$1.core.$strip>;
|
|
1729
|
-
declare const updateEnvironmentSecret: z$1.ZodObject<{
|
|
1730
|
-
secretId: z$1.ZodUUID;
|
|
1731
|
-
keyName: z$1.ZodOptional<z$1.ZodString>;
|
|
1732
|
-
keyValue: z$1.ZodOptional<z$1.ZodString>;
|
|
1733
|
-
}, z$1.core.$strip>;
|
|
1734
|
-
declare const getEnvironmentSecretById: z$1.ZodObject<{
|
|
1735
|
-
secretId: z$1.ZodUUID;
|
|
1736
|
-
}, z$1.core.$strip>;
|
|
1737
|
-
declare const getSecretsByEnvironmentId: z$1.ZodObject<{
|
|
1738
|
-
environmentId: z$1.ZodUUID;
|
|
1739
|
-
}, z$1.core.$strip>;
|
|
1740
|
-
declare const deleteEnvironmentSecret: z$1.ZodObject<{
|
|
1741
|
-
secretId: z$1.ZodUUID;
|
|
1742
|
-
}, z$1.core.$strip>;
|
|
1743
|
-
declare const deleteSecretsByEnvironmentId: z$1.ZodObject<{
|
|
1744
|
-
environmentId: z$1.ZodUUID;
|
|
1745
|
-
}, z$1.core.$strip>;
|
|
1746
|
-
declare const listEnvironmentSecrets: z$1.ZodObject<{
|
|
1747
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1748
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1749
|
-
}, z$1.core.$strip>;
|
|
1750
|
-
declare const createEnvironmentSecretDataLayer: (db: Kysely<Database>) => {
|
|
1751
|
-
createEnvironmentSecret: (params: z$1.infer<typeof createEnvironmentSecret>) => Promise<{
|
|
1752
|
-
id: string;
|
|
1753
|
-
createdAt: Date;
|
|
1754
|
-
updatedAt: Date;
|
|
1755
|
-
environmentId: string;
|
|
1756
|
-
keyName: string;
|
|
1757
|
-
keyValue: string;
|
|
1758
|
-
} | undefined>;
|
|
1759
|
-
updateEnvironmentSecret: (params: z$1.infer<typeof updateEnvironmentSecret>) => Promise<{
|
|
1760
|
-
id: string;
|
|
1761
|
-
createdAt: Date;
|
|
1762
|
-
updatedAt: Date;
|
|
1763
|
-
environmentId: string;
|
|
1764
|
-
keyName: string;
|
|
1765
|
-
keyValue: string;
|
|
1766
|
-
} | undefined>;
|
|
1767
|
-
getEnvironmentSecretById: (params: z$1.infer<typeof getEnvironmentSecretById>) => Promise<{
|
|
1768
|
-
id: string;
|
|
1769
|
-
createdAt: Date;
|
|
1770
|
-
updatedAt: Date;
|
|
1771
|
-
environmentId: string;
|
|
1772
|
-
keyName: string;
|
|
1773
|
-
keyValue: string;
|
|
1774
|
-
} | undefined>;
|
|
1775
|
-
getSecretsByEnvironmentId: (params: z$1.infer<typeof getSecretsByEnvironmentId>) => Promise<{
|
|
1776
|
-
id: string;
|
|
1777
|
-
createdAt: Date;
|
|
1778
|
-
updatedAt: Date;
|
|
1779
|
-
environmentId: string;
|
|
1780
|
-
keyName: string;
|
|
1781
|
-
keyValue: string;
|
|
1782
|
-
}[]>;
|
|
1783
|
-
deleteEnvironmentSecret: (params: z$1.infer<typeof deleteEnvironmentSecret>) => Promise<{
|
|
1784
|
-
id: string;
|
|
1785
|
-
createdAt: Date;
|
|
1786
|
-
updatedAt: Date;
|
|
1787
|
-
environmentId: string;
|
|
1788
|
-
keyName: string;
|
|
1789
|
-
keyValue: string;
|
|
1790
|
-
} | undefined>;
|
|
1791
|
-
deleteSecretsByEnvironmentId: (params: z$1.infer<typeof deleteSecretsByEnvironmentId>) => Promise<{
|
|
1792
|
-
id: string;
|
|
1793
|
-
createdAt: Date;
|
|
1794
|
-
updatedAt: Date;
|
|
1795
|
-
environmentId: string;
|
|
1796
|
-
keyName: string;
|
|
1797
|
-
keyValue: string;
|
|
1798
|
-
}[]>;
|
|
1799
|
-
listEnvironmentSecrets: (params?: z$1.infer<typeof listEnvironmentSecrets>) => Promise<{
|
|
1800
|
-
id: string;
|
|
1801
|
-
createdAt: Date;
|
|
1802
|
-
updatedAt: Date;
|
|
1803
|
-
environmentId: string;
|
|
1804
|
-
keyName: string;
|
|
1805
|
-
keyValue: string;
|
|
1806
|
-
}[]>;
|
|
1807
|
-
countEnvironmentSecrets: () => Promise<number>;
|
|
1808
|
-
};
|
|
1809
|
-
//#endregion
|
|
1810
|
-
//#region src/datalayer/guardrailConfigs.d.ts
|
|
1811
|
-
declare const createGuardrailConfig: z$1.ZodObject<{
|
|
1812
|
-
name: z$1.ZodString;
|
|
1813
|
-
pluginId: z$1.ZodString;
|
|
1814
|
-
functionId: z$1.ZodString;
|
|
1815
|
-
hookType: z$1.ZodEnum<{
|
|
1816
|
-
beforeRequestHook: "beforeRequestHook";
|
|
1817
|
-
afterRequestHook: "afterRequestHook";
|
|
1818
|
-
}>;
|
|
1819
|
-
parameters: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1820
|
-
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
1821
|
-
priority: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
1822
|
-
onFail: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
1823
|
-
block: "block";
|
|
1824
|
-
log: "log";
|
|
1825
|
-
}>>>;
|
|
1826
|
-
}, z$1.core.$strip>;
|
|
1827
|
-
declare const updateGuardrailConfig: z$1.ZodObject<{
|
|
1828
|
-
id: z$1.ZodString;
|
|
1829
|
-
name: z$1.ZodOptional<z$1.ZodString>;
|
|
1830
|
-
hookType: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1831
|
-
beforeRequestHook: "beforeRequestHook";
|
|
1832
|
-
afterRequestHook: "afterRequestHook";
|
|
1833
|
-
}>>;
|
|
1834
|
-
parameters: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1835
|
-
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1836
|
-
priority: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1837
|
-
onFail: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1838
|
-
block: "block";
|
|
1839
|
-
log: "log";
|
|
1840
|
-
}>>;
|
|
1841
|
-
}, z$1.core.$strip>;
|
|
1842
|
-
declare const getGuardrailConfigById: z$1.ZodObject<{
|
|
1843
|
-
id: z$1.ZodString;
|
|
1844
|
-
}, z$1.core.$strip>;
|
|
1845
|
-
declare const deleteGuardrailConfig: z$1.ZodObject<{
|
|
1846
|
-
id: z$1.ZodString;
|
|
1847
|
-
}, z$1.core.$strip>;
|
|
1848
|
-
declare const listGuardrailConfigs: z$1.ZodObject<{
|
|
1849
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1850
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1851
|
-
hookType: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1852
|
-
beforeRequestHook: "beforeRequestHook";
|
|
1853
|
-
afterRequestHook: "afterRequestHook";
|
|
1854
|
-
}>>;
|
|
1855
|
-
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1856
|
-
}, z$1.core.$strip>;
|
|
1857
|
-
declare const createGuardrailConfigsDataLayer: (db: Kysely<Database>) => {
|
|
1858
|
-
createGuardrailConfig: (params: z$1.infer<typeof createGuardrailConfig>) => Promise<{
|
|
1859
|
-
name: string;
|
|
1860
|
-
id: string;
|
|
1861
|
-
createdAt: Date;
|
|
1862
|
-
updatedAt: Date;
|
|
1863
|
-
priority: number;
|
|
1864
|
-
enabled: boolean;
|
|
1865
|
-
pluginId: string;
|
|
1866
|
-
functionId: string;
|
|
1867
|
-
hookType: string;
|
|
1868
|
-
parameters: Record<string, unknown>;
|
|
1869
|
-
onFail: string;
|
|
1870
|
-
} | undefined>;
|
|
1871
|
-
updateGuardrailConfig: (params: z$1.infer<typeof updateGuardrailConfig>) => Promise<{
|
|
1872
|
-
name: string;
|
|
1873
|
-
id: string;
|
|
1874
|
-
createdAt: Date;
|
|
1875
|
-
updatedAt: Date;
|
|
1876
|
-
priority: number;
|
|
1877
|
-
enabled: boolean;
|
|
1878
|
-
pluginId: string;
|
|
1879
|
-
functionId: string;
|
|
1880
|
-
hookType: string;
|
|
1881
|
-
parameters: Record<string, unknown>;
|
|
1882
|
-
onFail: string;
|
|
1883
|
-
} | undefined>;
|
|
1884
|
-
getGuardrailConfigById: (params: z$1.infer<typeof getGuardrailConfigById>) => Promise<{
|
|
1885
|
-
name: string;
|
|
1886
|
-
id: string;
|
|
1887
|
-
createdAt: Date;
|
|
1888
|
-
updatedAt: Date;
|
|
1889
|
-
priority: number;
|
|
1890
|
-
enabled: boolean;
|
|
1891
|
-
pluginId: string;
|
|
1892
|
-
functionId: string;
|
|
1893
|
-
hookType: string;
|
|
1894
|
-
parameters: Record<string, unknown>;
|
|
1895
|
-
onFail: string;
|
|
1896
|
-
} | undefined>;
|
|
1897
|
-
deleteGuardrailConfig: (params: z$1.infer<typeof deleteGuardrailConfig>) => Promise<{
|
|
1898
|
-
name: string;
|
|
1899
|
-
id: string;
|
|
1900
|
-
createdAt: Date;
|
|
1901
|
-
updatedAt: Date;
|
|
1902
|
-
priority: number;
|
|
1903
|
-
enabled: boolean;
|
|
1904
|
-
pluginId: string;
|
|
1905
|
-
functionId: string;
|
|
1906
|
-
hookType: string;
|
|
1907
|
-
parameters: Record<string, unknown>;
|
|
1908
|
-
onFail: string;
|
|
1909
|
-
} | undefined>;
|
|
1910
|
-
listGuardrailConfigs: (params?: z$1.infer<typeof listGuardrailConfigs>) => Promise<{
|
|
1911
|
-
name: string;
|
|
1912
|
-
id: string;
|
|
1913
|
-
createdAt: Date;
|
|
1914
|
-
updatedAt: Date;
|
|
1915
|
-
priority: number;
|
|
1916
|
-
enabled: boolean;
|
|
1917
|
-
pluginId: string;
|
|
1918
|
-
functionId: string;
|
|
1919
|
-
hookType: string;
|
|
1920
|
-
parameters: Record<string, unknown>;
|
|
1921
|
-
onFail: string;
|
|
1922
|
-
}[]>;
|
|
1923
|
-
countGuardrailConfigs: () => Promise<number>;
|
|
1924
|
-
/**
|
|
1925
|
-
* Get all enabled guardrails for a specific hook type
|
|
1926
|
-
* Ordered by priority (highest first)
|
|
1927
|
-
*/
|
|
1928
|
-
getEnabledGuardrailsByHookType: (hookType: "beforeRequestHook" | "afterRequestHook") => Promise<{
|
|
1929
|
-
name: string;
|
|
1930
|
-
id: string;
|
|
1931
|
-
createdAt: Date;
|
|
1932
|
-
updatedAt: Date;
|
|
1933
|
-
priority: number;
|
|
1934
|
-
enabled: boolean;
|
|
1935
|
-
pluginId: string;
|
|
1936
|
-
functionId: string;
|
|
1937
|
-
hookType: string;
|
|
1938
|
-
parameters: Record<string, unknown>;
|
|
1939
|
-
onFail: string;
|
|
1940
|
-
}[]>;
|
|
1941
|
-
};
|
|
1942
|
-
//#endregion
|
|
1943
|
-
//#region src/datalayer/llmRequests.d.ts
|
|
1944
|
-
/**
|
|
1945
|
-
* Schema for inserting a new LLM request log
|
|
1946
|
-
*/
|
|
1947
|
-
declare const insertLLMRequestSchema: z$1.ZodObject<{
|
|
1948
|
-
requestId: z$1.ZodString;
|
|
1949
|
-
configId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1950
|
-
variantId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1951
|
-
environmentId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1952
|
-
providerConfigId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1953
|
-
provider: z$1.ZodString;
|
|
1954
|
-
model: z$1.ZodString;
|
|
1955
|
-
promptTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1956
|
-
completionTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1957
|
-
totalTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1958
|
-
cachedTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1959
|
-
cacheCreationTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1960
|
-
cost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1961
|
-
cacheSavings: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1962
|
-
inputCost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1963
|
-
outputCost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1964
|
-
endpoint: z$1.ZodString;
|
|
1965
|
-
statusCode: z$1.ZodNumber;
|
|
1966
|
-
latencyMs: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1967
|
-
isStreaming: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1968
|
-
userId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1969
|
-
tags: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
1970
|
-
guardrailResults: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodObject<{
|
|
1971
|
-
results: z$1.ZodArray<z$1.ZodObject<{
|
|
1972
|
-
checkId: z$1.ZodString;
|
|
1973
|
-
functionId: z$1.ZodString;
|
|
1974
|
-
hookType: z$1.ZodEnum<{
|
|
1975
|
-
beforeRequestHook: "beforeRequestHook";
|
|
1976
|
-
afterRequestHook: "afterRequestHook";
|
|
1977
|
-
}>;
|
|
1978
|
-
verdict: z$1.ZodBoolean;
|
|
1979
|
-
latencyMs: z$1.ZodNumber;
|
|
1980
|
-
}, z$1.core.$strip>>;
|
|
1981
|
-
action: z$1.ZodEnum<{
|
|
1982
|
-
allowed: "allowed";
|
|
1983
|
-
blocked: "blocked";
|
|
1984
|
-
logged: "logged";
|
|
1985
|
-
}>;
|
|
1986
|
-
totalLatencyMs: z$1.ZodNumber;
|
|
1987
|
-
}, z$1.core.$strip>>>;
|
|
1988
|
-
traceId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1989
|
-
spanId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1990
|
-
parentSpanId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1991
|
-
sessionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1992
|
-
}, z$1.core.$strip>;
|
|
1993
|
-
type LLMRequestInsert = z$1.infer<typeof insertLLMRequestSchema>;
|
|
1994
|
-
/**
|
|
1995
|
-
* Schema for listing LLM requests
|
|
1996
|
-
*/
|
|
1997
|
-
declare const listRequestsSchema: z$1.ZodObject<{
|
|
1998
|
-
limit: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1999
|
-
offset: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2000
|
-
configId: z$1.ZodOptional<z$1.ZodString>;
|
|
2001
|
-
variantId: z$1.ZodOptional<z$1.ZodString>;
|
|
2002
|
-
environmentId: z$1.ZodOptional<z$1.ZodString>;
|
|
2003
|
-
providerConfigId: z$1.ZodOptional<z$1.ZodString>;
|
|
2004
|
-
provider: z$1.ZodOptional<z$1.ZodString>;
|
|
2005
|
-
model: z$1.ZodOptional<z$1.ZodString>;
|
|
2006
|
-
startDate: z$1.ZodOptional<z$1.ZodDate>;
|
|
2007
|
-
endDate: z$1.ZodOptional<z$1.ZodDate>;
|
|
2008
|
-
tags: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
|
|
2009
|
-
}, z$1.core.$strip>;
|
|
2010
|
-
/**
|
|
2011
|
-
* Schema for date range queries with optional filters
|
|
2012
|
-
*/
|
|
2013
|
-
declare const dateRangeSchema: z$1.ZodObject<{
|
|
2014
|
-
startDate: z$1.ZodDate;
|
|
2015
|
-
endDate: z$1.ZodDate;
|
|
2016
|
-
configId: z$1.ZodOptional<z$1.ZodString>;
|
|
2017
|
-
variantId: z$1.ZodOptional<z$1.ZodString>;
|
|
2018
|
-
environmentId: z$1.ZodOptional<z$1.ZodString>;
|
|
2019
|
-
tags: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
|
|
2020
|
-
}, z$1.core.$strip>;
|
|
2021
|
-
/**
|
|
2022
|
-
* Valid groupBy values for cost summary queries
|
|
2023
|
-
*/
|
|
2024
|
-
declare const COST_SUMMARY_GROUP_BY: readonly ["day", "hour", "model", "provider", "config", "endpoint", "tags"];
|
|
2025
|
-
type CostSummaryGroupBy = (typeof COST_SUMMARY_GROUP_BY)[number];
|
|
2026
|
-
/**
|
|
2027
|
-
* Schema for cost summary with grouping
|
|
2028
|
-
*/
|
|
2029
|
-
declare const costSummarySchema: z$1.ZodObject<{
|
|
2030
|
-
startDate: z$1.ZodDate;
|
|
2031
|
-
endDate: z$1.ZodDate;
|
|
2032
|
-
configId: z$1.ZodOptional<z$1.ZodString>;
|
|
2033
|
-
variantId: z$1.ZodOptional<z$1.ZodString>;
|
|
2034
|
-
environmentId: z$1.ZodOptional<z$1.ZodString>;
|
|
2035
|
-
tags: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
|
|
2036
|
-
groupBy: z$1.ZodOptional<z$1.ZodEnum<{
|
|
2037
|
-
provider: "provider";
|
|
2038
|
-
config: "config";
|
|
2039
|
-
model: "model";
|
|
2040
|
-
endpoint: "endpoint";
|
|
2041
|
-
tags: "tags";
|
|
2042
|
-
day: "day";
|
|
2043
|
-
hour: "hour";
|
|
2044
|
-
}>>;
|
|
2045
|
-
tagKeys: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
2046
|
-
}, z$1.core.$strip>;
|
|
2047
|
-
declare const createLLMRequestsDataLayer: (db: Kysely<Database>) => {
|
|
2048
|
-
/**
|
|
2049
|
-
* Batch insert LLM request logs
|
|
2050
|
-
* Used by the BatchWriter service for efficient writes
|
|
2051
|
-
*/
|
|
2052
|
-
batchInsertRequests: (requests: LLMRequestInsert[]) => Promise<{
|
|
2053
|
-
count: number;
|
|
2054
|
-
}>;
|
|
2055
|
-
/**
|
|
2056
|
-
* Insert a single LLM request log
|
|
2057
|
-
*/
|
|
2058
|
-
insertRequest: (request: LLMRequestInsert) => Promise<{
|
|
2059
|
-
id: string;
|
|
2060
|
-
createdAt: Date;
|
|
2061
|
-
updatedAt: Date;
|
|
2062
|
-
variantId: string | null;
|
|
2063
|
-
provider: string;
|
|
2064
|
-
environmentId: string | null;
|
|
2065
|
-
configId: string | null;
|
|
2066
|
-
providerConfigId: string | null;
|
|
2067
|
-
latencyMs: number;
|
|
2068
|
-
promptTokens: number;
|
|
2069
|
-
completionTokens: number;
|
|
2070
|
-
totalTokens: number;
|
|
2071
|
-
cost: number;
|
|
2072
|
-
requestId: string;
|
|
2073
|
-
model: string;
|
|
2074
|
-
cachedTokens: number;
|
|
2075
|
-
cacheCreationTokens: number;
|
|
2076
|
-
cacheSavings: number;
|
|
2077
|
-
inputCost: number;
|
|
2078
|
-
outputCost: number;
|
|
2079
|
-
endpoint: string;
|
|
2080
|
-
statusCode: number;
|
|
2081
|
-
isStreaming: boolean;
|
|
2082
|
-
userId: string | null;
|
|
2083
|
-
tags: Record<string, string>;
|
|
2084
|
-
guardrailResults: {
|
|
2085
|
-
results: {
|
|
2086
|
-
checkId: string;
|
|
2087
|
-
functionId: string;
|
|
2088
|
-
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
2089
|
-
verdict: boolean;
|
|
2090
|
-
latencyMs: number;
|
|
2091
|
-
}[];
|
|
2092
|
-
action: "allowed" | "blocked" | "logged";
|
|
2093
|
-
totalLatencyMs: number;
|
|
2094
|
-
} | null;
|
|
2095
|
-
traceId: string | null;
|
|
2096
|
-
spanId: string | null;
|
|
2097
|
-
parentSpanId: string | null;
|
|
2098
|
-
sessionId: string | null;
|
|
2099
|
-
} | undefined>;
|
|
2100
|
-
/**
|
|
2101
|
-
* List LLM requests with filtering and pagination
|
|
2102
|
-
* Returns data and total count for pagination
|
|
2103
|
-
*/
|
|
2104
|
-
listRequests: (params?: z$1.infer<typeof listRequestsSchema>) => Promise<{
|
|
2105
|
-
data: {
|
|
2106
|
-
id: string;
|
|
2107
|
-
createdAt: Date;
|
|
2108
|
-
updatedAt: Date;
|
|
2109
|
-
variantId: string | null;
|
|
2110
|
-
provider: string;
|
|
2111
|
-
environmentId: string | null;
|
|
2112
|
-
configId: string | null;
|
|
2113
|
-
providerConfigId: string | null;
|
|
2114
|
-
latencyMs: number;
|
|
2115
|
-
promptTokens: number;
|
|
2116
|
-
completionTokens: number;
|
|
2117
|
-
totalTokens: number;
|
|
2118
|
-
cost: number;
|
|
2119
|
-
requestId: string;
|
|
2120
|
-
model: string;
|
|
2121
|
-
cachedTokens: number;
|
|
2122
|
-
cacheCreationTokens: number;
|
|
2123
|
-
cacheSavings: number;
|
|
2124
|
-
inputCost: number;
|
|
2125
|
-
outputCost: number;
|
|
2126
|
-
endpoint: string;
|
|
2127
|
-
statusCode: number;
|
|
2128
|
-
isStreaming: boolean;
|
|
2129
|
-
userId: string | null;
|
|
2130
|
-
tags: Record<string, string>;
|
|
2131
|
-
guardrailResults: {
|
|
2132
|
-
results: {
|
|
2133
|
-
checkId: string;
|
|
2134
|
-
functionId: string;
|
|
2135
|
-
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
2136
|
-
verdict: boolean;
|
|
2137
|
-
latencyMs: number;
|
|
2138
|
-
}[];
|
|
2139
|
-
action: "allowed" | "blocked" | "logged";
|
|
2140
|
-
totalLatencyMs: number;
|
|
2141
|
-
} | null;
|
|
2142
|
-
traceId: string | null;
|
|
2143
|
-
spanId: string | null;
|
|
2144
|
-
parentSpanId: string | null;
|
|
2145
|
-
sessionId: string | null;
|
|
2146
|
-
}[];
|
|
2147
|
-
total: number;
|
|
2148
|
-
limit: number;
|
|
2149
|
-
offset: number;
|
|
2150
|
-
}>;
|
|
2151
|
-
/**
|
|
2152
|
-
* Get a single request by requestId
|
|
2153
|
-
*/
|
|
2154
|
-
getRequestByRequestId: (requestId: string) => Promise<{
|
|
2155
|
-
id: string;
|
|
2156
|
-
createdAt: Date;
|
|
2157
|
-
updatedAt: Date;
|
|
2158
|
-
variantId: string | null;
|
|
2159
|
-
provider: string;
|
|
2160
|
-
environmentId: string | null;
|
|
2161
|
-
configId: string | null;
|
|
2162
|
-
providerConfigId: string | null;
|
|
2163
|
-
latencyMs: number;
|
|
2164
|
-
promptTokens: number;
|
|
2165
|
-
completionTokens: number;
|
|
2166
|
-
totalTokens: number;
|
|
2167
|
-
cost: number;
|
|
2168
|
-
requestId: string;
|
|
2169
|
-
model: string;
|
|
2170
|
-
cachedTokens: number;
|
|
2171
|
-
cacheCreationTokens: number;
|
|
2172
|
-
cacheSavings: number;
|
|
2173
|
-
inputCost: number;
|
|
2174
|
-
outputCost: number;
|
|
2175
|
-
endpoint: string;
|
|
2176
|
-
statusCode: number;
|
|
2177
|
-
isStreaming: boolean;
|
|
2178
|
-
userId: string | null;
|
|
2179
|
-
tags: Record<string, string>;
|
|
2180
|
-
guardrailResults: {
|
|
2181
|
-
results: {
|
|
2182
|
-
checkId: string;
|
|
2183
|
-
functionId: string;
|
|
2184
|
-
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
2185
|
-
verdict: boolean;
|
|
2186
|
-
latencyMs: number;
|
|
2187
|
-
}[];
|
|
2188
|
-
action: "allowed" | "blocked" | "logged";
|
|
2189
|
-
totalLatencyMs: number;
|
|
2190
|
-
} | null;
|
|
2191
|
-
traceId: string | null;
|
|
2192
|
-
spanId: string | null;
|
|
2193
|
-
parentSpanId: string | null;
|
|
2194
|
-
sessionId: string | null;
|
|
2195
|
-
} | undefined>;
|
|
2196
|
-
/**
|
|
2197
|
-
* Get total cost for a date range with optional filters
|
|
2198
|
-
*/
|
|
2199
|
-
getTotalCost: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
2200
|
-
totalCost: number;
|
|
2201
|
-
totalInputCost: number;
|
|
2202
|
-
totalOutputCost: number;
|
|
2203
|
-
totalPromptTokens: number;
|
|
2204
|
-
totalCompletionTokens: number;
|
|
2205
|
-
totalTokens: number;
|
|
2206
|
-
totalCachedTokens: number;
|
|
2207
|
-
totalCacheSavings: number;
|
|
2208
|
-
requestCount: number;
|
|
2209
|
-
} | undefined>;
|
|
2210
|
-
/**
|
|
2211
|
-
* Get cost breakdown by model
|
|
2212
|
-
*/
|
|
2213
|
-
getCostByModel: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
2214
|
-
provider: string;
|
|
2215
|
-
model: string;
|
|
2216
|
-
totalCost: number;
|
|
2217
|
-
totalInputCost: number;
|
|
2218
|
-
totalOutputCost: number;
|
|
2219
|
-
totalTokens: number;
|
|
2220
|
-
requestCount: number;
|
|
2221
|
-
avgLatencyMs: number;
|
|
2222
|
-
}[]>;
|
|
2223
|
-
/**
|
|
2224
|
-
* Get cost breakdown by provider
|
|
2225
|
-
*/
|
|
2226
|
-
getCostByProvider: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
2227
|
-
provider: string;
|
|
2228
|
-
totalCost: number;
|
|
2229
|
-
totalInputCost: number;
|
|
2230
|
-
totalOutputCost: number;
|
|
2231
|
-
totalTokens: number;
|
|
2232
|
-
requestCount: number;
|
|
2233
|
-
avgLatencyMs: number;
|
|
2234
|
-
}[]>;
|
|
2235
|
-
/**
|
|
2236
|
-
* Get cost breakdown by config
|
|
2237
|
-
*/
|
|
2238
|
-
getCostByConfig: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
2239
|
-
configName: string | null | undefined;
|
|
2240
|
-
configId: string | null;
|
|
2241
|
-
totalCost: number;
|
|
2242
|
-
totalInputCost: number;
|
|
2243
|
-
totalOutputCost: number;
|
|
2244
|
-
totalTokens: number;
|
|
2245
|
-
requestCount: number;
|
|
2246
|
-
configSlug: string | null;
|
|
2247
|
-
}[]>;
|
|
2248
|
-
/**
|
|
2249
|
-
* Get daily cost summary
|
|
2250
|
-
*/
|
|
2251
|
-
getDailyCosts: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
2252
|
-
totalCost: number;
|
|
2253
|
-
totalInputCost: number;
|
|
2254
|
-
totalOutputCost: number;
|
|
2255
|
-
totalTokens: number;
|
|
2256
|
-
requestCount: number;
|
|
2257
|
-
date: string;
|
|
2258
|
-
}[]>;
|
|
2259
|
-
/**
|
|
2260
|
-
* Get cost summary with flexible grouping and optional filters
|
|
2261
|
-
*/
|
|
2262
|
-
getCostSummary: (params: z$1.infer<typeof costSummarySchema>) => Promise<{
|
|
2263
|
-
totalCost: number;
|
|
2264
|
-
requestCount: number;
|
|
2265
|
-
groupKey: string;
|
|
2266
|
-
}[]>;
|
|
2267
|
-
/**
|
|
2268
|
-
* Get request count and stats for a time range with optional filters
|
|
2269
|
-
*/
|
|
2270
|
-
getRequestStats: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
2271
|
-
avgLatencyMs: number;
|
|
2272
|
-
totalRequests: number;
|
|
2273
|
-
successfulRequests: number;
|
|
2274
|
-
failedRequests: number;
|
|
2275
|
-
streamingRequests: number;
|
|
2276
|
-
maxLatencyMs: number;
|
|
2277
|
-
minLatencyMs: number;
|
|
2278
|
-
} | undefined>;
|
|
2279
|
-
/**
|
|
2280
|
-
* Get all distinct tag key-value pairs from llm_requests
|
|
2281
|
-
* Used for populating tag filter dropdowns in the UI
|
|
2282
|
-
*/
|
|
2283
|
-
getDistinctTags: () => Promise<{
|
|
2284
|
-
key: string;
|
|
2285
|
-
value: string;
|
|
2286
|
-
}[]>;
|
|
2287
|
-
};
|
|
2288
|
-
//#endregion
|
|
2289
|
-
//#region src/datalayer/playgrounds.d.ts
|
|
2290
|
-
declare const createNewPlayground: z$1.ZodObject<{
|
|
2291
|
-
name: z$1.ZodString;
|
|
2292
|
-
datasetId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2293
|
-
columns: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodObject<{
|
|
2294
|
-
id: z$1.ZodString;
|
|
2295
|
-
name: z$1.ZodString;
|
|
2296
|
-
position: z$1.ZodNumber;
|
|
2297
|
-
providerConfigId: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodNull]>;
|
|
2298
|
-
modelName: z$1.ZodString;
|
|
2299
|
-
messages: z$1.ZodArray<z$1.ZodObject<{
|
|
2300
|
-
role: z$1.ZodEnum<{
|
|
2301
|
-
system: "system";
|
|
2302
|
-
user: "user";
|
|
2303
|
-
assistant: "assistant";
|
|
2304
|
-
}>;
|
|
2305
|
-
content: z$1.ZodString;
|
|
2306
|
-
}, z$1.core.$strip>>;
|
|
2307
|
-
temperature: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2308
|
-
maxTokens: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2309
|
-
topP: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2310
|
-
frequencyPenalty: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2311
|
-
presencePenalty: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2312
|
-
configId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2313
|
-
variantId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2314
|
-
variantVersionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2315
|
-
}, z$1.core.$strip>>>>;
|
|
2316
|
-
}, z$1.core.$strip>;
|
|
2317
|
-
declare const updatePlayground: z$1.ZodObject<{
|
|
2318
|
-
playgroundId: z$1.ZodUUID;
|
|
2319
|
-
name: z$1.ZodOptional<z$1.ZodString>;
|
|
2320
|
-
datasetId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2321
|
-
columns: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodObject<{
|
|
2322
|
-
id: z$1.ZodString;
|
|
2323
|
-
name: z$1.ZodString;
|
|
2324
|
-
position: z$1.ZodNumber;
|
|
2325
|
-
providerConfigId: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodNull]>;
|
|
2326
|
-
modelName: z$1.ZodString;
|
|
2327
|
-
messages: z$1.ZodArray<z$1.ZodObject<{
|
|
2328
|
-
role: z$1.ZodEnum<{
|
|
2329
|
-
system: "system";
|
|
2330
|
-
user: "user";
|
|
2331
|
-
assistant: "assistant";
|
|
2332
|
-
}>;
|
|
2333
|
-
content: z$1.ZodString;
|
|
2334
|
-
}, z$1.core.$strip>>;
|
|
2335
|
-
temperature: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2336
|
-
maxTokens: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2337
|
-
topP: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2338
|
-
frequencyPenalty: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2339
|
-
presencePenalty: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2340
|
-
configId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2341
|
-
variantId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2342
|
-
variantVersionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2343
|
-
}, z$1.core.$strip>>>>;
|
|
2344
|
-
}, z$1.core.$strip>;
|
|
2345
|
-
declare const getPlaygroundById: z$1.ZodObject<{
|
|
2346
|
-
playgroundId: z$1.ZodUUID;
|
|
2347
|
-
}, z$1.core.$strip>;
|
|
2348
|
-
declare const deletePlayground: z$1.ZodObject<{
|
|
2349
|
-
playgroundId: z$1.ZodUUID;
|
|
2350
|
-
}, z$1.core.$strip>;
|
|
2351
|
-
declare const listPlaygrounds: z$1.ZodObject<{
|
|
2352
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2353
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2354
|
-
}, z$1.core.$strip>;
|
|
2355
|
-
declare const createPlaygroundDataLayer: (db: Kysely<Database>) => {
|
|
2356
|
-
createNewPlayground: (params: z$1.infer<typeof createNewPlayground>) => Promise<{
|
|
2357
|
-
name: string;
|
|
2358
|
-
id: string;
|
|
2359
|
-
createdAt: Date;
|
|
2360
|
-
updatedAt: Date;
|
|
2361
|
-
datasetId: string | null;
|
|
2362
|
-
columns: {
|
|
2363
|
-
id: string;
|
|
2364
|
-
name: string;
|
|
2365
|
-
position: number;
|
|
2366
|
-
providerConfigId: string | null;
|
|
2367
|
-
modelName: string;
|
|
2368
|
-
messages: {
|
|
2369
|
-
role: "system" | "user" | "assistant";
|
|
2370
|
-
content: string;
|
|
2371
|
-
}[];
|
|
2372
|
-
temperature?: number | null | undefined;
|
|
2373
|
-
maxTokens?: number | null | undefined;
|
|
2374
|
-
topP?: number | null | undefined;
|
|
2375
|
-
frequencyPenalty?: number | null | undefined;
|
|
2376
|
-
presencePenalty?: number | null | undefined;
|
|
2377
|
-
configId?: string | null | undefined;
|
|
2378
|
-
variantId?: string | null | undefined;
|
|
2379
|
-
variantVersionId?: string | null | undefined;
|
|
2380
|
-
}[] | null;
|
|
2381
|
-
} | undefined>;
|
|
2382
|
-
updatePlayground: (params: z$1.infer<typeof updatePlayground>) => Promise<{
|
|
2383
|
-
name: string;
|
|
2384
|
-
id: string;
|
|
2385
|
-
createdAt: Date;
|
|
2386
|
-
updatedAt: Date;
|
|
2387
|
-
datasetId: string | null;
|
|
2388
|
-
columns: {
|
|
2389
|
-
id: string;
|
|
2390
|
-
name: string;
|
|
2391
|
-
position: number;
|
|
2392
|
-
providerConfigId: string | null;
|
|
2393
|
-
modelName: string;
|
|
2394
|
-
messages: {
|
|
2395
|
-
role: "system" | "user" | "assistant";
|
|
2396
|
-
content: string;
|
|
2397
|
-
}[];
|
|
2398
|
-
temperature?: number | null | undefined;
|
|
2399
|
-
maxTokens?: number | null | undefined;
|
|
2400
|
-
topP?: number | null | undefined;
|
|
2401
|
-
frequencyPenalty?: number | null | undefined;
|
|
2402
|
-
presencePenalty?: number | null | undefined;
|
|
2403
|
-
configId?: string | null | undefined;
|
|
2404
|
-
variantId?: string | null | undefined;
|
|
2405
|
-
variantVersionId?: string | null | undefined;
|
|
2406
|
-
}[] | null;
|
|
2407
|
-
} | undefined>;
|
|
2408
|
-
getPlaygroundById: (params: z$1.infer<typeof getPlaygroundById>) => Promise<{
|
|
2409
|
-
name: string;
|
|
2410
|
-
id: string;
|
|
2411
|
-
createdAt: Date;
|
|
2412
|
-
updatedAt: Date;
|
|
2413
|
-
datasetId: string | null;
|
|
2414
|
-
columns: {
|
|
2415
|
-
id: string;
|
|
2416
|
-
name: string;
|
|
2417
|
-
position: number;
|
|
2418
|
-
providerConfigId: string | null;
|
|
2419
|
-
modelName: string;
|
|
2420
|
-
messages: {
|
|
2421
|
-
role: "system" | "user" | "assistant";
|
|
2422
|
-
content: string;
|
|
2423
|
-
}[];
|
|
2424
|
-
temperature?: number | null | undefined;
|
|
2425
|
-
maxTokens?: number | null | undefined;
|
|
2426
|
-
topP?: number | null | undefined;
|
|
2427
|
-
frequencyPenalty?: number | null | undefined;
|
|
2428
|
-
presencePenalty?: number | null | undefined;
|
|
2429
|
-
configId?: string | null | undefined;
|
|
2430
|
-
variantId?: string | null | undefined;
|
|
2431
|
-
variantVersionId?: string | null | undefined;
|
|
2432
|
-
}[] | null;
|
|
2433
|
-
} | undefined>;
|
|
2434
|
-
deletePlayground: (params: z$1.infer<typeof deletePlayground>) => Promise<{
|
|
2435
|
-
name: string;
|
|
2436
|
-
id: string;
|
|
2437
|
-
createdAt: Date;
|
|
2438
|
-
updatedAt: Date;
|
|
2439
|
-
datasetId: string | null;
|
|
2440
|
-
columns: {
|
|
2441
|
-
id: string;
|
|
2442
|
-
name: string;
|
|
2443
|
-
position: number;
|
|
2444
|
-
providerConfigId: string | null;
|
|
2445
|
-
modelName: string;
|
|
2446
|
-
messages: {
|
|
2447
|
-
role: "system" | "user" | "assistant";
|
|
2448
|
-
content: string;
|
|
2449
|
-
}[];
|
|
2450
|
-
temperature?: number | null | undefined;
|
|
2451
|
-
maxTokens?: number | null | undefined;
|
|
2452
|
-
topP?: number | null | undefined;
|
|
2453
|
-
frequencyPenalty?: number | null | undefined;
|
|
2454
|
-
presencePenalty?: number | null | undefined;
|
|
2455
|
-
configId?: string | null | undefined;
|
|
2456
|
-
variantId?: string | null | undefined;
|
|
2457
|
-
variantVersionId?: string | null | undefined;
|
|
2458
|
-
}[] | null;
|
|
2459
|
-
} | undefined>;
|
|
2460
|
-
listPlaygrounds: (params?: z$1.infer<typeof listPlaygrounds>) => Promise<{
|
|
2461
|
-
name: string;
|
|
2462
|
-
id: string;
|
|
2463
|
-
createdAt: Date;
|
|
2464
|
-
updatedAt: Date;
|
|
2465
|
-
datasetId: string | null;
|
|
2466
|
-
columns: {
|
|
2467
|
-
id: string;
|
|
2468
|
-
name: string;
|
|
2469
|
-
position: number;
|
|
2470
|
-
providerConfigId: string | null;
|
|
2471
|
-
modelName: string;
|
|
2472
|
-
messages: {
|
|
2473
|
-
role: "system" | "user" | "assistant";
|
|
2474
|
-
content: string;
|
|
2475
|
-
}[];
|
|
2476
|
-
temperature?: number | null | undefined;
|
|
2477
|
-
maxTokens?: number | null | undefined;
|
|
2478
|
-
topP?: number | null | undefined;
|
|
2479
|
-
frequencyPenalty?: number | null | undefined;
|
|
2480
|
-
presencePenalty?: number | null | undefined;
|
|
2481
|
-
configId?: string | null | undefined;
|
|
2482
|
-
variantId?: string | null | undefined;
|
|
2483
|
-
variantVersionId?: string | null | undefined;
|
|
2484
|
-
}[] | null;
|
|
2485
|
-
}[]>;
|
|
2486
|
-
countPlaygrounds: () => Promise<number>;
|
|
2487
|
-
};
|
|
2488
|
-
//#endregion
|
|
2489
|
-
//#region src/datalayer/playgroundResults.d.ts
|
|
2490
|
-
declare const createPlaygroundResult: z$1.ZodObject<{
|
|
2491
|
-
runId: z$1.ZodString;
|
|
2492
|
-
columnId: z$1.ZodString;
|
|
2493
|
-
datasetRecordId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2494
|
-
inputVariables: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
2495
|
-
status: z$1.ZodDefault<z$1.ZodEnum<{
|
|
2496
|
-
pending: "pending";
|
|
2497
|
-
running: "running";
|
|
2498
|
-
completed: "completed";
|
|
2499
|
-
failed: "failed";
|
|
2500
|
-
}>>;
|
|
2501
|
-
}, z$1.core.$strip>;
|
|
2502
|
-
declare const createPlaygroundResultsBatch: z$1.ZodObject<{
|
|
2503
|
-
results: z$1.ZodArray<z$1.ZodObject<{
|
|
2504
|
-
runId: z$1.ZodString;
|
|
2505
|
-
columnId: z$1.ZodString;
|
|
2506
|
-
datasetRecordId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2507
|
-
inputVariables: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
2508
|
-
status: z$1.ZodDefault<z$1.ZodEnum<{
|
|
2509
|
-
pending: "pending";
|
|
2510
|
-
running: "running";
|
|
2511
|
-
completed: "completed";
|
|
2512
|
-
failed: "failed";
|
|
2513
|
-
}>>;
|
|
2514
|
-
}, z$1.core.$strip>>;
|
|
2515
|
-
}, z$1.core.$strip>;
|
|
2516
|
-
declare const updatePlaygroundResult: z$1.ZodObject<{
|
|
2517
|
-
resultId: z$1.ZodString;
|
|
2518
|
-
outputContent: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2519
|
-
status: z$1.ZodOptional<z$1.ZodEnum<{
|
|
2520
|
-
pending: "pending";
|
|
2521
|
-
running: "running";
|
|
2522
|
-
completed: "completed";
|
|
2523
|
-
failed: "failed";
|
|
2524
|
-
}>>;
|
|
2525
|
-
error: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2526
|
-
latencyMs: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2527
|
-
promptTokens: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2528
|
-
completionTokens: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2529
|
-
totalTokens: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2530
|
-
cost: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2531
|
-
}, z$1.core.$strip>;
|
|
2532
|
-
declare const getPlaygroundResultById: z$1.ZodObject<{
|
|
2533
|
-
resultId: z$1.ZodString;
|
|
2534
|
-
}, z$1.core.$strip>;
|
|
2535
|
-
declare const listPlaygroundResults: z$1.ZodObject<{
|
|
2536
|
-
runId: z$1.ZodString;
|
|
2537
|
-
columnId: z$1.ZodOptional<z$1.ZodString>;
|
|
2538
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2539
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2540
|
-
}, z$1.core.$strip>;
|
|
2541
|
-
declare const deletePlaygroundResultsByRunId: z$1.ZodObject<{
|
|
2542
|
-
runId: z$1.ZodString;
|
|
2543
|
-
}, z$1.core.$strip>;
|
|
2544
|
-
declare const createPlaygroundResultsDataLayer: (db: Kysely<Database>) => {
|
|
2545
|
-
createPlaygroundResult: (params: z$1.infer<typeof createPlaygroundResult>) => Promise<{
|
|
2546
|
-
error: string | null;
|
|
2547
|
-
id: string;
|
|
2548
|
-
createdAt: Date;
|
|
2549
|
-
updatedAt: Date;
|
|
2550
|
-
status: string;
|
|
2551
|
-
runId: string;
|
|
2552
|
-
columnId: string;
|
|
2553
|
-
datasetRecordId: string | null;
|
|
2554
|
-
inputVariables: Record<string, unknown>;
|
|
2555
|
-
outputContent: string | null;
|
|
2556
|
-
latencyMs: number | null;
|
|
2557
|
-
promptTokens: number | null;
|
|
2558
|
-
completionTokens: number | null;
|
|
2559
|
-
totalTokens: number | null;
|
|
2560
|
-
cost: number | null;
|
|
2561
|
-
} | undefined>;
|
|
2562
|
-
createPlaygroundResultsBatch: (params: z$1.infer<typeof createPlaygroundResultsBatch>) => Promise<{
|
|
2563
|
-
error: string | null;
|
|
2564
|
-
id: string;
|
|
2565
|
-
createdAt: Date;
|
|
2566
|
-
updatedAt: Date;
|
|
2567
|
-
status: string;
|
|
2568
|
-
runId: string;
|
|
2569
|
-
columnId: string;
|
|
2570
|
-
datasetRecordId: string | null;
|
|
2571
|
-
inputVariables: Record<string, unknown>;
|
|
2572
|
-
outputContent: string | null;
|
|
2573
|
-
latencyMs: number | null;
|
|
2574
|
-
promptTokens: number | null;
|
|
2575
|
-
completionTokens: number | null;
|
|
2576
|
-
totalTokens: number | null;
|
|
2577
|
-
cost: number | null;
|
|
2578
|
-
}[]>;
|
|
2579
|
-
updatePlaygroundResult: (params: z$1.infer<typeof updatePlaygroundResult>) => Promise<{
|
|
2580
|
-
error: string | null;
|
|
2581
|
-
id: string;
|
|
2582
|
-
createdAt: Date;
|
|
2583
|
-
updatedAt: Date;
|
|
2584
|
-
status: string;
|
|
2585
|
-
runId: string;
|
|
2586
|
-
columnId: string;
|
|
2587
|
-
datasetRecordId: string | null;
|
|
2588
|
-
inputVariables: Record<string, unknown>;
|
|
2589
|
-
outputContent: string | null;
|
|
2590
|
-
latencyMs: number | null;
|
|
2591
|
-
promptTokens: number | null;
|
|
2592
|
-
completionTokens: number | null;
|
|
2593
|
-
totalTokens: number | null;
|
|
2594
|
-
cost: number | null;
|
|
2595
|
-
} | undefined>;
|
|
2596
|
-
getPlaygroundResultById: (params: z$1.infer<typeof getPlaygroundResultById>) => Promise<{
|
|
2597
|
-
error: string | null;
|
|
2598
|
-
id: string;
|
|
2599
|
-
createdAt: Date;
|
|
2600
|
-
updatedAt: Date;
|
|
2601
|
-
status: string;
|
|
2602
|
-
runId: string;
|
|
2603
|
-
columnId: string;
|
|
2604
|
-
datasetRecordId: string | null;
|
|
2605
|
-
inputVariables: Record<string, unknown>;
|
|
2606
|
-
outputContent: string | null;
|
|
2607
|
-
latencyMs: number | null;
|
|
2608
|
-
promptTokens: number | null;
|
|
2609
|
-
completionTokens: number | null;
|
|
2610
|
-
totalTokens: number | null;
|
|
2611
|
-
cost: number | null;
|
|
2612
|
-
} | undefined>;
|
|
2613
|
-
listPlaygroundResults: (params: z$1.infer<typeof listPlaygroundResults>) => Promise<{
|
|
2614
|
-
error: string | null;
|
|
2615
|
-
id: string;
|
|
2616
|
-
createdAt: Date;
|
|
2617
|
-
updatedAt: Date;
|
|
2618
|
-
status: string;
|
|
2619
|
-
runId: string;
|
|
2620
|
-
columnId: string;
|
|
2621
|
-
datasetRecordId: string | null;
|
|
2622
|
-
inputVariables: Record<string, unknown>;
|
|
2623
|
-
outputContent: string | null;
|
|
2624
|
-
latencyMs: number | null;
|
|
2625
|
-
promptTokens: number | null;
|
|
2626
|
-
completionTokens: number | null;
|
|
2627
|
-
totalTokens: number | null;
|
|
2628
|
-
cost: number | null;
|
|
2629
|
-
}[]>;
|
|
2630
|
-
deletePlaygroundResultsByRunId: (params: z$1.infer<typeof deletePlaygroundResultsByRunId>) => Promise<{
|
|
2631
|
-
error: string | null;
|
|
2632
|
-
id: string;
|
|
2633
|
-
createdAt: Date;
|
|
2634
|
-
updatedAt: Date;
|
|
2635
|
-
status: string;
|
|
2636
|
-
runId: string;
|
|
2637
|
-
columnId: string;
|
|
2638
|
-
datasetRecordId: string | null;
|
|
2639
|
-
inputVariables: Record<string, unknown>;
|
|
2640
|
-
outputContent: string | null;
|
|
2641
|
-
latencyMs: number | null;
|
|
2642
|
-
promptTokens: number | null;
|
|
2643
|
-
completionTokens: number | null;
|
|
2644
|
-
totalTokens: number | null;
|
|
2645
|
-
cost: number | null;
|
|
2646
|
-
}[]>;
|
|
2647
|
-
countPlaygroundResults: (runId: string) => Promise<number>;
|
|
2648
|
-
countCompletedPlaygroundResults: (runId: string) => Promise<number>;
|
|
2649
|
-
};
|
|
2650
|
-
//#endregion
|
|
2651
|
-
//#region src/datalayer/playgroundRuns.d.ts
|
|
2652
|
-
declare const createPlaygroundRun: z$1.ZodObject<{
|
|
2653
|
-
playgroundId: z$1.ZodString;
|
|
2654
|
-
datasetId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2655
|
-
datasetVersionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2656
|
-
status: z$1.ZodDefault<z$1.ZodEnum<{
|
|
2657
|
-
pending: "pending";
|
|
2658
|
-
running: "running";
|
|
2659
|
-
completed: "completed";
|
|
2660
|
-
failed: "failed";
|
|
2661
|
-
cancelled: "cancelled";
|
|
2662
|
-
}>>;
|
|
2663
|
-
totalRecords: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2664
|
-
}, z$1.core.$strip>;
|
|
2665
|
-
declare const updatePlaygroundRun: z$1.ZodObject<{
|
|
2666
|
-
runId: z$1.ZodString;
|
|
2667
|
-
status: z$1.ZodOptional<z$1.ZodEnum<{
|
|
2668
|
-
pending: "pending";
|
|
2669
|
-
running: "running";
|
|
2670
|
-
completed: "completed";
|
|
2671
|
-
failed: "failed";
|
|
2672
|
-
cancelled: "cancelled";
|
|
2673
|
-
}>>;
|
|
2674
|
-
startedAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodDate>>;
|
|
2675
|
-
completedAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodDate>>;
|
|
2676
|
-
completedRecords: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2677
|
-
}, z$1.core.$strip>;
|
|
2678
|
-
declare const getPlaygroundRunById: z$1.ZodObject<{
|
|
2679
|
-
runId: z$1.ZodString;
|
|
2680
|
-
}, z$1.core.$strip>;
|
|
2681
|
-
declare const listPlaygroundRuns: z$1.ZodObject<{
|
|
2682
|
-
playgroundId: z$1.ZodString;
|
|
2683
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2684
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2685
|
-
}, z$1.core.$strip>;
|
|
2686
|
-
declare const deletePlaygroundRun: z$1.ZodObject<{
|
|
2687
|
-
runId: z$1.ZodString;
|
|
2688
|
-
}, z$1.core.$strip>;
|
|
2689
|
-
declare const createPlaygroundRunsDataLayer: (db: Kysely<Database>) => {
|
|
2690
|
-
createPlaygroundRun: (params: z$1.infer<typeof createPlaygroundRun>) => Promise<{
|
|
2691
|
-
id: string;
|
|
2692
|
-
createdAt: Date;
|
|
2693
|
-
updatedAt: Date;
|
|
2694
|
-
datasetId: string | null;
|
|
2695
|
-
playgroundId: string;
|
|
2696
|
-
datasetVersionId: string | null;
|
|
2697
|
-
status: string;
|
|
2698
|
-
startedAt: Date | null;
|
|
2699
|
-
completedAt: Date | null;
|
|
2700
|
-
totalRecords: number;
|
|
2701
|
-
completedRecords: number;
|
|
2702
|
-
} | undefined>;
|
|
2703
|
-
updatePlaygroundRun: (params: z$1.infer<typeof updatePlaygroundRun>) => Promise<{
|
|
2704
|
-
id: string;
|
|
2705
|
-
createdAt: Date;
|
|
2706
|
-
updatedAt: Date;
|
|
2707
|
-
datasetId: string | null;
|
|
2708
|
-
playgroundId: string;
|
|
2709
|
-
datasetVersionId: string | null;
|
|
2710
|
-
status: string;
|
|
2711
|
-
startedAt: Date | null;
|
|
2712
|
-
completedAt: Date | null;
|
|
2713
|
-
totalRecords: number;
|
|
2714
|
-
completedRecords: number;
|
|
2715
|
-
} | undefined>;
|
|
2716
|
-
getPlaygroundRunById: (params: z$1.infer<typeof getPlaygroundRunById>) => Promise<{
|
|
2717
|
-
id: string;
|
|
2718
|
-
createdAt: Date;
|
|
2719
|
-
updatedAt: Date;
|
|
2720
|
-
datasetId: string | null;
|
|
2721
|
-
playgroundId: string;
|
|
2722
|
-
datasetVersionId: string | null;
|
|
2723
|
-
status: string;
|
|
2724
|
-
startedAt: Date | null;
|
|
2725
|
-
completedAt: Date | null;
|
|
2726
|
-
totalRecords: number;
|
|
2727
|
-
completedRecords: number;
|
|
2728
|
-
} | undefined>;
|
|
2729
|
-
listPlaygroundRuns: (params: z$1.infer<typeof listPlaygroundRuns>) => Promise<{
|
|
2730
|
-
id: string;
|
|
2731
|
-
createdAt: Date;
|
|
2732
|
-
updatedAt: Date;
|
|
2733
|
-
datasetId: string | null;
|
|
2734
|
-
playgroundId: string;
|
|
2735
|
-
datasetVersionId: string | null;
|
|
2736
|
-
status: string;
|
|
2737
|
-
startedAt: Date | null;
|
|
2738
|
-
completedAt: Date | null;
|
|
2739
|
-
totalRecords: number;
|
|
2740
|
-
completedRecords: number;
|
|
2741
|
-
}[]>;
|
|
2742
|
-
deletePlaygroundRun: (params: z$1.infer<typeof deletePlaygroundRun>) => Promise<{
|
|
2743
|
-
id: string;
|
|
2744
|
-
createdAt: Date;
|
|
2745
|
-
updatedAt: Date;
|
|
2746
|
-
datasetId: string | null;
|
|
2747
|
-
playgroundId: string;
|
|
2748
|
-
datasetVersionId: string | null;
|
|
2749
|
-
status: string;
|
|
2750
|
-
startedAt: Date | null;
|
|
2751
|
-
completedAt: Date | null;
|
|
2752
|
-
totalRecords: number;
|
|
2753
|
-
completedRecords: number;
|
|
2754
|
-
} | undefined>;
|
|
2755
|
-
countPlaygroundRuns: (playgroundId: string) => Promise<number>;
|
|
2756
|
-
};
|
|
2757
|
-
//#endregion
|
|
2758
|
-
//#region src/datalayer/providerConfigs.d.ts
|
|
2759
|
-
declare const createProviderConfig: z$1.ZodObject<{
|
|
2760
|
-
providerId: z$1.ZodString;
|
|
2761
|
-
slug: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2762
|
-
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2763
|
-
config: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
2764
|
-
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
2765
|
-
}, z$1.core.$strip>;
|
|
2766
|
-
declare const updateProviderConfig: z$1.ZodObject<{
|
|
2767
|
-
id: z$1.ZodUUID;
|
|
2768
|
-
slug: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2769
|
-
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2770
|
-
config: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
2771
|
-
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
2772
|
-
}, z$1.core.$strip>;
|
|
2773
|
-
declare const getProviderConfigById: z$1.ZodObject<{
|
|
2774
|
-
id: z$1.ZodUUID;
|
|
2775
|
-
}, z$1.core.$strip>;
|
|
2776
|
-
declare const getProviderConfigByProviderId: z$1.ZodObject<{
|
|
2777
|
-
providerId: z$1.ZodString;
|
|
2778
|
-
}, z$1.core.$strip>;
|
|
2779
|
-
declare const getProviderConfigBySlug: z$1.ZodObject<{
|
|
2780
|
-
slug: z$1.ZodString;
|
|
2781
|
-
}, z$1.core.$strip>;
|
|
2782
|
-
declare const deleteProviderConfig: z$1.ZodObject<{
|
|
2783
|
-
id: z$1.ZodUUID;
|
|
2784
|
-
}, z$1.core.$strip>;
|
|
2785
|
-
declare const listProviderConfigs: z$1.ZodObject<{
|
|
2786
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2787
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2788
|
-
}, z$1.core.$strip>;
|
|
2789
|
-
declare const createProviderConfigsDataLayer: (db: Kysely<Database>) => {
|
|
2790
|
-
createProviderConfig: (params: z$1.infer<typeof createProviderConfig>) => Promise<{
|
|
2791
|
-
slug: string | null;
|
|
2792
|
-
name: string | null;
|
|
2793
|
-
id: string;
|
|
2794
|
-
createdAt: Date;
|
|
2795
|
-
updatedAt: Date;
|
|
2796
|
-
enabled: boolean;
|
|
2797
|
-
providerId: string;
|
|
2798
|
-
config: Record<string, unknown>;
|
|
2799
|
-
} | undefined>;
|
|
2800
|
-
updateProviderConfig: (params: z$1.infer<typeof updateProviderConfig>) => Promise<{
|
|
2801
|
-
slug: string | null;
|
|
2802
|
-
name: string | null;
|
|
2803
|
-
id: string;
|
|
2804
|
-
createdAt: Date;
|
|
2805
|
-
updatedAt: Date;
|
|
2806
|
-
enabled: boolean;
|
|
2807
|
-
providerId: string;
|
|
2808
|
-
config: Record<string, unknown>;
|
|
2809
|
-
} | undefined>;
|
|
2810
|
-
getProviderConfigById: (params: z$1.infer<typeof getProviderConfigById>) => Promise<{
|
|
2811
|
-
slug: string | null;
|
|
2812
|
-
name: string | null;
|
|
2813
|
-
id: string;
|
|
2814
|
-
createdAt: Date;
|
|
2815
|
-
updatedAt: Date;
|
|
2816
|
-
enabled: boolean;
|
|
2817
|
-
providerId: string;
|
|
2818
|
-
config: Record<string, unknown>;
|
|
2819
|
-
} | undefined>;
|
|
2820
|
-
getProviderConfigByProviderId: (params: z$1.infer<typeof getProviderConfigByProviderId>) => Promise<{
|
|
2821
|
-
slug: string | null;
|
|
2822
|
-
name: string | null;
|
|
2823
|
-
id: string;
|
|
2824
|
-
createdAt: Date;
|
|
2825
|
-
updatedAt: Date;
|
|
2826
|
-
enabled: boolean;
|
|
2827
|
-
providerId: string;
|
|
2828
|
-
config: Record<string, unknown>;
|
|
2829
|
-
} | undefined>;
|
|
2830
|
-
getProviderConfigBySlug: (params: z$1.infer<typeof getProviderConfigBySlug>) => Promise<{
|
|
2831
|
-
slug: string | null;
|
|
2832
|
-
name: string | null;
|
|
2833
|
-
id: string;
|
|
2834
|
-
createdAt: Date;
|
|
2835
|
-
updatedAt: Date;
|
|
2836
|
-
enabled: boolean;
|
|
2837
|
-
providerId: string;
|
|
2838
|
-
config: Record<string, unknown>;
|
|
2839
|
-
} | undefined>;
|
|
2840
|
-
deleteProviderConfig: (params: z$1.infer<typeof deleteProviderConfig>) => Promise<{
|
|
2841
|
-
slug: string | null;
|
|
2842
|
-
name: string | null;
|
|
2843
|
-
id: string;
|
|
2844
|
-
createdAt: Date;
|
|
2845
|
-
updatedAt: Date;
|
|
2846
|
-
enabled: boolean;
|
|
2847
|
-
providerId: string;
|
|
2848
|
-
config: Record<string, unknown>;
|
|
2849
|
-
} | undefined>;
|
|
2850
|
-
listProviderConfigs: (params?: z$1.infer<typeof listProviderConfigs>) => Promise<{
|
|
2851
|
-
slug: string | null;
|
|
2852
|
-
name: string | null;
|
|
2853
|
-
id: string;
|
|
2854
|
-
createdAt: Date;
|
|
2855
|
-
updatedAt: Date;
|
|
2856
|
-
enabled: boolean;
|
|
2857
|
-
providerId: string;
|
|
2858
|
-
config: Record<string, unknown>;
|
|
2859
|
-
}[]>;
|
|
2860
|
-
countProviderConfigs: () => Promise<number>;
|
|
2861
|
-
/**
|
|
2862
|
-
* Upsert provider config - creates if not exists, updates if exists
|
|
2863
|
-
* Useful for the dashboard UI where you want to set/update a provider config
|
|
2864
|
-
*/
|
|
2865
|
-
upsertProviderConfig: (params: z$1.infer<typeof createProviderConfig>) => Promise<{
|
|
2866
|
-
slug: string | null;
|
|
2867
|
-
name: string | null;
|
|
2868
|
-
id: string;
|
|
2869
|
-
createdAt: Date;
|
|
2870
|
-
updatedAt: Date;
|
|
2871
|
-
enabled: boolean;
|
|
2872
|
-
providerId: string;
|
|
2873
|
-
config: Record<string, unknown>;
|
|
2874
|
-
} | undefined>;
|
|
2875
|
-
};
|
|
2876
|
-
//#endregion
|
|
2877
|
-
//#region src/datalayer/providerGuardrailOverrides.d.ts
|
|
2878
|
-
declare const createProviderGuardrailOverride: z$1.ZodObject<{
|
|
2879
|
-
providerConfigId: z$1.ZodString;
|
|
2880
|
-
guardrailConfigId: z$1.ZodString;
|
|
2881
|
-
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
2882
|
-
parameters: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
2883
|
-
}, z$1.core.$strip>;
|
|
2884
|
-
declare const updateProviderGuardrailOverride: z$1.ZodObject<{
|
|
2885
|
-
id: z$1.ZodString;
|
|
2886
|
-
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
2887
|
-
parameters: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
2888
|
-
}, z$1.core.$strip>;
|
|
2889
|
-
declare const getOverrideById: z$1.ZodObject<{
|
|
2890
|
-
id: z$1.ZodString;
|
|
2891
|
-
}, z$1.core.$strip>;
|
|
2892
|
-
declare const deleteOverride: z$1.ZodObject<{
|
|
2893
|
-
id: z$1.ZodString;
|
|
2894
|
-
}, z$1.core.$strip>;
|
|
2895
|
-
declare const getOverridesByProviderConfigId: z$1.ZodObject<{
|
|
2896
|
-
providerConfigId: z$1.ZodString;
|
|
2897
|
-
}, z$1.core.$strip>;
|
|
2898
|
-
declare const getOverridesByGuardrailConfigId: z$1.ZodObject<{
|
|
2899
|
-
guardrailConfigId: z$1.ZodString;
|
|
2900
|
-
}, z$1.core.$strip>;
|
|
2901
|
-
declare const getOverrideByProviderAndGuardrail: z$1.ZodObject<{
|
|
2902
|
-
providerConfigId: z$1.ZodString;
|
|
2903
|
-
guardrailConfigId: z$1.ZodString;
|
|
2904
|
-
}, z$1.core.$strip>;
|
|
2905
|
-
declare const createProviderGuardrailOverridesDataLayer: (db: Kysely<Database>) => {
|
|
2906
|
-
createProviderGuardrailOverride: (params: z$1.infer<typeof createProviderGuardrailOverride>) => Promise<{
|
|
2907
|
-
id: string;
|
|
2908
|
-
createdAt: Date;
|
|
2909
|
-
updatedAt: Date;
|
|
2910
|
-
enabled: boolean;
|
|
2911
|
-
providerConfigId: string;
|
|
2912
|
-
parameters: Record<string, unknown> | null;
|
|
2913
|
-
guardrailConfigId: string;
|
|
2914
|
-
} | undefined>;
|
|
2915
|
-
updateProviderGuardrailOverride: (params: z$1.infer<typeof updateProviderGuardrailOverride>) => Promise<{
|
|
2916
|
-
id: string;
|
|
2917
|
-
createdAt: Date;
|
|
2918
|
-
updatedAt: Date;
|
|
2919
|
-
enabled: boolean;
|
|
2920
|
-
providerConfigId: string;
|
|
2921
|
-
parameters: Record<string, unknown> | null;
|
|
2922
|
-
guardrailConfigId: string;
|
|
2923
|
-
} | undefined>;
|
|
2924
|
-
getOverrideById: (params: z$1.infer<typeof getOverrideById>) => Promise<{
|
|
2925
|
-
id: string;
|
|
2926
|
-
createdAt: Date;
|
|
2927
|
-
updatedAt: Date;
|
|
2928
|
-
enabled: boolean;
|
|
2929
|
-
providerConfigId: string;
|
|
2930
|
-
parameters: Record<string, unknown> | null;
|
|
2931
|
-
guardrailConfigId: string;
|
|
2932
|
-
} | undefined>;
|
|
2933
|
-
deleteProviderGuardrailOverride: (params: z$1.infer<typeof deleteOverride>) => Promise<{
|
|
2934
|
-
id: string;
|
|
2935
|
-
createdAt: Date;
|
|
2936
|
-
updatedAt: Date;
|
|
2937
|
-
enabled: boolean;
|
|
2938
|
-
providerConfigId: string;
|
|
2939
|
-
parameters: Record<string, unknown> | null;
|
|
2940
|
-
guardrailConfigId: string;
|
|
2941
|
-
} | undefined>;
|
|
2942
|
-
getOverridesByProviderConfigId: (params: z$1.infer<typeof getOverridesByProviderConfigId>) => Promise<{
|
|
2943
|
-
id: string;
|
|
2944
|
-
createdAt: Date;
|
|
2945
|
-
updatedAt: Date;
|
|
2946
|
-
enabled: boolean;
|
|
2947
|
-
providerConfigId: string;
|
|
2948
|
-
parameters: Record<string, unknown> | null;
|
|
2949
|
-
guardrailConfigId: string;
|
|
2950
|
-
}[]>;
|
|
2951
|
-
getOverridesByGuardrailConfigId: (params: z$1.infer<typeof getOverridesByGuardrailConfigId>) => Promise<{
|
|
2952
|
-
id: string;
|
|
2953
|
-
createdAt: Date;
|
|
2954
|
-
updatedAt: Date;
|
|
2955
|
-
enabled: boolean;
|
|
2956
|
-
providerConfigId: string;
|
|
2957
|
-
parameters: Record<string, unknown> | null;
|
|
2958
|
-
guardrailConfigId: string;
|
|
2959
|
-
}[]>;
|
|
2960
|
-
getOverrideByProviderAndGuardrail: (params: z$1.infer<typeof getOverrideByProviderAndGuardrail>) => Promise<{
|
|
2961
|
-
id: string;
|
|
2962
|
-
createdAt: Date;
|
|
2963
|
-
updatedAt: Date;
|
|
2964
|
-
enabled: boolean;
|
|
2965
|
-
providerConfigId: string;
|
|
2966
|
-
parameters: Record<string, unknown> | null;
|
|
2967
|
-
guardrailConfigId: string;
|
|
2968
|
-
} | undefined>;
|
|
2969
|
-
/**
|
|
2970
|
-
* Upsert provider guardrail override - creates if not exists, updates if exists
|
|
2971
|
-
*/
|
|
2972
|
-
upsertProviderGuardrailOverride: (params: z$1.infer<typeof createProviderGuardrailOverride>) => Promise<{
|
|
2973
|
-
id: string;
|
|
2974
|
-
createdAt: Date;
|
|
2975
|
-
updatedAt: Date;
|
|
2976
|
-
enabled: boolean;
|
|
2977
|
-
providerConfigId: string;
|
|
2978
|
-
parameters: Record<string, unknown> | null;
|
|
2979
|
-
guardrailConfigId: string;
|
|
2980
|
-
} | undefined>;
|
|
2981
|
-
/**
|
|
2982
|
-
* Delete all overrides for a guardrail config
|
|
2983
|
-
* Useful when deleting a guardrail config
|
|
2984
|
-
*/
|
|
2985
|
-
deleteOverridesByGuardrailConfigId: (params: z$1.infer<typeof getOverridesByGuardrailConfigId>) => Promise<kysely0.DeleteResult[]>;
|
|
2986
|
-
};
|
|
2987
|
-
//#endregion
|
|
2988
|
-
//#region src/datalayer/targetingRules.d.ts
|
|
2989
|
-
declare const createTargetingRule: z$1.ZodObject<{
|
|
2990
|
-
environmentId: z$1.ZodString;
|
|
2991
|
-
configId: z$1.ZodString;
|
|
2992
|
-
configVariantId: z$1.ZodString;
|
|
2993
|
-
variantVersionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2994
|
-
weight: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
2995
|
-
priority: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
2996
|
-
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
2997
|
-
conditions: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
2998
|
-
}, z$1.core.$strip>;
|
|
2999
|
-
declare const updateTargetingRule: z$1.ZodObject<{
|
|
3000
|
-
id: z$1.ZodString;
|
|
3001
|
-
variantVersionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3002
|
-
weight: z$1.ZodOptional<z$1.ZodNumber>;
|
|
3003
|
-
priority: z$1.ZodOptional<z$1.ZodNumber>;
|
|
3004
|
-
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
3005
|
-
conditions: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
3006
|
-
}, z$1.core.$strip>;
|
|
3007
|
-
declare const getTargetingRuleById: z$1.ZodObject<{
|
|
3008
|
-
id: z$1.ZodString;
|
|
3009
|
-
}, z$1.core.$strip>;
|
|
3010
|
-
declare const getTargetingRulesByConfigId: z$1.ZodObject<{
|
|
3011
|
-
configId: z$1.ZodString;
|
|
3012
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
3013
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
3014
|
-
}, z$1.core.$strip>;
|
|
3015
|
-
declare const getTargetingRulesByEnvironmentId: z$1.ZodObject<{
|
|
3016
|
-
environmentId: z$1.ZodString;
|
|
3017
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
3018
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
3019
|
-
}, z$1.core.$strip>;
|
|
3020
|
-
declare const getTargetingRulesByConfigAndEnvironment: z$1.ZodObject<{
|
|
3021
|
-
configId: z$1.ZodString;
|
|
3022
|
-
environmentId: z$1.ZodString;
|
|
3023
|
-
}, z$1.core.$strip>;
|
|
3024
|
-
declare const deleteTargetingRule: z$1.ZodObject<{
|
|
3025
|
-
id: z$1.ZodString;
|
|
3026
|
-
}, z$1.core.$strip>;
|
|
3027
|
-
declare const deleteTargetingRulesByConfigId: z$1.ZodObject<{
|
|
3028
|
-
configId: z$1.ZodString;
|
|
3029
|
-
}, z$1.core.$strip>;
|
|
3030
|
-
declare const deleteTargetingRulesByEnvironmentId: z$1.ZodObject<{
|
|
3031
|
-
environmentId: z$1.ZodString;
|
|
3032
|
-
}, z$1.core.$strip>;
|
|
3033
|
-
declare const listTargetingRules: z$1.ZodObject<{
|
|
3034
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
3035
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
3036
|
-
}, z$1.core.$strip>;
|
|
3037
|
-
declare const setTargetingForEnvironment: z$1.ZodObject<{
|
|
3038
|
-
environmentId: z$1.ZodString;
|
|
3039
|
-
configId: z$1.ZodString;
|
|
3040
|
-
configVariantId: z$1.ZodString;
|
|
3041
|
-
variantVersionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3042
|
-
}, z$1.core.$strip>;
|
|
3043
|
-
declare const createTargetingRulesDataLayer: (db: Kysely<Database>) => {
|
|
3044
|
-
createTargetingRule: (params: z$1.infer<typeof createTargetingRule>) => Promise<{
|
|
3045
|
-
id: string;
|
|
3046
|
-
createdAt: Date;
|
|
3047
|
-
updatedAt: Date;
|
|
3048
|
-
environmentId: string;
|
|
3049
|
-
configId: string;
|
|
3050
|
-
configVariantId: string;
|
|
3051
|
-
variantVersionId: string | null;
|
|
3052
|
-
weight: number;
|
|
3053
|
-
priority: number;
|
|
3054
|
-
enabled: boolean;
|
|
3055
|
-
conditions: Record<string, unknown>;
|
|
3056
|
-
} | undefined>;
|
|
3057
|
-
updateTargetingRule: (params: z$1.infer<typeof updateTargetingRule>) => Promise<{
|
|
3058
|
-
id: string;
|
|
3059
|
-
createdAt: Date;
|
|
3060
|
-
updatedAt: Date;
|
|
3061
|
-
environmentId: string;
|
|
3062
|
-
configId: string;
|
|
3063
|
-
configVariantId: string;
|
|
3064
|
-
variantVersionId: string | null;
|
|
3065
|
-
weight: number;
|
|
3066
|
-
priority: number;
|
|
3067
|
-
enabled: boolean;
|
|
3068
|
-
conditions: Record<string, unknown>;
|
|
3069
|
-
} | undefined>;
|
|
3070
|
-
getTargetingRuleById: (params: z$1.infer<typeof getTargetingRuleById>) => Promise<{
|
|
3071
|
-
id: string;
|
|
3072
|
-
createdAt: Date;
|
|
3073
|
-
updatedAt: Date;
|
|
3074
|
-
environmentId: string;
|
|
3075
|
-
configId: string;
|
|
3076
|
-
configVariantId: string;
|
|
3077
|
-
variantVersionId: string | null;
|
|
3078
|
-
weight: number;
|
|
3079
|
-
priority: number;
|
|
3080
|
-
enabled: boolean;
|
|
3081
|
-
conditions: Record<string, unknown>;
|
|
3082
|
-
} | undefined>;
|
|
3083
|
-
getTargetingRulesByConfigId: (params: z$1.infer<typeof getTargetingRulesByConfigId>) => Promise<{
|
|
3084
|
-
id: string;
|
|
3085
|
-
createdAt: Date;
|
|
3086
|
-
updatedAt: Date;
|
|
3087
|
-
environmentId: string;
|
|
3088
|
-
configId: string;
|
|
3089
|
-
configVariantId: string;
|
|
3090
|
-
variantVersionId: string | null;
|
|
3091
|
-
weight: number;
|
|
3092
|
-
priority: number;
|
|
3093
|
-
enabled: boolean;
|
|
3094
|
-
conditions: Record<string, unknown>;
|
|
3095
|
-
}[]>;
|
|
3096
|
-
getTargetingRulesByEnvironmentId: (params: z$1.infer<typeof getTargetingRulesByEnvironmentId>) => Promise<{
|
|
3097
|
-
id: string;
|
|
3098
|
-
createdAt: Date;
|
|
3099
|
-
updatedAt: Date;
|
|
3100
|
-
environmentId: string;
|
|
3101
|
-
configId: string;
|
|
3102
|
-
configVariantId: string;
|
|
3103
|
-
variantVersionId: string | null;
|
|
3104
|
-
weight: number;
|
|
3105
|
-
priority: number;
|
|
3106
|
-
enabled: boolean;
|
|
3107
|
-
conditions: Record<string, unknown>;
|
|
3108
|
-
}[]>;
|
|
3109
|
-
getTargetingRulesByConfigAndEnvironment: (params: z$1.infer<typeof getTargetingRulesByConfigAndEnvironment>) => Promise<{
|
|
3110
|
-
id: string;
|
|
3111
|
-
createdAt: Date;
|
|
3112
|
-
updatedAt: Date;
|
|
3113
|
-
environmentId: string;
|
|
3114
|
-
configId: string;
|
|
3115
|
-
configVariantId: string;
|
|
3116
|
-
variantVersionId: string | null;
|
|
3117
|
-
weight: number;
|
|
3118
|
-
priority: number;
|
|
3119
|
-
enabled: boolean;
|
|
3120
|
-
conditions: Record<string, unknown>;
|
|
3121
|
-
}[]>;
|
|
3122
|
-
deleteTargetingRule: (params: z$1.infer<typeof deleteTargetingRule>) => Promise<{
|
|
3123
|
-
id: string;
|
|
3124
|
-
createdAt: Date;
|
|
3125
|
-
updatedAt: Date;
|
|
3126
|
-
environmentId: string;
|
|
3127
|
-
configId: string;
|
|
3128
|
-
configVariantId: string;
|
|
3129
|
-
variantVersionId: string | null;
|
|
3130
|
-
weight: number;
|
|
3131
|
-
priority: number;
|
|
3132
|
-
enabled: boolean;
|
|
3133
|
-
conditions: Record<string, unknown>;
|
|
3134
|
-
} | undefined>;
|
|
3135
|
-
deleteTargetingRulesByConfigId: (params: z$1.infer<typeof deleteTargetingRulesByConfigId>) => Promise<{
|
|
3136
|
-
id: string;
|
|
3137
|
-
createdAt: Date;
|
|
3138
|
-
updatedAt: Date;
|
|
3139
|
-
environmentId: string;
|
|
3140
|
-
configId: string;
|
|
3141
|
-
configVariantId: string;
|
|
3142
|
-
variantVersionId: string | null;
|
|
3143
|
-
weight: number;
|
|
3144
|
-
priority: number;
|
|
3145
|
-
enabled: boolean;
|
|
3146
|
-
conditions: Record<string, unknown>;
|
|
3147
|
-
}[]>;
|
|
3148
|
-
deleteTargetingRulesByEnvironmentId: (params: z$1.infer<typeof deleteTargetingRulesByEnvironmentId>) => Promise<{
|
|
3149
|
-
id: string;
|
|
3150
|
-
createdAt: Date;
|
|
3151
|
-
updatedAt: Date;
|
|
3152
|
-
environmentId: string;
|
|
3153
|
-
configId: string;
|
|
3154
|
-
configVariantId: string;
|
|
3155
|
-
variantVersionId: string | null;
|
|
3156
|
-
weight: number;
|
|
3157
|
-
priority: number;
|
|
3158
|
-
enabled: boolean;
|
|
3159
|
-
conditions: Record<string, unknown>;
|
|
3160
|
-
}[]>;
|
|
3161
|
-
listTargetingRules: (params?: z$1.infer<typeof listTargetingRules>) => Promise<{
|
|
3162
|
-
id: string;
|
|
3163
|
-
createdAt: Date;
|
|
3164
|
-
updatedAt: Date;
|
|
3165
|
-
environmentId: string;
|
|
3166
|
-
configId: string;
|
|
3167
|
-
configVariantId: string;
|
|
3168
|
-
variantVersionId: string | null;
|
|
3169
|
-
weight: number;
|
|
3170
|
-
priority: number;
|
|
3171
|
-
enabled: boolean;
|
|
3172
|
-
conditions: Record<string, unknown>;
|
|
3173
|
-
}[]>;
|
|
3174
|
-
/**
|
|
3175
|
-
* Get targeting rules with full details (environment, config, variant info)
|
|
3176
|
-
* Now includes variantVersionId and resolves the actual version being used
|
|
3177
|
-
*/
|
|
3178
|
-
getTargetingRulesWithDetailsByConfigId: (params: z$1.infer<typeof getTargetingRulesByConfigId>) => Promise<{
|
|
3179
|
-
variantProvider: string | null;
|
|
3180
|
-
variantModelName: string | null;
|
|
3181
|
-
pinnedVersion: number | null | undefined;
|
|
3182
|
-
latestVersion: number | null | undefined;
|
|
3183
|
-
variantId: string | null;
|
|
3184
|
-
variantName: string | null;
|
|
3185
|
-
id: string;
|
|
3186
|
-
createdAt: Date;
|
|
3187
|
-
updatedAt: Date;
|
|
3188
|
-
environmentId: string;
|
|
3189
|
-
configId: string;
|
|
3190
|
-
configVariantId: string;
|
|
3191
|
-
variantVersionId: string | null;
|
|
3192
|
-
weight: number;
|
|
3193
|
-
priority: number;
|
|
3194
|
-
enabled: boolean;
|
|
3195
|
-
conditions: Record<string, unknown>;
|
|
3196
|
-
environmentName: string | null;
|
|
3197
|
-
environmentSlug: string | null;
|
|
3198
|
-
}[]>;
|
|
3199
|
-
/**
|
|
3200
|
-
* Set a single variant for an environment (replaces existing).
|
|
3201
|
-
* Now supports optional variantVersionId to pin to a specific version.
|
|
3202
|
-
*/
|
|
3203
|
-
setTargetingForEnvironment: (params: z$1.infer<typeof setTargetingForEnvironment>) => Promise<{
|
|
3204
|
-
id: string;
|
|
3205
|
-
createdAt: Date;
|
|
3206
|
-
updatedAt: Date;
|
|
3207
|
-
environmentId: string;
|
|
3208
|
-
configId: string;
|
|
3209
|
-
configVariantId: string;
|
|
3210
|
-
variantVersionId: string | null;
|
|
3211
|
-
weight: number;
|
|
3212
|
-
priority: number;
|
|
3213
|
-
enabled: boolean;
|
|
3214
|
-
conditions: Record<string, unknown>;
|
|
3215
|
-
} | undefined>;
|
|
3216
|
-
};
|
|
3217
|
-
//#endregion
|
|
3218
|
-
//#region src/datalayer/traces.d.ts
|
|
3219
|
-
/**
|
|
3220
|
-
* Schema for upserting a trace
|
|
3221
|
-
*/
|
|
3222
|
-
declare const upsertTraceSchema: z$1.ZodObject<{
|
|
3223
|
-
traceId: z$1.ZodString;
|
|
3224
|
-
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3225
|
-
sessionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3226
|
-
userId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3227
|
-
status: z$1.ZodDefault<z$1.ZodEnum<{
|
|
3228
|
-
error: "error";
|
|
3229
|
-
unset: "unset";
|
|
3230
|
-
ok: "ok";
|
|
3231
|
-
}>>;
|
|
3232
|
-
startTime: z$1.ZodDate;
|
|
3233
|
-
endTime: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodDate>>;
|
|
3234
|
-
durationMs: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
3235
|
-
spanCount: z$1.ZodDefault<z$1.ZodNumber>;
|
|
3236
|
-
totalInputTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
3237
|
-
totalOutputTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
3238
|
-
totalTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
3239
|
-
totalCost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
3240
|
-
tags: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
3241
|
-
metadata: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
3242
|
-
}, z$1.core.$strip>;
|
|
3243
|
-
type TraceUpsert = z$1.infer<typeof upsertTraceSchema>;
|
|
3244
|
-
/**
|
|
3245
|
-
* Schema for inserting spans
|
|
3246
|
-
*/
|
|
3247
|
-
declare const insertSpanSchema: z$1.ZodObject<{
|
|
3248
|
-
traceId: z$1.ZodString;
|
|
3249
|
-
spanId: z$1.ZodString;
|
|
3250
|
-
parentSpanId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3251
|
-
name: z$1.ZodString;
|
|
3252
|
-
kind: z$1.ZodDefault<z$1.ZodNumber>;
|
|
3253
|
-
status: z$1.ZodDefault<z$1.ZodNumber>;
|
|
3254
|
-
statusMessage: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3255
|
-
startTime: z$1.ZodDate;
|
|
3256
|
-
endTime: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodDate>>;
|
|
3257
|
-
durationMs: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
3258
|
-
provider: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3259
|
-
model: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3260
|
-
promptTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
3261
|
-
completionTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
3262
|
-
totalTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
3263
|
-
cost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
3264
|
-
configId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3265
|
-
variantId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3266
|
-
environmentId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3267
|
-
providerConfigId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3268
|
-
requestId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3269
|
-
source: z$1.ZodDefault<z$1.ZodEnum<{
|
|
3270
|
-
gateway: "gateway";
|
|
3271
|
-
otlp: "otlp";
|
|
3272
|
-
langsmith: "langsmith";
|
|
3273
|
-
}>>;
|
|
3274
|
-
input: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodUnknown>>;
|
|
3275
|
-
output: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodUnknown>>;
|
|
3276
|
-
attributes: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
3277
|
-
}, z$1.core.$strip>;
|
|
3278
|
-
type SpanInsert = z$1.infer<typeof insertSpanSchema>;
|
|
3279
|
-
/**
|
|
3280
|
-
* Schema for inserting span events
|
|
3281
|
-
*/
|
|
3282
|
-
declare const insertSpanEventSchema: z$1.ZodObject<{
|
|
3283
|
-
traceId: z$1.ZodString;
|
|
3284
|
-
spanId: z$1.ZodString;
|
|
3285
|
-
name: z$1.ZodString;
|
|
3286
|
-
timestamp: z$1.ZodDate;
|
|
3287
|
-
attributes: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
3288
|
-
}, z$1.core.$strip>;
|
|
3289
|
-
type SpanEventInsert = z$1.infer<typeof insertSpanEventSchema>;
|
|
3290
|
-
/**
|
|
3291
|
-
* Schema for listing traces
|
|
3292
|
-
*/
|
|
3293
|
-
declare const listTracesSchema: z$1.ZodObject<{
|
|
3294
|
-
limit: z$1.ZodDefault<z$1.ZodNumber>;
|
|
3295
|
-
offset: z$1.ZodDefault<z$1.ZodNumber>;
|
|
3296
|
-
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
3297
|
-
userId: z$1.ZodOptional<z$1.ZodString>;
|
|
3298
|
-
status: z$1.ZodOptional<z$1.ZodEnum<{
|
|
3299
|
-
error: "error";
|
|
3300
|
-
unset: "unset";
|
|
3301
|
-
ok: "ok";
|
|
3302
|
-
}>>;
|
|
3303
|
-
name: z$1.ZodOptional<z$1.ZodString>;
|
|
3304
|
-
startDate: z$1.ZodOptional<z$1.ZodDate>;
|
|
3305
|
-
endDate: z$1.ZodOptional<z$1.ZodDate>;
|
|
3306
|
-
tags: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
|
|
3307
|
-
}, z$1.core.$strip>;
|
|
3308
|
-
/**
|
|
3309
|
-
* Schema for trace stats query
|
|
3310
|
-
*/
|
|
3311
|
-
declare const traceStatsSchema: z$1.ZodObject<{
|
|
3312
|
-
startDate: z$1.ZodDate;
|
|
3313
|
-
endDate: z$1.ZodDate;
|
|
3314
|
-
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
3315
|
-
userId: z$1.ZodOptional<z$1.ZodString>;
|
|
3316
|
-
}, z$1.core.$strip>;
|
|
3317
|
-
declare const createTracesDataLayer: (db: Kysely<Database>) => {
|
|
3318
|
-
/**
|
|
3319
|
-
* Upsert a trace — insert or update aggregates on conflict
|
|
3320
|
-
*/
|
|
3321
|
-
upsertTrace: (data: TraceUpsert) => Promise<void>;
|
|
3322
|
-
/**
|
|
3323
|
-
* Batch insert spans
|
|
3324
|
-
*/
|
|
3325
|
-
batchInsertSpans: (spans: SpanInsert[]) => Promise<{
|
|
3326
|
-
count: number;
|
|
3327
|
-
}>;
|
|
3328
|
-
/**
|
|
3329
|
-
* Batch insert span events
|
|
3330
|
-
*/
|
|
3331
|
-
batchInsertSpanEvents: (events: SpanEventInsert[]) => Promise<{
|
|
3332
|
-
count: number;
|
|
3333
|
-
}>;
|
|
3334
|
-
/**
|
|
3335
|
-
* List traces with filtering and pagination
|
|
3336
|
-
*/
|
|
3337
|
-
listTraces: (params?: z$1.infer<typeof listTracesSchema>) => Promise<{
|
|
3338
|
-
data: {
|
|
3339
|
-
name: string | null;
|
|
3340
|
-
id: string;
|
|
3341
|
-
createdAt: Date;
|
|
3342
|
-
updatedAt: Date;
|
|
3343
|
-
status: string;
|
|
3344
|
-
totalTokens: number;
|
|
3345
|
-
metadata: Record<string, unknown>;
|
|
3346
|
-
userId: string | null;
|
|
3347
|
-
tags: Record<string, string>;
|
|
3348
|
-
traceId: string;
|
|
3349
|
-
sessionId: string | null;
|
|
3350
|
-
startTime: Date;
|
|
3351
|
-
endTime: Date | null;
|
|
3352
|
-
durationMs: number | null;
|
|
3353
|
-
spanCount: number;
|
|
3354
|
-
totalInputTokens: number;
|
|
3355
|
-
totalOutputTokens: number;
|
|
3356
|
-
totalCost: number;
|
|
3357
|
-
}[];
|
|
3358
|
-
total: number;
|
|
3359
|
-
limit: number;
|
|
3360
|
-
offset: number;
|
|
3361
|
-
}>;
|
|
3362
|
-
/**
|
|
3363
|
-
* Get a single trace with all its spans and events
|
|
3364
|
-
*/
|
|
3365
|
-
getTraceWithSpans: (traceId: string) => Promise<{
|
|
3366
|
-
trace: {
|
|
3367
|
-
name: string | null;
|
|
3368
|
-
id: string;
|
|
3369
|
-
createdAt: Date;
|
|
3370
|
-
updatedAt: Date;
|
|
3371
|
-
status: string;
|
|
3372
|
-
totalTokens: number;
|
|
3373
|
-
metadata: Record<string, unknown>;
|
|
3374
|
-
userId: string | null;
|
|
3375
|
-
tags: Record<string, string>;
|
|
3376
|
-
traceId: string;
|
|
3377
|
-
sessionId: string | null;
|
|
3378
|
-
startTime: Date;
|
|
3379
|
-
endTime: Date | null;
|
|
3380
|
-
durationMs: number | null;
|
|
3381
|
-
spanCount: number;
|
|
3382
|
-
totalInputTokens: number;
|
|
3383
|
-
totalOutputTokens: number;
|
|
3384
|
-
totalCost: number;
|
|
3385
|
-
};
|
|
3386
|
-
spans: {
|
|
3387
|
-
name: string;
|
|
3388
|
-
id: string;
|
|
3389
|
-
createdAt: Date;
|
|
3390
|
-
updatedAt: Date;
|
|
3391
|
-
variantId: string | null;
|
|
3392
|
-
provider: string | null;
|
|
3393
|
-
input: unknown;
|
|
3394
|
-
output: unknown;
|
|
3395
|
-
environmentId: string | null;
|
|
3396
|
-
configId: string | null;
|
|
3397
|
-
providerConfigId: string | null;
|
|
3398
|
-
status: number;
|
|
3399
|
-
promptTokens: number;
|
|
3400
|
-
completionTokens: number;
|
|
3401
|
-
totalTokens: number;
|
|
3402
|
-
cost: number;
|
|
3403
|
-
requestId: string | null;
|
|
3404
|
-
model: string | null;
|
|
3405
|
-
traceId: string;
|
|
3406
|
-
spanId: string;
|
|
3407
|
-
parentSpanId: string | null;
|
|
3408
|
-
startTime: Date;
|
|
3409
|
-
endTime: Date | null;
|
|
3410
|
-
durationMs: number | null;
|
|
3411
|
-
kind: number;
|
|
3412
|
-
statusMessage: string | null;
|
|
3413
|
-
source: string;
|
|
3414
|
-
attributes: Record<string, unknown>;
|
|
3415
|
-
}[];
|
|
3416
|
-
events: {
|
|
3417
|
-
name: string;
|
|
3418
|
-
id: string;
|
|
3419
|
-
createdAt: Date;
|
|
3420
|
-
traceId: string;
|
|
3421
|
-
spanId: string;
|
|
3422
|
-
attributes: Record<string, unknown>;
|
|
3423
|
-
timestamp: Date;
|
|
3424
|
-
}[];
|
|
3425
|
-
} | undefined>;
|
|
3426
|
-
/**
|
|
3427
|
-
* Get aggregate trace statistics for a date range
|
|
3428
|
-
*/
|
|
3429
|
-
getTraceStats: (params: z$1.infer<typeof traceStatsSchema>) => Promise<{
|
|
3430
|
-
totalCost: number;
|
|
3431
|
-
totalTokens: number;
|
|
3432
|
-
totalTraces: number;
|
|
3433
|
-
avgDurationMs: number;
|
|
3434
|
-
errorCount: number;
|
|
3435
|
-
totalSpans: number;
|
|
3436
|
-
} | undefined>;
|
|
3437
|
-
};
|
|
3438
|
-
//#endregion
|
|
3439
|
-
//#region src/datalayer/variants.d.ts
|
|
3440
|
-
declare const createVariant: z$1.ZodObject<{
|
|
3441
|
-
name: z$1.ZodString;
|
|
3442
|
-
}, z$1.core.$strip>;
|
|
3443
|
-
declare const updateVariant: z$1.ZodObject<{
|
|
3444
|
-
variantId: z$1.ZodString;
|
|
3445
|
-
name: z$1.ZodOptional<z$1.ZodString>;
|
|
3446
|
-
}, z$1.core.$strip>;
|
|
3447
|
-
declare const getVariantById: z$1.ZodObject<{
|
|
3448
|
-
variantId: z$1.ZodString;
|
|
3449
|
-
}, z$1.core.$strip>;
|
|
3450
|
-
declare const deleteVariant: z$1.ZodObject<{
|
|
3451
|
-
variantId: z$1.ZodString;
|
|
3452
|
-
}, z$1.core.$strip>;
|
|
3453
|
-
declare const listVariants: z$1.ZodObject<{
|
|
3454
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
3455
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
3456
|
-
}, z$1.core.$strip>;
|
|
3457
|
-
declare const createVariantDataLayer: (db: Kysely<Database>) => {
|
|
3458
|
-
/**
|
|
3459
|
-
* Create a new variant (metadata only, no version data)
|
|
3460
|
-
*/
|
|
3461
|
-
createVariant: (params: z$1.infer<typeof createVariant>) => Promise<{
|
|
3462
|
-
name: string;
|
|
3463
|
-
id: string;
|
|
3464
|
-
createdAt: Date;
|
|
3465
|
-
updatedAt: Date;
|
|
3466
|
-
} | undefined>;
|
|
3467
|
-
/**
|
|
3468
|
-
* Update variant metadata (name only)
|
|
3469
|
-
*/
|
|
3470
|
-
updateVariant: (params: z$1.infer<typeof updateVariant>) => Promise<{
|
|
3471
|
-
name: string;
|
|
3472
|
-
id: string;
|
|
3473
|
-
createdAt: Date;
|
|
3474
|
-
updatedAt: Date;
|
|
3475
|
-
} | undefined>;
|
|
3476
|
-
/**
|
|
3477
|
-
* Get variant by ID (metadata only)
|
|
3478
|
-
*/
|
|
3479
|
-
getVariantById: (params: z$1.infer<typeof getVariantById>) => Promise<{
|
|
3480
|
-
name: string;
|
|
3481
|
-
id: string;
|
|
3482
|
-
createdAt: Date;
|
|
3483
|
-
updatedAt: Date;
|
|
3484
|
-
} | undefined>;
|
|
3485
|
-
/**
|
|
3486
|
-
* Get variant with its latest version data
|
|
3487
|
-
*/
|
|
3488
|
-
getVariantWithLatestVersion: (params: z$1.infer<typeof getVariantById>) => Promise<{
|
|
3489
|
-
latestVersion: {
|
|
3490
|
-
version: number;
|
|
3491
|
-
id: string;
|
|
3492
|
-
createdAt: Date;
|
|
3493
|
-
updatedAt: Date;
|
|
3494
|
-
variantId: string;
|
|
3495
|
-
provider: string;
|
|
3496
|
-
modelName: string;
|
|
3497
|
-
jsonData: Record<string, unknown>;
|
|
3498
|
-
} | null;
|
|
3499
|
-
name: string;
|
|
3500
|
-
id: string;
|
|
3501
|
-
createdAt: Date;
|
|
3502
|
-
updatedAt: Date;
|
|
3503
|
-
} | undefined>;
|
|
3504
|
-
/**
|
|
3505
|
-
* Delete variant and all its versions
|
|
3506
|
-
*/
|
|
3507
|
-
deleteVariant: (params: z$1.infer<typeof deleteVariant>) => Promise<{
|
|
3508
|
-
name: string;
|
|
3509
|
-
id: string;
|
|
3510
|
-
createdAt: Date;
|
|
3511
|
-
updatedAt: Date;
|
|
3512
|
-
} | undefined>;
|
|
3513
|
-
/**
|
|
3514
|
-
* List all variants (metadata only)
|
|
3515
|
-
*/
|
|
3516
|
-
listVariants: (params?: z$1.infer<typeof listVariants>) => Promise<{
|
|
3517
|
-
name: string;
|
|
3518
|
-
id: string;
|
|
3519
|
-
createdAt: Date;
|
|
3520
|
-
updatedAt: Date;
|
|
3521
|
-
}[]>;
|
|
3522
|
-
/**
|
|
3523
|
-
* List all variants with their latest version data
|
|
3524
|
-
*/
|
|
3525
|
-
listVariantsWithLatestVersion: (params?: z$1.infer<typeof listVariants>) => Promise<{
|
|
3526
|
-
latestVersion: {
|
|
3527
|
-
version: number;
|
|
3528
|
-
id: string;
|
|
3529
|
-
createdAt: Date;
|
|
3530
|
-
updatedAt: Date;
|
|
3531
|
-
variantId: string;
|
|
3532
|
-
provider: string;
|
|
3533
|
-
modelName: string;
|
|
3534
|
-
jsonData: Record<string, unknown>;
|
|
3535
|
-
} | null;
|
|
3536
|
-
name: string;
|
|
3537
|
-
id: string;
|
|
3538
|
-
createdAt: Date;
|
|
3539
|
-
updatedAt: Date;
|
|
3540
|
-
}[]>;
|
|
3541
|
-
};
|
|
3542
|
-
//#endregion
|
|
3543
|
-
//#region src/datalayer/variantVersions.d.ts
|
|
3544
|
-
declare const createVariantVersion: z$1.ZodObject<{
|
|
3545
|
-
variantId: z$1.ZodString;
|
|
3546
|
-
provider: z$1.ZodString;
|
|
3547
|
-
modelName: z$1.ZodString;
|
|
3548
|
-
jsonData: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
3549
|
-
}, z$1.core.$strip>;
|
|
3550
|
-
declare const getVariantVersionById: z$1.ZodObject<{
|
|
3551
|
-
id: z$1.ZodString;
|
|
3552
|
-
}, z$1.core.$strip>;
|
|
3553
|
-
declare const getVariantVersionsByVariantId: z$1.ZodObject<{
|
|
3554
|
-
variantId: z$1.ZodString;
|
|
3555
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
3556
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
3557
|
-
}, z$1.core.$strip>;
|
|
3558
|
-
declare const getLatestVariantVersion: z$1.ZodObject<{
|
|
3559
|
-
variantId: z$1.ZodString;
|
|
3560
|
-
}, z$1.core.$strip>;
|
|
3561
|
-
declare const getVariantVersionByNumber: z$1.ZodObject<{
|
|
3562
|
-
variantId: z$1.ZodString;
|
|
3563
|
-
version: z$1.ZodNumber;
|
|
3564
|
-
}, z$1.core.$strip>;
|
|
3565
|
-
declare const deleteVariantVersion: z$1.ZodObject<{
|
|
3566
|
-
id: z$1.ZodString;
|
|
3567
|
-
}, z$1.core.$strip>;
|
|
3568
|
-
declare const createVariantVersionsDataLayer: (db: Kysely<Database>) => {
|
|
3569
|
-
/**
|
|
3570
|
-
* Create a new version for a variant.
|
|
3571
|
-
* Auto-increments the version number based on existing versions.
|
|
3572
|
-
*/
|
|
3573
|
-
createVariantVersion: (params: z$1.infer<typeof createVariantVersion>) => Promise<{
|
|
3574
|
-
version: number;
|
|
3575
|
-
id: string;
|
|
3576
|
-
createdAt: Date;
|
|
3577
|
-
updatedAt: Date;
|
|
3578
|
-
variantId: string;
|
|
3579
|
-
provider: string;
|
|
3580
|
-
modelName: string;
|
|
3581
|
-
jsonData: Record<string, unknown>;
|
|
3582
|
-
} | undefined>;
|
|
3583
|
-
/**
|
|
3584
|
-
* Get a specific version by its UUID
|
|
3585
|
-
*/
|
|
3586
|
-
getVariantVersionById: (params: z$1.infer<typeof getVariantVersionById>) => Promise<{
|
|
3587
|
-
version: number;
|
|
3588
|
-
id: string;
|
|
3589
|
-
createdAt: Date;
|
|
3590
|
-
updatedAt: Date;
|
|
3591
|
-
variantId: string;
|
|
3592
|
-
provider: string;
|
|
3593
|
-
modelName: string;
|
|
3594
|
-
jsonData: Record<string, unknown>;
|
|
3595
|
-
} | undefined>;
|
|
3596
|
-
/**
|
|
3597
|
-
* Get all versions for a variant, ordered by version number descending (latest first)
|
|
3598
|
-
*/
|
|
3599
|
-
getVariantVersionsByVariantId: (params: z$1.infer<typeof getVariantVersionsByVariantId>) => Promise<{
|
|
3600
|
-
version: number;
|
|
3601
|
-
id: string;
|
|
3602
|
-
createdAt: Date;
|
|
3603
|
-
updatedAt: Date;
|
|
3604
|
-
variantId: string;
|
|
3605
|
-
provider: string;
|
|
3606
|
-
modelName: string;
|
|
3607
|
-
jsonData: Record<string, unknown>;
|
|
3608
|
-
}[]>;
|
|
3609
|
-
/**
|
|
3610
|
-
* Get the latest version for a variant
|
|
3611
|
-
*/
|
|
3612
|
-
getLatestVariantVersion: (params: z$1.infer<typeof getLatestVariantVersion>) => Promise<{
|
|
3613
|
-
version: number;
|
|
3614
|
-
id: string;
|
|
3615
|
-
createdAt: Date;
|
|
3616
|
-
updatedAt: Date;
|
|
3617
|
-
variantId: string;
|
|
3618
|
-
provider: string;
|
|
3619
|
-
modelName: string;
|
|
3620
|
-
jsonData: Record<string, unknown>;
|
|
3621
|
-
} | undefined>;
|
|
3622
|
-
/**
|
|
3623
|
-
* Get a specific version by variant ID and version number
|
|
3624
|
-
*/
|
|
3625
|
-
getVariantVersionByNumber: (params: z$1.infer<typeof getVariantVersionByNumber>) => Promise<{
|
|
3626
|
-
version: number;
|
|
3627
|
-
id: string;
|
|
3628
|
-
createdAt: Date;
|
|
3629
|
-
updatedAt: Date;
|
|
3630
|
-
variantId: string;
|
|
3631
|
-
provider: string;
|
|
3632
|
-
modelName: string;
|
|
3633
|
-
jsonData: Record<string, unknown>;
|
|
3634
|
-
} | undefined>;
|
|
3635
|
-
/**
|
|
3636
|
-
* Delete a specific version (use with caution, may break targeting rules)
|
|
3637
|
-
*/
|
|
3638
|
-
deleteVariantVersion: (params: z$1.infer<typeof deleteVariantVersion>) => Promise<{
|
|
3639
|
-
version: number;
|
|
3640
|
-
id: string;
|
|
3641
|
-
createdAt: Date;
|
|
3642
|
-
updatedAt: Date;
|
|
3643
|
-
variantId: string;
|
|
3644
|
-
provider: string;
|
|
3645
|
-
modelName: string;
|
|
3646
|
-
jsonData: Record<string, unknown>;
|
|
3647
|
-
} | undefined>;
|
|
3648
|
-
/**
|
|
3649
|
-
* Delete all versions for a variant (typically when deleting the variant itself)
|
|
3650
|
-
*/
|
|
3651
|
-
deleteVariantVersionsByVariantId: (params: z$1.infer<typeof getLatestVariantVersion>) => Promise<{
|
|
3652
|
-
version: number;
|
|
3653
|
-
id: string;
|
|
3654
|
-
createdAt: Date;
|
|
3655
|
-
updatedAt: Date;
|
|
3656
|
-
variantId: string;
|
|
3657
|
-
provider: string;
|
|
3658
|
-
modelName: string;
|
|
3659
|
-
jsonData: Record<string, unknown>;
|
|
3660
|
-
}[]>;
|
|
3661
|
-
/**
|
|
3662
|
-
* Get version with variant metadata (name)
|
|
3663
|
-
*/
|
|
3664
|
-
getVariantVersionWithVariant: (params: z$1.infer<typeof getVariantVersionById>) => Promise<{
|
|
3665
|
-
variantName: string;
|
|
3666
|
-
version: number;
|
|
3667
|
-
id: string;
|
|
3668
|
-
createdAt: Date;
|
|
3669
|
-
updatedAt: Date;
|
|
3670
|
-
variantId: string;
|
|
3671
|
-
provider: string;
|
|
3672
|
-
modelName: string;
|
|
3673
|
-
jsonData: Record<string, unknown>;
|
|
3674
|
-
} | undefined>;
|
|
3675
|
-
/**
|
|
3676
|
-
* Get all versions for a variant with variant metadata
|
|
3677
|
-
*/
|
|
3678
|
-
getVariantVersionsWithVariantByVariantId: (params: z$1.infer<typeof getVariantVersionsByVariantId>) => Promise<{
|
|
3679
|
-
variantName: string;
|
|
3680
|
-
version: number;
|
|
3681
|
-
id: string;
|
|
3682
|
-
createdAt: Date;
|
|
3683
|
-
updatedAt: Date;
|
|
3684
|
-
variantId: string;
|
|
3685
|
-
provider: string;
|
|
3686
|
-
modelName: string;
|
|
3687
|
-
jsonData: Record<string, unknown>;
|
|
3688
|
-
}[]>;
|
|
3689
|
-
};
|
|
3690
|
-
//#endregion
|
|
3691
|
-
//#region src/datalayer/workspaceSettings.d.ts
|
|
3692
|
-
declare const updateWorkspaceSettings: z$1.ZodObject<{
|
|
3693
|
-
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3694
|
-
setupComplete: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
3695
|
-
superAdminId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
3696
|
-
}, z$1.core.$strip>;
|
|
3697
|
-
declare const createWorkspaceSettingsDataLayer: (db: Kysely<Database>) => {
|
|
3698
|
-
/**
|
|
3699
|
-
* Get workspace settings (creates default if not exists)
|
|
3700
|
-
*/
|
|
3701
|
-
getWorkspaceSettings: () => Promise<{
|
|
3702
|
-
name: string | null;
|
|
3703
|
-
id: string;
|
|
3704
|
-
createdAt: Date;
|
|
3705
|
-
updatedAt: Date;
|
|
3706
|
-
setupComplete: boolean;
|
|
3707
|
-
superAdminId: string | null;
|
|
3708
|
-
} | undefined>;
|
|
3709
|
-
/**
|
|
3710
|
-
* Update workspace settings
|
|
3711
|
-
*/
|
|
3712
|
-
updateWorkspaceSettings: (params: z$1.infer<typeof updateWorkspaceSettings>) => Promise<{
|
|
3713
|
-
name: string | null;
|
|
3714
|
-
id: string;
|
|
3715
|
-
createdAt: Date;
|
|
3716
|
-
updatedAt: Date;
|
|
3717
|
-
setupComplete: boolean;
|
|
3718
|
-
superAdminId: string | null;
|
|
3719
|
-
} | undefined>;
|
|
3720
|
-
/**
|
|
3721
|
-
* Get the super admin user ID
|
|
3722
|
-
*/
|
|
3723
|
-
getSuperAdminId: () => Promise<string | null>;
|
|
3724
|
-
/**
|
|
3725
|
-
* Set the super admin user ID (only if not already set)
|
|
3726
|
-
*/
|
|
3727
|
-
setSuperAdminId: (userId: string) => Promise<boolean>;
|
|
3728
|
-
/**
|
|
3729
|
-
* Check if initial setup has been completed
|
|
3730
|
-
*/
|
|
3731
|
-
isSetupComplete: () => Promise<boolean>;
|
|
3732
|
-
/**
|
|
3733
|
-
* Mark initial setup as complete
|
|
3734
|
-
*/
|
|
3735
|
-
markSetupComplete: () => Promise<{
|
|
3736
|
-
name: string | null;
|
|
3737
|
-
id: string;
|
|
3738
|
-
createdAt: Date;
|
|
3739
|
-
updatedAt: Date;
|
|
3740
|
-
setupComplete: boolean;
|
|
3741
|
-
superAdminId: string | null;
|
|
3742
|
-
} | undefined>;
|
|
3743
|
-
};
|
|
3744
|
-
//#endregion
|
|
3745
|
-
//#region src/datalayer/interface.d.ts
|
|
3746
|
-
type ConfigsDataLayer = ReturnType<typeof createConfigDataLayer>;
|
|
3747
|
-
type ConfigVariantsDataLayer = ReturnType<typeof createConfigVariantDataLayer>;
|
|
3748
|
-
type DatasetsDataLayer = ReturnType<typeof createDatasetsDataLayer>;
|
|
3749
|
-
type EnvironmentsDataLayer = ReturnType<typeof createEnvironmentDataLayer>;
|
|
3750
|
-
type EnvironmentSecretsDataLayer = ReturnType<typeof createEnvironmentSecretDataLayer>;
|
|
3751
|
-
type GuardrailConfigsDataLayer = ReturnType<typeof createGuardrailConfigsDataLayer>;
|
|
3752
|
-
type LLMRequestsDataLayer = ReturnType<typeof createLLMRequestsDataLayer>;
|
|
3753
|
-
type PlaygroundsDataLayer = ReturnType<typeof createPlaygroundDataLayer>;
|
|
3754
|
-
type PlaygroundResultsDataLayer = ReturnType<typeof createPlaygroundResultsDataLayer>;
|
|
3755
|
-
type PlaygroundRunsDataLayer = ReturnType<typeof createPlaygroundRunsDataLayer>;
|
|
3756
|
-
type ProviderConfigsDataLayer = ReturnType<typeof createProviderConfigsDataLayer>;
|
|
3757
|
-
type ProviderGuardrailOverridesDataLayer = ReturnType<typeof createProviderGuardrailOverridesDataLayer>;
|
|
3758
|
-
type TargetingRulesDataLayer = ReturnType<typeof createTargetingRulesDataLayer>;
|
|
3759
|
-
type VariantsDataLayer = ReturnType<typeof createVariantDataLayer>;
|
|
3760
|
-
type VariantVersionsDataLayer = ReturnType<typeof createVariantVersionsDataLayer>;
|
|
3761
|
-
type TracesDataLayer = ReturnType<typeof createTracesDataLayer>;
|
|
3762
|
-
type WorkspaceSettingsDataLayer = ReturnType<typeof createWorkspaceSettingsDataLayer>;
|
|
3763
|
-
type DataLayer = ConfigsDataLayer & ConfigVariantsDataLayer & DatasetsDataLayer & EnvironmentsDataLayer & EnvironmentSecretsDataLayer & GuardrailConfigsDataLayer & LLMRequestsDataLayer & PlaygroundsDataLayer & PlaygroundResultsDataLayer & PlaygroundRunsDataLayer & ProviderConfigsDataLayer & ProviderGuardrailOverridesDataLayer & TargetingRulesDataLayer & TracesDataLayer & VariantsDataLayer & VariantVersionsDataLayer & WorkspaceSettingsDataLayer;
|
|
3764
|
-
//#endregion
|
|
3765
|
-
//#region src/datalayer/create.d.ts
|
|
3766
|
-
/**
|
|
3767
|
-
* Create all datalayers from a Kysely database instance.
|
|
3768
|
-
* Returns a flat object with all datalayer methods spread together.
|
|
3769
|
-
*/
|
|
3770
|
-
declare function createDataLayer(db: Kysely<Database>): DataLayer;
|
|
3771
|
-
//#endregion
|
|
3772
1188
|
//#region src/pricing/types.d.ts
|
|
3773
1189
|
/**
|
|
3774
1190
|
* Pricing types for cost tracking
|
|
@@ -3974,232 +1390,4 @@ declare class LLMOpsPricingProvider implements PricingProvider {
|
|
|
3974
1390
|
*/
|
|
3975
1391
|
declare function getDefaultPricingProvider(): LLMOpsPricingProvider;
|
|
3976
1392
|
//#endregion
|
|
3977
|
-
|
|
3978
|
-
interface AuthClientDatabaseConfig {
|
|
3979
|
-
/** Pre-configured Kysely instance with correct schema */
|
|
3980
|
-
db: Kysely<Database>;
|
|
3981
|
-
/** Database type (mapped to Better Auth compatible types) */
|
|
3982
|
-
type: 'postgres' | 'mysql' | 'sqlite' | 'mssql';
|
|
3983
|
-
}
|
|
3984
|
-
interface AuthClientOptions {
|
|
3985
|
-
/** Database configuration */
|
|
3986
|
-
database: any | AuthClientDatabaseConfig;
|
|
3987
|
-
/**
|
|
3988
|
-
* Callback fired after a user is created (signs up) successfully.
|
|
3989
|
-
* Use this to set up workspace settings like superAdminId.
|
|
3990
|
-
*/
|
|
3991
|
-
onUserCreated?: (userId: string) => Promise<void>;
|
|
3992
|
-
/**
|
|
3993
|
-
* Base URL for the application (used for auth redirects and origin validation)
|
|
3994
|
-
*/
|
|
3995
|
-
baseURL?: string;
|
|
3996
|
-
/**
|
|
3997
|
-
* Additional trusted origins for CORS (e.g., production domains).
|
|
3998
|
-
* Set via AUTH_TRUSTED_ORIGINS environment variable (comma-separated).
|
|
3999
|
-
*/
|
|
4000
|
-
trustedOrigins?: string[];
|
|
4001
|
-
}
|
|
4002
|
-
/**
|
|
4003
|
-
* Get Better Auth client options
|
|
4004
|
-
*
|
|
4005
|
-
* @param options - Auth client options including database config and hooks
|
|
4006
|
-
*/
|
|
4007
|
-
declare const getAuthClientOptions: (options: AuthClientOptions) => BetterAuthOptions;
|
|
4008
|
-
//#endregion
|
|
4009
|
-
//#region src/manifest/types.d.ts
|
|
4010
|
-
/**
|
|
4011
|
-
* Pre-computed variant version data needed for routing
|
|
4012
|
-
*/
|
|
4013
|
-
interface ManifestVariantVersion {
|
|
4014
|
-
id: string;
|
|
4015
|
-
variantId: string;
|
|
4016
|
-
version: number;
|
|
4017
|
-
provider: string;
|
|
4018
|
-
providerConfigId: string | null;
|
|
4019
|
-
modelName: string;
|
|
4020
|
-
jsonData: Record<string, unknown>;
|
|
4021
|
-
}
|
|
4022
|
-
/**
|
|
4023
|
-
* A targeting rule entry in the manifest
|
|
4024
|
-
* Pre-resolved with all necessary data for routing
|
|
4025
|
-
*/
|
|
4026
|
-
interface ManifestTargetingRule {
|
|
4027
|
-
id: string;
|
|
4028
|
-
configVariantId: string;
|
|
4029
|
-
variantVersionId: string | null;
|
|
4030
|
-
weight: number;
|
|
4031
|
-
priority: number;
|
|
4032
|
-
enabled: boolean;
|
|
4033
|
-
conditions: RulesLogic | null;
|
|
4034
|
-
resolvedVersion: ManifestVariantVersion;
|
|
4035
|
-
}
|
|
4036
|
-
/**
|
|
4037
|
-
* Config entry in the manifest
|
|
4038
|
-
*/
|
|
4039
|
-
interface ManifestConfig {
|
|
4040
|
-
id: string;
|
|
4041
|
-
slug: string;
|
|
4042
|
-
name: string | null;
|
|
4043
|
-
}
|
|
4044
|
-
/**
|
|
4045
|
-
* Environment entry in the manifest
|
|
4046
|
-
*/
|
|
4047
|
-
interface ManifestEnvironment {
|
|
4048
|
-
id: string;
|
|
4049
|
-
slug: string;
|
|
4050
|
-
name: string;
|
|
4051
|
-
isProd: boolean;
|
|
4052
|
-
}
|
|
4053
|
-
/**
|
|
4054
|
-
* Guardrail configuration in the manifest
|
|
4055
|
-
* Pre-loaded for gateway use without additional DB queries
|
|
4056
|
-
*/
|
|
4057
|
-
interface ManifestGuardrail {
|
|
4058
|
-
id: string;
|
|
4059
|
-
name: string;
|
|
4060
|
-
pluginId: string;
|
|
4061
|
-
functionId: string;
|
|
4062
|
-
hookType: 'beforeRequestHook' | 'afterRequestHook';
|
|
4063
|
-
parameters: Record<string, unknown>;
|
|
4064
|
-
priority: number;
|
|
4065
|
-
onFail: 'block' | 'log';
|
|
4066
|
-
}
|
|
4067
|
-
/**
|
|
4068
|
-
* Provider-specific guardrail override in the manifest
|
|
4069
|
-
*/
|
|
4070
|
-
interface ManifestProviderGuardrailOverride {
|
|
4071
|
-
id: string;
|
|
4072
|
-
providerConfigId: string;
|
|
4073
|
-
guardrailConfigId: string;
|
|
4074
|
-
enabled: boolean;
|
|
4075
|
-
parameters: Record<string, unknown> | null;
|
|
4076
|
-
}
|
|
4077
|
-
/**
|
|
4078
|
-
* The complete routing manifest
|
|
4079
|
-
* Stored in cache under key: "gateway:manifest"
|
|
4080
|
-
*/
|
|
4081
|
-
interface GatewayManifest {
|
|
4082
|
-
version: number;
|
|
4083
|
-
builtAt: string;
|
|
4084
|
-
configs: Record<string, ManifestConfig>;
|
|
4085
|
-
configsBySlug: Record<string, string>;
|
|
4086
|
-
environments: Record<string, ManifestEnvironment>;
|
|
4087
|
-
environmentsBySlug: Record<string, string>;
|
|
4088
|
-
routingTable: Record<string, Record<string, ManifestTargetingRule[]>>;
|
|
4089
|
-
secretToEnvironment: Record<string, string>;
|
|
4090
|
-
guardrails: {
|
|
4091
|
-
beforeRequestHook: ManifestGuardrail[];
|
|
4092
|
-
afterRequestHook: ManifestGuardrail[];
|
|
4093
|
-
};
|
|
4094
|
-
providerGuardrailOverrides: Record<string, ManifestProviderGuardrailOverride[]>;
|
|
4095
|
-
}
|
|
4096
|
-
/**
|
|
4097
|
-
* Context passed to JSONLogic for condition evaluation
|
|
4098
|
-
*/
|
|
4099
|
-
interface RoutingContext {
|
|
4100
|
-
headers?: Record<string, string>;
|
|
4101
|
-
user?: {
|
|
4102
|
-
id?: string;
|
|
4103
|
-
email?: string;
|
|
4104
|
-
groups?: string[];
|
|
4105
|
-
[key: string]: unknown;
|
|
4106
|
-
};
|
|
4107
|
-
request?: {
|
|
4108
|
-
path?: string;
|
|
4109
|
-
method?: string;
|
|
4110
|
-
ip?: string;
|
|
4111
|
-
};
|
|
4112
|
-
custom?: Record<string, unknown>;
|
|
4113
|
-
timestamp?: number;
|
|
4114
|
-
}
|
|
4115
|
-
/**
|
|
4116
|
-
* Result of routing a request
|
|
4117
|
-
*/
|
|
4118
|
-
interface RoutingResult {
|
|
4119
|
-
configId: string;
|
|
4120
|
-
environmentId: string;
|
|
4121
|
-
variantId: string;
|
|
4122
|
-
version: ManifestVariantVersion;
|
|
4123
|
-
rule: ManifestTargetingRule;
|
|
4124
|
-
}
|
|
4125
|
-
//#endregion
|
|
4126
|
-
//#region src/manifest/builder.d.ts
|
|
4127
|
-
/**
|
|
4128
|
-
* Builds the gateway routing manifest from database
|
|
4129
|
-
*/
|
|
4130
|
-
declare class ManifestBuilder {
|
|
4131
|
-
private db;
|
|
4132
|
-
constructor(db: Kysely<Database>);
|
|
4133
|
-
/**
|
|
4134
|
-
* Build the complete routing manifest from database
|
|
4135
|
-
*/
|
|
4136
|
-
build(): Promise<GatewayManifest>;
|
|
4137
|
-
}
|
|
4138
|
-
//#endregion
|
|
4139
|
-
//#region src/manifest/service.d.ts
|
|
4140
|
-
declare class ManifestService {
|
|
4141
|
-
private cache;
|
|
4142
|
-
private ttlMs;
|
|
4143
|
-
private builder;
|
|
4144
|
-
constructor(cache: CacheService, db: Kysely<Database>, ttlMs?: number);
|
|
4145
|
-
/**
|
|
4146
|
-
* Get the current manifest, building if necessary
|
|
4147
|
-
*/
|
|
4148
|
-
getManifest(): Promise<GatewayManifest>;
|
|
4149
|
-
/**
|
|
4150
|
-
* Force invalidate the manifest (called on mutations)
|
|
4151
|
-
*/
|
|
4152
|
-
invalidate(): Promise<void>;
|
|
4153
|
-
/**
|
|
4154
|
-
* Invalidate and immediately rebuild (atomic refresh)
|
|
4155
|
-
*/
|
|
4156
|
-
refresh(): Promise<GatewayManifest>;
|
|
4157
|
-
/**
|
|
4158
|
-
* Get manifest version without fetching full manifest
|
|
4159
|
-
* Useful for checking if manifest is stale
|
|
4160
|
-
*/
|
|
4161
|
-
getVersion(): Promise<number | null>;
|
|
4162
|
-
/**
|
|
4163
|
-
* Check if manifest exists in cache
|
|
4164
|
-
*/
|
|
4165
|
-
hasManifest(): Promise<boolean>;
|
|
4166
|
-
}
|
|
4167
|
-
//#endregion
|
|
4168
|
-
//#region src/manifest/router.d.ts
|
|
4169
|
-
/**
|
|
4170
|
-
* Router for evaluating the gateway manifest and selecting variants
|
|
4171
|
-
*/
|
|
4172
|
-
declare class ManifestRouter {
|
|
4173
|
-
private manifest;
|
|
4174
|
-
constructor(manifest: GatewayManifest);
|
|
4175
|
-
/**
|
|
4176
|
-
* Resolve a config identifier (UUID or slug) to config ID
|
|
4177
|
-
*/
|
|
4178
|
-
resolveConfigId(configIdOrSlug: string): string | null;
|
|
4179
|
-
/**
|
|
4180
|
-
* Resolve environment from secret value
|
|
4181
|
-
*/
|
|
4182
|
-
resolveEnvironmentFromSecret(secretValue: string): string | null;
|
|
4183
|
-
/**
|
|
4184
|
-
* Get production environment ID
|
|
4185
|
-
*/
|
|
4186
|
-
getProductionEnvironmentId(): string | null;
|
|
4187
|
-
/**
|
|
4188
|
-
* Get environment by ID
|
|
4189
|
-
*/
|
|
4190
|
-
getEnvironment(environmentId: string): ManifestEnvironment;
|
|
4191
|
-
/**
|
|
4192
|
-
* Get config by ID
|
|
4193
|
-
*/
|
|
4194
|
-
getConfig(configId: string): ManifestConfig;
|
|
4195
|
-
/**
|
|
4196
|
-
* Route a request to the appropriate variant version (first match wins)
|
|
4197
|
-
*/
|
|
4198
|
-
route(configIdOrSlug: string, environmentId: string, context?: RoutingContext): RoutingResult | null;
|
|
4199
|
-
/**
|
|
4200
|
-
* Route with weighted random selection among matching rules of same priority
|
|
4201
|
-
*/
|
|
4202
|
-
routeWithWeights(configIdOrSlug: string, environmentId: string, context?: RoutingContext): RoutingResult | null;
|
|
4203
|
-
}
|
|
4204
|
-
//#endregion
|
|
4205
|
-
export { type AnthropicProviderConfig, type AnyProviderConfig, AuthClientDatabaseConfig, AuthClientOptions, type AzureAIProviderConfig, type AzureOpenAIProviderConfig, BaseCacheConfig, type BaseProviderConfig, type BedrockProviderConfig, COST_SUMMARY_GROUP_BY, CacheBackend, CacheBackendType, CacheConfig, CacheEntry, CacheOptions, CacheService, CacheStats, ChatCompletionCreateParamsBase, type Config, type ConfigVariant, type ConfigVariantsDataLayer, type ConfigVariantsTable, type ConfigsDataLayer, type ConfigsTable, type CortexProviderConfig, CostResult, type CostSummaryGroupBy, DEFAULT_PROVIDER_ENV_VARS, type DataLayer, type Database, DatabaseConnection, DatabaseOptions, DatabaseType, type Dataset, type DatasetRecord, DatasetRecordsTable, type DatasetVersion, type DatasetVersionRecord, DatasetVersionRecordsTable, DatasetVersionsTable, type DatasetsDataLayer, DatasetsTable, type Environment, type EnvironmentSecret, type EnvironmentSecretsDataLayer, type EnvironmentSecretsTable, type EnvironmentsDataLayer, type EnvironmentsTable, FileCacheBackend, FileCacheConfig, type FireworksAIProviderConfig, type GatewayManifest, type GoogleProviderConfig, type GuardrailConfig, type GuardrailConfigsDataLayer, GuardrailConfigsTable, type GuardrailResult, type GuardrailResults, type HuggingFaceProviderConfig, type InlineProviderConfig, type InlineProvidersConfig, Insertable, LLMOPS_INTERNAL_HEADER, LLMOPS_REQUEST_ID_HEADER, LLMOPS_SESSION_ID_HEADER, LLMOPS_SPAN_ID_HEADER, LLMOPS_SPAN_NAME_HEADER, LLMOPS_TRACE_ID_HEADER, LLMOPS_TRACE_NAME_HEADER, LLMOPS_USER_ID_HEADER, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, LLMOpsPricingProvider, type LLMRequest, type LLMRequestInsert, type LLMRequestsDataLayer, LLMRequestsTable, MS, ManifestBuilder, type ManifestConfig, type ManifestEnvironment, type ManifestGuardrail, type ManifestProviderGuardrailOverride, ManifestRouter, ManifestService, type ManifestTargetingRule, type ManifestVariantVersion, MemoryCacheBackend, MemoryCacheConfig, MigrationOptions, MigrationResult, type MistralAIProviderConfig, ModelPricing, type OpenAIProviderConfig, type OracleProviderConfig, type Playground, type PlaygroundColumn, type PlaygroundResult, type PlaygroundResultsDataLayer, PlaygroundResultsTable, type PlaygroundRun, type PlaygroundRunsDataLayer, PlaygroundRunsTable, type PlaygroundsDataLayer, PlaygroundsTable, Prettify, PricingProvider, type ProviderConfig, type ProviderConfigMap, type ProviderConfigsDataLayer, ProviderConfigsTable, type ProviderGuardrailOverride, type ProviderGuardrailOverridesDataLayer, ProviderGuardrailOverridesTable, type ProvidersConfig, type RoutingContext, type RoutingResult, SCHEMA_METADATA, type SagemakerProviderConfig, Selectable, Span, SpanEvent, type SpanEventInsert, SpanEventsTable, type SpanInsert, SpansTable, type StabilityAIProviderConfig, SupportedProviders, type TableName, type TargetingRule, type TargetingRulesDataLayer, type TargetingRulesTable, Trace, type TraceUpsert, type TracesDataLayer, TracesTable, Updateable, UsageData, type ValidatedLLMOpsConfig, type Variant, VariantJsonData, type VariantVersion, type VariantVersionsDataLayer, VariantVersionsTable, type VariantsDataLayer, type VariantsTable, type VertexAIProviderConfig, type WorkersAIProviderConfig, type WorkspaceSettings, type WorkspaceSettingsDataLayer, WorkspaceSettingsTable, calculateCacheAwareCost, calculateCost, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createConfigDataLayer, createConfigVariantDataLayer, createDataLayer, createDatabase, createDatabaseFromConnection, createDatasetsDataLayer, createEnvironmentDataLayer, createEnvironmentSecretDataLayer, createGuardrailConfigsDataLayer, createLLMRequestsDataLayer, createNeonDialect, createPlaygroundDataLayer, createPlaygroundResultsDataLayer, createPlaygroundRunsDataLayer, createProviderConfigsDataLayer, createProviderGuardrailOverridesDataLayer, createTargetingRulesDataLayer, createTracesDataLayer, createVariantDataLayer, createVariantVersionsDataLayer, createWorkspaceSettingsDataLayer, datasetRecordsSchema, datasetVersionRecordsSchema, datasetVersionsSchema, datasetsSchema, detectDatabaseType, dollarsToMicroDollars, environmentSecretsSchema, environmentsSchema, executeWithSchema, formatCost, gateway, generateId, getAuthClientOptions, getDefaultPricingProvider, getDefaultProviders, getMigrations, guardrailConfigsSchema, llmRequestsSchema, llmopsConfigSchema, logger, matchType, mergeWithDefaultProviders, microDollarsToDollars, parsePartialTableData, parseTableData, playgroundColumnSchema, playgroundResultsSchema, playgroundRunsSchema, playgroundsSchema, providerConfigsSchema, providerGuardrailOverridesSchema, runAutoMigrations, schemas, spanEventsSchema, spansSchema, targetingRulesSchema, tracesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
|
1393
|
+
export { type AnthropicProviderConfig, type AnyProviderConfig, type AzureAIProviderConfig, type AzureOpenAIProviderConfig, BaseCacheConfig, type BaseProviderConfig, type BedrockProviderConfig, CacheBackend, CacheBackendType, CacheConfig, CacheEntry, CacheOptions, CacheService, CacheStats, ChatCompletionCreateParamsBase, type CortexProviderConfig, CostResult, DEFAULT_PROVIDER_ENV_VARS, FileCacheBackend, FileCacheConfig, type FireworksAIProviderConfig, type GoogleProviderConfig, type HuggingFaceProviderConfig, type InlineProviderConfig, type InlineProvidersConfig, LLMOPS_INTERNAL_HEADER, LLMOPS_REQUEST_ID_HEADER, LLMOPS_SESSION_ID_HEADER, LLMOPS_SPAN_ID_HEADER, LLMOPS_SPAN_NAME_HEADER, LLMOPS_TRACE_ID_HEADER, LLMOPS_TRACE_NAME_HEADER, LLMOPS_USER_ID_HEADER, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, LLMOpsPricingProvider, MS, MemoryCacheBackend, MemoryCacheConfig, type MistralAIProviderConfig, ModelPricing, type OpenAIProviderConfig, type OracleProviderConfig, Prettify, PricingProvider, type ProviderConfigMap, type ProvidersConfig, type SagemakerProviderConfig, type StabilityAIProviderConfig, SupportedProviders, UsageData, type ValidatedLLMOpsConfig, VariantJsonData, type VertexAIProviderConfig, type WorkersAIProviderConfig, calculateCacheAwareCost, calculateCost, chatCompletionCreateParamsBaseSchema, dollarsToMicroDollars, formatCost, gateway, generateId, getDefaultPricingProvider, getDefaultProviders, llmopsConfigSchema, logger, mergeWithDefaultProviders, microDollarsToDollars, validateLLMOpsConfig, variantJsonDataSchema };
|