@eventcatalog/core 2.35.7 → 2.35.9
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/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/catalog-to-astro-content-directory.cjs +3 -0
- package/dist/catalog-to-astro-content-directory.js +1 -1
- package/dist/{chunk-ZEIS5QXO.js → chunk-K2XHQGHN.js} +1 -1
- package/dist/{chunk-GRFWCJAM.js → chunk-KEOGLT6Y.js} +1 -1
- package/dist/{chunk-O7CEYSZC.js → chunk-RKOF335E.js} +1 -1
- package/dist/{chunk-5ZG43YD2.js → chunk-SLEMYHTU.js} +3 -0
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +4 -1
- package/dist/eventcatalog.js +4 -4
- package/eventcatalog/src/enterprise/eventcatalog-chat/EventCatalogVectorStore.ts +15 -1
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/windows/ChatWindow.client.tsx +1 -1
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/windows/ChatWindow.server.tsx +6 -2
- package/eventcatalog/src/enterprise/eventcatalog-chat/pages/api/ai/chat.ts +0 -2
- package/eventcatalog/src/enterprise/eventcatalog-chat/pages/chat/index.astro +13 -1
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +5 -0
- package/eventcatalog/src/utils/generators/index.ts +10 -0
- package/package.json +3 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-K2XHQGHN.js";
|
|
4
|
+
import "../chunk-KEOGLT6Y.js";
|
|
5
|
+
import "../chunk-RKOF335E.js";
|
|
6
6
|
import "../chunk-E7TXTI7G.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
|
@@ -221,6 +221,9 @@ var catalogToAstro = async (source, astroDir) => {
|
|
|
221
221
|
if (import_fs.default.existsSync(astroContentDir)) import_fs.default.rmSync(astroContentDir, { recursive: true });
|
|
222
222
|
import_fs.default.mkdirSync(astroContentDir);
|
|
223
223
|
await verifyRequiredFieldsAreInCatalogConfigFile(source);
|
|
224
|
+
if (!import_fs.default.existsSync(path3.join(source, "eventcatalog.styles.css"))) {
|
|
225
|
+
import_fs.default.writeFileSync(path3.join(source, "eventcatalog.styles.css"), "");
|
|
226
|
+
}
|
|
224
227
|
await copyFiles(source, astroDir);
|
|
225
228
|
};
|
|
226
229
|
var checkAndConvertMdToMdx = async (source, astroDir) => {
|
|
@@ -38,6 +38,9 @@ var catalogToAstro = async (source, astroDir) => {
|
|
|
38
38
|
if (fs.existsSync(astroContentDir)) fs.rmSync(astroContentDir, { recursive: true });
|
|
39
39
|
fs.mkdirSync(astroContentDir);
|
|
40
40
|
await verifyRequiredFieldsAreInCatalogConfigFile(source);
|
|
41
|
+
if (!fs.existsSync(path.join(source, "eventcatalog.styles.css"))) {
|
|
42
|
+
fs.writeFileSync(path.join(source, "eventcatalog.styles.css"), "");
|
|
43
|
+
}
|
|
41
44
|
await copyFiles(source, astroDir);
|
|
42
45
|
};
|
|
43
46
|
var checkAndConvertMdToMdx = async (source, astroDir) => {
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -157,7 +157,7 @@ var import_axios = __toESM(require("axios"), 1);
|
|
|
157
157
|
var import_os = __toESM(require("os"), 1);
|
|
158
158
|
|
|
159
159
|
// package.json
|
|
160
|
-
var version = "2.35.
|
|
160
|
+
var version = "2.35.9";
|
|
161
161
|
|
|
162
162
|
// src/constants.ts
|
|
163
163
|
var VERSION = version;
|
|
@@ -412,6 +412,9 @@ var catalogToAstro = async (source, astroDir) => {
|
|
|
412
412
|
if (import_fs.default.existsSync(astroContentDir)) import_fs.default.rmSync(astroContentDir, { recursive: true });
|
|
413
413
|
import_fs.default.mkdirSync(astroContentDir);
|
|
414
414
|
await verifyRequiredFieldsAreInCatalogConfigFile(source);
|
|
415
|
+
if (!import_fs.default.existsSync(path5.join(source, "eventcatalog.styles.css"))) {
|
|
416
|
+
import_fs.default.writeFileSync(path5.join(source, "eventcatalog.styles.css"), "");
|
|
417
|
+
}
|
|
415
418
|
await copyFiles(source, astroDir);
|
|
416
419
|
};
|
|
417
420
|
var checkAndConvertMdToMdx = async (source, astroDir) => {
|
package/dist/eventcatalog.js
CHANGED
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
} from "./chunk-DCLTVJDP.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-K2XHQGHN.js";
|
|
10
|
+
import "./chunk-KEOGLT6Y.js";
|
|
11
11
|
import {
|
|
12
12
|
catalogToAstro,
|
|
13
13
|
checkAndConvertMdToMdx
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-SLEMYHTU.js";
|
|
15
15
|
import {
|
|
16
16
|
VERSION
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RKOF335E.js";
|
|
18
18
|
import {
|
|
19
19
|
isBackstagePluginEnabled,
|
|
20
20
|
isEventCatalogScaleEnabled,
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { HuggingFaceTransformersEmbeddings } from '@langchain/community/embeddings/huggingface_transformers';
|
|
2
2
|
import { MemoryVectorStore } from 'langchain/vectorstores/memory';
|
|
3
3
|
import { Document as LangChainDocument } from 'langchain/document';
|
|
4
|
+
import { OpenAIEmbeddings } from '@langchain/openai';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
import { getConfigurationForGivenGenerator } from '@utils/generators';
|
|
7
|
+
|
|
8
|
+
const aiGeneratorConfiguration = getConfigurationForGivenGenerator('@eventcatalog/generator-ai');
|
|
9
|
+
const embedding = aiGeneratorConfiguration?.embedding || {};
|
|
6
10
|
|
|
7
11
|
export interface Resource {
|
|
8
12
|
id: string;
|
|
@@ -21,6 +25,16 @@ export class EventCatalogVectorStore {
|
|
|
21
25
|
|
|
22
26
|
// Static async factory method
|
|
23
27
|
public static async create(documents: LangChainDocument[], embeddings: number[][]): Promise<EventCatalogVectorStore> {
|
|
28
|
+
let embeddingsInstance: any;
|
|
29
|
+
|
|
30
|
+
if (embedding.provider === 'openai') {
|
|
31
|
+
const model = embedding.model || 'text-embedding-3-large';
|
|
32
|
+
embeddingsInstance = new OpenAIEmbeddings({ model });
|
|
33
|
+
} else {
|
|
34
|
+
const model = embedding.model || 'all-MiniLM-L6-v2';
|
|
35
|
+
embeddingsInstance = new HuggingFaceTransformersEmbeddings({ model });
|
|
36
|
+
}
|
|
37
|
+
|
|
24
38
|
const vectorStore = new MemoryVectorStore(embeddingsInstance);
|
|
25
39
|
await vectorStore.addVectors(embeddings, documents);
|
|
26
40
|
return new EventCatalogVectorStore(vectorStore);
|
package/eventcatalog/src/enterprise/eventcatalog-chat/components/windows/ChatWindow.client.tsx
CHANGED
|
@@ -511,7 +511,7 @@ const ChatWindow = ({
|
|
|
511
511
|
<div className="max-w-[900px] mx-auto flex justify-between">
|
|
512
512
|
{/* show what model is loaded */}
|
|
513
513
|
<p className="text-xs text-gray-400 mt-2">Model: {model}</p>
|
|
514
|
-
<p className="text-xs text-gray-500 mt-2">EventCatalog
|
|
514
|
+
<p className="text-xs text-gray-500 mt-2">EventCatalog Chat can make mistakes. Check important info.</p>
|
|
515
515
|
</div>
|
|
516
516
|
</div>
|
|
517
517
|
</div>
|
package/eventcatalog/src/enterprise/eventcatalog-chat/components/windows/ChatWindow.server.tsx
CHANGED
|
@@ -20,6 +20,7 @@ interface Resource {
|
|
|
20
20
|
|
|
21
21
|
interface ChatWindowProps {
|
|
22
22
|
model?: string;
|
|
23
|
+
embeddingModel?: string;
|
|
23
24
|
max_tokens?: number;
|
|
24
25
|
similarityResults?: number;
|
|
25
26
|
resources: Resource[];
|
|
@@ -28,6 +29,7 @@ interface ChatWindowProps {
|
|
|
28
29
|
|
|
29
30
|
const ChatWindow = ({
|
|
30
31
|
model = 'o4-mini',
|
|
32
|
+
embeddingModel = 'text-embedding-3-large',
|
|
31
33
|
max_tokens = 4096,
|
|
32
34
|
similarityResults = 50,
|
|
33
35
|
resources: mentionInputResources = [],
|
|
@@ -478,8 +480,10 @@ const ChatWindow = ({
|
|
|
478
480
|
</div>
|
|
479
481
|
<div className="max-w-[900px] mx-auto flex justify-between">
|
|
480
482
|
{/* show what model is loaded */}
|
|
481
|
-
<p className="text-xs text-gray-400 mt-2">
|
|
482
|
-
|
|
483
|
+
<p className="text-xs text-gray-400 mt-2">
|
|
484
|
+
Model: {model}, Embedding Model: {embeddingModel}
|
|
485
|
+
</p>
|
|
486
|
+
<p className="text-xs text-gray-500 mt-2">EventCatalog Chat can make mistakes. Check important info.</p>
|
|
483
487
|
</div>
|
|
484
488
|
</div>
|
|
485
489
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { APIContext } from 'astro';
|
|
2
2
|
import { askQuestion } from '@enterprise/eventcatalog-chat/utils/ai';
|
|
3
|
-
import config from '@config';
|
|
4
|
-
const output = config.output || 'static';
|
|
5
3
|
|
|
6
4
|
// Map the Keys to use in the SDK, astro exports as import.meta.env
|
|
7
5
|
process.env.OPENAI_API_KEY = import.meta.env.OPENAI_API_KEY || '';
|
|
@@ -11,10 +11,19 @@ import { getEvents } from '@utils/events';
|
|
|
11
11
|
import { getCommands } from '@utils/commands';
|
|
12
12
|
import { getServices } from '@utils/collections/services';
|
|
13
13
|
import { getQueries } from '@utils/queries';
|
|
14
|
+
import { getConfigurationForGivenGenerator } from '@utils/generators';
|
|
15
|
+
|
|
14
16
|
const isEnabled = config.chat?.enabled || false;
|
|
15
17
|
const chatConfig = config.chat || {};
|
|
16
18
|
const output = config.output || 'static';
|
|
17
19
|
|
|
20
|
+
const aiGeneratorConfig = getConfigurationForGivenGenerator('@eventcatalog/generator-ai');
|
|
21
|
+
let embeddingModel = aiGeneratorConfig?.embedding?.model || 'all-MiniLM-L6-v2';
|
|
22
|
+
|
|
23
|
+
if (aiGeneratorConfig?.embedding?.provider === 'openai') {
|
|
24
|
+
embeddingModel = aiGeneratorConfig?.embedding?.model || 'text-embedding-3-large';
|
|
25
|
+
}
|
|
26
|
+
|
|
18
27
|
const PROJECT_DIR = path.resolve(process.env.PROJECT_DIR || process.cwd());
|
|
19
28
|
const GENERATED_AI_DIR = path.resolve(PROJECT_DIR, 'public/ai');
|
|
20
29
|
|
|
@@ -68,7 +77,10 @@ const generatorConfig = `
|
|
|
68
77
|
<div id="chatContainer" class="w-full">
|
|
69
78
|
<Chat
|
|
70
79
|
client:only="react"
|
|
71
|
-
chatConfig={
|
|
80
|
+
chatConfig={{
|
|
81
|
+
...chatConfig,
|
|
82
|
+
embeddingModel,
|
|
83
|
+
}}
|
|
72
84
|
resources={resources}
|
|
73
85
|
chatPrompts={chatPrompts}
|
|
74
86
|
output={output as 'static' | 'server'}
|
|
@@ -45,6 +45,11 @@ const customDocs = await getCollection('customPages');
|
|
|
45
45
|
|
|
46
46
|
import { isEventCatalogUpgradeEnabled } from '@utils/feature';
|
|
47
47
|
|
|
48
|
+
// Try and load any custom styles if they exist
|
|
49
|
+
try {
|
|
50
|
+
await import('../../eventcatalog.styles.css');
|
|
51
|
+
} catch (error) {}
|
|
52
|
+
|
|
48
53
|
const currentPath = Astro.url.pathname;
|
|
49
54
|
|
|
50
55
|
const catalogHasDefaultLandingPageForDocs = await hasLandingPageForDocs();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Should really only be used on the server side
|
|
2
|
+
// If users are using path or fs in the eventcatalog.config.js file, it will break the build (for now)
|
|
3
|
+
|
|
4
|
+
import config from '@config';
|
|
5
|
+
|
|
6
|
+
export const getConfigurationForGivenGenerator = (generator: string) => {
|
|
7
|
+
const generators = config.generators ?? [];
|
|
8
|
+
const generatorConfig = generators.find((g: any) => g[0] === generator);
|
|
9
|
+
return generatorConfig?.[1];
|
|
10
|
+
};
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/event-catalog/eventcatalog.git"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
|
-
"version": "2.35.
|
|
9
|
+
"version": "2.35.9",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@asyncapi/avro-schema-parser": "^3.0.24",
|
|
32
32
|
"@asyncapi/parser": "^3.4.0",
|
|
33
33
|
"@asyncapi/react-component": "^2.4.3",
|
|
34
|
-
"@eventcatalog/generator-ai": "^1.0.
|
|
34
|
+
"@eventcatalog/generator-ai": "^1.0.2",
|
|
35
35
|
"@eventcatalog/sdk": "^2.2.7",
|
|
36
36
|
"@fontsource/inter": "^5.2.5",
|
|
37
37
|
"@headlessui/react": "^2.0.3",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"@huggingface/transformers": "^3.3.3",
|
|
40
40
|
"@iconify-json/logos": "^1.2.4",
|
|
41
41
|
"@langchain/community": "^0.3.32",
|
|
42
|
+
"@langchain/openai": "^0.5.6",
|
|
42
43
|
"@mlc-ai/web-llm": "^0.2.78",
|
|
43
44
|
"@parcel/watcher": "^2.4.1",
|
|
44
45
|
"@radix-ui/react-context-menu": "^2.2.6",
|