@eventcatalog/core 5.7.0 → 5.7.2

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 (38) 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-FMWQ2YYN.js → chunk-B3FUBDJN.js} +1 -1
  6. package/dist/{chunk-4CV7VC4K.js → chunk-EPI5BHEU.js} +1 -1
  7. package/dist/{chunk-MOPKQMQP.js → chunk-NNTWQNQ5.js} +1 -1
  8. package/dist/{chunk-BE5PTWNC.js → chunk-OR4VBY3F.js} +1 -1
  9. package/dist/{chunk-22KZ4TJF.js → chunk-TYZENGGJ.js} +1 -1
  10. package/dist/constants.cjs +1 -1
  11. package/dist/constants.js +1 -1
  12. package/dist/eventcatalog.cjs +1 -1
  13. package/dist/eventcatalog.js +5 -5
  14. package/dist/generate.cjs +1 -1
  15. package/dist/generate.js +3 -3
  16. package/dist/utils/cli-logger.cjs +1 -1
  17. package/dist/utils/cli-logger.js +2 -2
  18. package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +702 -128
  19. package/eventcatalog/src/components/ChatPanel/ChatPanelButton.tsx +3 -2
  20. package/eventcatalog/src/components/ChatPanel/assistant-events.ts +37 -0
  21. package/eventcatalog/src/components/ChatPanel/panel-width.ts +28 -0
  22. package/eventcatalog/src/components/MDX/ResourceRef/ResourceRef.astro +2 -34
  23. package/eventcatalog/src/features/ai/chat-api.ts +24 -5
  24. package/eventcatalog/src/features/mcp/apps/generated/canvas.html +72 -71
  25. package/eventcatalog/src/features/mcp/apps/generated/viewer.html +1 -1
  26. package/eventcatalog/src/features/studio/agent-choreography.ts +84 -16
  27. package/eventcatalog/src/features/studio/api/canvases-api.ts +3 -0
  28. package/eventcatalog/src/features/studio/canvas-actions.ts +330 -15
  29. package/eventcatalog/src/features/studio/catalog.ts +5 -3
  30. package/eventcatalog/src/features/studio/components/CanvasHeader.tsx +14 -0
  31. package/eventcatalog/src/features/studio/components/StudioDesigner.tsx +116 -13
  32. package/eventcatalog/src/features/studio/hooks/use-canvas-webmcp.ts +1 -1
  33. package/eventcatalog/src/features/studio/pages/[id].astro +2 -0
  34. package/eventcatalog/src/features/studio/server/assistant-tools.ts +207 -0
  35. package/eventcatalog/src/features/studio/server/canvas-agent.ts +27 -0
  36. package/eventcatalog/src/features/studio/server/canvas-mcp.ts +3 -15
  37. package/eventcatalog/src/utils/resource-reference-icons.ts +37 -0
  38. package/package.json +4 -4
