@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.
@@ -1,3663 +0,0 @@
1
- import { ColumnType, Dialect, Generated, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect } from "kysely";
2
- import * as zod0 from "zod";
3
- import { z } from "zod";
4
- import { NeonQueryFunction } from "@neondatabase/serverless";
5
-
6
- //#region src/db/schema.d.ts
7
- declare const configsSchema: z.ZodObject<{
8
- slug: z.ZodString;
9
- name: z.ZodOptional<z.ZodString>;
10
- id: z.ZodString;
11
- createdAt: z.ZodDate;
12
- updatedAt: z.ZodDate;
13
- }, z.core.$strip>;
14
- declare const variantsSchema: z.ZodObject<{
15
- name: z.ZodString;
16
- id: z.ZodString;
17
- createdAt: z.ZodDate;
18
- updatedAt: z.ZodDate;
19
- }, z.core.$strip>;
20
- declare const variantVersionsSchema: z.ZodObject<{
21
- variantId: z.ZodString;
22
- version: z.ZodNumber;
23
- provider: z.ZodString;
24
- modelName: z.ZodString;
25
- jsonData: z.ZodRecord<z.ZodString, z.ZodUnknown>;
26
- id: z.ZodString;
27
- createdAt: z.ZodDate;
28
- updatedAt: z.ZodDate;
29
- }, z.core.$strip>;
30
- declare const environmentsSchema: z.ZodObject<{
31
- name: z.ZodString;
32
- slug: z.ZodString;
33
- isProd: z.ZodDefault<z.ZodBoolean>;
34
- id: z.ZodString;
35
- createdAt: z.ZodDate;
36
- updatedAt: z.ZodDate;
37
- }, z.core.$strip>;
38
- declare const environmentSecretsSchema: z.ZodObject<{
39
- environmentId: z.ZodString;
40
- keyName: z.ZodString;
41
- keyValue: z.ZodString;
42
- id: z.ZodString;
43
- createdAt: z.ZodDate;
44
- updatedAt: z.ZodDate;
45
- }, z.core.$strip>;
46
- declare const configVariantsSchema: z.ZodObject<{
47
- configId: z.ZodString;
48
- variantId: z.ZodString;
49
- id: z.ZodString;
50
- createdAt: z.ZodDate;
51
- updatedAt: z.ZodDate;
52
- }, z.core.$strip>;
53
- declare const targetingRulesSchema: z.ZodObject<{
54
- environmentId: z.ZodString;
55
- configId: z.ZodString;
56
- configVariantId: z.ZodString;
57
- variantVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
58
- weight: z.ZodDefault<z.ZodNumber>;
59
- priority: z.ZodDefault<z.ZodNumber>;
60
- enabled: z.ZodDefault<z.ZodBoolean>;
61
- conditions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
62
- id: z.ZodString;
63
- createdAt: z.ZodDate;
64
- updatedAt: z.ZodDate;
65
- }, z.core.$strip>;
66
- declare const workspaceSettingsSchema: z.ZodObject<{
67
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
68
- setupComplete: z.ZodDefault<z.ZodBoolean>;
69
- superAdminId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
70
- id: z.ZodString;
71
- createdAt: z.ZodDate;
72
- updatedAt: z.ZodDate;
73
- }, z.core.$strip>;
74
- declare const providerConfigsSchema: z.ZodObject<{
75
- providerId: z.ZodString;
76
- slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
77
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
78
- config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
79
- enabled: z.ZodDefault<z.ZodBoolean>;
80
- id: z.ZodString;
81
- createdAt: z.ZodDate;
82
- updatedAt: z.ZodDate;
83
- }, z.core.$strip>;
84
- declare const playgroundColumnSchema: z.ZodObject<{
85
- id: z.ZodString;
86
- name: z.ZodString;
87
- position: z.ZodNumber;
88
- providerConfigId: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
89
- modelName: z.ZodString;
90
- messages: z.ZodArray<z.ZodObject<{
91
- role: z.ZodEnum<{
92
- system: "system";
93
- user: "user";
94
- assistant: "assistant";
95
- }>;
96
- content: z.ZodString;
97
- }, z.core.$strip>>;
98
- temperature: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
99
- maxTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
100
- topP: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
101
- frequencyPenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
102
- presencePenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
103
- configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
104
- variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
105
- variantVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
106
- }, z.core.$strip>;
107
- declare const playgroundsSchema: z.ZodObject<{
108
- name: z.ZodString;
109
- datasetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
110
- columns: z.ZodNullable<z.ZodArray<z.ZodObject<{
111
- id: z.ZodString;
112
- name: z.ZodString;
113
- position: z.ZodNumber;
114
- providerConfigId: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
115
- modelName: z.ZodString;
116
- messages: z.ZodArray<z.ZodObject<{
117
- role: z.ZodEnum<{
118
- system: "system";
119
- user: "user";
120
- assistant: "assistant";
121
- }>;
122
- content: z.ZodString;
123
- }, z.core.$strip>>;
124
- temperature: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
125
- maxTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
126
- topP: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
127
- frequencyPenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
128
- presencePenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
129
- configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
130
- variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
131
- variantVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
132
- }, z.core.$strip>>>;
133
- id: z.ZodString;
134
- createdAt: z.ZodDate;
135
- updatedAt: z.ZodDate;
136
- }, z.core.$strip>;
137
- declare const playgroundRunsSchema: z.ZodObject<{
138
- playgroundId: z.ZodString;
139
- datasetId: z.ZodNullable<z.ZodString>;
140
- datasetVersionId: z.ZodNullable<z.ZodString>;
141
- status: z.ZodEnum<{
142
- pending: "pending";
143
- running: "running";
144
- completed: "completed";
145
- failed: "failed";
146
- cancelled: "cancelled";
147
- }>;
148
- startedAt: z.ZodNullable<z.ZodDate>;
149
- completedAt: z.ZodNullable<z.ZodDate>;
150
- totalRecords: z.ZodDefault<z.ZodNumber>;
151
- completedRecords: z.ZodDefault<z.ZodNumber>;
152
- id: z.ZodString;
153
- createdAt: z.ZodDate;
154
- updatedAt: z.ZodDate;
155
- }, z.core.$strip>;
156
- declare const playgroundResultsSchema: z.ZodObject<{
157
- runId: z.ZodString;
158
- columnId: z.ZodString;
159
- datasetRecordId: z.ZodNullable<z.ZodString>;
160
- inputVariables: z.ZodRecord<z.ZodString, z.ZodUnknown>;
161
- outputContent: z.ZodNullable<z.ZodString>;
162
- status: z.ZodEnum<{
163
- pending: "pending";
164
- running: "running";
165
- completed: "completed";
166
- failed: "failed";
167
- }>;
168
- error: z.ZodNullable<z.ZodString>;
169
- latencyMs: z.ZodNullable<z.ZodNumber>;
170
- promptTokens: z.ZodNullable<z.ZodNumber>;
171
- completionTokens: z.ZodNullable<z.ZodNumber>;
172
- totalTokens: z.ZodNullable<z.ZodNumber>;
173
- cost: z.ZodNullable<z.ZodNumber>;
174
- id: z.ZodString;
175
- createdAt: z.ZodDate;
176
- updatedAt: z.ZodDate;
177
- }, z.core.$strip>;
178
- declare const datasetsSchema: z.ZodObject<{
179
- name: z.ZodString;
180
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
181
- recordCount: z.ZodDefault<z.ZodNumber>;
182
- latestVersionNumber: z.ZodDefault<z.ZodNumber>;
183
- id: z.ZodString;
184
- createdAt: z.ZodDate;
185
- updatedAt: z.ZodDate;
186
- }, z.core.$strip>;
187
- declare const datasetVersionsSchema: z.ZodObject<{
188
- datasetId: z.ZodString;
189
- versionNumber: z.ZodNumber;
190
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
191
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
192
- recordCount: z.ZodDefault<z.ZodNumber>;
193
- snapshotHash: z.ZodString;
194
- id: z.ZodString;
195
- createdAt: z.ZodDate;
196
- updatedAt: z.ZodDate;
197
- }, z.core.$strip>;
198
- declare const datasetRecordsSchema: z.ZodObject<{
199
- datasetId: z.ZodString;
200
- input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
201
- expected: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
202
- metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
203
- id: z.ZodString;
204
- createdAt: z.ZodDate;
205
- updatedAt: z.ZodDate;
206
- }, z.core.$strip>;
207
- declare const datasetVersionRecordsSchema: z.ZodObject<{
208
- datasetVersionId: z.ZodString;
209
- datasetRecordId: z.ZodString;
210
- position: z.ZodDefault<z.ZodNumber>;
211
- id: z.ZodString;
212
- createdAt: z.ZodDate;
213
- updatedAt: z.ZodDate;
214
- }, z.core.$strip>;
215
- declare const guardrailConfigsSchema: z.ZodObject<{
216
- name: z.ZodString;
217
- pluginId: z.ZodString;
218
- functionId: z.ZodString;
219
- hookType: z.ZodEnum<{
220
- beforeRequestHook: "beforeRequestHook";
221
- afterRequestHook: "afterRequestHook";
222
- }>;
223
- parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
224
- enabled: z.ZodDefault<z.ZodBoolean>;
225
- priority: z.ZodDefault<z.ZodNumber>;
226
- onFail: z.ZodDefault<z.ZodEnum<{
227
- block: "block";
228
- log: "log";
229
- }>>;
230
- id: z.ZodString;
231
- createdAt: z.ZodDate;
232
- updatedAt: z.ZodDate;
233
- }, z.core.$strip>;
234
- declare const providerGuardrailOverridesSchema: z.ZodObject<{
235
- providerConfigId: z.ZodString;
236
- guardrailConfigId: z.ZodString;
237
- enabled: z.ZodDefault<z.ZodBoolean>;
238
- parameters: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
239
- id: z.ZodString;
240
- createdAt: z.ZodDate;
241
- updatedAt: z.ZodDate;
242
- }, z.core.$strip>;
243
- declare const guardrailResultSchema: z.ZodObject<{
244
- checkId: z.ZodString;
245
- functionId: z.ZodString;
246
- hookType: z.ZodEnum<{
247
- beforeRequestHook: "beforeRequestHook";
248
- afterRequestHook: "afterRequestHook";
249
- }>;
250
- verdict: z.ZodBoolean;
251
- latencyMs: z.ZodNumber;
252
- }, z.core.$strip>;
253
- declare const guardrailResultsSchema: z.ZodObject<{
254
- results: z.ZodArray<z.ZodObject<{
255
- checkId: z.ZodString;
256
- functionId: z.ZodString;
257
- hookType: z.ZodEnum<{
258
- beforeRequestHook: "beforeRequestHook";
259
- afterRequestHook: "afterRequestHook";
260
- }>;
261
- verdict: z.ZodBoolean;
262
- latencyMs: z.ZodNumber;
263
- }, z.core.$strip>>;
264
- action: z.ZodEnum<{
265
- allowed: "allowed";
266
- blocked: "blocked";
267
- logged: "logged";
268
- }>;
269
- totalLatencyMs: z.ZodNumber;
270
- }, z.core.$strip>;
271
- declare const llmRequestsSchema: z.ZodObject<{
272
- requestId: z.ZodString;
273
- configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
274
- variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
275
- environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
276
- providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
277
- provider: z.ZodString;
278
- model: z.ZodString;
279
- promptTokens: z.ZodDefault<z.ZodNumber>;
280
- completionTokens: z.ZodDefault<z.ZodNumber>;
281
- totalTokens: z.ZodDefault<z.ZodNumber>;
282
- cachedTokens: z.ZodDefault<z.ZodNumber>;
283
- cacheCreationTokens: z.ZodDefault<z.ZodNumber>;
284
- cost: z.ZodDefault<z.ZodNumber>;
285
- cacheSavings: z.ZodDefault<z.ZodNumber>;
286
- inputCost: z.ZodDefault<z.ZodNumber>;
287
- outputCost: z.ZodDefault<z.ZodNumber>;
288
- endpoint: z.ZodString;
289
- statusCode: z.ZodNumber;
290
- latencyMs: z.ZodDefault<z.ZodNumber>;
291
- isStreaming: z.ZodDefault<z.ZodBoolean>;
292
- userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
293
- tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
294
- guardrailResults: z.ZodOptional<z.ZodNullable<z.ZodObject<{
295
- results: z.ZodArray<z.ZodObject<{
296
- checkId: z.ZodString;
297
- functionId: z.ZodString;
298
- hookType: z.ZodEnum<{
299
- beforeRequestHook: "beforeRequestHook";
300
- afterRequestHook: "afterRequestHook";
301
- }>;
302
- verdict: z.ZodBoolean;
303
- latencyMs: z.ZodNumber;
304
- }, z.core.$strip>>;
305
- action: z.ZodEnum<{
306
- allowed: "allowed";
307
- blocked: "blocked";
308
- logged: "logged";
309
- }>;
310
- totalLatencyMs: z.ZodNumber;
311
- }, z.core.$strip>>>;
312
- traceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
313
- spanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
314
- parentSpanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
315
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
316
- id: z.ZodString;
317
- createdAt: z.ZodDate;
318
- updatedAt: z.ZodDate;
319
- }, z.core.$strip>;
320
- declare const tracesSchema: z.ZodObject<{
321
- traceId: z.ZodString;
322
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
323
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
324
- userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
325
- status: z.ZodDefault<z.ZodString>;
326
- startTime: z.ZodDate;
327
- endTime: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
328
- durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
329
- spanCount: z.ZodDefault<z.ZodNumber>;
330
- totalInputTokens: z.ZodDefault<z.ZodNumber>;
331
- totalOutputTokens: z.ZodDefault<z.ZodNumber>;
332
- totalTokens: z.ZodDefault<z.ZodNumber>;
333
- totalCost: z.ZodDefault<z.ZodNumber>;
334
- tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
335
- metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
336
- id: z.ZodString;
337
- createdAt: z.ZodDate;
338
- updatedAt: z.ZodDate;
339
- }, z.core.$strip>;
340
- declare const spansSchema: z.ZodObject<{
341
- traceId: z.ZodString;
342
- spanId: z.ZodString;
343
- parentSpanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
344
- name: z.ZodString;
345
- kind: z.ZodDefault<z.ZodNumber>;
346
- status: z.ZodDefault<z.ZodNumber>;
347
- statusMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
348
- startTime: z.ZodDate;
349
- endTime: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
350
- durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
351
- provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
352
- model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
353
- promptTokens: z.ZodDefault<z.ZodNumber>;
354
- completionTokens: z.ZodDefault<z.ZodNumber>;
355
- totalTokens: z.ZodDefault<z.ZodNumber>;
356
- cost: z.ZodDefault<z.ZodNumber>;
357
- configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
358
- variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
359
- environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
360
- providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
361
- requestId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
362
- source: z.ZodDefault<z.ZodString>;
363
- input: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
364
- output: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
365
- attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
366
- id: z.ZodString;
367
- createdAt: z.ZodDate;
368
- updatedAt: z.ZodDate;
369
- }, z.core.$strip>;
370
- declare const spanEventsSchema: z.ZodObject<{
371
- id: z.ZodString;
372
- traceId: z.ZodString;
373
- spanId: z.ZodString;
374
- name: z.ZodString;
375
- timestamp: z.ZodDate;
376
- attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
377
- createdAt: z.ZodDate;
378
- }, z.core.$strip>;
379
- /**
380
- * Zod inferred types (for runtime validation)
381
- */
382
- type Config = z.infer<typeof configsSchema>;
383
- type Variant = z.infer<typeof variantsSchema>;
384
- type VariantVersion = z.infer<typeof variantVersionsSchema>;
385
- type Environment = z.infer<typeof environmentsSchema>;
386
- type EnvironmentSecret = z.infer<typeof environmentSecretsSchema>;
387
- type ConfigVariant = z.infer<typeof configVariantsSchema>;
388
- type TargetingRule = z.infer<typeof targetingRulesSchema>;
389
- type WorkspaceSettings = z.infer<typeof workspaceSettingsSchema>;
390
- type ProviderConfig = z.infer<typeof providerConfigsSchema>;
391
- type PlaygroundColumn = z.infer<typeof playgroundColumnSchema>;
392
- type Playground = z.infer<typeof playgroundsSchema>;
393
- type PlaygroundRun = z.infer<typeof playgroundRunsSchema>;
394
- type PlaygroundResult = z.infer<typeof playgroundResultsSchema>;
395
- type GuardrailConfig = z.infer<typeof guardrailConfigsSchema>;
396
- type ProviderGuardrailOverride = z.infer<typeof providerGuardrailOverridesSchema>;
397
- type GuardrailResult = z.infer<typeof guardrailResultSchema>;
398
- type GuardrailResults = z.infer<typeof guardrailResultsSchema>;
399
- type Dataset = z.infer<typeof datasetsSchema>;
400
- type DatasetVersion = z.infer<typeof datasetVersionsSchema>;
401
- type DatasetRecord = z.infer<typeof datasetRecordsSchema>;
402
- type DatasetVersionRecord = z.infer<typeof datasetVersionRecordsSchema>;
403
- type LLMRequest = z.infer<typeof llmRequestsSchema>;
404
- type Trace = z.infer<typeof tracesSchema>;
405
- type Span = z.infer<typeof spansSchema>;
406
- type SpanEvent = z.infer<typeof spanEventsSchema>;
407
- /**
408
- * Kysely Table Interfaces
409
- * Derived from Zod schemas with proper column types
410
- */
411
- interface BaseTable {
412
- id: Generated<string>;
413
- createdAt: ColumnType<Date, string | undefined, string | undefined>;
414
- updatedAt: ColumnType<Date, string | undefined, string | undefined>;
415
- }
416
- interface ConfigsTable extends BaseTable {
417
- slug: string;
418
- name?: string;
419
- }
420
- interface VariantsTable extends BaseTable {
421
- name: string;
422
- }
423
- interface VariantVersionsTable extends BaseTable {
424
- variantId: string;
425
- version: number;
426
- provider: string;
427
- modelName: string;
428
- jsonData: ColumnType<Record<string, unknown>, string, string>;
429
- }
430
- interface EnvironmentsTable extends BaseTable {
431
- name: string;
432
- slug: string;
433
- isProd: ColumnType<boolean, boolean | undefined, boolean | undefined>;
434
- }
435
- interface EnvironmentSecretsTable extends BaseTable {
436
- environmentId: string;
437
- keyName: string;
438
- keyValue: string;
439
- }
440
- interface ConfigVariantsTable extends BaseTable {
441
- configId: string;
442
- variantId: string;
443
- }
444
- interface TargetingRulesTable extends BaseTable {
445
- environmentId: string;
446
- configId: string;
447
- configVariantId: string;
448
- variantVersionId: string | null;
449
- weight: ColumnType<number, number | undefined, number | undefined>;
450
- priority: ColumnType<number, number | undefined, number | undefined>;
451
- enabled: ColumnType<boolean, boolean | undefined, boolean | undefined>;
452
- conditions: ColumnType<Record<string, unknown>, string, string>;
453
- }
454
- interface WorkspaceSettingsTable extends BaseTable {
455
- name: string | null;
456
- setupComplete: ColumnType<boolean, boolean | undefined, boolean | undefined>;
457
- superAdminId: string | null;
458
- }
459
- interface ProviderConfigsTable extends BaseTable {
460
- providerId: string;
461
- slug: string | null;
462
- name: string | null;
463
- config: ColumnType<Record<string, unknown>, string, string>;
464
- enabled: ColumnType<boolean, boolean | undefined, boolean | undefined>;
465
- }
466
- interface PlaygroundsTable extends BaseTable {
467
- name: string;
468
- datasetId: string | null;
469
- columns: ColumnType<PlaygroundColumn[] | null, string | null, string | null>;
470
- }
471
- interface PlaygroundRunsTable extends BaseTable {
472
- playgroundId: string;
473
- datasetId: string | null;
474
- datasetVersionId: string | null;
475
- status: string;
476
- startedAt: ColumnType<Date | null, string | null, string | null>;
477
- completedAt: ColumnType<Date | null, string | null, string | null>;
478
- totalRecords: ColumnType<number, number | undefined, number | undefined>;
479
- completedRecords: ColumnType<number, number | undefined, number | undefined>;
480
- }
481
- interface PlaygroundResultsTable extends BaseTable {
482
- runId: string;
483
- columnId: string;
484
- datasetRecordId: string | null;
485
- inputVariables: ColumnType<Record<string, unknown>, string, string>;
486
- outputContent: string | null;
487
- status: string;
488
- error: string | null;
489
- latencyMs: number | null;
490
- promptTokens: number | null;
491
- completionTokens: number | null;
492
- totalTokens: number | null;
493
- cost: number | null;
494
- }
495
- interface DatasetsTable extends BaseTable {
496
- name: string;
497
- description: string | null;
498
- recordCount: ColumnType<number, number | undefined, number | undefined>;
499
- latestVersionNumber: ColumnType<number, number | undefined, number | undefined>;
500
- }
501
- interface DatasetVersionsTable extends BaseTable {
502
- datasetId: string;
503
- versionNumber: number;
504
- name: string | null;
505
- description: string | null;
506
- recordCount: ColumnType<number, number | undefined, number | undefined>;
507
- snapshotHash: string;
508
- }
509
- interface DatasetRecordsTable extends BaseTable {
510
- datasetId: string;
511
- input: ColumnType<Record<string, unknown>, string, string>;
512
- expected: ColumnType<Record<string, unknown> | null, string | null, string | null>;
513
- metadata: ColumnType<Record<string, unknown>, string, string>;
514
- }
515
- interface DatasetVersionRecordsTable extends BaseTable {
516
- datasetVersionId: string;
517
- datasetRecordId: string;
518
- position: ColumnType<number, number | undefined, number | undefined>;
519
- }
520
- interface GuardrailConfigsTable extends BaseTable {
521
- name: string;
522
- pluginId: string;
523
- functionId: string;
524
- hookType: string;
525
- parameters: ColumnType<Record<string, unknown>, string, string>;
526
- enabled: ColumnType<boolean, boolean | undefined, boolean | undefined>;
527
- priority: ColumnType<number, number | undefined, number | undefined>;
528
- onFail: ColumnType<string, string | undefined, string | undefined>;
529
- }
530
- interface ProviderGuardrailOverridesTable extends BaseTable {
531
- providerConfigId: string;
532
- guardrailConfigId: string;
533
- enabled: ColumnType<boolean, boolean | undefined, boolean | undefined>;
534
- parameters: ColumnType<Record<string, unknown> | null, string | null, string | null>;
535
- }
536
- interface LLMRequestsTable extends BaseTable {
537
- requestId: string;
538
- configId: string | null;
539
- variantId: string | null;
540
- environmentId: string | null;
541
- providerConfigId: string | null;
542
- provider: string;
543
- model: string;
544
- promptTokens: ColumnType<number, number | undefined, number | undefined>;
545
- completionTokens: ColumnType<number, number | undefined, number | undefined>;
546
- totalTokens: ColumnType<number, number | undefined, number | undefined>;
547
- cachedTokens: ColumnType<number, number | undefined, number | undefined>;
548
- cacheCreationTokens: ColumnType<number, number | undefined, number | undefined>;
549
- cost: ColumnType<number, number | undefined, number | undefined>;
550
- cacheSavings: ColumnType<number, number | undefined, number | undefined>;
551
- inputCost: ColumnType<number, number | undefined, number | undefined>;
552
- outputCost: ColumnType<number, number | undefined, number | undefined>;
553
- endpoint: string;
554
- statusCode: number;
555
- latencyMs: ColumnType<number, number | undefined, number | undefined>;
556
- isStreaming: ColumnType<boolean, boolean | undefined, boolean | undefined>;
557
- userId: string | null;
558
- tags: ColumnType<Record<string, string>, string, string>;
559
- guardrailResults: ColumnType<GuardrailResults | null, string | null, string | null>;
560
- traceId: string | null;
561
- spanId: string | null;
562
- parentSpanId: string | null;
563
- sessionId: string | null;
564
- }
565
- interface TracesTable extends BaseTable {
566
- traceId: string;
567
- name: string | null;
568
- sessionId: string | null;
569
- userId: string | null;
570
- status: ColumnType<string, string | undefined, string | undefined>;
571
- startTime: ColumnType<Date, string, string>;
572
- endTime: ColumnType<Date | null, string | null, string | null>;
573
- durationMs: number | null;
574
- spanCount: ColumnType<number, number | undefined, number | undefined>;
575
- totalInputTokens: ColumnType<number, number | undefined, number | undefined>;
576
- totalOutputTokens: ColumnType<number, number | undefined, number | undefined>;
577
- totalTokens: ColumnType<number, number | undefined, number | undefined>;
578
- totalCost: ColumnType<number, number | undefined, number | undefined>;
579
- tags: ColumnType<Record<string, string>, string, string>;
580
- metadata: ColumnType<Record<string, unknown>, string, string>;
581
- }
582
- interface SpansTable extends BaseTable {
583
- traceId: string;
584
- spanId: string;
585
- parentSpanId: string | null;
586
- name: string;
587
- kind: ColumnType<number, number | undefined, number | undefined>;
588
- status: ColumnType<number, number | undefined, number | undefined>;
589
- statusMessage: string | null;
590
- startTime: ColumnType<Date, string, string>;
591
- endTime: ColumnType<Date | null, string | null, string | null>;
592
- durationMs: number | null;
593
- provider: string | null;
594
- model: string | null;
595
- promptTokens: ColumnType<number, number | undefined, number | undefined>;
596
- completionTokens: ColumnType<number, number | undefined, number | undefined>;
597
- totalTokens: ColumnType<number, number | undefined, number | undefined>;
598
- cost: ColumnType<number, number | undefined, number | undefined>;
599
- configId: string | null;
600
- variantId: string | null;
601
- environmentId: string | null;
602
- providerConfigId: string | null;
603
- requestId: string | null;
604
- source: ColumnType<string, string | undefined, string | undefined>;
605
- input: ColumnType<unknown | null, string | null, string | null>;
606
- output: ColumnType<unknown | null, string | null, string | null>;
607
- attributes: ColumnType<Record<string, unknown>, string, string>;
608
- }
609
- interface SpanEventsTable {
610
- id: Generated<string>;
611
- traceId: string;
612
- spanId: string;
613
- name: string;
614
- timestamp: ColumnType<Date, string, string>;
615
- attributes: ColumnType<Record<string, unknown>, string, string>;
616
- createdAt: ColumnType<Date, string | undefined, string | undefined>;
617
- }
618
- /**
619
- * Main Kysely Database interface
620
- */
621
- interface Database {
622
- configs: ConfigsTable;
623
- variants: VariantsTable;
624
- variant_versions: VariantVersionsTable;
625
- environments: EnvironmentsTable;
626
- environment_secrets: EnvironmentSecretsTable;
627
- config_variants: ConfigVariantsTable;
628
- targeting_rules: TargetingRulesTable;
629
- workspace_settings: WorkspaceSettingsTable;
630
- provider_configs: ProviderConfigsTable;
631
- playgrounds: PlaygroundsTable;
632
- playground_runs: PlaygroundRunsTable;
633
- playground_results: PlaygroundResultsTable;
634
- guardrail_configs: GuardrailConfigsTable;
635
- provider_guardrail_overrides: ProviderGuardrailOverridesTable;
636
- datasets: DatasetsTable;
637
- dataset_versions: DatasetVersionsTable;
638
- dataset_records: DatasetRecordsTable;
639
- dataset_version_records: DatasetVersionRecordsTable;
640
- llm_requests: LLMRequestsTable;
641
- traces: TracesTable;
642
- spans: SpansTable;
643
- span_events: SpanEventsTable;
644
- }
645
- /**
646
- * Table names as a union type
647
- */
648
- type TableName = keyof Database;
649
- /**
650
- * Utility types for type-safe operations
651
- */
652
- type Insertable<T extends TableName> = { [K in keyof Database[T]]: Database[T][K] extends ColumnType<infer _SelectType, infer InsertType, infer _UpdateType> ? InsertType : Database[T][K] extends Generated<infer _GeneratedType> ? never : Database[T][K] };
653
- type Selectable<T extends TableName> = { [K in keyof Database[T]]: Database[T][K] extends ColumnType<infer SelectType, infer _InsertType, infer _UpdateType> ? SelectType : Database[T][K] extends Generated<infer GeneratedType> ? GeneratedType : Database[T][K] };
654
- type Updateable<T extends TableName> = { [K in keyof Database[T]]?: Database[T][K] extends ColumnType<infer _SelectType, infer _InsertType, infer UpdateType> ? UpdateType : Database[T][K] extends Generated<infer _GeneratedType> ? never : Database[T][K] };
655
- /**
656
- * Schema metadata for migrations
657
- * Derived from Zod schemas
658
- */
659
- declare const SCHEMA_METADATA: {
660
- readonly tables: {
661
- readonly configs: {
662
- readonly order: 1;
663
- readonly schema: z.ZodObject<{
664
- slug: z.ZodString;
665
- name: z.ZodOptional<z.ZodString>;
666
- id: z.ZodString;
667
- createdAt: z.ZodDate;
668
- updatedAt: z.ZodDate;
669
- }, z.core.$strip>;
670
- readonly fields: {
671
- readonly id: {
672
- readonly type: "uuid";
673
- readonly primaryKey: true;
674
- };
675
- readonly slug: {
676
- readonly type: "text";
677
- readonly unique: true;
678
- };
679
- readonly name: {
680
- readonly type: "text";
681
- readonly nullable: true;
682
- };
683
- readonly createdAt: {
684
- readonly type: "timestamp";
685
- readonly default: "now()";
686
- };
687
- readonly updatedAt: {
688
- readonly type: "timestamp";
689
- readonly default: "now()";
690
- readonly onUpdate: "now()";
691
- };
692
- };
693
- };
694
- readonly variants: {
695
- readonly order: 2;
696
- readonly schema: z.ZodObject<{
697
- name: z.ZodString;
698
- id: z.ZodString;
699
- createdAt: z.ZodDate;
700
- updatedAt: z.ZodDate;
701
- }, z.core.$strip>;
702
- readonly fields: {
703
- readonly id: {
704
- readonly type: "uuid";
705
- readonly primaryKey: true;
706
- };
707
- readonly name: {
708
- readonly type: "text";
709
- };
710
- readonly createdAt: {
711
- readonly type: "timestamp";
712
- readonly default: "now()";
713
- };
714
- readonly updatedAt: {
715
- readonly type: "timestamp";
716
- readonly default: "now()";
717
- readonly onUpdate: "now()";
718
- };
719
- };
720
- };
721
- readonly variant_versions: {
722
- readonly order: 3;
723
- readonly schema: z.ZodObject<{
724
- variantId: z.ZodString;
725
- version: z.ZodNumber;
726
- provider: z.ZodString;
727
- modelName: z.ZodString;
728
- jsonData: z.ZodRecord<z.ZodString, z.ZodUnknown>;
729
- id: z.ZodString;
730
- createdAt: z.ZodDate;
731
- updatedAt: z.ZodDate;
732
- }, z.core.$strip>;
733
- readonly fields: {
734
- readonly id: {
735
- readonly type: "uuid";
736
- readonly primaryKey: true;
737
- };
738
- readonly variantId: {
739
- readonly type: "uuid";
740
- readonly references: {
741
- readonly table: "variants";
742
- readonly column: "id";
743
- };
744
- };
745
- readonly version: {
746
- readonly type: "integer";
747
- };
748
- readonly provider: {
749
- readonly type: "text";
750
- };
751
- readonly modelName: {
752
- readonly type: "text";
753
- };
754
- readonly jsonData: {
755
- readonly type: "jsonb";
756
- };
757
- readonly createdAt: {
758
- readonly type: "timestamp";
759
- readonly default: "now()";
760
- };
761
- readonly updatedAt: {
762
- readonly type: "timestamp";
763
- readonly default: "now()";
764
- readonly onUpdate: "now()";
765
- };
766
- };
767
- readonly uniqueConstraints: readonly [{
768
- readonly columns: readonly ["variantId", "version"];
769
- }];
770
- };
771
- readonly environments: {
772
- readonly order: 4;
773
- readonly schema: z.ZodObject<{
774
- name: z.ZodString;
775
- slug: z.ZodString;
776
- isProd: z.ZodDefault<z.ZodBoolean>;
777
- id: z.ZodString;
778
- createdAt: z.ZodDate;
779
- updatedAt: z.ZodDate;
780
- }, z.core.$strip>;
781
- readonly fields: {
782
- readonly id: {
783
- readonly type: "uuid";
784
- readonly primaryKey: true;
785
- };
786
- readonly name: {
787
- readonly type: "text";
788
- };
789
- readonly slug: {
790
- readonly type: "text";
791
- readonly unique: true;
792
- };
793
- readonly isProd: {
794
- readonly type: "boolean";
795
- readonly default: false;
796
- };
797
- readonly createdAt: {
798
- readonly type: "timestamp";
799
- readonly default: "now()";
800
- };
801
- readonly updatedAt: {
802
- readonly type: "timestamp";
803
- readonly default: "now()";
804
- readonly onUpdate: "now()";
805
- };
806
- };
807
- };
808
- readonly environment_secrets: {
809
- readonly order: 5;
810
- readonly schema: z.ZodObject<{
811
- environmentId: z.ZodString;
812
- keyName: z.ZodString;
813
- keyValue: z.ZodString;
814
- id: z.ZodString;
815
- createdAt: z.ZodDate;
816
- updatedAt: z.ZodDate;
817
- }, z.core.$strip>;
818
- readonly fields: {
819
- readonly id: {
820
- readonly type: "uuid";
821
- readonly primaryKey: true;
822
- };
823
- readonly environmentId: {
824
- readonly type: "uuid";
825
- readonly references: {
826
- readonly table: "environments";
827
- readonly column: "id";
828
- };
829
- };
830
- readonly keyName: {
831
- readonly type: "text";
832
- };
833
- readonly keyValue: {
834
- readonly type: "text";
835
- };
836
- readonly createdAt: {
837
- readonly type: "timestamp";
838
- readonly default: "now()";
839
- };
840
- readonly updatedAt: {
841
- readonly type: "timestamp";
842
- readonly default: "now()";
843
- readonly onUpdate: "now()";
844
- };
845
- };
846
- };
847
- readonly config_variants: {
848
- readonly order: 6;
849
- readonly schema: z.ZodObject<{
850
- configId: z.ZodString;
851
- variantId: z.ZodString;
852
- id: z.ZodString;
853
- createdAt: z.ZodDate;
854
- updatedAt: z.ZodDate;
855
- }, z.core.$strip>;
856
- readonly fields: {
857
- readonly id: {
858
- readonly type: "uuid";
859
- readonly primaryKey: true;
860
- };
861
- readonly configId: {
862
- readonly type: "uuid";
863
- readonly references: {
864
- readonly table: "configs";
865
- readonly column: "id";
866
- };
867
- };
868
- readonly variantId: {
869
- readonly type: "uuid";
870
- readonly references: {
871
- readonly table: "variants";
872
- readonly column: "id";
873
- };
874
- };
875
- readonly createdAt: {
876
- readonly type: "timestamp";
877
- readonly default: "now()";
878
- };
879
- readonly updatedAt: {
880
- readonly type: "timestamp";
881
- readonly default: "now()";
882
- readonly onUpdate: "now()";
883
- };
884
- };
885
- };
886
- readonly targeting_rules: {
887
- readonly order: 7;
888
- readonly schema: z.ZodObject<{
889
- environmentId: z.ZodString;
890
- configId: z.ZodString;
891
- configVariantId: z.ZodString;
892
- variantVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
893
- weight: z.ZodDefault<z.ZodNumber>;
894
- priority: z.ZodDefault<z.ZodNumber>;
895
- enabled: z.ZodDefault<z.ZodBoolean>;
896
- conditions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
897
- id: z.ZodString;
898
- createdAt: z.ZodDate;
899
- updatedAt: z.ZodDate;
900
- }, z.core.$strip>;
901
- readonly fields: {
902
- readonly id: {
903
- readonly type: "uuid";
904
- readonly primaryKey: true;
905
- };
906
- readonly environmentId: {
907
- readonly type: "uuid";
908
- readonly references: {
909
- readonly table: "environments";
910
- readonly column: "id";
911
- };
912
- };
913
- readonly configId: {
914
- readonly type: "uuid";
915
- readonly references: {
916
- readonly table: "configs";
917
- readonly column: "id";
918
- };
919
- };
920
- readonly configVariantId: {
921
- readonly type: "uuid";
922
- readonly references: {
923
- readonly table: "config_variants";
924
- readonly column: "id";
925
- };
926
- };
927
- readonly variantVersionId: {
928
- readonly type: "uuid";
929
- readonly nullable: true;
930
- readonly references: {
931
- readonly table: "variant_versions";
932
- readonly column: "id";
933
- };
934
- };
935
- readonly weight: {
936
- readonly type: "integer";
937
- readonly default: 10000;
938
- };
939
- readonly priority: {
940
- readonly type: "integer";
941
- readonly default: 0;
942
- };
943
- readonly enabled: {
944
- readonly type: "boolean";
945
- readonly default: true;
946
- };
947
- readonly conditions: {
948
- readonly type: "jsonb";
949
- readonly default: "{}";
950
- };
951
- readonly createdAt: {
952
- readonly type: "timestamp";
953
- readonly default: "now()";
954
- };
955
- readonly updatedAt: {
956
- readonly type: "timestamp";
957
- readonly default: "now()";
958
- readonly onUpdate: "now()";
959
- };
960
- };
961
- };
962
- readonly workspace_settings: {
963
- readonly order: 8;
964
- readonly schema: z.ZodObject<{
965
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
966
- setupComplete: z.ZodDefault<z.ZodBoolean>;
967
- superAdminId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
968
- id: z.ZodString;
969
- createdAt: z.ZodDate;
970
- updatedAt: z.ZodDate;
971
- }, z.core.$strip>;
972
- readonly fields: {
973
- readonly id: {
974
- readonly type: "uuid";
975
- readonly primaryKey: true;
976
- };
977
- readonly name: {
978
- readonly type: "text";
979
- readonly nullable: true;
980
- };
981
- readonly setupComplete: {
982
- readonly type: "boolean";
983
- readonly default: false;
984
- };
985
- readonly superAdminId: {
986
- readonly type: "text";
987
- readonly nullable: true;
988
- };
989
- readonly createdAt: {
990
- readonly type: "timestamp";
991
- readonly default: "now()";
992
- };
993
- readonly updatedAt: {
994
- readonly type: "timestamp";
995
- readonly default: "now()";
996
- readonly onUpdate: "now()";
997
- };
998
- };
999
- };
1000
- readonly provider_configs: {
1001
- readonly order: 9;
1002
- readonly schema: z.ZodObject<{
1003
- providerId: z.ZodString;
1004
- slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1005
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1006
- config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1007
- enabled: z.ZodDefault<z.ZodBoolean>;
1008
- id: z.ZodString;
1009
- createdAt: z.ZodDate;
1010
- updatedAt: z.ZodDate;
1011
- }, z.core.$strip>;
1012
- readonly fields: {
1013
- readonly id: {
1014
- readonly type: "uuid";
1015
- readonly primaryKey: true;
1016
- };
1017
- readonly providerId: {
1018
- readonly type: "text";
1019
- };
1020
- readonly slug: {
1021
- readonly type: "text";
1022
- readonly nullable: true;
1023
- };
1024
- readonly name: {
1025
- readonly type: "text";
1026
- readonly nullable: true;
1027
- };
1028
- readonly config: {
1029
- readonly type: "jsonb";
1030
- readonly default: "{}";
1031
- };
1032
- readonly enabled: {
1033
- readonly type: "boolean";
1034
- readonly default: true;
1035
- };
1036
- readonly createdAt: {
1037
- readonly type: "timestamp";
1038
- readonly default: "now()";
1039
- };
1040
- readonly updatedAt: {
1041
- readonly type: "timestamp";
1042
- readonly default: "now()";
1043
- readonly onUpdate: "now()";
1044
- };
1045
- };
1046
- };
1047
- readonly playgrounds: {
1048
- readonly order: 20;
1049
- readonly schema: z.ZodObject<{
1050
- name: z.ZodString;
1051
- datasetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1052
- columns: z.ZodNullable<z.ZodArray<z.ZodObject<{
1053
- id: z.ZodString;
1054
- name: z.ZodString;
1055
- position: z.ZodNumber;
1056
- providerConfigId: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
1057
- modelName: z.ZodString;
1058
- messages: z.ZodArray<z.ZodObject<{
1059
- role: z.ZodEnum<{
1060
- system: "system";
1061
- user: "user";
1062
- assistant: "assistant";
1063
- }>;
1064
- content: z.ZodString;
1065
- }, z.core.$strip>>;
1066
- temperature: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1067
- maxTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1068
- topP: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1069
- frequencyPenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1070
- presencePenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1071
- configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1072
- variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1073
- variantVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1074
- }, z.core.$strip>>>;
1075
- id: z.ZodString;
1076
- createdAt: z.ZodDate;
1077
- updatedAt: z.ZodDate;
1078
- }, z.core.$strip>;
1079
- readonly fields: {
1080
- readonly id: {
1081
- readonly type: "uuid";
1082
- readonly primaryKey: true;
1083
- };
1084
- readonly name: {
1085
- readonly type: "text";
1086
- };
1087
- readonly datasetId: {
1088
- readonly type: "uuid";
1089
- readonly nullable: true;
1090
- readonly references: {
1091
- readonly table: "datasets";
1092
- readonly column: "id";
1093
- };
1094
- };
1095
- readonly columns: {
1096
- readonly type: "jsonb";
1097
- readonly nullable: true;
1098
- };
1099
- readonly createdAt: {
1100
- readonly type: "timestamp";
1101
- readonly default: "now()";
1102
- };
1103
- readonly updatedAt: {
1104
- readonly type: "timestamp";
1105
- readonly default: "now()";
1106
- readonly onUpdate: "now()";
1107
- };
1108
- };
1109
- };
1110
- readonly playground_runs: {
1111
- readonly order: 21;
1112
- readonly schema: z.ZodObject<{
1113
- playgroundId: z.ZodString;
1114
- datasetId: z.ZodNullable<z.ZodString>;
1115
- datasetVersionId: z.ZodNullable<z.ZodString>;
1116
- status: z.ZodEnum<{
1117
- pending: "pending";
1118
- running: "running";
1119
- completed: "completed";
1120
- failed: "failed";
1121
- cancelled: "cancelled";
1122
- }>;
1123
- startedAt: z.ZodNullable<z.ZodDate>;
1124
- completedAt: z.ZodNullable<z.ZodDate>;
1125
- totalRecords: z.ZodDefault<z.ZodNumber>;
1126
- completedRecords: z.ZodDefault<z.ZodNumber>;
1127
- id: z.ZodString;
1128
- createdAt: z.ZodDate;
1129
- updatedAt: z.ZodDate;
1130
- }, z.core.$strip>;
1131
- readonly fields: {
1132
- readonly id: {
1133
- readonly type: "uuid";
1134
- readonly primaryKey: true;
1135
- };
1136
- readonly playgroundId: {
1137
- readonly type: "uuid";
1138
- readonly references: {
1139
- readonly table: "playgrounds";
1140
- readonly column: "id";
1141
- };
1142
- };
1143
- readonly datasetId: {
1144
- readonly type: "uuid";
1145
- readonly nullable: true;
1146
- readonly references: {
1147
- readonly table: "datasets";
1148
- readonly column: "id";
1149
- };
1150
- };
1151
- readonly datasetVersionId: {
1152
- readonly type: "uuid";
1153
- readonly nullable: true;
1154
- readonly references: {
1155
- readonly table: "dataset_versions";
1156
- readonly column: "id";
1157
- };
1158
- };
1159
- readonly status: {
1160
- readonly type: "text";
1161
- };
1162
- readonly startedAt: {
1163
- readonly type: "timestamp";
1164
- readonly nullable: true;
1165
- };
1166
- readonly completedAt: {
1167
- readonly type: "timestamp";
1168
- readonly nullable: true;
1169
- };
1170
- readonly totalRecords: {
1171
- readonly type: "integer";
1172
- readonly default: 0;
1173
- };
1174
- readonly completedRecords: {
1175
- readonly type: "integer";
1176
- readonly default: 0;
1177
- };
1178
- readonly createdAt: {
1179
- readonly type: "timestamp";
1180
- readonly default: "now()";
1181
- };
1182
- readonly updatedAt: {
1183
- readonly type: "timestamp";
1184
- readonly default: "now()";
1185
- readonly onUpdate: "now()";
1186
- };
1187
- };
1188
- };
1189
- readonly playground_results: {
1190
- readonly order: 22;
1191
- readonly schema: z.ZodObject<{
1192
- runId: z.ZodString;
1193
- columnId: z.ZodString;
1194
- datasetRecordId: z.ZodNullable<z.ZodString>;
1195
- inputVariables: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1196
- outputContent: z.ZodNullable<z.ZodString>;
1197
- status: z.ZodEnum<{
1198
- pending: "pending";
1199
- running: "running";
1200
- completed: "completed";
1201
- failed: "failed";
1202
- }>;
1203
- error: z.ZodNullable<z.ZodString>;
1204
- latencyMs: z.ZodNullable<z.ZodNumber>;
1205
- promptTokens: z.ZodNullable<z.ZodNumber>;
1206
- completionTokens: z.ZodNullable<z.ZodNumber>;
1207
- totalTokens: z.ZodNullable<z.ZodNumber>;
1208
- cost: z.ZodNullable<z.ZodNumber>;
1209
- id: z.ZodString;
1210
- createdAt: z.ZodDate;
1211
- updatedAt: z.ZodDate;
1212
- }, z.core.$strip>;
1213
- readonly fields: {
1214
- readonly id: {
1215
- readonly type: "uuid";
1216
- readonly primaryKey: true;
1217
- };
1218
- readonly runId: {
1219
- readonly type: "uuid";
1220
- readonly references: {
1221
- readonly table: "playground_runs";
1222
- readonly column: "id";
1223
- };
1224
- };
1225
- readonly columnId: {
1226
- readonly type: "uuid";
1227
- };
1228
- readonly datasetRecordId: {
1229
- readonly type: "uuid";
1230
- readonly nullable: true;
1231
- readonly references: {
1232
- readonly table: "dataset_records";
1233
- readonly column: "id";
1234
- };
1235
- };
1236
- readonly inputVariables: {
1237
- readonly type: "jsonb";
1238
- readonly default: "{}";
1239
- };
1240
- readonly outputContent: {
1241
- readonly type: "text";
1242
- readonly nullable: true;
1243
- };
1244
- readonly status: {
1245
- readonly type: "text";
1246
- };
1247
- readonly error: {
1248
- readonly type: "text";
1249
- readonly nullable: true;
1250
- };
1251
- readonly latencyMs: {
1252
- readonly type: "integer";
1253
- readonly nullable: true;
1254
- };
1255
- readonly promptTokens: {
1256
- readonly type: "integer";
1257
- readonly nullable: true;
1258
- };
1259
- readonly completionTokens: {
1260
- readonly type: "integer";
1261
- readonly nullable: true;
1262
- };
1263
- readonly totalTokens: {
1264
- readonly type: "integer";
1265
- readonly nullable: true;
1266
- };
1267
- readonly cost: {
1268
- readonly type: "integer";
1269
- readonly nullable: true;
1270
- };
1271
- readonly createdAt: {
1272
- readonly type: "timestamp";
1273
- readonly default: "now()";
1274
- };
1275
- readonly updatedAt: {
1276
- readonly type: "timestamp";
1277
- readonly default: "now()";
1278
- readonly onUpdate: "now()";
1279
- };
1280
- };
1281
- };
1282
- readonly guardrail_configs: {
1283
- readonly order: 14;
1284
- readonly schema: z.ZodObject<{
1285
- name: z.ZodString;
1286
- pluginId: z.ZodString;
1287
- functionId: z.ZodString;
1288
- hookType: z.ZodEnum<{
1289
- beforeRequestHook: "beforeRequestHook";
1290
- afterRequestHook: "afterRequestHook";
1291
- }>;
1292
- parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1293
- enabled: z.ZodDefault<z.ZodBoolean>;
1294
- priority: z.ZodDefault<z.ZodNumber>;
1295
- onFail: z.ZodDefault<z.ZodEnum<{
1296
- block: "block";
1297
- log: "log";
1298
- }>>;
1299
- id: z.ZodString;
1300
- createdAt: z.ZodDate;
1301
- updatedAt: z.ZodDate;
1302
- }, z.core.$strip>;
1303
- readonly fields: {
1304
- readonly id: {
1305
- readonly type: "uuid";
1306
- readonly primaryKey: true;
1307
- };
1308
- readonly name: {
1309
- readonly type: "text";
1310
- };
1311
- readonly pluginId: {
1312
- readonly type: "text";
1313
- };
1314
- readonly functionId: {
1315
- readonly type: "text";
1316
- };
1317
- readonly hookType: {
1318
- readonly type: "text";
1319
- };
1320
- readonly parameters: {
1321
- readonly type: "jsonb";
1322
- readonly default: "{}";
1323
- };
1324
- readonly enabled: {
1325
- readonly type: "boolean";
1326
- readonly default: true;
1327
- };
1328
- readonly priority: {
1329
- readonly type: "integer";
1330
- readonly default: 0;
1331
- };
1332
- readonly onFail: {
1333
- readonly type: "text";
1334
- readonly default: "block";
1335
- };
1336
- readonly createdAt: {
1337
- readonly type: "timestamp";
1338
- readonly default: "now()";
1339
- };
1340
- readonly updatedAt: {
1341
- readonly type: "timestamp";
1342
- readonly default: "now()";
1343
- readonly onUpdate: "now()";
1344
- };
1345
- };
1346
- };
1347
- readonly datasets: {
1348
- readonly order: 10;
1349
- readonly schema: z.ZodObject<{
1350
- name: z.ZodString;
1351
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1352
- recordCount: z.ZodDefault<z.ZodNumber>;
1353
- latestVersionNumber: z.ZodDefault<z.ZodNumber>;
1354
- id: z.ZodString;
1355
- createdAt: z.ZodDate;
1356
- updatedAt: z.ZodDate;
1357
- }, z.core.$strip>;
1358
- readonly fields: {
1359
- readonly id: {
1360
- readonly type: "uuid";
1361
- readonly primaryKey: true;
1362
- };
1363
- readonly name: {
1364
- readonly type: "text";
1365
- };
1366
- readonly description: {
1367
- readonly type: "text";
1368
- readonly nullable: true;
1369
- };
1370
- readonly recordCount: {
1371
- readonly type: "integer";
1372
- readonly default: 0;
1373
- };
1374
- readonly latestVersionNumber: {
1375
- readonly type: "integer";
1376
- readonly default: 1;
1377
- };
1378
- readonly createdAt: {
1379
- readonly type: "timestamp";
1380
- readonly default: "now()";
1381
- };
1382
- readonly updatedAt: {
1383
- readonly type: "timestamp";
1384
- readonly default: "now()";
1385
- readonly onUpdate: "now()";
1386
- };
1387
- };
1388
- };
1389
- readonly dataset_versions: {
1390
- readonly order: 11;
1391
- readonly schema: z.ZodObject<{
1392
- datasetId: z.ZodString;
1393
- versionNumber: z.ZodNumber;
1394
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1395
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1396
- recordCount: z.ZodDefault<z.ZodNumber>;
1397
- snapshotHash: z.ZodString;
1398
- id: z.ZodString;
1399
- createdAt: z.ZodDate;
1400
- updatedAt: z.ZodDate;
1401
- }, z.core.$strip>;
1402
- readonly fields: {
1403
- readonly id: {
1404
- readonly type: "uuid";
1405
- readonly primaryKey: true;
1406
- };
1407
- readonly datasetId: {
1408
- readonly type: "uuid";
1409
- readonly references: {
1410
- readonly table: "datasets";
1411
- readonly column: "id";
1412
- };
1413
- };
1414
- readonly versionNumber: {
1415
- readonly type: "integer";
1416
- };
1417
- readonly name: {
1418
- readonly type: "text";
1419
- readonly nullable: true;
1420
- };
1421
- readonly description: {
1422
- readonly type: "text";
1423
- readonly nullable: true;
1424
- };
1425
- readonly recordCount: {
1426
- readonly type: "integer";
1427
- readonly default: 0;
1428
- };
1429
- readonly snapshotHash: {
1430
- readonly type: "text";
1431
- };
1432
- readonly createdAt: {
1433
- readonly type: "timestamp";
1434
- readonly default: "now()";
1435
- };
1436
- readonly updatedAt: {
1437
- readonly type: "timestamp";
1438
- readonly default: "now()";
1439
- readonly onUpdate: "now()";
1440
- };
1441
- };
1442
- readonly uniqueConstraints: readonly [{
1443
- readonly columns: readonly ["datasetId", "versionNumber"];
1444
- }];
1445
- };
1446
- readonly dataset_records: {
1447
- readonly order: 12;
1448
- readonly schema: z.ZodObject<{
1449
- datasetId: z.ZodString;
1450
- input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1451
- expected: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1452
- metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1453
- id: z.ZodString;
1454
- createdAt: z.ZodDate;
1455
- updatedAt: z.ZodDate;
1456
- }, z.core.$strip>;
1457
- readonly fields: {
1458
- readonly id: {
1459
- readonly type: "uuid";
1460
- readonly primaryKey: true;
1461
- };
1462
- readonly datasetId: {
1463
- readonly type: "uuid";
1464
- readonly references: {
1465
- readonly table: "datasets";
1466
- readonly column: "id";
1467
- };
1468
- };
1469
- readonly input: {
1470
- readonly type: "jsonb";
1471
- };
1472
- readonly expected: {
1473
- readonly type: "jsonb";
1474
- readonly nullable: true;
1475
- };
1476
- readonly metadata: {
1477
- readonly type: "jsonb";
1478
- readonly default: "{}";
1479
- };
1480
- readonly createdAt: {
1481
- readonly type: "timestamp";
1482
- readonly default: "now()";
1483
- };
1484
- readonly updatedAt: {
1485
- readonly type: "timestamp";
1486
- readonly default: "now()";
1487
- readonly onUpdate: "now()";
1488
- };
1489
- };
1490
- };
1491
- readonly dataset_version_records: {
1492
- readonly order: 13;
1493
- readonly schema: z.ZodObject<{
1494
- datasetVersionId: z.ZodString;
1495
- datasetRecordId: z.ZodString;
1496
- position: z.ZodDefault<z.ZodNumber>;
1497
- id: z.ZodString;
1498
- createdAt: z.ZodDate;
1499
- updatedAt: z.ZodDate;
1500
- }, z.core.$strip>;
1501
- readonly fields: {
1502
- readonly id: {
1503
- readonly type: "uuid";
1504
- readonly primaryKey: true;
1505
- };
1506
- readonly datasetVersionId: {
1507
- readonly type: "uuid";
1508
- readonly references: {
1509
- readonly table: "dataset_versions";
1510
- readonly column: "id";
1511
- };
1512
- };
1513
- readonly datasetRecordId: {
1514
- readonly type: "uuid";
1515
- readonly references: {
1516
- readonly table: "dataset_records";
1517
- readonly column: "id";
1518
- };
1519
- };
1520
- readonly position: {
1521
- readonly type: "integer";
1522
- readonly default: 0;
1523
- };
1524
- readonly createdAt: {
1525
- readonly type: "timestamp";
1526
- readonly default: "now()";
1527
- };
1528
- readonly updatedAt: {
1529
- readonly type: "timestamp";
1530
- readonly default: "now()";
1531
- readonly onUpdate: "now()";
1532
- };
1533
- };
1534
- readonly uniqueConstraints: readonly [{
1535
- readonly columns: readonly ["datasetVersionId", "datasetRecordId"];
1536
- }];
1537
- };
1538
- readonly provider_guardrail_overrides: {
1539
- readonly order: 15;
1540
- readonly schema: z.ZodObject<{
1541
- providerConfigId: z.ZodString;
1542
- guardrailConfigId: z.ZodString;
1543
- enabled: z.ZodDefault<z.ZodBoolean>;
1544
- parameters: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1545
- id: z.ZodString;
1546
- createdAt: z.ZodDate;
1547
- updatedAt: z.ZodDate;
1548
- }, z.core.$strip>;
1549
- readonly fields: {
1550
- readonly id: {
1551
- readonly type: "uuid";
1552
- readonly primaryKey: true;
1553
- };
1554
- readonly providerConfigId: {
1555
- readonly type: "uuid";
1556
- readonly references: {
1557
- readonly table: "provider_configs";
1558
- readonly column: "id";
1559
- };
1560
- };
1561
- readonly guardrailConfigId: {
1562
- readonly type: "uuid";
1563
- readonly references: {
1564
- readonly table: "guardrail_configs";
1565
- readonly column: "id";
1566
- };
1567
- };
1568
- readonly enabled: {
1569
- readonly type: "boolean";
1570
- readonly default: true;
1571
- };
1572
- readonly parameters: {
1573
- readonly type: "jsonb";
1574
- readonly nullable: true;
1575
- };
1576
- readonly createdAt: {
1577
- readonly type: "timestamp";
1578
- readonly default: "now()";
1579
- };
1580
- readonly updatedAt: {
1581
- readonly type: "timestamp";
1582
- readonly default: "now()";
1583
- readonly onUpdate: "now()";
1584
- };
1585
- };
1586
- readonly uniqueConstraints: readonly [{
1587
- readonly columns: readonly ["providerConfigId", "guardrailConfigId"];
1588
- }];
1589
- };
1590
- readonly llm_requests: {
1591
- readonly order: 17;
1592
- readonly schema: z.ZodObject<{
1593
- requestId: z.ZodString;
1594
- configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1595
- variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1596
- environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1597
- providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1598
- provider: z.ZodString;
1599
- model: z.ZodString;
1600
- promptTokens: z.ZodDefault<z.ZodNumber>;
1601
- completionTokens: z.ZodDefault<z.ZodNumber>;
1602
- totalTokens: z.ZodDefault<z.ZodNumber>;
1603
- cachedTokens: z.ZodDefault<z.ZodNumber>;
1604
- cacheCreationTokens: z.ZodDefault<z.ZodNumber>;
1605
- cost: z.ZodDefault<z.ZodNumber>;
1606
- cacheSavings: z.ZodDefault<z.ZodNumber>;
1607
- inputCost: z.ZodDefault<z.ZodNumber>;
1608
- outputCost: z.ZodDefault<z.ZodNumber>;
1609
- endpoint: z.ZodString;
1610
- statusCode: z.ZodNumber;
1611
- latencyMs: z.ZodDefault<z.ZodNumber>;
1612
- isStreaming: z.ZodDefault<z.ZodBoolean>;
1613
- userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1614
- tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1615
- guardrailResults: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1616
- results: z.ZodArray<z.ZodObject<{
1617
- checkId: z.ZodString;
1618
- functionId: z.ZodString;
1619
- hookType: z.ZodEnum<{
1620
- beforeRequestHook: "beforeRequestHook";
1621
- afterRequestHook: "afterRequestHook";
1622
- }>;
1623
- verdict: z.ZodBoolean;
1624
- latencyMs: z.ZodNumber;
1625
- }, z.core.$strip>>;
1626
- action: z.ZodEnum<{
1627
- allowed: "allowed";
1628
- blocked: "blocked";
1629
- logged: "logged";
1630
- }>;
1631
- totalLatencyMs: z.ZodNumber;
1632
- }, z.core.$strip>>>;
1633
- traceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1634
- spanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1635
- parentSpanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1636
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1637
- id: z.ZodString;
1638
- createdAt: z.ZodDate;
1639
- updatedAt: z.ZodDate;
1640
- }, z.core.$strip>;
1641
- readonly fields: {
1642
- readonly id: {
1643
- readonly type: "uuid";
1644
- readonly primaryKey: true;
1645
- };
1646
- readonly requestId: {
1647
- readonly type: "uuid";
1648
- };
1649
- readonly configId: {
1650
- readonly type: "uuid";
1651
- readonly nullable: true;
1652
- readonly references: {
1653
- readonly table: "configs";
1654
- readonly column: "id";
1655
- };
1656
- };
1657
- readonly variantId: {
1658
- readonly type: "uuid";
1659
- readonly nullable: true;
1660
- readonly references: {
1661
- readonly table: "variants";
1662
- readonly column: "id";
1663
- };
1664
- };
1665
- readonly environmentId: {
1666
- readonly type: "uuid";
1667
- readonly nullable: true;
1668
- readonly references: {
1669
- readonly table: "environments";
1670
- readonly column: "id";
1671
- };
1672
- };
1673
- readonly providerConfigId: {
1674
- readonly type: "uuid";
1675
- readonly nullable: true;
1676
- readonly references: {
1677
- readonly table: "provider_configs";
1678
- readonly column: "id";
1679
- };
1680
- };
1681
- readonly provider: {
1682
- readonly type: "text";
1683
- };
1684
- readonly model: {
1685
- readonly type: "text";
1686
- };
1687
- readonly promptTokens: {
1688
- readonly type: "integer";
1689
- readonly default: 0;
1690
- };
1691
- readonly completionTokens: {
1692
- readonly type: "integer";
1693
- readonly default: 0;
1694
- };
1695
- readonly totalTokens: {
1696
- readonly type: "integer";
1697
- readonly default: 0;
1698
- };
1699
- readonly cachedTokens: {
1700
- readonly type: "integer";
1701
- readonly default: 0;
1702
- };
1703
- readonly cacheCreationTokens: {
1704
- readonly type: "integer";
1705
- readonly default: 0;
1706
- };
1707
- readonly cost: {
1708
- readonly type: "integer";
1709
- readonly default: 0;
1710
- };
1711
- readonly cacheSavings: {
1712
- readonly type: "integer";
1713
- readonly default: 0;
1714
- };
1715
- readonly inputCost: {
1716
- readonly type: "integer";
1717
- readonly default: 0;
1718
- };
1719
- readonly outputCost: {
1720
- readonly type: "integer";
1721
- readonly default: 0;
1722
- };
1723
- readonly endpoint: {
1724
- readonly type: "text";
1725
- };
1726
- readonly statusCode: {
1727
- readonly type: "integer";
1728
- };
1729
- readonly latencyMs: {
1730
- readonly type: "integer";
1731
- readonly default: 0;
1732
- };
1733
- readonly isStreaming: {
1734
- readonly type: "boolean";
1735
- readonly default: false;
1736
- };
1737
- readonly userId: {
1738
- readonly type: "text";
1739
- readonly nullable: true;
1740
- };
1741
- readonly tags: {
1742
- readonly type: "jsonb";
1743
- readonly default: "{}";
1744
- };
1745
- readonly guardrailResults: {
1746
- readonly type: "jsonb";
1747
- readonly nullable: true;
1748
- };
1749
- readonly traceId: {
1750
- readonly type: "text";
1751
- readonly nullable: true;
1752
- };
1753
- readonly spanId: {
1754
- readonly type: "text";
1755
- readonly nullable: true;
1756
- };
1757
- readonly parentSpanId: {
1758
- readonly type: "text";
1759
- readonly nullable: true;
1760
- };
1761
- readonly sessionId: {
1762
- readonly type: "text";
1763
- readonly nullable: true;
1764
- };
1765
- readonly createdAt: {
1766
- readonly type: "timestamp";
1767
- readonly default: "now()";
1768
- };
1769
- readonly updatedAt: {
1770
- readonly type: "timestamp";
1771
- readonly default: "now()";
1772
- readonly onUpdate: "now()";
1773
- };
1774
- };
1775
- };
1776
- readonly traces: {
1777
- readonly order: 30;
1778
- readonly schema: z.ZodObject<{
1779
- traceId: z.ZodString;
1780
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1781
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1782
- userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1783
- status: z.ZodDefault<z.ZodString>;
1784
- startTime: z.ZodDate;
1785
- endTime: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1786
- durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1787
- spanCount: z.ZodDefault<z.ZodNumber>;
1788
- totalInputTokens: z.ZodDefault<z.ZodNumber>;
1789
- totalOutputTokens: z.ZodDefault<z.ZodNumber>;
1790
- totalTokens: z.ZodDefault<z.ZodNumber>;
1791
- totalCost: z.ZodDefault<z.ZodNumber>;
1792
- tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1793
- metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1794
- id: z.ZodString;
1795
- createdAt: z.ZodDate;
1796
- updatedAt: z.ZodDate;
1797
- }, z.core.$strip>;
1798
- readonly fields: {
1799
- readonly id: {
1800
- readonly type: "uuid";
1801
- readonly primaryKey: true;
1802
- };
1803
- readonly traceId: {
1804
- readonly type: "text";
1805
- readonly unique: true;
1806
- };
1807
- readonly name: {
1808
- readonly type: "text";
1809
- readonly nullable: true;
1810
- };
1811
- readonly sessionId: {
1812
- readonly type: "text";
1813
- readonly nullable: true;
1814
- };
1815
- readonly userId: {
1816
- readonly type: "text";
1817
- readonly nullable: true;
1818
- };
1819
- readonly status: {
1820
- readonly type: "text";
1821
- readonly default: "unset";
1822
- };
1823
- readonly startTime: {
1824
- readonly type: "timestamp";
1825
- };
1826
- readonly endTime: {
1827
- readonly type: "timestamp";
1828
- readonly nullable: true;
1829
- };
1830
- readonly durationMs: {
1831
- readonly type: "integer";
1832
- readonly nullable: true;
1833
- };
1834
- readonly spanCount: {
1835
- readonly type: "integer";
1836
- readonly default: 0;
1837
- };
1838
- readonly totalInputTokens: {
1839
- readonly type: "integer";
1840
- readonly default: 0;
1841
- };
1842
- readonly totalOutputTokens: {
1843
- readonly type: "integer";
1844
- readonly default: 0;
1845
- };
1846
- readonly totalTokens: {
1847
- readonly type: "integer";
1848
- readonly default: 0;
1849
- };
1850
- readonly totalCost: {
1851
- readonly type: "integer";
1852
- readonly default: 0;
1853
- };
1854
- readonly tags: {
1855
- readonly type: "jsonb";
1856
- readonly default: "{}";
1857
- };
1858
- readonly metadata: {
1859
- readonly type: "jsonb";
1860
- readonly default: "{}";
1861
- };
1862
- readonly createdAt: {
1863
- readonly type: "timestamp";
1864
- readonly default: "now()";
1865
- };
1866
- readonly updatedAt: {
1867
- readonly type: "timestamp";
1868
- readonly default: "now()";
1869
- readonly onUpdate: "now()";
1870
- };
1871
- };
1872
- };
1873
- readonly spans: {
1874
- readonly order: 31;
1875
- readonly schema: z.ZodObject<{
1876
- traceId: z.ZodString;
1877
- spanId: z.ZodString;
1878
- parentSpanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1879
- name: z.ZodString;
1880
- kind: z.ZodDefault<z.ZodNumber>;
1881
- status: z.ZodDefault<z.ZodNumber>;
1882
- statusMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1883
- startTime: z.ZodDate;
1884
- endTime: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1885
- durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1886
- provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1887
- model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1888
- promptTokens: z.ZodDefault<z.ZodNumber>;
1889
- completionTokens: z.ZodDefault<z.ZodNumber>;
1890
- totalTokens: z.ZodDefault<z.ZodNumber>;
1891
- cost: z.ZodDefault<z.ZodNumber>;
1892
- configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1893
- variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1894
- environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1895
- providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1896
- requestId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1897
- source: z.ZodDefault<z.ZodString>;
1898
- input: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
1899
- output: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
1900
- attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1901
- id: z.ZodString;
1902
- createdAt: z.ZodDate;
1903
- updatedAt: z.ZodDate;
1904
- }, z.core.$strip>;
1905
- readonly fields: {
1906
- readonly id: {
1907
- readonly type: "uuid";
1908
- readonly primaryKey: true;
1909
- };
1910
- readonly traceId: {
1911
- readonly type: "text";
1912
- };
1913
- readonly spanId: {
1914
- readonly type: "text";
1915
- readonly unique: true;
1916
- };
1917
- readonly parentSpanId: {
1918
- readonly type: "text";
1919
- readonly nullable: true;
1920
- };
1921
- readonly name: {
1922
- readonly type: "text";
1923
- };
1924
- readonly kind: {
1925
- readonly type: "integer";
1926
- readonly default: 1;
1927
- };
1928
- readonly status: {
1929
- readonly type: "integer";
1930
- readonly default: 0;
1931
- };
1932
- readonly statusMessage: {
1933
- readonly type: "text";
1934
- readonly nullable: true;
1935
- };
1936
- readonly startTime: {
1937
- readonly type: "timestamp";
1938
- };
1939
- readonly endTime: {
1940
- readonly type: "timestamp";
1941
- readonly nullable: true;
1942
- };
1943
- readonly durationMs: {
1944
- readonly type: "integer";
1945
- readonly nullable: true;
1946
- };
1947
- readonly provider: {
1948
- readonly type: "text";
1949
- readonly nullable: true;
1950
- };
1951
- readonly model: {
1952
- readonly type: "text";
1953
- readonly nullable: true;
1954
- };
1955
- readonly promptTokens: {
1956
- readonly type: "integer";
1957
- readonly default: 0;
1958
- };
1959
- readonly completionTokens: {
1960
- readonly type: "integer";
1961
- readonly default: 0;
1962
- };
1963
- readonly totalTokens: {
1964
- readonly type: "integer";
1965
- readonly default: 0;
1966
- };
1967
- readonly cost: {
1968
- readonly type: "integer";
1969
- readonly default: 0;
1970
- };
1971
- readonly configId: {
1972
- readonly type: "uuid";
1973
- readonly nullable: true;
1974
- };
1975
- readonly variantId: {
1976
- readonly type: "uuid";
1977
- readonly nullable: true;
1978
- };
1979
- readonly environmentId: {
1980
- readonly type: "uuid";
1981
- readonly nullable: true;
1982
- };
1983
- readonly providerConfigId: {
1984
- readonly type: "uuid";
1985
- readonly nullable: true;
1986
- };
1987
- readonly requestId: {
1988
- readonly type: "uuid";
1989
- readonly nullable: true;
1990
- };
1991
- readonly source: {
1992
- readonly type: "text";
1993
- readonly default: "gateway";
1994
- };
1995
- readonly input: {
1996
- readonly type: "jsonb";
1997
- readonly nullable: true;
1998
- };
1999
- readonly output: {
2000
- readonly type: "jsonb";
2001
- readonly nullable: true;
2002
- };
2003
- readonly attributes: {
2004
- readonly type: "jsonb";
2005
- readonly default: "{}";
2006
- };
2007
- readonly createdAt: {
2008
- readonly type: "timestamp";
2009
- readonly default: "now()";
2010
- };
2011
- readonly updatedAt: {
2012
- readonly type: "timestamp";
2013
- readonly default: "now()";
2014
- readonly onUpdate: "now()";
2015
- };
2016
- };
2017
- };
2018
- readonly span_events: {
2019
- readonly order: 32;
2020
- readonly schema: z.ZodObject<{
2021
- id: z.ZodString;
2022
- traceId: z.ZodString;
2023
- spanId: z.ZodString;
2024
- name: z.ZodString;
2025
- timestamp: z.ZodDate;
2026
- attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2027
- createdAt: z.ZodDate;
2028
- }, z.core.$strip>;
2029
- readonly fields: {
2030
- readonly id: {
2031
- readonly type: "uuid";
2032
- readonly primaryKey: true;
2033
- };
2034
- readonly traceId: {
2035
- readonly type: "text";
2036
- };
2037
- readonly spanId: {
2038
- readonly type: "text";
2039
- };
2040
- readonly name: {
2041
- readonly type: "text";
2042
- };
2043
- readonly timestamp: {
2044
- readonly type: "timestamp";
2045
- };
2046
- readonly attributes: {
2047
- readonly type: "jsonb";
2048
- readonly default: "{}";
2049
- };
2050
- readonly createdAt: {
2051
- readonly type: "timestamp";
2052
- readonly default: "now()";
2053
- };
2054
- };
2055
- };
2056
- };
2057
- };
2058
- /**
2059
- * Export all Zod schemas for runtime validation
2060
- */
2061
- declare const schemas: {
2062
- readonly configs: z.ZodObject<{
2063
- slug: z.ZodString;
2064
- name: z.ZodOptional<z.ZodString>;
2065
- id: z.ZodString;
2066
- createdAt: z.ZodDate;
2067
- updatedAt: z.ZodDate;
2068
- }, z.core.$strip>;
2069
- readonly variants: z.ZodObject<{
2070
- name: z.ZodString;
2071
- id: z.ZodString;
2072
- createdAt: z.ZodDate;
2073
- updatedAt: z.ZodDate;
2074
- }, z.core.$strip>;
2075
- readonly variant_versions: z.ZodObject<{
2076
- variantId: z.ZodString;
2077
- version: z.ZodNumber;
2078
- provider: z.ZodString;
2079
- modelName: z.ZodString;
2080
- jsonData: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2081
- id: z.ZodString;
2082
- createdAt: z.ZodDate;
2083
- updatedAt: z.ZodDate;
2084
- }, z.core.$strip>;
2085
- readonly environments: z.ZodObject<{
2086
- name: z.ZodString;
2087
- slug: z.ZodString;
2088
- isProd: z.ZodDefault<z.ZodBoolean>;
2089
- id: z.ZodString;
2090
- createdAt: z.ZodDate;
2091
- updatedAt: z.ZodDate;
2092
- }, z.core.$strip>;
2093
- readonly environment_secrets: z.ZodObject<{
2094
- environmentId: z.ZodString;
2095
- keyName: z.ZodString;
2096
- keyValue: z.ZodString;
2097
- id: z.ZodString;
2098
- createdAt: z.ZodDate;
2099
- updatedAt: z.ZodDate;
2100
- }, z.core.$strip>;
2101
- readonly config_variants: z.ZodObject<{
2102
- configId: z.ZodString;
2103
- variantId: z.ZodString;
2104
- id: z.ZodString;
2105
- createdAt: z.ZodDate;
2106
- updatedAt: z.ZodDate;
2107
- }, z.core.$strip>;
2108
- readonly targeting_rules: z.ZodObject<{
2109
- environmentId: z.ZodString;
2110
- configId: z.ZodString;
2111
- configVariantId: z.ZodString;
2112
- variantVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2113
- weight: z.ZodDefault<z.ZodNumber>;
2114
- priority: z.ZodDefault<z.ZodNumber>;
2115
- enabled: z.ZodDefault<z.ZodBoolean>;
2116
- conditions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2117
- id: z.ZodString;
2118
- createdAt: z.ZodDate;
2119
- updatedAt: z.ZodDate;
2120
- }, z.core.$strip>;
2121
- readonly workspace_settings: z.ZodObject<{
2122
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2123
- setupComplete: z.ZodDefault<z.ZodBoolean>;
2124
- superAdminId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2125
- id: z.ZodString;
2126
- createdAt: z.ZodDate;
2127
- updatedAt: z.ZodDate;
2128
- }, z.core.$strip>;
2129
- readonly provider_configs: z.ZodObject<{
2130
- providerId: z.ZodString;
2131
- slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2132
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2133
- config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2134
- enabled: z.ZodDefault<z.ZodBoolean>;
2135
- id: z.ZodString;
2136
- createdAt: z.ZodDate;
2137
- updatedAt: z.ZodDate;
2138
- }, z.core.$strip>;
2139
- readonly playgrounds: z.ZodObject<{
2140
- name: z.ZodString;
2141
- datasetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2142
- columns: z.ZodNullable<z.ZodArray<z.ZodObject<{
2143
- id: z.ZodString;
2144
- name: z.ZodString;
2145
- position: z.ZodNumber;
2146
- providerConfigId: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
2147
- modelName: z.ZodString;
2148
- messages: z.ZodArray<z.ZodObject<{
2149
- role: z.ZodEnum<{
2150
- system: "system";
2151
- user: "user";
2152
- assistant: "assistant";
2153
- }>;
2154
- content: z.ZodString;
2155
- }, z.core.$strip>>;
2156
- temperature: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2157
- maxTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2158
- topP: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2159
- frequencyPenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2160
- presencePenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2161
- configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2162
- variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2163
- variantVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2164
- }, z.core.$strip>>>;
2165
- id: z.ZodString;
2166
- createdAt: z.ZodDate;
2167
- updatedAt: z.ZodDate;
2168
- }, z.core.$strip>;
2169
- readonly playground_columns: z.ZodObject<{
2170
- id: z.ZodString;
2171
- name: z.ZodString;
2172
- position: z.ZodNumber;
2173
- providerConfigId: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
2174
- modelName: z.ZodString;
2175
- messages: z.ZodArray<z.ZodObject<{
2176
- role: z.ZodEnum<{
2177
- system: "system";
2178
- user: "user";
2179
- assistant: "assistant";
2180
- }>;
2181
- content: z.ZodString;
2182
- }, z.core.$strip>>;
2183
- temperature: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2184
- maxTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2185
- topP: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2186
- frequencyPenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2187
- presencePenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2188
- configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2189
- variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2190
- variantVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2191
- }, z.core.$strip>;
2192
- readonly playground_runs: z.ZodObject<{
2193
- playgroundId: z.ZodString;
2194
- datasetId: z.ZodNullable<z.ZodString>;
2195
- datasetVersionId: z.ZodNullable<z.ZodString>;
2196
- status: z.ZodEnum<{
2197
- pending: "pending";
2198
- running: "running";
2199
- completed: "completed";
2200
- failed: "failed";
2201
- cancelled: "cancelled";
2202
- }>;
2203
- startedAt: z.ZodNullable<z.ZodDate>;
2204
- completedAt: z.ZodNullable<z.ZodDate>;
2205
- totalRecords: z.ZodDefault<z.ZodNumber>;
2206
- completedRecords: z.ZodDefault<z.ZodNumber>;
2207
- id: z.ZodString;
2208
- createdAt: z.ZodDate;
2209
- updatedAt: z.ZodDate;
2210
- }, z.core.$strip>;
2211
- readonly playground_results: z.ZodObject<{
2212
- runId: z.ZodString;
2213
- columnId: z.ZodString;
2214
- datasetRecordId: z.ZodNullable<z.ZodString>;
2215
- inputVariables: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2216
- outputContent: z.ZodNullable<z.ZodString>;
2217
- status: z.ZodEnum<{
2218
- pending: "pending";
2219
- running: "running";
2220
- completed: "completed";
2221
- failed: "failed";
2222
- }>;
2223
- error: z.ZodNullable<z.ZodString>;
2224
- latencyMs: z.ZodNullable<z.ZodNumber>;
2225
- promptTokens: z.ZodNullable<z.ZodNumber>;
2226
- completionTokens: z.ZodNullable<z.ZodNumber>;
2227
- totalTokens: z.ZodNullable<z.ZodNumber>;
2228
- cost: z.ZodNullable<z.ZodNumber>;
2229
- id: z.ZodString;
2230
- createdAt: z.ZodDate;
2231
- updatedAt: z.ZodDate;
2232
- }, z.core.$strip>;
2233
- readonly guardrail_configs: z.ZodObject<{
2234
- name: z.ZodString;
2235
- pluginId: z.ZodString;
2236
- functionId: z.ZodString;
2237
- hookType: z.ZodEnum<{
2238
- beforeRequestHook: "beforeRequestHook";
2239
- afterRequestHook: "afterRequestHook";
2240
- }>;
2241
- parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2242
- enabled: z.ZodDefault<z.ZodBoolean>;
2243
- priority: z.ZodDefault<z.ZodNumber>;
2244
- onFail: z.ZodDefault<z.ZodEnum<{
2245
- block: "block";
2246
- log: "log";
2247
- }>>;
2248
- id: z.ZodString;
2249
- createdAt: z.ZodDate;
2250
- updatedAt: z.ZodDate;
2251
- }, z.core.$strip>;
2252
- readonly provider_guardrail_overrides: z.ZodObject<{
2253
- providerConfigId: z.ZodString;
2254
- guardrailConfigId: z.ZodString;
2255
- enabled: z.ZodDefault<z.ZodBoolean>;
2256
- parameters: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
2257
- id: z.ZodString;
2258
- createdAt: z.ZodDate;
2259
- updatedAt: z.ZodDate;
2260
- }, z.core.$strip>;
2261
- readonly datasets: z.ZodObject<{
2262
- name: z.ZodString;
2263
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2264
- recordCount: z.ZodDefault<z.ZodNumber>;
2265
- latestVersionNumber: z.ZodDefault<z.ZodNumber>;
2266
- id: z.ZodString;
2267
- createdAt: z.ZodDate;
2268
- updatedAt: z.ZodDate;
2269
- }, z.core.$strip>;
2270
- readonly dataset_versions: z.ZodObject<{
2271
- datasetId: z.ZodString;
2272
- versionNumber: z.ZodNumber;
2273
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2274
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2275
- recordCount: z.ZodDefault<z.ZodNumber>;
2276
- snapshotHash: z.ZodString;
2277
- id: z.ZodString;
2278
- createdAt: z.ZodDate;
2279
- updatedAt: z.ZodDate;
2280
- }, z.core.$strip>;
2281
- readonly dataset_records: z.ZodObject<{
2282
- datasetId: z.ZodString;
2283
- input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2284
- expected: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
2285
- metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2286
- id: z.ZodString;
2287
- createdAt: z.ZodDate;
2288
- updatedAt: z.ZodDate;
2289
- }, z.core.$strip>;
2290
- readonly dataset_version_records: z.ZodObject<{
2291
- datasetVersionId: z.ZodString;
2292
- datasetRecordId: z.ZodString;
2293
- position: z.ZodDefault<z.ZodNumber>;
2294
- id: z.ZodString;
2295
- createdAt: z.ZodDate;
2296
- updatedAt: z.ZodDate;
2297
- }, z.core.$strip>;
2298
- readonly llm_requests: z.ZodObject<{
2299
- requestId: z.ZodString;
2300
- configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2301
- variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2302
- environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2303
- providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2304
- provider: z.ZodString;
2305
- model: z.ZodString;
2306
- promptTokens: z.ZodDefault<z.ZodNumber>;
2307
- completionTokens: z.ZodDefault<z.ZodNumber>;
2308
- totalTokens: z.ZodDefault<z.ZodNumber>;
2309
- cachedTokens: z.ZodDefault<z.ZodNumber>;
2310
- cacheCreationTokens: z.ZodDefault<z.ZodNumber>;
2311
- cost: z.ZodDefault<z.ZodNumber>;
2312
- cacheSavings: z.ZodDefault<z.ZodNumber>;
2313
- inputCost: z.ZodDefault<z.ZodNumber>;
2314
- outputCost: z.ZodDefault<z.ZodNumber>;
2315
- endpoint: z.ZodString;
2316
- statusCode: z.ZodNumber;
2317
- latencyMs: z.ZodDefault<z.ZodNumber>;
2318
- isStreaming: z.ZodDefault<z.ZodBoolean>;
2319
- userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2320
- tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
2321
- guardrailResults: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2322
- results: z.ZodArray<z.ZodObject<{
2323
- checkId: z.ZodString;
2324
- functionId: z.ZodString;
2325
- hookType: z.ZodEnum<{
2326
- beforeRequestHook: "beforeRequestHook";
2327
- afterRequestHook: "afterRequestHook";
2328
- }>;
2329
- verdict: z.ZodBoolean;
2330
- latencyMs: z.ZodNumber;
2331
- }, z.core.$strip>>;
2332
- action: z.ZodEnum<{
2333
- allowed: "allowed";
2334
- blocked: "blocked";
2335
- logged: "logged";
2336
- }>;
2337
- totalLatencyMs: z.ZodNumber;
2338
- }, z.core.$strip>>>;
2339
- traceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2340
- spanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2341
- parentSpanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2342
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2343
- id: z.ZodString;
2344
- createdAt: z.ZodDate;
2345
- updatedAt: z.ZodDate;
2346
- }, z.core.$strip>;
2347
- readonly traces: z.ZodObject<{
2348
- traceId: z.ZodString;
2349
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2350
- sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2351
- userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2352
- status: z.ZodDefault<z.ZodString>;
2353
- startTime: z.ZodDate;
2354
- endTime: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
2355
- durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2356
- spanCount: z.ZodDefault<z.ZodNumber>;
2357
- totalInputTokens: z.ZodDefault<z.ZodNumber>;
2358
- totalOutputTokens: z.ZodDefault<z.ZodNumber>;
2359
- totalTokens: z.ZodDefault<z.ZodNumber>;
2360
- totalCost: z.ZodDefault<z.ZodNumber>;
2361
- tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
2362
- metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2363
- id: z.ZodString;
2364
- createdAt: z.ZodDate;
2365
- updatedAt: z.ZodDate;
2366
- }, z.core.$strip>;
2367
- readonly spans: z.ZodObject<{
2368
- traceId: z.ZodString;
2369
- spanId: z.ZodString;
2370
- parentSpanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2371
- name: z.ZodString;
2372
- kind: z.ZodDefault<z.ZodNumber>;
2373
- status: z.ZodDefault<z.ZodNumber>;
2374
- statusMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2375
- startTime: z.ZodDate;
2376
- endTime: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
2377
- durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2378
- provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2379
- model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2380
- promptTokens: z.ZodDefault<z.ZodNumber>;
2381
- completionTokens: z.ZodDefault<z.ZodNumber>;
2382
- totalTokens: z.ZodDefault<z.ZodNumber>;
2383
- cost: z.ZodDefault<z.ZodNumber>;
2384
- configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2385
- variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2386
- environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2387
- providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2388
- requestId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2389
- source: z.ZodDefault<z.ZodString>;
2390
- input: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
2391
- output: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
2392
- attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2393
- id: z.ZodString;
2394
- createdAt: z.ZodDate;
2395
- updatedAt: z.ZodDate;
2396
- }, z.core.$strip>;
2397
- readonly span_events: z.ZodObject<{
2398
- id: z.ZodString;
2399
- traceId: z.ZodString;
2400
- spanId: z.ZodString;
2401
- name: z.ZodString;
2402
- timestamp: z.ZodDate;
2403
- attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2404
- createdAt: z.ZodDate;
2405
- }, z.core.$strip>;
2406
- };
2407
- //#endregion
2408
- //#region src/db/validation.d.ts
2409
- /**
2410
- * Validate data against table schema
2411
- * Useful for runtime validation before inserting/updating
2412
- */
2413
- declare function validateTableData<T extends TableName>(table: T, data: unknown): zod0.ZodSafeParseSuccess<{
2414
- slug: string;
2415
- id: string;
2416
- createdAt: Date;
2417
- updatedAt: Date;
2418
- name?: string | undefined;
2419
- }> | zod0.ZodSafeParseError<{
2420
- slug: string;
2421
- id: string;
2422
- createdAt: Date;
2423
- updatedAt: Date;
2424
- name?: string | undefined;
2425
- }> | zod0.ZodSafeParseSuccess<{
2426
- name: string;
2427
- id: string;
2428
- createdAt: Date;
2429
- updatedAt: Date;
2430
- }> | zod0.ZodSafeParseError<{
2431
- name: string;
2432
- id: string;
2433
- createdAt: Date;
2434
- updatedAt: Date;
2435
- }> | zod0.ZodSafeParseSuccess<{
2436
- variantId: string;
2437
- version: number;
2438
- provider: string;
2439
- modelName: string;
2440
- jsonData: Record<string, unknown>;
2441
- id: string;
2442
- createdAt: Date;
2443
- updatedAt: Date;
2444
- }> | zod0.ZodSafeParseError<{
2445
- variantId: string;
2446
- version: number;
2447
- provider: string;
2448
- modelName: string;
2449
- jsonData: Record<string, unknown>;
2450
- id: string;
2451
- createdAt: Date;
2452
- updatedAt: Date;
2453
- }> | zod0.ZodSafeParseSuccess<{
2454
- environmentId: string;
2455
- keyName: string;
2456
- keyValue: string;
2457
- id: string;
2458
- createdAt: Date;
2459
- updatedAt: Date;
2460
- }> | zod0.ZodSafeParseError<{
2461
- environmentId: string;
2462
- keyName: string;
2463
- keyValue: string;
2464
- id: string;
2465
- createdAt: Date;
2466
- updatedAt: Date;
2467
- }> | zod0.ZodSafeParseSuccess<{
2468
- configId: string;
2469
- variantId: string;
2470
- id: string;
2471
- createdAt: Date;
2472
- updatedAt: Date;
2473
- }> | zod0.ZodSafeParseError<{
2474
- configId: string;
2475
- variantId: string;
2476
- id: string;
2477
- createdAt: Date;
2478
- updatedAt: Date;
2479
- }> | zod0.ZodSafeParseSuccess<{
2480
- environmentId: string;
2481
- configId: string;
2482
- configVariantId: string;
2483
- weight: number;
2484
- priority: number;
2485
- enabled: boolean;
2486
- conditions: Record<string, unknown>;
2487
- id: string;
2488
- createdAt: Date;
2489
- updatedAt: Date;
2490
- variantVersionId?: string | null | undefined;
2491
- }> | zod0.ZodSafeParseError<{
2492
- environmentId: string;
2493
- configId: string;
2494
- configVariantId: string;
2495
- weight: number;
2496
- priority: number;
2497
- enabled: boolean;
2498
- conditions: Record<string, unknown>;
2499
- id: string;
2500
- createdAt: Date;
2501
- updatedAt: Date;
2502
- variantVersionId?: string | null | undefined;
2503
- }> | zod0.ZodSafeParseSuccess<{
2504
- setupComplete: boolean;
2505
- id: string;
2506
- createdAt: Date;
2507
- updatedAt: Date;
2508
- name?: string | null | undefined;
2509
- superAdminId?: string | null | undefined;
2510
- }> | zod0.ZodSafeParseError<{
2511
- setupComplete: boolean;
2512
- id: string;
2513
- createdAt: Date;
2514
- updatedAt: Date;
2515
- name?: string | null | undefined;
2516
- superAdminId?: string | null | undefined;
2517
- }> | zod0.ZodSafeParseSuccess<{
2518
- providerId: string;
2519
- config: Record<string, unknown>;
2520
- enabled: boolean;
2521
- id: string;
2522
- createdAt: Date;
2523
- updatedAt: Date;
2524
- slug?: string | null | undefined;
2525
- name?: string | null | undefined;
2526
- }> | zod0.ZodSafeParseError<{
2527
- providerId: string;
2528
- config: Record<string, unknown>;
2529
- enabled: boolean;
2530
- id: string;
2531
- createdAt: Date;
2532
- updatedAt: Date;
2533
- slug?: string | null | undefined;
2534
- name?: string | null | undefined;
2535
- }> | zod0.ZodSafeParseSuccess<{
2536
- playgroundId: string;
2537
- datasetId: string | null;
2538
- datasetVersionId: string | null;
2539
- status: "pending" | "running" | "completed" | "failed" | "cancelled";
2540
- startedAt: Date | null;
2541
- completedAt: Date | null;
2542
- totalRecords: number;
2543
- completedRecords: number;
2544
- id: string;
2545
- createdAt: Date;
2546
- updatedAt: Date;
2547
- }> | zod0.ZodSafeParseError<{
2548
- playgroundId: string;
2549
- datasetId: string | null;
2550
- datasetVersionId: string | null;
2551
- status: "pending" | "running" | "completed" | "failed" | "cancelled";
2552
- startedAt: Date | null;
2553
- completedAt: Date | null;
2554
- totalRecords: number;
2555
- completedRecords: number;
2556
- id: string;
2557
- createdAt: Date;
2558
- updatedAt: Date;
2559
- }> | zod0.ZodSafeParseSuccess<{
2560
- runId: string;
2561
- columnId: string;
2562
- datasetRecordId: string | null;
2563
- inputVariables: Record<string, unknown>;
2564
- outputContent: string | null;
2565
- status: "pending" | "running" | "completed" | "failed";
2566
- error: string | null;
2567
- latencyMs: number | null;
2568
- promptTokens: number | null;
2569
- completionTokens: number | null;
2570
- totalTokens: number | null;
2571
- cost: number | null;
2572
- id: string;
2573
- createdAt: Date;
2574
- updatedAt: Date;
2575
- }> | zod0.ZodSafeParseError<{
2576
- runId: string;
2577
- columnId: string;
2578
- datasetRecordId: string | null;
2579
- inputVariables: Record<string, unknown>;
2580
- outputContent: string | null;
2581
- status: "pending" | "running" | "completed" | "failed";
2582
- error: string | null;
2583
- latencyMs: number | null;
2584
- promptTokens: number | null;
2585
- completionTokens: number | null;
2586
- totalTokens: number | null;
2587
- cost: number | null;
2588
- id: string;
2589
- createdAt: Date;
2590
- updatedAt: Date;
2591
- }> | zod0.ZodSafeParseSuccess<{
2592
- datasetId: string;
2593
- versionNumber: number;
2594
- recordCount: number;
2595
- snapshotHash: string;
2596
- id: string;
2597
- createdAt: Date;
2598
- updatedAt: Date;
2599
- name?: string | null | undefined;
2600
- description?: string | null | undefined;
2601
- }> | zod0.ZodSafeParseError<{
2602
- datasetId: string;
2603
- versionNumber: number;
2604
- recordCount: number;
2605
- snapshotHash: string;
2606
- id: string;
2607
- createdAt: Date;
2608
- updatedAt: Date;
2609
- name?: string | null | undefined;
2610
- description?: string | null | undefined;
2611
- }> | zod0.ZodSafeParseSuccess<{
2612
- datasetId: string;
2613
- input: Record<string, unknown>;
2614
- metadata: Record<string, unknown>;
2615
- id: string;
2616
- createdAt: Date;
2617
- updatedAt: Date;
2618
- expected?: Record<string, unknown> | null | undefined;
2619
- }> | zod0.ZodSafeParseError<{
2620
- datasetId: string;
2621
- input: Record<string, unknown>;
2622
- metadata: Record<string, unknown>;
2623
- id: string;
2624
- createdAt: Date;
2625
- updatedAt: Date;
2626
- expected?: Record<string, unknown> | null | undefined;
2627
- }> | zod0.ZodSafeParseSuccess<{
2628
- datasetVersionId: string;
2629
- datasetRecordId: string;
2630
- position: number;
2631
- id: string;
2632
- createdAt: Date;
2633
- updatedAt: Date;
2634
- }> | zod0.ZodSafeParseError<{
2635
- datasetVersionId: string;
2636
- datasetRecordId: string;
2637
- position: number;
2638
- id: string;
2639
- createdAt: Date;
2640
- updatedAt: Date;
2641
- }> | zod0.ZodSafeParseSuccess<{
2642
- providerConfigId: string;
2643
- guardrailConfigId: string;
2644
- enabled: boolean;
2645
- id: string;
2646
- createdAt: Date;
2647
- updatedAt: Date;
2648
- parameters?: Record<string, unknown> | null | undefined;
2649
- }> | zod0.ZodSafeParseError<{
2650
- providerConfigId: string;
2651
- guardrailConfigId: string;
2652
- enabled: boolean;
2653
- id: string;
2654
- createdAt: Date;
2655
- updatedAt: Date;
2656
- parameters?: Record<string, unknown> | null | undefined;
2657
- }> | zod0.ZodSafeParseSuccess<{
2658
- requestId: string;
2659
- provider: string;
2660
- model: string;
2661
- promptTokens: number;
2662
- completionTokens: number;
2663
- totalTokens: number;
2664
- cachedTokens: number;
2665
- cacheCreationTokens: number;
2666
- cost: number;
2667
- cacheSavings: number;
2668
- inputCost: number;
2669
- outputCost: number;
2670
- endpoint: string;
2671
- statusCode: number;
2672
- latencyMs: number;
2673
- isStreaming: boolean;
2674
- tags: Record<string, string>;
2675
- id: string;
2676
- createdAt: Date;
2677
- updatedAt: Date;
2678
- configId?: string | null | undefined;
2679
- variantId?: string | null | undefined;
2680
- environmentId?: string | null | undefined;
2681
- providerConfigId?: string | null | undefined;
2682
- userId?: string | null | undefined;
2683
- guardrailResults?: {
2684
- results: {
2685
- checkId: string;
2686
- functionId: string;
2687
- hookType: "beforeRequestHook" | "afterRequestHook";
2688
- verdict: boolean;
2689
- latencyMs: number;
2690
- }[];
2691
- action: "allowed" | "blocked" | "logged";
2692
- totalLatencyMs: number;
2693
- } | null | undefined;
2694
- traceId?: string | null | undefined;
2695
- spanId?: string | null | undefined;
2696
- parentSpanId?: string | null | undefined;
2697
- sessionId?: string | null | undefined;
2698
- }> | zod0.ZodSafeParseError<{
2699
- requestId: string;
2700
- provider: string;
2701
- model: string;
2702
- promptTokens: number;
2703
- completionTokens: number;
2704
- totalTokens: number;
2705
- cachedTokens: number;
2706
- cacheCreationTokens: number;
2707
- cost: number;
2708
- cacheSavings: number;
2709
- inputCost: number;
2710
- outputCost: number;
2711
- endpoint: string;
2712
- statusCode: number;
2713
- latencyMs: number;
2714
- isStreaming: boolean;
2715
- tags: Record<string, string>;
2716
- id: string;
2717
- createdAt: Date;
2718
- updatedAt: Date;
2719
- configId?: string | null | undefined;
2720
- variantId?: string | null | undefined;
2721
- environmentId?: string | null | undefined;
2722
- providerConfigId?: string | null | undefined;
2723
- userId?: string | null | undefined;
2724
- guardrailResults?: {
2725
- results: {
2726
- checkId: string;
2727
- functionId: string;
2728
- hookType: "beforeRequestHook" | "afterRequestHook";
2729
- verdict: boolean;
2730
- latencyMs: number;
2731
- }[];
2732
- action: "allowed" | "blocked" | "logged";
2733
- totalLatencyMs: number;
2734
- } | null | undefined;
2735
- traceId?: string | null | undefined;
2736
- spanId?: string | null | undefined;
2737
- parentSpanId?: string | null | undefined;
2738
- sessionId?: string | null | undefined;
2739
- }> | zod0.ZodSafeParseSuccess<{
2740
- traceId: string;
2741
- status: string;
2742
- startTime: Date;
2743
- spanCount: number;
2744
- totalInputTokens: number;
2745
- totalOutputTokens: number;
2746
- totalTokens: number;
2747
- totalCost: number;
2748
- tags: Record<string, string>;
2749
- metadata: Record<string, unknown>;
2750
- id: string;
2751
- createdAt: Date;
2752
- updatedAt: Date;
2753
- name?: string | null | undefined;
2754
- sessionId?: string | null | undefined;
2755
- userId?: string | null | undefined;
2756
- endTime?: Date | null | undefined;
2757
- durationMs?: number | null | undefined;
2758
- }> | zod0.ZodSafeParseError<{
2759
- traceId: string;
2760
- status: string;
2761
- startTime: Date;
2762
- spanCount: number;
2763
- totalInputTokens: number;
2764
- totalOutputTokens: number;
2765
- totalTokens: number;
2766
- totalCost: number;
2767
- tags: Record<string, string>;
2768
- metadata: Record<string, unknown>;
2769
- id: string;
2770
- createdAt: Date;
2771
- updatedAt: Date;
2772
- name?: string | null | undefined;
2773
- sessionId?: string | null | undefined;
2774
- userId?: string | null | undefined;
2775
- endTime?: Date | null | undefined;
2776
- durationMs?: number | null | undefined;
2777
- }> | zod0.ZodSafeParseSuccess<{
2778
- id: string;
2779
- traceId: string;
2780
- spanId: string;
2781
- name: string;
2782
- timestamp: Date;
2783
- attributes: Record<string, unknown>;
2784
- createdAt: Date;
2785
- }> | zod0.ZodSafeParseError<{
2786
- id: string;
2787
- traceId: string;
2788
- spanId: string;
2789
- name: string;
2790
- timestamp: Date;
2791
- attributes: Record<string, unknown>;
2792
- createdAt: Date;
2793
- }>;
2794
- /**
2795
- * Validate partial data (for updates)
2796
- */
2797
- declare function validatePartialTableData<T extends TableName>(table: T, data: unknown): zod0.ZodSafeParseSuccess<{
2798
- name?: string | undefined;
2799
- id?: string | undefined;
2800
- createdAt?: Date | undefined;
2801
- updatedAt?: Date | undefined;
2802
- }> | zod0.ZodSafeParseError<{
2803
- name?: string | undefined;
2804
- id?: string | undefined;
2805
- createdAt?: Date | undefined;
2806
- updatedAt?: Date | undefined;
2807
- }> | zod0.ZodSafeParseSuccess<{
2808
- variantId?: string | undefined;
2809
- version?: number | undefined;
2810
- provider?: string | undefined;
2811
- modelName?: string | undefined;
2812
- jsonData?: Record<string, unknown> | undefined;
2813
- id?: string | undefined;
2814
- createdAt?: Date | undefined;
2815
- updatedAt?: Date | undefined;
2816
- }> | zod0.ZodSafeParseError<{
2817
- variantId?: string | undefined;
2818
- version?: number | undefined;
2819
- provider?: string | undefined;
2820
- modelName?: string | undefined;
2821
- jsonData?: Record<string, unknown> | undefined;
2822
- id?: string | undefined;
2823
- createdAt?: Date | undefined;
2824
- updatedAt?: Date | undefined;
2825
- }> | zod0.ZodSafeParseSuccess<{
2826
- environmentId?: string | undefined;
2827
- keyName?: string | undefined;
2828
- keyValue?: string | undefined;
2829
- id?: string | undefined;
2830
- createdAt?: Date | undefined;
2831
- updatedAt?: Date | undefined;
2832
- }> | zod0.ZodSafeParseError<{
2833
- environmentId?: string | undefined;
2834
- keyName?: string | undefined;
2835
- keyValue?: string | undefined;
2836
- id?: string | undefined;
2837
- createdAt?: Date | undefined;
2838
- updatedAt?: Date | undefined;
2839
- }> | zod0.ZodSafeParseSuccess<{
2840
- configId?: string | undefined;
2841
- variantId?: string | undefined;
2842
- id?: string | undefined;
2843
- createdAt?: Date | undefined;
2844
- updatedAt?: Date | undefined;
2845
- }> | zod0.ZodSafeParseError<{
2846
- configId?: string | undefined;
2847
- variantId?: string | undefined;
2848
- id?: string | undefined;
2849
- createdAt?: Date | undefined;
2850
- updatedAt?: Date | undefined;
2851
- }> | zod0.ZodSafeParseSuccess<{
2852
- environmentId?: string | undefined;
2853
- configId?: string | undefined;
2854
- configVariantId?: string | undefined;
2855
- variantVersionId?: string | null | undefined;
2856
- weight?: number | undefined;
2857
- priority?: number | undefined;
2858
- enabled?: boolean | undefined;
2859
- conditions?: Record<string, unknown> | undefined;
2860
- id?: string | undefined;
2861
- createdAt?: Date | undefined;
2862
- updatedAt?: Date | undefined;
2863
- }> | zod0.ZodSafeParseError<{
2864
- environmentId?: string | undefined;
2865
- configId?: string | undefined;
2866
- configVariantId?: string | undefined;
2867
- variantVersionId?: string | null | undefined;
2868
- weight?: number | undefined;
2869
- priority?: number | undefined;
2870
- enabled?: boolean | undefined;
2871
- conditions?: Record<string, unknown> | undefined;
2872
- id?: string | undefined;
2873
- createdAt?: Date | undefined;
2874
- updatedAt?: Date | undefined;
2875
- }> | zod0.ZodSafeParseSuccess<{
2876
- name?: string | null | undefined;
2877
- setupComplete?: boolean | undefined;
2878
- superAdminId?: string | null | undefined;
2879
- id?: string | undefined;
2880
- createdAt?: Date | undefined;
2881
- updatedAt?: Date | undefined;
2882
- }> | zod0.ZodSafeParseError<{
2883
- name?: string | null | undefined;
2884
- setupComplete?: boolean | undefined;
2885
- superAdminId?: string | null | undefined;
2886
- id?: string | undefined;
2887
- createdAt?: Date | undefined;
2888
- updatedAt?: Date | undefined;
2889
- }> | zod0.ZodSafeParseSuccess<{
2890
- providerId?: string | undefined;
2891
- slug?: string | null | undefined;
2892
- name?: string | null | undefined;
2893
- config?: Record<string, unknown> | undefined;
2894
- enabled?: boolean | undefined;
2895
- id?: string | undefined;
2896
- createdAt?: Date | undefined;
2897
- updatedAt?: Date | undefined;
2898
- }> | zod0.ZodSafeParseError<{
2899
- providerId?: string | undefined;
2900
- slug?: string | null | undefined;
2901
- name?: string | null | undefined;
2902
- config?: Record<string, unknown> | undefined;
2903
- enabled?: boolean | undefined;
2904
- id?: string | undefined;
2905
- createdAt?: Date | undefined;
2906
- updatedAt?: Date | undefined;
2907
- }> | zod0.ZodSafeParseSuccess<{
2908
- playgroundId?: string | undefined;
2909
- datasetId?: string | null | undefined;
2910
- datasetVersionId?: string | null | undefined;
2911
- status?: "pending" | "running" | "completed" | "failed" | "cancelled" | undefined;
2912
- startedAt?: Date | null | undefined;
2913
- completedAt?: Date | null | undefined;
2914
- totalRecords?: number | undefined;
2915
- completedRecords?: number | undefined;
2916
- id?: string | undefined;
2917
- createdAt?: Date | undefined;
2918
- updatedAt?: Date | undefined;
2919
- }> | zod0.ZodSafeParseError<{
2920
- playgroundId?: string | undefined;
2921
- datasetId?: string | null | undefined;
2922
- datasetVersionId?: string | null | undefined;
2923
- status?: "pending" | "running" | "completed" | "failed" | "cancelled" | undefined;
2924
- startedAt?: Date | null | undefined;
2925
- completedAt?: Date | null | undefined;
2926
- totalRecords?: number | undefined;
2927
- completedRecords?: number | undefined;
2928
- id?: string | undefined;
2929
- createdAt?: Date | undefined;
2930
- updatedAt?: Date | undefined;
2931
- }> | zod0.ZodSafeParseSuccess<{
2932
- runId?: string | undefined;
2933
- columnId?: string | undefined;
2934
- datasetRecordId?: string | null | undefined;
2935
- inputVariables?: Record<string, unknown> | undefined;
2936
- outputContent?: string | null | undefined;
2937
- status?: "pending" | "running" | "completed" | "failed" | undefined;
2938
- error?: string | null | undefined;
2939
- latencyMs?: number | null | undefined;
2940
- promptTokens?: number | null | undefined;
2941
- completionTokens?: number | null | undefined;
2942
- totalTokens?: number | null | undefined;
2943
- cost?: number | null | undefined;
2944
- id?: string | undefined;
2945
- createdAt?: Date | undefined;
2946
- updatedAt?: Date | undefined;
2947
- }> | zod0.ZodSafeParseError<{
2948
- runId?: string | undefined;
2949
- columnId?: string | undefined;
2950
- datasetRecordId?: string | null | undefined;
2951
- inputVariables?: Record<string, unknown> | undefined;
2952
- outputContent?: string | null | undefined;
2953
- status?: "pending" | "running" | "completed" | "failed" | undefined;
2954
- error?: string | null | undefined;
2955
- latencyMs?: number | null | undefined;
2956
- promptTokens?: number | null | undefined;
2957
- completionTokens?: number | null | undefined;
2958
- totalTokens?: number | null | undefined;
2959
- cost?: number | null | undefined;
2960
- id?: string | undefined;
2961
- createdAt?: Date | undefined;
2962
- updatedAt?: Date | undefined;
2963
- }> | zod0.ZodSafeParseSuccess<{
2964
- datasetId?: string | undefined;
2965
- versionNumber?: number | undefined;
2966
- name?: string | null | undefined;
2967
- description?: string | null | undefined;
2968
- recordCount?: number | undefined;
2969
- snapshotHash?: string | undefined;
2970
- id?: string | undefined;
2971
- createdAt?: Date | undefined;
2972
- updatedAt?: Date | undefined;
2973
- }> | zod0.ZodSafeParseError<{
2974
- datasetId?: string | undefined;
2975
- versionNumber?: number | undefined;
2976
- name?: string | null | undefined;
2977
- description?: string | null | undefined;
2978
- recordCount?: number | undefined;
2979
- snapshotHash?: string | undefined;
2980
- id?: string | undefined;
2981
- createdAt?: Date | undefined;
2982
- updatedAt?: Date | undefined;
2983
- }> | zod0.ZodSafeParseSuccess<{
2984
- datasetId?: string | undefined;
2985
- input?: Record<string, unknown> | undefined;
2986
- expected?: Record<string, unknown> | null | undefined;
2987
- metadata?: Record<string, unknown> | undefined;
2988
- id?: string | undefined;
2989
- createdAt?: Date | undefined;
2990
- updatedAt?: Date | undefined;
2991
- }> | zod0.ZodSafeParseError<{
2992
- datasetId?: string | undefined;
2993
- input?: Record<string, unknown> | undefined;
2994
- expected?: Record<string, unknown> | null | undefined;
2995
- metadata?: Record<string, unknown> | undefined;
2996
- id?: string | undefined;
2997
- createdAt?: Date | undefined;
2998
- updatedAt?: Date | undefined;
2999
- }> | zod0.ZodSafeParseSuccess<{
3000
- datasetVersionId?: string | undefined;
3001
- datasetRecordId?: string | undefined;
3002
- position?: number | undefined;
3003
- id?: string | undefined;
3004
- createdAt?: Date | undefined;
3005
- updatedAt?: Date | undefined;
3006
- }> | zod0.ZodSafeParseError<{
3007
- datasetVersionId?: string | undefined;
3008
- datasetRecordId?: string | undefined;
3009
- position?: number | undefined;
3010
- id?: string | undefined;
3011
- createdAt?: Date | undefined;
3012
- updatedAt?: Date | undefined;
3013
- }> | zod0.ZodSafeParseSuccess<{
3014
- providerConfigId?: string | undefined;
3015
- guardrailConfigId?: string | undefined;
3016
- enabled?: boolean | undefined;
3017
- parameters?: Record<string, unknown> | null | undefined;
3018
- id?: string | undefined;
3019
- createdAt?: Date | undefined;
3020
- updatedAt?: Date | undefined;
3021
- }> | zod0.ZodSafeParseError<{
3022
- providerConfigId?: string | undefined;
3023
- guardrailConfigId?: string | undefined;
3024
- enabled?: boolean | undefined;
3025
- parameters?: Record<string, unknown> | null | undefined;
3026
- id?: string | undefined;
3027
- createdAt?: Date | undefined;
3028
- updatedAt?: Date | undefined;
3029
- }> | zod0.ZodSafeParseSuccess<{
3030
- requestId?: string | undefined;
3031
- configId?: string | null | undefined;
3032
- variantId?: string | null | undefined;
3033
- environmentId?: string | null | undefined;
3034
- providerConfigId?: string | null | undefined;
3035
- provider?: string | undefined;
3036
- model?: string | undefined;
3037
- promptTokens?: number | undefined;
3038
- completionTokens?: number | undefined;
3039
- totalTokens?: number | undefined;
3040
- cachedTokens?: number | undefined;
3041
- cacheCreationTokens?: number | undefined;
3042
- cost?: number | undefined;
3043
- cacheSavings?: number | undefined;
3044
- inputCost?: number | undefined;
3045
- outputCost?: number | undefined;
3046
- endpoint?: string | undefined;
3047
- statusCode?: number | undefined;
3048
- latencyMs?: number | undefined;
3049
- isStreaming?: boolean | undefined;
3050
- userId?: string | null | undefined;
3051
- tags?: Record<string, string> | undefined;
3052
- guardrailResults?: {
3053
- results: {
3054
- checkId: string;
3055
- functionId: string;
3056
- hookType: "beforeRequestHook" | "afterRequestHook";
3057
- verdict: boolean;
3058
- latencyMs: number;
3059
- }[];
3060
- action: "allowed" | "blocked" | "logged";
3061
- totalLatencyMs: number;
3062
- } | null | undefined;
3063
- traceId?: string | null | undefined;
3064
- spanId?: string | null | undefined;
3065
- parentSpanId?: string | null | undefined;
3066
- sessionId?: string | null | undefined;
3067
- id?: string | undefined;
3068
- createdAt?: Date | undefined;
3069
- updatedAt?: Date | undefined;
3070
- }> | zod0.ZodSafeParseError<{
3071
- requestId?: string | undefined;
3072
- configId?: string | null | undefined;
3073
- variantId?: string | null | undefined;
3074
- environmentId?: string | null | undefined;
3075
- providerConfigId?: string | null | undefined;
3076
- provider?: string | undefined;
3077
- model?: string | undefined;
3078
- promptTokens?: number | undefined;
3079
- completionTokens?: number | undefined;
3080
- totalTokens?: number | undefined;
3081
- cachedTokens?: number | undefined;
3082
- cacheCreationTokens?: number | undefined;
3083
- cost?: number | undefined;
3084
- cacheSavings?: number | undefined;
3085
- inputCost?: number | undefined;
3086
- outputCost?: number | undefined;
3087
- endpoint?: string | undefined;
3088
- statusCode?: number | undefined;
3089
- latencyMs?: number | undefined;
3090
- isStreaming?: boolean | undefined;
3091
- userId?: string | null | undefined;
3092
- tags?: Record<string, string> | undefined;
3093
- guardrailResults?: {
3094
- results: {
3095
- checkId: string;
3096
- functionId: string;
3097
- hookType: "beforeRequestHook" | "afterRequestHook";
3098
- verdict: boolean;
3099
- latencyMs: number;
3100
- }[];
3101
- action: "allowed" | "blocked" | "logged";
3102
- totalLatencyMs: number;
3103
- } | null | undefined;
3104
- traceId?: string | null | undefined;
3105
- spanId?: string | null | undefined;
3106
- parentSpanId?: string | null | undefined;
3107
- sessionId?: string | null | undefined;
3108
- id?: string | undefined;
3109
- createdAt?: Date | undefined;
3110
- updatedAt?: Date | undefined;
3111
- }> | zod0.ZodSafeParseSuccess<{
3112
- traceId?: string | undefined;
3113
- name?: string | null | undefined;
3114
- sessionId?: string | null | undefined;
3115
- userId?: string | null | undefined;
3116
- status?: string | undefined;
3117
- startTime?: Date | undefined;
3118
- endTime?: Date | null | undefined;
3119
- durationMs?: number | null | undefined;
3120
- spanCount?: number | undefined;
3121
- totalInputTokens?: number | undefined;
3122
- totalOutputTokens?: number | undefined;
3123
- totalTokens?: number | undefined;
3124
- totalCost?: number | undefined;
3125
- tags?: Record<string, string> | undefined;
3126
- metadata?: Record<string, unknown> | undefined;
3127
- id?: string | undefined;
3128
- createdAt?: Date | undefined;
3129
- updatedAt?: Date | undefined;
3130
- }> | zod0.ZodSafeParseError<{
3131
- traceId?: string | undefined;
3132
- name?: string | null | undefined;
3133
- sessionId?: string | null | undefined;
3134
- userId?: string | null | undefined;
3135
- status?: string | undefined;
3136
- startTime?: Date | undefined;
3137
- endTime?: Date | null | undefined;
3138
- durationMs?: number | null | undefined;
3139
- spanCount?: number | undefined;
3140
- totalInputTokens?: number | undefined;
3141
- totalOutputTokens?: number | undefined;
3142
- totalTokens?: number | undefined;
3143
- totalCost?: number | undefined;
3144
- tags?: Record<string, string> | undefined;
3145
- metadata?: Record<string, unknown> | undefined;
3146
- id?: string | undefined;
3147
- createdAt?: Date | undefined;
3148
- updatedAt?: Date | undefined;
3149
- }> | zod0.ZodSafeParseSuccess<{
3150
- id?: string | undefined;
3151
- traceId?: string | undefined;
3152
- spanId?: string | undefined;
3153
- name?: string | undefined;
3154
- timestamp?: Date | undefined;
3155
- attributes?: Record<string, unknown> | undefined;
3156
- createdAt?: Date | undefined;
3157
- }> | zod0.ZodSafeParseError<{
3158
- id?: string | undefined;
3159
- traceId?: string | undefined;
3160
- spanId?: string | undefined;
3161
- name?: string | undefined;
3162
- timestamp?: Date | undefined;
3163
- attributes?: Record<string, unknown> | undefined;
3164
- createdAt?: Date | undefined;
3165
- }>;
3166
- /**
3167
- * Parse and validate data, throws on error
3168
- */
3169
- declare function parseTableData<T extends TableName>(table: T, data: unknown): {
3170
- slug: string;
3171
- id: string;
3172
- createdAt: Date;
3173
- updatedAt: Date;
3174
- name?: string | undefined;
3175
- } | {
3176
- name: string;
3177
- id: string;
3178
- createdAt: Date;
3179
- updatedAt: Date;
3180
- } | {
3181
- variantId: string;
3182
- version: number;
3183
- provider: string;
3184
- modelName: string;
3185
- jsonData: Record<string, unknown>;
3186
- id: string;
3187
- createdAt: Date;
3188
- updatedAt: Date;
3189
- } | {
3190
- environmentId: string;
3191
- keyName: string;
3192
- keyValue: string;
3193
- id: string;
3194
- createdAt: Date;
3195
- updatedAt: Date;
3196
- } | {
3197
- configId: string;
3198
- variantId: string;
3199
- id: string;
3200
- createdAt: Date;
3201
- updatedAt: Date;
3202
- } | {
3203
- environmentId: string;
3204
- configId: string;
3205
- configVariantId: string;
3206
- weight: number;
3207
- priority: number;
3208
- enabled: boolean;
3209
- conditions: Record<string, unknown>;
3210
- id: string;
3211
- createdAt: Date;
3212
- updatedAt: Date;
3213
- variantVersionId?: string | null | undefined;
3214
- } | {
3215
- setupComplete: boolean;
3216
- id: string;
3217
- createdAt: Date;
3218
- updatedAt: Date;
3219
- name?: string | null | undefined;
3220
- superAdminId?: string | null | undefined;
3221
- } | {
3222
- providerId: string;
3223
- config: Record<string, unknown>;
3224
- enabled: boolean;
3225
- id: string;
3226
- createdAt: Date;
3227
- updatedAt: Date;
3228
- slug?: string | null | undefined;
3229
- name?: string | null | undefined;
3230
- } | {
3231
- playgroundId: string;
3232
- datasetId: string | null;
3233
- datasetVersionId: string | null;
3234
- status: "pending" | "running" | "completed" | "failed" | "cancelled";
3235
- startedAt: Date | null;
3236
- completedAt: Date | null;
3237
- totalRecords: number;
3238
- completedRecords: number;
3239
- id: string;
3240
- createdAt: Date;
3241
- updatedAt: Date;
3242
- } | {
3243
- runId: string;
3244
- columnId: string;
3245
- datasetRecordId: string | null;
3246
- inputVariables: Record<string, unknown>;
3247
- outputContent: string | null;
3248
- status: "pending" | "running" | "completed" | "failed";
3249
- error: string | null;
3250
- latencyMs: number | null;
3251
- promptTokens: number | null;
3252
- completionTokens: number | null;
3253
- totalTokens: number | null;
3254
- cost: number | null;
3255
- id: string;
3256
- createdAt: Date;
3257
- updatedAt: Date;
3258
- } | {
3259
- datasetId: string;
3260
- versionNumber: number;
3261
- recordCount: number;
3262
- snapshotHash: string;
3263
- id: string;
3264
- createdAt: Date;
3265
- updatedAt: Date;
3266
- name?: string | null | undefined;
3267
- description?: string | null | undefined;
3268
- } | {
3269
- datasetId: string;
3270
- input: Record<string, unknown>;
3271
- metadata: Record<string, unknown>;
3272
- id: string;
3273
- createdAt: Date;
3274
- updatedAt: Date;
3275
- expected?: Record<string, unknown> | null | undefined;
3276
- } | {
3277
- datasetVersionId: string;
3278
- datasetRecordId: string;
3279
- position: number;
3280
- id: string;
3281
- createdAt: Date;
3282
- updatedAt: Date;
3283
- } | {
3284
- providerConfigId: string;
3285
- guardrailConfigId: string;
3286
- enabled: boolean;
3287
- id: string;
3288
- createdAt: Date;
3289
- updatedAt: Date;
3290
- parameters?: Record<string, unknown> | null | undefined;
3291
- } | {
3292
- requestId: string;
3293
- provider: string;
3294
- model: string;
3295
- promptTokens: number;
3296
- completionTokens: number;
3297
- totalTokens: number;
3298
- cachedTokens: number;
3299
- cacheCreationTokens: number;
3300
- cost: number;
3301
- cacheSavings: number;
3302
- inputCost: number;
3303
- outputCost: number;
3304
- endpoint: string;
3305
- statusCode: number;
3306
- latencyMs: number;
3307
- isStreaming: boolean;
3308
- tags: Record<string, string>;
3309
- id: string;
3310
- createdAt: Date;
3311
- updatedAt: Date;
3312
- configId?: string | null | undefined;
3313
- variantId?: string | null | undefined;
3314
- environmentId?: string | null | undefined;
3315
- providerConfigId?: string | null | undefined;
3316
- userId?: string | null | undefined;
3317
- guardrailResults?: {
3318
- results: {
3319
- checkId: string;
3320
- functionId: string;
3321
- hookType: "beforeRequestHook" | "afterRequestHook";
3322
- verdict: boolean;
3323
- latencyMs: number;
3324
- }[];
3325
- action: "allowed" | "blocked" | "logged";
3326
- totalLatencyMs: number;
3327
- } | null | undefined;
3328
- traceId?: string | null | undefined;
3329
- spanId?: string | null | undefined;
3330
- parentSpanId?: string | null | undefined;
3331
- sessionId?: string | null | undefined;
3332
- } | {
3333
- traceId: string;
3334
- status: string;
3335
- startTime: Date;
3336
- spanCount: number;
3337
- totalInputTokens: number;
3338
- totalOutputTokens: number;
3339
- totalTokens: number;
3340
- totalCost: number;
3341
- tags: Record<string, string>;
3342
- metadata: Record<string, unknown>;
3343
- id: string;
3344
- createdAt: Date;
3345
- updatedAt: Date;
3346
- name?: string | null | undefined;
3347
- sessionId?: string | null | undefined;
3348
- userId?: string | null | undefined;
3349
- endTime?: Date | null | undefined;
3350
- durationMs?: number | null | undefined;
3351
- } | {
3352
- id: string;
3353
- traceId: string;
3354
- spanId: string;
3355
- name: string;
3356
- timestamp: Date;
3357
- attributes: Record<string, unknown>;
3358
- createdAt: Date;
3359
- };
3360
- /**
3361
- * Parse partial data, throws on error
3362
- */
3363
- declare function parsePartialTableData<T extends TableName>(table: T, data: unknown): {
3364
- name?: string | undefined;
3365
- id?: string | undefined;
3366
- createdAt?: Date | undefined;
3367
- updatedAt?: Date | undefined;
3368
- } | {
3369
- variantId?: string | undefined;
3370
- version?: number | undefined;
3371
- provider?: string | undefined;
3372
- modelName?: string | undefined;
3373
- jsonData?: Record<string, unknown> | undefined;
3374
- id?: string | undefined;
3375
- createdAt?: Date | undefined;
3376
- updatedAt?: Date | undefined;
3377
- } | {
3378
- environmentId?: string | undefined;
3379
- keyName?: string | undefined;
3380
- keyValue?: string | undefined;
3381
- id?: string | undefined;
3382
- createdAt?: Date | undefined;
3383
- updatedAt?: Date | undefined;
3384
- } | {
3385
- configId?: string | undefined;
3386
- variantId?: string | undefined;
3387
- id?: string | undefined;
3388
- createdAt?: Date | undefined;
3389
- updatedAt?: Date | undefined;
3390
- } | {
3391
- environmentId?: string | undefined;
3392
- configId?: string | undefined;
3393
- configVariantId?: string | undefined;
3394
- variantVersionId?: string | null | undefined;
3395
- weight?: number | undefined;
3396
- priority?: number | undefined;
3397
- enabled?: boolean | undefined;
3398
- conditions?: Record<string, unknown> | undefined;
3399
- id?: string | undefined;
3400
- createdAt?: Date | undefined;
3401
- updatedAt?: Date | undefined;
3402
- } | {
3403
- name?: string | null | undefined;
3404
- setupComplete?: boolean | undefined;
3405
- superAdminId?: string | null | undefined;
3406
- id?: string | undefined;
3407
- createdAt?: Date | undefined;
3408
- updatedAt?: Date | undefined;
3409
- } | {
3410
- providerId?: string | undefined;
3411
- slug?: string | null | undefined;
3412
- name?: string | null | undefined;
3413
- config?: Record<string, unknown> | undefined;
3414
- enabled?: boolean | undefined;
3415
- id?: string | undefined;
3416
- createdAt?: Date | undefined;
3417
- updatedAt?: Date | undefined;
3418
- } | {
3419
- playgroundId?: string | undefined;
3420
- datasetId?: string | null | undefined;
3421
- datasetVersionId?: string | null | undefined;
3422
- status?: "pending" | "running" | "completed" | "failed" | "cancelled" | undefined;
3423
- startedAt?: Date | null | undefined;
3424
- completedAt?: Date | null | undefined;
3425
- totalRecords?: number | undefined;
3426
- completedRecords?: number | undefined;
3427
- id?: string | undefined;
3428
- createdAt?: Date | undefined;
3429
- updatedAt?: Date | undefined;
3430
- } | {
3431
- runId?: string | undefined;
3432
- columnId?: string | undefined;
3433
- datasetRecordId?: string | null | undefined;
3434
- inputVariables?: Record<string, unknown> | undefined;
3435
- outputContent?: string | null | undefined;
3436
- status?: "pending" | "running" | "completed" | "failed" | undefined;
3437
- error?: string | null | undefined;
3438
- latencyMs?: number | null | undefined;
3439
- promptTokens?: number | null | undefined;
3440
- completionTokens?: number | null | undefined;
3441
- totalTokens?: number | null | undefined;
3442
- cost?: number | null | undefined;
3443
- id?: string | undefined;
3444
- createdAt?: Date | undefined;
3445
- updatedAt?: Date | undefined;
3446
- } | {
3447
- datasetId?: string | undefined;
3448
- versionNumber?: number | undefined;
3449
- name?: string | null | undefined;
3450
- description?: string | null | undefined;
3451
- recordCount?: number | undefined;
3452
- snapshotHash?: string | undefined;
3453
- id?: string | undefined;
3454
- createdAt?: Date | undefined;
3455
- updatedAt?: Date | undefined;
3456
- } | {
3457
- datasetId?: string | undefined;
3458
- input?: Record<string, unknown> | undefined;
3459
- expected?: Record<string, unknown> | null | undefined;
3460
- metadata?: Record<string, unknown> | undefined;
3461
- id?: string | undefined;
3462
- createdAt?: Date | undefined;
3463
- updatedAt?: Date | undefined;
3464
- } | {
3465
- datasetVersionId?: string | undefined;
3466
- datasetRecordId?: string | undefined;
3467
- position?: number | undefined;
3468
- id?: string | undefined;
3469
- createdAt?: Date | undefined;
3470
- updatedAt?: Date | undefined;
3471
- } | {
3472
- providerConfigId?: string | undefined;
3473
- guardrailConfigId?: string | undefined;
3474
- enabled?: boolean | undefined;
3475
- parameters?: Record<string, unknown> | null | undefined;
3476
- id?: string | undefined;
3477
- createdAt?: Date | undefined;
3478
- updatedAt?: Date | undefined;
3479
- } | {
3480
- requestId?: string | undefined;
3481
- configId?: string | null | undefined;
3482
- variantId?: string | null | undefined;
3483
- environmentId?: string | null | undefined;
3484
- providerConfigId?: string | null | undefined;
3485
- provider?: string | undefined;
3486
- model?: string | undefined;
3487
- promptTokens?: number | undefined;
3488
- completionTokens?: number | undefined;
3489
- totalTokens?: number | undefined;
3490
- cachedTokens?: number | undefined;
3491
- cacheCreationTokens?: number | undefined;
3492
- cost?: number | undefined;
3493
- cacheSavings?: number | undefined;
3494
- inputCost?: number | undefined;
3495
- outputCost?: number | undefined;
3496
- endpoint?: string | undefined;
3497
- statusCode?: number | undefined;
3498
- latencyMs?: number | undefined;
3499
- isStreaming?: boolean | undefined;
3500
- userId?: string | null | undefined;
3501
- tags?: Record<string, string> | undefined;
3502
- guardrailResults?: {
3503
- results: {
3504
- checkId: string;
3505
- functionId: string;
3506
- hookType: "beforeRequestHook" | "afterRequestHook";
3507
- verdict: boolean;
3508
- latencyMs: number;
3509
- }[];
3510
- action: "allowed" | "blocked" | "logged";
3511
- totalLatencyMs: number;
3512
- } | null | undefined;
3513
- traceId?: string | null | undefined;
3514
- spanId?: string | null | undefined;
3515
- parentSpanId?: string | null | undefined;
3516
- sessionId?: string | null | undefined;
3517
- id?: string | undefined;
3518
- createdAt?: Date | undefined;
3519
- updatedAt?: Date | undefined;
3520
- } | {
3521
- traceId?: string | undefined;
3522
- name?: string | null | undefined;
3523
- sessionId?: string | null | undefined;
3524
- userId?: string | null | undefined;
3525
- status?: string | undefined;
3526
- startTime?: Date | undefined;
3527
- endTime?: Date | null | undefined;
3528
- durationMs?: number | null | undefined;
3529
- spanCount?: number | undefined;
3530
- totalInputTokens?: number | undefined;
3531
- totalOutputTokens?: number | undefined;
3532
- totalTokens?: number | undefined;
3533
- totalCost?: number | undefined;
3534
- tags?: Record<string, string> | undefined;
3535
- metadata?: Record<string, unknown> | undefined;
3536
- id?: string | undefined;
3537
- createdAt?: Date | undefined;
3538
- updatedAt?: Date | undefined;
3539
- } | {
3540
- id?: string | undefined;
3541
- traceId?: string | undefined;
3542
- spanId?: string | undefined;
3543
- name?: string | undefined;
3544
- timestamp?: Date | undefined;
3545
- attributes?: Record<string, unknown> | undefined;
3546
- createdAt?: Date | undefined;
3547
- };
3548
- //#endregion
3549
- //#region src/db/migrations.d.ts
3550
- /**
3551
- * Options for migration operations
3552
- */
3553
- interface MigrationOptions {
3554
- /**
3555
- * PostgreSQL schema name to use.
3556
- * If provided, the schema will be created if it doesn't exist.
3557
- */
3558
- schema?: string;
3559
- rawConnection?: unknown;
3560
- }
3561
- declare function matchType(columnDataType: string, fieldType: string, dbType: DatabaseType): boolean;
3562
- interface MigrationResult {
3563
- toBeCreated: Array<{
3564
- table: string;
3565
- fields: Record<string, any>;
3566
- order: number;
3567
- }>;
3568
- toBeAdded: Array<{
3569
- table: string;
3570
- fields: Record<string, any>;
3571
- order: number;
3572
- }>;
3573
- runMigrations: () => Promise<void>;
3574
- compileMigrations: () => Promise<string>;
3575
- migrations: any[];
3576
- needsMigration: boolean;
3577
- }
3578
- declare function getMigrations(db: Kysely<Database>, dbType: DatabaseType, options?: MigrationOptions): Promise<MigrationResult>;
3579
- /**
3580
- * Run migrations if needed
3581
- * @param db - Kysely database instance
3582
- * @param dbType - Database type
3583
- * @param options - Migration options (schema, etc.)
3584
- * @returns true if migrations were run, false otherwise
3585
- */
3586
- declare function runAutoMigrations(db: Kysely<Database>, dbType: DatabaseType, options?: MigrationOptions): Promise<{
3587
- ran: boolean;
3588
- tables: string[];
3589
- fields: string[];
3590
- }>;
3591
- //#endregion
3592
- //#region src/db/neon-dialect.d.ts
3593
- /**
3594
- * Create a Neon serverless dialect for Kysely
3595
- *
3596
- * @param neonInstance - Neon database query function
3597
- * @returns Kysely dialect configured for Neon serverless
3598
- */
3599
- declare function createNeonDialect(neonInstance: NeonQueryFunction<false, false>): any;
3600
- /**
3601
- * Execute a query with search_path set for Neon serverless
3602
- *
3603
- * @param neonInstance - Neon database query function
3604
- * @param query - SQL query to execute
3605
- * @param schema - Schema to set (optional)
3606
- * @returns Query result
3607
- */
3608
- declare function executeWithSchema(neonInstance: NeonQueryFunction<false, false>, query: string, schema?: string): Promise<any>;
3609
- //#endregion
3610
- //#region src/db/index.d.ts
3611
- /**
3612
- * Supported database types
3613
- */
3614
- type DatabaseType = 'postgres' | 'mysql' | 'sqlite' | 'mssql' | 'neon';
3615
- /**
3616
- * Options for creating a database connection
3617
- */
3618
- interface DatabaseOptions {
3619
- /**
3620
- * PostgreSQL schema name (sets search_path).
3621
- * Defaults to 'llmops'.
3622
- */
3623
- schema?: string;
3624
- }
3625
- /**
3626
- * Database connection options
3627
- */
3628
- type DatabaseConnection = {
3629
- type: 'postgres';
3630
- dialect: PostgresDialect;
3631
- } | {
3632
- type: 'mysql';
3633
- dialect: MysqlDialect;
3634
- } | {
3635
- type: 'sqlite';
3636
- dialect: SqliteDialect;
3637
- } | {
3638
- type: 'mssql';
3639
- dialect: MssqlDialect;
3640
- } | {
3641
- type: 'neon';
3642
- dialect: Dialect;
3643
- } | {
3644
- type: DatabaseType;
3645
- kysely: Kysely<Database>;
3646
- };
3647
- /**
3648
- * Create a Kysely database instance with type safety
3649
- */
3650
- declare function createDatabase(connection: DatabaseConnection): Kysely<Database>;
3651
- /**
3652
- * Auto-detect database type from connection object or string
3653
- */
3654
- declare function detectDatabaseType(db: unknown): DatabaseType | null;
3655
- /**
3656
- * Create database from raw connection
3657
- *
3658
- * @param rawConnection - The raw database connection (pg Pool, sqlite Database, etc.)
3659
- * @param options - Optional configuration (schema for PostgreSQL)
3660
- */
3661
- declare function createDatabaseFromConnection(rawConnection: any, options?: DatabaseOptions): Promise<Kysely<Database> | null>;
3662
- //#endregion
3663
- export { SCHEMA_METADATA as $, DatasetsTable as A, playgroundsSchema as At, LLMRequest as B, workspaceSettingsSchema as Bt, Dataset as C, environmentSecretsSchema as Ct, DatasetVersionRecord as D, playgroundColumnSchema as Dt, DatasetVersion as E, llmRequestsSchema as Et, GuardrailConfig as F, spansSchema as Ft, PlaygroundResultsTable as G, Playground as H, GuardrailConfigsTable as I, targetingRulesSchema as It, PlaygroundsTable as J, PlaygroundRun as K, GuardrailResult as L, tracesSchema as Lt, EnvironmentSecret as M, providerGuardrailOverridesSchema as Mt, EnvironmentSecretsTable as N, schemas as Nt, DatasetVersionRecordsTable as O, playgroundResultsSchema as Ot, EnvironmentsTable as P, spanEventsSchema as Pt, ProviderGuardrailOverridesTable as Q, GuardrailResults as R, variantVersionsSchema as Rt, Database as S, datasetsSchema as St, DatasetRecordsTable as T, guardrailConfigsSchema as Tt, PlaygroundColumn as U, LLMRequestsTable as V, PlaygroundResult as W, ProviderConfigsTable as X, ProviderConfig as Y, ProviderGuardrailOverride as Z, validateTableData as _, configVariantsSchema as _t, createDatabaseFromConnection as a, TableName as at, ConfigVariantsTable as b, datasetVersionRecordsSchema as bt, executeWithSchema as c, Trace as ct, getMigrations as d, Variant as dt, Selectable as et, matchType as f, VariantVersion as ft, validatePartialTableData as g, WorkspaceSettingsTable as gt, parseTableData as h, WorkspaceSettings as ht, createDatabase as i, SpansTable as it, Environment as j, providerConfigsSchema as jt, DatasetVersionsTable as k, playgroundRunsSchema as kt, MigrationOptions as l, TracesTable as lt, parsePartialTableData as m, VariantsTable as mt, DatabaseOptions as n, SpanEvent as nt, detectDatabaseType as o, TargetingRule as ot, runAutoMigrations as p, VariantVersionsTable as pt, PlaygroundRunsTable as q, DatabaseType as r, SpanEventsTable as rt, createNeonDialect as s, TargetingRulesTable as st, DatabaseConnection as t, Span as tt, MigrationResult as u, Updateable as ut, Config as v, configsSchema as vt, DatasetRecord as w, environmentsSchema as wt, ConfigsTable as x, datasetVersionsSchema as xt, ConfigVariant as y, datasetRecordsSchema as yt, Insertable as z, variantsSchema as zt };