@llmops/core 0.1.1 → 0.1.2-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.
- package/dist/{bun-sqlite-dialect-Dzur5J1r.cjs → bun-sqlite-dialect-zL8xmYst.cjs} +1 -1
- package/dist/db/index.cjs +3 -2
- package/dist/db/index.d.cts +2 -2
- package/dist/db/index.d.mts +2 -2
- package/dist/db/index.mjs +2 -2
- package/dist/{db-gMDwCuHR.cjs → db-C9-M-kdS.cjs} +37 -3
- package/dist/{db-DN6gkyRp.mjs → db-CGY-vZ3u.mjs} +30 -2
- package/dist/{index-DbVk2Vpc.d.mts → index-BVOY5y9k.d.mts} +76 -49
- package/dist/{index-DGUMebzL.d.cts → index-D8DWyBKi.d.cts} +93 -66
- package/dist/index.cjs +13 -7
- package/dist/index.d.cts +199 -184
- package/dist/index.d.mts +22 -7
- package/dist/index.mjs +12 -7
- package/dist/{node-sqlite-dialect-BTbo14Y2.cjs → node-sqlite-dialect-CQlHW438.cjs} +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as TargetingRulesTable, B as
|
|
1
|
+
import { A as TargetingRulesTable, B as environmentSecretsSchema, C as EnvironmentSecretsTable, D as Selectable, E as SCHEMA_METADATA, F as VariantsTable, G as variantsSchema, H as schemas, I as WorkspaceSettings, K as workspaceSettingsSchema, L as WorkspaceSettingsTable, M as Variant, N as VariantVersion, O as TableName, P as VariantVersionsTable, R as configVariantsSchema, S as EnvironmentSecret, T as Insertable, U as targetingRulesSchema, V as environmentsSchema, W as variantVersionsSchema, _ 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 Updateable, k as TargetingRule, l as getMigrations, m as validatePartialTableData, n as DatabaseOptions, o as detectDatabaseType, p as parseTableData, 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 configsSchema } from "./index-BVOY5y9k.mjs";
|
|
2
2
|
import gateway from "@llmops/gateway";
|
|
3
3
|
import { Kysely } from "kysely";
|
|
4
4
|
import pino from "pino";
|
|
@@ -393,10 +393,8 @@ type AutoMigrateConfig = boolean | 'development';
|
|
|
393
393
|
declare const llmopsConfigSchema: z.ZodObject<{
|
|
394
394
|
database: z.ZodAny;
|
|
395
395
|
auth: z.ZodObject<{
|
|
396
|
-
type: z.
|
|
397
|
-
|
|
398
|
-
defaultPassword: z.ZodString;
|
|
399
|
-
}, z.core.$strip>;
|
|
396
|
+
type: z.ZodString;
|
|
397
|
+
}, z.core.$loose>;
|
|
400
398
|
basePath: z.ZodString;
|
|
401
399
|
providers: z.ZodObject<{
|
|
402
400
|
openai: z.ZodOptional<z.ZodObject<{
|
|
@@ -829,16 +827,33 @@ declare const llmopsConfigSchema: z.ZodObject<{
|
|
|
829
827
|
autoMigrate: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"development">]>>>;
|
|
830
828
|
schema: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
831
829
|
}, z.core.$strip>;
|
|
830
|
+
/**
|
|
831
|
+
* Base auth configuration interface
|
|
832
|
+
* All auth providers must have at least a type field
|
|
833
|
+
*/
|
|
834
|
+
interface AuthConfig {
|
|
835
|
+
readonly type: string;
|
|
836
|
+
[key: string]: unknown;
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Basic auth configuration (open source)
|
|
840
|
+
*/
|
|
841
|
+
interface BasicAuthConfig extends AuthConfig {
|
|
842
|
+
readonly type: 'basic';
|
|
843
|
+
readonly defaultUser: string;
|
|
844
|
+
readonly defaultPassword: string;
|
|
845
|
+
}
|
|
832
846
|
/**
|
|
833
847
|
* Validated LLMOps configuration with typed providers
|
|
834
848
|
* Uses ProvidersConfig for proper provider-specific typing
|
|
835
849
|
*
|
|
836
850
|
* Note: autoMigrate and schema are optional in input but always present after validation
|
|
837
851
|
*/
|
|
838
|
-
type ValidatedLLMOpsConfig = Omit<z.infer<typeof llmopsConfigSchema>, 'providers' | 'autoMigrate' | 'schema'> & {
|
|
852
|
+
type ValidatedLLMOpsConfig = Omit<z.infer<typeof llmopsConfigSchema>, 'providers' | 'autoMigrate' | 'schema' | 'auth'> & {
|
|
839
853
|
providers: ProvidersConfig;
|
|
840
854
|
autoMigrate?: AutoMigrateConfig;
|
|
841
855
|
schema: string;
|
|
856
|
+
auth: AuthConfig;
|
|
842
857
|
};
|
|
843
858
|
/**
|
|
844
859
|
* Input type for LLMOps configuration (before validation)
|
|
@@ -2085,4 +2100,4 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
|
|
|
2085
2100
|
}[]>;
|
|
2086
2101
|
}>;
|
|
2087
2102
|
//#endregion
|
|
2088
|
-
export { type AnthropicProviderConfig, type AnyProviderConfig, AutoMigrateConfig, type AzureAIProviderConfig, type AzureOpenAIProviderConfig, type BaseProviderConfig, type BedrockProviderConfig, ChatCompletionCreateParamsBase, Config, ConfigVariant, type ConfigVariantsTable, type ConfigsTable, type CortexProviderConfig, type Database, DatabaseConnection, DatabaseOptions, DatabaseType, Environment, EnvironmentSecret, type EnvironmentSecretsTable, type EnvironmentsTable, type FireworksAIProviderConfig, type GoogleProviderConfig, type HuggingFaceProviderConfig, Insertable, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, MigrationOptions, MigrationResult, type MistralAIProviderConfig, type OpenAIProviderConfig, type OracleProviderConfig, Prettify, type ProviderConfigMap, type ProvidersConfig, SCHEMA_METADATA, type SagemakerProviderConfig, Selectable, type StabilityAIProviderConfig, SupportedProviders, type TableName, TargetingRule, type TargetingRulesTable, Updateable, type ValidatedLLMOpsConfig, Variant, VariantJsonData, VariantVersion, VariantVersionsTable, type VariantsTable, type VertexAIProviderConfig, type WorkersAIProviderConfig, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createDataLayer, createDatabase, createDatabaseFromConnection, detectDatabaseType, environmentSecretsSchema, environmentsSchema, gateway, generateId, getMigrations, llmopsConfigSchema, logger, matchType, parsePartialTableData, parseTableData, runAutoMigrations, schemas, targetingRulesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema };
|
|
2103
|
+
export { type AnthropicProviderConfig, type AnyProviderConfig, type AuthConfig, AutoMigrateConfig, type AzureAIProviderConfig, type AzureOpenAIProviderConfig, type BaseProviderConfig, type BasicAuthConfig, type BedrockProviderConfig, ChatCompletionCreateParamsBase, Config, ConfigVariant, type ConfigVariantsTable, type ConfigsTable, type CortexProviderConfig, type Database, DatabaseConnection, DatabaseOptions, DatabaseType, Environment, EnvironmentSecret, type EnvironmentSecretsTable, type EnvironmentsTable, type FireworksAIProviderConfig, type GoogleProviderConfig, type HuggingFaceProviderConfig, Insertable, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, MigrationOptions, MigrationResult, type MistralAIProviderConfig, type OpenAIProviderConfig, type OracleProviderConfig, Prettify, type ProviderConfigMap, type ProvidersConfig, SCHEMA_METADATA, type SagemakerProviderConfig, Selectable, type StabilityAIProviderConfig, SupportedProviders, type TableName, TargetingRule, type TargetingRulesTable, Updateable, type ValidatedLLMOpsConfig, Variant, VariantJsonData, VariantVersion, VariantVersionsTable, type VariantsTable, type VertexAIProviderConfig, type WorkersAIProviderConfig, WorkspaceSettings, WorkspaceSettingsTable, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createDataLayer, createDatabase, createDatabaseFromConnection, detectDatabaseType, environmentSecretsSchema, environmentsSchema, gateway, generateId, getMigrations, llmopsConfigSchema, logger, matchType, parsePartialTableData, parseTableData, runAutoMigrations, schemas, targetingRulesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as record, C as _enum, D as literal, E as boolean, M as union, N as unknown, O as number, S as zod_default, T as array, _ as schemas, a as matchType, b as variantsSchema, c as parsePartialTableData, d as validateTableData, f as SCHEMA_METADATA, g as environmentsSchema, h as environmentSecretsSchema, i as getMigrations, j as string, k as object, l as parseTableData, m as configsSchema, n as createDatabaseFromConnection, o as runAutoMigrations, p as configVariantsSchema, r as detectDatabaseType, s as logger, t as createDatabase, u as validatePartialTableData, v as targetingRulesSchema, w as any, x as workspaceSettingsSchema, y as variantVersionsSchema } from "./db-CGY-vZ3u.mjs";
|
|
2
2
|
import gateway from "@llmops/gateway";
|
|
3
3
|
import { createRandomStringGenerator } from "@better-auth/utils/random";
|
|
4
4
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
@@ -438,11 +438,16 @@ const providerEntries = Object.values(SupportedProviders).map((provider) => [pro
|
|
|
438
438
|
* All providers are optional, but at least one must be configured
|
|
439
439
|
*/
|
|
440
440
|
const providersSchema = object(Object.fromEntries(providerEntries)).refine((providers) => Object.values(providers).some((v) => v !== void 0 && v !== null), "At least one provider must be configured");
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
441
|
+
/**
|
|
442
|
+
* Auth configuration schema
|
|
443
|
+
*
|
|
444
|
+
* Uses a flexible schema with passthrough to allow different auth providers.
|
|
445
|
+
* - Open source: basicAuth() from @llmops/sdk (type: 'basic')
|
|
446
|
+
* - Enterprise: enterpriseAuth() from @llmops/enterprise (type: 'better-auth', etc.)
|
|
447
|
+
*
|
|
448
|
+
* The actual auth handling is done by the auth middleware based on the type.
|
|
449
|
+
*/
|
|
450
|
+
const authSchema = object({ type: string().min(1, "Auth type is required") }).passthrough();
|
|
446
451
|
const llmopsConfigSchema = object({
|
|
447
452
|
database: any(),
|
|
448
453
|
auth: authSchema,
|
|
@@ -1348,4 +1353,4 @@ const createDataLayer = async (db) => {
|
|
|
1348
1353
|
};
|
|
1349
1354
|
|
|
1350
1355
|
//#endregion
|
|
1351
|
-
export { SCHEMA_METADATA, SupportedProviders, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createDataLayer, createDatabase, createDatabaseFromConnection, detectDatabaseType, environmentSecretsSchema, environmentsSchema, gateway, generateId, getMigrations, llmopsConfigSchema, logger, matchType, parsePartialTableData, parseTableData, runAutoMigrations, schemas, targetingRulesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema };
|
|
1356
|
+
export { SCHEMA_METADATA, SupportedProviders, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createDataLayer, createDatabase, createDatabaseFromConnection, detectDatabaseType, environmentSecretsSchema, environmentsSchema, gateway, generateId, getMigrations, llmopsConfigSchema, logger, matchType, parsePartialTableData, parseTableData, runAutoMigrations, schemas, targetingRulesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llmops/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2-beta.2",
|
|
4
4
|
"description": "Core LLMOps functionality and utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"hono": "^4.10.7",
|
|
52
52
|
"kysely": "^0.28.8",
|
|
53
53
|
"pino": "^10.1.0",
|
|
54
|
-
"@llmops/gateway": "^0.1.
|
|
54
|
+
"@llmops/gateway": "^0.1.2-beta.2"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "tsdown",
|