@eventcatalog/core 4.12.2 → 5.0.0-beta.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 (268) hide show
  1. package/LICENSE +226 -95
  2. package/NOTICE +30 -0
  3. package/README.md +3 -2
  4. package/dist/analytics/analytics.cjs +1 -1
  5. package/dist/analytics/analytics.js +2 -2
  6. package/dist/analytics/log-build.cjs +43 -16
  7. package/dist/analytics/log-build.d.cts +6 -5
  8. package/dist/analytics/log-build.d.ts +6 -5
  9. package/dist/analytics/log-build.js +4 -3
  10. package/dist/{chunk-U4YJSTGV.js → chunk-AYNZXUB5.js} +2 -10
  11. package/dist/{chunk-IVVM67LN.js → chunk-CR6AK5LR.js} +1 -1
  12. package/dist/{chunk-GTIC4R74.js → chunk-LR7AGRHN.js} +13 -16
  13. package/dist/chunk-TQLRG35T.js +203 -0
  14. package/dist/{chunk-WK4J6FP3.js → chunk-TWN43V4T.js} +1 -1
  15. package/dist/{chunk-ZW3MYAWF.js → chunk-WAIADKQE.js} +1 -1
  16. package/dist/{chunk-RPVA2SZY.js → chunk-ZHKEARLJ.js} +1 -1
  17. package/dist/constants.cjs +1 -1
  18. package/dist/constants.js +1 -1
  19. package/dist/eventcatalog.cjs +407 -291
  20. package/dist/eventcatalog.config.d.cts +2 -3
  21. package/dist/eventcatalog.config.d.ts +2 -3
  22. package/dist/eventcatalog.js +30 -93
  23. package/dist/federation/content-cache.d.cts +0 -5
  24. package/dist/federation/content-cache.d.ts +0 -5
  25. package/dist/federation/diagnostics.d.cts +0 -5
  26. package/dist/federation/diagnostics.d.ts +0 -5
  27. package/dist/federation/federate.cjs +0 -9
  28. package/dist/federation/federate.d.cts +0 -5
  29. package/dist/federation/federate.d.ts +0 -5
  30. package/dist/federation/federate.js +2 -3
  31. package/dist/federation/filesystem-source-provider.d.cts +0 -5
  32. package/dist/federation/filesystem-source-provider.d.ts +0 -5
  33. package/dist/federation/github-source-provider.d.cts +0 -5
  34. package/dist/federation/github-source-provider.d.ts +0 -5
  35. package/dist/federation/output-transaction.d.cts +0 -4
  36. package/dist/federation/output-transaction.d.ts +0 -4
  37. package/dist/federation/public-assets.d.cts +0 -5
  38. package/dist/federation/public-assets.d.ts +0 -5
  39. package/dist/federation/source-provider.d.cts +0 -5
  40. package/dist/federation/source-provider.d.ts +0 -5
  41. package/dist/federation/types.d.cts +0 -5
  42. package/dist/federation/types.d.ts +0 -5
  43. package/dist/generate.cjs +1 -1
  44. package/dist/generate.js +3 -3
  45. package/dist/license-C1y-56bb.d.cts +23 -0
  46. package/dist/license-C1y-56bb.d.ts +23 -0
  47. package/dist/runtime-dependencies/@eventcatalog__visualiser__layout.mjs +3 -0
  48. package/dist/runtime-dependencies/@modelcontextprotocol__ext-apps.mjs +3 -0
  49. package/dist/runtime-dependencies/@modelcontextprotocol__ext-apps__react.mjs +3 -0
  50. package/dist/runtime-dependencies/@modelcontextprotocol__ext-apps__server.mjs +3 -0
  51. package/dist/runtime-dependencies/@modelcontextprotocol__sdk__types.js.mjs +3 -0
  52. package/dist/runtime-dependencies/manifest.json +12 -1
  53. package/dist/runtime-dependencies/react-syntax-highlighter__dist__esm__languages__prism__graphql.mjs +3 -0
  54. package/dist/runtime-dependencies/react-syntax-highlighter__dist__esm__languages__prism__json.mjs +3 -0
  55. package/dist/runtime-dependencies/react-syntax-highlighter__dist__esm__languages__prism__markup.mjs +3 -0
  56. package/dist/runtime-dependencies/react-syntax-highlighter__dist__esm__languages__prism__protobuf.mjs +3 -0
  57. package/dist/runtime-dependencies/react-syntax-highlighter__dist__esm__languages__prism__yaml.mjs +3 -0
  58. package/dist/runtime-dependencies/react-syntax-highlighter__dist__esm__styles__prism__one-dark.mjs +3 -0
  59. package/dist/runtime-dependencies/react-syntax-highlighter__dist__esm__styles__prism__one-light.mjs +3 -0
  60. package/dist/utils/cli-logger.cjs +1 -1
  61. package/dist/utils/cli-logger.js +2 -2
  62. package/dist/utils/license-status.cjs +240 -0
  63. package/dist/utils/license-status.d.cts +28 -0
  64. package/dist/utils/license-status.d.ts +28 -0
  65. package/dist/utils/license-status.js +12 -0
  66. package/eventcatalog/astro.config.mjs +1 -1
  67. package/eventcatalog/integrations/eventcatalog-runtime.mjs +1 -1
  68. package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +29 -19
  69. package/eventcatalog/src/components/ChatPanel/OfflineReply.tsx +74 -0
  70. package/eventcatalog/src/components/FieldsExplorer/FieldFilters.tsx +24 -28
  71. package/eventcatalog/src/components/FieldsExplorer/FieldNodeGraph.tsx +16 -11
  72. package/eventcatalog/src/components/FieldsExplorer/FieldsExplorer.tsx +4 -218
  73. package/eventcatalog/src/components/FieldsExplorer/FieldsTable.tsx +27 -36
  74. package/eventcatalog/src/components/Header.astro +43 -58
  75. package/eventcatalog/src/components/Lists/PillListFlat.styles.css +17 -17
  76. package/eventcatalog/src/components/MDX/EntityMap/EntityMap.astro +1 -1
  77. package/eventcatalog/src/components/MDX/Flow/Flow.astro +4 -0
  78. package/eventcatalog/src/components/MDX/NodeGraph/AstroNodeGraph.tsx +14 -0
  79. package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +49 -18
  80. package/eventcatalog/src/components/MDX/RemoteFile.astro +2 -24
  81. package/eventcatalog/src/components/SchemaExplorer/ApiAccessSection.tsx +59 -93
  82. package/eventcatalog/src/components/SchemaExplorer/ApiContentViewer.tsx +1 -32
  83. package/eventcatalog/src/components/SchemaExplorer/DiffViewer.tsx +20 -67
  84. package/eventcatalog/src/components/SchemaExplorer/SchemaContentViewer.tsx +2 -11
  85. package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsPanel.tsx +11 -60
  86. package/eventcatalog/src/components/SchemaExplorer/SchemaExplorer.tsx +1 -3
  87. package/eventcatalog/src/components/SchemaExplorer/SchemaPageViewer.tsx +0 -3
  88. package/eventcatalog/src/components/SchemaExplorer/VersionHistoryModal.tsx +2 -9
  89. package/eventcatalog/src/components/SchemaExplorer/parse-schema.ts +46 -0
  90. package/eventcatalog/src/components/SchemaExplorer/utils.ts +11 -0
  91. package/eventcatalog/src/components/Settings/AssistantSettingsForm.tsx +2 -9
  92. package/eventcatalog/src/components/Settings/LicenseSettings.tsx +288 -0
  93. package/eventcatalog/src/components/Settings/LlmAccessSettingsForm.tsx +3 -19
  94. package/eventcatalog/src/components/Settings/McpSettingsForm.tsx +85 -30
  95. package/eventcatalog/src/components/Settings/SettingsShared.tsx +7 -75
  96. package/eventcatalog/src/components/SideNav/CustomDocsNav.astro +2 -2
  97. package/eventcatalog/src/components/TrialBadge.astro +82 -0
  98. package/eventcatalog/src/content.config.ts +9 -90
  99. package/eventcatalog/src/{enterprise → features}/ai/chat-api.ts +22 -34
  100. package/eventcatalog/src/{enterprise → features}/analytics/adapters/ga4.ts +0 -5
  101. package/eventcatalog/src/{enterprise → features}/analytics/adapters/gtm.ts +0 -5
  102. package/eventcatalog/src/{enterprise → features}/analytics/adapters/posthog.ts +0 -5
  103. package/eventcatalog/src/{enterprise → features}/analytics/components/AnalyticsHead.astro +2 -4
  104. package/eventcatalog/src/{enterprise → features}/analytics/components/AnalyticsTracker.astro +2 -4
  105. package/eventcatalog/src/{enterprise → features}/analytics/tracker.ts +0 -5
  106. package/eventcatalog/src/{enterprise → features}/api/catalog.ts +0 -5
  107. package/eventcatalog/src/{enterprise → features}/auth/[...auth].ts +0 -5
  108. package/eventcatalog/src/{enterprise → features}/auth/middleware/middleware-auth.ts +0 -5
  109. package/eventcatalog/src/{enterprise → features}/auth/middleware/middleware.ts +0 -5
  110. package/eventcatalog/src/{enterprise → features}/collections/custom-pages.ts +0 -5
  111. package/eventcatalog/src/{enterprise → features}/collections/index.ts +0 -5
  112. package/eventcatalog/src/{enterprise → features}/collections/resource-docs.ts +0 -5
  113. package/eventcatalog/src/{enterprise → features}/custom-documentation/collection.ts +0 -5
  114. package/eventcatalog/src/features/custom-documentation/components/CustomDocsNav/CustomDocsNav.astro +9 -0
  115. package/eventcatalog/src/{enterprise → features}/custom-documentation/components/CustomDocsNav/CustomDocsNavWrapper.tsx +0 -5
  116. package/eventcatalog/src/{enterprise → features}/custom-documentation/components/CustomDocsNav/components/NestedItem.tsx +1 -6
  117. package/eventcatalog/src/{enterprise → features}/custom-documentation/components/CustomDocsNav/components/NoResultsFound.tsx +0 -5
  118. package/eventcatalog/src/{enterprise → features}/custom-documentation/components/CustomDocsNav/index.tsx +1 -6
  119. package/eventcatalog/src/{enterprise → features}/custom-documentation/components/CustomDocsNav/types.ts +0 -5
  120. package/eventcatalog/src/{enterprise/custom-documentation/pages/docs/custom/index.astro → features/custom-documentation/components/CustomDocumentationPage.astro} +5 -5
  121. package/eventcatalog/src/{enterprise → features}/custom-documentation/utils/badge-styles.ts +0 -5
  122. package/eventcatalog/src/{enterprise → features}/custom-documentation/utils/custom-docs.ts +1 -6
  123. package/eventcatalog/src/{enterprise → features}/custom-documentation/utils/docs-search.ts +0 -5
  124. package/eventcatalog/src/{enterprise → features}/custom-pages/routes.ts +0 -5
  125. package/eventcatalog/src/{enterprise → features}/directory/user-team-directory.ts +0 -5
  126. package/eventcatalog/src/{enterprise → features}/fields/field-extractor.ts +0 -5
  127. package/eventcatalog/src/{enterprise → features}/fields/field-indexer.ts +0 -5
  128. package/eventcatalog/src/{enterprise → features}/fields/fields-db.ts +0 -5
  129. package/eventcatalog/src/{enterprise → features}/fields/pages/api/fields.ts +1 -6
  130. package/eventcatalog/src/{enterprise → features}/fields/pages/fields.astro +1 -2
  131. package/eventcatalog/src/{enterprise → features}/integrations/eventcatalog-features.ts +17 -75
  132. package/eventcatalog/src/features/mcp/apps/architecture-diagram/links.ts +59 -0
  133. package/eventcatalog/src/features/mcp/apps/architecture-diagram/node-chat.tsx +299 -0
  134. package/eventcatalog/src/features/mcp/apps/architecture-diagram/shared.ts +14 -0
  135. package/eventcatalog/src/features/mcp/apps/architecture-diagram/view.tsx +454 -0
  136. package/eventcatalog/src/features/mcp/apps/generated/viewer.html +432 -0
  137. package/eventcatalog/src/features/mcp/apps/mermaid-stub.ts +10 -0
  138. package/eventcatalog/src/features/mcp/apps/schema-viewer/schema-code.tsx +65 -0
  139. package/eventcatalog/src/features/mcp/apps/schema-viewer/shared.ts +23 -0
  140. package/eventcatalog/src/features/mcp/apps/schema-viewer/view.tsx +170 -0
  141. package/eventcatalog/src/features/mcp/apps/shared/app-view.tsx +98 -0
  142. package/eventcatalog/src/features/mcp/apps/shared/resource-types.ts +15 -0
  143. package/eventcatalog/src/features/mcp/apps/viewer/shared.ts +24 -0
  144. package/eventcatalog/src/features/mcp/apps/viewer/styles.css +25 -0
  145. package/eventcatalog/src/features/mcp/apps/viewer/view.tsx +59 -0
  146. package/eventcatalog/src/features/mcp/mcp-app-icons.ts +63 -0
  147. package/eventcatalog/src/features/mcp/mcp-apps.ts +160 -0
  148. package/eventcatalog/src/{enterprise → features}/mcp/mcp-auth.ts +0 -5
  149. package/eventcatalog/src/{enterprise → features}/mcp/mcp-scope.ts +7 -7
  150. package/eventcatalog/src/{enterprise → features}/mcp/mcp-scoped-tools.ts +47 -40
  151. package/eventcatalog/src/{enterprise → features}/mcp/mcp-server.ts +347 -34
  152. package/eventcatalog/src/{enterprise → features}/mcp/oauth-protected-resource.ts +0 -5
  153. package/eventcatalog/src/features/mcp/schema-viewer.ts +24 -0
  154. package/eventcatalog/src/{enterprise → features}/tools/catalog-tools.ts +133 -102
  155. package/eventcatalog/src/features/tools/index.ts +5 -0
  156. package/eventcatalog/src/{enterprise → features}/visualizer-layout/reset.ts +0 -5
  157. package/eventcatalog/src/{enterprise → features}/visualizer-layout/save.ts +0 -5
  158. package/eventcatalog/src/layouts/BaseLayout.astro +2 -2
  159. package/eventcatalog/src/layouts/Footer.astro +31 -39
  160. package/eventcatalog/src/layouts/SettingsLayout.astro +6 -6
  161. package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +7 -37
  162. package/eventcatalog/src/{enterprise → pages}/api/schemas/[collection]/[id]/[version]/index.ts +0 -22
  163. package/eventcatalog/src/{enterprise → pages}/api/schemas/services/[id]/[version]/[specification]/index.ts +0 -19
  164. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/_index.data.ts +2 -6
  165. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +1 -5
  166. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/_index.data.ts +2 -6
  167. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +1 -5
  168. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId].md.ts +2 -6
  169. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId].mdx.ts +2 -6
  170. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +9 -5
  171. package/eventcatalog/src/pages/docs/custom/[...path]/index.astro +12 -0
  172. package/eventcatalog/src/{enterprise/custom-documentation/pages/docs/custom/root-index.astro → pages/docs/custom/index.astro} +1 -23
  173. package/eventcatalog/src/pages/docs/llm/llms-full.txt.ts +4 -9
  174. package/eventcatalog/src/pages/docs/llm/llms.txt.ts +4 -4
  175. package/eventcatalog/src/pages/docs/llm/schemas.txt.ts +0 -11
  176. package/eventcatalog/src/pages/docs/services/[id]/[docType]/[docId]/index.astro +2 -2
  177. package/eventcatalog/src/pages/index.astro +2 -2
  178. package/eventcatalog/src/pages/schemas/[type]/[id]/[version]/index.astro +0 -3
  179. package/eventcatalog/src/pages/schemas/explorer/index.astro +1 -4
  180. package/eventcatalog/src/pages/settings/assistant.astro +2 -4
  181. package/eventcatalog/src/pages/settings/license.astro +18 -0
  182. package/eventcatalog/src/pages/settings/llm-access.astro +1 -4
  183. package/eventcatalog/src/pages/settings/mcp.astro +33 -4
  184. package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/_index.data.ts +1 -2
  185. package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/data/index.astro +2 -45
  186. package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/entity-map/index.astro +1 -1
  187. package/eventcatalog/src/pages/visualiser/[type]/[id]/[version].mermaid.ts +7 -109
  188. package/eventcatalog/src/pages/visualiser/_mermaid-route.ts +78 -0
  189. package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/_index.data.ts +44 -0
  190. package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/entity-map/index.astro +1 -1
  191. package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/index.astro +56 -0
  192. package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/systems-context/index.astro +3 -40
  193. package/eventcatalog/src/pages/visualiser/domains/[id]/[version].mermaid.ts +20 -0
  194. package/eventcatalog/src/pages/visualiser/systems/[id]/[version]/_index.data.ts +29 -0
  195. package/eventcatalog/src/pages/visualiser/systems/[id]/[version]/context/index.astro +3 -38
  196. package/eventcatalog/src/pages/visualiser/systems/[id]/[version]/index.astro +56 -0
  197. package/eventcatalog/src/pages/visualiser/systems/[id]/[version].mermaid.ts +20 -0
  198. package/eventcatalog/src/stores/sidebar-store/builders/agent.ts +1 -1
  199. package/eventcatalog/src/stores/sidebar-store/builders/container.ts +1 -1
  200. package/eventcatalog/src/stores/sidebar-store/builders/data-product.ts +1 -1
  201. package/eventcatalog/src/stores/sidebar-store/builders/domain.ts +7 -32
  202. package/eventcatalog/src/stores/sidebar-store/builders/entity.ts +1 -1
  203. package/eventcatalog/src/stores/sidebar-store/builders/message.ts +1 -1
  204. package/eventcatalog/src/stores/sidebar-store/builders/service.ts +2 -8
  205. package/eventcatalog/src/stores/sidebar-store/builders/system.ts +2 -12
  206. package/eventcatalog/src/stores/sidebar-store/custom-sidebar.ts +0 -10
  207. package/eventcatalog/src/stores/sidebar-store/state.ts +4 -6
  208. package/eventcatalog/src/styles/theme.css +22 -18
  209. package/eventcatalog/src/styles/themes/forest.css +8 -8
  210. package/eventcatalog/src/styles/themes/ocean.css +8 -8
  211. package/eventcatalog/src/styles/themes/sapphire.css +8 -8
  212. package/eventcatalog/src/styles/themes/sunset.css +8 -8
  213. package/eventcatalog/src/utils/clipboard.ts +4 -4
  214. package/eventcatalog/src/utils/collections/flow-step-schema.ts +117 -0
  215. package/eventcatalog/src/utils/collections/pointer-schema.ts +7 -0
  216. package/eventcatalog/src/utils/collections/resource-docs.ts +677 -14
  217. package/eventcatalog/src/utils/collections/schema-loader.ts +0 -5
  218. package/eventcatalog/src/utils/feature.ts +14 -23
  219. package/eventcatalog/src/utils/license.ts +114 -0
  220. package/eventcatalog/src/utils/node-graphs/architecture-diagram-types.ts +32 -0
  221. package/eventcatalog/src/utils/node-graphs/architecture-diagram.ts +84 -0
  222. package/eventcatalog/src/utils/node-graphs/catalog-force-graph.ts +1 -0
  223. package/eventcatalog/src/utils/node-graphs/channel-node-graph.ts +4 -25
  224. package/eventcatalog/src/utils/node-graphs/container-node-graph.ts +12 -39
  225. package/eventcatalog/src/utils/node-graphs/data-products-node-graph.ts +11 -27
  226. package/eventcatalog/src/utils/node-graphs/domain-levels-node-graph.ts +679 -0
  227. package/eventcatalog/src/utils/node-graphs/domains-node-graph.ts +3 -20
  228. package/eventcatalog/src/utils/node-graphs/export-mermaid.ts +62 -4
  229. package/eventcatalog/src/utils/node-graphs/field-node-graph.ts +8 -23
  230. package/eventcatalog/src/utils/node-graphs/flow-lanes.ts +119 -0
  231. package/eventcatalog/src/utils/node-graphs/flows-node-graph.ts +153 -45
  232. package/eventcatalog/src/utils/node-graphs/layout-node-graph.ts +28 -0
  233. package/eventcatalog/src/utils/node-graphs/layout-persistence.ts +3 -3
  234. package/eventcatalog/src/utils/node-graphs/message-node-graph.ts +16 -34
  235. package/eventcatalog/src/utils/node-graphs/services-node-graph.ts +11 -25
  236. package/eventcatalog/src/utils/node-graphs/system-context-node-graph.ts +18 -54
  237. package/eventcatalog/src/utils/node-graphs/system-levels-node-graph.ts +59 -0
  238. package/eventcatalog/src/utils/node-graphs/systems-node-graph.ts +20 -80
  239. package/eventcatalog/src/utils/node-graphs/utils/utils.ts +1 -78
  240. package/eventcatalog/src/utils/trial.ts +36 -0
  241. package/eventcatalog/tsconfig.json +1 -1
  242. package/package.json +11 -11
  243. package/dist/chunk-FV56YFM4.js +0 -7
  244. package/dist/federation/entitlement.cjs +0 -31
  245. package/dist/federation/entitlement.d.cts +0 -12
  246. package/dist/federation/entitlement.d.ts +0 -12
  247. package/dist/federation/entitlement.js +0 -6
  248. package/dist/runtime-dependencies/dagre.mjs +0 -3
  249. package/eventcatalog/src/components/Settings/BillingSettingsForm.tsx +0 -265
  250. package/eventcatalog/src/enterprise/LICENSE +0 -57
  251. package/eventcatalog/src/enterprise/README.md +0 -5
  252. package/eventcatalog/src/enterprise/collections/resource-docs-utils.ts +0 -691
  253. package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/CustomDocsNav.astro +0 -9
  254. package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/[...path]/index.astro +0 -18
  255. package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/feature.astro +0 -171
  256. package/eventcatalog/src/enterprise/feature.ts +0 -75
  257. package/eventcatalog/src/enterprise/tools/index.ts +0 -10
  258. package/eventcatalog/src/hooks/eventcatalog-visualizer.ts +0 -126
  259. package/eventcatalog/src/pages/settings/billing.astro +0 -17
  260. package/eventcatalog/src/pages/visualiser/domain-integrations/index.astro +0 -26
  261. package/eventcatalog/src/types/mcp-modules.d.ts +0 -67
  262. package/eventcatalog/src/utils/node-graphs/domains-canvas.ts +0 -261
  263. package/eventcatalog/src/utils/node-graphs/export-node-graph.ts +0 -91
  264. /package/eventcatalog/src/{enterprise → features}/auth/error.astro +0 -0
  265. /package/eventcatalog/src/{enterprise → features}/auth/login.astro +0 -0
  266. /package/eventcatalog/src/{enterprise → features}/auth/unauthorized.astro +0 -0
  267. /package/eventcatalog/src/{enterprise/custom-documentation/pages → pages}/docs/custom/[...path]/_index.data.ts +0 -0
  268. /package/eventcatalog/src/{enterprise/custom-documentation/pages → pages}/docs/custom/[...path].mdx.ts +0 -0
