@llmops/core 0.3.1 → 0.3.2-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-BNaQHMpk.cjs → bun-sqlite-dialect-B5rfiYIH.cjs} +1 -1
- package/dist/db/index.cjs +4 -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-B-EsQtOz.mjs → db-Bkg85wso.mjs} +125 -3
- package/dist/{db-Du2xmkGS.cjs → db-CCKBHjuz.cjs} +139 -5
- package/dist/{index-COkIT6TH.d.mts → index-BMN3ZSTf.d.mts} +398 -2
- package/dist/{index-CunWjFE4.d.cts → index-nsx8vXII.d.cts} +433 -37
- package/dist/index.cjs +249 -5
- package/dist/index.d.cts +765 -205
- package/dist/index.d.mts +1026 -466
- package/dist/index.mjs +245 -5
- package/dist/{neon-dialect-BR1nZmKX.cjs → neon-dialect-DmI-frVR.cjs} +1 -1
- package/dist/{neon-dialect-B-Q6mmbI.cjs → neon-dialect-q-8lApt2.cjs} +1 -1
- package/dist/{node-sqlite-dialect-DpdAEbyp.cjs → node-sqlite-dialect-uTc3IyPv.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-CCKBHjuz.cjs');
|
|
2
|
+
const require_neon_dialect = require('../neon-dialect-DmI-frVR.cjs');
|
|
3
3
|
|
|
4
4
|
exports.SCHEMA_METADATA = require_db.SCHEMA_METADATA;
|
|
5
5
|
exports.configVariantsSchema = require_db.configVariantsSchema;
|
|
@@ -12,11 +12,13 @@ exports.environmentSecretsSchema = require_db.environmentSecretsSchema;
|
|
|
12
12
|
exports.environmentsSchema = require_db.environmentsSchema;
|
|
13
13
|
exports.executeWithSchema = require_neon_dialect.executeWithSchema;
|
|
14
14
|
exports.getMigrations = require_db.getMigrations;
|
|
15
|
+
exports.guardrailConfigsSchema = require_db.guardrailConfigsSchema;
|
|
15
16
|
exports.llmRequestsSchema = require_db.llmRequestsSchema;
|
|
16
17
|
exports.matchType = require_db.matchType;
|
|
17
18
|
exports.parsePartialTableData = require_db.parsePartialTableData;
|
|
18
19
|
exports.parseTableData = require_db.parseTableData;
|
|
19
20
|
exports.providerConfigsSchema = require_db.providerConfigsSchema;
|
|
21
|
+
exports.providerGuardrailOverridesSchema = require_db.providerGuardrailOverridesSchema;
|
|
20
22
|
exports.runAutoMigrations = require_db.runAutoMigrations;
|
|
21
23
|
exports.schemas = require_db.schemas;
|
|
22
24
|
exports.targetingRulesSchema = require_db.targetingRulesSchema;
|
package/dist/db/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
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, createNeonDialect, detectDatabaseType, environmentSecretsSchema, environmentsSchema, executeWithSchema, getMigrations, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, providerConfigsSchema, runAutoMigrations, schemas, targetingRulesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
|
1
|
+
import { $ as environmentsSchema, A as GuardrailResults, B as TableName, C as Environment, D as GuardrailConfig, E as EnvironmentsTable, F as ProviderConfigsTable, G as VariantVersion, H as TargetingRulesTable, I as ProviderGuardrailOverride, J as WorkspaceSettings, K as VariantVersionsTable, L as ProviderGuardrailOverridesTable, M as LLMRequest, N as LLMRequestsTable, O as GuardrailConfigsTable, P as ProviderConfig, Q as environmentSecretsSchema, R as SCHEMA_METADATA, S as Database, T as EnvironmentSecretsTable, U as Updateable, V as TargetingRule, W as Variant, X as configVariantsSchema, Y as WorkspaceSettingsTable, Z as configsSchema, _ as validateTableData, a as createDatabaseFromConnection, at as targetingRulesSchema, b as ConfigVariantsTable, c as executeWithSchema, ct as workspaceSettingsSchema, d as getMigrations, et as guardrailConfigsSchema, f as matchType, g as validatePartialTableData, h as parseTableData, i as createDatabase, it as schemas, j as Insertable, k as GuardrailResult, l as MigrationOptions, m as parsePartialTableData, n as DatabaseOptions, nt as providerConfigsSchema, o as detectDatabaseType, ot as variantVersionsSchema, p as runAutoMigrations, q as VariantsTable, r as DatabaseType, rt as providerGuardrailOverridesSchema, s as createNeonDialect, st as variantsSchema, t as DatabaseConnection, tt as llmRequestsSchema, u as MigrationResult, v as Config, w as EnvironmentSecret, x as ConfigsTable, y as ConfigVariant, z as Selectable } from "../index-nsx8vXII.cjs";
|
|
2
|
+
export { Config, ConfigVariant, ConfigVariantsTable, ConfigsTable, Database, DatabaseConnection, DatabaseOptions, DatabaseType, Environment, EnvironmentSecret, EnvironmentSecretsTable, EnvironmentsTable, GuardrailConfig, GuardrailConfigsTable, GuardrailResult, GuardrailResults, Insertable, LLMRequest, LLMRequestsTable, MigrationOptions, MigrationResult, ProviderConfig, ProviderConfigsTable, ProviderGuardrailOverride, ProviderGuardrailOverridesTable, SCHEMA_METADATA, Selectable, TableName, TargetingRule, TargetingRulesTable, Updateable, Variant, VariantVersion, VariantVersionsTable, VariantsTable, WorkspaceSettings, WorkspaceSettingsTable, configVariantsSchema, configsSchema, createDatabase, createDatabaseFromConnection, createNeonDialect, detectDatabaseType, environmentSecretsSchema, environmentsSchema, executeWithSchema, getMigrations, guardrailConfigsSchema, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, providerConfigsSchema, providerGuardrailOverridesSchema, runAutoMigrations, schemas, targetingRulesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
package/dist/db/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
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, createNeonDialect, detectDatabaseType, environmentSecretsSchema, environmentsSchema, executeWithSchema, getMigrations, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, providerConfigsSchema, runAutoMigrations, schemas, targetingRulesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
|
1
|
+
import { $ as environmentsSchema, A as GuardrailResults, B as TableName, C as Environment, D as GuardrailConfig, E as EnvironmentsTable, F as ProviderConfigsTable, G as VariantVersion, H as TargetingRulesTable, I as ProviderGuardrailOverride, J as WorkspaceSettings, K as VariantVersionsTable, L as ProviderGuardrailOverridesTable, M as LLMRequest, N as LLMRequestsTable, O as GuardrailConfigsTable, P as ProviderConfig, Q as environmentSecretsSchema, R as SCHEMA_METADATA, S as Database, T as EnvironmentSecretsTable, U as Updateable, V as TargetingRule, W as Variant, X as configVariantsSchema, Y as WorkspaceSettingsTable, Z as configsSchema, _ as validateTableData, a as createDatabaseFromConnection, at as targetingRulesSchema, b as ConfigVariantsTable, c as executeWithSchema, ct as workspaceSettingsSchema, d as getMigrations, et as guardrailConfigsSchema, f as matchType, g as validatePartialTableData, h as parseTableData, i as createDatabase, it as schemas, j as Insertable, k as GuardrailResult, l as MigrationOptions, m as parsePartialTableData, n as DatabaseOptions, nt as providerConfigsSchema, o as detectDatabaseType, ot as variantVersionsSchema, p as runAutoMigrations, q as VariantsTable, r as DatabaseType, rt as providerGuardrailOverridesSchema, s as createNeonDialect, st as variantsSchema, t as DatabaseConnection, tt as llmRequestsSchema, u as MigrationResult, v as Config, w as EnvironmentSecret, x as ConfigsTable, y as ConfigVariant, z as Selectable } from "../index-BMN3ZSTf.mjs";
|
|
2
|
+
export { Config, ConfigVariant, ConfigVariantsTable, ConfigsTable, Database, DatabaseConnection, DatabaseOptions, DatabaseType, Environment, EnvironmentSecret, EnvironmentSecretsTable, EnvironmentsTable, GuardrailConfig, GuardrailConfigsTable, GuardrailResult, GuardrailResults, Insertable, LLMRequest, LLMRequestsTable, MigrationOptions, MigrationResult, ProviderConfig, ProviderConfigsTable, ProviderGuardrailOverride, ProviderGuardrailOverridesTable, SCHEMA_METADATA, Selectable, TableName, TargetingRule, TargetingRulesTable, Updateable, Variant, VariantVersion, VariantVersionsTable, VariantsTable, WorkspaceSettings, WorkspaceSettingsTable, configVariantsSchema, configsSchema, createDatabase, createDatabaseFromConnection, createNeonDialect, detectDatabaseType, environmentSecretsSchema, environmentsSchema, executeWithSchema, getMigrations, guardrailConfigsSchema, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, providerConfigsSchema, providerGuardrailOverridesSchema, runAutoMigrations, schemas, targetingRulesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
package/dist/db/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as targetingRulesSchema, E as workspaceSettingsSchema, S as schemas, T as variantsSchema, _ as environmentsSchema, a as matchType, b as providerConfigsSchema, 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 guardrailConfigsSchema, w as variantVersionsSchema, x as providerGuardrailOverridesSchema, y as llmRequestsSchema } from "../db-Bkg85wso.mjs";
|
|
2
2
|
import { n as executeWithSchema, t as createNeonDialect } from "../neon-dialect-DySGBYUi.mjs";
|
|
3
3
|
|
|
4
|
-
export { SCHEMA_METADATA, configVariantsSchema, configsSchema, createDatabase, createDatabaseFromConnection, createNeonDialect, detectDatabaseType, environmentSecretsSchema, environmentsSchema, executeWithSchema, getMigrations, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, providerConfigsSchema, runAutoMigrations, schemas, targetingRulesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
|
4
|
+
export { SCHEMA_METADATA, configVariantsSchema, configsSchema, createDatabase, createDatabaseFromConnection, createNeonDialect, detectDatabaseType, environmentSecretsSchema, environmentsSchema, executeWithSchema, getMigrations, guardrailConfigsSchema, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, providerConfigsSchema, providerGuardrailOverridesSchema, runAutoMigrations, schemas, targetingRulesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
|
@@ -12942,6 +12942,40 @@ const providerConfigsSchema = object({
|
|
|
12942
12942
|
config: record(string$1(), unknown()),
|
|
12943
12943
|
enabled: boolean$1().default(true)
|
|
12944
12944
|
});
|
|
12945
|
+
const guardrailConfigsSchema = object({
|
|
12946
|
+
...baseSchema,
|
|
12947
|
+
name: string$1(),
|
|
12948
|
+
pluginId: string$1(),
|
|
12949
|
+
functionId: string$1(),
|
|
12950
|
+
hookType: _enum(["beforeRequestHook", "afterRequestHook"]),
|
|
12951
|
+
parameters: record(string$1(), unknown()).default({}),
|
|
12952
|
+
enabled: boolean$1().default(true),
|
|
12953
|
+
priority: number$1().int().default(0),
|
|
12954
|
+
onFail: _enum(["block", "log"]).default("block")
|
|
12955
|
+
});
|
|
12956
|
+
const providerGuardrailOverridesSchema = object({
|
|
12957
|
+
...baseSchema,
|
|
12958
|
+
providerConfigId: string$1().uuid(),
|
|
12959
|
+
guardrailConfigId: string$1().uuid(),
|
|
12960
|
+
enabled: boolean$1().default(true),
|
|
12961
|
+
parameters: record(string$1(), unknown()).nullable().optional()
|
|
12962
|
+
});
|
|
12963
|
+
const guardrailResultSchema = object({
|
|
12964
|
+
configId: string$1().uuid(),
|
|
12965
|
+
functionId: string$1(),
|
|
12966
|
+
hookType: _enum(["beforeRequestHook", "afterRequestHook"]),
|
|
12967
|
+
verdict: boolean$1(),
|
|
12968
|
+
latencyMs: number$1()
|
|
12969
|
+
});
|
|
12970
|
+
const guardrailResultsSchema = object({
|
|
12971
|
+
results: array(guardrailResultSchema),
|
|
12972
|
+
action: _enum([
|
|
12973
|
+
"allowed",
|
|
12974
|
+
"blocked",
|
|
12975
|
+
"logged"
|
|
12976
|
+
]),
|
|
12977
|
+
totalLatencyMs: number$1()
|
|
12978
|
+
});
|
|
12945
12979
|
const llmRequestsSchema = object({
|
|
12946
12980
|
...baseSchema,
|
|
12947
12981
|
requestId: string$1().uuid(),
|
|
@@ -12963,7 +12997,8 @@ const llmRequestsSchema = object({
|
|
|
12963
12997
|
latencyMs: number$1().int().default(0),
|
|
12964
12998
|
isStreaming: boolean$1().default(false),
|
|
12965
12999
|
userId: string$1().nullable().optional(),
|
|
12966
|
-
tags: record(string$1(), string$1()).default({})
|
|
13000
|
+
tags: record(string$1(), string$1()).default({}),
|
|
13001
|
+
guardrailResults: guardrailResultsSchema.nullable().optional()
|
|
12967
13002
|
});
|
|
12968
13003
|
/**
|
|
12969
13004
|
* Schema metadata for migrations
|
|
@@ -13268,8 +13303,89 @@ const SCHEMA_METADATA = { tables: {
|
|
|
13268
13303
|
}
|
|
13269
13304
|
}
|
|
13270
13305
|
},
|
|
13271
|
-
|
|
13306
|
+
guardrail_configs: {
|
|
13272
13307
|
order: 10,
|
|
13308
|
+
schema: guardrailConfigsSchema,
|
|
13309
|
+
fields: {
|
|
13310
|
+
id: {
|
|
13311
|
+
type: "uuid",
|
|
13312
|
+
primaryKey: true
|
|
13313
|
+
},
|
|
13314
|
+
name: { type: "text" },
|
|
13315
|
+
pluginId: { type: "text" },
|
|
13316
|
+
functionId: { type: "text" },
|
|
13317
|
+
hookType: { type: "text" },
|
|
13318
|
+
parameters: {
|
|
13319
|
+
type: "jsonb",
|
|
13320
|
+
default: "{}"
|
|
13321
|
+
},
|
|
13322
|
+
enabled: {
|
|
13323
|
+
type: "boolean",
|
|
13324
|
+
default: true
|
|
13325
|
+
},
|
|
13326
|
+
priority: {
|
|
13327
|
+
type: "integer",
|
|
13328
|
+
default: 0
|
|
13329
|
+
},
|
|
13330
|
+
onFail: {
|
|
13331
|
+
type: "text",
|
|
13332
|
+
default: "block"
|
|
13333
|
+
},
|
|
13334
|
+
createdAt: {
|
|
13335
|
+
type: "timestamp",
|
|
13336
|
+
default: "now()"
|
|
13337
|
+
},
|
|
13338
|
+
updatedAt: {
|
|
13339
|
+
type: "timestamp",
|
|
13340
|
+
default: "now()",
|
|
13341
|
+
onUpdate: "now()"
|
|
13342
|
+
}
|
|
13343
|
+
}
|
|
13344
|
+
},
|
|
13345
|
+
provider_guardrail_overrides: {
|
|
13346
|
+
order: 11,
|
|
13347
|
+
schema: providerGuardrailOverridesSchema,
|
|
13348
|
+
fields: {
|
|
13349
|
+
id: {
|
|
13350
|
+
type: "uuid",
|
|
13351
|
+
primaryKey: true
|
|
13352
|
+
},
|
|
13353
|
+
providerConfigId: {
|
|
13354
|
+
type: "uuid",
|
|
13355
|
+
references: {
|
|
13356
|
+
table: "provider_configs",
|
|
13357
|
+
column: "id"
|
|
13358
|
+
}
|
|
13359
|
+
},
|
|
13360
|
+
guardrailConfigId: {
|
|
13361
|
+
type: "uuid",
|
|
13362
|
+
references: {
|
|
13363
|
+
table: "guardrail_configs",
|
|
13364
|
+
column: "id"
|
|
13365
|
+
}
|
|
13366
|
+
},
|
|
13367
|
+
enabled: {
|
|
13368
|
+
type: "boolean",
|
|
13369
|
+
default: true
|
|
13370
|
+
},
|
|
13371
|
+
parameters: {
|
|
13372
|
+
type: "jsonb",
|
|
13373
|
+
nullable: true
|
|
13374
|
+
},
|
|
13375
|
+
createdAt: {
|
|
13376
|
+
type: "timestamp",
|
|
13377
|
+
default: "now()"
|
|
13378
|
+
},
|
|
13379
|
+
updatedAt: {
|
|
13380
|
+
type: "timestamp",
|
|
13381
|
+
default: "now()",
|
|
13382
|
+
onUpdate: "now()"
|
|
13383
|
+
}
|
|
13384
|
+
},
|
|
13385
|
+
uniqueConstraints: [{ columns: ["providerConfigId", "guardrailConfigId"] }]
|
|
13386
|
+
},
|
|
13387
|
+
llm_requests: {
|
|
13388
|
+
order: 12,
|
|
13273
13389
|
schema: llmRequestsSchema,
|
|
13274
13390
|
fields: {
|
|
13275
13391
|
id: {
|
|
@@ -13357,6 +13473,10 @@ const SCHEMA_METADATA = { tables: {
|
|
|
13357
13473
|
type: "jsonb",
|
|
13358
13474
|
default: "{}"
|
|
13359
13475
|
},
|
|
13476
|
+
guardrailResults: {
|
|
13477
|
+
type: "jsonb",
|
|
13478
|
+
nullable: true
|
|
13479
|
+
},
|
|
13360
13480
|
createdAt: {
|
|
13361
13481
|
type: "timestamp",
|
|
13362
13482
|
default: "now()"
|
|
@@ -13382,6 +13502,8 @@ const schemas = {
|
|
|
13382
13502
|
targeting_rules: targetingRulesSchema,
|
|
13383
13503
|
workspace_settings: workspaceSettingsSchema,
|
|
13384
13504
|
provider_configs: providerConfigsSchema,
|
|
13505
|
+
guardrail_configs: guardrailConfigsSchema,
|
|
13506
|
+
provider_guardrail_overrides: providerGuardrailOverridesSchema,
|
|
13385
13507
|
llm_requests: llmRequestsSchema
|
|
13386
13508
|
};
|
|
13387
13509
|
|
|
@@ -13876,4 +13998,4 @@ async function createDatabaseFromConnection(rawConnection, options) {
|
|
|
13876
13998
|
}
|
|
13877
13999
|
|
|
13878
14000
|
//#endregion
|
|
13879
|
-
export {
|
|
14001
|
+
export { array as A, targetingRulesSchema as C, zod_default as D, workspaceSettingsSchema as E, record as F, string$1 as I, union as L, literal as M, number$1 as N, _enum as O, object as P, unknown as R, schemas as S, variantsSchema as T, environmentsSchema as _, matchType as a, providerConfigsSchema as b, logger as c, validatePartialTableData as d, validateTableData as f, environmentSecretsSchema as g, configsSchema as h, getMigrations$1 as i, boolean$1 as j, any as k, parsePartialTableData as l, configVariantsSchema as m, createDatabaseFromConnection as n, runAutoMigrations as o, SCHEMA_METADATA as p, detectDatabaseType as r, getAuthClientOptions as s, createDatabase as t, parseTableData as u, guardrailConfigsSchema as v, variantVersionsSchema as w, providerGuardrailOverridesSchema as x, llmRequestsSchema as y };
|
|
@@ -12966,6 +12966,40 @@ const providerConfigsSchema = object({
|
|
|
12966
12966
|
config: record(string$1(), unknown()),
|
|
12967
12967
|
enabled: boolean$1().default(true)
|
|
12968
12968
|
});
|
|
12969
|
+
const guardrailConfigsSchema = object({
|
|
12970
|
+
...baseSchema,
|
|
12971
|
+
name: string$1(),
|
|
12972
|
+
pluginId: string$1(),
|
|
12973
|
+
functionId: string$1(),
|
|
12974
|
+
hookType: _enum(["beforeRequestHook", "afterRequestHook"]),
|
|
12975
|
+
parameters: record(string$1(), unknown()).default({}),
|
|
12976
|
+
enabled: boolean$1().default(true),
|
|
12977
|
+
priority: number$1().int().default(0),
|
|
12978
|
+
onFail: _enum(["block", "log"]).default("block")
|
|
12979
|
+
});
|
|
12980
|
+
const providerGuardrailOverridesSchema = object({
|
|
12981
|
+
...baseSchema,
|
|
12982
|
+
providerConfigId: string$1().uuid(),
|
|
12983
|
+
guardrailConfigId: string$1().uuid(),
|
|
12984
|
+
enabled: boolean$1().default(true),
|
|
12985
|
+
parameters: record(string$1(), unknown()).nullable().optional()
|
|
12986
|
+
});
|
|
12987
|
+
const guardrailResultSchema = object({
|
|
12988
|
+
configId: string$1().uuid(),
|
|
12989
|
+
functionId: string$1(),
|
|
12990
|
+
hookType: _enum(["beforeRequestHook", "afterRequestHook"]),
|
|
12991
|
+
verdict: boolean$1(),
|
|
12992
|
+
latencyMs: number$1()
|
|
12993
|
+
});
|
|
12994
|
+
const guardrailResultsSchema = object({
|
|
12995
|
+
results: array(guardrailResultSchema),
|
|
12996
|
+
action: _enum([
|
|
12997
|
+
"allowed",
|
|
12998
|
+
"blocked",
|
|
12999
|
+
"logged"
|
|
13000
|
+
]),
|
|
13001
|
+
totalLatencyMs: number$1()
|
|
13002
|
+
});
|
|
12969
13003
|
const llmRequestsSchema = object({
|
|
12970
13004
|
...baseSchema,
|
|
12971
13005
|
requestId: string$1().uuid(),
|
|
@@ -12987,7 +13021,8 @@ const llmRequestsSchema = object({
|
|
|
12987
13021
|
latencyMs: number$1().int().default(0),
|
|
12988
13022
|
isStreaming: boolean$1().default(false),
|
|
12989
13023
|
userId: string$1().nullable().optional(),
|
|
12990
|
-
tags: record(string$1(), string$1()).default({})
|
|
13024
|
+
tags: record(string$1(), string$1()).default({}),
|
|
13025
|
+
guardrailResults: guardrailResultsSchema.nullable().optional()
|
|
12991
13026
|
});
|
|
12992
13027
|
/**
|
|
12993
13028
|
* Schema metadata for migrations
|
|
@@ -13292,8 +13327,89 @@ const SCHEMA_METADATA = { tables: {
|
|
|
13292
13327
|
}
|
|
13293
13328
|
}
|
|
13294
13329
|
},
|
|
13295
|
-
|
|
13330
|
+
guardrail_configs: {
|
|
13296
13331
|
order: 10,
|
|
13332
|
+
schema: guardrailConfigsSchema,
|
|
13333
|
+
fields: {
|
|
13334
|
+
id: {
|
|
13335
|
+
type: "uuid",
|
|
13336
|
+
primaryKey: true
|
|
13337
|
+
},
|
|
13338
|
+
name: { type: "text" },
|
|
13339
|
+
pluginId: { type: "text" },
|
|
13340
|
+
functionId: { type: "text" },
|
|
13341
|
+
hookType: { type: "text" },
|
|
13342
|
+
parameters: {
|
|
13343
|
+
type: "jsonb",
|
|
13344
|
+
default: "{}"
|
|
13345
|
+
},
|
|
13346
|
+
enabled: {
|
|
13347
|
+
type: "boolean",
|
|
13348
|
+
default: true
|
|
13349
|
+
},
|
|
13350
|
+
priority: {
|
|
13351
|
+
type: "integer",
|
|
13352
|
+
default: 0
|
|
13353
|
+
},
|
|
13354
|
+
onFail: {
|
|
13355
|
+
type: "text",
|
|
13356
|
+
default: "block"
|
|
13357
|
+
},
|
|
13358
|
+
createdAt: {
|
|
13359
|
+
type: "timestamp",
|
|
13360
|
+
default: "now()"
|
|
13361
|
+
},
|
|
13362
|
+
updatedAt: {
|
|
13363
|
+
type: "timestamp",
|
|
13364
|
+
default: "now()",
|
|
13365
|
+
onUpdate: "now()"
|
|
13366
|
+
}
|
|
13367
|
+
}
|
|
13368
|
+
},
|
|
13369
|
+
provider_guardrail_overrides: {
|
|
13370
|
+
order: 11,
|
|
13371
|
+
schema: providerGuardrailOverridesSchema,
|
|
13372
|
+
fields: {
|
|
13373
|
+
id: {
|
|
13374
|
+
type: "uuid",
|
|
13375
|
+
primaryKey: true
|
|
13376
|
+
},
|
|
13377
|
+
providerConfigId: {
|
|
13378
|
+
type: "uuid",
|
|
13379
|
+
references: {
|
|
13380
|
+
table: "provider_configs",
|
|
13381
|
+
column: "id"
|
|
13382
|
+
}
|
|
13383
|
+
},
|
|
13384
|
+
guardrailConfigId: {
|
|
13385
|
+
type: "uuid",
|
|
13386
|
+
references: {
|
|
13387
|
+
table: "guardrail_configs",
|
|
13388
|
+
column: "id"
|
|
13389
|
+
}
|
|
13390
|
+
},
|
|
13391
|
+
enabled: {
|
|
13392
|
+
type: "boolean",
|
|
13393
|
+
default: true
|
|
13394
|
+
},
|
|
13395
|
+
parameters: {
|
|
13396
|
+
type: "jsonb",
|
|
13397
|
+
nullable: true
|
|
13398
|
+
},
|
|
13399
|
+
createdAt: {
|
|
13400
|
+
type: "timestamp",
|
|
13401
|
+
default: "now()"
|
|
13402
|
+
},
|
|
13403
|
+
updatedAt: {
|
|
13404
|
+
type: "timestamp",
|
|
13405
|
+
default: "now()",
|
|
13406
|
+
onUpdate: "now()"
|
|
13407
|
+
}
|
|
13408
|
+
},
|
|
13409
|
+
uniqueConstraints: [{ columns: ["providerConfigId", "guardrailConfigId"] }]
|
|
13410
|
+
},
|
|
13411
|
+
llm_requests: {
|
|
13412
|
+
order: 12,
|
|
13297
13413
|
schema: llmRequestsSchema,
|
|
13298
13414
|
fields: {
|
|
13299
13415
|
id: {
|
|
@@ -13381,6 +13497,10 @@ const SCHEMA_METADATA = { tables: {
|
|
|
13381
13497
|
type: "jsonb",
|
|
13382
13498
|
default: "{}"
|
|
13383
13499
|
},
|
|
13500
|
+
guardrailResults: {
|
|
13501
|
+
type: "jsonb",
|
|
13502
|
+
nullable: true
|
|
13503
|
+
},
|
|
13384
13504
|
createdAt: {
|
|
13385
13505
|
type: "timestamp",
|
|
13386
13506
|
default: "now()"
|
|
@@ -13406,6 +13526,8 @@ const schemas = {
|
|
|
13406
13526
|
targeting_rules: targetingRulesSchema,
|
|
13407
13527
|
workspace_settings: workspaceSettingsSchema,
|
|
13408
13528
|
provider_configs: providerConfigsSchema,
|
|
13529
|
+
guardrail_configs: guardrailConfigsSchema,
|
|
13530
|
+
provider_guardrail_overrides: providerGuardrailOverridesSchema,
|
|
13409
13531
|
llm_requests: llmRequestsSchema
|
|
13410
13532
|
};
|
|
13411
13533
|
|
|
@@ -13854,12 +13976,12 @@ async function createDatabaseFromConnection(rawConnection, options) {
|
|
|
13854
13976
|
case "sqlite":
|
|
13855
13977
|
if ("aggregate" in rawConnection && !("createSession" in rawConnection)) dialect = new kysely.SqliteDialect({ database: rawConnection });
|
|
13856
13978
|
else if ("fileControl" in rawConnection) {
|
|
13857
|
-
const { BunSqliteDialect } = await Promise.resolve().then(() => require("./bun-sqlite-dialect-
|
|
13979
|
+
const { BunSqliteDialect } = await Promise.resolve().then(() => require("./bun-sqlite-dialect-B5rfiYIH.cjs"));
|
|
13858
13980
|
dialect = new BunSqliteDialect({ database: rawConnection });
|
|
13859
13981
|
} else if ("createSession" in rawConnection && typeof window === "undefined") try {
|
|
13860
13982
|
const { DatabaseSync } = await import("node:sqlite");
|
|
13861
13983
|
if (rawConnection instanceof DatabaseSync) {
|
|
13862
|
-
const { NodeSqliteDialect } = await Promise.resolve().then(() => require("./node-sqlite-dialect-
|
|
13984
|
+
const { NodeSqliteDialect } = await Promise.resolve().then(() => require("./node-sqlite-dialect-uTc3IyPv.cjs"));
|
|
13863
13985
|
dialect = new NodeSqliteDialect({ database: rawConnection });
|
|
13864
13986
|
}
|
|
13865
13987
|
} catch {}
|
|
@@ -13888,7 +14010,7 @@ async function createDatabaseFromConnection(rawConnection, options) {
|
|
|
13888
14010
|
}
|
|
13889
14011
|
});
|
|
13890
14012
|
} else {
|
|
13891
|
-
const { createNeonDialect } = await Promise.resolve().then(() => require("./neon-dialect-
|
|
14013
|
+
const { createNeonDialect } = await Promise.resolve().then(() => require("./neon-dialect-q-8lApt2.cjs"));
|
|
13892
14014
|
dialect = createNeonDialect(rawConnection);
|
|
13893
14015
|
}
|
|
13894
14016
|
break;
|
|
@@ -13990,6 +14112,12 @@ Object.defineProperty(exports, 'getMigrations', {
|
|
|
13990
14112
|
return getMigrations;
|
|
13991
14113
|
}
|
|
13992
14114
|
});
|
|
14115
|
+
Object.defineProperty(exports, 'guardrailConfigsSchema', {
|
|
14116
|
+
enumerable: true,
|
|
14117
|
+
get: function () {
|
|
14118
|
+
return guardrailConfigsSchema;
|
|
14119
|
+
}
|
|
14120
|
+
});
|
|
13993
14121
|
Object.defineProperty(exports, 'literal', {
|
|
13994
14122
|
enumerable: true,
|
|
13995
14123
|
get: function () {
|
|
@@ -14044,6 +14172,12 @@ Object.defineProperty(exports, 'providerConfigsSchema', {
|
|
|
14044
14172
|
return providerConfigsSchema;
|
|
14045
14173
|
}
|
|
14046
14174
|
});
|
|
14175
|
+
Object.defineProperty(exports, 'providerGuardrailOverridesSchema', {
|
|
14176
|
+
enumerable: true,
|
|
14177
|
+
get: function () {
|
|
14178
|
+
return providerGuardrailOverridesSchema;
|
|
14179
|
+
}
|
|
14180
|
+
});
|
|
14047
14181
|
Object.defineProperty(exports, 'record', {
|
|
14048
14182
|
enumerable: true,
|
|
14049
14183
|
get: function () {
|