@eventcatalog/core 5.4.2 → 5.5.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.
Files changed (44) hide show
  1. package/dist/analytics/analytics.cjs +1 -1
  2. package/dist/analytics/analytics.js +2 -2
  3. package/dist/analytics/log-build.cjs +1 -1
  4. package/dist/analytics/log-build.js +3 -3
  5. package/dist/{chunk-VSBMYXLL.js → chunk-3TREOJOK.js} +1 -1
  6. package/dist/{chunk-CQ4L4SMB.js → chunk-754U4T7K.js} +1 -1
  7. package/dist/{chunk-EXRIIYEP.js → chunk-RDF2OMEF.js} +1 -1
  8. package/dist/{chunk-XB6FJMI3.js → chunk-UBDTKNFS.js} +1 -1
  9. package/dist/{chunk-HV4ONKTM.js → chunk-WPFA7AGD.js} +1 -1
  10. package/dist/constants.cjs +1 -1
  11. package/dist/constants.js +1 -1
  12. package/dist/eventcatalog.cjs +1 -1
  13. package/dist/eventcatalog.js +8 -8
  14. package/dist/generate.cjs +1 -1
  15. package/dist/generate.js +3 -3
  16. package/dist/utils/cli-logger.cjs +1 -1
  17. package/dist/utils/cli-logger.js +2 -2
  18. package/eventcatalog/src/components/MDX/NodeGraph/AstroNodeGraph.tsx +2 -0
  19. package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +5 -0
  20. package/eventcatalog/src/features/ai/chat-api.ts +6 -3
  21. package/eventcatalog/src/features/mcp/apps/architecture-diagram/shared.ts +3 -1
  22. package/eventcatalog/src/features/mcp/apps/architecture-diagram/view.tsx +6 -1
  23. package/eventcatalog/src/features/mcp/apps/generated/canvas.html +82 -70
  24. package/eventcatalog/src/features/mcp/apps/generated/viewer.html +85 -71
  25. package/eventcatalog/src/features/mcp/mcp-scoped-tools.ts +2 -1
  26. package/eventcatalog/src/features/mcp/mcp-server.ts +9 -8
  27. package/eventcatalog/src/features/studio/components/StudioDesigner.tsx +2 -0
  28. package/eventcatalog/src/features/tools/catalog-tools.ts +8 -1
  29. package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/entity-map/index.astro +1 -0
  30. package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/index.astro +1 -0
  31. package/eventcatalog/src/pages/visualiser/_mermaid-route.ts +48 -5
  32. package/eventcatalog/src/pages/visualiser/designs/[id]/index.astro +1 -0
  33. package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/[level].mermaid.ts +18 -0
  34. package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/entity-map/index.astro +1 -0
  35. package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/index.astro +1 -0
  36. package/eventcatalog/src/pages/visualiser/system-context-map/index.astro +1 -0
  37. package/eventcatalog/src/pages/visualiser/systems/[id]/[version]/[level].mermaid.ts +18 -0
  38. package/eventcatalog/src/pages/visualiser/systems/[id]/[version]/index.astro +1 -0
  39. package/eventcatalog/src/utils/node-graphs/architecture-diagram-types.ts +7 -1
  40. package/eventcatalog/src/utils/node-graphs/architecture-diagram.ts +5 -2
  41. package/eventcatalog/src/utils/node-graphs/compact-visualiser-graph.ts +2 -0
  42. package/eventcatalog/src/utils/node-graphs/domain-levels-node-graph.ts +246 -29
  43. package/package.json +3 -3
  44. package/eventcatalog/src/utils/node-graphs/export-mermaid.ts +0 -375
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(analytics_exports);
36
36
  var import_os = __toESM(require("os"), 1);
37
37
 
38
38
  // package.json
39
- var version = "5.4.2";
39
+ var version = "5.5.0";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-EXRIIYEP.js";
3
+ } from "../chunk-RDF2OMEF.js";
4
4
  import "../chunk-CPW6G62V.js";
5
- import "../chunk-HV4ONKTM.js";
5
+ import "../chunk-WPFA7AGD.js";
6
6
  export {
7
7
  raiseEvent
8
8
  };
