@auto-engineer/message-bus 0.14.0 → 0.15.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.
@@ -1,6 +1,5 @@
1
-
2
- 
3
- > @auto-engineer/message-bus@0.14.0 build /Users/sam/WebstormProjects/top/auto-engineer/packages/message-bus
4
- > tsc && tsx ../../scripts/fix-esm-imports.ts
5
-
6
- Fixed ESM imports in dist/
1
+
2
+ > @auto-engineer/message-bus@0.15.0 build /home/runner/work/auto-engineer/auto-engineer/packages/message-bus
3
+ > tsc && tsx ../../scripts/fix-esm-imports.ts
4
+
5
+ Fixed ESM imports in dist/
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @auto-engineer/message-bus
2
2
 
3
+ ## 0.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - version bump
8
+
3
9
  ## 0.14.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -1,244 +1,231 @@
1
1
  # @auto-engineer/message-bus
2
2
 
3
- A message bus plugin for the Auto Engineer CLI that implements a Command Query Responsibility Segregation (CQRS) pattern for handling commands and events in an event-driven architecture. It supports command handling, event publishing, and subscription with robust debugging capabilities.
3
+ Type-safe message bus implementing the CQRS pattern with command handling and event publishing.
4
4
 
5
- ## Installation
6
-
7
- Install the package as a dependency in your Auto Engineer project:
8
-
9
- ```bash
10
- npm install @auto-engineer/message-bus
11
- ```
12
-
13
- ## Configuration
14
-
15
- Add the plugin to your `auto.config.ts`:
16
-
17
- ```typescript
18
- export default {
19
- plugins: [
20
- '@auto-engineer/message-bus',
21
- // ... other plugins
22
- ],
23
- };
24
- ```
25
-
26
- ## What does this package do?
27
-
28
- The `@auto-engineer/message-bus` plugin provides a lightweight, type-safe message bus for managing commands and events in the Auto Engineer ecosystem. It enables plugins to communicate through a CQRS pattern, where commands trigger actions and events notify subscribers of changes. It includes detailed debugging support and integrates seamlessly with other Auto Engineer plugins.
29
-
30
- ## Key Features
31
-
32
- ### CQRS Pattern
33
-
34
- - **Commands**: Trigger actions with type-safe data payloads
35
- - **Events**: Notify subscribers of state changes or actions
36
- - **Handlers**: Define command and event handlers with type safety
37
- - **Subscriptions**: Subscribe to specific events or all events
38
-
39
- ### Command Handling
5
+ ---
40
6
 
41
- - Register command handlers with `registerCommandHandler`
42
- - Execute commands with `sendCommand`
43
- - Supports async command handling with optional event emission
44
- - Ensures one handler per command type
7
+ ## Purpose
45
8
 
46
- ### Event Publishing and Subscription
9
+ Without `@auto-engineer/message-bus`, you would have to implement your own command/event routing, handle handler registration, manage request/correlation ID propagation, and ensure proper error isolation between handlers.
47
10
 
48
- - Publish events with `publishEvent`
49
- - Subscribe to specific events with `subscribeToEvent`
50
- - Subscribe to all events with `subscribeAll`
51
- - Unsubscribe from events using subscription objects
11
+ This package provides the core messaging infrastructure for the Auto Engineer ecosystem. It enables decoupled communication through commands (write operations) and events (state changes) with robust debugging support.
52
12
 
53
- ### Debugging Support
13
+ ---
54
14
 
55
- - Uses the `debug` library for detailed logging
56
- - Namespaces: `message-bus`, `message-bus:command`, `message-bus:event`, `message-bus:handler`
57
- - Logs command execution, event publishing, and handler registration
58
- - Configurable via `DEBUG` environment variable
15
+ ## Installation
59
16
 
60
- ## Usage
17
+ ```bash
18
+ pnpm add @auto-engineer/message-bus
19
+ ```
61
20
 
62
- ### Creating a Message Bus
21
+ ## Quick Start
63
22
 
