@eventcatalog/core 5.8.0 → 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.
Files changed (50) 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-Z6UUCTIB.js → chunk-26C26LFE.js} +1 -1
  6. package/dist/{chunk-YU6FEGOK.js → chunk-C4L6B5KR.js} +1 -1
  7. package/dist/{chunk-WLXXZTLD.js → chunk-SZU7I2PD.js} +1 -1
  8. package/dist/{chunk-DT63JMNP.js → chunk-UIJUSHOT.js} +1 -1
  9. package/dist/{chunk-E636DOFG.js → chunk-WN6ZFSXF.js} +1 -1
  10. package/dist/constants.cjs +1 -1
  11. package/dist/constants.js +1 -1
  12. package/dist/docs/api/02-config.md +1 -1
  13. package/dist/docs/development/00-why-eventcatalog.md +12 -8
  14. package/dist/docs/development/01-adopting-eventcatalog.md +51 -0
  15. package/dist/docs/development/{ask-your-architecture/03-install-skills.md → 01-getting-started/install-skills.md} +10 -4
  16. package/dist/docs/development/01-getting-started/installation.md +5 -1
  17. package/dist/docs/development/ask-your-architecture/01-intro.md +7 -5
  18. package/dist/docs/development/ask-your-architecture/03-mcp-server/getting-started.md +17 -3
  19. package/dist/docs/development/ask-your-architecture/03-mcp-server/introduction.md +3 -0
  20. package/dist/docs/development/ask-your-architecture/06-sync-docs-with-your-code.md +220 -0
  21. package/dist/docs/development/ask-your-architecture/07-catch-breaking-changes.md +142 -0
  22. package/dist/docs/development/components/custom-components/02-create-your-first-component.md +4 -0
  23. package/dist/docs/development/customization/customize-visualizer/00-visualizer-nodes.md +7 -5
  24. package/dist/docs/development/developer-tools/api-catalog.md +1 -1
  25. package/dist/docs/development/{ask-your-architecture/02-llms.txt.md → developer-tools/llms.txt.md} +2 -0
  26. package/dist/docs/development/{ask-your-architecture/03-schemas.txt.md → developer-tools/schemas.txt.md} +1 -1
  27. package/dist/docs/development/developer-tools/ubiquitous-language.txt.md +42 -0
  28. package/dist/docs/development/guides/domains/03-ownership-and-language/02-adding-ubiquitous-language.md +3 -0
  29. package/dist/eventcatalog.cjs +1 -1
  30. package/dist/eventcatalog.js +5 -5
  31. package/dist/generate.cjs +1 -1
  32. package/dist/generate.js +3 -3
  33. package/dist/utils/cli-logger.cjs +1 -1
  34. package/dist/utils/cli-logger.js +2 -2
  35. package/eventcatalog/src/components/Settings/LlmAccessSettingsForm.tsx +23 -3
  36. package/eventcatalog/src/features/auth/middleware/middleware-auth.ts +1 -0
  37. package/eventcatalog/src/features/mcp/apps/generated/viewer.html +1 -1
  38. package/eventcatalog/src/features/mcp/mcp-scoped-tools.ts +7 -4
  39. package/eventcatalog/src/features/mcp/mcp-server.ts +13 -1
  40. package/eventcatalog/src/features/tools/catalog-tools.ts +97 -30
  41. package/eventcatalog/src/pages/docs/llm/llms.txt.ts +24 -17
  42. package/eventcatalog/src/pages/docs/llm/schemas.txt.ts +1 -1
  43. package/eventcatalog/src/pages/docs/llm/ubiquitous-language.txt.ts +68 -0
  44. package/eventcatalog/src/pages/settings/llm-access.astro +2 -0
  45. package/eventcatalog/src/utils/collections/domains.ts +84 -0
  46. package/package.json +3 -3
  47. package/dist/docs/development/ask-your-architecture/04-agents/01-overview.md +0 -27
  48. package/dist/docs/development/ask-your-architecture/04-agents/02-code-to-docs.md +0 -124
  49. package/dist/docs/development/ask-your-architecture/04-agents/03-breaking-changes.md +0 -170
  50. package/dist/docs/development/ask-your-architecture/04-agents/_category_.json +0 -12