@@ -0,0 +1,3 @@
1
+ export * from "@modelcontextprotocol/ext-apps/react";
2
+ import * as dependency from "@modelcontextprotocol/ext-apps/react";
3
+ export default dependency.default;
@@ -0,0 +1,3 @@
1
+ export * from "@modelcontextprotocol/ext-apps/server";
2
+ import * as dependency from "@modelcontextprotocol/ext-apps/server";
3
+ export default dependency.default;
@@ -0,0 +1,3 @@
1
+ export * from "@modelcontextprotocol/sdk/types.js";
2
+ import * as dependency from "@modelcontextprotocol/sdk/types.js";
3
+ export default dependency.default;
@@ -20,6 +20,7 @@
20
20
  "@eventcatalog/linter": "@eventcatalog__linter.mjs",
21
21
  "@eventcatalog/sdk": "@eventcatalog__sdk.mjs",
22
22
  "@eventcatalog/visualiser": "@eventcatalog__visualiser.mjs",
23
+ "@eventcatalog/visualiser/layout": "@eventcatalog__visualiser__layout.mjs",
23
24
  "@eventcatalog/visualiser/styles-core.css": "@eventcatalog__visualiser__styles-core.css.mjs",
24
25
  "@fontsource/inter": "@fontsource__inter.mjs",
