@llmops/core 0.6.7 → 0.6.9-beta.1
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-BUnuGpx1.cjs → bun-sqlite-dialect-CksPRKLh.cjs} +1 -1
- package/dist/db/index.cjs +2 -2
- package/dist/db/index.mjs +1 -1
- package/dist/{db-Cd1KR24Y.mjs → db-7xGTn9dj.mjs} +28 -6
- package/dist/{db-i0OOYxJm.cjs → db-DCd8fH5o.cjs} +29 -7
- package/dist/index.cjs +14 -9
- package/dist/index.mjs +13 -7
- package/dist/{neon-dialect-oh8u9vRy.cjs → neon-dialect-BwxWZibF.cjs} +1 -1
- package/dist/{neon-dialect-DavGzunb.cjs → neon-dialect-D1BNI0H1.cjs} +1 -1
- package/dist/{node-sqlite-dialect-CbwETvHG.cjs → node-sqlite-dialect-Lkc1F6MI.cjs} +1 -1
- package/package.json +2 -2
package/dist/db/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_db = require('../db-
|
|
2
|
-
const require_neon_dialect = require('../neon-dialect-
|
|
1
|
+
const require_db = require('../db-DCd8fH5o.cjs');
|
|
2
|
+
const require_neon_dialect = require('../neon-dialect-BwxWZibF.cjs');
|
|
3
3
|
|
|
4
4
|
exports.SCHEMA_METADATA = require_db.SCHEMA_METADATA;
|
|
5
5
|
exports.configVariantsSchema = require_db.configVariantsSchema;
|
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-
|
|
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-7xGTn9dj.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,5 +1,4 @@
|
|
|
1
1
|
import { CompiledQuery, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect, sql } from "kysely";
|
|
2
|
-
import { getMigrations } from "better-auth/db";
|
|
3
2
|
import pino from "pino";
|
|
4
3
|
|
|
5
4
|
//#region rolldown:runtime
|
|
@@ -14369,7 +14368,7 @@ async function ensurePostgresSchemaExists(db, schema) {
|
|
|
14369
14368
|
logger.warn({ error: error$47 }, "Failed to ensure PostgreSQL schema exists");
|
|
14370
14369
|
}
|
|
14371
14370
|
}
|
|
14372
|
-
async function getMigrations
|
|
14371
|
+
async function getMigrations(db, dbType, options) {
|
|
14373
14372
|
let currentSchema = "public";
|
|
14374
14373
|
if (dbType === "postgres" || dbType === "neon") {
|
|
14375
14374
|
if (options?.schema) {
|
|
@@ -14521,10 +14520,33 @@ async function getMigrations$1(db, dbType, options) {
|
|
|
14521
14520
|
} catch (error$47) {
|
|
14522
14521
|
logger.warn({ error: error$47 }, "Failed to set search_path for Better Auth migrations");
|
|
14523
14522
|
}
|
|
14524
|
-
|
|
14523
|
+
let getAuthMigrations;
|
|
14524
|
+
try {
|
|
14525
|
+
try {
|
|
14526
|
+
({getMigrations: getAuthMigrations} = await import("better-auth/db"));
|
|
14527
|
+
} catch {
|
|
14528
|
+
({getMigrations: getAuthMigrations} = await import("better-auth/db/migration"));
|
|
14529
|
+
}
|
|
14530
|
+
} catch (error$47) {
|
|
14531
|
+
logger.warn({ error: error$47 }, "Failed to import better-auth migrations; skipping auth migrations");
|
|
14532
|
+
return {
|
|
14533
|
+
toBeCreated,
|
|
14534
|
+
toBeAdded,
|
|
14535
|
+
runMigrations: async () => {
|
|
14536
|
+
for (const migration of migrations) await migration.execute();
|
|
14537
|
+
},
|
|
14538
|
+
compileMigrations: async () => {
|
|
14539
|
+
return migrations.map((m) => m.compile().sql).join(";\n\n") + ";";
|
|
14540
|
+
},
|
|
14541
|
+
migrations,
|
|
14542
|
+
needsMigration: toBeCreated.length > 0 || toBeAdded.length > 0
|
|
14543
|
+
};
|
|
14544
|
+
}
|
|
14545
|
+
const authOptions = getAuthClientOptions({ database: {
|
|
14525
14546
|
db,
|
|
14526
14547
|
type: dbType === "neon" ? "postgres" : dbType
|
|
14527
|
-
} })
|
|
14548
|
+
} });
|
|
14549
|
+
const { toBeAdded: authChangesToBeAdded, toBeCreated: authChangesToBeCreated, runMigrations: runAuthMigrations } = await getAuthMigrations(authOptions);
|
|
14528
14550
|
async function runMigrations() {
|
|
14529
14551
|
for (const migration of migrations) await migration.execute();
|
|
14530
14552
|
await runAuthMigrations();
|
|
@@ -14593,7 +14615,7 @@ async function runAutoMigrations(db, dbType, options) {
|
|
|
14593
14615
|
} catch (error$47) {
|
|
14594
14616
|
logger.debug(`Constraint fixup skipped or failed: ${error$47}`);
|
|
14595
14617
|
}
|
|
14596
|
-
const { toBeCreated, toBeAdded, runMigrations, needsMigration } = await getMigrations
|
|
14618
|
+
const { toBeCreated, toBeAdded, runMigrations, needsMigration } = await getMigrations(db, dbType, options);
|
|
14597
14619
|
if (!needsMigration) {
|
|
14598
14620
|
logger.debug("Auto-migration: No migrations needed");
|
|
14599
14621
|
return {
|
|
@@ -14714,4 +14736,4 @@ async function createDatabaseFromConnection(rawConnection, options) {
|
|
|
14714
14736
|
}
|
|
14715
14737
|
|
|
14716
14738
|
//#endregion
|
|
14717
|
-
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
|
|
14739
|
+
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 };
|
|
@@ -39,7 +39,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
39
39
|
|
|
40
40
|
//#endregion
|
|
41
41
|
let kysely = require("kysely");
|
|
42
|
-
let better_auth_db = require("better-auth/db");
|
|
43
42
|
let pino = require("pino");
|
|
44
43
|
pino = __toESM(pino);
|
|
45
44
|
|
|
@@ -14545,10 +14544,33 @@ async function getMigrations(db, dbType, options) {
|
|
|
14545
14544
|
} catch (error$47) {
|
|
14546
14545
|
logger.warn({ error: error$47 }, "Failed to set search_path for Better Auth migrations");
|
|
14547
14546
|
}
|
|
14548
|
-
|
|
14547
|
+
let getAuthMigrations;
|
|
14548
|
+
try {
|
|
14549
|
+
try {
|
|
14550
|
+
({getMigrations: getAuthMigrations} = await import("better-auth/db"));
|
|
14551
|
+
} catch {
|
|
14552
|
+
({getMigrations: getAuthMigrations} = await import("better-auth/db/migration"));
|
|
14553
|
+
}
|
|
14554
|
+
} catch (error$47) {
|
|
14555
|
+
logger.warn({ error: error$47 }, "Failed to import better-auth migrations; skipping auth migrations");
|
|
14556
|
+
return {
|
|
14557
|
+
toBeCreated,
|
|
14558
|
+
toBeAdded,
|
|
14559
|
+
runMigrations: async () => {
|
|
14560
|
+
for (const migration of migrations) await migration.execute();
|
|
14561
|
+
},
|
|
14562
|
+
compileMigrations: async () => {
|
|
14563
|
+
return migrations.map((m) => m.compile().sql).join(";\n\n") + ";";
|
|
14564
|
+
},
|
|
14565
|
+
migrations,
|
|
14566
|
+
needsMigration: toBeCreated.length > 0 || toBeAdded.length > 0
|
|
14567
|
+
};
|
|
14568
|
+
}
|
|
14569
|
+
const authOptions = getAuthClientOptions({ database: {
|
|
14549
14570
|
db,
|
|
14550
14571
|
type: dbType === "neon" ? "postgres" : dbType
|
|
14551
|
-
} })
|
|
14572
|
+
} });
|
|
14573
|
+
const { toBeAdded: authChangesToBeAdded, toBeCreated: authChangesToBeCreated, runMigrations: runAuthMigrations } = await getAuthMigrations(authOptions);
|
|
14552
14574
|
async function runMigrations() {
|
|
14553
14575
|
for (const migration of migrations) await migration.execute();
|
|
14554
14576
|
await runAuthMigrations();
|
|
@@ -14695,12 +14717,12 @@ async function createDatabaseFromConnection(rawConnection, options) {
|
|
|
14695
14717
|
case "sqlite":
|
|
14696
14718
|
if ("aggregate" in rawConnection && !("createSession" in rawConnection)) dialect = new kysely.SqliteDialect({ database: rawConnection });
|
|
14697
14719
|
else if ("fileControl" in rawConnection) {
|
|
14698
|
-
const { BunSqliteDialect } = await Promise.resolve().then(() => require("./bun-sqlite-dialect-
|
|
14720
|
+
const { BunSqliteDialect } = await Promise.resolve().then(() => require("./bun-sqlite-dialect-CksPRKLh.cjs"));
|
|
14699
14721
|
dialect = new BunSqliteDialect({ database: rawConnection });
|
|
14700
14722
|
} else if ("createSession" in rawConnection && typeof window === "undefined") try {
|
|
14701
14723
|
const { DatabaseSync } = await import("node:sqlite");
|
|
14702
14724
|
if (rawConnection instanceof DatabaseSync) {
|
|
14703
|
-
const { NodeSqliteDialect } = await Promise.resolve().then(() => require("./node-sqlite-dialect-
|
|
14725
|
+
const { NodeSqliteDialect } = await Promise.resolve().then(() => require("./node-sqlite-dialect-Lkc1F6MI.cjs"));
|
|
14704
14726
|
dialect = new NodeSqliteDialect({ database: rawConnection });
|
|
14705
14727
|
}
|
|
14706
14728
|
} catch {}
|
|
@@ -14718,7 +14740,7 @@ async function createDatabaseFromConnection(rawConnection, options) {
|
|
|
14718
14740
|
break;
|
|
14719
14741
|
case "neon": {
|
|
14720
14742
|
if (typeof rawConnection === "function") {
|
|
14721
|
-
const { createNeonDialect: createNeonDialect$1 } = await Promise.resolve().then(() => require("./neon-dialect-
|
|
14743
|
+
const { createNeonDialect: createNeonDialect$1 } = await Promise.resolve().then(() => require("./neon-dialect-D1BNI0H1.cjs"));
|
|
14722
14744
|
dialect = createNeonDialect$1(rawConnection);
|
|
14723
14745
|
break;
|
|
14724
14746
|
}
|
|
@@ -14726,7 +14748,7 @@ async function createDatabaseFromConnection(rawConnection, options) {
|
|
|
14726
14748
|
if (!connectionString) throw new Error("Neon connection string is required. Pass it directly as the database option or set one of: NEON_CONNECTION_STRING, NEON_PG_URL, DATABASE_URL, POSTGRES_URL");
|
|
14727
14749
|
const { neon } = await import("@neondatabase/serverless");
|
|
14728
14750
|
const sql$1 = neon(connectionString);
|
|
14729
|
-
const { createNeonDialect } = await Promise.resolve().then(() => require("./neon-dialect-
|
|
14751
|
+
const { createNeonDialect } = await Promise.resolve().then(() => require("./neon-dialect-D1BNI0H1.cjs"));
|
|
14730
14752
|
dialect = createNeonDialect(sql$1);
|
|
14731
14753
|
break;
|
|
14732
14754
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
const require_db = require('./db-
|
|
2
|
-
const require_neon_dialect = require('./neon-dialect-
|
|
1
|
+
const require_db = require('./db-DCd8fH5o.cjs');
|
|
2
|
+
const require_neon_dialect = require('./neon-dialect-BwxWZibF.cjs');
|
|
3
3
|
let __llmops_gateway = require("@llmops/gateway");
|
|
4
4
|
__llmops_gateway = require_db.__toESM(__llmops_gateway);
|
|
5
5
|
let kysely = require("kysely");
|
|
6
|
-
let node_fs_promises = require("node:fs/promises");
|
|
7
|
-
node_fs_promises = require_db.__toESM(node_fs_promises);
|
|
8
6
|
let node_path = require("node:path");
|
|
9
7
|
node_path = require_db.__toESM(node_path);
|
|
10
8
|
let __better_auth_utils_random = require("@better-auth/utils/random");
|
|
@@ -643,7 +641,7 @@ const llmopsConfigBaseSchema = require_db.object({
|
|
|
643
641
|
const llmopsConfigSchema = llmopsConfigBaseSchema.transform((config) => ({
|
|
644
642
|
...config,
|
|
645
643
|
providers: mergeWithDefaultProviders(config.providers)
|
|
646
|
-
}))
|
|
644
|
+
}));
|
|
647
645
|
function validateLLMOpsConfig(config) {
|
|
648
646
|
const result = llmopsConfigSchema.safeParse(config ?? {});
|
|
649
647
|
if (!result.success) {
|
|
@@ -864,14 +862,16 @@ var FileCacheBackend = class {
|
|
|
864
862
|
if (!this.loaded) await this.loadPromise;
|
|
865
863
|
}
|
|
866
864
|
async ensureDataDir() {
|
|
865
|
+
const { mkdir } = await import("node:fs/promises");
|
|
867
866
|
const dir = node_path.dirname(this.cacheFile);
|
|
868
867
|
try {
|
|
869
|
-
await
|
|
868
|
+
await mkdir(dir, { recursive: true });
|
|
870
869
|
} catch {}
|
|
871
870
|
}
|
|
872
871
|
async loadCache() {
|
|
873
872
|
try {
|
|
874
|
-
const
|
|
873
|
+
const { readFile } = await import("node:fs/promises");
|
|
874
|
+
const content = await readFile(this.cacheFile, "utf-8");
|
|
875
875
|
this.data = JSON.parse(content);
|
|
876
876
|
this.updateStats();
|
|
877
877
|
this.loaded = true;
|
|
@@ -883,7 +883,8 @@ var FileCacheBackend = class {
|
|
|
883
883
|
async saveCache() {
|
|
884
884
|
try {
|
|
885
885
|
await this.ensureDataDir();
|
|
886
|
-
|
|
886
|
+
const { writeFile } = await import("node:fs/promises");
|
|
887
|
+
await writeFile(this.cacheFile, JSON.stringify(this.data, null, 2));
|
|
887
888
|
} catch {}
|
|
888
889
|
}
|
|
889
890
|
scheduleSave() {
|
|
@@ -3663,7 +3664,11 @@ const createWorkspaceSettingsDataLayer = (db) => {
|
|
|
3663
3664
|
return true;
|
|
3664
3665
|
},
|
|
3665
3666
|
isSetupComplete: async () => {
|
|
3666
|
-
|
|
3667
|
+
try {
|
|
3668
|
+
return (await db.selectFrom("workspace_settings").select("setupComplete").executeTakeFirst())?.setupComplete ?? false;
|
|
3669
|
+
} catch {
|
|
3670
|
+
return false;
|
|
3671
|
+
}
|
|
3667
3672
|
},
|
|
3668
3673
|
markSetupComplete: async () => {
|
|
3669
3674
|
let settings = await db.selectFrom("workspace_settings").selectAll().executeTakeFirst();
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { A as schemas, B as any, C as llmRequestsSchema, D as playgroundsSchema, E as playgroundRunsSchema, F as variantVersionsSchema, G as object, H as boolean, I as variantsSchema, J as union, K as record, L as workspaceSettingsSchema, M as spansSchema, N as targetingRulesSchema, O as providerConfigsSchema, P as tracesSchema, R as zod_default, S as guardrailConfigsSchema, T as playgroundResultsSchema, U as literal, V as array, W as number, Y as unknown, _ as datasetVersionRecordsSchema, a as matchType, b as environmentSecretsSchema, c as logger, 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, q as string, r as detectDatabaseType, s as getAuthClientOptions, t as createDatabase, u as parseTableData, v as datasetVersionsSchema, w as playgroundColumnSchema, x as environmentsSchema, y as datasetsSchema, z as _enum } from "./db-
|
|
1
|
+
import { A as schemas, B as any, C as llmRequestsSchema, D as playgroundsSchema, E as playgroundRunsSchema, F as variantVersionsSchema, G as object, H as boolean, I as variantsSchema, J as union, K as record, L as workspaceSettingsSchema, M as spansSchema, N as targetingRulesSchema, O as providerConfigsSchema, P as tracesSchema, R as zod_default, S as guardrailConfigsSchema, T as playgroundResultsSchema, U as literal, V as array, W as number, Y as unknown, _ as datasetVersionRecordsSchema, a as matchType, b as environmentSecretsSchema, c as logger, 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, q as string, r as detectDatabaseType, s as getAuthClientOptions, t as createDatabase, u as parseTableData, v as datasetVersionsSchema, w as playgroundColumnSchema, x as environmentsSchema, y as datasetsSchema, z as _enum } from "./db-7xGTn9dj.mjs";
|
|
2
2
|
import { n as executeWithSchema, t as createNeonDialect } from "./neon-dialect-DySGBYUi.mjs";
|
|
3
3
|
import gateway from "@llmops/gateway";
|
|
4
4
|
import { sql } from "kysely";
|
|
5
|
-
import * as fs from "node:fs/promises";
|
|
6
5
|
import * as path from "node:path";
|
|
7
6
|
import { createRandomStringGenerator } from "@better-auth/utils/random";
|
|
8
7
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
@@ -639,7 +638,7 @@ const llmopsConfigBaseSchema = object({
|
|
|
639
638
|
const llmopsConfigSchema = llmopsConfigBaseSchema.transform((config) => ({
|
|
640
639
|
...config,
|
|
641
640
|
providers: mergeWithDefaultProviders(config.providers)
|
|
642
|
-
}))
|
|
641
|
+
}));
|
|
643
642
|
function validateLLMOpsConfig(config) {
|
|
644
643
|
const result = llmopsConfigSchema.safeParse(config ?? {});
|
|
645
644
|
if (!result.success) {
|
|
@@ -860,14 +859,16 @@ var FileCacheBackend = class {
|
|
|
860
859
|
if (!this.loaded) await this.loadPromise;
|
|
861
860
|
}
|
|
862
861
|
async ensureDataDir() {
|
|
862
|
+
const { mkdir } = await import("node:fs/promises");
|
|
863
863
|
const dir = path.dirname(this.cacheFile);
|
|
864
864
|
try {
|
|
865
|
-
await
|
|
865
|
+
await mkdir(dir, { recursive: true });
|
|
866
866
|
} catch {}
|
|
867
867
|
}
|
|
868
868
|
async loadCache() {
|
|
869
869
|
try {
|
|
870
|
-
const
|
|
870
|
+
const { readFile } = await import("node:fs/promises");
|
|
871
|
+
const content = await readFile(this.cacheFile, "utf-8");
|
|
871
872
|
this.data = JSON.parse(content);
|
|
872
873
|
this.updateStats();
|
|
873
874
|
this.loaded = true;
|
|
@@ -879,7 +880,8 @@ var FileCacheBackend = class {
|
|
|
879
880
|
async saveCache() {
|
|
880
881
|
try {
|
|
881
882
|
await this.ensureDataDir();
|
|
882
|
-
|
|
883
|
+
const { writeFile } = await import("node:fs/promises");
|
|
884
|
+
await writeFile(this.cacheFile, JSON.stringify(this.data, null, 2));
|
|
883
885
|
} catch {}
|
|
884
886
|
}
|
|
885
887
|
scheduleSave() {
|
|
@@ -3659,7 +3661,11 @@ const createWorkspaceSettingsDataLayer = (db) => {
|
|
|
3659
3661
|
return true;
|
|
3660
3662
|
},
|
|
3661
3663
|
isSetupComplete: async () => {
|
|
3662
|
-
|
|
3664
|
+
try {
|
|
3665
|
+
return (await db.selectFrom("workspace_settings").select("setupComplete").executeTakeFirst())?.setupComplete ?? false;
|
|
3666
|
+
} catch {
|
|
3667
|
+
return false;
|
|
3668
|
+
}
|
|
3663
3669
|
},
|
|
3664
3670
|
markSetupComplete: async () => {
|
|
3665
3671
|
let settings = await db.selectFrom("workspace_settings").selectAll().executeTakeFirst();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llmops/core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9-beta.1",
|
|
4
4
|
"description": "Core LLMOps functionality and utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"kysely": "^0.28.8",
|
|
56
56
|
"kysely-neon": "^2.0.2",
|
|
57
57
|
"pino": "^10.1.0",
|
|
58
|
-
"@llmops/gateway": "^0.6.
|
|
58
|
+
"@llmops/gateway": "^0.6.9-beta.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/json-logic-js": "^2.0.8",
|