@@ -0,0 +1,68 @@
1
+ import config from '@config';
2
+ import type { APIRoute } from 'astro';
3
+ import { isLLMSTxtEnabled } from '@utils/feature';
4
+ import {
5
+ getTermsDefinedInSeveralDomains,
6
+ getTermSummary,
7
+ getUbiquitousLanguageGlossary,
8
+ type DomainGlossary,
9
+ type UbiquitousLanguageTerm,
10
+ } from '@utils/collections/domains';
11
+
12
+ const formatTerm = (term: UbiquitousLanguageTerm) => {
13
+ const summary = getTermSummary(term);
14
+ return `- ${term.name}${summary ? `: ${summary}` : ''}`;
15
+ };
16
+
17
+ export const GET: APIRoute = async ({ request }) => {
18
+ if (!isLLMSTxtEnabled()) {
19
+ return new Response('ubiquitous-language.txt is not enabled for this Catalog.', { status: 404 });
20
+ }
21
+
22
+ const url = new URL(request.url);
23
+ const baseUrl = process.env.LLMS_TXT_BASE_URL || `${url.origin}`;
24
+
25
+ const glossary = await getUbiquitousLanguageGlossary();
26
+
27
+ const header = [
28
+ `# ${config.organizationName} Ubiquitous Language`,
29
+ '> The business terms used across this organization, grouped by domain. A term only applies within its domain: the same word can mean something different in another domain.',
30
+ ].join('\n');
31
+
32
+ if (glossary.length === 0) {
33
+ return new Response(`${header}\n\nNo ubiquitous language terms are defined in this catalog.`, {
34
+ headers: { 'Content-Type': 'text/plain; charset=utf-8' },
35
+ });
36
+ }
37
+
38
+ const formatDomain = (domain: DomainGlossary, heading: string) =>
39
+ [
40
+ `${heading} ${domain.name}`,
41
+ ...(domain.terms.length > 0
42
+ ? [`Full definitions: ${baseUrl}/docs/domains/${domain.id}/language.mdx`, ...domain.terms.map(formatTerm)]
43
+ : []),
44
+ ].join('\n');
45
+
46
+ const termsInSeveralDomains = [...getTermsDefinedInSeveralDomains(glossary).values()].map((definitions) =>
47
+ [
48
+ `- ${definitions[0].term.name}`,
49
+ ...definitions.map(({ domain, term }) => {
50
+ const summary = getTermSummary(term);
51
+ return ` - ${domain.name}${summary ? `: ${summary}` : ''}`;
52
+ }),
53
+ ].join('\n')
54
+ );
55
+
56
+ const sections = [
57
+ header,
58
+ ...(termsInSeveralDomains.length > 0 ? [`## Terms defined in more than one domain\n${termsInSeveralDomains.join('\n')}`] : []),
59
+ ...glossary.flatMap((domain) => [
60
+ formatDomain(domain, '##'),
61
+ ...domain.subdomains.map((subdomain) => formatDomain(subdomain, '###')),
62
+ ]),
63
+ ];
64
+
65
+ return new Response(sections.join('\n\n'), {
66
+ headers: { 'Content-Type': 'text/plain; charset=utf-8' },
67
+ });
68
+ };
@@ -16,6 +16,7 @@ const apiBase = buildUrl('/api/settings');
16
16
  const llmsTxtUrl = buildUrl('/llms.txt');
17
17
  const llmsFullTxtUrl = buildUrl('/llms-full.txt');
18
18
  const schemasTxtUrl = buildUrl('/docs/llm/schemas.txt');
19
+ const ubiquitousLanguageTxtUrl = buildUrl('/docs/llm/ubiquitous-language.txt');
19
20
  ---
20
21
 
21
22
  <SettingsLayout title="LLM Access" active="llm-access">
@@ -27,5 +28,6 @@ const schemasTxtUrl = buildUrl('/docs/llm/schemas.txt');
27
28
  llmsTxtUrl={llmsTxtUrl}
28
29
  llmsFullTxtUrl={llmsFullTxtUrl}
29
30
  schemasTxtUrl={schemasTxtUrl}
31
+ ubiquitousLanguageTxtUrl={ubiquitousLanguageTxtUrl}
30
32
  />
31
33
  </SettingsLayout>
@@ -436,6 +436,90 @@ export const getRootDomains = async (): Promise<Domain[]> => {
436
436
  return domains.filter((d) => !allSubDomains.some((sd) => sd.data.id === d.data.id));
437
437
  };
438
438
 