25
26
  "@fontsource/inter/400.css": "@fontsource__inter__400.css.mjs",
@@ -36,9 +37,13 @@
36
37
  "@iconify-json/logos": "@iconify-json__logos.mjs",
37
38
  "@mermaid-js/layout-elk": "@mermaid-js__layout-elk.mjs",
38
39
  "@mermaid-js/layout-elk/dist/mermaid-layout-elk.core.mjs": "@mermaid-js__layout-elk__dist__mermaid-layout-elk.core.mjs.mjs",
40
+ "@modelcontextprotocol/ext-apps": "@modelcontextprotocol__ext-apps.mjs",
41
+ "@modelcontextprotocol/ext-apps/react": "@modelcontextprotocol__ext-apps__react.mjs",
42
+ "@modelcontextprotocol/ext-apps/server": "@modelcontextprotocol__ext-apps__server.mjs",
39
43
  "@modelcontextprotocol/sdk": "@modelcontextprotocol__sdk.mjs",
40
44
  "@modelcontextprotocol/sdk/server/mcp.js": "@modelcontextprotocol__sdk__server__mcp.js.mjs",
41
45
  "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js": "@modelcontextprotocol__sdk__server__webStandardStreamableHttp.js.mjs",
46
+ "@modelcontextprotocol/sdk/types.js": "@modelcontextprotocol__sdk__types.js.mjs",
42
47
  "@nanostores/react": "@nanostores__react.mjs",
