@eventcatalog/core 5.0.0-beta.6 → 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.
Files changed (85) 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 +3 -1
  4. package/dist/analytics/log-build.js +4 -4
  5. package/dist/{chunk-XMPFHLK4.js → chunk-4W55ZOOS.js} +2 -2
  6. package/dist/{chunk-PIYJM642.js → chunk-AWOO63ME.js} +70 -44
  7. package/dist/{chunk-QBP3BBSV.js → chunk-C6T2AAFR.js} +1 -1
  8. package/dist/{chunk-MDWB5HLO.js → chunk-ENAG6UH7.js} +5 -0
  9. package/dist/{chunk-56CD2NH6.js → chunk-PU25TOOJ.js} +1 -1
  10. package/dist/{chunk-L2IRFOE7.js → chunk-RDIZJ7UT.js} +1 -1
  11. package/dist/{chunk-DE3QHVJP.js → chunk-T4G3VVZ4.js} +1 -1
  12. package/dist/constants.cjs +1 -1
  13. package/dist/constants.js +1 -1
  14. package/dist/eventcatalog.cjs +138 -90
  15. package/dist/eventcatalog.config.d.cts +47 -0
  16. package/dist/eventcatalog.config.d.ts +47 -0
  17. package/dist/eventcatalog.js +30 -11
  18. package/dist/features.cjs +8 -2
  19. package/dist/features.d.cts +3 -1
  20. package/dist/features.d.ts +3 -1
  21. package/dist/features.js +5 -3
  22. package/dist/generate.cjs +1 -1
  23. package/dist/generate.js +3 -3
  24. package/dist/utils/cli-logger.cjs +1 -1
  25. package/dist/utils/cli-logger.js +2 -2
  26. package/dist/utils/license-status.cjs +70 -44
  27. package/dist/utils/license-status.d.cts +14 -5
  28. package/dist/utils/license-status.d.ts +14 -5
  29. package/dist/utils/license-status.js +1 -1
  30. package/eventcatalog/integrations/studio-server.mjs +15 -3
  31. package/eventcatalog/src/components/Header.astro +3 -3
  32. package/eventcatalog/src/features/integrations/eventcatalog-features.ts +10 -2
  33. package/eventcatalog/src/features/mcp/apps/canvas/shared.ts +9 -1
  34. package/eventcatalog/src/features/mcp/apps/canvas/view.tsx +9 -2
  35. package/eventcatalog/src/features/mcp/apps/generated/canvas.html +70 -69
  36. package/eventcatalog/src/features/mcp/apps/generated/viewer.html +69 -69
  37. package/eventcatalog/src/features/mcp/mcp-server.ts +5 -3
  38. package/eventcatalog/src/features/studio/agent-choreography.ts +8 -5
  39. package/eventcatalog/src/features/studio/canvas-actions.ts +148 -21
  40. package/eventcatalog/src/features/studio/canvas-doc.ts +138 -9
  41. package/eventcatalog/src/features/studio/canvas-preview.ts +53 -0
  42. package/eventcatalog/src/features/studio/catalog-resources.ts +5 -2
  43. package/eventcatalog/src/features/studio/clipboard.ts +97 -0
  44. package/eventcatalog/src/features/studio/components/CanvasControls.tsx +4 -3
  45. package/eventcatalog/src/features/studio/components/CanvasHeader.tsx +39 -22
  46. package/eventcatalog/src/features/studio/components/CanvasStatusMenu.tsx +117 -0
  47. package/eventcatalog/src/features/studio/components/Comments.tsx +345 -30
  48. package/eventcatalog/src/features/studio/components/ConnectAgentDialog.tsx +140 -76
  49. package/eventcatalog/src/features/studio/components/ConnectionsChooser.tsx +144 -0
  50. package/eventcatalog/src/features/studio/components/ContainerChooser.tsx +1 -1
  51. package/eventcatalog/src/features/studio/components/DragGhost.tsx +115 -0
  52. package/eventcatalog/src/features/studio/components/JoinForm.tsx +0 -24
  53. package/eventcatalog/src/features/studio/components/LeftPanel.tsx +131 -35
  54. package/eventcatalog/src/features/studio/components/Picture.tsx +21 -0
  55. package/eventcatalog/src/features/studio/components/Presence.tsx +2 -0
  56. package/eventcatalog/src/features/studio/components/PropertiesPanel.tsx +187 -50
  57. package/eventcatalog/src/features/studio/components/ShareDialog.tsx +260 -0
  58. package/eventcatalog/src/features/studio/components/StudioDesigner.tsx +442 -40
  59. package/eventcatalog/src/features/studio/components/canvas-nodes.tsx +198 -22
  60. package/eventcatalog/src/features/studio/components/icons.ts +6 -1
  61. package/eventcatalog/src/features/studio/components/status.ts +30 -1
  62. package/eventcatalog/src/features/studio/edges.ts +2 -0
  63. package/eventcatalog/src/features/studio/grouping.ts +95 -2
  64. package/eventcatalog/src/features/studio/hooks/presence-store.ts +5 -1
  65. package/eventcatalog/src/features/studio/hooks/use-canvas-webmcp.ts +13 -3
  66. package/eventcatalog/src/features/studio/hooks/use-comments.ts +8 -1
  67. package/eventcatalog/src/features/studio/hooks/use-follow-camera.ts +7 -2
  68. package/eventcatalog/src/features/studio/hooks/use-studio-flow.ts +174 -27
  69. package/eventcatalog/src/features/studio/identity.ts +35 -0
  70. package/eventcatalog/src/features/studio/layout.ts +7 -4
  71. package/eventcatalog/src/features/studio/levels.ts +138 -72
  72. package/eventcatalog/src/features/studio/node-types.ts +35 -3
  73. package/eventcatalog/src/features/studio/pages/[id].astro +7 -2
  74. package/eventcatalog/src/features/studio/pages/index.astro +555 -2
  75. package/eventcatalog/src/features/studio/pages/new.astro +24 -0
  76. package/eventcatalog/src/features/studio/pages/wake.ts +15 -0
  77. package/eventcatalog/src/features/studio/server/canvas-mcp.ts +48 -13
  78. package/eventcatalog/src/features/studio/server/runtime.ts +193 -14
  79. package/eventcatalog/src/features/studio/server/sign-in.ts +18 -0
  80. package/eventcatalog/src/features/studio/server/storage.ts +110 -0
  81. package/eventcatalog/src/features/studio/studio.css +184 -0
  82. package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +1 -1
  83. package/eventcatalog/src/utils/feature.ts +7 -3
  84. package/eventcatalog/src/utils/node-graphs/export-mermaid.ts +0 -2
  85. package/package.json +4 -4
