@llmops/core 0.6.10 → 1.0.0-beta.2

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,4 +1,4 @@
1
- const require_db = require('./db-D8otWwZL.cjs');
1
+ const require_db = require('./db-DZv0NtMm.cjs');
2
2
  let kysely = require("kysely");
3
3
 
4
4
  //#region src/db/bun-sqlite-dialect.ts
package/dist/db/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
- const require_db = require('../db-D8otWwZL.cjs');
2
- const require_neon_dialect = require('../neon-dialect-ccr-mLKR.cjs');
1
+ const require_db = require('../db-DZv0NtMm.cjs');
2
+ const require_neon_dialect = require('../neon-dialect-ByrFa9iy.cjs');
3
3
 
4
4
  exports.SCHEMA_METADATA = require_db.SCHEMA_METADATA;
5
5
  exports.configVariantsSchema = require_db.configVariantsSchema;
@@ -1,2 +1,2 @@
1
- import { $ as SCHEMA_METADATA, A as DatasetsTable, At as playgroundsSchema, B as LLMRequest, Bt as workspaceSettingsSchema, C as Dataset, Ct as environmentSecretsSchema, D as DatasetVersionRecord, Dt as playgroundColumnSchema, E as DatasetVersion, Et as llmRequestsSchema, F as GuardrailConfig, Ft as spansSchema, G as PlaygroundResultsTable, H as Playground, I as GuardrailConfigsTable, It as targetingRulesSchema, J as PlaygroundsTable, K as PlaygroundRun, L as GuardrailResult, Lt as tracesSchema, M as EnvironmentSecret, Mt as providerGuardrailOverridesSchema, N as EnvironmentSecretsTable, Nt as schemas, O as DatasetVersionRecordsTable, Ot as playgroundResultsSchema, P as EnvironmentsTable, Pt as spanEventsSchema, Q as ProviderGuardrailOverridesTable, R as GuardrailResults, Rt as variantVersionsSchema, S as Database, St as datasetsSchema, T as DatasetRecordsTable, Tt as guardrailConfigsSchema, U as PlaygroundColumn, V as LLMRequestsTable, W as PlaygroundResult, X as ProviderConfigsTable, Y as ProviderConfig, Z as ProviderGuardrailOverride, _ as validateTableData, _t as configVariantsSchema, a as createDatabaseFromConnection, at as TableName, b as ConfigVariantsTable, bt as datasetVersionRecordsSchema, c as executeWithSchema, ct as Trace, d as getMigrations, dt as Variant, et as Selectable, f as matchType, ft as VariantVersion, g as validatePartialTableData, gt as WorkspaceSettingsTable, h as parseTableData, ht as WorkspaceSettings, i as createDatabase, it as SpansTable, j as Environment, jt as providerConfigsSchema, k as DatasetVersionsTable, kt as playgroundRunsSchema, l as MigrationOptions, lt as TracesTable, m as parsePartialTableData, mt as VariantsTable, n as DatabaseOptions, nt as SpanEvent, o as detectDatabaseType, ot as TargetingRule, p as runAutoMigrations, pt as VariantVersionsTable, q as PlaygroundRunsTable, r as DatabaseType, rt as SpanEventsTable, s as createNeonDialect, st as TargetingRulesTable, t as DatabaseConnection, tt as Span, u as MigrationResult, ut as Updateable, v as Config, vt as configsSchema, w as DatasetRecord, wt as environmentsSchema, x as ConfigsTable, xt as datasetVersionsSchema, y as ConfigVariant, yt as datasetRecordsSchema, z as Insertable, zt as variantsSchema } from "../index-CyVFWq76.cjs";
1
+ import { $ as SCHEMA_METADATA, A as DatasetsTable, At as playgroundsSchema, B as LLMRequest, Bt as workspaceSettingsSchema, C as Dataset, Ct as environmentSecretsSchema, D as DatasetVersionRecord, Dt as playgroundColumnSchema, E as DatasetVersion, Et as llmRequestsSchema, F as GuardrailConfig, Ft as spansSchema, G as PlaygroundResultsTable, H as Playground, I as GuardrailConfigsTable, It as targetingRulesSchema, J as PlaygroundsTable, K as PlaygroundRun, L as GuardrailResult, Lt as tracesSchema, M as EnvironmentSecret, Mt as providerGuardrailOverridesSchema, N as EnvironmentSecretsTable, Nt as schemas, O as DatasetVersionRecordsTable, Ot as playgroundResultsSchema, P as EnvironmentsTable, Pt as spanEventsSchema, Q as ProviderGuardrailOverridesTable, R as GuardrailResults, Rt as variantVersionsSchema, S as Database, St as datasetsSchema, T as DatasetRecordsTable, Tt as guardrailConfigsSchema, U as PlaygroundColumn, V as LLMRequestsTable, W as PlaygroundResult, X as ProviderConfigsTable, Y as ProviderConfig, Z as ProviderGuardrailOverride, _ as validateTableData, _t as configVariantsSchema, a as createDatabaseFromConnection, at as TableName, b as ConfigVariantsTable, bt as datasetVersionRecordsSchema, c as executeWithSchema, ct as Trace, d as getMigrations, dt as Variant, et as Selectable, f as matchType, ft as VariantVersion, g as validatePartialTableData, gt as WorkspaceSettingsTable, h as parseTableData, ht as WorkspaceSettings, i as createDatabase, it as SpansTable, j as Environment, jt as providerConfigsSchema, k as DatasetVersionsTable, kt as playgroundRunsSchema, l as MigrationOptions, lt as TracesTable, m as parsePartialTableData, mt as VariantsTable, n as DatabaseOptions, nt as SpanEvent, o as detectDatabaseType, ot as TargetingRule, p as runAutoMigrations, pt as VariantVersionsTable, q as PlaygroundRunsTable, r as DatabaseType, rt as SpanEventsTable, s as createNeonDialect, st as TargetingRulesTable, t as DatabaseConnection, tt as Span, u as MigrationResult, ut as Updateable, v as Config, vt as configsSchema, w as DatasetRecord, wt as environmentsSchema, x as ConfigsTable, xt as datasetVersionsSchema, y as ConfigVariant, yt as datasetRecordsSchema, z as Insertable, zt as variantsSchema } from "../index-DjIHdwhi.cjs";
2
2
  export { Config, ConfigVariant, ConfigVariantsTable, ConfigsTable, Database, DatabaseConnection, DatabaseOptions, DatabaseType, Dataset, DatasetRecord, DatasetRecordsTable, DatasetVersion, DatasetVersionRecord, DatasetVersionRecordsTable, DatasetVersionsTable, DatasetsTable, Environment, EnvironmentSecret, EnvironmentSecretsTable, EnvironmentsTable, GuardrailConfig, GuardrailConfigsTable, GuardrailResult, GuardrailResults, Insertable, LLMRequest, LLMRequestsTable, MigrationOptions, MigrationResult, Playground, PlaygroundColumn, PlaygroundResult, PlaygroundResultsTable, PlaygroundRun, PlaygroundRunsTable, PlaygroundsTable, ProviderConfig, ProviderConfigsTable, ProviderGuardrailOverride, ProviderGuardrailOverridesTable, SCHEMA_METADATA, Selectable, Span, SpanEvent, SpanEventsTable, SpansTable, TableName, TargetingRule, TargetingRulesTable, Trace, TracesTable, Updateable, Variant, VariantVersion, VariantVersionsTable, VariantsTable, WorkspaceSettings, WorkspaceSettingsTable, configVariantsSchema, configsSchema, createDatabase, createDatabaseFromConnection, createNeonDialect, datasetRecordsSchema, datasetVersionRecordsSchema, datasetVersionsSchema, datasetsSchema, detectDatabaseType, environmentSecretsSchema, environmentsSchema, executeWithSchema, getMigrations, guardrailConfigsSchema, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, playgroundColumnSchema, playgroundResultsSchema, playgroundRunsSchema, playgroundsSchema, providerConfigsSchema, providerGuardrailOverridesSchema, runAutoMigrations, schemas, spanEventsSchema, spansSchema, targetingRulesSchema, tracesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
@@ -1,2 +1,2 @@
1
- import { $ as SCHEMA_METADATA, A as DatasetsTable, At as playgroundsSchema, B as LLMRequest, Bt as workspaceSettingsSchema, C as Dataset, Ct as environmentSecretsSchema, D as DatasetVersionRecord, Dt as playgroundColumnSchema, E as DatasetVersion, Et as llmRequestsSchema, F as GuardrailConfig, Ft as spansSchema, G as PlaygroundResultsTable, H as Playground, I as GuardrailConfigsTable, It as targetingRulesSchema, J as PlaygroundsTable, K as PlaygroundRun, L as GuardrailResult, Lt as tracesSchema, M as EnvironmentSecret, Mt as providerGuardrailOverridesSchema, N as EnvironmentSecretsTable, Nt as schemas, O as DatasetVersionRecordsTable, Ot as playgroundResultsSchema, P as EnvironmentsTable, Pt as spanEventsSchema, Q as ProviderGuardrailOverridesTable, R as GuardrailResults, Rt as variantVersionsSchema, S as Database, St as datasetsSchema, T as DatasetRecordsTable, Tt as guardrailConfigsSchema, U as PlaygroundColumn, V as LLMRequestsTable, W as PlaygroundResult, X as ProviderConfigsTable, Y as ProviderConfig, Z as ProviderGuardrailOverride, _ as validateTableData, _t as configVariantsSchema, a as createDatabaseFromConnection, at as TableName, b as ConfigVariantsTable, bt as datasetVersionRecordsSchema, c as executeWithSchema, ct as Trace, d as getMigrations, dt as Variant, et as Selectable, f as matchType, ft as VariantVersion, g as validatePartialTableData, gt as WorkspaceSettingsTable, h as parseTableData, ht as WorkspaceSettings, i as createDatabase, it as SpansTable, j as Environment, jt as providerConfigsSchema, k as DatasetVersionsTable, kt as playgroundRunsSchema, l as MigrationOptions, lt as TracesTable, m as parsePartialTableData, mt as VariantsTable, n as DatabaseOptions, nt as SpanEvent, o as detectDatabaseType, ot as TargetingRule, p as runAutoMigrations, pt as VariantVersionsTable, q as PlaygroundRunsTable, r as DatabaseType, rt as SpanEventsTable, s as createNeonDialect, st as TargetingRulesTable, t as DatabaseConnection, tt as Span, u as MigrationResult, ut as Updateable, v as Config, vt as configsSchema, w as DatasetRecord, wt as environmentsSchema, x as ConfigsTable, xt as datasetVersionsSchema, y as ConfigVariant, yt as datasetRecordsSchema, z as Insertable, zt as variantsSchema } from "../index-D3onb7gK.mjs";
1
+ import { $ as SCHEMA_METADATA, A as DatasetsTable, At as playgroundsSchema, B as LLMRequest, Bt as workspaceSettingsSchema, C as Dataset, Ct as environmentSecretsSchema, D as DatasetVersionRecord, Dt as playgroundColumnSchema, E as DatasetVersion, Et as llmRequestsSchema, F as GuardrailConfig, Ft as spansSchema, G as PlaygroundResultsTable, H as Playground, I as GuardrailConfigsTable, It as targetingRulesSchema, J as PlaygroundsTable, K as PlaygroundRun, L as GuardrailResult, Lt as tracesSchema, M as EnvironmentSecret, Mt as providerGuardrailOverridesSchema, N as EnvironmentSecretsTable, Nt as schemas, O as DatasetVersionRecordsTable, Ot as playgroundResultsSchema, P as EnvironmentsTable, Pt as spanEventsSchema, Q as ProviderGuardrailOverridesTable, R as GuardrailResults, Rt as variantVersionsSchema, S as Database, St as datasetsSchema, T as DatasetRecordsTable, Tt as guardrailConfigsSchema, U as PlaygroundColumn, V as LLMRequestsTable, W as PlaygroundResult, X as ProviderConfigsTable, Y as ProviderConfig, Z as ProviderGuardrailOverride, _ as validateTableData, _t as configVariantsSchema, a as createDatabaseFromConnection, at as TableName, b as ConfigVariantsTable, bt as datasetVersionRecordsSchema, c as executeWithSchema, ct as Trace, d as getMigrations, dt as Variant, et as Selectable, f as matchType, ft as VariantVersion, g as validatePartialTableData, gt as WorkspaceSettingsTable, h as parseTableData, ht as WorkspaceSettings, i as createDatabase, it as SpansTable, j as Environment, jt as providerConfigsSchema, k as DatasetVersionsTable, kt as playgroundRunsSchema, l as MigrationOptions, lt as TracesTable, m as parsePartialTableData, mt as VariantsTable, n as DatabaseOptions, nt as SpanEvent, o as detectDatabaseType, ot as TargetingRule, p as runAutoMigrations, pt as VariantVersionsTable, q as PlaygroundRunsTable, r as DatabaseType, rt as SpanEventsTable, s as createNeonDialect, st as TargetingRulesTable, t as DatabaseConnection, tt as Span, u as MigrationResult, ut as Updateable, v as Config, vt as configsSchema, w as DatasetRecord, wt as environmentsSchema, x as ConfigsTable, xt as datasetVersionsSchema, y as ConfigVariant, yt as datasetRecordsSchema, z as Insertable, zt as variantsSchema } from "../index-BlFAMkmT.mjs";
2
2
  export { Config, ConfigVariant, ConfigVariantsTable, ConfigsTable, Database, DatabaseConnection, DatabaseOptions, DatabaseType, Dataset, DatasetRecord, DatasetRecordsTable, DatasetVersion, DatasetVersionRecord, DatasetVersionRecordsTable, DatasetVersionsTable, DatasetsTable, Environment, EnvironmentSecret, EnvironmentSecretsTable, EnvironmentsTable, GuardrailConfig, GuardrailConfigsTable, GuardrailResult, GuardrailResults, Insertable, LLMRequest, LLMRequestsTable, MigrationOptions, MigrationResult, Playground, PlaygroundColumn, PlaygroundResult, PlaygroundResultsTable, PlaygroundRun, PlaygroundRunsTable, PlaygroundsTable, ProviderConfig, ProviderConfigsTable, ProviderGuardrailOverride, ProviderGuardrailOverridesTable, SCHEMA_METADATA, Selectable, Span, SpanEvent, SpanEventsTable, SpansTable, TableName, TargetingRule, TargetingRulesTable, Trace, TracesTable, Updateable, Variant, VariantVersion, VariantVersionsTable, VariantsTable, WorkspaceSettings, WorkspaceSettingsTable, configVariantsSchema, configsSchema, createDatabase, createDatabaseFromConnection, createNeonDialect, datasetRecordsSchema, datasetVersionRecordsSchema, datasetVersionsSchema, datasetsSchema, detectDatabaseType, environmentSecretsSchema, environmentsSchema, executeWithSchema, getMigrations, guardrailConfigsSchema, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, playgroundColumnSchema, playgroundResultsSchema, playgroundRunsSchema, playgroundsSchema, providerConfigsSchema, providerGuardrailOverridesSchema, runAutoMigrations, schemas, spanEventsSchema, spansSchema, targetingRulesSchema, tracesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
package/dist/db/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as schemas, C as llmRequestsSchema, D as playgroundsSchema, E as playgroundRunsSchema, F as variantVersionsSchema, I as variantsSchema, L as workspaceSettingsSchema, M as spansSchema, N as targetingRulesSchema, O as providerConfigsSchema, P as tracesSchema, S as guardrailConfigsSchema, T as playgroundResultsSchema, _ as datasetVersionRecordsSchema, a as matchType, b as environmentSecretsSchema, d as validatePartialTableData, f as validateTableData, g as datasetRecordsSchema, h as configsSchema, i as getMigrations, j as spanEventsSchema, k as providerGuardrailOverridesSchema, l as parsePartialTableData, m as configVariantsSchema, n as createDatabaseFromConnection, o as runAutoMigrations, p as SCHEMA_METADATA, r as detectDatabaseType, t as createDatabase, u as parseTableData, v as datasetVersionsSchema, w as playgroundColumnSchema, x as environmentsSchema, y as datasetsSchema } from "../db-CdAtHHw5.mjs";
1
+ import { A as spanEventsSchema, C as playgroundColumnSchema, D as providerConfigsSchema, E as playgroundsSchema, F as variantsSchema, I as workspaceSettingsSchema, M as targetingRulesSchema, N as tracesSchema, O as providerGuardrailOverridesSchema, P as variantVersionsSchema, S as llmRequestsSchema, T as playgroundRunsSchema, _ as datasetVersionsSchema, a as matchType, b as environmentsSchema, c as parsePartialTableData, d as validateTableData, f as SCHEMA_METADATA, g as datasetVersionRecordsSchema, h as datasetRecordsSchema, i as getMigrations, j as spansSchema, k as schemas, l as parseTableData, m as configsSchema, n as createDatabaseFromConnection, o as runAutoMigrations, p as configVariantsSchema, r as detectDatabaseType, t as createDatabase, u as validatePartialTableData, v as datasetsSchema, w as playgroundResultsSchema, x as guardrailConfigsSchema, y as environmentSecretsSchema } from "../db-CZ8KtpL-.mjs";
2
2
  import { n as executeWithSchema, t as createNeonDialect } from "../neon-dialect-DySGBYUi.mjs";
3
3
 
4
4
  export { SCHEMA_METADATA, configVariantsSchema, configsSchema, createDatabase, createDatabaseFromConnection, createNeonDialect, datasetRecordsSchema, datasetVersionRecordsSchema, datasetVersionsSchema, datasetsSchema, detectDatabaseType, environmentSecretsSchema, environmentsSchema, executeWithSchema, getMigrations, guardrailConfigsSchema, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, playgroundColumnSchema, playgroundResultsSchema, playgroundRunsSchema, playgroundsSchema, providerConfigsSchema, providerGuardrailOverridesSchema, runAutoMigrations, schemas, spanEventsSchema, spansSchema, targetingRulesSchema, tracesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
@@ -1,3 +1,4 @@
1
+ import { createRequire } from "node:module";
1
2
  import { CompiledQuery, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect, sql } from "kysely";
2
3
  import pino from "pino";
3
4
 
@@ -16,6 +17,7 @@ var __export = (all, symbols) => {
16
17
  }
17
18
  return target;
18
19
  };
20
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
19
21
 
20
22
  //#endregion
21
23
  //#region ../../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/core.js
@@ -12945,7 +12947,8 @@ const playgroundColumnSchema = object({
12945
12947
  id: string$1().uuid(),
12946
12948
  name: string$1(),
12947
12949
  position: number$1().int().min(0),
12948
- providerConfigId: union([string$1().uuid(), _null()]),
12950
+ providerConfigId: union([string$1().uuid(), _null()]).optional(),
12951
+ providerSlug: string$1().nullable().optional(),
12949
12952
  modelName: string$1(),
12950
12953
  messages: array(object({
12951
12954
  role: _enum([
@@ -12959,10 +12962,7 @@ const playgroundColumnSchema = object({
12959
12962
  maxTokens: number$1().int().nullable().optional(),
12960
12963
  topP: number$1().nullable().optional(),
12961
12964
  frequencyPenalty: number$1().nullable().optional(),
12962
- presencePenalty: number$1().nullable().optional(),
12963
- configId: string$1().uuid().nullable().optional(),
12964
- variantId: string$1().uuid().nullable().optional(),
12965
- variantVersionId: string$1().uuid().nullable().optional()
12965
+ presencePenalty: number$1().nullable().optional()
12966
12966
  });
12967
12967
  const playgroundsSchema = object({
12968
12968
  ...baseSchema,
@@ -13160,237 +13160,6 @@ const spanEventsSchema = object({
13160
13160
  * Derived from Zod schemas
13161
13161
  */
13162
13162
  const SCHEMA_METADATA = { tables: {
13163
- configs: {
13164
- order: 1,
13165
- schema: configsSchema,
13166
- fields: {
13167
- id: {
13168
- type: "uuid",
13169
- primaryKey: true
13170
- },
13171
- slug: {
13172
- type: "text",
13173
- unique: true
13174
- },
13175
- name: {
13176
- type: "text",
13177
- nullable: true
13178
- },
13179
- createdAt: {
13180
- type: "timestamp",
13181
- default: "now()"
13182
- },
13183
- updatedAt: {
13184
- type: "timestamp",
13185
- default: "now()",
13186
- onUpdate: "now()"
13187
- }
13188
- }
13189
- },
13190
- variants: {
13191
- order: 2,
13192
- schema: variantsSchema,
13193
- fields: {
13194
- id: {
13195
- type: "uuid",
13196
- primaryKey: true
13197
- },
13198
- name: { type: "text" },
13199
- createdAt: {
13200
- type: "timestamp",
13201
- default: "now()"
13202
- },
13203
- updatedAt: {
13204
- type: "timestamp",
13205
- default: "now()",
13206
- onUpdate: "now()"
13207
- }
13208
- }
13209
- },
13210
- variant_versions: {
13211
- order: 3,
13212
- schema: variantVersionsSchema,
13213
- fields: {
13214
- id: {
13215
- type: "uuid",
13216
- primaryKey: true
13217
- },
13218
- variantId: {
13219
- type: "uuid",
13220
- references: {
13221
- table: "variants",
13222
- column: "id"
13223
- }
13224
- },
13225
- version: { type: "integer" },
13226
- provider: { type: "text" },
13227
- modelName: { type: "text" },
13228
- jsonData: { type: "jsonb" },
13229
- createdAt: {
13230
- type: "timestamp",
13231
- default: "now()"
13232
- },
13233
- updatedAt: {
13234
- type: "timestamp",
13235
- default: "now()",
13236
- onUpdate: "now()"
13237
- }
13238
- },
13239
- uniqueConstraints: [{ columns: ["variantId", "version"] }]
13240
- },
13241
- environments: {
13242
- order: 4,
13243
- schema: environmentsSchema,
13244
- fields: {
13245
- id: {
13246
- type: "uuid",
13247
- primaryKey: true
13248
- },
13249
- name: { type: "text" },
13250
- slug: {
13251
- type: "text",
13252
- unique: true
13253
- },
13254
- isProd: {
13255
- type: "boolean",
13256
- default: false
13257
- },
13258
- createdAt: {
13259
- type: "timestamp",
13260
- default: "now()"
13261
- },
13262
- updatedAt: {
13263
- type: "timestamp",
13264
- default: "now()",
13265
- onUpdate: "now()"
13266
- }
13267
- }
13268
- },
13269
- environment_secrets: {
13270
- order: 5,
13271
- schema: environmentSecretsSchema,
13272
- fields: {
13273
- id: {
13274
- type: "uuid",
13275
- primaryKey: true
13276
- },
13277
- environmentId: {
13278
- type: "uuid",
13279
- references: {
13280
- table: "environments",
13281
- column: "id"
13282
- }
13283
- },
13284
- keyName: { type: "text" },
13285
- keyValue: { type: "text" },
13286
- createdAt: {
13287
- type: "timestamp",
13288
- default: "now()"
13289
- },
13290
- updatedAt: {
13291
- type: "timestamp",
13292
- default: "now()",
13293
- onUpdate: "now()"
13294
- }
13295
- }
13296
- },
13297
- config_variants: {
13298
- order: 6,
13299
- schema: configVariantsSchema,
13300
- fields: {
13301
- id: {
13302
- type: "uuid",
13303
- primaryKey: true
13304
- },
13305
- configId: {
13306
- type: "uuid",
13307
- references: {
13308
- table: "configs",
13309
- column: "id"
13310
- }
13311
- },
13312
- variantId: {
13313
- type: "uuid",
13314
- references: {
13315
- table: "variants",
13316
- column: "id"
13317
- }
13318
- },
13319
- createdAt: {
13320
- type: "timestamp",
13321
- default: "now()"
13322
- },
13323
- updatedAt: {
13324
- type: "timestamp",
13325
- default: "now()",
13326
- onUpdate: "now()"
13327
- }
13328
- }
13329
- },
13330
- targeting_rules: {
13331
- order: 7,
13332
- schema: targetingRulesSchema,
13333
- fields: {
13334
- id: {
13335
- type: "uuid",
13336
- primaryKey: true
13337
- },
13338
- environmentId: {
13339
- type: "uuid",
13340
- references: {
13341
- table: "environments",
13342
- column: "id"
13343
- }
13344
- },
13345
- configId: {
13346
- type: "uuid",
13347
- references: {
13348
- table: "configs",
13349
- column: "id"
13350
- }
13351
- },
13352
- configVariantId: {
13353
- type: "uuid",
13354
- references: {
13355
- table: "config_variants",
13356
- column: "id"
13357
- }
13358
- },
13359
- variantVersionId: {
13360
- type: "uuid",
13361
- nullable: true,
13362
- references: {
13363
- table: "variant_versions",
13364
- column: "id"
13365
- }
13366
- },
13367
- weight: {
13368
- type: "integer",
13369
- default: 1e4
13370
- },
13371
- priority: {
13372
- type: "integer",
13373
- default: 0
13374
- },
13375
- enabled: {
13376
- type: "boolean",
13377
- default: true
13378
- },
13379
- conditions: {
13380
- type: "jsonb",
13381
- default: "{}"
13382
- },
13383
- createdAt: {
13384
- type: "timestamp",
13385
- default: "now()"
13386
- },
13387
- updatedAt: {
13388
- type: "timestamp",
13389
- default: "now()",
13390
- onUpdate: "now()"
13391
- }
13392
- }
13393
- },
13394
13163
  workspace_settings: {
13395
13164
  order: 8,
13396
13165
  schema: workspaceSettingsSchema,
@@ -13422,42 +13191,6 @@ const SCHEMA_METADATA = { tables: {
13422
13191
  }
13423
13192
  }
13424
13193
  },
13425
- provider_configs: {
13426
- order: 9,
13427
- schema: providerConfigsSchema,
13428
- fields: {
13429
- id: {
13430
- type: "uuid",
13431
- primaryKey: true
13432
- },
13433
- providerId: { type: "text" },
13434
- slug: {
13435
- type: "text",
13436
- nullable: true
13437
- },
13438
- name: {
13439
- type: "text",
13440
- nullable: true
13441
- },
13442
- config: {
13443
- type: "jsonb",
13444
- default: "{}"
13445
- },
13446
- enabled: {
13447
- type: "boolean",
13448
- default: true
13449
- },
13450
- createdAt: {
13451
- type: "timestamp",
13452
- default: "now()"
13453
- },
13454
- updatedAt: {
13455
- type: "timestamp",
13456
- default: "now()",
13457
- onUpdate: "now()"
13458
- }
13459
- }
13460
- },
13461
13194
  playgrounds: {
13462
13195
  order: 20,
13463
13196
  schema: playgroundsSchema,
@@ -13617,45 +13350,6 @@ const SCHEMA_METADATA = { tables: {
13617
13350
  }
13618
13351
  }
13619
13352
  },
13620
- guardrail_configs: {
13621
- order: 14,
13622
- schema: guardrailConfigsSchema,
13623
- fields: {
13624
- id: {
13625
- type: "uuid",
13626
- primaryKey: true
13627
- },
13628
- name: { type: "text" },
13629
- pluginId: { type: "text" },
13630
- functionId: { type: "text" },
13631
- hookType: { type: "text" },
13632
- parameters: {
13633
- type: "jsonb",
13634
- default: "{}"
13635
- },
13636
- enabled: {
13637
- type: "boolean",
13638
- default: true
13639
- },
13640
- priority: {
13641
- type: "integer",
13642
- default: 0
13643
- },
13644
- onFail: {
13645
- type: "text",
13646
- default: "block"
13647
- },
13648
- createdAt: {
13649
- type: "timestamp",
13650
- default: "now()"
13651
- },
13652
- updatedAt: {
13653
- type: "timestamp",
13654
- default: "now()",
13655
- onUpdate: "now()"
13656
- }
13657
- }
13658
- },
13659
13353
  datasets: {
13660
13354
  order: 10,
13661
13355
  schema: datasetsSchema,
@@ -13802,48 +13496,6 @@ const SCHEMA_METADATA = { tables: {
13802
13496
  },
13803
13497
  uniqueConstraints: [{ columns: ["datasetVersionId", "datasetRecordId"] }]
13804
13498
  },
13805
- provider_guardrail_overrides: {
13806
- order: 15,
13807
- schema: providerGuardrailOverridesSchema,
13808
- fields: {
13809
- id: {
13810
- type: "uuid",
13811
- primaryKey: true
13812
- },
13813
- providerConfigId: {
13814
- type: "uuid",
13815
- references: {
13816
- table: "provider_configs",
13817
- column: "id"
13818
- }
13819
- },
13820
- guardrailConfigId: {
13821
- type: "uuid",
13822
- references: {
13823
- table: "guardrail_configs",
13824
- column: "id"
13825
- }
13826
- },
13827
- enabled: {
13828
- type: "boolean",
13829
- default: true
13830
- },
13831
- parameters: {
13832
- type: "jsonb",
13833
- nullable: true
13834
- },
13835
- createdAt: {
13836
- type: "timestamp",
13837
- default: "now()"
13838
- },
13839
- updatedAt: {
13840
- type: "timestamp",
13841
- default: "now()",
13842
- onUpdate: "now()"
13843
- }
13844
- },
13845
- uniqueConstraints: [{ columns: ["providerConfigId", "guardrailConfigId"] }]
13846
- },
13847
13499
  llm_requests: {
13848
13500
  order: 17,
13849
13501
  schema: llmRequestsSchema,
@@ -14185,21 +13837,11 @@ const SCHEMA_METADATA = { tables: {
14185
13837
  * Export all Zod schemas for runtime validation
14186
13838
  */
14187
13839
  const schemas = {
14188
- configs: configsSchema,
14189
- variants: variantsSchema,
14190
- variant_versions: variantVersionsSchema,
14191
- environments: environmentsSchema,
14192
- environment_secrets: environmentSecretsSchema,
14193
- config_variants: configVariantsSchema,
14194
- targeting_rules: targetingRulesSchema,
14195
13840
  workspace_settings: workspaceSettingsSchema,
14196
- provider_configs: providerConfigsSchema,
14197
13841
  playgrounds: playgroundsSchema,
14198
13842
  playground_columns: playgroundColumnSchema,
14199
13843
  playground_runs: playgroundRunsSchema,
14200
13844
  playground_results: playgroundResultsSchema,
14201
- guardrail_configs: guardrailConfigsSchema,
14202
- provider_guardrail_overrides: providerGuardrailOverridesSchema,
14203
13845
  datasets: datasetsSchema,
14204
13846
  dataset_versions: datasetVersionsSchema,
14205
13847
  dataset_records: datasetRecordsSchema,
@@ -14242,27 +13884,6 @@ function parsePartialTableData(table, data) {
14242
13884
  //#region src/utils/logger.ts
14243
13885
  const logger = pino({ level: process.env.LOG_LEVEL || "info" });
14244
13886
 
14245
- //#endregion
14246
- //#region src/auth/get-auth-client-options.ts
14247
- /**
14248
- * Get Better Auth client options
14249
- *
14250
- * @param options - Auth client options including database config and hooks
14251
- */
14252
- const getAuthClientOptions = (options) => {
14253
- const { database, onUserCreated, baseURL, trustedOrigins } = options;
14254
- return {
14255
- database,
14256
- baseURL,
14257
- trustedOrigins,
14258
- emailAndPassword: { enabled: true },
14259
- advanced: { cookiePrefix: "llmops" },
14260
- databaseHooks: onUserCreated ? { user: { create: { after: async (user) => {
14261
- await onUserCreated(user.id);
14262
- } } } } : void 0
14263
- };
14264
- };
14265
-
14266
13887
  //#endregion
14267
13888
  //#region src/db/migrations.ts
14268
13889
  const postgresMap = {
@@ -14515,23 +14136,7 @@ async function getMigrations(db, dbType, options) {
14515
14136
  migrations.push(builder);
14516
14137
  }
14517
14138
  }
14518
- if (dbType === "postgres") try {
14519
- await sql`SET search_path TO "${options?.schema ?? "llmops"}"`.execute(db);
14520
- } catch (error$47) {
14521
- logger.warn({ error: error$47 }, "Failed to set search_path for Better Auth migrations");
14522
- }
14523
- let getAuthMigrations;
14524
- try {
14525
- const dbModule = await import("better-auth/db");
14526
- if (typeof dbModule.getMigrations === "function") getAuthMigrations = dbModule.getMigrations;
14527
- if (!getAuthMigrations) {
14528
- const migrationModule = await import("better-auth/db/migration");
14529
- if (typeof migrationModule.getMigrations === "function") getAuthMigrations = migrationModule.getMigrations;
14530
- }
14531
- } catch (error$47) {
14532
- logger.warn({ error: error$47 }, "Failed to import better-auth migrations; skipping auth migrations");
14533
- }
14534
- if (!getAuthMigrations) return {
14139
+ return {
14535
14140
  toBeCreated,
14536
14141
  toBeAdded,
14537
14142
  runMigrations: async () => {
@@ -14543,26 +14148,6 @@ async function getMigrations(db, dbType, options) {
14543
14148
  migrations,
14544
14149
  needsMigration: toBeCreated.length > 0 || toBeAdded.length > 0
14545
14150
  };
14546
- const authOptions = getAuthClientOptions({ database: {
14547
- db,
14548
- type: dbType === "neon" ? "postgres" : dbType
14549
- } });
14550
- const { toBeAdded: authChangesToBeAdded, toBeCreated: authChangesToBeCreated, runMigrations: runAuthMigrations } = await getAuthMigrations(authOptions);
14551
- async function runMigrations() {
14552
- for (const migration of migrations) await migration.execute();
14553
- await runAuthMigrations();
14554
- }
14555
- async function compileMigrations() {
14556
- return migrations.map((m) => m.compile().sql).join(";\n\n") + ";";
14557
- }
14558
- return {
14559
- toBeCreated: [...toBeCreated, ...authChangesToBeCreated],
14560
- toBeAdded: [...toBeAdded, ...authChangesToBeAdded],
14561
- runMigrations,
14562
- compileMigrations,
14563
- migrations,
14564
- needsMigration: toBeCreated.length > 0 || toBeAdded.length > 0 || authChangesToBeCreated.length > 0 || authChangesToBeAdded.length > 0
14565
- };
14566
14151
  }
14567
14152
  /**
14568
14153
  * Fix legacy constraints that may exist from previous schema versions
@@ -14737,4 +14322,4 @@ async function createDatabaseFromConnection(rawConnection, options) {
14737
14322
  }
14738
14323
 
14739
14324
  //#endregion
14740
- export { schemas as A, any as B, llmRequestsSchema as C, playgroundsSchema as D, playgroundRunsSchema as E, variantVersionsSchema as F, object as G, boolean$1 as H, variantsSchema as I, union as J, record as K, workspaceSettingsSchema as L, spansSchema as M, targetingRulesSchema as N, providerConfigsSchema as O, tracesSchema as P, zod_default as R, guardrailConfigsSchema as S, playgroundResultsSchema as T, literal as U, array as V, number$1 as W, unknown as Y, datasetVersionRecordsSchema as _, matchType as a, environmentSecretsSchema as b, logger as c, validatePartialTableData as d, validateTableData as f, datasetRecordsSchema as g, configsSchema as h, getMigrations as i, spanEventsSchema as j, providerGuardrailOverridesSchema as k, parsePartialTableData as l, configVariantsSchema as m, createDatabaseFromConnection as n, runAutoMigrations as o, SCHEMA_METADATA as p, string$1 as q, detectDatabaseType as r, getAuthClientOptions as s, createDatabase as t, parseTableData as u, datasetVersionsSchema as v, playgroundColumnSchema as w, environmentsSchema as x, datasetsSchema as y, _enum as z };
14325
+ export { spanEventsSchema as A, array as B, playgroundColumnSchema as C, providerConfigsSchema as D, playgroundsSchema as E, variantsSchema as F, record as G, literal as H, workspaceSettingsSchema as I, unknown as J, string$1 as K, zod_default as L, targetingRulesSchema as M, tracesSchema as N, providerGuardrailOverridesSchema as O, variantVersionsSchema as P, _enum as R, llmRequestsSchema as S, playgroundRunsSchema as T, number$1 as U, boolean$1 as V, object as W, __require as Y, datasetVersionsSchema as _, matchType as a, environmentsSchema as b, parsePartialTableData as c, validateTableData as d, SCHEMA_METADATA as f, datasetVersionRecordsSchema as g, datasetRecordsSchema as h, getMigrations as i, spansSchema as j, schemas as k, parseTableData as l, configsSchema as m, createDatabaseFromConnection as n, runAutoMigrations as o, configVariantsSchema as p, union as q, detectDatabaseType as r, logger as s, createDatabase as t, validatePartialTableData as u, datasetsSchema as v, playgroundResultsSchema as w, guardrailConfigsSchema as x, environmentSecretsSchema as y, any as z };