43
48
  "@parcel/watcher": "@parcel__watcher.mjs",
44
49
  "@radix-ui/react-context-menu": "@radix-ui__react-context-menu.mjs",
@@ -72,7 +77,6 @@
72
77
  "d3-force": "d3-force.mjs",
73
78
  "d3-selection": "d3-selection.mjs",
74
79
  "d3-zoom": "d3-zoom.mjs",
75
- "dagre": "dagre.mjs",
76
80
  "diff": "diff.mjs",
77
81
  "diff2html": "diff2html.mjs",
78
82
  "diff2html/bundles/css/diff2html.min.css": "diff2html__bundles__css__diff2html.min.css.mjs",
@@ -107,6 +111,13 @@
107
111
  "react-syntax-highlighter": "react-syntax-highlighter.mjs",
108
112
  "react-syntax-highlighter/dist/cjs/styles/prism": "react-syntax-highlighter__dist__cjs__styles__prism.mjs",
109
113
  "react-syntax-highlighter/dist/cjs/styles/prism/index.js": "react-syntax-highlighter__dist__cjs__styles__prism__index.js.mjs",
114
+ "react-syntax-highlighter/dist/esm/languages/prism/graphql": "react-syntax-highlighter__dist__esm__languages__prism__graphql.mjs",
115
+ "react-syntax-highlighter/dist/esm/languages/prism/json": "react-syntax-highlighter__dist__esm__languages__prism__json.mjs",
116
+ "react-syntax-highlighter/dist/esm/languages/prism/markup": "react-syntax-highlighter__dist__esm__languages__prism__markup.mjs",
117
+ "react-syntax-highlighter/dist/esm/languages/prism/protobuf": "react-syntax-highlighter__dist__esm__languages__prism__protobuf.mjs",
118
+ "react-syntax-highlighter/dist/esm/languages/prism/yaml": "react-syntax-highlighter__dist__esm__languages__prism__yaml.mjs",
119
+ "react-syntax-highlighter/dist/esm/styles/prism/one-dark": "react-syntax-highlighter__dist__esm__styles__prism__one-dark.mjs",
120
+ "react-syntax-highlighter/dist/esm/styles/prism/one-light": "react-syntax-highlighter__dist__esm__styles__prism__one-light.mjs",
110
121
  "react/jsx-dev-runtime": "react__jsx-dev-runtime.mjs",
