@eventcatalog/core 5.7.6 → 5.9.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.
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-SLN5D6WP.js → chunk-26C26LFE.js} +1 -1
- package/dist/{chunk-E2262TPK.js → chunk-C4L6B5KR.js} +1 -1
- package/dist/{chunk-XB4U75TZ.js → chunk-SZU7I2PD.js} +1 -1
- package/dist/{chunk-UI2XA4V7.js → chunk-UIJUSHOT.js} +1 -1
- package/dist/{chunk-A22MC5P5.js → chunk-WN6ZFSXF.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/docs/api/02-config.md +1 -1
- package/dist/docs/development/00-why-eventcatalog.md +12 -8
- package/dist/docs/development/01-adopting-eventcatalog.md +51 -0
- package/dist/docs/development/{ask-your-architecture/03-install-skills.md → 01-getting-started/install-skills.md} +10 -4
- package/dist/docs/development/01-getting-started/installation.md +5 -1
- package/dist/docs/development/ask-your-architecture/01-intro.md +7 -5
- package/dist/docs/development/ask-your-architecture/03-mcp-server/getting-started.md +17 -3
- package/dist/docs/development/ask-your-architecture/03-mcp-server/introduction.md +3 -0
- package/dist/docs/development/ask-your-architecture/06-sync-docs-with-your-code.md +220 -0
- package/dist/docs/development/ask-your-architecture/07-catch-breaking-changes.md +142 -0
- package/dist/docs/development/components/custom-components/02-create-your-first-component.md +4 -0
- package/dist/docs/development/customization/customize-visualizer/00-visualizer-nodes.md +7 -5
- package/dist/docs/development/developer-tools/api-catalog.md +1 -1
- package/dist/docs/development/{ask-your-architecture/02-llms.txt.md → developer-tools/llms.txt.md} +2 -0
- package/dist/docs/development/{ask-your-architecture/03-schemas.txt.md → developer-tools/schemas.txt.md} +1 -1
- package/dist/docs/development/developer-tools/ubiquitous-language.txt.md +42 -0
- package/dist/docs/development/guides/domains/03-ownership-and-language/02-adding-ubiquitous-language.md +3 -0
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +21 -21
- package/dist/federation/federate.js +2 -2
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/components/Settings/LlmAccessSettingsForm.tsx +23 -3
- package/eventcatalog/src/components/SpecificationDownloadButton.astro +24 -0
- package/eventcatalog/src/features/auth/middleware/middleware-auth.ts +1 -0
- package/eventcatalog/src/features/mcp/apps/generated/viewer.html +1 -1
- package/eventcatalog/src/features/mcp/mcp-scoped-tools.ts +7 -4
- package/eventcatalog/src/features/mcp/mcp-server.ts +13 -1
- package/eventcatalog/src/features/tools/catalog-tools.ts +97 -30
- package/eventcatalog/src/pages/api/schemas/services/[id]/[version]/[specification]/index.ts +25 -27
- package/eventcatalog/src/pages/discover/[type]/index.astro +9 -2
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/[filename]/[file].ts +7 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/[filename].astro +19 -7
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/generic/[filename]/[file].ts +7 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/generic/[filename].astro +21 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename]/[file].ts +7 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename].astro +19 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/[filename]/[file].ts +7 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/[filename].astro +4 -0
- package/eventcatalog/src/pages/docs/llm/llms.txt.ts +24 -17
- package/eventcatalog/src/pages/docs/llm/schemas.txt.ts +1 -1
- package/eventcatalog/src/pages/docs/llm/ubiquitous-language.txt.ts +68 -0
- package/eventcatalog/src/pages/docs/services/[id]/asyncapi/[filename]/[file].ts +7 -0
- package/eventcatalog/src/pages/docs/services/[id]/graphql/[filename]/[file].ts +7 -0
- package/eventcatalog/src/pages/docs/services/[id]/spec/[filename]/[file].ts +7 -0
- package/eventcatalog/src/pages/docs/services/_latest-raw-specification-route.ts +37 -0
- package/eventcatalog/src/pages/settings/llm-access.astro +2 -0
- package/eventcatalog/src/stores/sidebar-store/builders/data-product.ts +7 -3
- package/eventcatalog/src/utils/collections/domains.ts +84 -0
- package/eventcatalog/src/utils/raw-specification.ts +126 -0
- package/package.json +4 -4
- package/dist/docs/development/ask-your-architecture/04-agents/01-overview.md +0 -27
- package/dist/docs/development/ask-your-architecture/04-agents/02-code-to-docs.md +0 -124
- package/dist/docs/development/ask-your-architecture/04-agents/03-breaking-changes.md +0 -170
- package/dist/docs/development/ask-your-architecture/04-agents/_category_.json +0 -12
- package/dist/{chunk-46TBJZC3.js → chunk-QJ7KKN2D.js} +4 -4
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { APIContext, APIRoute } from 'astro';
|
|
2
|
+
import type { CollectionEntry } from 'astro:content';
|
|
3
|
+
import type { CollectionTypes } from '@types';
|
|
4
|
+
import { getSpecificationMediaType, processSpecifications, type SpecificationType } from '@utils/collections/util';
|
|
5
|
+
import { readResourceFile, resourceFileExists } from '@utils/resource-files';
|
|
6
|
+
import { resolveHeaders } from '@utils/remote-spec';
|
|
7
|
+
import { buildUrl } from '@utils/url-builder';
|
|
8
|
+
import Config from '@utils/eventcatalog-config/catalog';
|
|
9
|
+
|
|
10
|
+
/** The folder each kind of specification page lives in, under /docs/{type}/{id}/{version}/ */
|
|
11
|
+
const PAGE_SEGMENT_BY_SPECIFICATION_TYPE: Record<SpecificationType, string> = {
|
|
12
|
+
asyncapi: 'asyncapi',
|
|
13
|
+
openapi: 'spec',
|
|
14
|
+
graphql: 'graphql',
|
|
15
|
+
generic: 'generic',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type StaticPath = { params: Record<string, string | undefined>; props: Record<string, any> };
|
|
19
|
+
|
|
20
|
+
/** The data a specification page loads: the resource, plus the specification's path and file names */
|
|
21
|
+
export type SpecificationPageData = CollectionEntry<CollectionTypes> & {
|
|
22
|
+
path: string;
|
|
23
|
+
filename: string;
|
|
24
|
+
filenameWithoutExtension: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** A specification page's data loader (the `Page` class in each `_[filename].data.ts`) */
|
|
28
|
+
export type SpecificationPage = {
|
|
29
|
+
getStaticPaths(): Promise<StaticPath[]>;
|
|
30
|
+
getData(astro: { params: Record<string, string | undefined>; props: Record<string, any> }): Promise<any>;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The name a specification's file has in its URL: a remote specification's file name without the URL's query
|
|
35
|
+
* or fragment (orders.yaml?token=abc is orders.yaml), which would otherwise end the URL's path
|
|
36
|
+
*/
|
|
37
|
+
export const getRawSpecificationFileName = (filename: string) => filename.split(/[?#]/, 1)[0];
|
|
38
|
+
|
|
39
|
+
/** Whether a raw specification URL's `file` names this specification's file */
|
|
40
|
+
export const isRawSpecificationFile = (pageData: SpecificationPageData, file: string | undefined) =>
|
|
41
|
+
getRawSpecificationFileName(pageData.filename) === file;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The URL of a specification's file, as written (JSON, YAML, GraphQL...): its page's URL followed by the
|
|
45
|
+
* file's name, e.g. /docs/services/Orders/1.0.0/asyncapi/orders/orders.yaml
|
|
46
|
+
*/
|
|
47
|
+
export const getRawSpecificationUrl = ({
|
|
48
|
+
collection,
|
|
49
|
+
id,
|
|
50
|
+
version,
|
|
51
|
+
type,
|
|
52
|
+
filename,
|
|
53
|
+
filenameWithoutExtension,
|
|
54
|
+
}: {
|
|
55
|
+
collection: string;
|
|
56
|
+
id: string;
|
|
57
|
+
version: string;
|
|
58
|
+
type: SpecificationType;
|
|
59
|
+
filename: string;
|
|
60
|
+
filenameWithoutExtension: string;
|
|
61
|
+
}) =>
|
|
62
|
+
buildUrl(
|
|
63
|
+
`/docs/${collection}/${id}/${version}/${PAGE_SEGMENT_BY_SPECIFICATION_TYPE[type]}/${filenameWithoutExtension}/${getRawSpecificationFileName(filename)}`,
|
|
64
|
+
true
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const isRemote = (path: string) => /^https?:\/\//i.test(path);
|
|
68
|
+
|
|
69
|
+
export const notFound = (error: string) =>
|
|
70
|
+
new Response(JSON.stringify({ error }), { status: 404, headers: { 'Content-Type': 'application/json' } });
|
|
71
|
+
|
|
72
|
+
/** The specification's file, as written, with the media type of its format */
|
|
73
|
+
export const getRawSpecificationResponse = async (
|
|
74
|
+
type: SpecificationType,
|
|
75
|
+
pageData: SpecificationPageData
|
|
76
|
+
): Promise<Response> => {
|
|
77
|
+
const specification = processSpecifications((pageData.data as any).specifications).find(
|
|
78
|
+
(spec) => spec.type === type && spec.path === pageData.path
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
if (!specification) return notFound('Specification not found');
|
|
82
|
+
|
|
83
|
+
const headers = { 'Content-Type': getSpecificationMediaType(specification) };
|
|
84
|
+
|
|
85
|
+
if (isRemote(specification.path)) {
|
|
86
|
+
const allowAnyEnvInHeaders = type === 'asyncapi' && (Config?.asyncAPI?.allowAnyEnvInSpecHeaders ?? false);
|
|
87
|
+
const response = await fetch(specification.path, {
|
|
88
|
+
headers: resolveHeaders(specification.headers ?? {}, { allowAnyEnvInHeaders }),
|
|
89
|
+
}).catch(() => null);
|
|
90
|
+
|
|
91
|
+
if (!response?.ok) return notFound('Specification file could not be fetched');
|
|
92
|
+
return new Response(await response.text(), { headers });
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const content = readResourceFile(pageData, specification.path);
|
|
96
|
+
if (content === null) return notFound('Specification file could not be read');
|
|
97
|
+
|
|
98
|
+
return new Response(content, { headers });
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Each specification page's path, with the specification's file name added as `file`. A local file that
|
|
103
|
+
* doesn't exist gets no path: a static build would otherwise save the 404's JSON under the file's name.
|
|
104
|
+
*/
|
|
105
|
+
export const toRawSpecificationPaths = (paths: StaticPath[]): StaticPath[] =>
|
|
106
|
+
paths
|
|
107
|
+
.filter(({ props }) => isRemote(props.path) || resourceFileExists(props, props.path))
|
|
108
|
+
.map(({ params, props }) => ({ params: { ...params, file: getRawSpecificationFileName(props.filename) }, props }));
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The route that serves a specification's file next to its page:
|
|
112
|
+
* /docs/{type}/{id}/{version}/{asyncapi|spec|graphql|generic}/{filename}/{file}
|
|
113
|
+
*/
|
|
114
|
+
export const createRawSpecificationRoute = (type: SpecificationType, Page: SpecificationPage) => {
|
|
115
|
+
const getStaticPaths = async () => toRawSpecificationPaths(await Page.getStaticPaths());
|
|
116
|
+
|
|
117
|
+
const GET: APIRoute = async ({ params, props }: APIContext) => {
|
|
118
|
+
const pageData: SpecificationPageData | undefined = await Page.getData({ params, props });
|
|
119
|
+
|
|
120
|
+
if (!pageData || !isRawSpecificationFile(pageData, params.file)) return notFound('Specification not found');
|
|
121
|
+
|
|
122
|
+
return getRawSpecificationResponse(type, pageData);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
return { getStaticPaths, GET };
|
|
126
|
+
};
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"license": "BUSL-1.1",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "5.
|
|
10
|
+
"version": "5.9.0",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -142,10 +142,10 @@
|
|
|
142
142
|
"yjs": "^13.6.33",
|
|
143
143
|
"zod": "^4.6.6",
|
|
144
144
|
"@eventcatalog/exporters": "0.1.4",
|
|
145
|
+
"@eventcatalog/sdk": "2.32.0",
|
|
146
|
+
"@eventcatalog/visualiser": "^5.2.5",
|
|
145
147
|
"@eventcatalog/fitness": "0.1.1",
|
|
146
|
-
"@eventcatalog/linter": "1.3.1"
|
|
147
|
-
"@eventcatalog/visualiser": "^5.2.4",
|
|
148
|
-
"@eventcatalog/sdk": "2.32.0"
|
|
148
|
+
"@eventcatalog/linter": "1.3.1"
|
|
149
149
|
},
|
|
150
150
|
"devDependencies": {
|
|
151
151
|
"@astrojs/check": "^0.9.10",
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 1
|
|
3
|
-
keywords:
|
|
4
|
-
- AI Agents
|
|
5
|
-
- documentation generation
|
|
6
|
-
- automation
|
|
7
|
-
sidebar_label: Overview
|
|
8
|
-
title: EventCatalog Agents
|
|
9
|
-
description: AI agents that help you manage and document your architecture with EventCatalog
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
[EventCatalog Agent](https://github.com/event-catalog/agents) is an agent that helps you manage your documentation through CI/CD and adds a governing layer to your pull requests.
|
|
13
|
-
|
|
14
|
-
Our Agent understands EventCatalog conventions (domains, systems and resources) and uses that understanding to keep your architecture documented for you, without you having to hand-write and maintain every catalog file yourself.
|
|
15
|
-
|
|
16
|
-
EventCatalog Agent lets you define and bring your own model.
|
|
17
|
-
|
|
18
|
-
### Available workflows
|
|
19
|
-
|
|
20
|
-
| Agent | What it does |
|
|
21
|
-
| --- | --- |
|
|
22
|
-
| [Code-to-Docs](/docs/development/ask-your-architecture/agents/code-to-docs) | The EventCatalog Agent will review your pull request code and update your catalog documentation for you. |
|
|
23
|
-
| [Breaking Changes](/docs/development/ask-your-architecture/agents/breaking-changes) | Detects breaking schema changes in a pull request and shows which catalog consumers could be affected. |
|
|
24
|
-
|
|
25
|
-
### Have an idea for a workflow?
|
|
26
|
-
|
|
27
|
-
More agents and AI workflows are on the way. If you have an idea for an agent or an AI workflow you'd like to see in EventCatalog, [open an issue on GitHub](https://github.com/event-catalog/agents/issues/new) and let us know. We use these ideas to decide what to build next.
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 2
|
|
3
|
-
keywords:
|
|
4
|
-
- Code to Docs
|
|
5
|
-
- AI Agents
|
|
6
|
-
- GitHub Action
|
|
7
|
-
- documentation generation
|
|
8
|
-
sidebar_label: Code-to-Docs Agent
|
|
9
|
-
title: Code-to-Docs Agent
|
|
10
|
-
description: Keep your EventCatalog documentation in sync with your code using the Code-to-Docs agent
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
The **Code-to-Docs** agent keeps your EventCatalog documentation in sync with your code.
|
|
14
|
-
|
|
15
|
-
When you open a pull request, the agent reviews the diff, works out which documentation should change, updates it in your catalog repository, and opens (or updates) a documentation pull request. It then comments back on your source pull request with a summary and a link.
|
|
16
|
-
|
|
17
|
-
## How it works
|
|
18
|
-
|
|
19
|
-
```mermaid
|
|
20
|
-
flowchart LR
|
|
21
|
-
PR[Source pull request] --> Agent[Code-to-Docs agent]
|
|
22
|
-
Agent --> Plan{Docs need<br/>updating?}
|
|
23
|
-
Plan -- No --> Comment[Comment on source PR]
|
|
24
|
-
Plan -- Yes --> Docs[Update catalog docs]
|
|
25
|
-
Docs --> CatalogPR[Open catalog pull request]
|
|
26
|
-
CatalogPR --> Comment
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
When a pull request is opened, the agent:
|
|
30
|
-
|
|
31
|
-
1. **Checks out your catalog** so it can see your existing documentation.
|
|
32
|
-
2. **Collects the changed source files** from the pull request.
|
|
33
|
-
3. **Plans the impact**. A read-only pass where the agent decides whether the diff requires any documentation changes, and if so, exactly which catalog resources should change. If nothing is needed, it stops here and says so.
|
|
34
|
-
4. **Applies the plan**. The agent updates the documentation, using EventCatalog conventions for frontmatter and folder structure, and a linter to validate its changes. It is only allowed to touch the resources approved in the plan.
|
|
35
|
-
5. **Opens a catalog pull request** with the changes for you to review.
|
|
36
|
-
6. **Comments on your source pull request** with a high-level summary and a link to the catalog pull request.
|
|
37
|
-
|
|
38
|
-
You stay in control: the agent never edits your catalog silently. Every change arrives as a pull request you can review, tweak, and merge.
|
|
39
|
-
|
|
40
|
-
## Getting started
|
|
41
|
-
|
|
42
|
-
The Code-to-Docs agent runs as a GitHub Action. Add it to your repository in three steps.
|
|
43
|
-
|
|
44
|
-
### 1. Add a new GitHub workflow
|
|
45
|
-
|
|
46
|
-
Create a new workflow in your source directory. Typically this is where your source code lives (e.g a service that publishes/consumes messages).
|
|
47
|
-
|
|
48
|
-
Create a `.github/workflows/eventcatalog.yml` file.
|
|
49
|
-
|
|
50
|
-
```yaml
|
|
51
|
-
on:
|
|
52
|
-
pull_request:
|
|
53
|
-
|
|
54
|
-
jobs:
|
|
55
|
-
eventcatalog:
|
|
56
|
-
runs-on: ubuntu-latest
|
|
57
|
-
permissions:
|
|
58
|
-
contents: read
|
|
59
|
-
issues: write
|
|
60
|
-
pull-requests: write
|
|
61
|
-
steps:
|
|
62
|
-
- uses: actions/checkout@v6
|
|
63
|
-
with:
|
|
64
|
-
fetch-depth: 0
|
|
65
|
-
|
|
66
|
-
- uses: event-catalog/agents@main
|
|
67
|
-
env:
|
|
68
|
-
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
69
|
-
with:
|
|
70
|
-
agent: code-to-docs
|
|
71
|
-
catalog-repo: your-org/your-catalog
|
|
72
|
-
catalog-token: ${{ secrets.EVENTCATALOG_TOKEN }}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
`fetch-depth: 0` is required so the agent can diff the pull request against its base.
|
|
76
|
-
|
|
77
|
-
### 2. Add your model provider key
|
|
78
|
-
|
|
79
|
-
Add the API key for your chosen model as a secret in your repository (**Settings → Secrets and variables → Actions**). Use the one that matches your model, for example `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or `OPENROUTER_API_KEY`.
|
|
80
|
-
|
|
81
|
-
You can see the list of [available models here](https://pi.dev/models).
|
|
82
|
-
|
|
83
|
-
### 3. Open a pull request
|
|
84
|
-
|
|
85
|
-
When you next open a pull request on your project, the EventCatalog Agent will run.
|
|
86
|
-
|
|
87
|
-
If your architecture changed, opens a documentation pull request in your catalog repository and comments back with a link.
|
|
88
|
-
|
|
89
|
-
## Configuration
|
|
90
|
-
|
|
91
|
-
### Inputs
|
|
92
|
-
|
|
93
|
-
| Input | Required | Default | Description |
|
|
94
|
-
| --- | --- | --- | --- |
|
|
95
|
-
| `catalog-repo` | Yes | | The location of your hosted EventCatalog. EventCatalog repository to document into, in `owner/repo` format. |
|
|
96
|
-
| `catalog-ref` | No | `main` | Branch checked out from the catalog repository and targeted by documentation pull requests. |
|
|
97
|
-
| `catalog-token` | No | `github.token` | Token used to check out the catalog repository and open documentation pull requests. |
|
|
98
|
-
| `model` | No | `anthropic/claude-sonnet-4-6` | Model specifier for the agent. See [available models](https://pi.dev/models). |
|
|
99
|
-
| `ignore-paths` | No | common build/output paths | Comma-separated paths or glob patterns to ignore in pull request diffs. |
|
|
100
|
-
| `agent` | No | `code-to-docs` | Which EventCatalog agent to run. Use `code-to-docs` for this workflow. |
|
|
101
|
-
|
|
102
|
-
### Provider API keys
|
|
103
|
-
|
|
104
|
-
The model provider's API key is passed as a normal workflow environment variable. Set the one that matches your `model`:
|
|
105
|
-
|
|
106
|
-
| Provider | Environment variable |
|
|
107
|
-
| --- | --- |
|
|
108
|
-
| Anthropic | `ANTHROPIC_API_KEY` |
|
|
109
|
-
| OpenAI | `OPENAI_API_KEY` |
|
|
110
|
-
| OpenRouter | `OPENROUTER_API_KEY` |
|
|
111
|
-
|
|
112
|
-
The agent supports models from many providers. See the full list of model specifiers at [pi.dev/models](https://pi.dev/models).
|
|
113
|
-
|
|
114
|
-
### Documenting into a separate catalog repository
|
|
115
|
-
|
|
116
|
-
When your catalog lives in a **different** repository from your source code, provide a `catalog-token` with permission to push branches and open pull requests in that catalog repository (the default `github.token` only has access to the current repository).
|
|
117
|
-
|
|
118
|
-
:::info Early access
|
|
119
|
-
The Code-to-Docs agent is in early access and free to evaluate. In the future, a license will be required to run EventCatalog Agents in production.
|
|
120
|
-
:::
|
|
121
|
-
|
|
122
|
-
## Found an issue or have feedback?
|
|
123
|
-
|
|
124
|
-
The Code-to-Docs agent is open on GitHub at [event-catalog/agents](https://github.com/event-catalog/agents). If you hit a problem, or the agent documents something in a way you didn't expect, [open an issue](https://github.com/event-catalog/agents/issues/new) and let us know. Your feedback during early access directly shapes how the agent works.
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 3
|
|
3
|
-
keywords:
|
|
4
|
-
- Breaking Changes
|
|
5
|
-
- AI Agents
|
|
6
|
-
- GitHub Action
|
|
7
|
-
- schema governance
|
|
8
|
-
- schema compatibility
|
|
9
|
-
sidebar_label: Breaking Changes Agent
|
|
10
|
-
title: Breaking Changes Agent
|
|
11
|
-
description: Detect breaking schema changes and affected EventCatalog consumers from pull requests
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
The **Breaking Changes** agent reviews schema changes in pull requests and reports whether they are likely to break existing consumers.
|
|
15
|
-
|
|
16
|
-
When a pull request changes a message schema, the agent checks whether the diff removes or renames fields, changes types, adds new required fields, narrows enums, or introduces similar compatibility risks. If it finds a breaking change, it traces the schema through your EventCatalog and comments on the source pull request with the breaking lines and affected consumers.
|
|
17
|
-
|
|
18
|
-
The Breaking Changes agent is read-only. It does not edit your catalog or open documentation pull requests.
|
|
19
|
-
|
|
20
|
-

|
|
21
|
-
|
|
22
|
-
## How it works
|
|
23
|
-
|
|
24
|
-
```mermaid
|
|
25
|
-
flowchart LR
|
|
26
|
-
PR[Source pull request] --> Agent[Breaking Changes agent]
|
|
27
|
-
Agent --> Schema{Schema<br/>changed?}
|
|
28
|
-
Schema -- No --> Skip[Nothing to report]
|
|
29
|
-
Schema -- Yes --> Breaking{Breaking<br/>change?}
|
|
30
|
-
Breaking -- No --> Skip
|
|
31
|
-
Breaking -- Yes --> Consumers[Find catalog consumers]
|
|
32
|
-
Consumers --> Comment[Comment on source PR]
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
When a pull request is opened, the agent:
|
|
36
|
-
|
|
37
|
-
1. **Checks out your catalog** so it can understand the existing producers, consumers, messages, schemas, and flows.
|
|
38
|
-
2. **Collects the changed source files** from the pull request.
|
|
39
|
-
3. **Filters to schema files** using the configured schema extensions.
|
|
40
|
-
4. **Scores each schema change** for breaking-change risk. Additive changes, such as adding an optional field, are skipped.
|
|
41
|
-
5. **Finds affected consumers** for each breaking schema change by tracing the message through EventCatalog.
|
|
42
|
-
6. **Comments on your source pull request** with the breaking change, the relevant diff lines, and the consumers that could be affected.
|
|
43
|
-
|
|
44
|
-
If the pull request has no changed schema files, or only non-breaking schema changes, the workflow exits without creating a catalog pull request.
|
|
45
|
-
|
|
46
|
-
## Getting started
|
|
47
|
-
|
|
48
|
-
The Breaking Changes agent runs as a GitHub Action.
|
|
49
|
-
|
|
50
|
-
### 1. Add a new GitHub workflow
|
|
51
|
-
|
|
52
|
-
Create a `.github/workflows/eventcatalog-breaking-changes.yml` file in the repository where your source changes happen.
|
|
53
|
-
|
|
54
|
-
```yaml
|
|
55
|
-
on:
|
|
56
|
-
pull_request:
|
|
57
|
-
|
|
58
|
-
jobs:
|
|
59
|
-
eventcatalog-breaking-changes:
|
|
60
|
-
runs-on: ubuntu-latest
|
|
61
|
-
permissions:
|
|
62
|
-
contents: read
|
|
63
|
-
issues: write
|
|
64
|
-
pull-requests: write
|
|
65
|
-
steps:
|
|
66
|
-
- uses: actions/checkout@v6
|
|
67
|
-
with:
|
|
68
|
-
fetch-depth: 0
|
|
69
|
-
|
|
70
|
-
- uses: event-catalog/agents@main
|
|
71
|
-
env:
|
|
72
|
-
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
73
|
-
with:
|
|
74
|
-
agent: breaking-changes
|
|
75
|
-
catalog-repo: your-org/your-catalog
|
|
76
|
-
catalog-token: ${{ secrets.EVENTCATALOG_TOKEN }}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
`fetch-depth: 0` is required so the agent can diff the pull request against its base.
|
|
80
|
-
|
|
81
|
-
### 2. Add your model provider key
|
|
82
|
-
|
|
83
|
-
Add the API key for your chosen model as a secret in your repository (**Settings → Secrets and variables → Actions**). Use the one that matches your model, for example `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or `OPENROUTER_API_KEY`.
|
|
84
|
-
|
|
85
|
-
You can see the list of [available models here](https://pi.dev/models).
|
|
86
|
-
|
|
87
|
-
### 3. Open a pull request that changes a schema
|
|
88
|
-
|
|
89
|
-
When a pull request changes a schema, the agent reviews the schema diff. If it finds a breaking change, it comments on the pull request with the affected EventCatalog consumers.
|
|
90
|
-
|
|
91
|
-
## Configuration
|
|
92
|
-
|
|
93
|
-
### Inputs
|
|
94
|
-
|
|
95
|
-
| Input | Required | Default | Description |
|
|
96
|
-
| --- | --- | --- | --- |
|
|
97
|
-
| `agent` | No | `code-to-docs` | Set this to `breaking-changes` to run the Breaking Changes agent. |
|
|
98
|
-
| `catalog-repo` | Yes | | The EventCatalog repository to inspect, in `owner/repo` format. |
|
|
99
|
-
| `catalog-ref` | No | `main` | Branch checked out from the catalog repository. |
|
|
100
|
-
| `catalog-token` | No | `github.token` | Token used to check out the catalog repository. Use a token with read access when the catalog is in another private repository. |
|
|
101
|
-
| `model` | No | `anthropic/claude-sonnet-4-6` | Model specifier for the agent. See [available models](https://pi.dev/models). |
|
|
102
|
-
| `ignore-paths` | No | common build/output paths | Comma-separated paths or glob patterns to ignore in pull request diffs. |
|
|
103
|
-
| `schema-extensions` | No | `.json,.yml,.yaml,.avro,.avsc,.proto,.graphql,.gql` | Comma-separated file extensions the agent treats as message schemas. |
|
|
104
|
-
|
|
105
|
-
### Schema extensions
|
|
106
|
-
|
|
107
|
-
By default, the agent checks common schema files:
|
|
108
|
-
|
|
109
|
-
```yaml
|
|
110
|
-
schema-extensions: .json,.yml,.yaml,.avro,.avsc,.proto,.graphql,.gql
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
If your message contracts live in another file type, add that extension:
|
|
114
|
-
|
|
115
|
-
```yaml
|
|
116
|
-
- uses: event-catalog/agents@main
|
|
117
|
-
env:
|
|
118
|
-
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
119
|
-
with:
|
|
120
|
-
agent: breaking-changes
|
|
121
|
-
catalog-repo: your-org/your-catalog
|
|
122
|
-
catalog-token: ${{ secrets.EVENTCATALOG_TOKEN }}
|
|
123
|
-
schema-extensions: .json,.yaml,.ts
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Only add source-code extensions when those files contain message contracts. The agent ignores non-schema files for this workflow.
|
|
127
|
-
|
|
128
|
-
### Provider API keys
|
|
129
|
-
|
|
130
|
-
The model provider's API key is passed as a normal workflow environment variable. Set the one that matches your `model`:
|
|
131
|
-
|
|
132
|
-
| Provider | Environment variable |
|
|
133
|
-
| --- | --- |
|
|
134
|
-
| Anthropic | `ANTHROPIC_API_KEY` |
|
|
135
|
-
| OpenAI | `OPENAI_API_KEY` |
|
|
136
|
-
| OpenRouter | `OPENROUTER_API_KEY` |
|
|
137
|
-
|
|
138
|
-
The agent supports models from many providers. See the full list of model specifiers at [pi.dev/models](https://pi.dev/models).
|
|
139
|
-
|
|
140
|
-
## Run with Code-to-Docs
|
|
141
|
-
|
|
142
|
-
Each Action step runs one EventCatalog agent. To run Breaking Changes and [Code-to-Docs](/docs/development/ask-your-architecture/agents/code-to-docs) on the same pull request, add two steps:
|
|
143
|
-
|
|
144
|
-
```yaml
|
|
145
|
-
- uses: event-catalog/agents@main
|
|
146
|
-
env:
|
|
147
|
-
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
148
|
-
with:
|
|
149
|
-
agent: breaking-changes
|
|
150
|
-
catalog-repo: your-org/your-catalog
|
|
151
|
-
catalog-token: ${{ secrets.EVENTCATALOG_TOKEN }}
|
|
152
|
-
|
|
153
|
-
- uses: event-catalog/agents@main
|
|
154
|
-
env:
|
|
155
|
-
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
156
|
-
with:
|
|
157
|
-
agent: code-to-docs
|
|
158
|
-
catalog-repo: your-org/your-catalog
|
|
159
|
-
catalog-token: ${{ secrets.EVENTCATALOG_TOKEN }}
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
Use Breaking Changes when you want pull request feedback about schema compatibility. Use Code-to-Docs when you want catalog documentation updates proposed as a separate pull request.
|
|
163
|
-
|
|
164
|
-
:::info Early access
|
|
165
|
-
The Breaking Changes agent is in early access and free to evaluate. In the future, a license will be required to run EventCatalog Agents in production.
|
|
166
|
-
:::
|
|
167
|
-
|
|
168
|
-
## Found an issue or have feedback?
|
|
169
|
-
|
|
170
|
-
The Breaking Changes agent is open on GitHub at [event-catalog/agents](https://github.com/event-catalog/agents). If you hit a problem, or the agent reports something in a way you didn't expect, [open an issue](https://github.com/event-catalog/agents/issues/new) and let us know. Your feedback during early access directly shapes how the agent works.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"label": "Agents",
|
|
3
|
-
"position": 4,
|
|
4
|
-
"collapsible": true,
|
|
5
|
-
"collapsed": true,
|
|
6
|
-
"link": {
|
|
7
|
-
"type": "generated-index",
|
|
8
|
-
"slug": "/development/ask-your-architecture/agents",
|
|
9
|
-
"title": "EventCatalog Agents",
|
|
10
|
-
"description": "AI agents that help you manage and document your architecture with EventCatalog."
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getFederationDiagnostics,
|
|
3
|
-
resolveFederationRules
|
|
4
|
-
} from "./chunk-JJPB6EOZ.js";
|
|
5
1
|
import {
|
|
6
2
|
withFederationOutputTransaction
|
|
7
3
|
} from "./chunk-WRNH5C3U.js";
|
|
@@ -14,6 +10,10 @@ import {
|
|
|
14
10
|
import {
|
|
15
11
|
createFederationContentCache
|
|
16
12
|
} from "./chunk-R7Z5ALYI.js";
|
|
13
|
+
import {
|
|
14
|
+
getFederationDiagnostics,
|
|
15
|
+
resolveFederationRules
|
|
16
|
+
} from "./chunk-JJPB6EOZ.js";
|
|
17
17
|
import {
|
|
18
18
|
getEventCatalogConfigFile
|
|
19
19
|
} from "./chunk-4G7FSRPN.js";
|