@eventcatalog/core 4.12.0-beta.4 → 4.12.0-beta.6
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-runtime.cjs +3 -0
- package/dist/catalog-runtime.d.cts +6 -1
- package/dist/catalog-runtime.d.ts +6 -1
- package/dist/catalog-runtime.js +3 -1
- package/dist/{chunk-NAGVDHNB.js → chunk-7NJ6XHQ3.js} +3 -3
- package/dist/{chunk-GTXK64UD.js → chunk-FKW33BKL.js} +1 -1
- package/dist/{chunk-M4MMC5MN.js → chunk-HNFISK46.js} +1 -1
- package/dist/{chunk-SAN4U2WU.js → chunk-LFQJXLHG.js} +2 -0
- package/dist/{chunk-AHPVNJ7S.js → chunk-OFHPJR47.js} +1 -1
- package/dist/{chunk-ZZSCV5ZI.js → chunk-WNYQQG52.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +15 -6
- package/dist/eventcatalog.js +28 -19
- package/dist/federation/federate.js +4 -4
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/enterprise/ai/chat-api.ts +186 -183
- package/package.json +5 -5
- package/dist/{chunk-RYPZGCRN.js → chunk-FAZ3LEZ5.js} +7 -7
|
@@ -146,7 +146,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
146
146
|
var import_os = __toESM(require("os"), 1);
|
|
147
147
|
|
|
148
148
|
// package.json
|
|
149
|
-
var version = "4.12.0-beta.
|
|
149
|
+
var version = "4.12.0-beta.6";
|
|
150
150
|
|
|
151
151
|
// src/constants.ts
|
|
152
152
|
var VERSION = version;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-7NJ6XHQ3.js";
|
|
4
|
+
import "../chunk-OFHPJR47.js";
|
|
4
5
|
import "../chunk-ZAZHAVKB.js";
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-ZZSCV5ZI.js";
|
|
6
|
+
import "../chunk-WNYQQG52.js";
|
|
7
7
|
import "../chunk-JE6RX7SJ.js";
|
|
8
8
|
export {
|
|
9
9
|
log_build_default as default
|
package/dist/catalog-runtime.cjs
CHANGED
|
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var catalog_runtime_exports = {};
|
|
32
32
|
__export(catalog_runtime_exports, {
|
|
33
33
|
clearCatalogCache: () => clearCatalogCache,
|
|
34
|
+
hasLegacyCatalogRuntime: () => hasLegacyCatalogRuntime,
|
|
34
35
|
prepareCatalogRuntime: () => prepareCatalogRuntime
|
|
35
36
|
});
|
|
36
37
|
module.exports = __toCommonJS(catalog_runtime_exports);
|
|
@@ -66,6 +67,7 @@ var writeIfChanged = (file, content) => {
|
|
|
66
67
|
import_node_fs.default.writeFileSync(file, content);
|
|
67
68
|
};
|
|
68
69
|
var importPath = (file) => file.replace(/\\/g, "/");
|
|
70
|
+
var hasLegacyCatalogRuntime = (projectDirectory) => import_node_fs.default.existsSync(import_node_path2.default.join(projectDirectory, ".eventcatalog-core"));
|
|
69
71
|
var clearCatalogCache = (projectDirectory) => {
|
|
70
72
|
const { cacheDirectory } = getRuntimePaths(projectDirectory);
|
|
71
73
|
import_node_fs.default.rmSync(cacheDirectory, { recursive: true, force: true });
|
|
@@ -132,5 +134,6 @@ var prepareCatalogRuntime = ({ projectDirectory, catalogDirectory, packageDirect
|
|
|
132
134
|
// Annotate the CommonJS export names for ESM import in node:
|
|
133
135
|
0 && (module.exports = {
|
|
134
136
|
clearCatalogCache,
|
|
137
|
+
hasLegacyCatalogRuntime,
|
|
135
138
|
prepareCatalogRuntime
|
|
136
139
|
});
|
|
@@ -4,9 +4,14 @@ type RuntimeOptions = {
|
|
|
4
4
|
/** The installed package's eventcatalog/ directory. */
|
|
5
5
|
packageDirectory: string;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Versions before 4.12 copied the application into `.eventcatalog-core/`. It is
|
|
9
|
+
* left in place because an older EventCatalog process may still be using it.
|
|
10
|
+
*/
|
|
11
|
+
declare const hasLegacyCatalogRuntime: (projectDirectory: string) => boolean;
|
|
7
12
|
/** Clear all generated Astro state, not just EventCatalog's bootstrap files. */
|
|
8
13
|
declare const clearCatalogCache: (projectDirectory: string) => void;
|
|
9
14
|
/** Generate only collection/type metadata inside Astro's cache. */
|
|
10
15
|
declare const prepareCatalogRuntime: ({ projectDirectory, catalogDirectory, packageDirectory }: RuntimeOptions) => void;
|
|
11
16
|
|
|
12
|
-
export { clearCatalogCache, prepareCatalogRuntime };
|
|
17
|
+
export { clearCatalogCache, hasLegacyCatalogRuntime, prepareCatalogRuntime };
|
|
@@ -4,9 +4,14 @@ type RuntimeOptions = {
|
|
|
4
4
|
/** The installed package's eventcatalog/ directory. */
|
|
5
5
|
packageDirectory: string;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Versions before 4.12 copied the application into `.eventcatalog-core/`. It is
|
|
9
|
+
* left in place because an older EventCatalog process may still be using it.
|
|
10
|
+
*/
|
|
11
|
+
declare const hasLegacyCatalogRuntime: (projectDirectory: string) => boolean;
|
|
7
12
|
/** Clear all generated Astro state, not just EventCatalog's bootstrap files. */
|
|
8
13
|
declare const clearCatalogCache: (projectDirectory: string) => void;
|
|
9
14
|
/** Generate only collection/type metadata inside Astro's cache. */
|
|
10
15
|
declare const prepareCatalogRuntime: ({ projectDirectory, catalogDirectory, packageDirectory }: RuntimeOptions) => void;
|
|
11
16
|
|
|
12
|
-
export { clearCatalogCache, prepareCatalogRuntime };
|
|
17
|
+
export { clearCatalogCache, hasLegacyCatalogRuntime, prepareCatalogRuntime };
|
package/dist/catalog-runtime.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
raiseEvent
|
|
3
|
+
} from "./chunk-OFHPJR47.js";
|
|
1
4
|
import {
|
|
2
5
|
countResources,
|
|
3
6
|
hashCatalogContent,
|
|
4
7
|
serializeCounts
|
|
5
8
|
} from "./chunk-ZAZHAVKB.js";
|
|
6
|
-
import {
|
|
7
|
-
raiseEvent
|
|
8
|
-
} from "./chunk-AHPVNJ7S.js";
|
|
9
9
|
import {
|
|
10
10
|
getEventCatalogConfigFile,
|
|
11
11
|
verifyRequiredFieldsAreInCatalogConfigFile
|
|
@@ -25,6 +25,7 @@ var writeIfChanged = (file, content) => {
|
|
|
25
25
|
fs.writeFileSync(file, content);
|
|
26
26
|
};
|
|
27
27
|
var importPath = (file) => file.replace(/\\/g, "/");
|
|
28
|
+
var hasLegacyCatalogRuntime = (projectDirectory) => fs.existsSync(path2.join(projectDirectory, ".eventcatalog-core"));
|
|
28
29
|
var clearCatalogCache = (projectDirectory) => {
|
|
29
30
|
const { cacheDirectory } = getRuntimePaths(projectDirectory);
|
|
30
31
|
fs.rmSync(cacheDirectory, { recursive: true, force: true });
|
|
@@ -91,6 +92,7 @@ var prepareCatalogRuntime = ({ projectDirectory, catalogDirectory, packageDirect
|
|
|
91
92
|
|
|
92
93
|
export {
|
|
93
94
|
getRuntimePaths,
|
|
95
|
+
hasLegacyCatalogRuntime,
|
|
94
96
|
clearCatalogCache,
|
|
95
97
|
prepareCatalogRuntime
|
|
96
98
|
};
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -151,7 +151,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
151
151
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
152
152
|
|
|
153
153
|
// package.json
|
|
154
|
-
var version = "4.12.0-beta.
|
|
154
|
+
var version = "4.12.0-beta.6";
|
|
155
155
|
|
|
156
156
|
// src/constants.ts
|
|
157
157
|
var VERSION = version;
|
|
@@ -1583,6 +1583,7 @@ var writeIfChanged = (file, content) => {
|
|
|
1583
1583
|
import_node_fs7.default.writeFileSync(file, content);
|
|
1584
1584
|
};
|
|
1585
1585
|
var importPath = (file) => file.replace(/\\/g, "/");
|
|
1586
|
+
var hasLegacyCatalogRuntime = (projectDirectory) => import_node_fs7.default.existsSync(import_node_path11.default.join(projectDirectory, ".eventcatalog-core"));
|
|
1586
1587
|
var clearCatalogCache = (projectDirectory) => {
|
|
1587
1588
|
const { cacheDirectory } = getRuntimePaths(projectDirectory);
|
|
1588
1589
|
import_node_fs7.default.rmSync(cacheDirectory, { recursive: true, force: true });
|
|
@@ -2857,11 +2858,19 @@ var runCommandWithFilteredOutput = async ({
|
|
|
2857
2858
|
});
|
|
2858
2859
|
});
|
|
2859
2860
|
};
|
|
2860
|
-
var prepareCore = () =>
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2861
|
+
var prepareCore = () => {
|
|
2862
|
+
if (hasLegacyCatalogRuntime(dir)) {
|
|
2863
|
+
logger.warning(
|
|
2864
|
+
"The .eventcatalog-core/ directory is no longer used. You can delete it once older EventCatalog processes have stopped.",
|
|
2865
|
+
"eventcatalog"
|
|
2866
|
+
);
|
|
2867
|
+
}
|
|
2868
|
+
prepareCatalogRuntime({
|
|
2869
|
+
projectDirectory: dir,
|
|
2870
|
+
catalogDirectory: core,
|
|
2871
|
+
packageDirectory: eventCatalogDir
|
|
2872
|
+
});
|
|
2873
|
+
};
|
|
2865
2874
|
var clearCore = () => {
|
|
2866
2875
|
clearCatalogCache(dir);
|
|
2867
2876
|
};
|
package/dist/eventcatalog.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
log_build_default
|
|
3
|
+
} from "./chunk-7NJ6XHQ3.js";
|
|
4
|
+
import "./chunk-OFHPJR47.js";
|
|
5
|
+
import "./chunk-ZAZHAVKB.js";
|
|
1
6
|
import {
|
|
2
7
|
runMigrations
|
|
3
8
|
} from "./chunk-XUAF2H54.js";
|
|
4
9
|
import "./chunk-CA4U2JP7.js";
|
|
5
|
-
import {
|
|
6
|
-
log_build_default
|
|
7
|
-
} from "./chunk-NAGVDHNB.js";
|
|
8
|
-
import "./chunk-ZAZHAVKB.js";
|
|
9
10
|
import {
|
|
10
11
|
FederationConflictError,
|
|
11
12
|
FederationDiagnosticError,
|
|
12
13
|
federateCatalog
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-WRNH5C3U.js";
|
|
15
|
-
import "./chunk-5EPNFDT5.js";
|
|
16
|
-
import "./chunk-A2RZR3U4.js";
|
|
17
|
-
import "./chunk-R7Z5ALYI.js";
|
|
14
|
+
} from "./chunk-FAZ3LEZ5.js";
|
|
18
15
|
import {
|
|
19
16
|
getFederationDiagnosticCounts,
|
|
20
17
|
getVisibleFederationDiagnostics
|
|
21
18
|
} from "./chunk-JJPB6EOZ.js";
|
|
22
19
|
import "./chunk-FV56YFM4.js";
|
|
20
|
+
import "./chunk-WRNH5C3U.js";
|
|
21
|
+
import "./chunk-5EPNFDT5.js";
|
|
22
|
+
import "./chunk-A2RZR3U4.js";
|
|
23
23
|
import "./chunk-SDZQJTJW.js";
|
|
24
24
|
import "./chunk-352FGP6W.js";
|
|
25
25
|
import {
|
|
@@ -30,10 +30,10 @@ import {
|
|
|
30
30
|
} from "./chunk-3SJDIENM.js";
|
|
31
31
|
import {
|
|
32
32
|
generate
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-FKW33BKL.js";
|
|
34
34
|
import {
|
|
35
35
|
logger
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-HNFISK46.js";
|
|
37
37
|
import {
|
|
38
38
|
resolve_catalog_dependencies_default
|
|
39
39
|
} from "./chunk-EEZXGNF6.js";
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
import {
|
|
48
48
|
watch
|
|
49
49
|
} from "./chunk-U63GDPPY.js";
|
|
50
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-R7Z5ALYI.js";
|
|
51
51
|
import {
|
|
52
52
|
getAstroConfigPath
|
|
53
53
|
} from "./chunk-VIJJ7JKH.js";
|
|
@@ -58,11 +58,12 @@ import {
|
|
|
58
58
|
import {
|
|
59
59
|
clearCatalogCache,
|
|
60
60
|
getRuntimePaths,
|
|
61
|
+
hasLegacyCatalogRuntime,
|
|
61
62
|
prepareCatalogRuntime
|
|
62
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-LFQJXLHG.js";
|
|
63
64
|
import {
|
|
64
65
|
VERSION
|
|
65
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-WNYQQG52.js";
|
|
66
67
|
import {
|
|
67
68
|
getEventCatalogConfigFile,
|
|
68
69
|
verifyRequiredFieldsAreInCatalogConfigFile
|
|
@@ -819,11 +820,19 @@ var runCommandWithFilteredOutput = async ({
|
|
|
819
820
|
});
|
|
820
821
|
});
|
|
821
822
|
};
|
|
822
|
-
var prepareCore = () =>
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
823
|
+
var prepareCore = () => {
|
|
824
|
+
if (hasLegacyCatalogRuntime(dir)) {
|
|
825
|
+
logger.warning(
|
|
826
|
+
"The .eventcatalog-core/ directory is no longer used. You can delete it once older EventCatalog processes have stopped.",
|
|
827
|
+
"eventcatalog"
|
|
828
|
+
);
|
|
829
|
+
}
|
|
830
|
+
prepareCatalogRuntime({
|
|
831
|
+
projectDirectory: dir,
|
|
832
|
+
catalogDirectory: core,
|
|
833
|
+
packageDirectory: eventCatalogDir
|
|
834
|
+
});
|
|
835
|
+
};
|
|
827
836
|
var clearCore = () => {
|
|
828
837
|
clearCatalogCache(dir);
|
|
829
838
|
};
|
|
@@ -2,15 +2,15 @@ import {
|
|
|
2
2
|
FederationConflictError,
|
|
3
3
|
FederationDiagnosticError,
|
|
4
4
|
federateCatalog
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-FAZ3LEZ5.js";
|
|
6
|
+
import "../chunk-JJPB6EOZ.js";
|
|
7
|
+
import "../chunk-FV56YFM4.js";
|
|
6
8
|
import "../chunk-WRNH5C3U.js";
|
|
7
9
|
import "../chunk-5EPNFDT5.js";
|
|
8
10
|
import "../chunk-A2RZR3U4.js";
|
|
9
|
-
import "../chunk-R7Z5ALYI.js";
|
|
10
|
-
import "../chunk-JJPB6EOZ.js";
|
|
11
|
-
import "../chunk-FV56YFM4.js";
|
|
12
11
|
import "../chunk-SDZQJTJW.js";
|
|
13
12
|
import "../chunk-352FGP6W.js";
|
|
13
|
+
import "../chunk-R7Z5ALYI.js";
|
|
14
14
|
import "../chunk-JE6RX7SJ.js";
|
|
15
15
|
export {
|
|
16
16
|
FederationConflictError,
|
package/dist/generate.cjs
CHANGED
|
@@ -112,7 +112,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
112
112
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
113
113
|
|
|
114
114
|
// package.json
|
|
115
|
-
var version = "4.12.0-beta.
|
|
115
|
+
var version = "4.12.0-beta.6";
|
|
116
116
|
|
|
117
117
|
// src/constants.ts
|
|
118
118
|
var VERSION = version;
|
package/dist/generate.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generate
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-FKW33BKL.js";
|
|
4
|
+
import "./chunk-HNFISK46.js";
|
|
5
|
+
import "./chunk-WNYQQG52.js";
|
|
6
6
|
import "./chunk-JE6RX7SJ.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -4,7 +4,16 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { APIContext } from 'astro';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
convertToModelMessages,
|
|
9
|
+
createUIMessageStreamResponse,
|
|
10
|
+
isStepCount,
|
|
11
|
+
streamText,
|
|
12
|
+
toUIMessageStream,
|
|
13
|
+
tool,
|
|
14
|
+
type LanguageModel,
|
|
15
|
+
type UIMessage,
|
|
16
|
+
} from 'ai';
|
|
8
17
|
import { join } from 'node:path';
|
|
9
18
|
import { isEventCatalogScaleEnabled, isEventCatalogStarterEnabled } from '@utils/feature';
|
|
10
19
|
import { getCollection, getEntry } from 'astro:content';
|
|
@@ -211,204 +220,198 @@ export const POST = async ({ request }: APIContext<{ question: string; messages:
|
|
|
211
220
|
const referrer = request.headers.get('referer');
|
|
212
221
|
|
|
213
222
|
try {
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
stopWhen: stepCountIs(5),
|
|
220
|
-
// maxTokens: 4000, // Increased to handle large tool results
|
|
221
|
-
onError: (error) => {
|
|
222
|
-
console.error('[Chat] On error', error);
|
|
223
|
-
},
|
|
224
|
-
// maxOutputTokens: 40000,
|
|
225
|
-
// tools: tools,
|
|
226
|
-
tools: {
|
|
227
|
-
getResources: tool({
|
|
228
|
-
description: toolDescriptions.getResources,
|
|
229
|
-
inputSchema: z.object({
|
|
230
|
-
collection: collectionSchema.describe('The collection to get the resources from'),
|
|
231
|
-
}),
|
|
232
|
-
execute: async ({ collection }) => {
|
|
233
|
-
const result = await getResourcesImpl({ collection });
|
|
234
|
-
if ('error' in result) return result;
|
|
235
|
-
return result.resources;
|
|
236
|
-
},
|
|
223
|
+
const tools = {
|
|
224
|
+
getResources: tool({
|
|
225
|
+
description: toolDescriptions.getResources,
|
|
226
|
+
inputSchema: z.object({
|
|
227
|
+
collection: collectionSchema.describe('The collection to get the resources from'),
|
|
237
228
|
}),
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
229
|
+
execute: async ({ collection }) => {
|
|
230
|
+
const result = await getResourcesImpl({ collection });
|
|
231
|
+
if ('error' in result) return result;
|
|
232
|
+
return result.resources;
|
|
233
|
+
},
|
|
234
|
+
}),
|
|
235
|
+
getResource: tool({
|
|
236
|
+
description: toolDescriptions.getResource,
|
|
237
|
+
inputSchema: z.object({
|
|
238
|
+
collection: collectionSchema.describe('The collection to get the resource from'),
|
|
239
|
+
id: z.string().describe('The id of the resource to get'),
|
|
240
|
+
version: z.string().describe('The version of the resource to get'),
|
|
248
241
|
}),
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
const consumers = resource.data.consumers || [];
|
|
260
|
-
return {
|
|
261
|
-
producers,
|
|
262
|
-
consumers,
|
|
263
|
-
};
|
|
264
|
-
},
|
|
242
|
+
execute: async ({ collection, id, version }) => {
|
|
243
|
+
return await getResourceImpl({ collection, id, version });
|
|
244
|
+
},
|
|
245
|
+
}),
|
|
246
|
+
getProducersAndConsumersFromSchema: tool({
|
|
247
|
+
description: 'Use this tool to get the producers and consumers for a schema by its id and version',
|
|
248
|
+
inputSchema: z.object({
|
|
249
|
+
collection: messageCollectionSchema.describe('The collection to get the producers and consumers from'),
|
|
250
|
+
id: z.string().describe('The id of the message to get the producers and consumers for'),
|
|
251
|
+
version: z.string().describe('The version of the message to get the producers and consumers for'),
|
|
265
252
|
}),
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
253
|
+
execute: async ({ collection, id, version }) => {
|
|
254
|
+
const resource = await getEntry(collection as any, `${id}-${version}`);
|
|
255
|
+
const producers = resource.data.producers || [];
|
|
256
|
+
const consumers = resource.data.consumers || [];
|
|
257
|
+
return {
|
|
258
|
+
producers,
|
|
259
|
+
consumers,
|
|
260
|
+
};
|
|
261
|
+
},
|
|
262
|
+
}),
|
|
263
|
+
getMessagesProducedOrConsumedByResource: tool({
|
|
264
|
+
description: toolDescriptions.getMessagesProducedOrConsumedByResource,
|
|
265
|
+
inputSchema: z.object({
|
|
266
|
+
resourceId: z.string().describe('The id of the resource to get the messages produced or consumed for'),
|
|
267
|
+
resourceVersion: z.string().describe('The version of the resource to get the messages produced or consumed for'),
|
|
268
|
+
resourceCollection: resourceCollectionSchema
|
|
269
|
+
.describe('The collection of the resource to get the messages produced or consumed for')
|
|
270
|
+
.default('services'),
|
|
278
271
|
}),
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
const consumers = await getProducersOfMessage(services, message as any);
|
|
292
|
-
return consumers;
|
|
293
|
-
},
|
|
272
|
+
execute: async ({ resourceId, resourceVersion, resourceCollection }) => {
|
|
273
|
+
return await getMessagesImpl({ resourceId, resourceVersion, resourceCollection });
|
|
274
|
+
},
|
|
275
|
+
}),
|
|
276
|
+
getProducerAndConsumerForMessage: tool({
|
|
277
|
+
description: 'Use this tool to get the producers and consumers for a message by its id and version',
|
|
278
|
+
inputSchema: z.object({
|
|
279
|
+
messageId: z.string().describe('The id of the message to get the producers and consumers for'),
|
|
280
|
+
messageVersion: z.string().describe('The version of the message to get the producers and consumers for'),
|
|
281
|
+
messageCollection: messageCollectionSchema
|
|
282
|
+
.describe('The collection of the message to get the producers and consumers for')
|
|
283
|
+
.default('events'),
|
|
294
284
|
}),
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
285
|
+
execute: async ({ messageId, messageVersion, messageCollection }) => {
|
|
286
|
+
const services = await getCollection('services');
|
|
287
|
+
const message = await getEntry(messageCollection as any, `${messageId}-${messageVersion}`);
|
|
288
|
+
const consumers = await getProducersOfMessage(services, message as any);
|
|
289
|
+
return consumers;
|
|
290
|
+
},
|
|
291
|
+
}),
|
|
292
|
+
getConsumersOfMessage: tool({
|
|
293
|
+
description: 'Use this tool to get the consumers for a message by its id and version',
|
|
294
|
+
inputSchema: z.object({
|
|
295
|
+
messageId: z.string().describe('The id of the message to get the consumers for'),
|
|
296
|
+
messageVersion: z.string().describe('The version of the message to get the consumers for'),
|
|
297
|
+
messageCollection: messageCollectionSchema
|
|
298
|
+
.describe('The collection of the message to get the consumers for')
|
|
299
|
+
.default('events'),
|
|
310
300
|
}),
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
301
|
+
execute: async ({ messageId, messageVersion, messageCollection }) => {
|
|
302
|
+
const services = await getCollection('services');
|
|
303
|
+
const message = await getEntry(messageCollection as any, `${messageId}-${messageVersion}`);
|
|
304
|
+
const consumers = await getConsumersOfMessage(services, message as any);
|
|
305
|
+
return consumers;
|
|
306
|
+
},
|
|
307
|
+
}),
|
|
308
|
+
getSchemaForResource: tool({
|
|
309
|
+
description: toolDescriptions.getSchemaForResource,
|
|
310
|
+
inputSchema: z.object({
|
|
311
|
+
resourceId: z.string().describe('The id of the resource to get the schema for'),
|
|
312
|
+
resourceVersion: z.string().describe('The version of the resource to get the schema for'),
|
|
313
|
+
resourceCollection: resourceCollectionSchema
|
|
314
|
+
.describe('The collection of the resource to get the schema for')
|
|
315
|
+
.default('services'),
|
|
323
316
|
}),
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
317
|
+
execute: async ({ resourceId, resourceVersion, resourceCollection }) => {
|
|
318
|
+
return await getSchemaImpl({ resourceId, resourceVersion, resourceCollection });
|
|
319
|
+
},
|
|
320
|
+
}),
|
|
321
|
+
getDataProductInputs: tool({
|
|
322
|
+
description: toolDescriptions.getDataProductInputs,
|
|
323
|
+
inputSchema: z.object({
|
|
324
|
+
dataProductId: z.string().describe('The id of the data product to get the inputs for'),
|
|
325
|
+
dataProductVersion: z.string().describe('The version of the data product to get the inputs for'),
|
|
333
326
|
}),
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
327
|
+
execute: async ({ dataProductId, dataProductVersion }) => {
|
|
328
|
+
return await getDataProductInputsImpl({ dataProductId, dataProductVersion });
|
|
329
|
+
},
|
|
330
|
+
}),
|
|
331
|
+
getDataProductOutputs: tool({
|
|
332
|
+
description: toolDescriptions.getDataProductOutputs,
|
|
333
|
+
inputSchema: z.object({
|
|
334
|
+
dataProductId: z.string().describe('The id of the data product to get the outputs for'),
|
|
335
|
+
dataProductVersion: z.string().describe('The version of the data product to get the outputs for'),
|
|
343
336
|
}),
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
337
|
+
execute: async ({ dataProductId, dataProductVersion }) => {
|
|
338
|
+
return await getDataProductOutputsImpl({ dataProductId, dataProductVersion });
|
|
339
|
+
},
|
|
340
|
+
}),
|
|
341
|
+
getArchitectureDiagramAsMermaid: tool({
|
|
342
|
+
description: toolDescriptions.getArchitectureDiagramAsMermaid,
|
|
343
|
+
inputSchema: z.object({
|
|
344
|
+
resourceId: z.string().describe('The id of the resource to get the architecture diagram for'),
|
|
345
|
+
resourceVersion: z.string().describe('The version of the resource to get the architecture diagram for'),
|
|
346
|
+
resourceCollection: visualiserCollectionSchema
|
|
347
|
+
.describe(
|
|
348
|
+
'The collection of the resource (events, commands, queries, services, domains, systems, flows, containers, data-products)'
|
|
349
|
+
)
|
|
350
|
+
.default('services'),
|
|
358
351
|
}),
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
352
|
+
execute: async ({ resourceId, resourceVersion, resourceCollection }) => {
|
|
353
|
+
return await getArchitectureDiagramImpl({ resourceId, resourceVersion, resourceCollection });
|
|
354
|
+
},
|
|
355
|
+
}),
|
|
356
|
+
getCustomDocs: tool({
|
|
357
|
+
description: toolDescriptions.getCustomDocs,
|
|
358
|
+
inputSchema: z.object({
|
|
359
|
+
cursor: z.string().optional().describe('Pagination cursor from previous response'),
|
|
360
|
+
search: z.string().optional().describe('Search term to filter docs by title, id, or summary (case-insensitive)'),
|
|
368
361
|
}),
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
362
|
+
execute: async ({ cursor, search }) => {
|
|
363
|
+
return await getCustomDocsImpl({ cursor, search });
|
|
364
|
+
},
|
|
365
|
+
}),
|
|
366
|
+
searchCustomDocs: tool({
|
|
367
|
+
description: toolDescriptions.searchCustomDocs,
|
|
368
|
+
inputSchema: z.object({
|
|
369
|
+
query: z.string().describe('Full-text search query, e.g. keywords describing the topic to find'),
|
|
370
|
+
limit: z.number().optional().describe('Maximum number of results to return (default 10)'),
|
|
378
371
|
}),
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
372
|
+
execute: async ({ query, limit }) => {
|
|
373
|
+
return await searchCustomDocsImpl({ query, limit });
|
|
374
|
+
},
|
|
375
|
+
}),
|
|
376
|
+
getCustomDoc: tool({
|
|
377
|
+
description: toolDescriptions.getCustomDoc,
|
|
378
|
+
inputSchema: z.object({
|
|
379
|
+
id: z.string().describe('The id or slug of the custom documentation page'),
|
|
380
|
+
section: z.string().optional().describe('Optional section heading to return only that section of the page'),
|
|
388
381
|
}),
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
}),
|
|
399
|
-
execute: async ({ questions }) => {
|
|
400
|
-
// This tool doesn't need to do anything - it just returns the questions
|
|
401
|
-
// which will be captured by the UI
|
|
402
|
-
return { suggestions: questions };
|
|
403
|
-
},
|
|
382
|
+
execute: async ({ id, section }) => {
|
|
383
|
+
return await getCustomDocImpl({ id, section });
|
|
384
|
+
},
|
|
385
|
+
}),
|
|
386
|
+
suggestFollowUpQuestions: tool({
|
|
387
|
+
description:
|
|
388
|
+
'Use this tool after answering a question to suggest 2-3 relevant follow-up questions the user might want to ask. These will be displayed as clickable suggestions.',
|
|
389
|
+
inputSchema: z.object({
|
|
390
|
+
questions: z.array(z.string()).min(1).max(3).describe('Array of 2-3 follow-up questions relevant to the conversation'),
|
|
404
391
|
}),
|
|
405
|
-
|
|
392
|
+
execute: async ({ questions }) => {
|
|
393
|
+
// This tool doesn't need to do anything - it just returns the questions
|
|
394
|
+
// which will be captured by the UI
|
|
395
|
+
return { suggestions: questions };
|
|
396
|
+
},
|
|
397
|
+
}),
|
|
398
|
+
...extendedTools,
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
const result = streamText({
|
|
402
|
+
model,
|
|
403
|
+
instructions: getBaseSystemPrompt(referrer ?? ''),
|
|
404
|
+
messages: await convertToModelMessages(messages),
|
|
405
|
+
temperature: modelConfiguration?.temperature ?? 0.7,
|
|
406
|
+
stopWhen: isStepCount(5),
|
|
407
|
+
onError: (error) => {
|
|
408
|
+
console.error('[Chat] On error', error);
|
|
406
409
|
},
|
|
410
|
+
tools,
|
|
407
411
|
});
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
},
|
|
412
|
+
|
|
413
|
+
return createUIMessageStreamResponse({
|
|
414
|
+
stream: toUIMessageStream({ stream: result.stream, tools }),
|
|
412
415
|
});
|
|
413
416
|
} catch (err: any) {
|
|
414
417
|
console.error('[Chat] Error during streaming:', err);
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"license": "SEE LICENSE IN LICENSE",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "4.12.0-beta.
|
|
10
|
+
"version": "4.12.0-beta.6",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dist/"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@ai-sdk/react": "^
|
|
48
|
+
"@ai-sdk/react": "^4.0.109",
|
|
49
49
|
"@astrojs/markdown-remark": "^7.3.1",
|
|
50
50
|
"@astrojs/mdx": "^8.0.1",
|
|
51
51
|
"@astrojs/node": "^11.1.6",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@tailwindcss/vite": "^4.3.1",
|
|
75
75
|
"@tanstack/react-table": "^8.17.3",
|
|
76
76
|
"@xyflow/react": "^12.3.6",
|
|
77
|
-
"ai": "^
|
|
77
|
+
"ai": "^7.0.106",
|
|
78
78
|
"astro": "7.3.3",
|
|
79
79
|
"astro-expressive-code": "^0.44.0",
|
|
80
80
|
"astro-seo": "^0.8.4",
|
|
@@ -134,8 +134,8 @@
|
|
|
134
134
|
"uuid": "^11.1.1",
|
|
135
135
|
"zod": "^4.3.6",
|
|
136
136
|
"@eventcatalog/linter": "1.1.20",
|
|
137
|
-
"@eventcatalog/
|
|
138
|
-
"@eventcatalog/
|
|
137
|
+
"@eventcatalog/visualiser": "^4.1.4",
|
|
138
|
+
"@eventcatalog/sdk": "2.29.1"
|
|
139
139
|
},
|
|
140
140
|
"devDependencies": {
|
|
141
141
|
"@astrojs/check": "^0.9.10",
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getFederationDiagnostics,
|
|
3
|
+
resolveFederationRules
|
|
4
|
+
} from "./chunk-JJPB6EOZ.js";
|
|
5
|
+
import {
|
|
6
|
+
isFederationEnabled
|
|
7
|
+
} from "./chunk-FV56YFM4.js";
|
|
1
8
|
import {
|
|
2
9
|
withFederationOutputTransaction
|
|
3
10
|
} from "./chunk-WRNH5C3U.js";
|
|
@@ -10,13 +17,6 @@ import {
|
|
|
10
17
|
import {
|
|
11
18
|
createFederationContentCache
|
|
12
19
|
} from "./chunk-R7Z5ALYI.js";
|
|
13
|
-
import {
|
|
14
|
-
getFederationDiagnostics,
|
|
15
|
-
resolveFederationRules
|
|
16
|
-
} from "./chunk-JJPB6EOZ.js";
|
|
17
|
-
import {
|
|
18
|
-
isFederationEnabled
|
|
19
|
-
} from "./chunk-FV56YFM4.js";
|
|
20
20
|
import {
|
|
21
21
|
getEventCatalogConfigFile
|
|
22
22
|
} from "./chunk-JE6RX7SJ.js";
|