@llmops/core 0.2.11-beta.1 → 0.2.11-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-CzLvkATK.cjs');
1
+ const require_db = require('./db-CqDD6Ydv.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,4 +1,4 @@
1
- const require_db = require('../db-CzLvkATK.cjs');
1
+ const require_db = require('../db-CqDD6Ydv.cjs');
2
2
 
3
3
  exports.SCHEMA_METADATA = require_db.SCHEMA_METADATA;
4
4
  exports.configVariantsSchema = require_db.configVariantsSchema;
@@ -1,2 +1,2 @@
1
- import { A as SCHEMA_METADATA, B as WorkspaceSettings, C as EnvironmentSecretsTable, D as LLMRequestsTable, E as LLMRequest, F as Updateable, G as environmentsSchema, H as configVariantsSchema, I as Variant, J as schemas, K as llmRequestsSchema, L as VariantVersion, M as TableName, N as TargetingRule, O as ProviderConfig, P as TargetingRulesTable, Q as workspaceSettingsSchema, R as VariantVersionsTable, S as EnvironmentSecret, T as Insertable, U as configsSchema, V as WorkspaceSettingsTable, W as environmentSecretsSchema, X as variantVersionsSchema, Y as targetingRulesSchema, Z as variantsSchema, _ as ConfigVariant, a as createDatabaseFromConnection, b as Database, c as MigrationResult, d as runAutoMigrations, f as parsePartialTableData, g as Config, h as validateTableData, i as createDatabase, j as Selectable, k as ProviderConfigsTable, l as getMigrations, m as validatePartialTableData, n as DatabaseOptions, o as detectDatabaseType, p as parseTableData, q as providerConfigsSchema, r as DatabaseType, s as MigrationOptions, t as DatabaseConnection, u as matchType, v as ConfigVariantsTable, w as EnvironmentsTable, x as Environment, y as ConfigsTable, z as VariantsTable } from "../index-8czO0OIS.cjs";
1
+ import { A as SCHEMA_METADATA, B as WorkspaceSettings, C as EnvironmentSecretsTable, D as LLMRequestsTable, E as LLMRequest, F as Updateable, G as environmentsSchema, H as configVariantsSchema, I as Variant, J as schemas, K as llmRequestsSchema, L as VariantVersion, M as TableName, N as TargetingRule, O as ProviderConfig, P as TargetingRulesTable, Q as workspaceSettingsSchema, R as VariantVersionsTable, S as EnvironmentSecret, T as Insertable, U as configsSchema, V as WorkspaceSettingsTable, W as environmentSecretsSchema, X as variantVersionsSchema, Y as targetingRulesSchema, Z as variantsSchema, _ as ConfigVariant, a as createDatabaseFromConnection, b as Database, c as MigrationResult, d as runAutoMigrations, f as parsePartialTableData, g as Config, h as validateTableData, i as createDatabase, j as Selectable, k as ProviderConfigsTable, l as getMigrations, m as validatePartialTableData, n as DatabaseOptions, o as detectDatabaseType, p as parseTableData, q as providerConfigsSchema, r as DatabaseType, s as MigrationOptions, t as DatabaseConnection, u as matchType, v as ConfigVariantsTable, w as EnvironmentsTable, x as Environment, y as ConfigsTable, z as VariantsTable } from "../index-BUlmWTh7.cjs";
2
2
  export { Config, ConfigVariant, ConfigVariantsTable, ConfigsTable, Database, DatabaseConnection, DatabaseOptions, DatabaseType, Environment, EnvironmentSecret, EnvironmentSecretsTable, EnvironmentsTable, Insertable, LLMRequest, LLMRequestsTable, MigrationOptions, MigrationResult, ProviderConfig, ProviderConfigsTable, SCHEMA_METADATA, Selectable, TableName, TargetingRule, TargetingRulesTable, Updateable, Variant, VariantVersion, VariantVersionsTable, VariantsTable, WorkspaceSettings, WorkspaceSettingsTable, configVariantsSchema, configsSchema, createDatabase, createDatabaseFromConnection, detectDatabaseType, environmentSecretsSchema, environmentsSchema, getMigrations, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, providerConfigsSchema, runAutoMigrations, schemas, targetingRulesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
@@ -1,2 +1,2 @@
1
- import { A as SCHEMA_METADATA, B as WorkspaceSettings, C as EnvironmentSecretsTable, D as LLMRequestsTable, E as LLMRequest, F as Updateable, G as environmentsSchema, H as configVariantsSchema, I as Variant, J as schemas, K as llmRequestsSchema, L as VariantVersion, M as TableName, N as TargetingRule, O as ProviderConfig, P as TargetingRulesTable, Q as workspaceSettingsSchema, R as VariantVersionsTable, S as EnvironmentSecret, T as Insertable, U as configsSchema, V as WorkspaceSettingsTable, W as environmentSecretsSchema, X as variantVersionsSchema, Y as targetingRulesSchema, Z as variantsSchema, _ as ConfigVariant, a as createDatabaseFromConnection, b as Database, c as MigrationResult, d as runAutoMigrations, f as parsePartialTableData, g as Config, h as validateTableData, i as createDatabase, j as Selectable, k as ProviderConfigsTable, l as getMigrations, m as validatePartialTableData, n as DatabaseOptions, o as detectDatabaseType, p as parseTableData, q as providerConfigsSchema, r as DatabaseType, s as MigrationOptions, t as DatabaseConnection, u as matchType, v as ConfigVariantsTable, w as EnvironmentsTable, x as Environment, y as ConfigsTable, z as VariantsTable } from "../index-BEoqwM0H.mjs";
1
+ import { A as SCHEMA_METADATA, B as WorkspaceSettings, C as EnvironmentSecretsTable, D as LLMRequestsTable, E as LLMRequest, F as Updateable, G as environmentsSchema, H as configVariantsSchema, I as Variant, J as schemas, K as llmRequestsSchema, L as VariantVersion, M as TableName, N as TargetingRule, O as ProviderConfig, P as TargetingRulesTable, Q as workspaceSettingsSchema, R as VariantVersionsTable, S as EnvironmentSecret, T as Insertable, U as configsSchema, V as WorkspaceSettingsTable, W as environmentSecretsSchema, X as variantVersionsSchema, Y as targetingRulesSchema, Z as variantsSchema, _ as ConfigVariant, a as createDatabaseFromConnection, b as Database, c as MigrationResult, d as runAutoMigrations, f as parsePartialTableData, g as Config, h as validateTableData, i as createDatabase, j as Selectable, k as ProviderConfigsTable, l as getMigrations, m as validatePartialTableData, n as DatabaseOptions, o as detectDatabaseType, p as parseTableData, q as providerConfigsSchema, r as DatabaseType, s as MigrationOptions, t as DatabaseConnection, u as matchType, v as ConfigVariantsTable, w as EnvironmentsTable, x as Environment, y as ConfigsTable, z as VariantsTable } from "../index-CVGG0zoD.mjs";
2
2
  export { Config, ConfigVariant, ConfigVariantsTable, ConfigsTable, Database, DatabaseConnection, DatabaseOptions, DatabaseType, Environment, EnvironmentSecret, EnvironmentSecretsTable, EnvironmentsTable, Insertable, LLMRequest, LLMRequestsTable, MigrationOptions, MigrationResult, ProviderConfig, ProviderConfigsTable, SCHEMA_METADATA, Selectable, TableName, TargetingRule, TargetingRulesTable, Updateable, Variant, VariantVersion, VariantVersionsTable, VariantsTable, WorkspaceSettings, WorkspaceSettingsTable, configVariantsSchema, configsSchema, createDatabase, createDatabaseFromConnection, detectDatabaseType, environmentSecretsSchema, environmentsSchema, getMigrations, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, providerConfigsSchema, runAutoMigrations, schemas, targetingRulesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
package/dist/db/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { C as variantsSchema, S as variantVersionsSchema, _ as environmentsSchema, a as matchType, b as schemas, d as validatePartialTableData, f as validateTableData, g as environmentSecretsSchema, h as configsSchema, i as getMigrations, 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 llmRequestsSchema, w as workspaceSettingsSchema, x as targetingRulesSchema, y as providerConfigsSchema } from "../db-DA8xIZ3w.mjs";
1
+ import { C as variantsSchema, S as variantVersionsSchema, _ as environmentsSchema, a as matchType, b as schemas, d as validatePartialTableData, f as validateTableData, g as environmentSecretsSchema, h as configsSchema, i as getMigrations, 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 llmRequestsSchema, w as workspaceSettingsSchema, x as targetingRulesSchema, y as providerConfigsSchema } from "../db-BGDhJROC.mjs";
2
2
 
3
3
  export { SCHEMA_METADATA, configVariantsSchema, configsSchema, createDatabase, createDatabaseFromConnection, detectDatabaseType, environmentSecretsSchema, environmentsSchema, getMigrations, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, providerConfigsSchema, runAutoMigrations, schemas, targetingRulesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
@@ -12947,6 +12947,7 @@ const llmRequestsSchema = object({
12947
12947
  configId: string$1().uuid().nullable().optional(),
12948
12948
  variantId: string$1().uuid().nullable().optional(),
12949
12949
  environmentId: string$1().uuid().nullable().optional(),
12950
+ providerConfigId: string$1().uuid().nullable().optional(),
12950
12951
  provider: string$1(),
12951
12952
  model: string$1(),
12952
12953
  promptTokens: number$1().int().default(0),
@@ -13295,6 +13296,14 @@ const SCHEMA_METADATA = { tables: {
13295
13296
  column: "id"
13296
13297
  }
13297
13298
  },
13299
+ providerConfigId: {
13300
+ type: "uuid",
13301
+ nullable: true,
13302
+ references: {
13303
+ table: "provider_configs",
13304
+ column: "id"
13305
+ }
13306
+ },
13298
13307
  provider: { type: "text" },
13299
13308
  model: { type: "text" },
13300
13309
  promptTokens: {
@@ -12971,6 +12971,7 @@ const llmRequestsSchema = object({
12971
12971
  configId: string$1().uuid().nullable().optional(),
12972
12972
  variantId: string$1().uuid().nullable().optional(),
12973
12973
  environmentId: string$1().uuid().nullable().optional(),
12974
+ providerConfigId: string$1().uuid().nullable().optional(),
12974
12975
  provider: string$1(),
12975
12976
  model: string$1(),
12976
12977
  promptTokens: number$1().int().default(0),
@@ -13319,6 +13320,14 @@ const SCHEMA_METADATA = { tables: {
13319
13320
  column: "id"
13320
13321
  }
13321
13322
  },
13323
+ providerConfigId: {
13324
+ type: "uuid",
13325
+ nullable: true,
13326
+ references: {
13327
+ table: "provider_configs",
13328
+ column: "id"
13329
+ }
13330
+ },
13322
13331
  provider: { type: "text" },
13323
13332
  model: { type: "text" },
13324
13333
  promptTokens: {
@@ -13820,12 +13829,12 @@ async function createDatabaseFromConnection(rawConnection, options) {
13820
13829
  case "sqlite":
13821
13830
  if ("aggregate" in rawConnection && !("createSession" in rawConnection)) dialect = new kysely.SqliteDialect({ database: rawConnection });
13822
13831
  else if ("fileControl" in rawConnection) {
13823
- const { BunSqliteDialect } = await Promise.resolve().then(() => require("./bun-sqlite-dialect-DxPi9X8H.cjs"));
13832
+ const { BunSqliteDialect } = await Promise.resolve().then(() => require("./bun-sqlite-dialect-t1xHHJDz.cjs"));
13824
13833
  dialect = new BunSqliteDialect({ database: rawConnection });
13825
13834
  } else if ("createSession" in rawConnection && typeof window === "undefined") try {
13826
13835
  const { DatabaseSync } = await import("node:sqlite");
13827
13836
  if (rawConnection instanceof DatabaseSync) {
13828
- const { NodeSqliteDialect } = await Promise.resolve().then(() => require("./node-sqlite-dialect-Ckt6QTf5.cjs"));
13837
+ const { NodeSqliteDialect } = await Promise.resolve().then(() => require("./node-sqlite-dialect-D4V5e49r.cjs"));
13829
13838
  dialect = new NodeSqliteDialect({ database: rawConnection });
13830
13839
  }
13831
13840
  } catch {}
@@ -84,6 +84,7 @@ declare const llmRequestsSchema: z.ZodObject<{
84
84
  configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
85
85
  variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
86
86
  environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
87
+ providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
87
88
  provider: z.ZodString;
88
89
  model: z.ZodString;
89
90
  promptTokens: z.ZodDefault<z.ZodNumber>;
@@ -179,6 +180,7 @@ interface LLMRequestsTable extends BaseTable {
179
180
  configId: string | null;
180
181
  variantId: string | null;
181
182
  environmentId: string | null;
183
+ providerConfigId: string | null;
182
184
  provider: string;
183
185
  model: string;
184
186
  promptTokens: ColumnType<number, number | undefined, number | undefined>;
@@ -614,6 +616,7 @@ declare const SCHEMA_METADATA: {
614
616
  configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
615
617
  variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
616
618
  environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
619
+ providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
617
620
  provider: z.ZodString;
618
621
  model: z.ZodString;
619
622
  promptTokens: z.ZodDefault<z.ZodNumber>;
@@ -665,6 +668,14 @@ declare const SCHEMA_METADATA: {
665
668
  readonly column: "id";
666
669
  };
667
670
  };
671
+ readonly providerConfigId: {
672
+ readonly type: "uuid";
673
+ readonly nullable: true;
674
+ readonly references: {
675
+ readonly table: "provider_configs";
676
+ readonly column: "id";
677
+ };
678
+ };
668
679
  readonly provider: {
669
680
  readonly type: "text";
670
681
  };
@@ -819,6 +830,7 @@ declare const schemas: {
819
830
  configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
820
831
  variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
821
832
  environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
833
+ providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
822
834
  provider: z.ZodString;
823
835
  model: z.ZodString;
824
836
  promptTokens: z.ZodDefault<z.ZodNumber>;
@@ -987,6 +999,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
987
999
  configId?: string | null | undefined;
988
1000
  variantId?: string | null | undefined;
989
1001
  environmentId?: string | null | undefined;
1002
+ providerConfigId?: string | null | undefined;
990
1003
  userId?: string | null | undefined;
991
1004
  }> | zod0.ZodSafeParseError<{
992
1005
  requestId: string;
@@ -1010,6 +1023,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
1010
1023
  configId?: string | null | undefined;
1011
1024
  variantId?: string | null | undefined;
1012
1025
  environmentId?: string | null | undefined;
1026
+ providerConfigId?: string | null | undefined;
1013
1027
  userId?: string | null | undefined;
1014
1028
  }>;
1015
1029
  /**
@@ -1128,6 +1142,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
1128
1142
  configId?: string | null | undefined;
1129
1143
  variantId?: string | null | undefined;
1130
1144
  environmentId?: string | null | undefined;
1145
+ providerConfigId?: string | null | undefined;
1131
1146
  provider?: string | undefined;
1132
1147
  model?: string | undefined;
1133
1148
  promptTokens?: number | undefined;
@@ -1151,6 +1166,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
1151
1166
  configId?: string | null | undefined;
1152
1167
  variantId?: string | null | undefined;
1153
1168
  environmentId?: string | null | undefined;
1169
+ providerConfigId?: string | null | undefined;
1154
1170
  provider?: string | undefined;
1155
1171
  model?: string | undefined;
1156
1172
  promptTokens?: number | undefined;
@@ -1255,6 +1271,7 @@ declare function parseTableData<T extends TableName>(table: T, data: unknown): {
1255
1271
  configId?: string | null | undefined;
1256
1272
  variantId?: string | null | undefined;
1257
1273
  environmentId?: string | null | undefined;
1274
+ providerConfigId?: string | null | undefined;
1258
1275
  userId?: string | null | undefined;
1259
1276
  };
1260
1277
  /**
@@ -1319,6 +1336,7 @@ declare function parsePartialTableData<T extends TableName>(table: T, data: unkn
1319
1336
  configId?: string | null | undefined;
1320
1337
  variantId?: string | null | undefined;
1321
1338
  environmentId?: string | null | undefined;
1339
+ providerConfigId?: string | null | undefined;
1322
1340
  provider?: string | undefined;
1323
1341
  model?: string | undefined;
1324
1342
  promptTokens?: number | undefined;
@@ -1,5 +1,5 @@
1
1
  import { ColumnType, Generated, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect } from "kysely";
2
- import * as zod495 from "zod";
2
+ import * as zod0 from "zod";
3
3
  import { z } from "zod";
4
4
 
5
5
  //#region src/db/schema.d.ts
@@ -84,6 +84,7 @@ declare const llmRequestsSchema: z.ZodObject<{
84
84
  configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
85
85
  variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
86
86
  environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
87
+ providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
87
88
  provider: z.ZodString;
88
89
  model: z.ZodString;
89
90
  promptTokens: z.ZodDefault<z.ZodNumber>;
@@ -179,6 +180,7 @@ interface LLMRequestsTable extends BaseTable {
179
180
  configId: string | null;
180
181
  variantId: string | null;
181
182
  environmentId: string | null;
183
+ providerConfigId: string | null;
182
184
  provider: string;
183
185
  model: string;
184
186
  promptTokens: ColumnType<number, number | undefined, number | undefined>;
@@ -614,6 +616,7 @@ declare const SCHEMA_METADATA: {
614
616
  configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
615
617
  variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
616
618
  environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
619
+ providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
617
620
  provider: z.ZodString;
618
621
  model: z.ZodString;
619
622
  promptTokens: z.ZodDefault<z.ZodNumber>;
@@ -665,6 +668,14 @@ declare const SCHEMA_METADATA: {
665
668
  readonly column: "id";
666
669
  };
667
670
  };
671
+ readonly providerConfigId: {
672
+ readonly type: "uuid";
673
+ readonly nullable: true;
674
+ readonly references: {
675
+ readonly table: "provider_configs";
676
+ readonly column: "id";
677
+ };
678
+ };
668
679
  readonly provider: {
669
680
  readonly type: "text";
670
681
  };
@@ -819,6 +830,7 @@ declare const schemas: {
819
830
  configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
820
831
  variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
821
832
  environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
833
+ providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
822
834
  provider: z.ZodString;
823
835
  model: z.ZodString;
824
836
  promptTokens: z.ZodDefault<z.ZodNumber>;
@@ -845,29 +857,29 @@ declare const schemas: {
845
857
  * Validate data against table schema
846
858
  * Useful for runtime validation before inserting/updating
847
859
  */
848
- declare function validateTableData<T extends TableName>(table: T, data: unknown): zod495.ZodSafeParseSuccess<{
860
+ declare function validateTableData<T extends TableName>(table: T, data: unknown): zod0.ZodSafeParseSuccess<{
849
861
  slug: string;
850
862
  id: string;
851
863
  createdAt: Date;
852
864
  updatedAt: Date;
853
865
  name?: string | undefined;
854
- }> | zod495.ZodSafeParseError<{
866
+ }> | zod0.ZodSafeParseError<{
855
867
  slug: string;
856
868
  id: string;
857
869
  createdAt: Date;
858
870
  updatedAt: Date;
859
871
  name?: string | undefined;
860
- }> | zod495.ZodSafeParseSuccess<{
872
+ }> | zod0.ZodSafeParseSuccess<{
861
873
  name: string;
862
874
  id: string;
863
875
  createdAt: Date;
864
876
  updatedAt: Date;
865
- }> | zod495.ZodSafeParseError<{
877
+ }> | zod0.ZodSafeParseError<{
866
878
  name: string;
867
879
  id: string;
868
880
  createdAt: Date;
869
881
  updatedAt: Date;
870
- }> | zod495.ZodSafeParseSuccess<{
882
+ }> | zod0.ZodSafeParseSuccess<{
871
883
  variantId: string;
872
884
  version: number;
873
885
  provider: string;
@@ -876,7 +888,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
876
888
  id: string;
877
889
  createdAt: Date;
878
890
  updatedAt: Date;
879
- }> | zod495.ZodSafeParseError<{
891
+ }> | zod0.ZodSafeParseError<{
880
892
  variantId: string;
881
893
  version: number;
882
894
  provider: string;
@@ -885,33 +897,33 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
885
897
  id: string;
886
898
  createdAt: Date;
887
899
  updatedAt: Date;
888
- }> | zod495.ZodSafeParseSuccess<{
900
+ }> | zod0.ZodSafeParseSuccess<{
889
901
  environmentId: string;
890
902
  keyName: string;
891
903
  keyValue: string;
892
904
  id: string;
893
905
  createdAt: Date;
894
906
  updatedAt: Date;
895
- }> | zod495.ZodSafeParseError<{
907
+ }> | zod0.ZodSafeParseError<{
896
908
  environmentId: string;
897
909
  keyName: string;
898
910
  keyValue: string;
899
911
  id: string;
900
912
  createdAt: Date;
901
913
  updatedAt: Date;
902
- }> | zod495.ZodSafeParseSuccess<{
914
+ }> | zod0.ZodSafeParseSuccess<{
903
915
  configId: string;
904
916
  variantId: string;
905
917
  id: string;
906
918
  createdAt: Date;
907
919
  updatedAt: Date;
908
- }> | zod495.ZodSafeParseError<{
920
+ }> | zod0.ZodSafeParseError<{
909
921
  configId: string;
910
922
  variantId: string;
911
923
  id: string;
912
924
  createdAt: Date;
913
925
  updatedAt: Date;
914
- }> | zod495.ZodSafeParseSuccess<{
926
+ }> | zod0.ZodSafeParseSuccess<{
915
927
  environmentId: string;
916
928
  configId: string;
917
929
  configVariantId: string;
@@ -923,7 +935,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
923
935
  createdAt: Date;
924
936
  updatedAt: Date;
925
937
  variantVersionId?: string | null | undefined;
926
- }> | zod495.ZodSafeParseError<{
938
+ }> | zod0.ZodSafeParseError<{
927
939
  environmentId: string;
928
940
  configId: string;
929
941
  configVariantId: string;
@@ -935,21 +947,21 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
935
947
  createdAt: Date;
936
948
  updatedAt: Date;
937
949
  variantVersionId?: string | null | undefined;
938
- }> | zod495.ZodSafeParseSuccess<{
950
+ }> | zod0.ZodSafeParseSuccess<{
939
951
  setupComplete: boolean;
940
952
  id: string;
941
953
  createdAt: Date;
942
954
  updatedAt: Date;
943
955
  name?: string | null | undefined;
944
956
  superAdminId?: string | null | undefined;
945
- }> | zod495.ZodSafeParseError<{
957
+ }> | zod0.ZodSafeParseError<{
946
958
  setupComplete: boolean;
947
959
  id: string;
948
960
  createdAt: Date;
949
961
  updatedAt: Date;
950
962
  name?: string | null | undefined;
951
963
  superAdminId?: string | null | undefined;
952
- }> | zod495.ZodSafeParseSuccess<{
964
+ }> | zod0.ZodSafeParseSuccess<{
953
965
  providerId: string;
954
966
  config: Record<string, unknown>;
955
967
  enabled: boolean;
@@ -957,7 +969,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
957
969
  createdAt: Date;
958
970
  updatedAt: Date;
959
971
  name?: string | null | undefined;
960
- }> | zod495.ZodSafeParseError<{
972
+ }> | zod0.ZodSafeParseError<{
961
973
  providerId: string;
962
974
  config: Record<string, unknown>;
963
975
  enabled: boolean;
@@ -965,7 +977,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
965
977
  createdAt: Date;
966
978
  updatedAt: Date;
967
979
  name?: string | null | undefined;
968
- }> | zod495.ZodSafeParseSuccess<{
980
+ }> | zod0.ZodSafeParseSuccess<{
969
981
  requestId: string;
970
982
  provider: string;
971
983
  model: string;
@@ -987,8 +999,9 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
987
999
  configId?: string | null | undefined;
988
1000
  variantId?: string | null | undefined;
989
1001
  environmentId?: string | null | undefined;
1002
+ providerConfigId?: string | null | undefined;
990
1003
  userId?: string | null | undefined;
991
- }> | zod495.ZodSafeParseError<{
1004
+ }> | zod0.ZodSafeParseError<{
992
1005
  requestId: string;
993
1006
  provider: string;
994
1007
  model: string;
@@ -1010,22 +1023,23 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
1010
1023
  configId?: string | null | undefined;
1011
1024
  variantId?: string | null | undefined;
1012
1025
  environmentId?: string | null | undefined;
1026
+ providerConfigId?: string | null | undefined;
1013
1027
  userId?: string | null | undefined;
1014
1028
  }>;
1015
1029
  /**
1016
1030
  * Validate partial data (for updates)
1017
1031
  */
1018
- declare function validatePartialTableData<T extends TableName>(table: T, data: unknown): zod495.ZodSafeParseSuccess<{
1032
+ declare function validatePartialTableData<T extends TableName>(table: T, data: unknown): zod0.ZodSafeParseSuccess<{
1019
1033
  name?: string | undefined;
1020
1034
  id?: string | undefined;
1021
1035
  createdAt?: Date | undefined;
1022
1036
  updatedAt?: Date | undefined;
1023
- }> | zod495.ZodSafeParseError<{
1037
+ }> | zod0.ZodSafeParseError<{
1024
1038
  name?: string | undefined;
1025
1039
  id?: string | undefined;
1026
1040
  createdAt?: Date | undefined;
1027
1041
  updatedAt?: Date | undefined;
1028
- }> | zod495.ZodSafeParseSuccess<{
1042
+ }> | zod0.ZodSafeParseSuccess<{
1029
1043
  variantId?: string | undefined;
1030
1044
  version?: number | undefined;
1031
1045
  provider?: string | undefined;
@@ -1034,7 +1048,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
1034
1048
  id?: string | undefined;
1035
1049
  createdAt?: Date | undefined;
1036
1050
  updatedAt?: Date | undefined;
1037
- }> | zod495.ZodSafeParseError<{
1051
+ }> | zod0.ZodSafeParseError<{
1038
1052
  variantId?: string | undefined;
1039
1053
  version?: number | undefined;
1040
1054
  provider?: string | undefined;
@@ -1043,33 +1057,33 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
1043
1057
  id?: string | undefined;
1044
1058
  createdAt?: Date | undefined;
1045
1059
  updatedAt?: Date | undefined;
1046
- }> | zod495.ZodSafeParseSuccess<{
1060
+ }> | zod0.ZodSafeParseSuccess<{
1047
1061
  environmentId?: string | undefined;
1048
1062
  keyName?: string | undefined;
1049
1063
  keyValue?: string | undefined;
1050
1064
  id?: string | undefined;
1051
1065
  createdAt?: Date | undefined;
1052
1066
  updatedAt?: Date | undefined;
1053
- }> | zod495.ZodSafeParseError<{
1067
+ }> | zod0.ZodSafeParseError<{
1054
1068
  environmentId?: string | undefined;
1055
1069
  keyName?: string | undefined;
1056
1070
  keyValue?: string | undefined;
1057
1071
  id?: string | undefined;
1058
1072
  createdAt?: Date | undefined;
1059
1073
  updatedAt?: Date | undefined;
1060
- }> | zod495.ZodSafeParseSuccess<{
1074
+ }> | zod0.ZodSafeParseSuccess<{
1061
1075
  configId?: string | undefined;
1062
1076
  variantId?: string | undefined;
1063
1077
  id?: string | undefined;
1064
1078
  createdAt?: Date | undefined;
1065
1079
  updatedAt?: Date | undefined;
1066
- }> | zod495.ZodSafeParseError<{
1080
+ }> | zod0.ZodSafeParseError<{
1067
1081
  configId?: string | undefined;
1068
1082
  variantId?: string | undefined;
1069
1083
  id?: string | undefined;
1070
1084
  createdAt?: Date | undefined;
1071
1085
  updatedAt?: Date | undefined;
1072
- }> | zod495.ZodSafeParseSuccess<{
1086
+ }> | zod0.ZodSafeParseSuccess<{
1073
1087
  environmentId?: string | undefined;
1074
1088
  configId?: string | undefined;
1075
1089
  configVariantId?: string | undefined;
@@ -1081,7 +1095,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
1081
1095
  id?: string | undefined;
1082
1096
  createdAt?: Date | undefined;
1083
1097
  updatedAt?: Date | undefined;
1084
- }> | zod495.ZodSafeParseError<{
1098
+ }> | zod0.ZodSafeParseError<{
1085
1099
  environmentId?: string | undefined;
1086
1100
  configId?: string | undefined;
1087
1101
  configVariantId?: string | undefined;
@@ -1093,21 +1107,21 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
1093
1107
  id?: string | undefined;
1094
1108
  createdAt?: Date | undefined;
1095
1109
  updatedAt?: Date | undefined;
1096
- }> | zod495.ZodSafeParseSuccess<{
1110
+ }> | zod0.ZodSafeParseSuccess<{
1097
1111
  name?: string | null | undefined;
1098
1112
  setupComplete?: boolean | undefined;
1099
1113
  superAdminId?: string | null | undefined;
1100
1114
  id?: string | undefined;
1101
1115
  createdAt?: Date | undefined;
1102
1116
  updatedAt?: Date | undefined;
1103
- }> | zod495.ZodSafeParseError<{
1117
+ }> | zod0.ZodSafeParseError<{
1104
1118
  name?: string | null | undefined;
1105
1119
  setupComplete?: boolean | undefined;
1106
1120
  superAdminId?: string | null | undefined;
1107
1121
  id?: string | undefined;
1108
1122
  createdAt?: Date | undefined;
1109
1123
  updatedAt?: Date | undefined;
1110
- }> | zod495.ZodSafeParseSuccess<{
1124
+ }> | zod0.ZodSafeParseSuccess<{
1111
1125
  providerId?: string | undefined;
1112
1126
  name?: string | null | undefined;
1113
1127
  config?: Record<string, unknown> | undefined;
@@ -1115,7 +1129,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
1115
1129
  id?: string | undefined;
1116
1130
  createdAt?: Date | undefined;
1117
1131
  updatedAt?: Date | undefined;
1118
- }> | zod495.ZodSafeParseError<{
1132
+ }> | zod0.ZodSafeParseError<{
1119
1133
  providerId?: string | undefined;
1120
1134
  name?: string | null | undefined;
1121
1135
  config?: Record<string, unknown> | undefined;
@@ -1123,11 +1137,12 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
1123
1137
  id?: string | undefined;
1124
1138
  createdAt?: Date | undefined;
1125
1139
  updatedAt?: Date | undefined;
1126
- }> | zod495.ZodSafeParseSuccess<{
1140
+ }> | zod0.ZodSafeParseSuccess<{
1127
1141
  requestId?: string | undefined;
1128
1142
  configId?: string | null | undefined;
1129
1143
  variantId?: string | null | undefined;
1130
1144
  environmentId?: string | null | undefined;
1145
+ providerConfigId?: string | null | undefined;
1131
1146
  provider?: string | undefined;
1132
1147
  model?: string | undefined;
1133
1148
  promptTokens?: number | undefined;
@@ -1146,11 +1161,12 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
1146
1161
  id?: string | undefined;
1147
1162
  createdAt?: Date | undefined;
1148
1163
  updatedAt?: Date | undefined;
1149
- }> | zod495.ZodSafeParseError<{
1164
+ }> | zod0.ZodSafeParseError<{
1150
1165
  requestId?: string | undefined;
1151
1166
  configId?: string | null | undefined;
1152
1167
  variantId?: string | null | undefined;
1153
1168
  environmentId?: string | null | undefined;
1169
+ providerConfigId?: string | null | undefined;
1154
1170
  provider?: string | undefined;
1155
1171
  model?: string | undefined;
1156
1172
  promptTokens?: number | undefined;
@@ -1255,6 +1271,7 @@ declare function parseTableData<T extends TableName>(table: T, data: unknown): {
1255
1271
  configId?: string | null | undefined;
1256
1272
  variantId?: string | null | undefined;
1257
1273
  environmentId?: string | null | undefined;
1274
+ providerConfigId?: string | null | undefined;
1258
1275
  userId?: string | null | undefined;
1259
1276
  };
1260
1277
  /**
@@ -1319,6 +1336,7 @@ declare function parsePartialTableData<T extends TableName>(table: T, data: unkn
1319
1336
  configId?: string | null | undefined;
1320
1337
  variantId?: string | null | undefined;
1321
1338
  environmentId?: string | null | undefined;
1339
+ providerConfigId?: string | null | undefined;
1322
1340
  provider?: string | undefined;
1323
1341
  model?: string | undefined;
1324
1342
  promptTokens?: number | undefined;
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_db = require('./db-CzLvkATK.cjs');
1
+ const require_db = require('./db-CqDD6Ydv.cjs');
2
2
  let __llmops_gateway = require("@llmops/gateway");
3
3
  __llmops_gateway = require_db.__toESM(__llmops_gateway);
4
4
  let kysely = require("kysely");
@@ -1264,8 +1264,19 @@ const createConfigVariantDataLayer = (db) => {
1264
1264
  "version"
1265
1265
  ]).where("variantId", "=", configVariant.variantId).orderBy("version", "desc").limit(1).executeTakeFirst();
1266
1266
  if (!versionData) throw new LLMOpsError(`No variant version found for variant ${configVariant.variantId}`);
1267
+ let finalProvider = versionData.provider;
1268
+ let providerConfigId = null;
1269
+ if (UUID_REGEX.test(versionData.provider)) {
1270
+ const providerConfig = await db.selectFrom("provider_configs").select(["id", "providerId"]).where("id", "=", versionData.provider).executeTakeFirst();
1271
+ if (providerConfig) {
1272
+ finalProvider = providerConfig.providerId;
1273
+ providerConfigId = providerConfig.id;
1274
+ }
1275
+ }
1267
1276
  return {
1268
1277
  ...versionData,
1278
+ provider: finalProvider,
1279
+ providerConfigId,
1269
1280
  configId: resolvedConfigId,
1270
1281
  variantId: configVariant.variantId,
1271
1282
  environmentId
@@ -1439,6 +1450,7 @@ const insertLLMRequestSchema = require_db.zod_default.object({
1439
1450
  configId: require_db.zod_default.string().uuid().nullable().optional(),
1440
1451
  variantId: require_db.zod_default.string().uuid().nullable().optional(),
1441
1452
  environmentId: require_db.zod_default.string().uuid().nullable().optional(),
1453
+ providerConfigId: require_db.zod_default.string().uuid().nullable().optional(),
1442
1454
  provider: require_db.zod_default.string(),
1443
1455
  model: require_db.zod_default.string(),
1444
1456
  promptTokens: require_db.zod_default.number().int().default(0),
@@ -1464,6 +1476,7 @@ const listRequestsSchema = require_db.zod_default.object({
1464
1476
  configId: require_db.zod_default.string().uuid().optional(),
1465
1477
  variantId: require_db.zod_default.string().uuid().optional(),
1466
1478
  environmentId: require_db.zod_default.string().uuid().optional(),
1479
+ providerConfigId: require_db.zod_default.string().uuid().optional(),
1467
1480
  provider: require_db.zod_default.string().optional(),
1468
1481
  model: require_db.zod_default.string().optional(),
1469
1482
  startDate: require_db.zod_default.date().optional(),
@@ -1521,6 +1534,7 @@ const createLLMRequestsDataLayer = (db) => {
1521
1534
  configId: req.configId ?? null,
1522
1535
  variantId: req.variantId ?? null,
1523
1536
  environmentId: req.environmentId ?? null,
1537
+ providerConfigId: req.providerConfigId ?? null,
1524
1538
  provider: req.provider,
1525
1539
  model: req.model,
1526
1540
  promptTokens: req.promptTokens,
@@ -1553,6 +1567,7 @@ const createLLMRequestsDataLayer = (db) => {
1553
1567
  configId: req.configId ?? null,
1554
1568
  variantId: req.variantId ?? null,
1555
1569
  environmentId: req.environmentId ?? null,
1570
+ providerConfigId: req.providerConfigId ?? null,
1556
1571
  provider: req.provider,
1557
1572
  model: req.model,
1558
1573
  promptTokens: req.promptTokens,
@@ -1575,11 +1590,12 @@ const createLLMRequestsDataLayer = (db) => {
1575
1590
  listRequests: async (params) => {
1576
1591
  const result = await listRequestsSchema.safeParseAsync(params || {});
1577
1592
  if (!result.success) throw new LLMOpsError(`Invalid parameters: ${result.error.message}`);
1578
- const { limit, offset, configId, variantId, environmentId, provider, model, startDate, endDate, tags } = result.data;
1593
+ const { limit, offset, configId, variantId, environmentId, providerConfigId, provider, model, startDate, endDate, tags } = result.data;
1579
1594
  let baseQuery = db.selectFrom("llm_requests");
1580
1595
  if (configId) baseQuery = baseQuery.where("configId", "=", configId);
1581
1596
  if (variantId) baseQuery = baseQuery.where("variantId", "=", variantId);
1582
1597
  if (environmentId) baseQuery = baseQuery.where("environmentId", "=", environmentId);
1598
+ if (providerConfigId) baseQuery = baseQuery.where("providerConfigId", "=", providerConfigId);
1583
1599
  if (provider) baseQuery = baseQuery.where("provider", "=", provider);
1584
1600
  if (model) baseQuery = baseQuery.where("model", "=", model);
1585
1601
  if (startDate) baseQuery = baseQuery.where(kysely.sql`${col("createdAt")} >= ${startDate.toISOString()}`);