@@ -169,7 +169,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
169
169
  var import_os = __toESM(require("os"), 1);
170
170
 
171
171
  // package.json
172
- var version = "5.4.2";
172
+ var version = "5.5.0";
173
173
 
174
174
  // src/constants.ts
175
175
  var VERSION = version;
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-VSBMYXLL.js";
3
+ } from "../chunk-3TREOJOK.js";
4
4
  import "../chunk-AD7CL772.js";
5
- import "../chunk-EXRIIYEP.js";
5
+ import "../chunk-RDF2OMEF.js";
6
6
  import "../chunk-YRZK7HKX.js";
7
7
  import "../chunk-CA6WCQ2T.js";
8
8
  import "../chunk-CPW6G62V.js";
9
- import "../chunk-HV4ONKTM.js";
9
+ import "../chunk-WPFA7AGD.js";
10
10
  import "../chunk-4G7FSRPN.js";
11
11
  export {
12
12
  log_build_default as default
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-AD7CL772.js";
4
4
  import {
5
5
  raiseEvent
6
- } from "./chunk-EXRIIYEP.js";
6
+ } from "./chunk-RDF2OMEF.js";
7
7
  import {
8
8
  countResources,
9
9
  hashCatalogContent,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-XB6FJMI3.js";
3
+ } from "./chunk-UBDTKNFS.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-CPW6G62V.js";
5
5
  import {
6
6
  VERSION
7
- } from "./chunk-HV4ONKTM.js";
7
+ } from "./chunk-WPFA7AGD.js";
8
8
 
9
9
  // src/analytics/analytics.js
10
10
  import os from "os";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-HV4ONKTM.js";
3
+ } from "./chunk-WPFA7AGD.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "5.4.2";
2
+ var version = "5.5.0";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "5.4.2";
28
+ var version = "5.5.0";
29
29
 
30
30
  // src/constants.ts
31
31
  var VERSION = version;
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-HV4ONKTM.js";
3
+ } from "./chunk-WPFA7AGD.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -174,7 +174,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
174
174
  var import_picocolors = __toESM(require("picocolors"), 1);
175
175
 
176
176
  // package.json
177
- var version = "5.4.2";
177
+ var version = "5.5.0";
178
178
 
179
179
  // src/constants.ts
180
180
  var VERSION = version;
@@ -1,18 +1,18 @@
1
+ import {
2
+ stopChildWithParent
3
+ } from "./chunk-S5GWAUG5.js";
1
4
  import {
2
5
  runMigrations
3
6
  } from "./chunk-XUAF2H54.js";
4
7
  import "./chunk-CA4U2JP7.js";
5
- import {
6
- stopChildWithParent
7
- } from "./chunk-S5GWAUG5.js";
8
8
  import {
9
9
  log_build_default
10
- } from "./chunk-VSBMYXLL.js";
10
+ } from "./chunk-3TREOJOK.js";
11
11
  import {
12
12
  getLicenseStatus,
13
13
  printLicenseStatus
14
14
  } from "./chunk-AD7CL772.js";
15
- import "./chunk-EXRIIYEP.js";
15
+ import "./chunk-RDF2OMEF.js";
16
16
  import "./chunk-YRZK7HKX.js";
17
17
  import "./chunk-CA6WCQ2T.js";
18
18
  import "./chunk-CPW6G62V.js";
@@ -39,10 +39,10 @@ import {
39
39
  } from "./chunk-NKNOXQ62.js";
40
40
  import {
41
41
  generate
42
- } from "./chunk-CQ4L4SMB.js";
42
+ } from "./chunk-754U4T7K.js";
43
43
  import {
44
44
  logger
45
- } from "./chunk-XB6FJMI3.js";
45
+ } from "./chunk-UBDTKNFS.js";
46
46
  import {
47
47
  resolve_catalog_dependencies_default
48
48
  } from "./chunk-PD7KTSYN.js";
@@ -79,7 +79,7 @@ import {
79
79
  } from "./chunk-LFQJXLHG.js";