@@ -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.0.0-beta.6";
39
+ var version = "5.0.0-beta.8";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-QBP3BBSV.js";
4
- import "../chunk-L2IRFOE7.js";
3
+ } from "../chunk-C6T2AAFR.js";
4
+ import "../chunk-RDIZJ7UT.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -176,7 +176,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
176
176
  var import_os = __toESM(require("os"), 1);
177
177
 
178
178
  // package.json
179
- var version = "5.0.0-beta.6";
179
+ var version = "5.0.0-beta.8";
180
180
 
181
181
  // src/constants.ts
182
182
  var VERSION = version;
@@ -281,6 +281,7 @@ function serializeCounts(counts) {
281
281
 
282
282
  // src/utils/license-status.ts
283
283
  var import_boxen = __toESM(require("boxen"), 1);
284
+ var import_picocolors = __toESM(require("picocolors"), 1);
284
285
  var import_license2 = require("@eventcatalog/license");
285
286
 
286
287
  // eventcatalog/src/utils/trial.ts
@@ -311,6 +312,7 @@ var getLicenseAnalytics = (license = { state: "none" }, tsd) => ({
311
312
  licenseExpiry: "expiresAt" in license ? license.expiresAt?.getTime() : void 0,
312
313
  trialExpiry: getTrialStatus(tsd)?.endsAt.getTime()
313
314
  });
315
+ var COLOURS = { bold: import_picocolors.default.bold, dim: import_picocolors.default.dim, link: (text) => import_picocolors.default.cyan(text) };
314
316
 
315
317
  // src/analytics/log-build.js
316
318
  var isMCPEnabled = (configFile) => configFile.output === "server" && (configFile.mcp?.enabled ?? true);
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-XMPFHLK4.js";
4
- import "../chunk-PIYJM642.js";
3
+ } from "../chunk-4W55ZOOS.js";
4
+ import "../chunk-AWOO63ME.js";
5
5
  import "../chunk-ZAZHAVKB.js";
6
- import "../chunk-QBP3BBSV.js";
7
- import "../chunk-L2IRFOE7.js";
6
+ import "../chunk-C6T2AAFR.js";
7
+ import "../chunk-RDIZJ7UT.js";
8
8
  import "../chunk-RFIXKATC.js";