111
122
  "react/jsx-runtime": "react__jsx-runtime.mjs",
112
123
  "recast": "recast.mjs",
@@ -0,0 +1,3 @@
1
+ export * from "react-syntax-highlighter/dist/esm/languages/prism/graphql";
2
+ import * as dependency from "react-syntax-highlighter/dist/esm/languages/prism/graphql";
3
+ export default dependency.default;
@@ -0,0 +1,3 @@
1
+ export * from "react-syntax-highlighter/dist/esm/languages/prism/json";
2
+ import * as dependency from "react-syntax-highlighter/dist/esm/languages/prism/json";
3
+ export default dependency.default;
@@ -0,0 +1,3 @@
1
+ export * from "react-syntax-highlighter/dist/esm/languages/prism/markup";
2
+ import * as dependency from "react-syntax-highlighter/dist/esm/languages/prism/markup";
3
+ export default dependency.default;
@@ -0,0 +1,3 @@
1
+ export * from "react-syntax-highlighter/dist/esm/languages/prism/protobuf";
2
+ import * as dependency from "react-syntax-highlighter/dist/esm/languages/prism/protobuf";
3
+ export default dependency.default;
@@ -0,0 +1,3 @@
1
+ export * from "react-syntax-highlighter/dist/esm/languages/prism/yaml";
2
+ import * as dependency from "react-syntax-highlighter/dist/esm/languages/prism/yaml";
3
+ export default dependency.default;
@@ -0,0 +1,3 @@
1
+ export * from "react-syntax-highlighter/dist/esm/styles/prism/one-dark";
2
+ import * as dependency from "react-syntax-highlighter/dist/esm/styles/prism/one-dark";
3
+ export default dependency.default;
@@ -0,0 +1,3 @@
1
+ export * from "react-syntax-highlighter/dist/esm/styles/prism/one-light";
2
+ import * as dependency from "react-syntax-highlighter/dist/esm/styles/prism/one-light";
3
+ export default dependency.default;
@@ -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 = "4.12.2";
39
+ var version = "5.0.0-beta.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-RPVA2SZY.js";
4
- import "../chunk-WK4J6FP3.js";
3
+ } from "../chunk-ZHKEARLJ.js";
4
+ import "../chunk-TWN43V4T.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -0,0 +1,240 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/utils/license-status.ts
31
+ var license_status_exports = {};
32
+ __export(license_status_exports, {
33
+ getLicenseAnalytics: () => getLicenseAnalytics,
34
+ getLicenseStatus: () => getLicenseStatus2,
35
+ getLicenseStatusMessage: () => getLicenseStatusMessage,
36
+ printLicenseStatus: () => printLicenseStatus
37
+ });
38
+ module.exports = __toCommonJS(license_status_exports);
39
+ var import_boxen = __toESM(require("boxen"), 1);
40
+ var import_license2 = require("@eventcatalog/license");
41
+
42
+ // eventcatalog/src/utils/trial.ts
43
+ var TRIAL_LENGTH_DAYS = 90;
44
+ var LICENSE_FAQ_URL = "https://www.eventcatalog.dev/license-faq";
45
+ var LICENSE_RENEW_URL = "https://eventcatalog.cloud";
46
+ var DAY_IN_MS = 24 * 60 * 60 * 1e3;
47
+ var getTrialStatus = (tsd, now = Date.now()) => {
48
+ if (typeof tsd !== "number" || !Number.isFinite(tsd) || tsd <= 0) return;
49
+ const endsAt = tsd + TRIAL_LENGTH_DAYS * DAY_IN_MS;
50
+ const daysLeft = Math.max(0, Math.ceil((endsAt - now) / DAY_IN_MS));
51
+ return { daysLeft, ended: daysLeft === 0, endsAt: new Date(endsAt) };
52
+ };
53
+ var LICENSE_REMINDER_DAYS = 30;
54
+
55
+ // eventcatalog/src/utils/license.ts
56
+ var import_node_fs = __toESM(require("fs"), 1);
57
+ var import_node_path = __toESM(require("path"), 1);
58
+ var import_license = require("@eventcatalog/license");
59
+ var toDate = (seconds) => typeof seconds === "number" ? new Date(seconds * 1e3) : void 0;
60
+ var getDetails = (claims) => ({
61
+ org: typeof claims.org === "string" ? claims.org : void 0,
62
+ licenseId: typeof claims.licenseId === "string" ? claims.licenseId : void 0,
63
+ issuedAt: toDate(claims.iat)
64
+ });
65
+ var INVALID_REASONS = {
66
+ LICENSE_FILE_EMPTY: "the file is empty",
67
+ LICENSE_NOT_YET_VALID: "it is not valid yet",
68
+ LICENSE_SIGNATURE_INVALID: "its signature is invalid",
69
+ LICENSE_VALIDATION_FAILED: "it was not issued by EventCatalog"
70
+ };
71
+ var getLicenseFilePath = (projectDirectory) => process.env.EC_LICENSE || import_node_path.default.join(projectDirectory, "license.jwt");
72
+ var readClaims = (licenseFilePath) => {
73
+ try {
74
+ const payload = import_node_fs.default.readFileSync(licenseFilePath, "utf8").trim().split(".")[1];
75
+ return JSON.parse(Buffer.from(payload, "base64url").toString("utf8"));
76
+ } catch {
77
+ return {};
78
+ }
79
+ };
80
+ var statusCache = /* @__PURE__ */ new Map();
81
+ var getLicensePlan = () => {
82
+ if (process.env.EVENTCATALOG_SCALE === "true") return "scale";
83
+ if (process.env.EVENTCATALOG_STARTER === "true") return "starter";
84
+ };
85
+ var getCommercialLicenseStatus = (projectDirectory = process.env.PROJECT_DIR || process.cwd()) => {
86
+ const licensePath = getLicenseFilePath(projectDirectory);
87
+ const modifiedAt = import_node_fs.default.statSync(licensePath, { throwIfNoEntry: false })?.mtimeMs;
88
+ if (modifiedAt === void 0) return Promise.resolve({ state: "none" });
89
+ const key = `${licensePath}:${modifiedAt}`;
90
+ if (!statusCache.has(key)) statusCache.set(key, verifyLicense(licensePath));
91
+ return statusCache.get(key);
92
+ };
93
+ var getLicenseStatus = async (projectDirectory) => {
94
+ const license = await getCommercialLicenseStatus(projectDirectory);
95
+ if (license.state === "licensed") return license;
96
+ const plan = getLicensePlan();
97
+ return plan ? { state: "plan", plan } : license;
98
+ };
99
+ var verifyLicense = async (licensePath) => {
100
+ const consoleError = console.error;
101
+ console.error = () => {
102
+ };
103
+ try {
104
+ (0, import_license.clearCache)();
105
+ if (await (0, import_license.hasCommercialLicense)()) {
106
+ const entitlements2 = await (0, import_license.verifyOfflineLicense)({ licensePath });
107
+ return { state: "licensed", ...getDetails(entitlements2), expiresAt: new Date(entitlements2.exp * 1e3) };
108
+ }
109
+ (0, import_license.clearCache)();
110
+ const entitlements = await (0, import_license.verifyOfflineLicense)({ licensePath });
111
+ if (typeof entitlements.exp !== "number") return { state: "invalid", reason: "it has no expiry date" };
112
+ return { state: "expired", ...getDetails(entitlements), expiresAt: new Date(entitlements.exp * 1e3) };
113
+ } catch (error) {
114
+ if (error?.code === "LICENSE_EXPIRED") {
115
+ const claims = readClaims(licensePath);
116
+ return { state: "expired", ...getDetails(claims), expiresAt: toDate(claims.exp) };
117
+ }
118
+ return { state: "invalid", reason: INVALID_REASONS[error?.code] || error?.message || String(error) };
119
+ } finally {
120
+ console.error = consoleError;
121
+ }
122
+ };
123
+
124
+ // src/utils/license-status.ts
125
+ var isPlanEnabled = async (check) => {
126
+ const consoleError = console.error;
127
+ console.error = () => {
128
+ };
129
+ try {
130
+ return await check();
131
+ } catch {
132
+ return false;
133
+ } finally {
134
+ console.error = consoleError;
135
+ }
136
+ };
137
+ var checkPlanLicense = async () => {
138
+ if (await isPlanEnabled(import_license2.isEventCatalogScaleEnabled)) return "scale";
139
+ if (await isPlanEnabled(import_license2.isEventCatalogStarterEnabled)) return "starter";
140
+ };
141
+ var getLicenseStatus2 = async (projectDirectory) => {
142
+ const license = await getCommercialLicenseStatus(projectDirectory);
143
+ const plan = license.state === "licensed" ? void 0 : await checkPlanLicense();
144
+ process.env.EVENTCATALOG_SCALE = String(plan === "scale");
145
+ process.env.EVENTCATALOG_STARTER = String(plan === "starter");
146
+ return getLicenseStatus(projectDirectory);
147
+ };
148
+ var DAY_IN_MS2 = 24 * 60 * 60 * 1e3;
149
+ var getLicenseType = (license) => {
150
+ if (license.state === "licensed") return "commercial";
151
+ if (license.state === "plan") return license.plan;
152
+ return "trial";
153
+ };
154
+ var getLicenseAnalytics = (license = { state: "none" }, tsd) => ({
155
+ license: getLicenseType(license),
156
+ licenseState: license.state === "licensed" || license.state === "plan" ? "valid" : license.state,
157
+ licenseExpiry: "expiresAt" in license ? license.expiresAt?.getTime() : void 0,
158
+ trialExpiry: getTrialStatus(tsd)?.endsAt.getTime()
159
+ });
160
+ var formatDate = (date) => date.toLocaleDateString(void 0, { dateStyle: "medium" });
161
+ var formatDays = (days) => `${days} ${days === 1 ? "day" : "days"}`;
162
+ var getTrialLine = (tsd, now) => {
163
+ const trial = getTrialStatus(tsd, now);
164
+ if (!trial) return;
165
+ 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)}).`;
166
+ };
167
+ var getLicenseStatusMessage = (license, tsd, now = Date.now()) => {
168
+ if (license.state === "licensed") {
169
+ 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
+ if (daysLeft < LICENSE_REMINDER_DAYS) {
172
+ return {
173
+ title: "EventCatalog Commercial License",
174
+ color: "yellow",
175
+ text: [
176
+ licensedTo,
177
+ `Your license expires in ${formatDays(daysLeft)}, on ${formatDate(license.expiresAt)}.`,
178
+ `Renew it to keep using EventCatalog commercially: ${LICENSE_RENEW_URL}`
179
+ ].join("\n")
180
+ };
181
+ }
182
+ return {
183
+ title: "EventCatalog Commercial License",
184
+ color: "green",
185
+ text: `${licensedTo}
186
+ Valid until ${formatDate(license.expiresAt)} (${formatDays(daysLeft)} left)`
187
+ };
188
+ }
189
+ if (license.state === "plan") return;
190
+ const trialLine = getTrialLine(tsd, now);
191
+ if (license.state === "none") {
192
+ if (!trialLine) return;
193
+ const ended = getTrialStatus(tsd, now)?.ended;
194
+ return {
195
+ title: "EventCatalog trial",
196
+ color: ended ? "yellow" : "green",
197
+ text: `${trialLine}
198
+ Learn about licensing: ${LICENSE_FAQ_URL}`
199
+ };
200
+ }
201
+ if (license.state === "expired") {
202
+ const expiredOn = license.expiresAt ? `expired on ${formatDate(license.expiresAt)} (${formatDays(Math.floor((now - license.expiresAt.getTime()) / DAY_IN_MS2))} ago)` : "has expired";
203
+ return {
204
+ title: "EventCatalog License Expired",
205
+ color: "yellow",
206
+ text: [
207
+ `Your EventCatalog commercial license${license.org ? ` for ${license.org}` : ""} ${expiredOn}.`,
208
+ `Renew it to keep using EventCatalog commercially: ${LICENSE_RENEW_URL}`,
209
+ trialLine,
210
+ `Learn about licensing: ${LICENSE_FAQ_URL}`
211
+ ].filter(Boolean).join("\n")
212
+ };
213
+ }
214
+ return {
215
+ title: "EventCatalog license",
216
+ color: "yellow",
217
+ text: [`Your license.jwt could not be verified: ${license.reason}.`, trialLine, `Learn about licensing: ${LICENSE_FAQ_URL}`].filter(Boolean).join("\n")
218
+ };
219
+ };
220
+ var printLicenseStatus = (license, tsd) => {
221
+ const message = getLicenseStatusMessage(license, tsd);
222
+ if (!message) return;
223
+ console.log(
224
+ (0, import_boxen.default)(message.text, {
225
+ padding: 1,
226
+ margin: 1,
227
+ borderStyle: "round",
228
+ borderColor: message.color,
229
+ title: message.title,
230
+ titleAlignment: "center"
231
+ })
232
+ );
233
+ };
234
+ // Annotate the CommonJS export names for ESM import in node:
235
+ 0 && (module.exports = {
236
+ getLicenseAnalytics,
237
+ getLicenseStatus,
238
+ getLicenseStatusMessage,
239
+ printLicenseStatus
240
+ });
@@ -0,0 +1,28 @@
1
+ import { L as LicenseStatus } from '../license-C1y-56bb.cjs';
2
+
3
+ /**
4
+ * The catalog's license: a commercial license (license.jwt) first, falling back to a Scale or
5
+ * Starter license key. The plan is passed on to Astro (see getLicensePlan) through the environment.
6
+ */
7
+ declare const getLicenseStatus: (projectDirectory: string) => Promise<LicenseStatus>;
8
+ /**
9
+ * License fields for build telemetry: a commercial license (a valid license.jwt), a Scale or
10
+ * Starter plan, or the trial, and when each expires (unix ms, like `tsd`).
11
+ */
12
+ declare const getLicenseAnalytics: (license?: LicenseStatus, tsd?: unknown) => {
13
+ license: string;
14
+ licenseState: string;
15
+ licenseExpiry: number | undefined;
16
+ trialExpiry: number | undefined;
17
+ };
18
+ /**
19
+ * The license (or trial) box for the terminal. Undefined when there's nothing to show.
20
+ */
21
+ declare const getLicenseStatusMessage: (license: LicenseStatus, tsd: unknown, now?: number) => {
22
+ title: string;
23
+ color: string;
24
+ text: string;
25
+ } | undefined;
26
+ declare const printLicenseStatus: (license: LicenseStatus, tsd: unknown) => void;
27
+
28
+ export { LicenseStatus, getLicenseAnalytics, getLicenseStatus, getLicenseStatusMessage, printLicenseStatus };
@@ -0,0 +1,28 @@
1
+ import { L as LicenseStatus } from '../license-C1y-56bb.js';
2
+
3
+ /**
4
+ * The catalog's license: a commercial license (license.jwt) first, falling back to a Scale or
5
+ * Starter license key. The plan is passed on to Astro (see getLicensePlan) through the environment.
6
+ */
7
+ declare const getLicenseStatus: (projectDirectory: string) => Promise<LicenseStatus>;
8
+ /**
9
+ * License fields for build telemetry: a commercial license (a valid license.jwt), a Scale or
10
+ * Starter plan, or the trial, and when each expires (unix ms, like `tsd`).
11
+ */
12
+ declare const getLicenseAnalytics: (license?: LicenseStatus, tsd?: unknown) => {
13
+ license: string;
14
+ licenseState: string;
15
+ licenseExpiry: number | undefined;
16
+ trialExpiry: number | undefined;
17
+ };
18
+ /**
19
+ * The license (or trial) box for the terminal. Undefined when there's nothing to show.
20
+ */
21
+ declare const getLicenseStatusMessage: (license: LicenseStatus, tsd: unknown, now?: number) => {
22
+ title: string;
23
+ color: string;
24
+ text: string;
25
+ } | undefined;
26
+ declare const printLicenseStatus: (license: LicenseStatus, tsd: unknown) => void;
27
+
28
+ export { LicenseStatus, getLicenseAnalytics, getLicenseStatus, getLicenseStatusMessage, printLicenseStatus };
@@ -0,0 +1,12 @@
1
+ import {
2
+ getLicenseAnalytics,
3
+ getLicenseStatus,
4
+ getLicenseStatusMessage,
5
+ printLicenseStatus
6
+ } from "../chunk-TQLRG35T.js";
7
+ export {
8
+ getLicenseAnalytics,
9
+ getLicenseStatus,
10
+ getLicenseStatusMessage,
11
+ printLicenseStatus
12
+ };
@@ -27,7 +27,7 @@ import expressiveCode from 'astro-expressive-code';
27
27
  // preprocessors and the rehype plugin below load those same package defaults.
28
28
  import expressiveCodeConfig from './ec.config.mjs';
29
29
  import ecstudioWatcher from './integrations/ecstudio-watcher.mjs';
30
- import eventCatalogIntegration from './src/enterprise/integrations/eventcatalog-features.ts';
30
+ import eventCatalogIntegration from './src/features/integrations/eventcatalog-features.ts';
31
31
  import eventCatalogRuntime, { getDevServerFileSystem, packageDirectory } from './integrations/eventcatalog-runtime.mjs';
32
32
  import config from './src/utils/eventcatalog-config/source.ts';
33
33
  import preprocessExpressiveCodeConfig from './integrations/expressive-code-config.mjs';
@@ -59,7 +59,7 @@ export function getRuntimeAliases({ projectDirectory, runtimeDirectory, coreDire
59
59
  { find: /^@types$/, replacement: source('types/index.ts') },
60
60
  { find: '@utils', replacement: source('utils') },
61
61
  { find: '@layouts', replacement: source('layouts') },
62
- { find: '@enterprise', replacement: source('enterprise') },
62
+ { find: '@features', replacement: source('features') },
63
63
  { find: /^auth:config$/, replacement: path.join(coreDirectory, 'auth.config.ts') },
64
64
  { find: '@stores', replacement: source('stores') },
65
65
  ];
@@ -9,7 +9,7 @@ import { oneDark } from 'react-syntax-highlighter/dist/cjs/styles/prism';
9
9
  import * as Dialog from '@radix-ui/react-dialog';
10
10
  import * as Popover from '@radix-ui/react-popover';
11
11
  import { buildUrl } from '@utils/url-builder';
12
- import OfflineReply, { offlineReplyText } from './OfflineReply';
12
+ import OfflineReply, { ConfigurationErrorReply, getChatError, offlineReplyText } from './OfflineReply';
13
13
 
14
14
  interface ToolMetadata {
15
15
  name: string;
@@ -654,8 +654,8 @@ const ChatPanel = ({ isOpen, onClose, configured = false }: ChatPanelProps) => {
654
654
 
655
655
  const { messages, sendMessage, stop, status, setMessages, error } = useChat({ transport: chatTransport });
656
656
 
657
- // Extract user-friendly error message
658
- const errorMessage = error?.message || 'Something went wrong. Please try again.';
657
+ // The chat API's error, or how to fix a chat configuration that didn't load
658
+ const chatError = useMemo(() => getChatError(error), [error]);
659
659
 
660
660
  // Memoize last assistant message to avoid array operations on every render
661
661
  const lastAssistantMessage = useMemo(() => messages.findLast((m) => m.role === 'assistant'), [messages]);
@@ -1058,16 +1058,21 @@ const ChatPanel = ({ isOpen, onClose, configured = false }: ChatPanelProps) => {
1058
1058
  )}
1059
1059
 
1060
1060
  {/* Error message as chat bubble */}
1061
- {status === 'error' && (
1062
- <div className="flex justify-start">
1063
- <div className="w-full">
1064
- <div className="flex items-start gap-2 text-red-600 text-sm">
1065
- <span className="shrink-0">⚠️</span>
1066
- <span>{errorMessage}</span>
1061
+ {status === 'error' &&
1062
+ (chatError.type === 'configuration' ? (
1063
+ <div className="ec-chat-message ec-chat-setup flex flex-col items-start">
1064
+ <ConfigurationErrorReply reason={chatError.reason} />
1065
+ </div>
1066
+ ) : (
1067
+ <div className="flex justify-start">
1068
+ <div className="w-full">
1069
+ <div className="flex items-start gap-2 text-red-600 text-sm">
1070
+ <span className="shrink-0">⚠️</span>
1071
+ <span>{chatError.message}</span>
1072
+ </div>
1067
1073
  </div>
1068
1074
  </div>
1069
- </div>
1070
- )}
1075
+ ))}
1071
1076
 
1072
1077
  <div ref={messagesEndRef} />
1073
1078
  </div>
@@ -1361,16 +1366,21 @@ const ChatPanel = ({ isOpen, onClose, configured = false }: ChatPanelProps) => {
1361
1366
  )}
1362
1367
 
1363
1368
  {/* Error message as chat bubble */}
1364
- {status === 'error' && (
1365
- <div className="flex justify-start">
1366
- <div className="w-full">
1367
- <div className="flex items-start gap-2 text-red-600 text-sm">
1368
- <span className="shrink-0">⚠️</span>
1369
- <span>{errorMessage}</span>
1369
+ {status === 'error' &&
1370
+ (chatError.type === 'configuration' ? (
1371
+ <div className="ec-chat-message ec-chat-setup flex flex-col items-start">
1372
+ <ConfigurationErrorReply reason={chatError.reason} />
1373
+ </div>
1374
+ ) : (
1375
+ <div className="flex justify-start">
1376
+ <div className="w-full">
1377
+ <div className="flex items-start gap-2 text-red-600 text-sm">
1378
+ <span className="shrink-0">⚠️</span>
1379
+ <span>{chatError.message}</span>
1380
+ </div>
1370
1381
  </div>
1371
1382
  </div>
1372
- </div>
1373
- )}
1383
+ ))}
1374
1384
 
1375
1385
  <div ref={modalMessagesEndRef} />
1376
1386
  </div>
@@ -43,3 +43,77 @@ export default function OfflineReply() {
43
43
  </div>
44
44
  );
45
45
  }
46
+
47
+ /**
48
+ * The chat's error, from the chat API's JSON body when there is one. A configuration error means
49
+ * eventcatalog.chat.js didn't load; `reason` says why (dev mode only).
50
+ */
51
+ export type ChatError = { type: 'configuration'; reason?: string } | { type: 'error'; message: string };
52
+
53
+ export const getChatError = (error: Error | undefined): ChatError => {
54
+ const fallback = 'Something went wrong. Please try again.';
55
+ if (!error) return { type: 'error', message: fallback };
56
+ try {
57
+ const body = JSON.parse(error.message);
58
+ if (body?.code === 'CHAT_CONFIGURATION_ERROR') return { type: 'configuration', reason: body.reason };
59
+ if (typeof body?.error === 'string') return { type: 'error', message: body.error };
60
+ } catch {
61
+ // Not JSON: the error message is already readable
62
+ }
63
+ return { type: 'error', message: error.message || fallback };
64
+ };
65
+
66
+ /**
67
+ * The assistant's reply when eventcatalog.chat.js exists but didn't load. In dev mode (with the
68
+ * reason) it walks the catalog owner through the fix; otherwise it points readers to the owner.
69
+ */
70
+ export function ConfigurationErrorReply({ reason }: { reason?: string }) {
71
+ return (
72
+ <div className="ec-chat-offline w-full space-y-4 py-2 text-[13px] leading-relaxed text-[rgb(var(--ec-content-text))]">
73
+ <div className="space-y-2">
74
+ <p className="text-base font-medium leading-snug text-[rgb(var(--ec-page-text))]">I can’t reach your model yet.</p>
75
+ <p>
76
+ Your catalog has an <code className="text-[12px]">eventcatalog.chat.js</code>, but it didn’t load, so I’m not connected
77
+ to a model.
78
+ </p>
79
+ </div>
80
+ <div className="space-y-3 rounded-xl border border-[rgb(var(--ec-accent)/0.15)] bg-[rgb(var(--ec-accent)/0.04)] p-4">
81
+ {reason ? (
82
+ <>
83
+ <div className="space-y-1.5">
84
+ <p className="font-medium text-[rgb(var(--ec-page-text))]">What went wrong</p>
85
+ <pre className="whitespace-pre-wrap break-words rounded-lg border border-[rgb(var(--ec-page-border))] bg-[rgb(var(--ec-page-bg))] px-3 py-2 font-mono text-[11px] text-[rgb(var(--ec-page-text))]">
86
+ {reason}
87
+ </pre>
88
+ </div>
89
+ <div className="space-y-1.5">
90
+ <p className="font-medium text-[rgb(var(--ec-page-text))]">How to fix it</p>
91
+ <ol className="list-decimal space-y-1 pl-4">
92
+ <li>
93
+ Install the packages your <code className="text-[12px]">eventcatalog.chat.js</code> imports in your catalog,
94
+ e.g. <code className="text-[12px]">npm install ai @ai-sdk/anthropic</code>.
95
+ </li>
96
+ <li>
97
+ Add the provider’s API key to the <code className="text-[12px]">.env</code> file in your catalog, e.g.{' '}
98
+ <code className="text-[12px]">ANTHROPIC_API_KEY</code>.
99
+ </li>
100
+ <li>Restart EventCatalog.</li>
101
+ </ol>
102
+ </div>
103
+ </>
104
+ ) : (
105
+ <p>Your catalog owner can find out why in the server logs, under “Error loading chat configuration”.</p>
106
+ )}
107
+ <a
108
+ href={setupUrl}
109
+ target="_blank"
110
+ rel="noreferrer"
111
+ className="inline-flex items-center gap-2 rounded-lg bg-[rgb(var(--ec-accent))] px-3 py-2 text-xs font-medium text-white transition-colors hover:bg-[rgb(var(--ec-accent-hover))] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[rgb(var(--ec-accent))]"
112
+ >
113
+ Configuration guide
114
+ <ArrowUpRight size={14} aria-hidden="true" />
115
+ </a>
116
+ </div>
117
+ </div>
118
+ );
119
+ }