439
+ export type UbiquitousLanguageTerm = NonNullable<UbiquitousLanguage['data']['dictionary']>[number];
440
+
441
+ export type DomainGlossary = {
442
+ id: string;
443
+ version: string;
444
+ name: string;
445
+ terms: UbiquitousLanguageTerm[];
446
+ };
447
+
448
+ export type SubdomainGlossary = DomainGlossary & { parentId: string };
449
+
450
+ export type OrganizationGlossaryDomain = DomainGlossary & { subdomains: SubdomainGlossary[] };
451
+
452
+ /**
453
+ * The ubiquitous language of the whole catalog: every domain with terms (or with a subdomain that has
454
+ * them), with all of its subdomains, at any depth, listed under it. Terms stay with their domain and are
455
+ * never merged, because the same word can mean something different in another domain.
456
+ */
457
+ export const getUbiquitousLanguageGlossary = async (): Promise<OrganizationGlossaryDomain[]> => {
458
+ const [domains, rootDomains, ubiquitousLanguages] = await Promise.all([
459
+ getDomains({ getAllVersions: false }),
460
+ getRootDomains(),
461
+ getCollection('ubiquitousLanguages'),
462
+ ]);
463
+ const domainsById = new Map(domains.map((domain) => [domain.data.id, domain]));
464
+
465
+ const toGlossary = (domain: Domain): DomainGlossary => ({
466
+ id: domain.data.id,
467
+ version: domain.data.version,
468
+ name: domain.data.name || domain.data.id,
469
+ terms: getUbiquitousLanguageFromCollection(domain, ubiquitousLanguages).flatMap(
470
+ (ubiquitousLanguage) => ubiquitousLanguage.data.dictionary || []
471
+ ),
472
+ });
473
+
474
+ // Each domain is only listed once, whether several domains share it or domains point at each other
475
+ const listedDomains = new Set<string>();
476
+
477
+ const getDescendants = (parent: Domain): SubdomainGlossary[] =>
478
+ ((parent.data.domains as unknown as Domain[]) || []).flatMap((subdomain) => {
479
+ if (listedDomains.has(subdomain.data.id)) return [];
480
+ listedDomains.add(subdomain.data.id);
481
+
482
+ // Use the current version even when the parent pins an old one: only current versions have glossaries,
483
+ // and their own subdomains resolved
484
+ const currentSubdomain = domainsById.get(subdomain.data.id) || subdomain;
485
+
486
+ return [{ ...toGlossary(currentSubdomain), parentId: parent.data.id }, ...getDescendants(currentSubdomain)];
487
+ });
488
+
489
+ // Root domains go first. Any domain still not listed after them points in a loop, so has no root.
490
+ return [...rootDomains, ...domains]
491
+ .flatMap((domain) => {
492
+ if (listedDomains.has(domain.data.id)) return [];
493
+ listedDomains.add(domain.data.id);
494
+
495
+ return [
496
+ {
497
+ ...toGlossary(domain),
498
+ subdomains: getDescendants(domain).filter((subdomain) => subdomain.terms.length > 0),
499
+ },
500
+ ];
501
+ })
502
+ .filter((domain) => domain.terms.length > 0 || domain.subdomains.length > 0);
503
+ };
504
+
505
+ /** The terms defined in more than one domain, keyed by their lowercase name */
506
+ export const getTermsDefinedInSeveralDomains = (glossary: OrganizationGlossaryDomain[]) => {
507
+ const definitions = new Map<string, { domain: DomainGlossary; term: UbiquitousLanguageTerm }[]>();
508
+
509
+ for (const domain of glossary.flatMap((domain) => [domain, ...domain.subdomains])) {
510
+ for (const term of domain.terms) {
511
+ const key = term.name.toLowerCase();
512
+ definitions.set(key, [...(definitions.get(key) || []), { domain, term }]);
513
+ }
514
+ }
515
+
516
+ return new Map([...definitions].filter(([, termDefinitions]) => new Set(termDefinitions.map((d) => d.domain.id)).size > 1));
517
+ };
518
+
519
+ /** A term's definition on one line, for the text files we generate for LLMs */
520
+ export const getTermSummary = (term: UbiquitousLanguageTerm) =>
521
+ (term.summary || term.description || '').replace(/\s+/g, ' ').trim();
522
+
439
523
  export const getDomainsForService = async (service: Service): Promise<Domain[]> => {
440
524
  const domains = await getDomains({ getAllVersions: false });
441
525
  return domains.filter((d) => {
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "license": "BUSL-1.1",
9
9
  "type": "module",
10
- "version": "5.8.0",
10
+ "version": "5.9.0",
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",
146
145
  "@eventcatalog/sdk": "2.32.0",
147
- "@eventcatalog/visualiser": "^5.2.4",
146
+ "@eventcatalog/visualiser": "^5.2.5",
147
+ "@eventcatalog/fitness": "0.1.1",
148
148
  "@eventcatalog/linter": "1.3.1"
149
149
  },
150
150
  "devDependencies": {
@@ -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
- ![Breaking Changes agent pull request comment showing detected schema changes and affected consumers](./img/breaking-changes-agent.jpeg)
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
- }