@inkeep/agents-core 0.36.0 → 0.37.0
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/auth/auth-validation-schemas.js +17 -17
- package/dist/auth/auth.d.ts +29 -4
- package/dist/auth/auth.js +37 -5
- package/dist/{chunk-OEHP46F7.js → chunk-32YRH2S7.js} +67 -63
- package/dist/chunk-CUM6BY2Y.js +320 -0
- package/dist/{chunk-4OISWRFK.js → chunk-ICZLNCX7.js} +49 -30
- package/dist/{chunk-FOK3JSQN.js → chunk-MB2ZIPZS.js} +5 -5
- package/dist/chunk-OUXC23J7.js +12534 -0
- package/dist/{chunk-4RVJB4KV.js → chunk-Q5U2SVA6.js} +7 -8
- package/dist/{chunk-KMLLKRUY.js → chunk-SLQW43IV.js} +5 -4
- package/dist/{chunk-7GZHUB4J.js → chunk-SSRRHYU4.js} +5 -4
- package/dist/{chunk-ZCEKN54E.js → chunk-VQXQOGJU.js} +314 -312
- package/dist/{client-HrEgt7wv.d.ts → client-CnpNkGsH.d.ts} +1 -1
- package/dist/client-exports.d.ts +2 -2
- package/dist/client-exports.js +126 -125
- package/dist/constants/schema-validation/index.js +1 -1
- package/dist/credential-stores/index.d.ts +1 -1
- package/dist/credential-stores/index.js +1 -1
- package/dist/db/schema.d.ts +2 -2
- package/dist/db/test-client.d.ts +3 -3
- package/dist/index.d.ts +23 -6
- package/dist/index.js +16 -14
- package/dist/{schema-CoC3tYFX.d.ts → schema-Cgkp_geg.d.ts} +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/{utility-C4QAannk.d.ts → utility-C_tTZ7-k.d.ts} +5 -0
- package/dist/utils/schema-conversion.js +1 -1
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +2 -2
- package/package.json +4 -8
|
@@ -1,12 +1,11 @@
|
|
|
1
|
+
import { external_exports } from './chunk-OUXC23J7.js';
|
|
1
2
|
import fs from 'fs';
|
|
2
3
|
import os from 'os';
|
|
3
4
|
import path from 'path';
|
|
4
5
|
import dotenv from 'dotenv';
|
|
5
6
|
import { expand } from 'dotenv-expand';
|
|
6
7
|
import { findUpSync } from 'find-up';
|
|
7
|
-
import { z } from 'zod';
|
|
8
8
|
|
|
9
|
-
// src/env.ts
|
|
10
9
|
var loadEnvironmentFiles = () => {
|
|
11
10
|
const environmentFiles = [];
|
|
12
11
|
const currentEnv = path.resolve(process.cwd(), ".env");
|
|
@@ -33,18 +32,18 @@ var loadEnvironmentFiles = () => {
|
|
|
33
32
|
}
|
|
34
33
|
};
|
|
35
34
|
loadEnvironmentFiles();
|
|
36
|
-
var envSchema =
|
|
37
|
-
ENVIRONMENT:
|
|
38
|
-
DATABASE_URL:
|
|
39
|
-
POSTGRES_POOL_SIZE:
|
|
40
|
-
INKEEP_AGENTS_JWT_SIGNING_SECRET:
|
|
35
|
+
var envSchema = external_exports.object({
|
|
36
|
+
ENVIRONMENT: external_exports.enum(["development", "production", "pentest", "test"]).optional(),
|
|
37
|
+
DATABASE_URL: external_exports.string().optional(),
|
|
38
|
+
POSTGRES_POOL_SIZE: external_exports.string().optional(),
|
|
39
|
+
INKEEP_AGENTS_JWT_SIGNING_SECRET: external_exports.string().min(32, "INKEEP_AGENTS_JWT_SIGNING_SECRET must be at least 32 characters").optional()
|
|
41
40
|
});
|
|
42
41
|
var parseEnv = () => {
|
|
43
42
|
try {
|
|
44
43
|
const parsedEnv = envSchema.parse(process.env);
|
|
45
44
|
return parsedEnv;
|
|
46
45
|
} catch (error) {
|
|
47
|
-
if (error instanceof
|
|
46
|
+
if (error instanceof external_exports.ZodError) {
|
|
48
47
|
const missingVars = error.issues.map((issue) => issue.path.join("."));
|
|
49
48
|
throw new Error(
|
|
50
49
|
`\u274C Invalid environment variables: ${missingVars.join(", ")}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { schemaValidationDefaults } from './chunk-Z64UK4CA.js';
|
|
2
|
-
import { loadEnvironmentFiles } from './chunk-
|
|
3
|
-
import {
|
|
2
|
+
import { loadEnvironmentFiles } from './chunk-Q5U2SVA6.js';
|
|
3
|
+
import { external_exports } from './chunk-OUXC23J7.js';
|
|
4
4
|
|
|
5
|
+
// src/constants/schema-validation/index.ts
|
|
5
6
|
loadEnvironmentFiles();
|
|
6
|
-
var constantsSchema =
|
|
7
|
+
var constantsSchema = external_exports.object(
|
|
7
8
|
Object.fromEntries(
|
|
8
9
|
Object.keys(schemaValidationDefaults).map((key) => [
|
|
9
10
|
`AGENTS_${key}`,
|
|
10
|
-
|
|
11
|
+
external_exports.coerce.number().optional()
|
|
11
12
|
])
|
|
12
13
|
)
|
|
13
14
|
);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { getLogger } from './chunk-DN4B564Y.js';
|
|
2
|
-
import {
|
|
2
|
+
import { external_exports } from './chunk-OUXC23J7.js';
|
|
3
3
|
|
|
4
|
+
// src/utils/schema-conversion.ts
|
|
4
5
|
var logger = getLogger("schema-conversion");
|
|
5
6
|
function convertZodToJsonSchema(zodSchema) {
|
|
6
7
|
try {
|
|
7
|
-
const jsonSchema =
|
|
8
|
+
const jsonSchema = external_exports.toJSONSchema(zodSchema);
|
|
8
9
|
if (jsonSchema.$schema) {
|
|
9
10
|
delete jsonSchema.$schema;
|
|
10
11
|
}
|
|
@@ -26,7 +27,7 @@ var preview = (schema) => {
|
|
|
26
27
|
};
|
|
27
28
|
function convertZodToJsonSchemaWithPreview(zodSchema) {
|
|
28
29
|
const jsonSchema = convertZodToJsonSchema(zodSchema);
|
|
29
|
-
if (zodSchema instanceof
|
|
30
|
+
if (zodSchema instanceof external_exports.ZodObject && jsonSchema.properties) {
|
|
30
31
|
const shape = zodSchema.shape;
|
|
31
32
|
for (const [key, fieldSchema] of Object.entries(shape)) {
|
|
32
33
|
if (fieldSchema?._def?.inPreview === true) {
|
|
@@ -41,7 +42,7 @@ function isZodSchema(value) {
|
|
|
41
42
|
}
|
|
42
43
|
function extractPreviewFields(schema) {
|
|
43
44
|
const previewFields = [];
|
|
44
|
-
if (schema instanceof
|
|
45
|
+
if (schema instanceof external_exports.ZodObject) {
|
|
45
46
|
const shape = schema.shape;
|
|
46
47
|
for (const [key, fieldSchema] of Object.entries(shape)) {
|
|
47
48
|
if (fieldSchema?._def?.inPreview === true) {
|