9
9
  export {
10
10
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getLicenseAnalytics
3
- } from "./chunk-PIYJM642.js";
3
+ } from "./chunk-AWOO63ME.js";
4
4
  import {
5
5
  countResources,
6
6
  hashCatalogContent,
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-ZAZHAVKB.js";
9
9
  import {
10
10
  raiseEvent
11
- } from "./chunk-QBP3BBSV.js";
11
+ } from "./chunk-C6T2AAFR.js";
12
12
  import {
13
13
  getEventCatalogConfigFile,
14
14
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,5 +1,6 @@
1
1
  // src/utils/license-status.ts
2
2
  import boxen from "boxen";
3
+ import pc from "picocolors";
3
4
  import { isEventCatalogScaleEnabled, isEventCatalogStarterEnabled } from "@eventcatalog/license";
4
5
 
5
6
  // eventcatalog/src/utils/trial.ts
@@ -122,75 +123,100 @@ var getLicenseAnalytics = (license = { state: "none" }, tsd) => ({
122
123
  });
123
124
  var formatDate = (date) => date.toLocaleDateString(void 0, { dateStyle: "medium" });
124
125
  var formatDays = (days) => `${days} ${days === 1 ? "day" : "days"}`;
125
- var getTrialLine = (tsd, now) => {
126
+ var PLAIN = { bold: (text) => text, dim: (text) => text, link: (text) => text };
127
+ var COLOURS = { bold: pc.bold, dim: pc.dim, link: (text) => pc.cyan(text) };
128
+ var render = ({ headline, rows, links }, colours) => {
129
+ const width = Math.max(0, ...[...rows, ...links].map(([label]) => label.length));
130
+ const row = ([label, value]) => `${colours.dim(label.padEnd(width))} ${value}`;
131
+ return [
132
+ colours.bold(headline),
133
+ ...rows.length ? ["", ...rows.map(row)] : [],
134
+ ...links.length ? ["", ...links.map(([label, url]) => row([label, colours.link(url)]))] : []
135
+ ].join("\n");
136
+ };
137
+ var message = (content) => ({
138
+ ...content,
139
+ text: render(content, PLAIN)
140
+ });
141
+ var getTrialRow = (tsd, now) => {
126
142
  const trial = getTrialStatus(tsd, now);
127
143
  if (!trial) return;
128
- return trial.ended ? `Your ${TRIAL_LENGTH_DAYS}-day EventCatalog trial ended on ${formatDate(trial.endsAt)}.` : `${formatDays(trial.daysLeft)} left of your ${TRIAL_LENGTH_DAYS}-day EventCatalog trial (ends ${formatDate(trial.endsAt)}).`;
144
+ return [
145
+ "Trial",
146
+ trial.ended ? `Ended ${formatDate(trial.endsAt)}` : `${formatDays(trial.daysLeft)} left of ${TRIAL_LENGTH_DAYS} (ends ${formatDate(trial.endsAt)})`
147
+ ];
129
148
  };
130
149
  var getLicenseStatusMessage = (license, tsd, now = Date.now()) => {
150
+ const licensing = ["Licensing", LICENSE_FAQ_URL];
151
+ const renew = ["Renew", LICENSE_RENEW_URL];
152
+ const licensedTo = "org" in license && license.org ? [["Licensed to", license.org]] : [];
131
153
  if (license.state === "licensed") {
132
154
  const daysLeft = Math.max(0, Math.ceil((license.expiresAt.getTime() - now) / DAY_IN_MS2));
133
- const licensedTo = license.org ? `Licensed to ${license.org}` : "Licensed";
134
155
  if (daysLeft < LICENSE_REMINDER_DAYS) {
135
- return {
136
- title: "EventCatalog Commercial License",
156
+ return message({
157
+ title: "EventCatalog license",
137
158
  color: "yellow",
138
- text: [
139
- licensedTo,
140
- `Your license expires in ${formatDays(daysLeft)}, on ${formatDate(license.expiresAt)}.`,
141
- `Renew it to keep using EventCatalog commercially: ${LICENSE_RENEW_URL}`
142
- ].join("\n")
143
- };
159
+ headline: `Your commercial license expires in ${formatDays(daysLeft)}`,
160
+ rows: [...licensedTo, ["Expires", formatDate(license.expiresAt)]],
161
+ links: [renew]
162
+ });
144
163
  }
145
- return {
146
- title: "EventCatalog Commercial License",
164
+ return message({
165
+ title: "EventCatalog license",
147
166
  color: "green",
148
- text: `${licensedTo}
149
- Valid until ${formatDate(license.expiresAt)} (${formatDays(daysLeft)} left)`
150
- };
167
+ headline: "Commercial license active",
168
+ rows: [...licensedTo, ["Valid until", `${formatDate(license.expiresAt)} (${formatDays(daysLeft)} left)`]],
169
+ links: []
170
+ });
151
171
  }
152
172
  if (license.state === "plan") return;
153
- const trialLine = getTrialLine(tsd, now);
173
+ const trialRow = getTrialRow(tsd, now);
174
+ const trialRows = trialRow ? [trialRow] : [];
154
175
  if (license.state === "none") {
155
- if (!trialLine) return;
156
- const ended = getTrialStatus(tsd, now)?.ended;
157
- return {
176
+ const trial = getTrialStatus(tsd, now);
177
+ if (!trial || !trialRow) return;
178
+ return message({
158
179
  title: "EventCatalog trial",
159
- color: ended ? "yellow" : "green",
160
- text: `${trialLine}
161
- Learn about licensing: ${LICENSE_FAQ_URL}`
162
- };
180
+ color: trial.ended ? "yellow" : "green",
181
+ headline: trial.ended ? "Your EventCatalog trial has ended" : `You're on the ${TRIAL_LENGTH_DAYS}-day EventCatalog trial`,
182
+ rows: trialRows,
183
+ links: trial.ended ? [["Get a license", LICENSE_RENEW_URL], licensing] : [licensing]
184
+ });
163
185
  }
164
186
  if (license.state === "expired") {
165
- const expiredOn = license.expiresAt ? `expired on ${formatDate(license.expiresAt)} (${formatDays(Math.floor((now - license.expiresAt.getTime()) / DAY_IN_MS2))} ago)` : "has expired";
166
- return {
167
- title: "EventCatalog License Expired",
187
+ const expiredOn = license.expiresAt ? [
188
+ [
189
+ "Expired",
190
+ `${formatDate(license.expiresAt)} (${formatDays(Math.floor((now - license.expiresAt.getTime()) / DAY_IN_MS2))} ago)`
191
+ ]
192
+ ] : [];
193
+ return message({
194
+ title: "EventCatalog license",
168
195
  color: "yellow",
169
- text: [
170
- `Your EventCatalog commercial license${license.org ? ` for ${license.org}` : ""} ${expiredOn}.`,
171
- `Renew it to keep using EventCatalog commercially: ${LICENSE_RENEW_URL}`,
172
- trialLine,
173
- `Learn about licensing: ${LICENSE_FAQ_URL}`
174
- ].filter(Boolean).join("\n")
175
- };
196
+ headline: "Your commercial license has expired",
197
+ rows: [...licensedTo, ...expiredOn, ...trialRows],
198
+ links: [renew, licensing]
199
+ });
176
200
  }
177
- return {
201
+ return message({
178
202
  title: "EventCatalog license",
179
203
  color: "yellow",
180
- text: [`Your license.jwt could not be verified: ${license.reason}.`, trialLine, `Learn about licensing: ${LICENSE_FAQ_URL}`].filter(Boolean).join("\n")
181
- };
204
+ headline: "Your license.jwt couldn't be verified",
205
+ rows: [["Reason", license.reason.charAt(0).toUpperCase() + license.reason.slice(1)], ...trialRows],
206
+ links: [licensing]
207
+ });
182
208
  };
183
209
  var printLicenseStatus = (license, tsd) => {
184
- const message = getLicenseStatusMessage(license, tsd);
185
- if (!message) return;
210
+ const status = getLicenseStatusMessage(license, tsd);
211
+ if (!status) return;
186
212
  console.log(
187
- boxen(message.text, {
188
- padding: 1,
213
+ boxen(render(status, COLOURS), {
214
+ padding: { top: 1, bottom: 1, left: 2, right: 2 },
189
215
  margin: 1,
190
216
  borderStyle: "round",
191
- borderColor: message.color,
192
- title: message.title,
193
- titleAlignment: "center"
217
+ borderColor: status.color,
218
+ title: status.title,
219
+ titleAlignment: "left"
194
220
  })
195
221
  );
196
222
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-L2IRFOE7.js";
3
+ } from "./chunk-RDIZJ7UT.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import os from "os";
@@ -13,6 +13,10 @@ var isOutputServer = async () => {
13
13
  const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
14
14
  return config?.output === "server";
15
15
  };
16
+ var isStudioEnabled = async () => {
17
+ const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
18
+ return config?.output === "server" && config?.studio?.enabled === true;
19
+ };
16
20
  var isIndexedSearchEnabled = async () => {
17
21
  const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
18
22
  return config?.search?.type === "indexed";
@@ -26,6 +30,7 @@ var isAuthEnabled = async () => {
26
30
  export {
27
31
  getProjectOutDir,
28
32
  isOutputServer,
33
+ isStudioEnabled,
29
34
  isIndexedSearchEnabled,
30
35
  isAuthEnabled
31
36
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-L2IRFOE7.js";
3
+ } from "./chunk-RDIZJ7UT.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.0.0-beta.6";
2
+ var version = "5.0.0-beta.8";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-56CD2NH6.js";
3
+ } from "./chunk-PU25TOOJ.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "5.0.0-beta.6";
28
+ var version = "5.0.0-beta.8";
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-L2IRFOE7.js";
3
+ } from "./chunk-RDIZJ7UT.js";
4
4
  export {
5
5
  VERSION
6
6
  };