@eventcatalog/core 5.9.0 → 5.9.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.
Files changed (30) hide show
  1. package/dist/analytics/analytics.cjs +1 -1
  2. package/dist/analytics/analytics.js +2 -2
  3. package/dist/analytics/log-build.cjs +1 -1
  4. package/dist/analytics/log-build.js +3 -3
  5. package/dist/{chunk-WN6ZFSXF.js → chunk-3PWCUWQC.js} +1 -1
  6. package/dist/{chunk-UIJUSHOT.js → chunk-A3256YCN.js} +3 -2
  7. package/dist/{chunk-SZU7I2PD.js → chunk-JDSFD7IC.js} +1 -1
  8. package/dist/{chunk-C4L6B5KR.js → chunk-KGFAIGOT.js} +1 -1
  9. package/dist/{chunk-26C26LFE.js → chunk-YBM7MCOY.js} +1 -1
  10. package/dist/constants.cjs +1 -1
  11. package/dist/constants.js +1 -1
  12. package/dist/docs/development/00-why-eventcatalog.md +3 -0
  13. package/dist/docs/development/ask-your-architecture/01-intro.md +17 -4
  14. package/dist/docs/development/ask-your-architecture/06-sync-docs-with-your-code.md +8 -1
  15. package/dist/docs/development/ask-your-architecture/07-catch-breaking-changes.md +8 -1
  16. package/dist/docs/development/ask-your-architecture/08-check-code-against-adrs.md +169 -0
  17. package/dist/docs/development/guides/resources/adrs/01-introduction.md +1 -0
  18. package/dist/eventcatalog.cjs +6 -5
  19. package/dist/eventcatalog.js +8 -8
  20. package/dist/generate.cjs +3 -2
  21. package/dist/generate.js +3 -3
  22. package/dist/utils/cli-logger.cjs +1 -1
  23. package/dist/utils/cli-logger.js +2 -2
  24. package/eventcatalog/auth.config.ts +7 -9
  25. package/eventcatalog/src/features/ai/chat-api.ts +2 -4
  26. package/eventcatalog/src/features/auth/login.astro +2 -4
  27. package/eventcatalog/src/features/auth/middleware/middleware.ts +2 -3
  28. package/eventcatalog/src/features/mcp/mcp-server.ts +2 -1
  29. package/eventcatalog/src/utils/catalog-modules.ts +16 -0
  30. package/package.json +2 -2
@@ -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.9.0";
39
+ var version = "5.9.1";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-26C26LFE.js";
3
+ } from "../chunk-YBM7MCOY.js";
4
4
  import "../chunk-CPW6G62V.js";
5
- import "../chunk-C4L6B5KR.js";
5
+ import "../chunk-KGFAIGOT.js";
6
6
  export {
7
7
  raiseEvent
8
8
  };
@@ -169,7 +169,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
169
169
  var import_os = __toESM(require("os"), 1);
170
170
 
171
171
  // package.json
172
- var version = "5.9.0";
172
+ var version = "5.9.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-WN6ZFSXF.js";
3
+ } from "../chunk-3PWCUWQC.js";
4
4
  import "../chunk-AD7CL772.js";
5
- import "../chunk-26C26LFE.js";
5
+ import "../chunk-YBM7MCOY.js";
6
6
  import "../chunk-YRZK7HKX.js";
7
7
  import "../chunk-CA6WCQ2T.js";
8
8
  import "../chunk-CPW6G62V.js";
9
- import "../chunk-C4L6B5KR.js";
9
+ import "../chunk-KGFAIGOT.js";
10
10
  import "../chunk-4G7FSRPN.js";
11
11
  export {
12
12
  log_build_default as default
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-AD7CL772.js";
4
4
  import {
5
5
  raiseEvent
6
- } from "./chunk-26C26LFE.js";
6
+ } from "./chunk-YBM7MCOY.js";
7
7
  import {
8
8
  countResources,
9
9
  hashCatalogContent,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-SZU7I2PD.js";
3
+ } from "./chunk-JDSFD7IC.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -8,6 +8,7 @@ import {
8
8
 
9
9
  // src/generate.js
10
10
  import path from "path";
11
+ import { pathToFileURL } from "url";
11
12
  function getDefaultExport(importedModule) {
12
13
  if (importedModule === null || typeof importedModule !== "object") {
13
14
  throw new Error("Invalid module");
@@ -39,7 +40,7 @@ var generate = async (PROJECT_DIRECTORY) => {
39
40
  plugin = plugin.replace("<rootDir>", PROJECT_DIRECTORY);
40
41
  }
41
42
  try {
42
- const importedGenerator = await import(plugin);
43
+ const importedGenerator = await (path.isAbsolute(plugin) ? import(pathToFileURL(plugin).href) : import(plugin));
43
44
  const generator2 = getDefaultExport(importedGenerator);
44
45
  await generator2({ eventCatalogConfig: {} }, pluginConfig);
45
46
  } catch (error) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-C4L6B5KR.js";
3
+ } from "./chunk-KGFAIGOT.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.9.0";
2
+ var version = "5.9.1";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-CPW6G62V.js";
5
5
  import {
6
6
  VERSION
7
- } from "./chunk-C4L6B5KR.js";
7
+ } from "./chunk-KGFAIGOT.js";
8
8
 