64
23
  ```typescript
65
- import { createMessageBus } from '@auto-engineer/message-bus';
24
+ import { createMessageBus, defineCommandHandler } from '@auto-engineer/message-bus';
66
25
 
67
26
  const bus = createMessageBus();
68
- ```
69
27
 
70
- ### Registering a Command Handler
71
-
72
- ```typescript
73
- import { defineCommandHandler } from '@auto-engineer/message-bus';
74
-
75
- const createUserHandler = defineCommandHandler({
28
+ const handler = defineCommandHandler({
76
29
  name: 'CreateUser',
77
30
  alias: 'create-user',
78
31
  description: 'Creates a new user',
79
- category: 'User Management',
80
32
  fields: {
81
33
  name: { description: 'User name', required: true },
82
- email: { description: 'User email', required: true },
83
- },
84
- examples: ['create-user --name John --email john@example.com'],
85
- handle: async (command) => {
86
- console.log(`Creating user: ${command.data.name}`);
87
- return {
88
- type: 'UserCreated',
89
- data: { userId: '123', name: command.data.name, email: command.data.email },
90
- timestamp: new Date(),
91
- requestId: command.requestId,
92
- correlationId: command.correlationId,
93
- };
94
34
  },
35
+ examples: [],
36
+ events: ['UserCreated'],
37
+ handle: async (cmd) => ({
38
+ type: 'UserCreated',
39
+ data: { userId: 'u-001', name: cmd.data.name },
40
+ }),
95
41
  });
96
42
 
97
- bus.registerCommandHandler(createUserHandler);
43
+ bus.registerCommandHandler(handler);
44
+
45
+ const result = await bus.sendCommand({
46
+ type: 'CreateUser',
47
+ data: { name: 'John' },
48
+ });
49
+
50
+ console.log(result);
51
+ // → { type: 'UserCreated', data: { userId: 'u-001', name: 'John' } }
98
52
  ```
99
53
 
100
- ### Sending a Command
54
+ ---
55
+
56
+ ## How-to Guides
57
+
58
+ ### Register a Command Handler
101
59
 
102
60
  ```typescript
103
- await bus.sendCommand({
61
+ import { createMessageBus, defineCommandHandler } from '@auto-engineer/message-bus';
62
+
63
+ const handler = defineCommandHandler({
64
+ name: 'MyCommand',
65
+ alias: 'my-command',
66
+ description: 'Does something',
67
+ fields: {},
68
+ examples: [],
69
+ events: ['MyEvent'],
70
+ handle: async (cmd) => ({ type: 'MyEvent', data: {} }),
71
+ });
72
+
73
+ const bus = createMessageBus();
74
+ bus.registerCommandHandler(handler);
75
+ ```
76
+
77
+ ### Send a Command
78
+
79
+ ```typescript
80
+ const result = await bus.sendCommand({
104
81
  type: 'CreateUser',
105
82
  data: { name: 'John', email: 'john@example.com' },
106
83
  requestId: 'req-123',
107
- correlationId: 'corr-456',
108
84
  });
109
85
  ```
110
86
 
111
- ### Subscribing to Events
87
+ ### Subscribe to Events
112
88
 
113
89
  ```typescript
114
90
  const subscription = bus.subscribeToEvent('UserCreated', {
115
- name: 'UserCreatedHandler',
91
+ name: 'UserCreatedNotifier',
116
92
  handle: async (event) => {
117
93
  console.log(`User created: ${event.data.userId}`);
118
94
  },
119
95
  });
120
96
 
121
- // Unsubscribe when needed
122
97
  subscription.unsubscribe();
123
98
  ```
124
99
 
125
- ### Subscribing to All Events
100
+ ### Subscribe to All Events
126
101
 
127
102
  ```typescript
128
103
  const subscription = bus.subscribeAll({
129
- name: 'AllEventsHandler',
130
- handle: async (event) => {
131
- console.log(`Event received: ${event.type}`);
104
+ name: 'EventLogger',
105
+ handle: (event) => {
106
+ console.log(`[${event.type}]`, event.data);
132
107
  },
133
108
  });
134
-
135
- // Unsubscribe when needed
136
- subscription.unsubscribe();
137
109
  ```
138
110
 
