@eventcatalog/core 3.47.3 → 3.48.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/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-RI354NOR.js → chunk-4PAHVB2Y.js} +1 -1
- package/dist/{chunk-RXNCY52G.js → chunk-5WM3KVZ4.js} +3 -3
- package/dist/{chunk-VGYTVGLU.js → chunk-BOOGBLDG.js} +1 -1
- package/dist/{chunk-L2S6Y5ND.js → chunk-E4TWUZEU.js} +1 -1
- package/dist/{chunk-RESGIWJP.js → chunk-GSDFCY6Q.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 +10 -10
- 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/mcp/mcp-server.ts +39 -2
- package/eventcatalog/src/enterprise/tools/catalog-tools.ts +114 -0
- package/eventcatalog/src/plugins/likec4.ts +3 -3
- package/package.json +2 -2
|
@@ -140,7 +140,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
140
140
|
var import_os = __toESM(require("os"), 1);
|
|
141
141
|
|
|
142
142
|
// package.json
|
|
143
|
-
var version = "3.
|
|
143
|
+
var version = "3.48.0";
|
|
144
144
|
|
|
145
145
|
// src/constants.ts
|
|
146
146
|
var VERSION = version;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-RI354NOR.js";
|
|
3
|
+
} from "../chunk-5WM3KVZ4.js";
|
|
5
4
|
import "../chunk-DAOXTQVS.js";
|
|
6
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-4PAHVB2Y.js";
|
|
6
|
+
import "../chunk-E4TWUZEU.js";
|
|
7
7
|
import "../chunk-6QENHZZP.js";
|
|
8
8
|
export {
|
|
9
9
|
log_build_default as default
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
raiseEvent
|
|
3
|
-
} from "./chunk-RI354NOR.js";
|
|
4
1
|
import {
|
|
5
2
|
countResources,
|
|
6
3
|
serializeCounts
|
|
7
4
|
} from "./chunk-DAOXTQVS.js";
|
|
5
|
+
import {
|
|
6
|
+
raiseEvent
|
|
7
|
+
} from "./chunk-4PAHVB2Y.js";
|
|
8
8
|
import {
|
|
9
9
|
getEventCatalogConfigFile,
|
|
10
10
|
verifyRequiredFieldsAreInCatalogConfigFile
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -144,7 +144,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
144
144
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
145
145
|
|
|
146
146
|
// package.json
|
|
147
|
-
var version = "3.
|
|
147
|
+
var version = "3.48.0";
|
|
148
148
|
|
|
149
149
|
// src/constants.ts
|
|
150
150
|
var VERSION = version;
|
package/dist/eventcatalog.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
2
|
+
log_build_default
|
|
3
|
+
} from "./chunk-5WM3KVZ4.js";
|
|
4
|
+
import "./chunk-DAOXTQVS.js";
|
|
5
5
|
import {
|
|
6
6
|
resolve_catalog_dependencies_default
|
|
7
7
|
} from "./chunk-LHR4G2UO.js";
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
watch
|
|
13
13
|
} from "./chunk-O3Y2G6CY.js";
|
|
14
14
|
import {
|
|
15
|
-
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
15
|
+
runMigrations
|
|
16
|
+
} from "./chunk-XUAF2H54.js";
|
|
17
|
+
import "./chunk-CA4U2JP7.js";
|
|
18
|
+
import "./chunk-4PAHVB2Y.js";
|
|
19
19
|
import {
|
|
20
20
|
catalogToAstro
|
|
21
21
|
} from "./chunk-WQNKHIDM.js";
|
|
@@ -28,13 +28,13 @@ import {
|
|
|
28
28
|
} from "./chunk-B7HCX5HM.js";
|
|
29
29
|
import {
|
|
30
30
|
generate
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-GSDFCY6Q.js";
|
|
32
32
|
import {
|
|
33
33
|
logger
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-BOOGBLDG.js";
|
|
35
35
|
import {
|
|
36
36
|
VERSION
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-E4TWUZEU.js";
|
|
38
38
|
import {
|
|
39
39
|
getEventCatalogConfigFile,
|
|
40
40
|
verifyRequiredFieldsAreInCatalogConfigFile
|
package/dist/generate.cjs
CHANGED
|
@@ -108,7 +108,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
108
108
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
109
109
|
|
|
110
110
|
// package.json
|
|
111
|
-
var version = "3.
|
|
111
|
+
var version = "3.48.0";
|
|
112
112
|
|
|
113
113
|
// src/constants.ts
|
|
114
114
|
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-GSDFCY6Q.js";
|
|
4
|
+
import "./chunk-BOOGBLDG.js";
|
|
5
|
+
import "./chunk-E4TWUZEU.js";
|
|
6
6
|
import "./chunk-6QENHZZP.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
resourceCollectionSchema,
|
|
31
31
|
messageCollectionSchema,
|
|
32
32
|
toolDescriptions,
|
|
33
|
+
getC4Diagram,
|
|
33
34
|
} from '@enterprise/tools/catalog-tools';
|
|
34
35
|
import { getCollection } from 'astro:content';
|
|
35
36
|
import { createMcpAuthErrorResponse, validateMcpRequest } from './mcp-auth';
|
|
@@ -181,6 +182,17 @@ function createMcpServer() {
|
|
|
181
182
|
createToolHandler(getConsumersOfMessage, 'Failed to get consumers')
|
|
182
183
|
);
|
|
183
184
|
|
|
185
|
+
server.registerTool(
|
|
186
|
+
'getC4Diagram',
|
|
187
|
+
{
|
|
188
|
+
description: toolDescriptions.getC4Diagram,
|
|
189
|
+
inputSchema: z.object({
|
|
190
|
+
viewId: z.string().describe('The id of the LikeC4 view to return source files for').optional(),
|
|
191
|
+
}),
|
|
192
|
+
},
|
|
193
|
+
createToolHandler(getC4Diagram, 'Failed to get c4 diagram')
|
|
194
|
+
);
|
|
195
|
+
|
|
184
196
|
server.registerTool(
|
|
185
197
|
'analyzeChangeImpact',
|
|
186
198
|
{
|
|
@@ -328,7 +340,18 @@ function createMcpServer() {
|
|
|
328
340
|
name: 'All Resources in EventCatalog',
|
|
329
341
|
uri: 'eventcatalog://all',
|
|
330
342
|
description: 'All messages, agents, domains and services in EventCatalog',
|
|
331
|
-
collections: [
|
|
343
|
+
collections: [
|
|
344
|
+
'events',
|
|
345
|
+
'commands',
|
|
346
|
+
'queries',
|
|
347
|
+
'agents',
|
|
348
|
+
'services',
|
|
349
|
+
'domains',
|
|
350
|
+
'flows',
|
|
351
|
+
'channels',
|
|
352
|
+
'entities',
|
|
353
|
+
'adrs',
|
|
354
|
+
] as const,
|
|
332
355
|
},
|
|
333
356
|
{
|
|
334
357
|
name: 'All Events in EventCatalog',
|
|
@@ -360,6 +383,12 @@ function createMcpServer() {
|
|
|
360
383
|
description: 'All agents in EventCatalog',
|
|
361
384
|
collections: ['agents'] as const,
|
|
362
385
|
},
|
|
386
|
+
{
|
|
387
|
+
name: 'All Architecture Decision Records (adrs) in EventCatalog',
|
|
388
|
+
uri: 'eventcatalog://adrs',
|
|
389
|
+
description: 'All architecture decision records in EventCatalog',
|
|
390
|
+
collections: ['adrs'] as const,
|
|
391
|
+
},
|
|
363
392
|
{
|
|
364
393
|
name: 'All Domains in EventCatalog',
|
|
365
394
|
uri: 'eventcatalog://domains',
|
|
@@ -378,6 +407,12 @@ function createMcpServer() {
|
|
|
378
407
|
description: 'All channels in EventCatalog',
|
|
379
408
|
collections: ['channels'] as const,
|
|
380
409
|
},
|
|
410
|
+
{
|
|
411
|
+
name: 'All Entities in EventCatalog',
|
|
412
|
+
uri: 'eventcatalog://entities',
|
|
413
|
+
description: 'All entities in EventCatalog',
|
|
414
|
+
collections: ['entities'] as const,
|
|
415
|
+
},
|
|
381
416
|
{
|
|
382
417
|
name: 'All Containers in EventCatalog',
|
|
383
418
|
uri: 'eventcatalog://containers',
|
|
@@ -461,8 +496,10 @@ const mcpResources = [
|
|
|
461
496
|
'eventcatalog://commands',
|
|
462
497
|
'eventcatalog://queries',
|
|
463
498
|
'eventcatalog://agents',
|
|
499
|
+
'eventcatalog://adrs',
|
|
464
500
|
'eventcatalog://services',
|
|
465
501
|
'eventcatalog://domains',
|
|
502
|
+
'eventcatalog://entities',
|
|
466
503
|
'eventcatalog://flows',
|
|
467
504
|
'eventcatalog://teams',
|
|
468
505
|
'eventcatalog://users',
|
|
@@ -478,7 +515,7 @@ app.get('/', async (c: Context) => {
|
|
|
478
515
|
|
|
479
516
|
return c.json({
|
|
480
517
|
name: 'EventCatalog MCP Server',
|
|
481
|
-
version: '1.
|
|
518
|
+
version: '1.1.0',
|
|
482
519
|
status: 'running',
|
|
483
520
|
tools: [...builtInTools, ...extendedToolNames],
|
|
484
521
|
extendedTools: extendedToolNames.length > 0 ? extendedToolNames : undefined,
|
|
@@ -27,8 +27,75 @@ import { getNodesAndEdges as getNodesAndEdgesForDataProduct } from '@utils/node-
|
|
|
27
27
|
import { getNodesAndEdges as getNodesAndEdgesForContainer } from '@utils/node-graphs/container-node-graph';
|
|
28
28
|
import { convertToMermaid } from '@utils/node-graphs/export-mermaid';
|
|
29
29
|
import config from '@config';
|
|
30
|
+
import { glob } from 'glob';
|
|
31
|
+
import path from 'node:path';
|
|
30
32
|
|
|
31
33
|
const MESSAGE_COLLECTIONS = new Set(['events', 'commands', 'queries']);
|
|
34
|
+
const LIKEC4_SOURCE_PATTERN = '**/*.{c4,likec4}';
|
|
35
|
+
|
|
36
|
+
type LikeC4View = {
|
|
37
|
+
id: string;
|
|
38
|
+
kind: 'element' | 'dynamic' | 'deployment';
|
|
39
|
+
filePath: string;
|
|
40
|
+
line: number;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
type LikeC4SourceFile = {
|
|
44
|
+
path: string;
|
|
45
|
+
content: string;
|
|
46
|
+
views: LikeC4View[];
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const toPosixPath = (filePath: string) => filePath.split(path.sep).join(path.posix.sep);
|
|
50
|
+
|
|
51
|
+
const lineNumberAtIndex = (content: string, index: number) => content.slice(0, index).split(/\r\n|\r|\n/).length;
|
|
52
|
+
|
|
53
|
+
const stripLikeC4Comments = (content: string) => content.replace(/\/\*[\s\S]*?\*\//g, '').replace(/(^|[^:])\/\/.*$/gm, '$1');
|
|
54
|
+
|
|
55
|
+
const parseLikeC4Views = (content: string, filePath: string): LikeC4View[] => {
|
|
56
|
+
const contentWithoutComments = stripLikeC4Comments(content);
|
|
57
|
+
const viewDeclarationPattern =
|
|
58
|
+
/\b(?:(dynamic|deployment)\s+)?view(?:\s+([A-Za-z_][\w.-]*))?(?:\s+of\s+[A-Za-z_][\w.-]*(?:\.[A-Za-z_][\w.-]*)*)?\s*\{/g;
|
|
59
|
+
const views: LikeC4View[] = [];
|
|
60
|
+
let match: RegExpExecArray | null;
|
|
61
|
+
|
|
62
|
+
while ((match = viewDeclarationPattern.exec(contentWithoutComments)) !== null) {
|
|
63
|
+
const [, kind, id] = match;
|
|
64
|
+
|
|
65
|
+
if (!id) {
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
views.push({
|
|
70
|
+
id,
|
|
71
|
+
kind: kind === 'dynamic' || kind === 'deployment' ? kind : 'element',
|
|
72
|
+
filePath,
|
|
73
|
+
line: lineNumberAtIndex(contentWithoutComments, match.index),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return views;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const discoverLikeC4Sources = async (projectRoot: string): Promise<LikeC4SourceFile[]> => {
|
|
81
|
+
const sourceFiles = await glob(LIKEC4_SOURCE_PATTERN, {
|
|
82
|
+
cwd: projectRoot,
|
|
83
|
+
ignore: ['**/node_modules/**'],
|
|
84
|
+
nodir: true,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
return sourceFiles
|
|
88
|
+
.map(toPosixPath)
|
|
89
|
+
.sort()
|
|
90
|
+
.map((sourceFile) => {
|
|
91
|
+
const content = fs.readFileSync(path.join(projectRoot, sourceFile), 'utf-8');
|
|
92
|
+
return {
|
|
93
|
+
path: sourceFile,
|
|
94
|
+
content,
|
|
95
|
+
views: parseLikeC4Views(content, sourceFile),
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
};
|
|
32
99
|
|
|
33
100
|
// ============================================
|
|
34
101
|
// Pagination utilities
|
|
@@ -105,6 +172,7 @@ export function paginate<T>(
|
|
|
105
172
|
export const collectionSchema = z.enum([
|
|
106
173
|
'events',
|
|
107
174
|
'agents',
|
|
175
|
+
'adrs',
|
|
108
176
|
'services',
|
|
109
177
|
'commands',
|
|
110
178
|
'queries',
|
|
@@ -122,6 +190,7 @@ export const messageCollectionSchema = z.enum(['events', 'commands', 'queries'])
|
|
|
122
190
|
export const resourceCollectionSchema = z.enum([
|
|
123
191
|
'agents',
|
|
124
192
|
'services',
|
|
193
|
+
'adrs',
|
|
125
194
|
'events',
|
|
126
195
|
'commands',
|
|
127
196
|
'queries',
|
|
@@ -276,6 +345,9 @@ export async function findResourcesByOwner(params: { ownerId: string }) {
|
|
|
276
345
|
'flows',
|
|
277
346
|
'channels',
|
|
278
347
|
'entities',
|
|
348
|
+
'adrs',
|
|
349
|
+
'containers',
|
|
350
|
+
'diagrams',
|
|
279
351
|
'data-products',
|
|
280
352
|
] as const;
|
|
281
353
|
|
|
@@ -345,6 +417,46 @@ export async function getProducersOfMessage(params: { messageId: string; message
|
|
|
345
417
|
};
|
|
346
418
|
}
|
|
347
419
|
|
|
420
|
+
export async function getC4Diagram(params: { viewId?: string }) {
|
|
421
|
+
const projectRoot = process.env.PROJECT_DIR || process.cwd();
|
|
422
|
+
const sources = await discoverLikeC4Sources(projectRoot);
|
|
423
|
+
const availableViews = sources.flatMap((source) => source.views);
|
|
424
|
+
|
|
425
|
+
if (sources.length === 0) {
|
|
426
|
+
return {
|
|
427
|
+
message: 'No LikeC4 source files found in this EventCatalog project',
|
|
428
|
+
sources: [],
|
|
429
|
+
totalSourceFiles: 0,
|
|
430
|
+
totalViews: 0,
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
if (!params.viewId) {
|
|
435
|
+
return {
|
|
436
|
+
message: 'LikeC4 source files found',
|
|
437
|
+
sources,
|
|
438
|
+
totalSourceFiles: sources.length,
|
|
439
|
+
totalViews: availableViews.length,
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
const matchingViews = availableViews.filter((view) => view.id === params.viewId);
|
|
444
|
+
|
|
445
|
+
if (matchingViews.length === 0) {
|
|
446
|
+
return {
|
|
447
|
+
error: `LikeC4 view not found: ${params.viewId}`,
|
|
448
|
+
availableViews,
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
return {
|
|
453
|
+
viewId: params.viewId,
|
|
454
|
+
matchingViews,
|
|
455
|
+
sources,
|
|
456
|
+
totalSourceFiles: sources.length,
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
|
|
348
460
|
/**
|
|
349
461
|
* Get resources that consume (receive) a specific message
|
|
350
462
|
*/
|
|
@@ -992,6 +1104,8 @@ export const toolDescriptions = {
|
|
|
992
1104
|
'Use this tool to find which agents or services produce (send) a specific message (event, command, or query)',
|
|
993
1105
|
getConsumersOfMessage:
|
|
994
1106
|
'Use this tool to find which agents or services consume (receive) a specific message (event, command, or query)',
|
|
1107
|
+
getC4Diagram:
|
|
1108
|
+
'Use this tool to get the C4 diagram (or likeC4) in EventCatalog. These files usually have a .c4 extension on them',
|
|
995
1109
|
analyzeChangeImpact:
|
|
996
1110
|
'Use this tool to analyze the impact of changing a message. Returns all affected agents and services (producers and consumers), the teams that own them, and the blast radius of the change',
|
|
997
1111
|
explainBusinessFlow:
|
|
@@ -16,9 +16,9 @@ const likeC4InstallMessage = `LikeC4 diagrams were found, but LikeC4 is not inst
|
|
|
16
16
|
|
|
17
17
|
Install LikeC4 in your EventCatalog project:
|
|
18
18
|
|
|
19
|
-
npm install --save-dev likec4@1.
|
|
20
|
-
pnpm add -D likec4@1.
|
|
21
|
-
yarn add -D likec4@1.
|
|
19
|
+
npm install --save-dev likec4@1.55.1 @likec4/icons@1.46.4
|
|
20
|
+
pnpm add -D likec4@1.55.1 @likec4/icons@1.46.4
|
|
21
|
+
yarn add -D likec4@1.55.1 @likec4/icons@1.46.4`;
|
|
22
22
|
|
|
23
23
|
export const eventCatalogLikeC4 = async (workspaceDir: string): Promise<Plugin[]> => {
|
|
24
24
|
const enabled = hasLikeC4Sources(workspaceDir);
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"license": "SEE LICENSE IN LICENSE",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "3.
|
|
10
|
+
"version": "3.48.0",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"update-notifier": "^7.3.1",
|
|
112
112
|
"uuid": "^10.0.0",
|
|
113
113
|
"zod": "^4.3.6",
|
|
114
|
-
"@eventcatalog/linter": "1.0
|
|
114
|
+
"@eventcatalog/linter": "1.1.0",
|
|
115
115
|
"@eventcatalog/visualiser": "^3.22.1",
|
|
116
116
|
"@eventcatalog/sdk": "2.24.1"
|
|
117
117
|
},
|