80
80
  import {
81
81
  VERSION
82
- } from "./chunk-HV4ONKTM.js";
82
+ } from "./chunk-WPFA7AGD.js";
83
83
  import {
84
84
  getEventCatalogConfigFile,
85
85
  verifyRequiredFieldsAreInCatalogConfigFile
package/dist/generate.cjs CHANGED
@@ -105,7 +105,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
105
105
  var import_picocolors = __toESM(require("picocolors"), 1);
106
106
 
107
107
  // package.json
108
- var version = "5.4.2";
108
+ var version = "5.5.0";
109
109
 
110
110
  // src/constants.ts
111
111
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-CQ4L4SMB.js";
4
- import "./chunk-XB6FJMI3.js";
5
- import "./chunk-HV4ONKTM.js";
3
+ } from "./chunk-754U4T7K.js";
4
+ import "./chunk-UBDTKNFS.js";
5
+ import "./chunk-WPFA7AGD.js";
6
6
  import "./chunk-4G7FSRPN.js";
7
7
  export {
8
8
  generate
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(cli_logger_exports);
36
36
  var import_picocolors = __toESM(require("picocolors"), 1);
37
37
 
38
38
  // package.json
39
- var version = "5.4.2";
39
+ var version = "5.5.0";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  logger
3
- } from "../chunk-XB6FJMI3.js";
4
- import "../chunk-HV4ONKTM.js";
3
+ } from "../chunk-UBDTKNFS.js";
4
+ import "../chunk-WPFA7AGD.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -78,6 +78,8 @@ interface AstroNodeGraphProps {
78
78
  hiddenMessagesGraph?: { nodes: Node[]; edges: Edge[] };
79
79
  // The kind of diagram, so the level is remembered for each kind
80
80
  preferenceScope?: string;
81
+ // On the visualiser's own pages: keep the Mermaid view in the URL (`?render=mermaid`)
82
+ syncRenderModeWithUrl?: boolean;
81
83
  // Group a flow's steps into swimlanes to start with
82
84
  swimlanes?: FlowGroupBy;
83
85
  // The Studio API's address, when Studio is on: the menu can then start a canvas from the diagram
@@ -66,6 +66,9 @@ interface Props {
66
66
  overview?: { label: string };
67
67
  // Flows only: group the steps into swimlanes to start with
68
68
  lanes?: FlowGroupBy;
69
+ // The visualiser's own pages: keep the Mermaid view in the URL (`?render=mermaid`), so links open in it.
70
+ // Not docs pages, which can show several diagrams.
71
+ syncRenderModeWithUrl?: boolean;
69
72
  }
70
73
 