9
9
  // src/analytics/analytics.js
10
10
  import os from "os";
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "5.9.0";
28
+ var version = "5.9.1";
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-C4L6B5KR.js";
3
+ } from "./chunk-KGFAIGOT.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -45,6 +45,9 @@ EventCatalog is technology agnostic, this means you can document and model any s
45
45
  - **Help you detect breaking changes before they reach production**
46
46
  - Use EventCatalog Agents to [detect breaking schema changes](/docs/development/agents/set-up-breaking-changes)
47
47
  - Bring your own model and get notified when things break
48
+ - **Help you follow the architecture decisions you've made**
49
+ - Document decisions as [ADRs](/docs/development/guides/resources/adrs/introduction) alongside the resources they affect
50
+ - Use EventCatalog Agents to [check pull requests against your ADRs](/docs/development/agents/set-up-adr-compliance)
48
51
  - **Use natural language to query your architecture**
49
52
  - Connect AI tools to your architecture using [EventCatalog's MCP server](/docs/development/ask-your-architecture/mcp-server/introduction)
50
53
  - Ask architectural questions grounded in your documented domains, services, events, [data products](/docs/development/guides/resources/data-products/introduction), and schemas
@@ -9,14 +9,27 @@ description: Architecture documentation for humans and AI
9
9
 
10
10
  import AddedIn from '@site/src/components/MDX/AddedIn';
11
11
 
12
- EventCatalog creates an internal graph of your architecture. Perfect for AI and LLMs.
12
+ There are three ways to use AI with your catalog.
13
13
 
14
- EventCatalog supports eight ways to use AI with your catalog:
14
+ ## Ask questions about your architecture
15
+
16
+ Connect AI to your catalog, and ask it how your architecture works.
15
17
 
16
18
  - [EventCatalog MCP Server](/docs/development/ask-your-architecture/mcp-server/introduction) - Connect EventCatalog to Agents through MCP
17
19
  - [EventCatalog Assistant](/docs/development/ask-your-architecture/eventcatalog-assistant/what-is-eventcatalog-assistant) - AI Chat in your Catalog.
18
- - [Sync docs with your code](/docs/development/agents/set-up-code-to-docs) - EventCatalog Agents keep your catalog in sync with your code
19
- - [Catch breaking changes](/docs/development/agents/set-up-breaking-changes) - EventCatalog Agents warn you before a schema change breaks a consumer
20
+
21
+ ## Automate your pull requests
22
+
23
+ EventCatalog Agents run in your CI/CD pipeline and report back on your pull requests.
24
+
25
+ - [Sync docs with your code](/docs/development/agents/set-up-code-to-docs) - Keep your catalog in sync with your code
26
+ - [Catch breaking changes](/docs/development/agents/set-up-breaking-changes) - Get warned before a schema change breaks a consumer
27
+ - [Check code against ADRs](/docs/development/agents/set-up-adr-compliance) - Check that pull requests follow your architecture decisions
28
+
29
+ ## Help AI tools work with your catalog
30
+
31
+ Give the AI tools you already use the skills and context they need.
32
+
20
33
  - [AI Skills](/docs/development/getting-started/install-skills) - Install our Skills to help you manage your catalog
21
34
  - [llms.txt](/docs/development/developer-tools/llms.txt) - Give AI tools a machine-readable index of your catalog.
22
35
  - [schemas.txt](/docs/development/developer-tools/schemas.txt) - Give AI tools access to your schemas and specifications.
@@ -45,7 +45,7 @@ You need:
45
45
  - A repository with code to document (the **source repository**).
46
46
  - An API key for an AI model provider.
47
47
 
48
- ## Set it up
48
+ ## Setup
49
49
 
50
50
  In your source repository, add two secrets under **Settings → Secrets and variables → Actions**:
51
51
 
@@ -75,11 +75,18 @@ jobs:
75
75
  fetch-depth: 0
76
76
  - uses: event-catalog/agents@v2
77
77
  env:
78
+ # The key for your model's provider. This one is for the default model.
79
+ # Using another provider? Swap this variable and set `model` below.
78
80
  ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
79
81
  with:
82
+ # The agent workflow to run.
80
83
  agent: code-to-docs
84
+ # Your catalog repository, in owner/repo format.
81
85
  catalog-repo: your-org/your-catalog
86
+ # A token that can read your catalog, push branches and open pull requests.
82
87
  catalog-token: ${{ secrets.EVENTCATALOG_TOKEN }}
88
+ # Optional: the model to use. Defaults to anthropic/claude-sonnet-4-6.
89
+ # model: openai/gpt-5.1
83
90
  ```
84
91
 
85
92
  Replace `your-org/your-catalog` with your catalog repository. Keep `fetch-depth: 0`: the agent needs it to compare the pull request with its base branch.
@@ -40,7 +40,7 @@ You need:
40
40
  - A repository with message schemas (the **source repository**).
41
41
  - An API key for an AI model provider.
42
42
 
43
- ## Set it up
43
+ ## Setup
44
44
 
45
45
  In your source repository, add two secrets under **Settings → Secrets and variables → Actions**:
46
46
 
@@ -68,11 +68,18 @@ jobs:
68
68
  fetch-depth: 0
69
69
  - uses: event-catalog/agents@v2
70
70
  env:
71
+ # The key for your model's provider. This one is for the default model.
72
+ # Using another provider? Swap this variable and set `model` below.
71
73
  ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
72
74
  with:
75
+ # The agent workflow to run.
73
76
  agent: breaking-changes
77
+ # Your catalog repository, in owner/repo format.
74
78
  catalog-repo: your-org/your-catalog
79
+ # A token that can read your catalog repository.
75
80
  catalog-token: ${{ secrets.EVENTCATALOG_TOKEN }}
81
+ # Optional: the model to use. Defaults to anthropic/claude-sonnet-4-6.
82
+ # model: openai/gpt-5.1
76
83
  ```
77
84
 
78
85
  Replace `your-org/your-catalog` with your catalog repository. Keep `fetch-depth: 0`: the agent needs it to compare the pull request with its base branch.
@@ -0,0 +1,169 @@
1
+ ---
2
+ sidebar_position: 8
3
+ keywords:
4
+ - ADR Compliance
5
+ - EventCatalog Agents
6
+ - architecture decision records
7
+ - ADR governance
8
+ - GitHub Actions
9
+ sidebar_label: Check code against ADRs
10
+ title: Check code against ADRs
11
+ description: The ADR Compliance workflow comments on pull requests when the code conflicts with an architecture decision documented in your EventCatalog, citing the line and the decision.
12
+ slug: /development/agents/set-up-adr-compliance
13
+ ---
14
+
15
+ import { AdrComplianceComment } from '@site/src/components/AgentOutputs';
16
+ import { AgentPrompt } from '@site/src/components/AgentPrompt';
17
+
18
+ The **ADR Compliance** workflow checks the code changed in a pull request against the [architecture decision records](/docs/development/guides/resources/adrs/introduction) in your catalog. You choose which ADRs apply to the repository. If the code clearly conflicts with one, it comments with the line, the decision, and how to fix it. It never edits your catalog or blocks a merge.
19
+
20
+ <AgentPrompt variant="adr-compliance" />
21
+
22
+ ### Example
23
+ <AdrComplianceComment />
24
+
25
+ ## How it works
26
+
27
+ 1. **Selects the ADRs.** It finds the ADRs matching your `adrs` input, and keeps the `accepted` ones at their latest version. If an accepted ADR amends one of them, it's included too, because the decision can't be judged correctly without it.
28
+ 2. **Finds the relevant ones.** It compares the ADR summaries with the changes, so only ADRs on the same topic are reviewed in full.
29
+ 3. **Reviews the changed lines.** It reports only clear conflicts. Code that follows an ADR, code the pull request didn't change, and comments that merely mention something an ADR rules out are not conflicts. A decision for a domain or system takes precedence over a broader one on the same topic.
30
+ 4. **Checks its citations.** The line must be one the pull request changed, and the quoted sentence must be in the ADR. A conflict that fails this check is dropped.
31
+ 5. **Comments on the pull request** with each conflict. The comment updates on every push, and says so once the conflicts are gone.
32
+
33
+ If there are no conflicts, it doesn't comment.
34
+
35
+ ## Before you start
36
+
37
+ You need:
38
+
39
+ - An EventCatalog in a GitHub repository (the **catalog repository**), with the catalog at the root of the repository, and your decisions documented as [ADRs](/docs/development/guides/resources/adrs/creating-adrs).
40
+ - A repository with the code you want to check (the **source repository**).
41
+ - An API key for an AI model provider.
42
+
43
+ ## Setup
44
+
45
+ In your source repository, add two secrets under **Settings → Secrets and variables → Actions**:
46
+
47
+ - `ANTHROPIC_API_KEY`, or the key for [your model provider](#models).
48
+ - `EVENTCATALOG_TOKEN`, a GitHub token that can read your catalog repository. The workflow never writes to it.
49
+
50
+ Then add the workflow. It runs while the pull request is open, so a conflict is raised while the code can still change:
51
+
52
+ ```yaml title=".github/workflows/eventcatalog-adr-compliance.yml"
53
+ on:
54
+ pull_request:
55
+ types: [opened, synchronize, reopened]
56
+
57
+ jobs:
58
+ adr-compliance:
59
+ runs-on: ubuntu-latest
60
+ permissions:
61
+ contents: read
62
+ issues: write
63
+ pull-requests: write
64
+ steps:
65
+ - uses: actions/checkout@v6
66
+ with:
67
+ ref: ${{ github.event.pull_request.head.sha }}
68
+ fetch-depth: 0
69
+ - uses: event-catalog/agents@v2
70
+ env:
71
+ # The key for your model's provider. This one is for the default model.
72
+ # Using another provider? Swap this variable and set `model` below.
73
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
74
+ with:
75
+ # The agent workflow to run.
76
+ agent: adr-compliance
77
+ # The ADRs to check against, as globs from your catalog's root.
78
+ # Here: the top-level adrs folder and the Orders domain.
79
+ adrs: adrs/**, domains/Orders/**
80
+ # Your catalog repository, in owner/repo format.
81
+ catalog-repo: your-org/your-catalog
82
+ # A token that can read your catalog repository.
83
+ catalog-token: ${{ secrets.EVENTCATALOG_TOKEN }}
84
+ # Optional: the model to use. Defaults to anthropic/claude-sonnet-4-6.
85
+ # model: openai/gpt-5.1
86
+ ```
87
+
88
+ Replace `your-org/your-catalog` with your catalog repository, and set `adrs` to the [ADRs that apply to this repository](#choose-which-adrs-to-check). Keep `fetch-depth: 0`: the agent needs it to compare the pull request with its base branch.
89
+
90
+ To check it works, open a pull request that does something one of your accepted ADRs rules out.
91
+
92
+ ## Choose which ADRs to check
93
+
94
+ The `adrs` input is required. It takes comma-separated globs, relative to the root of your catalog. ADRs can live in any `adrs` folder in your catalog, so point the globs at wherever yours are:
95
+
96
+ | To check against | Use |
97
+ | --- | --- |
98
+ | ADRs in the top-level `adrs` folder | `adrs/**` |
99
+ | A domain, and everything nested in it | `domains/Orders/**` |
100
+ | One system | `domains/Orders/systems/checkout-system/**` |
101
+ | One service | `domains/Orders/services/OrdersAPI/**` |
102
+ | ADRs that share a naming convention | `adrs/adr-orders-*/**` |
103
+ | One ADR | `adrs/adr-012-use-outbox` |
104
+ | Every ADR in the catalog | `'**/adrs/**'` |
105
+
106
+ A typical repository checks against your organization-wide ADRs and those of its own domain:
107
+
108
+ ```yaml
109
+ with:
110
+ adrs: adrs/**, domains/Orders/**
111
+ ```
112
+
113
+ Globs start at the catalog root, so `adrs/**` means only the top-level folder, not every folder called `adrs`. A value that starts with `*` needs quotes in YAML.
114
+
115
+ If `adrs` is missing or matches no ADRs, the run fails with an error that shows where your ADRs are, so a typo can't look like a clean pass.
116
+
117
+ :::tip
118
+ Checking every ADR in the catalog can raise conflicts with decisions meant for other teams. Start with the ADRs that apply to the repository.
119
+ :::
120
+
121
+ ## Record an exception
122
+
123
+ If a conflict is intentional, add a line to the pull request description with the ADR's `id` and your reason:
124
+
125
+ ```text
126
+ adr-exception: adr-003-offload-async-work-to-worker small thumbnails only
127
+ ```
128
+
129
+ The conflict then moves to an exceptions list in the comment, so reviewers can still see it. The agent reads the description when it runs, so push a commit or re-run the workflow after adding the line. To re-run automatically when the description changes, add `edited` to the `types`.
130
+
131
+ A reason is required: a line without one is ignored. Exceptions are visible rather than enforced, so anyone who can edit the description can add one.
132
+
133
+ If the decision itself has changed, propose a new ADR in your catalog instead. See [ADR relationships](/docs/development/guides/resources/adrs/relationships).
134
+
135
+ ## Configuration
136
+
137
+ | Input | Required | Default | Description |
138
+ | --- | --- | --- | --- |
139
+ | `agent` | Yes | | Set to `adr-compliance` to run this workflow. |
140
+ | `adrs` | Yes | | Comma-separated globs, relative to the catalog root, selecting the ADRs to check against. |
141
+ | `catalog-repo` | Yes | | Your catalog repository, in `owner/repo` format. |
142
+ | `catalog-ref` | No | `main` | The catalog branch to read. |
143
+ | `catalog-token` | No | `github.token` | A token that can read the catalog repository. |
144
+ | `catalog-url` | No | | The URL of your hosted catalog. The comment links ADRs to it. Without it, they link to your catalog repository. |
145
+ | `model` | No | `anthropic/claude-sonnet-4-6` | The model the agent uses. See [models](#models). |
146
+ | `ignore-paths` | No | Build and dependency folders | Comma-separated paths or glob patterns to leave out of the review. |
147
+
148
+ ## Models
149
+
150
+ Use any model from [these providers](https://pi.dev/models). Set `model` to a provider and model name, and pass your provider's key as an environment variable on the step:
151
+
152
+ | Provider | Model example | Environment variable |
153
+ | --- | --- | --- |
154
+ | Anthropic | `anthropic/claude-sonnet-4-6` | `ANTHROPIC_API_KEY` |
155
+ | OpenAI | `openai/gpt-5.1` | `OPENAI_API_KEY` |
156
+ | OpenRouter | `openrouter/anthropic/claude-sonnet-4.6` | `OPENROUTER_API_KEY` |
157
+
158
+ To use models in your own AWS account, use an `amazon-bedrock/` model, such as `amazon-bedrock/eu.anthropic.claude-sonnet-4-6`, and give the job AWS credentials with [`aws-actions/configure-aws-credentials`](https://github.com/aws-actions/configure-aws-credentials).
159
+
160
+ ## Data and privacy
161
+
162
+ - **It's read-only.** It only comments on pull requests, and never edits your catalog.
163
+ - **Your code goes to one place:** the model provider you configure. The agent runs in your GitHub Actions runner. EventCatalog never receives your code, your catalog or your pull requests.
164
+
165
+ Each run sends one anonymous usage event: the outcome and the kind of error if it failed, the model, the run's duration, whether the pull request was open or merged, and the repository name. It never contains code, file names, paths, diffs or pull request content. To turn it off, set `POSTHOG_KEY: ''` in the step's `env`.
166
+
167
+ ## Versions
168
+
169
+ ADR Compliance needs `event-catalog/agents@v2.2.0` or later. Use `event-catalog/agents@v2` for the latest v2 release, or an exact release such as `event-catalog/agents@v2.2.0`, which never changes. Releases are listed on [GitHub](https://github.com/event-catalog/agents/tags).
@@ -20,6 +20,7 @@ Documenting ADRs in your catalog gives your team:
20
20
  - **Context** — anyone can see what alternatives were considered and why a particular path was chosen.
21
21
  - **Traceability** — decisions are linked directly to the services, events, domains, and flows they affect via `appliesTo`.
22
22
  - **Lifecycle tracking** — each ADR has a status (`proposed`, `accepted`, `rejected`, `deprecated`, `superseded`) so it is clear which decisions are still in force.
23
+ - **Checks in pull requests** — the [ADR Compliance workflow](/docs/development/agents/set-up-adr-compliance) comments when a pull request's code conflicts with an accepted decision.
23
24
  - **AI-ready context** — because ADRs sit alongside the resources they govern, the [EventCatalog MCP server](/docs/development/ask-your-architecture/mcp-server/introduction) can surface the *why* behind your architecture to AI assistants, not just the *what*. When an LLM is reasoning about a service or event, it picks up the decisions, trade-offs, and constraints recorded in your ADRs.
24
25
 
25
26
  ## Lifecycle statuses
@@ -33,11 +33,12 @@ var import_node_path22 = require("path");
33
33
  var import_node_http = __toESM(require("http"), 1);
34
34
  var import_fs = __toESM(require("fs"), 1);
35
35
  var import_node_path23 = __toESM(require("path"), 1);
36
- var import_node_url2 = require("url");
36
+ var import_node_url3 = require("url");
37
37
  var import_node_module3 = require("module");
38
38
 
39
39
  // src/generate.js
40
40
  var import_node_path3 = __toESM(require("path"), 1);
41
+ var import_node_url2 = require("url");
41
42
 
42
43
  // src/eventcatalog-config-file-utils.js
43
44
  var import_promises2 = require("fs/promises");
@@ -174,7 +175,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
174
175
  var import_picocolors = __toESM(require("picocolors"), 1);
175
176
 
176
177
  // package.json
177
- var version = "5.9.0";
178
+ var version = "5.9.1";
178
179
 
179
180
  // src/constants.ts
180
181
  var VERSION = version;
@@ -273,7 +274,7 @@ var generate = async (PROJECT_DIRECTORY) => {
273
274
  plugin = plugin.replace("<rootDir>", PROJECT_DIRECTORY);
274
275
  }
275
276
  try {
276
- const importedGenerator = await import(plugin);
277
+ const importedGenerator = await (import_node_path3.default.isAbsolute(plugin) ? import((0, import_node_url2.pathToFileURL)(plugin).href) : import(plugin));
277
278
  const generator2 = getDefaultExport(importedGenerator);
278
279
  await generator2({ eventCatalogConfig: {} }, pluginConfig);
279
280
  } catch (error) {
@@ -3090,7 +3091,7 @@ Run npm i @eventcatalog/core to update`;
3090
3091
  };
3091
3092
 
3092
3093
  // src/eventcatalog.ts
3093
- var currentDir = import_node_path23.default.dirname((0, import_node_url2.fileURLToPath)(importMetaUrl));
3094
+ var currentDir = import_node_path23.default.dirname((0, import_node_url3.fileURLToPath)(importMetaUrl));
3094
3095
  var astroCli = import_node_path23.default.join(import_node_path23.default.dirname((0, import_node_module3.createRequire)(importMetaUrl).resolve("astro/package.json")), "bin/astro.mjs");
3095
3096
  var ASTRO_IN_FOREGROUND = { ASTRO_DEV_BACKGROUND: "1", ASTRO_PREVIEW_BACKGROUND: "1" };
3096
3097
  var program = new import_commander.Command().version(VERSION);
@@ -3576,7 +3577,7 @@ var startServerCatalog = async () => {
3576
3577
  const base = (config?.base || "/").replace(/\/$/, "");
3577
3578
  await runCommandWithFilteredOutput({
3578
3579
  command: process.execPath,
3579
- args: ["--input-type=module", "-e", SERVER_BOOTSTRAP, (0, import_node_url2.pathToFileURL)(serverEntryPath).href],
3580
+ args: ["--input-type=module", "-e", SERVER_BOOTSTRAP, (0, import_node_url3.pathToFileURL)(serverEntryPath).href],
3580
3581
  cwd: dir,
3581
3582
  env: {
3582
3583
  PROJECT_DIR: dir,
@@ -1,18 +1,18 @@
1
- import {
2
- stopChildWithParent
3
- } from "./chunk-S5GWAUG5.js";
4
1
  import {
5
2
  runMigrations
6
3
  } from "./chunk-XUAF2H54.js";
7
4
  import "./chunk-CA4U2JP7.js";
5
+ import {
6
+ stopChildWithParent
7
+ } from "./chunk-S5GWAUG5.js";
8
8
  import {
9
9
  log_build_default
10
- } from "./chunk-WN6ZFSXF.js";
10
+ } from "./chunk-3PWCUWQC.js";
11
11
  import {
12
12
  getLicenseStatus,
13
13
  printLicenseStatus
14
14
  } from "./chunk-AD7CL772.js";
15
- import "./chunk-26C26LFE.js";
15
+ import "./chunk-YBM7MCOY.js";
16
16
  import "./chunk-YRZK7HKX.js";
17
17
  import "./chunk-CA6WCQ2T.js";
18
18
  import "./chunk-CPW6G62V.js";
@@ -39,10 +39,10 @@ import {
39
39
  } from "./chunk-NKNOXQ62.js";
40
40
  import {
41
41
  generate
42
- } from "./chunk-UIJUSHOT.js";
42
+ } from "./chunk-A3256YCN.js";
43
43
  import {
44
44
  logger
45
- } from "./chunk-SZU7I2PD.js";
45
+ } from "./chunk-JDSFD7IC.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-C4L6B5KR.js";
82
+ } from "./chunk-KGFAIGOT.js";
83
83
  import {
84
84
  getEventCatalogConfigFile,
85
85
  verifyRequiredFieldsAreInCatalogConfigFile
package/dist/generate.cjs CHANGED
@@ -34,6 +34,7 @@ __export(generate_exports, {
34
34
  });
35
35
  module.exports = __toCommonJS(generate_exports);
36
36
  var import_node_path3 = __toESM(require("path"), 1);
37
+ var import_node_url2 = require("url");
37
38
 
38
39
  // src/eventcatalog-config-file-utils.js
39
40
  var import_promises2 = require("fs/promises");
@@ -105,7 +106,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
105
106
  var import_picocolors = __toESM(require("picocolors"), 1);
106
107
 
107
108
  // package.json
108
- var version = "5.9.0";
109
+ var version = "5.9.1";
109
110
 
110
111
  // src/constants.ts
111
112
  var VERSION = version;
@@ -204,7 +205,7 @@ var generate = async (PROJECT_DIRECTORY) => {
204
205
  plugin = plugin.replace("<rootDir>", PROJECT_DIRECTORY);
205
206
  }
206
207
  try {
207
- const importedGenerator = await import(plugin);
208
+ const importedGenerator = await (import_node_path3.default.isAbsolute(plugin) ? import((0, import_node_url2.pathToFileURL)(plugin).href) : import(plugin));
208
209
  const generator2 = getDefaultExport(importedGenerator);
209
210
  await generator2({ eventCatalogConfig: {} }, pluginConfig);
210
211
  } catch (error) {
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-UIJUSHOT.js";
4
- import "./chunk-SZU7I2PD.js";
5
- import "./chunk-C4L6B5KR.js";
3
+ } from "./chunk-A3256YCN.js";
4
+ import "./chunk-JDSFD7IC.js";
5
+ import "./chunk-KGFAIGOT.js";
6
6
  import "./chunk-4G7FSRPN.js";
7
7
  export {
8
8
  generate
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(cli_logger_exports);
36
36
  var import_picocolors = __toESM(require("picocolors"), 1);
37
37
 
38
38
  // package.json
39
- var version = "5.9.0";
39
+ var version = "5.9.1";
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-SZU7I2PD.js";
4
- import "../chunk-C4L6B5KR.js";
3
+ } from "../chunk-JDSFD7IC.js";
4
+ import "../chunk-KGFAIGOT.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -1,20 +1,18 @@
1
1
  import { defineConfig } from '@utils/auth-astro/config';
2
- import { join } from 'node:path';
3
2
  import GitHub from '@auth/core/providers/github';
4
3
  import Okta from '@auth/core/providers/okta';
5
4
  import type { Account, Profile, User, Session } from '@auth/core/types';
6
5
  import { isAuthEnabled, isSSR } from '@utils/feature';
6
+ import { importCatalogModule } from '@utils/catalog-modules';
7
7
  import Google from '@auth/core/providers/google';
8
8
  import Auth0 from '@auth/core/providers/auth0';
9
9
  import Entra from '@auth/core/providers/microsoft-entra-id';
10
10
  import jwt from 'jsonwebtoken';
11
11
 
12
12
  // Need to try and read the eventcatalog.auth.js file and get the auth providers from there
13
- const catalogDirectory = process.env.PROJECT_DIR || process.cwd();
14
-
15
13
  const getAuthProviders = async () => {
16
14
  try {
17
- const config = await import(/* @vite-ignore */ join(catalogDirectory, 'eventcatalog.auth.js'));
15
+ const config = await importCatalogModule('eventcatalog.auth.js');
18
16
  const authConfig = config.default;
19
17
 
20
18
  const providers = [];
@@ -98,6 +96,7 @@ const getAuthProviders = async () => {
98
96
 
99
97
  return providers;
100
98
  } catch (error) {
99
+ console.error('❌ Failed to load the auth providers from eventcatalog.auth.js:', error);
101
100
  return [];
102
101
  }
103
102
  };
@@ -110,13 +109,13 @@ const getAuthConfig = async () => {
110
109
  };
111
110
  }
112
111
  try {
113
- const config = await import(/* @vite-ignore */ join(catalogDirectory, 'eventcatalog.auth.js'));
112
+ const config = await importCatalogModule('eventcatalog.auth.js');
114
113
  const authConfig = config.default;
115
114
 
116
115
  // If custom auth config is specified (Enterprise feature)
117
116
  if (authConfig?.customAuthConfig) {
118
117
  try {
119
- const customConfig = await import(/* @vite-ignore */ join(catalogDirectory, authConfig.customAuthConfig));
118
+ const customConfig = await importCatalogModule(authConfig.customAuthConfig);
120
119
  return customConfig.default;
121
120
  } catch (error) {
122
121
  console.error('❌ Failed to load custom auth config:', error);
@@ -212,9 +211,8 @@ const getAuthConfig = async () => {
212
211
  debug: authConfig?.debug || false,
213
212
  };
214
213
  } catch (error) {
215
- console.log(
216
- 'No auth config found, auth disabled. If you want to use auth, create a eventcatalog.auth.js file in your project directory.'
217
- );
214
+ // Auth is enabled and eventcatalog.auth.js exists (isAuthEnabled checks both), so the file failed to load
215
+ console.error('❌ Failed to load eventcatalog.auth.js, auth disabled:', error);
218
216
  return {
219
217
  providers: [],
220
218
  pages: {
@@ -9,7 +9,7 @@ import {
9
9
  type LanguageModel,
10
10
  type UIMessage,
11
11
  } from 'ai';
12
- import { join } from 'node:path';
12
+ import { importCatalogModule } from '@utils/catalog-modules';
13
13
  import { isCanvasEnabled, isDevMode } from '@utils/feature';
14
14
  import { getCollection, getEntry } from 'astro:content';
15
15
  import { z } from 'astro/zod';
@@ -33,8 +33,6 @@ import {
33
33
  toolDescriptions,
34
34
  } from '@features/tools/catalog-tools';
35
35
 
36
- const catalogDirectory = process.env.PROJECT_DIR || process.cwd();
37
-
38
36
  // How many model calls one answer may take. Questions across several domains need many tool calls, so the last
39
37
  // step has tools turned off: the model has to answer with what it found, rather than stop without a reply.
40
38
  const MAX_STEPS = 10;
@@ -58,7 +56,7 @@ let modelConfiguration: any;
58
56
  let extendedTools: any;
59
57
 
60
58
  try {
61
- const providerConfiguration = await import(/* @vite-ignore */ join(catalogDirectory, 'eventcatalog.chat.js'));
59
+ const providerConfiguration = await importCatalogModule('eventcatalog.chat.js');
62
60
  model = await providerConfiguration.default();
63
61
  modelConfiguration = providerConfiguration.configuration || defaultConfiguration;
64
62
  hasChatConfiguration = true;
@@ -3,18 +3,16 @@ import '../../styles/tailwind.css';
3
3
  import config from '@config';
4
4
  import { formatPageTitle } from '@utils/page-title';
5
5
  const { title, logo } = config;
6
- import { join } from 'node:path';
7
6
  import { isAuthEnabled, isSSR } from '@utils/feature';
8
7
  import { buildUrl } from '@utils/url-builder';
9
8
  import { getSession } from '@utils/auth-astro/server';
10
-
11
- const catalogDirectory = process.env.PROJECT_DIR || process.cwd();
9
+ import { importCatalogModule } from '@utils/catalog-modules';
12
10
 
13
11
  let hasAuthConfigurationFile = false;
14
12
  let providers: string[] = [];
15
13
 
16
14
  try {
17
- const authConfig = await import(/* @vite-ignore */ join(catalogDirectory, 'eventcatalog.auth.js'));
15
+ const authConfig = await importCatalogModule('eventcatalog.auth.js');
18
16
  providers = Object.keys(authConfig.default.providers);
19
17
  hasAuthConfigurationFile = true;
20
18
  } catch (error) {
@@ -1,15 +1,14 @@
1
1
  import type { MiddlewareHandler } from 'astro';
2
2
  import { authMiddleware } from './middleware-auth.ts';
3
3
  import { sequence } from 'astro:middleware';
4
- import { join } from 'node:path';
4
+ import { importCatalogModule } from '@utils/catalog-modules';
5
5
  import { isSSR } from '@utils/feature';
6
6
 
7
7
  // Try to load customer's custom RBAC middleware
8
8
  let customerRbacMiddleware: MiddlewareHandler | null = null;
9
9
 
10
10
  try {
11
- const catalogDirectory = process.env.PROJECT_DIR || process.cwd();
12
- const customerMiddleware = await import(/* @vite-ignore */ join(catalogDirectory, 'middleware.ts'));
11
+ const customerMiddleware = await importCatalogModule('middleware.ts');
13
12
  customerRbacMiddleware = customerMiddleware.rbacMiddleware;
14
13
 
15
14
  if (!isSSR()) {
@@ -3,6 +3,7 @@ import { Hono, type Context } from 'hono';
3
3
  import { McpServer, WebStandardStreamableHTTPServerTransport, type StandardSchemaWithJSON } from '@modelcontextprotocol/server';
4
4
  import { z } from 'zod';
5
5
  import { join } from 'node:path';
6
+ import { importCatalogModule } from '@utils/catalog-modules';
6
7
  import * as catalogTools from '@features/tools/catalog-tools';
7
8
  import { getCollection } from 'astro:content';
8
9
  import { createMcpAuthErrorResponse, validateMcpRequest } from './mcp-auth';
@@ -78,7 +79,7 @@ function createToolHandler<T>(fn: (params: T) => Promise<any>, errorMessage: str
78
79
  let extendedTools: Record<string, any> = {};
79
80
 
80
81
  try {
81
- const providerConfiguration = await import(/* @vite-ignore */ join(catalogDirectory, 'eventcatalog.chat.js'));
82
+ const providerConfiguration = await importCatalogModule('eventcatalog.chat.js');
82
83
 
83
84
  if (providerConfiguration.tools) {
84
85
  extendedTools = providerConfiguration.tools;
@@ -0,0 +1,16 @@
1
+ import { join } from 'node:path';
2
+ import { pathToFileURL } from 'node:url';
3
+
4
+ /**
5
+ * The file:// URL of a file in the catalog. Node's ES module loader only takes URLs: on Windows an absolute path
6
+ * (C:\catalog\eventcatalog.auth.js) reads as a URL with the scheme "c:", and the import fails.
7
+ */
8
+ export const catalogModuleUrl = (file: string, directory = process.env.PROJECT_DIR || process.cwd()) =>
9
+ pathToFileURL(join(directory, file)).href;
10
+
11
+ /**
12
+ * Imports a module from the catalog (eventcatalog.auth.js, eventcatalog.chat.js, middleware.ts), at runtime rather
13
+ * than bundled into the build, so the catalog's own file is the one that runs.
14
+ */
15
+ export const importCatalogModule = (file: string, directory?: string) =>
16
+ import(/* @vite-ignore */ catalogModuleUrl(file, directory));
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "license": "BUSL-1.1",
9
9
  "type": "module",
10
- "version": "5.9.0",
10
+ "version": "5.9.1",
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },
@@ -142,9 +142,9 @@
142
142
  "yjs": "^13.6.33",
143
143
  "zod": "^4.6.6",
144
144
  "@eventcatalog/exporters": "0.1.4",
145
+ "@eventcatalog/fitness": "0.1.1",
145
146
  "@eventcatalog/sdk": "2.32.0",
146
147
  "@eventcatalog/visualiser": "^5.2.5",
147
- "@eventcatalog/fitness": "0.1.1",
148
148
  "@eventcatalog/linter": "1.3.1"
149
149
  },
150
150
  "devDependencies": {