@eventcatalog/core 5.4.2 → 5.5.1
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 +1 -1
- package/dist/{chunk-VSBMYXLL.js → chunk-6KR5ZLEQ.js} +1 -1
- package/dist/{chunk-XB6FJMI3.js → chunk-EBZQJP7F.js} +1 -1
- package/dist/{chunk-HV4ONKTM.js → chunk-GPIKYBQ5.js} +1 -1
- package/dist/{chunk-EXRIIYEP.js → chunk-GZLVDQPM.js} +1 -1
- package/dist/{chunk-CQ4L4SMB.js → chunk-K5QKWVI3.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +2 -2
- package/dist/eventcatalog.js +14 -14
- package/dist/federation/federate.js +3 -3
- 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/components/MDX/NodeGraph/AstroNodeGraph.tsx +2 -0
- package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +5 -0
- package/eventcatalog/src/components/SchemaExplorer/AvroSchemaViewer.tsx +5 -3
- package/eventcatalog/src/components/SchemaExplorer/JSONSchemaViewer.tsx +6 -5
- package/eventcatalog/src/components/SchemaExplorer/ProtobufSchemaViewer.tsx +6 -5
- package/eventcatalog/src/features/ai/chat-api.ts +6 -3
- package/eventcatalog/src/features/mcp/apps/architecture-diagram/shared.ts +3 -1
- package/eventcatalog/src/features/mcp/apps/architecture-diagram/view.tsx +6 -1
- package/eventcatalog/src/features/mcp/apps/generated/canvas.html +80 -68
- package/eventcatalog/src/features/mcp/apps/generated/viewer.html +87 -73
- package/eventcatalog/src/features/mcp/mcp-apps.ts +1 -1
- package/eventcatalog/src/features/mcp/mcp-scoped-tools.ts +2 -1
- package/eventcatalog/src/features/mcp/mcp-server.ts +14 -12
- package/eventcatalog/src/features/mcp/schema-viewer.ts +3 -3
- package/eventcatalog/src/features/studio/components/StudioDesigner.tsx +2 -0
- package/eventcatalog/src/features/studio/server/canvas-mcp.ts +1 -1
- package/eventcatalog/src/features/tools/catalog-tools.ts +143 -75
- package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/entity-map/index.astro +1 -0
- package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/index.astro +1 -0
- package/eventcatalog/src/pages/visualiser/_mermaid-route.ts +48 -5
- package/eventcatalog/src/pages/visualiser/designs/[id]/index.astro +1 -0
- package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/[level].mermaid.ts +18 -0
- package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/entity-map/index.astro +1 -0
- package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/index.astro +1 -0
- package/eventcatalog/src/pages/visualiser/system-context-map/index.astro +1 -0
- package/eventcatalog/src/pages/visualiser/systems/[id]/[version]/[level].mermaid.ts +18 -0
- package/eventcatalog/src/pages/visualiser/systems/[id]/[version]/index.astro +1 -0
- package/eventcatalog/src/utils/node-graphs/architecture-diagram-types.ts +7 -1
- package/eventcatalog/src/utils/node-graphs/architecture-diagram.ts +5 -2
- package/eventcatalog/src/utils/node-graphs/compact-visualiser-graph.ts +2 -0
- package/eventcatalog/src/utils/node-graphs/domain-levels-node-graph.ts +246 -29
- package/package.json +5 -5
- package/eventcatalog/src/utils/node-graphs/export-mermaid.ts +0 -375
- package/dist/{chunk-QJ7KKN2D.js → chunk-NCEZDQSW.js} +7 -7
|
@@ -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.
|
|
172
|
+
var version = "5.5.1";
|
|
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-
|
|
3
|
+
} from "../chunk-6KR5ZLEQ.js";
|
|
4
4
|
import "../chunk-AD7CL772.js";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-GZLVDQPM.js";
|
|
6
6
|
import "../chunk-YRZK7HKX.js";
|
|
7
7
|
import "../chunk-CA6WCQ2T.js";
|
|
8
8
|
import "../chunk-CPW6G62V.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-GPIKYBQ5.js";
|
|
10
10
|
import "../chunk-4G7FSRPN.js";
|
|
11
11
|
export {
|
|
12
12
|
log_build_default as default
|
package/dist/catalog-runtime.cjs
CHANGED
|
@@ -36,7 +36,7 @@ __export(catalog_runtime_exports, {
|
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(catalog_runtime_exports);
|
|
38
38
|
|
|
39
|
-
// ../../node_modules/.pnpm/tsup@8.5.0_jiti@2.7.0_postcss@8.5.
|
|
39
|
+
// ../../node_modules/.pnpm/tsup@8.5.0_jiti@2.7.0_postcss@8.5.31_tsx@4.23.15_typescript@5.9.3_yaml@2.9.1/node_modules/tsup/assets/cjs_shims.js
|
|
40
40
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
41
41
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
42
42
|
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -22,7 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
24
|
|
|
25
|
-
// ../../node_modules/.pnpm/tsup@8.5.0_jiti@2.7.0_postcss@8.5.
|
|
25
|
+
// ../../node_modules/.pnpm/tsup@8.5.0_jiti@2.7.0_postcss@8.5.31_tsx@4.23.15_typescript@5.9.3_yaml@2.9.1/node_modules/tsup/assets/cjs_shims.js
|
|
26
26
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
27
27
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
28
28
|
|
|
@@ -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.
|
|
177
|
+
var version = "5.5.1";
|
|
178
178
|
|
|
179
179
|
// src/constants.ts
|
|
180
180
|
var VERSION = version;
|
package/dist/eventcatalog.js
CHANGED
|
@@ -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-
|
|
10
|
+
} from "./chunk-6KR5ZLEQ.js";
|
|
11
11
|
import {
|
|
12
12
|
getLicenseStatus,
|
|
13
13
|
printLicenseStatus
|
|
14
14
|
} from "./chunk-AD7CL772.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-GZLVDQPM.js";
|
|
16
16
|
import "./chunk-YRZK7HKX.js";
|
|
17
17
|
import "./chunk-CA6WCQ2T.js";
|
|
18
18
|
import "./chunk-CPW6G62V.js";
|
|
@@ -20,17 +20,17 @@ import {
|
|
|
20
20
|
FederationConflictError,
|
|
21
21
|
FederationDiagnosticError,
|
|
22
22
|
federateCatalog
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-WRNH5C3U.js";
|
|
25
|
-
import "./chunk-5EPNFDT5.js";
|
|
26
|
-
import "./chunk-A2RZR3U4.js";
|
|
27
|
-
import "./chunk-SDZQJTJW.js";
|
|
28
|
-
import "./chunk-352FGP6W.js";
|
|
23
|
+
} from "./chunk-NCEZDQSW.js";
|
|
29
24
|
import "./chunk-R7Z5ALYI.js";
|
|
30
25
|
import {
|
|
31
26
|
getFederationDiagnosticCounts,
|
|
32
27
|
getVisibleFederationDiagnostics
|
|
33
28
|
} from "./chunk-JJPB6EOZ.js";
|
|
29
|
+
import "./chunk-WRNH5C3U.js";
|
|
30
|
+
import "./chunk-5EPNFDT5.js";
|
|
31
|
+
import "./chunk-A2RZR3U4.js";
|
|
32
|
+
import "./chunk-SDZQJTJW.js";
|
|
33
|
+
import "./chunk-352FGP6W.js";
|
|
34
34
|
import {
|
|
35
35
|
getProjectOutDir,
|
|
36
36
|
isAuthEnabled,
|
|
@@ -39,10 +39,10 @@ import {
|
|
|
39
39
|
} from "./chunk-NKNOXQ62.js";
|
|
40
40
|
import {
|
|
41
41
|
generate
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-K5QKWVI3.js";
|
|
43
43
|
import {
|
|
44
44
|
logger
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-EBZQJP7F.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-
|
|
82
|
+
} from "./chunk-GPIKYBQ5.js";
|
|
83
83
|
import {
|
|
84
84
|
getEventCatalogConfigFile,
|
|
85
85
|
verifyRequiredFieldsAreInCatalogConfigFile
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
FederationConflictError,
|
|
3
3
|
FederationDiagnosticError,
|
|
4
4
|
federateCatalog
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-NCEZDQSW.js";
|
|
6
|
+
import "../chunk-R7Z5ALYI.js";
|
|
7
|
+
import "../chunk-JJPB6EOZ.js";
|
|
6
8
|
import "../chunk-WRNH5C3U.js";
|
|
7
9
|
import "../chunk-5EPNFDT5.js";
|
|
8
10
|
import "../chunk-A2RZR3U4.js";
|
|
9
11
|
import "../chunk-SDZQJTJW.js";
|
|
10
12
|
import "../chunk-352FGP6W.js";
|
|
11
|
-
import "../chunk-R7Z5ALYI.js";
|
|
12
|
-
import "../chunk-JJPB6EOZ.js";
|
|
13
13
|
import "../chunk-4G7FSRPN.js";
|
|
14
14
|
export {
|
|
15
15
|
FederationConflictError,
|
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.
|
|
108
|
+
var version = "5.5.1";
|
|
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-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-K5QKWVI3.js";
|
|
4
|
+
import "./chunk-EBZQJP7F.js";
|
|
5
|
+
import "./chunk-GPIKYBQ5.js";
|
|
6
6
|
import "./chunk-4G7FSRPN.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -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
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect, useRef } from 'react';
|
|
2
|
+
import { ChevronRightIcon } from '@heroicons/react/20/solid';
|
|
2
3
|
|
|
3
4
|
interface AvroSchemaViewerProps {
|
|
4
5
|
schema: any;
|
|
@@ -124,14 +125,15 @@ const AvroField = ({ field, level, expand, showRequired }: AvroFieldProps) => {
|
|
|
124
125
|
<div className={`avro-field-container mb-2 border-l border-[rgb(var(--ec-page-border))] ${indentClass}`}>
|
|
125
126
|
<div className="flex space-x-2">
|
|
126
127
|
{/* Collapse/Expand button */}
|
|
127
|
-
<div className="flex-shrink-0 w-4
|
|
128
|
+
<div className="flex-shrink-0 w-4">
|
|
128
129
|
{hasNested ? (
|
|
129
130
|
<button
|
|
130
131
|
onClick={() => setIsExpanded(!isExpanded)}
|
|
131
|
-
className="avro-field-toggle text-[rgb(var(--ec-page-text-muted))] hover:text-[rgb(var(--ec-page-text))]
|
|
132
|
+
className="avro-field-toggle flex h-5 w-4 items-center justify-center text-[rgb(var(--ec-page-text-muted))] hover:text-[rgb(var(--ec-page-text))]"
|
|
132
133
|
aria-expanded={isExpanded}
|
|
134
|
+
aria-label={`Toggle ${field.name}`}
|
|
133
135
|
>
|
|
134
|
-
<
|
|
136
|
+
<ChevronRightIcon className={`h-3.5 w-3.5 transition-transform ${isExpanded ? 'rotate-90' : ''}`} />
|
|
135
137
|
</button>
|
|
136
138
|
) : null}
|
|
137
139
|
</div>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect, useRef, useMemo, useId } from 'react';
|
|
2
|
+
import { ChevronRightIcon } from '@heroicons/react/20/solid';
|
|
2
3
|
|
|
3
4
|
interface JSONSchemaViewerProps {
|
|
4
5
|
schema: any;
|
|
@@ -323,20 +324,20 @@ const SchemaProperty = ({ name, details, isRequired, level, isListItem = false,
|
|
|
323
324
|
type="button"
|
|
324
325
|
aria-expanded={isExpanded}
|
|
325
326
|
aria-controls={contentId}
|
|
327
|
+
aria-label={`Toggle ${name}`}
|
|
326
328
|
onClick={() => setIsExpanded(!isExpanded)}
|
|
327
|
-
className="property-toggle text-[rgb(var(--ec-page-text-muted))] hover:text-[rgb(var(--ec-page-text))]
|
|
329
|
+
className="property-toggle flex h-5 w-4 flex-shrink-0 items-center justify-center text-[rgb(var(--ec-page-text-muted))] hover:text-[rgb(var(--ec-page-text))] focus:outline-hidden"
|
|
328
330
|
>
|
|
329
|
-
<
|
|
330
|
-
<span className={`icon-expanded font-mono text-xs ${!isExpanded ? 'hidden' : ''}`}>v</span>
|
|
331
|
+
<ChevronRightIcon className={`h-3.5 w-3.5 transition-transform ${isExpanded ? 'rotate-90' : ''}`} />
|
|
331
332
|
</button>
|
|
332
333
|
) : (
|
|
333
|
-
<div className="w-
|
|
334
|
+
<div className="w-4 h-5 flex-shrink-0" />
|
|
334
335
|
)}
|
|
335
336
|
|
|
336
337
|
<div className="flex-grow">
|
|
337
338
|
<div className="-mx-1 rounded px-1 transition-colors hover:bg-[rgb(var(--ec-content-hover))]">
|
|
338
339
|
<div className="flex justify-between items-baseline">
|
|
339
|
-
<div>
|
|
340
|
+
<div className="text-sm">
|
|
340
341
|
<span className="font-semibold text-[rgb(var(--ec-page-text))] text-sm">{name}</span>
|
|
341
342
|
<span className="ml-1.5 text-[rgb(var(--ec-accent))] font-mono text-xs">
|
|
342
343
|
{hasVariants ? (details.variantType === 'anyOf' ? 'anyOf' : 'oneOf') : formatType(details.type)}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect, useRef, useMemo } from 'react';
|
|
2
|
+
import { ChevronRightIcon } from '@heroicons/react/20/solid';
|
|
2
3
|
import type { ProtobufSchema, ProtobufMessage, ProtobufEnum, ProtobufField } from '@utils/protobuf-schema';
|
|
3
4
|
import {
|
|
4
5
|
formatProtobufOptionValue,
|
|
@@ -144,20 +145,20 @@ const ProtobufFieldRow = ({ field, level, expand, showRequired, registry, packag
|
|
|
144
145
|
<button
|
|
145
146
|
type="button"
|
|
146
147
|
aria-expanded={isExpanded}
|
|
148
|
+
aria-label={`Toggle ${field.name}`}
|
|
147
149
|
onClick={() => setIsExpanded(!isExpanded)}
|
|
148
|
-
className="proto-field-toggle text-[rgb(var(--ec-page-text-muted))] hover:text-[rgb(var(--ec-page-text))]
|
|
150
|
+
className="proto-field-toggle flex h-5 w-4 flex-shrink-0 items-center justify-center text-[rgb(var(--ec-page-text-muted))] hover:text-[rgb(var(--ec-page-text))] focus:outline-hidden"
|
|
149
151
|
>
|
|
150
|
-
<
|
|
151
|
-
<span className={`icon-expanded font-mono text-xs ${!isExpanded ? 'hidden' : ''}`}>v</span>
|
|
152
|
+
<ChevronRightIcon className={`h-3.5 w-3.5 transition-transform ${isExpanded ? 'rotate-90' : ''}`} />
|
|
152
153
|
</button>
|
|
153
154
|
) : (
|
|
154
|
-
<div className="w-
|
|
155
|
+
<div className="w-4 h-5 flex-shrink-0" />
|
|
155
156
|
)}
|
|
156
157
|
|
|
157
158
|
<div className="flex-grow">
|
|
158
159
|
<div className="-mx-1 rounded px-1 transition-colors hover:bg-[rgb(var(--ec-content-hover))]">
|
|
159
160
|
<div className="flex justify-between items-baseline">
|
|
160
|
-
<div>
|
|
161
|
+
<div className="text-sm">
|
|
161
162
|
<span className="proto-field-name font-semibold text-[rgb(var(--ec-page-text))] text-sm">{field.name}</span>
|
|
162
163
|
<span
|
|
163
164
|
className="ml-1.5 text-[rgb(var(--ec-accent))] font-mono text-xs"
|
|
@@ -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
|
-
|
|
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
|