@@ -16,7 +16,6 @@ import {
16
16
  getCanvasMaps,
17
17
  readCanvas,
18
18
  readMeta,
19
- reopeningIfEdited,
20
19
  replyToThread,
21
20
  setCanvasStatus,
22
21
  setThreadResolved,
@@ -33,10 +32,10 @@ import {
33
32
  playOnNode,
34
33
  playRemove,
35
34
  playUpdateNode,
36
- type AgentStage,
37
35
  } from '../agent-choreography';
38
36
  import { STUDIO_SOCKET_PATH, findStudioRuntime } from './runtime';
39
37
  import { getAgent } from '../agents';
38
+ import { agentOnCanvas } from './canvas-agent';
40
39
 
41
40
  /**
42
41
  * MCP tools for the collaborative canvas: agents create canvases, join the ones people are on, and
@@ -100,18 +99,7 @@ export function registerCanvasTools(server: McpServer, { catalogUrl, userAgent }
100
99
  * Work on a canvas as an agent: changes are played out like a person would make them (see agent-choreography),
101
100
  * with the agent's pointer, selection and what it's doing shown to everyone on the canvas.
102
101
  */
103
- const asAgent = (id: string, name: string | undefined) => {
104
- const agent = getAgent(name, userAgent);
105
- const author = { ...agent, agent: true } as Author;
106
- const stage: AgentStage = {
107
- // An agent changing an accepted (or rejected) canvas makes it a draft again, like a person doing it
108
- change: (fn) => runtime.withCanvas(id, (doc) => reopeningIfEdited(doc, author, () => fn(doc))),
109
- present: (presence) => runtime.setAgentPresence(id, agent, presence),
110
- lastPointer: runtime.getAgentPointer(id, agent),
111
- sharesMoves: true,
112
- };
113
- return { stage, author };
114
- };
102
+ const asAgent = (id: string, name: string | undefined) => agentOnCanvas(runtime, id, getAgent(name, userAgent));
115
103
 
116
104
  // ---- The canvas in the chat (MCP App) ----
117
105
 
@@ -384,7 +372,7 @@ export function registerCanvasTools(server: McpServer, { catalogUrl, userAgent }
384
372
  {
385
373
  title: 'Remove from a canvas',
386
374
  description:
387
- 'Removes nodes (and their connections) or connections from a canvas. Comments on removed nodes stay on the canvas. Only remove what the user asked for or what you added.',
375
+ 'Removes nodes (and their connections and hotspots) or connections from a canvas. Comments on removed nodes stay on the canvas. Only remove what the user asked for or what you added.',
388
376
  inputSchema: z.object({
389
377
  canvasId,
390
378
  nodeIds: z.array(z.string()).optional(),
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Each kind of resource reference's icon (heroicons outline paths, drawn in a 24x24 viewBox with a stroke): the docs'
3
+ * [[service|OrderService]] references, and the assistant's references to what's on a Studio canvas
4
+ */
5
+ const RESOURCE_REFERENCE_ICONS: Record<string, string> = {
6
+ agent:
7
+ '<path stroke-linecap="round" stroke-linejoin="round" d="M12 6V3m-4.5 7.5h9m-9 3h9M7.5 18h9A2.5 2.5 0 0019 15.5v-5A2.5 2.5 0 0016.5 8h-9A2.5 2.5 0 005 10.5v5A2.5 2.5 0 007.5 18zM9 21h6" />',
8
+ entity:
9
+ '<path stroke-linecap="round" stroke-linejoin="round" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4" />', // Box/cube
10
+ service:
11
+ '<path stroke-linecap="round" stroke-linejoin="round" d="M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01" />', // Server
12
+ event:
13
+ '<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z" />', // Bolt
14
+ command:
15
+ '<path stroke-linecap="round" stroke-linejoin="round" d="M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 01-2.555-.337A5.972 5.972 0 015.41 20.97a5.969 5.969 0 01-.474-.065 4.48 4.48 0 00.978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25z" />', // ChatBubble
16
+ query:
17
+ '<path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z" />', // MagnifyingGlass
18
+ domain:
19
+ '<path stroke-linecap="round" stroke-linejoin="round" d="M2.25 7.125C2.25 6.504 2.754 6 3.375 6h6c.621 0 1.125.504 1.125 1.125v3.75c0 .621-.504 1.125-1.125 1.125h-6a1.125 1.125 0 01-1.125-1.125v-3.75zM14.25 8.625c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v8.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 01-1.125-1.125v-8.25zM3.75 16.125c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v2.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 01-1.125-1.125v-2.25z" />', // RectangleGroup
20
+ flow: '<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z" />', // QueueList
21
+ channel:
22
+ '<path stroke-linecap="round" stroke-linejoin="round" d="M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5" />', // ArrowsRightLeft
23
+ diagram:
24
+ '<path stroke-linecap="round" stroke-linejoin="round" d="M9 6.75V15m6-6v8.25m.503 3.498l4.875-2.437c.381-.19.622-.58.622-1.006V4.82c0-.836-.88-1.38-1.628-1.006l-3.869 1.934c-.317.159-.69.159-1.006 0L9.503 3.252a1.125 1.125 0 00-1.006 0L3.622 5.689C3.24 5.88 3 6.27 3 6.695V19.18c0 .836.88 1.38 1.628 1.006l3.869-1.934c.317-.159.69-.159 1.006 0l4.994 2.497c.317.158.69.158 1.006 0z" />', // Map
25
+ container:
26
+ '<path stroke-linecap="round" stroke-linejoin="round" d="M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125" />', // Database
27
+ user: '<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" />', // User
28
+ team: '<path stroke-linecap="round" stroke-linejoin="round" d="M18 18.72a9.094 9.094 0 003.741-.479 3 3 0 00-4.682-2.72m.94 3.198l.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0112 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 016 18.719m12 0a5.971 5.971 0 00-.941-3.197m0 0A5.995 5.995 0 0012 12.75a5.995 5.995 0 00-5.058 2.772m0 0a3 3 0 00-4.681 2.72 8.986 8.986 0 003.74.477m.94-3.197a5.971 5.971 0 00-.94 3.197M15 6.75a3 3 0 11-6 0 3 3 0 016 0zm6 3a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0zm-13.5 0a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z" />', // UserGroup
29
+ doc: '<path stroke-linecap="round" stroke-linejoin="round" d="M14 2v4a2 2 0 002 2h4" /><path stroke-linecap="round" stroke-linejoin="round" d="M15 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V7z" /><path stroke-linecap="round" stroke-linejoin="round" d="M10 9H8" /><path stroke-linecap="round" stroke-linejoin="round" d="M16 13H8" /><path stroke-linecap="round" stroke-linejoin="round" d="M16 17H8" />', // FileText
30
+ 'data-product':
31
+ '<path stroke-linecap="round" stroke-linejoin="round" d="M21 7.5l-9-5.25L3 7.5m18 0l-9 5.25M21 7.5v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9" />', // Cube
32
+ system:
33
+ '<path stroke-linecap="round" stroke-linejoin="round" d="M2.25 7.125C2.25 6.504 2.754 6 3.375 6h6c.621 0 1.125.504 1.125 1.125v3.75c0 .621-.504 1.125-1.125 1.125h-6a1.125 1.125 0 01-1.125-1.125v-3.75zM14.25 8.625c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v8.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 01-1.125-1.125v-8.25zM3.75 16.125c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v2.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 01-1.125-1.125v-2.25z" />', // Group (systems)
34
+ adr: '<path stroke-linecap="round" stroke-linejoin="round" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /><path stroke-linecap="round" stroke-linejoin="round" d="M9 7h2" />', // ClipboardList-ish (ADR)
35
+ };
36
+
37
+ export const getResourceReferenceIcon = (type: string) => RESOURCE_REFERENCE_ICONS[type] ?? RESOURCE_REFERENCE_ICONS.entity;
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "license": "BUSL-1.1",
9
9
  "type": "module",
10
- "version": "5.7.0",
10
+ "version": "5.7.2",
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },
@@ -141,11 +141,11 @@
141
141
  "y-protocols": "^1.0.7",
142
142
  "yjs": "^13.6.33",
143
143
  "zod": "^4.6.6",
144
+ "@eventcatalog/exporters": "0.1.4",
144
145
  "@eventcatalog/fitness": "0.1.1",
145
- "@eventcatalog/sdk": "2.32.0",
146
- "@eventcatalog/visualiser": "^5.2.0",
147
146
  "@eventcatalog/linter": "1.3.1",
148
- "@eventcatalog/exporters": "0.1.4"
147
+ "@eventcatalog/sdk": "2.32.0",
148
+ "@eventcatalog/visualiser": "^5.2.2"
149
149
  },
150
150
  "devDependencies": {
151
151
  "@astrojs/check": "^0.9.10",