139
- ### Debugging
140
-
141
- Enable debug logging with the `DEBUG` environment variable:
111
+ ### Return Multiple Events
142
112
 
143
- ```bash
144
- DEBUG=message-bus:* npm run dev
113
+ ```typescript
114
+ const handler = defineCommandHandler({
115
+ name: 'BatchCreate',
116
+ // ...
117
+ handle: async (cmd) => {
118
+ return cmd.data.items.map(item => ({
119
+ type: 'ItemCreated',
120
+ data: item,
121
+ }));
122
+ },
123
+ });
145
124
  ```
146
125
 
147
- Example output:
148
-
149
- ```
150
- message-bus Creating new message bus instance
151
- message-bus Message bus state initialized
152
- message-bus:handler Registering command handler: CreateUser
153
- message-bus:handler Handler registered successfully, total handlers: 1
154
- message-bus:command Sending command: CreateUser
155
- message-bus:command Request ID: req-123
156
- message-bus:command Correlation ID: corr-456
157
- message-bus:command Data keys: [ 'name', 'email' ]
158
- message-bus:command Handler found for command: CreateUser
159
- message-bus:command Executing handler for: CreateUser
160
- message-bus:event Publishing event: UserCreated
161
- message-bus:event Request ID: req-123
162
- message-bus:event Correlation ID: corr-456
163
- message-bus:event Timestamp: 2025-09-04T14:19:00.000Z
164
- message-bus:event Data keys: [ 'userId', 'name', 'email' ]
165
- ```
126
+ ---
166
127
 
167
- See [DEBUG.md](./DEBUG.md) for detailed debugging instructions.
128
+ ## API Reference
168
129
 
169
- ## Project Structure
130
+ ### Package Exports
170
131
 
171
- ```
172
- message-bus/
173
- ├── src/
174
- │ ├── index.ts # Exports and main entry point
175
- │ ├── message-bus.ts # Core message bus implementation
176
- │ ├── define-command.ts # Command handler definition utility
177
- │ ├── types.ts # Type definitions for CQRS
178
- ├── DEBUG.md # Debugging instructions
179
- ├── CHANGELOG.md # Version history
180
- ├── package.json
181
- ├── tsconfig.json
132
+ ```typescript
133
+ import {
134
+ createMessageBus,
135
+ defineCommandHandler,
136
+ } from '@auto-engineer/message-bus';
137
+
138
+ import type {
139
+ Command,
140
+ Event,
141
+ CommandHandler,
142
+ EventHandler,
143
+ EventSubscription,
144
+ MessageBus,
145
+ UnifiedCommandHandler,
146
+ FieldDefinition,
147
+ } from '@auto-engineer/message-bus';
182
148
  ```
183
149
 
184
- ## Quality Assurance
150
+ ### Functions
185
151
 
186
- - **Type Safety**: Full TypeScript support with strict type checking
187
- - **Testing**: Unit tests using Vitest
188
- - **Linting**: ESLint and Prettier for code quality
189
- - **Error Handling**: Robust error handling for command and event processing
190
- - **Debugging**: Detailed logging with `debug` library
152
+ #### `createMessageBus(): MessageBus`
191
153
 
192
- ## Integration with Auto Engineer Ecosystem
154
+ Create a new message bus instance.
193
155
 
194
- Works with other Auto Engineer plugins:
156
+ #### `defineCommandHandler(options): UnifiedCommandHandler`
195
157
 
196
- - **@auto-engineer/file-syncer**: Emits file change events
197
- - **@auto-engineer/flow**: Publishes flow-related events
198
- - **@auto-engineer/server-generator-apollo-emmett**: Triggers commands for server generation
199
- - **@auto-engineer/frontend-generator-react-graphql**: Triggers commands for frontend generation
200
- - **@auto-engineer/server-implementer**: Handles server implementation commands
201
- - **@auto-engineer/frontend-implementer**: Handles frontend implementation commands
158
+ Define a command handler with CLI metadata.
202
159
 
203
- ## Commands
160
+ ### Command Type
204
161
 