71
74
  const {
@@ -84,6 +87,7 @@ const {
84
87
  disableMessageAnimation,
85
88
  overview,
86
89
  lanes,
90
+ syncRenderModeWithUrl = false,
87
91
  } = Astro.props;
88
92
 
89
93
  let nodes = [],
@@ -263,6 +267,7 @@ if (overview && levelsOverview) {
263
267
  preferenceScope={collection}
264
268
  swimlanes={lanes}
265
269
  studioApiUrl={studioApiUrl}
270
+ syncRenderModeWithUrl={syncRenderModeWithUrl}
266
271
  />
267
272
  </div>
268
273
 
@@ -29,6 +29,7 @@ import {
29
29
  resourceCollectionSchema,
30
30
  messageCollectionSchema,
31
31
  visualiserCollectionSchema,
32
+ architectureDiagramDetailSchema,
32
33
  toolDescriptions,
33
34
  } from '@features/tools/catalog-tools';
34
35
 
@@ -136,7 +137,8 @@ The referer URL is: ${referrer}
136
137
 
137
138
  IMPORTANT: When the user is on a visualiser page (/visualiser/*) or asks about architecture, dependencies, data flow, or connections:
138
139
  - Use the getArchitectureDiagramAsMermaid tool to fetch the architecture diagram
139
- - The mermaid code shows all the connections between resources (services, events, channels, etc.)
140
+ - The mermaid code shows all the connections between resources (services, events, channels, etc.), with domains and systems as subgraphs around what's in them
141
+ - For a high-level answer about a domain or system, pass detail "overview" (domains, systems and their relationships) or "services" (services and data stores) instead of the full diagram
140
142
  - Use this to provide accurate, contextual answers about the architecture
141
143
 
142
144
  Sometimes the user will be on the specification page (openapi, asyncapi, graphql) for a resource too
@@ -336,9 +338,10 @@ export const POST = async ({ request }: APIContext<{ question: string; messages:
336
338
  'The collection of the resource (events, commands, queries, services, domains, systems, flows, containers, data-products)'
337
339
  )
338
340
  .default('services'),
341
+ detail: architectureDiagramDetailSchema.optional(),
339
342
  }),
340
- execute: async ({ resourceId, resourceVersion, resourceCollection }) => {
341
- return await getArchitectureDiagramImpl({ resourceId, resourceVersion, resourceCollection });
343
+ execute: async ({ resourceId, resourceVersion, resourceCollection, detail }) => {
344
+ return await getArchitectureDiagramImpl({ resourceId, resourceVersion, resourceCollection, detail });
342
345
  },
343
346
  }),
344
347
  getCustomDocs: tool({
@@ -2,7 +2,7 @@
2
2
  * Shared by the MCP server and the architecture diagram MCP App view (view.tsx, shown by the viewer in ../viewer).
3
3
  * Kept free of server-only imports so it can be bundled into the view.
4
4
  */
5
- import type { ArchitectureDiagramView } from '@utils/node-graphs/architecture-diagram-types';
5
+ import type { ArchitectureDiagramDetail, ArchitectureDiagramView } from '@utils/node-graphs/architecture-diagram-types';
6
6
 
7
7
  export type ArchitectureDiagramPayload = {
8
8
  resource: { collection: string; id: string; version: string; name: string };
@@ -11,4 +11,6 @@ export type ArchitectureDiagramPayload = {
11
11
  /** Path of the resource's Diagram page in EventCatalog */
12
12
  visualiserPath: string;
13
13
  view: ArchitectureDiagramView;
14
+ /** The level the diagram was asked for, to open at it (otherwise the diagram's own default) */
15
+ detail?: ArchitectureDiagramDetail;
14
16
  };
@@ -11,6 +11,9 @@ import visualiserStyles from '@eventcatalog/visualiser/styles.css?inline';
11
11
  import type { App, McpUiHostContext } from '@modelcontextprotocol/ext-apps';
12
12
  import type { Node } from '@xyflow/react';
13
13
  import type { ArchitectureDiagramPayload } from './shared';
14
+
15
+ /** The diagram's level for each level of detail an MCP client can ask for */
16
+ const LEVEL_OF_DETAIL = { overview: 1, services: 2, full: 3 } as const;
14
17
  import { NodeChat, describeNode, describeNodeForModel, type SelectedNode } from './node-chat';
15
18
  import { parseAskLink, parseDiagramLink, withAskMenuItem, type DiagramLink } from './links';
16
19
  import { getToolResultPayload } from '../shared/app-view';
@@ -421,7 +424,8 @@ export function ArchitectureDiagramView({ app, payload: toolPayload, hostContext
421
424
  />
422
425
  )}
423
426
  </div>
424
- <div style={{ display: 'none' }} key={`${graphId}-graph`}>
427
+ {/* Again for another level of the same diagram, so it opens at it */}
428
+ <div style={{ display: 'none' }} key={`${graphId}-${payload.detail ?? 'default'}-graph`}>
425
429
  <NodeGraph
426
430
  id={graphId}
427
431
  nodes={graph.nodes}
@@ -436,6 +440,7 @@ export function ArchitectureDiagramView({ app, payload: toolPayload, hostContext
436
440
  }
437
441
  hiddenMessagesGraph={graph.hiddenMessages}
438
442
  preferenceScope={resource.collection}
443
+ initialLevel={payload.detail ? LEVEL_OF_DETAIL[payload.detail] : undefined}
439
444
  mode="full"
440
445
  linkTo="docs"
441
446
  showSearch