@eventcatalog/core 2.24.0 → 2.24.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/README.md +1 -1
- 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/{chunk-BV5L5YQN.js → chunk-AMO6QDAS.js} +1 -1
- package/dist/{chunk-RX5LWHVR.js → chunk-Q77NQ43U.js} +1 -1
- package/dist/{chunk-O4U4YIV4.js → chunk-VOOF34RB.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +3 -3
- package/eventcatalog/src/enterprise/ai-assistant/components/Chat.tsx +2 -2
- package/eventcatalog/src/enterprise/ai-assistant/components/ChatWindow.tsx +2 -2
- package/eventcatalog/src/enterprise/ai-assistant/components/workers/document-importer.ts +5 -7
- package/eventcatalog/src/pages/chat/index.astro +43 -2
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-VOOF34RB.js";
|
|
4
|
+
import "../chunk-Q77NQ43U.js";
|
|
5
|
+
import "../chunk-AMO6QDAS.js";
|
|
6
6
|
import "../chunk-E7TXTI7G.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
package/dist/eventcatalog.js
CHANGED
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
} from "./chunk-OW2FQPYP.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-VOOF34RB.js";
|
|
10
|
+
import "./chunk-Q77NQ43U.js";
|
|
11
11
|
import {
|
|
12
12
|
catalogToAstro
|
|
13
13
|
} from "./chunk-CXKIF3EI.js";
|
|
14
14
|
import {
|
|
15
15
|
VERSION
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AMO6QDAS.js";
|
|
17
17
|
import {
|
|
18
18
|
isBackstagePluginEnabled
|
|
19
19
|
} from "./chunk-XMDPVKIJ.js";
|
|
@@ -2,12 +2,12 @@ import Sidebar from './ChatSidebar';
|
|
|
2
2
|
import { ChatProvider } from './hooks/ChatProvider';
|
|
3
3
|
import ChatWindow from './ChatWindow';
|
|
4
4
|
|
|
5
|
-
const Chat = (
|
|
5
|
+
const Chat = () => {
|
|
6
6
|
return (
|
|
7
7
|
<ChatProvider>
|
|
8
8
|
<div className="flex overflow-hidden w-full">
|
|
9
9
|
<Sidebar />
|
|
10
|
-
<ChatWindow
|
|
10
|
+
<ChatWindow />
|
|
11
11
|
</div>
|
|
12
12
|
</ChatProvider>
|
|
13
13
|
);
|
|
@@ -5,7 +5,7 @@ import { CreateWebWorkerMLCEngine, type InitProgressReport } from '@mlc-ai/web-l
|
|
|
5
5
|
import { useChat } from './hooks/ChatProvider';
|
|
6
6
|
import config from '@config';
|
|
7
7
|
|
|
8
|
-
const ChatWindow = (
|
|
8
|
+
const ChatWindow = () => {
|
|
9
9
|
const [loading, setLoading] = useState(true);
|
|
10
10
|
const [loadingProgress, setLoadingProgress] = useState(0);
|
|
11
11
|
const [engine, setEngine] = useState<any>(null);
|
|
@@ -236,7 +236,7 @@ const ChatWindow = ({ catalogPath }: { catalogPath: string }) => {
|
|
|
236
236
|
|
|
237
237
|
const importDocuments = async () => {
|
|
238
238
|
const worker = new Worker(new URL('./workers/document-importer.ts', import.meta.url), { type: 'module' });
|
|
239
|
-
worker.postMessage({ init: true
|
|
239
|
+
worker.postMessage({ init: true });
|
|
240
240
|
setVectorWorker(worker);
|
|
241
241
|
};
|
|
242
242
|
|
|
@@ -13,15 +13,12 @@ self.onmessage = async (event) => {
|
|
|
13
13
|
try {
|
|
14
14
|
// Initialize the vector store
|
|
15
15
|
if (event?.data?.init && !documents && !embeddings) {
|
|
16
|
-
const documentsImport = await
|
|
17
|
-
const embeddingsImport = await
|
|
16
|
+
const documentsImport = await fetch(`/ai/documents.json`);
|
|
17
|
+
const embeddingsImport = await fetch(`/ai/embeddings.json`);
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
console.log(embeddingsImport);
|
|
19
|
+
documents = await documentsImport.json();
|
|
20
|
+
embeddings = await embeddingsImport.json();
|
|
22
21
|
|
|
23
|
-
documents = documentsImport.default;
|
|
24
|
-
embeddings = embeddingsImport.default;
|
|
25
22
|
await vectorStore.addVectors(embeddings, documents);
|
|
26
23
|
}
|
|
27
24
|
|
|
@@ -33,6 +30,7 @@ self.onmessage = async (event) => {
|
|
|
33
30
|
const results = await vectorStore.similaritySearchWithScore(event.data.input, 10);
|
|
34
31
|
postMessage({ results: results, action: 'search-results' });
|
|
35
32
|
} catch (error) {
|
|
33
|
+
console.log(error);
|
|
36
34
|
self.postMessage({ error: (error as Error).message });
|
|
37
35
|
}
|
|
38
36
|
};
|
|
@@ -10,7 +10,7 @@ import { Code } from 'astro-expressive-code/components';
|
|
|
10
10
|
const isEnabled = config.chat?.enabled || false;
|
|
11
11
|
|
|
12
12
|
const PROJECT_DIR = path.resolve(process.env.PROJECT_DIR || process.cwd());
|
|
13
|
-
const GENERATED_AI_DIR = path.resolve(PROJECT_DIR, '
|
|
13
|
+
const GENERATED_AI_DIR = path.resolve(PROJECT_DIR, 'public/ai');
|
|
14
14
|
|
|
15
15
|
const directoryExists = fs.existsSync(GENERATED_AI_DIR);
|
|
16
16
|
|
|
@@ -31,7 +31,24 @@ const generatorConfig = `
|
|
|
31
31
|
{
|
|
32
32
|
isEnabled ? (
|
|
33
33
|
directoryExists ? (
|
|
34
|
-
|
|
34
|
+
<>
|
|
35
|
+
<div id="browserWarning" class="flex items-center justify-center w-full p-4 sm:p-8" style="display: none;">
|
|
36
|
+
<div class="max-w-2xl text-center bg-yellow-100 text-yellow-800 px-8 py-6 rounded-lg shadow-md">
|
|
37
|
+
<h2 class="text-2xl font-bold mb-4">Unsupported Browser</h2>
|
|
38
|
+
<p>
|
|
39
|
+
EventCatalog AI Assistant uses LLM models in the browser which is{' '}
|
|
40
|
+
<a href="https://developer.mozilla.org/en-US/docs/Web/API/GPU" class="text-blue-500 hover:underline">
|
|
41
|
+
only supported in Chrome and Edge browsers
|
|
42
|
+
</a>
|
|
43
|
+
. <br />
|
|
44
|
+
Please switch to a supported browser for the best experience.
|
|
45
|
+
</p>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
<div id="chatContainer" class="w-full">
|
|
49
|
+
<Chat client:only="react" />
|
|
50
|
+
</div>
|
|
51
|
+
</>
|
|
35
52
|
) : (
|
|
36
53
|
<div class="flex items-center justify-center w-full p-4 sm:p-8">
|
|
37
54
|
<div class="max-w-2xl text-center">
|
|
@@ -105,6 +122,30 @@ const generatorConfig = `
|
|
|
105
122
|
</div>
|
|
106
123
|
</VerticalSideBarLayout>
|
|
107
124
|
|
|
125
|
+
<script>
|
|
126
|
+
function checkBrowser() {
|
|
127
|
+
const userAgent = navigator.userAgent.toLowerCase();
|
|
128
|
+
const isChrome = /chrome/.test(userAgent) && !/edg/.test(userAgent);
|
|
129
|
+
const isEdge = /edg/.test(userAgent);
|
|
130
|
+
|
|
131
|
+
const warningElement = document.getElementById('browserWarning') as HTMLElement;
|
|
132
|
+
const chatContainer = document.getElementById('chatContainer') as HTMLElement;
|
|
133
|
+
|
|
134
|
+
if (warningElement && chatContainer) {
|
|
135
|
+
if (!isChrome && !isEdge) {
|
|
136
|
+
warningElement.style.display = 'flex';
|
|
137
|
+
chatContainer.style.display = 'none';
|
|
138
|
+
} else {
|
|
139
|
+
warningElement.style.display = 'none';
|
|
140
|
+
chatContainer.style.display = 'block';
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Run check when DOM is loaded
|
|
146
|
+
document.addEventListener('DOMContentLoaded', checkBrowser);
|
|
147
|
+
</script>
|
|
148
|
+
|
|
108
149
|
<style>
|
|
109
150
|
.loading-status.ready {
|
|
110
151
|
background-color: rgb(240 253 244); /* light green bg */
|
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.24.
|
|
9
|
+
"version": "2.24.2",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@asyncapi/avro-schema-parser": "^3.0.24",
|
|
30
30
|
"@asyncapi/parser": "^3.4.0",
|
|
31
31
|
"@asyncapi/react-component": "^2.4.3",
|
|
32
|
-
"@eventcatalog/generator-ai": "^0.1.
|
|
32
|
+
"@eventcatalog/generator-ai": "^0.1.2",
|
|
33
33
|
"@headlessui/react": "^2.0.3",
|
|
34
34
|
"@heroicons/react": "^2.1.3",
|
|
35
35
|
"@huggingface/transformers": "^3.3.3",
|
|
@@ -115,6 +115,7 @@
|
|
|
115
115
|
"preview": "astro preview",
|
|
116
116
|
"astro": "astro",
|
|
117
117
|
"start:catalog": "node scripts/start-catalog-locally.js",
|
|
118
|
+
"preview:catalog": "node scripts/preview-catalog-locally.js",
|
|
118
119
|
"generate:catalog": "node scripts/generate-catalog-locally.js",
|
|
119
120
|
"verify-build:catalog": "rimraf dist && pnpm run build:cd",
|
|
120
121
|
"changeset": "changeset",
|