205
- This plugin integrates with the Auto Engineer CLI but does not expose direct CLI commands. It is used internally by other plugins for event-driven communication.
206
-
207
- ## Getting Started
162
+ ```typescript
163
+ type Command<Type extends string, Data> = Readonly<{
164
+ type: Type;
165
+ data: Readonly<Data>;
166
+ timestamp?: Date;
167
+ requestId?: string;
168
+ correlationId?: string;
169
+ }>;
170
+ ```
208
171
 
209
- 1. Install the plugin (see Installation above)
210
- 2. Add it to your `auto.config.ts`
211
- 3. Use the message bus in your application or other plugins
172
+ ### Event Type
212
173
 
213
- Example:
174
+ ```typescript
175
+ type Event<Type extends string, Data> = Readonly<{
176
+ type: Type;
177
+ data: Data;
178
+ timestamp?: Date;
179
+ requestId?: string;
180
+ correlationId?: string;
181
+ }>;
182
+ ```
214
183
 
215
- ```bash
216
- # Install the plugin
217
- npm install @auto-engineer/message-bus
184
+ ### MessageBus Interface
218
185
 
219
- # Run your Auto Engineer project
220
- npm run start
186
+ ```typescript
187
+ interface MessageBus {
188
+ registerCommandHandler(handler: CommandHandler): void;
189
+ registerEventHandler(eventType: string, handler: EventHandler): void;
190
+ sendCommand(command: Command): Promise<Event | Event[]>;
191
+ publishEvent(event: Event): Promise<void>;
192
+ subscribeToEvent(eventType: string, handler: EventHandler): EventSubscription;
193
+ subscribeAll(handler: EventHandler): EventSubscription;
194
+ getCommandHandlers(): Record<string, CommandHandler>;
195
+ }
221
196
  ```
222
197
 
223
- ## Advanced Features
198
+ ---
224
199
 
225
- ### Type-Safe Command Handlers
200
+ ## Architecture
226
201
 
227
- - Use `defineCommandHandler` to create handlers with metadata (alias, description, fields)
228
- - Supports command validation through field definitions
229
- - Generates events or void responses
202
+ ```
203
+ src/
204
+ ├── index.ts
205
+ ├── message-bus.ts
206
+ ├── define-command.ts
207
+ └── types.ts
208
+ ```
209
+
210
+ The following diagram shows the message flow:
230
211
 
231
- ### Event-Driven Architecture
212
+ ```mermaid
213
+ flowchart LR
214
+ A[sendCommand] --> B[CommandHandler]
215
+ B --> C[Event]
216
+ C --> D[publishEvent]
217
+ D --> E[EventHandlers]
218
+ ```
232
219
 
233
- - Asynchronous event handling with `Promise.allSettled` for robust execution
234
- - Supports multiple handlers per event type
235
- - All-event subscription for global event monitoring
220
+ *Flow: Command is sent, handler processes it, returns event(s), events are published to subscribers.*
236
221
 
237
- ### Correlation and Request IDs
222
+ ### Key Concepts
238
223
 
239
- - Tracks `requestId` and `correlationId` for command/event traceability
240
- - Useful for debugging and logging workflows
224
+ - **One handler per command type**: Ensures deterministic command processing
225
+ - **Multiple handlers per event type**: Enables fan-out notification
226
+ - **Request/Correlation ID propagation**: Maintains traceability
227
+ - **Error isolation**: Handler failures don't affect other handlers
241
228
 
242
- ## Changelog
229
+ ### Dependencies
243
230
 
244
- See [CHANGELOG.md](./CHANGELOG.md) for version history and updates.
231
+ This package has no dependencies on other `@auto-engineer/*` packages. It is a foundational package used throughout the monorepo.
@@ -1,4 +1,4 @@
1
- import type { Command, CommandHandler, Event } from './types';
1
+ import type { Command, CommandHandler, Event, EventDefinition } from './types';
2
2
  type CommandData<C> = C extends Command<string, infer D> ? D : never;
3
3
  type CommandType<C> = C extends Command<infer T, Record<string, unknown>> ? T : never;
4
4
  export interface FieldDefinition<T> {
@@ -11,10 +11,10 @@ export interface PackageMetadata {
11
11
  version?: string;
12
12
  description?: string;
13
13
  }
14
- type ExtractEventTypes<T> = T extends Promise<infer U> ? U extends Event<infer EventType, Record<string, unknown>> ? EventType : U extends Event<infer EventType1, Record<string, unknown>> | Event<infer EventType2, Record<string, unknown>> ? EventType1 | EventType2 : never : never;
15
14
  export interface UnifiedCommandHandler<C extends Command<string, Record<string, unknown>>> extends CommandHandler {
16
15
  alias: string;
17
16
  description: string;
17
+ displayName?: string;
18
18
  category?: string;
19
19
  icon?: string;
20
20
  package?: PackageMetadata;
@@ -22,7 +22,7 @@ export interface UnifiedCommandHandler<C extends Command<string, Record<string,
22
22
  [K in keyof CommandData<C>]: FieldDefinition<CommandData<C>[K]>;
23
23
  };
24
24
  examples: string[];
25
- events?: string[];
25
+ events?: EventDefinition[];
26
26
  handle: (command: Command) => Promise<Event | Event[]>;
27
27
  }
28
28
  /**
@@ -34,6 +34,7 @@ export declare function defineCommandHandler<C extends Command<string, Record<st
34
34
  name: CommandType<C>;
35
35
  alias: string;
36
36
  description: string;
37
+ displayName?: string;
37
38
  category?: string;
38
39
  icon?: string;
39
40
  package?: PackageMetadata;
@@ -42,7 +43,7 @@ export declare function defineCommandHandler<C extends Command<string, Record<st
42
43
  };
43
44
  examples: string[];
44
45
  handle: H;
45
- events: Array<ExtractEventTypes<ReturnType<H>>>;
46
+ events: EventDefinition[];
46
47
  }): UnifiedCommandHandler<C>;
47
48
  /**
48
49
  * Define a command handler with manual event specification (without generics)
@@ -53,13 +54,14 @@ export declare function defineCommandHandler(config: {
53
54
  name: string;
54
55
  alias: string;
55
56
  description: string;
57
+ displayName?: string;
56
58
  category?: string;
57
59
  icon?: string;
58
60
  package?: PackageMetadata;
59
61
  fields: Record<string, FieldDefinition<unknown>>;
60
62
  examples: string[];
61
63
  handle: (command: Command) => Promise<Event | Event[]>;
62
- events: string[];
64
+ events: EventDefinition[];
63
65
  }): CommandHandler;
64
66
  export {};
65
67
  //# sourceMappingURL=define-command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"define-command.d.ts","sourceRoot":"","sources":["../../src/define-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAG9D,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AACrE,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAGtF,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,IAAI,CAAC;IAC9C,IAAI,CAAC,E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MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;IACjD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,CAAC;IACvD,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B,GAAG,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"define-command.js","sourceRoot":"","sources":["../../src/define-command.ts"],"names":[],"mappings":"AAqFA,MAAM,UAAU,oBAAoB,CAAC,MAWpC;IACC,gFAAgF;IAChF,OAAO;QACL,GAAG,MAAM;QACT,MAAM,EAAE,MAAM,CAAC,MAAwD;KACxE,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"define-command.js","sourceRoot":"","sources":["../../src/define-command.ts"],"names":[],"mappings":"AA+EA,MAAM,UAAU,oBAAoB,CAAC,MAYpC;IACC,gFAAgF;IAChF,OAAO;QACL,GAAG,MAAM;QACT,MAAM,EAAE,MAAM,CAAC,MAAwD;KACxE,CAAC;AACJ,CAAC"}
@@ -24,5 +24,9 @@ export type EventHandler<TEvent extends Event = Event> = {
24
24
  export type EventSubscription = {
25
25
  unsubscribe: () => void;
26
26
  };
27
+ export type EventDefinition = string | {
28
+ name: string;
29
+ displayName: string;
30
+ };
27
31
  export {};
28
32
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAEA,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEzC,MAAM,MAAM,OAAO,CAAC,WAAW,SAAS,MAAM,GAAG,MAAM,E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