@eventcatalog/core 5.0.0-beta.7 → 5.0.0-beta.8
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 +3 -1
- package/dist/analytics/log-build.js +4 -4
- package/dist/{chunk-BOKAG5XC.js → chunk-4W55ZOOS.js} +2 -2
- package/dist/{chunk-PIYJM642.js → chunk-AWOO63ME.js} +70 -44
- package/dist/{chunk-3VBB2ZMP.js → chunk-C6T2AAFR.js} +1 -1
- package/dist/{chunk-MDWB5HLO.js → chunk-ENAG6UH7.js} +5 -0
- package/dist/{chunk-S7ODHVII.js → chunk-PU25TOOJ.js} +1 -1
- package/dist/{chunk-FARBIZ7Y.js → chunk-RDIZJ7UT.js} +1 -1
- package/dist/{chunk-SJJKWZYZ.js → chunk-T4G3VVZ4.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +138 -90
- package/dist/eventcatalog.config.d.cts +47 -0
- package/dist/eventcatalog.config.d.ts +47 -0
- package/dist/eventcatalog.js +30 -11
- package/dist/features.cjs +8 -2
- package/dist/features.d.cts +3 -1
- package/dist/features.d.ts +3 -1
- package/dist/features.js +5 -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/dist/utils/license-status.cjs +70 -44
- package/dist/utils/license-status.d.cts +14 -5
- package/dist/utils/license-status.d.ts +14 -5
- package/dist/utils/license-status.js +1 -1
- package/eventcatalog/integrations/studio-server.mjs +15 -3
- package/eventcatalog/src/components/Header.astro +3 -3
- package/eventcatalog/src/features/integrations/eventcatalog-features.ts +10 -2
- package/eventcatalog/src/features/mcp/apps/canvas/shared.ts +9 -1
- package/eventcatalog/src/features/mcp/apps/canvas/view.tsx +9 -2
- package/eventcatalog/src/features/mcp/apps/generated/canvas.html +70 -69
- package/eventcatalog/src/features/mcp/apps/generated/viewer.html +69 -69
- package/eventcatalog/src/features/mcp/mcp-server.ts +5 -3
- package/eventcatalog/src/features/studio/agent-choreography.ts +8 -5
- package/eventcatalog/src/features/studio/canvas-actions.ts +148 -21
- package/eventcatalog/src/features/studio/canvas-doc.ts +138 -9
- package/eventcatalog/src/features/studio/canvas-preview.ts +53 -0
- package/eventcatalog/src/features/studio/catalog-resources.ts +5 -2
- package/eventcatalog/src/features/studio/clipboard.ts +97 -0
- package/eventcatalog/src/features/studio/components/CanvasControls.tsx +4 -3
- package/eventcatalog/src/features/studio/components/CanvasHeader.tsx +39 -22
- package/eventcatalog/src/features/studio/components/CanvasStatusMenu.tsx +117 -0
- package/eventcatalog/src/features/studio/components/Comments.tsx +345 -30
- package/eventcatalog/src/features/studio/components/ConnectAgentDialog.tsx +140 -76
- package/eventcatalog/src/features/studio/components/ConnectionsChooser.tsx +144 -0
- package/eventcatalog/src/features/studio/components/ContainerChooser.tsx +1 -1
- package/eventcatalog/src/features/studio/components/DragGhost.tsx +115 -0
- package/eventcatalog/src/features/studio/components/JoinForm.tsx +0 -24
- package/eventcatalog/src/features/studio/components/LeftPanel.tsx +131 -35
- package/eventcatalog/src/features/studio/components/Picture.tsx +21 -0
- package/eventcatalog/src/features/studio/components/Presence.tsx +2 -0
- package/eventcatalog/src/features/studio/components/PropertiesPanel.tsx +187 -50
- package/eventcatalog/src/features/studio/components/ShareDialog.tsx +260 -0
- package/eventcatalog/src/features/studio/components/StudioDesigner.tsx +442 -40
- package/eventcatalog/src/features/studio/components/canvas-nodes.tsx +198 -22
- package/eventcatalog/src/features/studio/components/icons.ts +6 -1
- package/eventcatalog/src/features/studio/components/status.ts +30 -1
- package/eventcatalog/src/features/studio/edges.ts +2 -0
- package/eventcatalog/src/features/studio/grouping.ts +95 -2
- package/eventcatalog/src/features/studio/hooks/presence-store.ts +5 -1
- package/eventcatalog/src/features/studio/hooks/use-canvas-webmcp.ts +13 -3
- package/eventcatalog/src/features/studio/hooks/use-comments.ts +8 -1
- package/eventcatalog/src/features/studio/hooks/use-follow-camera.ts +7 -2
- package/eventcatalog/src/features/studio/hooks/use-studio-flow.ts +174 -27
- package/eventcatalog/src/features/studio/identity.ts +35 -0
- package/eventcatalog/src/features/studio/layout.ts +7 -4
- package/eventcatalog/src/features/studio/levels.ts +138 -72
- package/eventcatalog/src/features/studio/node-types.ts +35 -3
- package/eventcatalog/src/features/studio/pages/[id].astro +7 -2
- package/eventcatalog/src/features/studio/pages/index.astro +555 -2
- package/eventcatalog/src/features/studio/pages/new.astro +24 -0
- package/eventcatalog/src/features/studio/pages/wake.ts +15 -0
- package/eventcatalog/src/features/studio/server/canvas-mcp.ts +48 -13
- package/eventcatalog/src/features/studio/server/runtime.ts +193 -14
- package/eventcatalog/src/features/studio/server/sign-in.ts +18 -0
- package/eventcatalog/src/features/studio/server/storage.ts +110 -0
- package/eventcatalog/src/features/studio/studio.css +184 -0
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +1 -1
- package/eventcatalog/src/utils/feature.ts +7 -3
- package/eventcatalog/src/utils/node-graphs/export-mermaid.ts +0 -2
- package/package.json +4 -4
package/dist/features.d.cts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare const getProjectOutDir: () => Promise<any>;
|
|
2
2
|
declare const isOutputServer: () => Promise<boolean>;
|
|
3
|
+
/** EventCatalog Studio in production (server output, studio.enabled) */
|
|
4
|
+
declare const isStudioEnabled: () => Promise<boolean>;
|
|
3
5
|
declare const isIndexedSearchEnabled: () => Promise<boolean>;
|
|
4
6
|
declare const isAuthEnabled: () => Promise<boolean>;
|
|
5
7
|
|
|
6
|
-
export { getProjectOutDir, isAuthEnabled, isIndexedSearchEnabled, isOutputServer };
|
|
8
|
+
export { getProjectOutDir, isAuthEnabled, isIndexedSearchEnabled, isOutputServer, isStudioEnabled };
|
package/dist/features.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare const getProjectOutDir: () => Promise<any>;
|
|
2
2
|
declare const isOutputServer: () => Promise<boolean>;
|
|
3
|
+
/** EventCatalog Studio in production (server output, studio.enabled) */
|
|
4
|
+
declare const isStudioEnabled: () => Promise<boolean>;
|
|
3
5
|
declare const isIndexedSearchEnabled: () => Promise<boolean>;
|
|
4
6
|
declare const isAuthEnabled: () => Promise<boolean>;
|
|
5
7
|
|
|
6
|
-
export { getProjectOutDir, isAuthEnabled, isIndexedSearchEnabled, isOutputServer };
|
|
8
|
+
export { getProjectOutDir, isAuthEnabled, isIndexedSearchEnabled, isOutputServer, isStudioEnabled };
|
package/dist/features.js
CHANGED
|
@@ -2,12 +2,14 @@ import {
|
|
|
2
2
|
getProjectOutDir,
|
|
3
3
|
isAuthEnabled,
|
|
4
4
|
isIndexedSearchEnabled,
|
|
5
|
-
isOutputServer
|
|
6
|
-
|
|
5
|
+
isOutputServer,
|
|
6
|
+
isStudioEnabled
|
|
7
|
+
} from "./chunk-ENAG6UH7.js";
|
|
7
8
|
import "./chunk-RFIXKATC.js";
|
|
8
9
|
export {
|
|
9
10
|
getProjectOutDir,
|
|
10
11
|
isAuthEnabled,
|
|
11
12
|
isIndexedSearchEnabled,
|
|
12
|
-
isOutputServer
|
|
13
|
+
isOutputServer,
|
|
14
|
+
isStudioEnabled
|
|
13
15
|
};
|
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 = "5.0.0-beta.
|
|
115
|
+
var version = "5.0.0-beta.8";
|
|
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-T4G3VVZ4.js";
|
|
4
|
+
import "./chunk-PU25TOOJ.js";
|
|
5
|
+
import "./chunk-RDIZJ7UT.js";
|
|
6
6
|
import "./chunk-RFIXKATC.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -37,6 +37,7 @@ __export(license_status_exports, {
|
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(license_status_exports);
|
|
39
39
|
var import_boxen = __toESM(require("boxen"), 1);
|
|
40
|
+
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
40
41
|
var import_license2 = require("@eventcatalog/license");
|
|
41
42
|
|
|
42
43
|
// eventcatalog/src/utils/trial.ts
|
|
@@ -159,75 +160,100 @@ var getLicenseAnalytics = (license = { state: "none" }, tsd) => ({
|
|
|
159
160
|
});
|
|
160
161
|
var formatDate = (date) => date.toLocaleDateString(void 0, { dateStyle: "medium" });
|
|
161
162
|
var formatDays = (days) => `${days} ${days === 1 ? "day" : "days"}`;
|
|
162
|
-
var
|
|
163
|
+
var PLAIN = { bold: (text) => text, dim: (text) => text, link: (text) => text };
|
|
164
|
+
var COLOURS = { bold: import_picocolors.default.bold, dim: import_picocolors.default.dim, link: (text) => import_picocolors.default.cyan(text) };
|
|
165
|
+
var render = ({ headline, rows, links }, colours) => {
|
|
166
|
+
const width = Math.max(0, ...[...rows, ...links].map(([label]) => label.length));
|
|
167
|
+
const row = ([label, value]) => `${colours.dim(label.padEnd(width))} ${value}`;
|
|
168
|
+
return [
|
|
169
|
+
colours.bold(headline),
|
|
170
|
+
...rows.length ? ["", ...rows.map(row)] : [],
|
|
171
|
+
...links.length ? ["", ...links.map(([label, url]) => row([label, colours.link(url)]))] : []
|
|
172
|
+
].join("\n");
|
|
173
|
+
};
|
|
174
|
+
var message = (content) => ({
|
|
175
|
+
...content,
|
|
176
|
+
text: render(content, PLAIN)
|
|
177
|
+
});
|
|
178
|
+
var getTrialRow = (tsd, now) => {
|
|
163
179
|
const trial = getTrialStatus(tsd, now);
|
|
164
180
|
if (!trial) return;
|
|
165
|
-
return
|
|
181
|
+
return [
|
|
182
|
+
"Trial",
|
|
183
|
+
trial.ended ? `Ended ${formatDate(trial.endsAt)}` : `${formatDays(trial.daysLeft)} left of ${TRIAL_LENGTH_DAYS} (ends ${formatDate(trial.endsAt)})`
|
|
184
|
+
];
|
|
166
185
|
};
|
|
167
186
|
var getLicenseStatusMessage = (license, tsd, now = Date.now()) => {
|
|
187
|
+
const licensing = ["Licensing", LICENSE_FAQ_URL];
|
|
188
|
+
const renew = ["Renew", LICENSE_RENEW_URL];
|
|
189
|
+
const licensedTo = "org" in license && license.org ? [["Licensed to", license.org]] : [];
|
|
168
190
|
if (license.state === "licensed") {
|
|
169
191
|
const daysLeft = Math.max(0, Math.ceil((license.expiresAt.getTime() - now) / DAY_IN_MS2));
|
|
170
|
-
const licensedTo = license.org ? `Licensed to ${license.org}` : "Licensed";
|
|
171
192
|
if (daysLeft < LICENSE_REMINDER_DAYS) {
|
|
172
|
-
return {
|
|
173
|
-
title: "EventCatalog
|
|
193
|
+
return message({
|
|
194
|
+
title: "EventCatalog license",
|
|
174
195
|
color: "yellow",
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
].join("\n")
|
|
180
|
-
};
|
|
196
|
+
headline: `Your commercial license expires in ${formatDays(daysLeft)}`,
|
|
197
|
+
rows: [...licensedTo, ["Expires", formatDate(license.expiresAt)]],
|
|
198
|
+
links: [renew]
|
|
199
|
+
});
|
|
181
200
|
}
|
|
182
|
-
return {
|
|
183
|
-
title: "EventCatalog
|
|
201
|
+
return message({
|
|
202
|
+
title: "EventCatalog license",
|
|
184
203
|
color: "green",
|
|
185
|
-
|
|
186
|
-
Valid until
|
|
187
|
-
|
|
204
|
+
headline: "Commercial license active",
|
|
205
|
+
rows: [...licensedTo, ["Valid until", `${formatDate(license.expiresAt)} (${formatDays(daysLeft)} left)`]],
|
|
206
|
+
links: []
|
|
207
|
+
});
|
|
188
208
|
}
|
|
189
209
|
if (license.state === "plan") return;
|
|
190
|
-
const
|
|
210
|
+
const trialRow = getTrialRow(tsd, now);
|
|
211
|
+
const trialRows = trialRow ? [trialRow] : [];
|
|
191
212
|
if (license.state === "none") {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
return {
|
|
213
|
+
const trial = getTrialStatus(tsd, now);
|
|
214
|
+
if (!trial || !trialRow) return;
|
|
215
|
+
return message({
|
|
195
216
|
title: "EventCatalog trial",
|
|
196
|
-
color: ended ? "yellow" : "green",
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
217
|
+
color: trial.ended ? "yellow" : "green",
|
|
218
|
+
headline: trial.ended ? "Your EventCatalog trial has ended" : `You're on the ${TRIAL_LENGTH_DAYS}-day EventCatalog trial`,
|
|
219
|
+
rows: trialRows,
|
|
220
|
+
links: trial.ended ? [["Get a license", LICENSE_RENEW_URL], licensing] : [licensing]
|
|
221
|
+
});
|
|
200
222
|
}
|
|
201
223
|
if (license.state === "expired") {
|
|
202
|
-
const expiredOn = license.expiresAt ?
|
|
203
|
-
|
|
204
|
-
|
|
224
|
+
const expiredOn = license.expiresAt ? [
|
|
225
|
+
[
|
|
226
|
+
"Expired",
|
|
227
|
+
`${formatDate(license.expiresAt)} (${formatDays(Math.floor((now - license.expiresAt.getTime()) / DAY_IN_MS2))} ago)`
|
|
228
|
+
]
|
|
229
|
+
] : [];
|
|
230
|
+
return message({
|
|
231
|
+
title: "EventCatalog license",
|
|
205
232
|
color: "yellow",
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
`Learn about licensing: ${LICENSE_FAQ_URL}`
|
|
211
|
-
].filter(Boolean).join("\n")
|
|
212
|
-
};
|
|
233
|
+
headline: "Your commercial license has expired",
|
|
234
|
+
rows: [...licensedTo, ...expiredOn, ...trialRows],
|
|
235
|
+
links: [renew, licensing]
|
|
236
|
+
});
|
|
213
237
|
}
|
|
214
|
-
return {
|
|
238
|
+
return message({
|
|
215
239
|
title: "EventCatalog license",
|
|
216
240
|
color: "yellow",
|
|
217
|
-
|
|
218
|
-
|
|
241
|
+
headline: "Your license.jwt couldn't be verified",
|
|
242
|
+
rows: [["Reason", license.reason.charAt(0).toUpperCase() + license.reason.slice(1)], ...trialRows],
|
|
243
|
+
links: [licensing]
|
|
244
|
+
});
|
|
219
245
|
};
|
|
220
246
|
var printLicenseStatus = (license, tsd) => {
|
|
221
|
-
const
|
|
222
|
-
if (!
|
|
247
|
+
const status = getLicenseStatusMessage(license, tsd);
|
|
248
|
+
if (!status) return;
|
|
223
249
|
console.log(
|
|
224
|
-
(0, import_boxen.default)(
|
|
225
|
-
padding: 1,
|
|
250
|
+
(0, import_boxen.default)(render(status, COLOURS), {
|
|
251
|
+
padding: { top: 1, bottom: 1, left: 2, right: 2 },
|
|
226
252
|
margin: 1,
|
|
227
253
|
borderStyle: "round",
|
|
228
|
-
borderColor:
|
|
229
|
-
title:
|
|
230
|
-
titleAlignment: "
|
|
254
|
+
borderColor: status.color,
|
|
255
|
+
title: status.title,
|
|
256
|
+
titleAlignment: "left"
|
|
231
257
|
})
|
|
232
258
|
);
|
|
233
259
|
};
|
|
@@ -15,14 +15,23 @@ declare const getLicenseAnalytics: (license?: LicenseStatus, tsd?: unknown) => {
|
|
|
15
15
|
licenseExpiry: number | undefined;
|
|
16
16
|
trialExpiry: number | undefined;
|
|
17
17
|
};
|
|
18
|
+
type Row = [label: string, value: string];
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* What the license box says: a headline, the facts as aligned rows ("Licensed to acme"), and links on their own
|
|
21
|
+
* rows, so it can be read at a glance. `text` is the box's content without colours.
|
|
20
22
|
*/
|
|
21
|
-
|
|
23
|
+
type LicenseStatusMessage = {
|
|
22
24
|
title: string;
|
|
23
|
-
color:
|
|
25
|
+
color: 'green' | 'yellow';
|
|
26
|
+
headline: string;
|
|
27
|
+
rows: Row[];
|
|
28
|
+
links: Row[];
|
|
24
29
|
text: string;
|
|
25
|
-
}
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The license (or trial) box for the terminal. Undefined when there's nothing to show.
|
|
33
|
+
*/
|
|
34
|
+
declare const getLicenseStatusMessage: (license: LicenseStatus, tsd: unknown, now?: number) => LicenseStatusMessage | undefined;
|
|
26
35
|
declare const printLicenseStatus: (license: LicenseStatus, tsd: unknown) => void;
|
|
27
36
|
|
|
28
|
-
export { LicenseStatus, getLicenseAnalytics, getLicenseStatus, getLicenseStatusMessage, printLicenseStatus };
|
|
37
|
+
export { LicenseStatus, type LicenseStatusMessage, getLicenseAnalytics, getLicenseStatus, getLicenseStatusMessage, printLicenseStatus };
|
|
@@ -15,14 +15,23 @@ declare const getLicenseAnalytics: (license?: LicenseStatus, tsd?: unknown) => {
|
|
|
15
15
|
licenseExpiry: number | undefined;
|
|
16
16
|
trialExpiry: number | undefined;
|
|
17
17
|
};
|
|
18
|
+
type Row = [label: string, value: string];
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* What the license box says: a headline, the facts as aligned rows ("Licensed to acme"), and links on their own
|
|
21
|
+
* rows, so it can be read at a glance. `text` is the box's content without colours.
|
|
20
22
|
*/
|
|
21
|
-
|
|
23
|
+
type LicenseStatusMessage = {
|
|
22
24
|
title: string;
|
|
23
|
-
color:
|
|
25
|
+
color: 'green' | 'yellow';
|
|
26
|
+
headline: string;
|
|
27
|
+
rows: Row[];
|
|
28
|
+
links: Row[];
|
|
24
29
|
text: string;
|
|
25
|
-
}
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The license (or trial) box for the terminal. Undefined when there's nothing to show.
|
|
33
|
+
*/
|
|
34
|
+
declare const getLicenseStatusMessage: (license: LicenseStatus, tsd: unknown, now?: number) => LicenseStatusMessage | undefined;
|
|
26
35
|
declare const printLicenseStatus: (license: LicenseStatus, tsd: unknown) => void;
|
|
27
36
|
|
|
28
|
-
export { LicenseStatus, getLicenseAnalytics, getLicenseStatus, getLicenseStatusMessage, printLicenseStatus };
|
|
37
|
+
export { LicenseStatus, type LicenseStatusMessage, getLicenseAnalytics, getLicenseStatus, getLicenseStatusMessage, printLicenseStatus };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getStudioRuntime } from '../src/features/studio/server/runtime.ts';
|
|
2
|
+
import config from '../src/utils/eventcatalog-config/source.ts';
|
|
2
3
|
import { isCanvasEnabled } from '../src/utils/feature.ts';
|
|
3
4
|
|
|
4
5
|
// Collaborative canvases: the collaboration WebSocket (Yjs over Hocuspocus), on the dev server's port.
|
|
@@ -7,10 +8,21 @@ export default function studioServer() {
|
|
|
7
8
|
return {
|
|
8
9
|
name: 'eventcatalog-studio-server',
|
|
9
10
|
hooks: {
|
|
10
|
-
'astro:server:setup': ({ server, logger }) => {
|
|
11
|
+
'astro:server:setup': async ({ server, logger }) => {
|
|
11
12
|
if (!isCanvasEnabled() || !server.httpServer) return;
|
|
12
|
-
getStudioRuntime()
|
|
13
|
-
|
|
13
|
+
const runtime = getStudioRuntime();
|
|
14
|
+
const projectDirectory = process.env.PROJECT_DIR || process.cwd();
|
|
15
|
+
// Canvases are loaded from storage before anyone can open one
|
|
16
|
+
try {
|
|
17
|
+
await runtime.useStorage(config.studio?.storage, projectDirectory);
|
|
18
|
+
} catch (error) {
|
|
19
|
+
logger.error(`Could not use the Studio storage configured, keeping canvases in memory: ${error.message}`);
|
|
20
|
+
await runtime.useStorage({ type: 'memory' }, projectDirectory);
|
|
21
|
+
}
|
|
22
|
+
runtime.attach(server.httpServer);
|
|
23
|
+
const { type, location } = runtime.storage;
|
|
24
|
+
const kept = type === 'memory' ? 'kept in memory until the server restarts' : `stored in ${location}`;
|
|
25
|
+
logger.info(`Collaboration server ready at /_eventcatalog/studio (canvases ${kept})`);
|
|
14
26
|
},
|
|
15
27
|
},
|
|
16
28
|
};
|
|
@@ -94,16 +94,16 @@ const providerName = user?.provider ? providerNames[user.provider] || user.provi
|
|
|
94
94
|
<img
|
|
95
95
|
src={userImage}
|
|
96
96
|
alt=""
|
|
97
|
-
class="h-
|
|
97
|
+
class="h-7 w-7 rounded-full object-cover ring-1 ring-[rgb(var(--ec-page-border))]"
|
|
98
98
|
/>
|
|
99
99
|
) : (
|
|
100
|
-
<span class="h-
|
|
100
|
+
<span class="h-7 w-7 rounded-full bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-accent))] ring-1 ring-[rgb(var(--ec-page-border))] flex items-center justify-center text-[11px] font-semibold">
|
|
101
101
|
{userInitials}
|
|
102
102
|
</span>
|
|
103
103
|
)}
|
|
104
104
|
<svg
|
|
105
105
|
viewBox="0 0 24 24"
|
|
106
|
-
class="h-
|
|
106
|
+
class="h-3.5 w-3.5 transition-transform group-aria-expanded:rotate-180"
|
|
107
107
|
fill="none"
|
|
108
108
|
stroke="currentColor"
|
|
109
109
|
stroke-width="2"
|
|
@@ -176,17 +176,25 @@ export default function eventCatalogIntegration(): AstroIntegration {
|
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
// Collaborative canvases in EventCatalog Studio (/studio starts one). Their WebSocket
|
|
180
|
-
// integrations/studio-server.mjs.
|
|
179
|
+
// Collaborative canvases in EventCatalog Studio (/studio lists them, /studio/new starts one). Their WebSocket
|
|
180
|
+
// server is in integrations/studio-server.mjs.
|
|
181
181
|
if (isCanvasEnabled()) {
|
|
182
182
|
params.injectRoute({
|
|
183
183
|
pattern: '/studio',
|
|
184
184
|
entrypoint: path.join(packageDirectory, 'src/features/studio/pages/index.astro'),
|
|
185
185
|
});
|
|
186
|
+
params.injectRoute({
|
|
187
|
+
pattern: '/studio/new',
|
|
188
|
+
entrypoint: path.join(packageDirectory, 'src/features/studio/pages/new.astro'),
|
|
189
|
+
});
|
|
186
190
|
params.injectRoute({
|
|
187
191
|
pattern: '/studio/[id]',
|
|
188
192
|
entrypoint: path.join(packageDirectory, 'src/features/studio/pages/[id].astro'),
|
|
189
193
|
});
|
|
194
|
+
params.injectRoute({
|
|
195
|
+
pattern: '/_eventcatalog/studio/wake',
|
|
196
|
+
entrypoint: path.join(packageDirectory, 'src/features/studio/pages/wake.ts'),
|
|
197
|
+
});
|
|
190
198
|
params.injectRoute({
|
|
191
199
|
pattern: '/webmcp-relay/[file]',
|
|
192
200
|
entrypoint: path.join(packageDirectory, 'src/features/studio/pages/webmcp-relay.ts'),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Shared by the canvas MCP App (client) and the MCP server: no server-only imports here
|
|
2
2
|
import type { CatalogRelation, CatalogResource } from '../../../studio/catalog-resources';
|
|
3
|
+
import type { CanvasStatus } from '../../../studio/canvas-doc';
|
|
3
4
|
|
|
4
5
|
export const CANVAS_RESOURCE_URI = 'ui://eventcatalog/canvas.html';
|
|
5
6
|
/** Key of the payload in openCanvas results' `_meta` */
|
|
@@ -12,7 +13,14 @@ export const CANVAS_CATALOG_TOOL = 'getCanvasCatalog';
|
|
|
12
13
|
export const CANVAS_SYNC_TOOL = 'syncCanvas';
|
|
13
14
|
|
|
14
15
|
/** A canvas listed in the view's picker */
|
|
15
|
-
export type CanvasListItem = {
|
|
16
|
+
export type CanvasListItem = {
|
|
17
|
+
canvasId: string;
|
|
18
|
+
title?: string;
|
|
19
|
+
status: CanvasStatus;
|
|
20
|
+
people: string[];
|
|
21
|
+
nodeCount: number;
|
|
22
|
+
openComments: number;
|
|
23
|
+
};
|
|
16
24
|
|
|
17
25
|
/**
|
|
18
26
|
* What the view shows: a canvas (it connects to it itself, so people and agents edit it live), or, when opened
|
|
@@ -15,7 +15,7 @@ import type { App } from '@modelcontextprotocol/ext-apps';
|
|
|
15
15
|
import styles from './styles.css?inline';
|
|
16
16
|
import visualiserStyles from '@eventcatalog/visualiser/styles.css?inline';
|
|
17
17
|
import StudioDesigner, { type SelectedNode } from '@features/studio/components/StudioDesigner';
|
|
18
|
-
import { STATUS } from '@features/studio/components/status';
|
|
18
|
+
import { CANVAS_STATUS_LOOK, STATUS } from '@features/studio/components/status';
|
|
19
19
|
import { getToolResultPayload, mountView, useMcpAppView } from '../shared/app-view';
|
|
20
20
|
import {
|
|
21
21
|
CANVAS_CATALOG_TOOL,
|
|
@@ -101,7 +101,14 @@ function CanvasPicker({
|
|
|
101
101
|
className="flex w-full items-center justify-between gap-3 rounded-xl border px-4 py-3 text-left bg-[rgb(var(--ec-card-bg))] border-[rgb(var(--ec-page-border))] hover:border-[rgb(var(--ec-accent))]"
|
|
102
102
|
>
|
|
103
103
|
<span className="min-w-0">
|
|
104
|
-
<span className="
|
|
104
|
+
<span className="flex items-center gap-2">
|
|
105
|
+
<span className="truncate text-sm font-semibold">{canvas.title ?? 'Untitled canvas'}</span>
|
|
106
|
+
<span
|
|
107
|
+
className={`shrink-0 rounded-full border px-1.5 py-px text-[10px] font-semibold ${CANVAS_STATUS_LOOK[canvas.status].pill}`}
|
|
108
|
+
>
|
|
109
|
+
{CANVAS_STATUS_LOOK[canvas.status].label}
|
|
110
|
+
</span>
|
|
111
|
+
</span>
|
|
105
112
|
<span className="text-xs text-[rgb(var(--ec-page-text-muted))]">
|
|
106
113
|
{canvas.nodeCount} {canvas.nodeCount === 1 ? 'node' : 'nodes'}
|
|
107
114
|
{canvas.openComments > 0 && ` · ${canvas.openComments} open comments`}
|