@auto-engineer/cli 0.5.20 → 0.6.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.
- package/CHANGELOG.md +11 -0
- package/LICENSE +10 -0
- package/README.md +185 -151
- package/dist/src/index.js +254 -93
- package/dist/src/index.js.map +1 -1
- package/dist/src/manifest-types.d.ts +21 -0
- package/dist/src/manifest-types.d.ts.map +1 -0
- package/dist/src/manifest-types.js +2 -0
- package/dist/src/manifest-types.js.map +1 -0
- package/dist/src/plugin-loader.d.ts +49 -0
- package/dist/src/plugin-loader.d.ts.map +1 -0
- package/dist/src/plugin-loader.js +383 -0
- package/dist/src/plugin-loader.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -28
- package/dist/src/commands/check-client.d.ts +0 -6
- package/dist/src/commands/check-client.d.ts.map +0 -1
- package/dist/src/commands/check-client.js +0 -69
- package/dist/src/commands/check-client.js.map +0 -1
- package/dist/src/commands/check-lint.d.ts +0 -5
- package/dist/src/commands/check-lint.d.ts.map +0 -1
- package/dist/src/commands/check-lint.js +0 -96
- package/dist/src/commands/check-lint.js.map +0 -1
- package/dist/src/commands/check-tests.d.ts +0 -5
- package/dist/src/commands/check-tests.d.ts.map +0 -1
- package/dist/src/commands/check-tests.js +0 -87
- package/dist/src/commands/check-tests.js.map +0 -1
- package/dist/src/commands/check-types.d.ts +0 -5
- package/dist/src/commands/check-types.d.ts.map +0 -1
- package/dist/src/commands/check-types.js +0 -83
- package/dist/src/commands/check-types.js.map +0 -1
- package/dist/src/commands/copy-example.d.ts +0 -5
- package/dist/src/commands/copy-example.d.ts.map +0 -1
- package/dist/src/commands/copy-example.js +0 -54
- package/dist/src/commands/copy-example.js.map +0 -1
- package/dist/src/commands/create-example.d.ts +0 -5
- package/dist/src/commands/create-example.d.ts.map +0 -1
- package/dist/src/commands/create-example.js +0 -60
- package/dist/src/commands/create-example.js.map +0 -1
- package/dist/src/commands/export-schema.d.ts +0 -5
- package/dist/src/commands/export-schema.d.ts.map +0 -1
- package/dist/src/commands/export-schema.js +0 -49
- package/dist/src/commands/export-schema.js.map +0 -1
- package/dist/src/commands/generate-client.d.ts +0 -5
- package/dist/src/commands/generate-client.d.ts.map +0 -1
- package/dist/src/commands/generate-client.js +0 -77
- package/dist/src/commands/generate-client.js.map +0 -1
- package/dist/src/commands/generate-gql-schema.d.ts +0 -5
- package/dist/src/commands/generate-gql-schema.d.ts.map +0 -1
- package/dist/src/commands/generate-gql-schema.js +0 -57
- package/dist/src/commands/generate-gql-schema.js.map +0 -1
- package/dist/src/commands/generate-ia.d.ts +0 -5
- package/dist/src/commands/generate-ia.d.ts.map +0 -1
- package/dist/src/commands/generate-ia.js +0 -54
- package/dist/src/commands/generate-ia.js.map +0 -1
- package/dist/src/commands/generate-server.d.ts +0 -5
- package/dist/src/commands/generate-server.d.ts.map +0 -1
- package/dist/src/commands/generate-server.js +0 -50
- package/dist/src/commands/generate-server.js.map +0 -1
- package/dist/src/commands/implement-client.d.ts +0 -5
- package/dist/src/commands/implement-client.d.ts.map +0 -1
- package/dist/src/commands/implement-client.js +0 -70
- package/dist/src/commands/implement-client.js.map +0 -1
- package/dist/src/commands/implement-server.d.ts +0 -5
- package/dist/src/commands/implement-server.d.ts.map +0 -1
- package/dist/src/commands/implement-server.js +0 -69
- package/dist/src/commands/implement-server.js.map +0 -1
- package/dist/src/commands/import-design-system.d.ts +0 -5
- package/dist/src/commands/import-design-system.d.ts.map +0 -1
- package/dist/src/commands/import-design-system.js +0 -62
- package/dist/src/commands/import-design-system.js.map +0 -1
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import { pathToFileURL } from 'url';
|
|
4
|
+
import createJiti from 'jiti';
|
|
5
|
+
import createDebug from 'debug';
|
|
6
|
+
import { createMessageBus } from '@auto-engineer/message-bus';
|
|
7
|
+
const debug = createDebug('cli:plugin-loader');
|
|
8
|
+
const debugConfig = createDebug('cli:plugin-loader:config');
|
|
9
|
+
const debugPlugins = createDebug('cli:plugin-loader:plugins');
|
|
10
|
+
const debugConflicts = createDebug('cli:plugin-loader:conflicts');
|
|
11
|
+
const debugBus = createDebug('cli:plugin-loader:bus');
|
|
12
|
+
// Set non-error-like colors (avoid red/orange)
|
|
13
|
+
// Colors: 0=gray, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan
|
|
14
|
+
debug.color = '4'; // blue
|
|
15
|
+
debugConfig.color = '6'; // cyan
|
|
16
|
+
debugPlugins.color = '2'; // green
|
|
17
|
+
debugConflicts.color = '3'; // yellow (ok for conflicts)
|
|
18
|
+
debugBus.color = '4'; // blue
|
|
19
|
+
export class PluginLoader {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.commands = new Map();
|
|
22
|
+
this.conflicts = new Map(); // alias -> [package1, package2, ...]
|
|
23
|
+
this.loadedPlugins = new Set(); // Track successfully loaded plugins
|
|
24
|
+
this.messageBus = createMessageBus();
|
|
25
|
+
}
|
|
26
|
+
async loadConfigFile(configPath) {
|
|
27
|
+
try {
|
|
28
|
+
if (this.loadConfig) {
|
|
29
|
+
// Use test override
|
|
30
|
+
return await this.loadConfig(configPath);
|
|
31
|
+
}
|
|
32
|
+
// Handle TypeScript config files
|
|
33
|
+
if (configPath.endsWith('.ts')) {
|
|
34
|
+
debugConfig('Loading TypeScript config file with jiti');
|
|
35
|
+
const jiti = createJiti(import.meta.url, {
|
|
36
|
+
interopDefault: true,
|
|
37
|
+
});
|
|
38
|
+
const config = jiti(configPath);
|
|
39
|
+
debugConfig('TypeScript config loaded successfully');
|
|
40
|
+
return config;
|
|
41
|
+
}
|
|
42
|
+
// Import JavaScript config file directly
|
|
43
|
+
const configUrl = pathToFileURL(path.resolve(configPath)).href;
|
|
44
|
+
debugConfig('Importing JavaScript config from: %s', configUrl);
|
|
45
|
+
const configModule = (await import(configUrl));
|
|
46
|
+
return (configModule.default ?? configModule);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
debugConfig('Error loading config: %O', error);
|
|
50
|
+
console.error(`Failed to load config from ${configPath}:`, error);
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async loadPlugin(packageName) {
|
|
55
|
+
try {
|
|
56
|
+
const packagePath = path.join(process.cwd(), 'node_modules', packageName, 'dist', 'src', 'cli-manifest.js');
|
|
57
|
+
if (fs.existsSync(packagePath)) {
|
|
58
|
+
const packageUrl = pathToFileURL(packagePath).href;
|
|
59
|
+
debugPlugins('Trying to load plugin from cwd: %s', packageUrl);
|
|
60
|
+
return await import(packageUrl);
|
|
61
|
+
}
|
|
62
|
+
// Try the shorter path for packages that might have different structure
|
|
63
|
+
const altPath = path.join(process.cwd(), 'node_modules', packageName, 'dist', 'cli-manifest.js');
|
|
64
|
+
if (fs.existsSync(altPath)) {
|
|
65
|
+
const packageUrl = pathToFileURL(altPath).href;
|
|
66
|
+
debugPlugins('Trying to load plugin from cwd (alt path): %s', packageUrl);
|
|
67
|
+
return await import(packageUrl);
|
|
68
|
+
}
|
|
69
|
+
throw new Error('Package not found in node_modules');
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
debugPlugins('Failed to load from cwd, trying default import: %s', e);
|
|
73
|
+
return this.importPlugin ? await this.importPlugin(packageName) : await import(packageName);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
async processPlugin(packageName, aliasMap) {
|
|
77
|
+
debugPlugins('Loading plugin: %s', packageName);
|
|
78
|
+
try {
|
|
79
|
+
const pkg = (await this.loadPlugin(packageName));
|
|
80
|
+
if (!pkg.CLI_MANIFEST) {
|
|
81
|
+
debugPlugins('Package %s does not export CLI_MANIFEST, skipping', packageName);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
debugPlugins('Found CLI_MANIFEST in %s', packageName);
|
|
85
|
+
const manifest = pkg.CLI_MANIFEST;
|
|
86
|
+
// Track that this plugin was successfully loaded
|
|
87
|
+
this.loadedPlugins.add(packageName);
|
|
88
|
+
// Process each command in the manifest
|
|
89
|
+
for (const [alias, command] of Object.entries(manifest.commands)) {
|
|
90
|
+
debugPlugins('Processing command %s from %s', alias, packageName);
|
|
91
|
+
// Add the category from the manifest to each command
|
|
92
|
+
const commandWithCategory = {
|
|
93
|
+
...command,
|
|
94
|
+
category: manifest.category ?? packageName,
|
|
95
|
+
};
|
|
96
|
+
// Track all packages that want this alias
|
|
97
|
+
if (!aliasMap.has(alias)) {
|
|
98
|
+
aliasMap.set(alias, []);
|
|
99
|
+
}
|
|
100
|
+
aliasMap.get(alias).push({
|
|
101
|
+
packageName,
|
|
102
|
+
command: commandWithCategory,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
debugPlugins('Failed to load plugin %s: %O', packageName, error);
|
|
108
|
+
console.warn(`Failed to load plugin ${packageName}:`, error);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
async findMatchingCandidate(candidates, userOverride) {
|
|
112
|
+
for (const candidate of candidates) {
|
|
113
|
+
try {
|
|
114
|
+
const cmd = candidate.command;
|
|
115
|
+
const module = (await cmd.handler());
|
|
116
|
+
if (module === userOverride ||
|
|
117
|
+
module.default === userOverride ||
|
|
118
|
+
module.handler === userOverride ||
|
|
119
|
+
module.default?.handler === userOverride) {
|
|
120
|
+
return candidate;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch (e) {
|
|
124
|
+
debugConflicts('Error checking handler match: %o', e);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
async processConflictResolution(alias, candidates, config) {
|
|
130
|
+
const packages = candidates.map((c) => c.packageName);
|
|
131
|
+
debugConflicts('Conflict detected for alias "%s" between packages: %o', alias, packages);
|
|
132
|
+
const userOverride = config.aliases?.[alias];
|
|
133
|
+
if (userOverride === undefined) {
|
|
134
|
+
this.conflicts.set(alias, packages);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const isFunction = typeof userOverride === 'function';
|
|
138
|
+
const hasDefault = typeof userOverride.default === 'function';
|
|
139
|
+
if (!isFunction && !hasDefault) {
|
|
140
|
+
console.error(`\n❌ Invalid override for alias "${alias}"`);
|
|
141
|
+
console.error(` Expected a command handler function, got: ${typeof userOverride}`);
|
|
142
|
+
console.error(` Import the handler from one of: ${packages.join(', ')}`);
|
|
143
|
+
this.conflicts.set(alias, packages);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const matchingCandidate = await this.findMatchingCandidate(candidates, userOverride);
|
|
147
|
+
if (matchingCandidate !== null) {
|
|
148
|
+
debugConflicts('Using user override for %s with handler from %s', alias, matchingCandidate.packageName);
|
|
149
|
+
await this.registerCommand(alias, matchingCandidate);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
console.error(`\n❌ Invalid override for alias "${alias}"`);
|
|
153
|
+
console.error(` The provided handler does not match any of the conflicting commands`);
|
|
154
|
+
console.error(` Available packages: ${packages.join(', ')}`);
|
|
155
|
+
this.conflicts.set(alias, packages);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
processStringAlias(alias, target) {
|
|
159
|
+
if (!this.commands.has(target))
|
|
160
|
+
return;
|
|
161
|
+
debugPlugins('Creating alias %s -> %s', alias, target);
|
|
162
|
+
const existingCommand = this.commands.get(target);
|
|
163
|
+
this.commands.set(alias, {
|
|
164
|
+
...existingCommand,
|
|
165
|
+
description: `Alias for ${target}`,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
processHandlerAlias(alias, target) {
|
|
169
|
+
const t = target;
|
|
170
|
+
debugPlugins('Registering custom alias %s with CommandHandler', alias);
|
|
171
|
+
const commandEntry = {
|
|
172
|
+
handler: async () => ({ default: target }),
|
|
173
|
+
description: t.name !== undefined && t.name !== '' ? `${t.name} command` : `Custom command: ${alias}`,
|
|
174
|
+
package: 'custom-alias',
|
|
175
|
+
};
|
|
176
|
+
this.commands.set(alias, commandEntry);
|
|
177
|
+
// Register with message bus
|
|
178
|
+
const commandHandler = {
|
|
179
|
+
name: alias,
|
|
180
|
+
handle: async (command) => {
|
|
181
|
+
debugBus('Handling custom alias command %s', alias);
|
|
182
|
+
await t.handle(command);
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
this.messageBus.registerCommandHandler(commandHandler);
|
|
186
|
+
debugBus('Registered custom alias %s with message bus', alias);
|
|
187
|
+
}
|
|
188
|
+
processFunctionAlias(alias, target) {
|
|
189
|
+
debugPlugins('Registering custom alias %s with handler function', alias);
|
|
190
|
+
const handlerFunc = typeof target === 'function' ? target : target.default;
|
|
191
|
+
this.commands.set(alias, {
|
|
192
|
+
handler: async () => ({ default: handlerFunc }),
|
|
193
|
+
description: `Custom command: ${alias}`,
|
|
194
|
+
package: 'custom-alias',
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
processCustomAlias(alias, target) {
|
|
198
|
+
if (typeof target === 'string') {
|
|
199
|
+
this.processStringAlias(alias, target);
|
|
200
|
+
}
|
|
201
|
+
else if (target !== null &&
|
|
202
|
+
target !== undefined &&
|
|
203
|
+
typeof target.handle === 'function') {
|
|
204
|
+
this.processHandlerAlias(alias, target);
|
|
205
|
+
}
|
|
206
|
+
else if (typeof target === 'function' ||
|
|
207
|
+
(target !== null && target !== undefined && typeof target.default === 'function')) {
|
|
208
|
+
this.processFunctionAlias(alias, target);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
async processCustomAliases(config, aliasMap) {
|
|
212
|
+
if (config.aliases === undefined)
|
|
213
|
+
return;
|
|
214
|
+
for (const [alias, target] of Object.entries(config.aliases)) {
|
|
215
|
+
// Skip if this was already processed as a conflict resolution
|
|
216
|
+
if (!aliasMap.has(alias)) {
|
|
217
|
+
this.processCustomAlias(alias, target);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
reportConflicts(config) {
|
|
222
|
+
if (this.conflicts.size === 0)
|
|
223
|
+
return;
|
|
224
|
+
console.error('\n❌ Command alias conflicts detected!\n');
|
|
225
|
+
console.error('Multiple packages are trying to register the same command aliases.');
|
|
226
|
+
console.error('Please add alias overrides to your auto.config.ts file:\n');
|
|
227
|
+
console.error('// Import the specific handler you want to use');
|
|
228
|
+
for (const [alias, packages] of this.conflicts.entries()) {
|
|
229
|
+
console.error(`// For "${alias}", import from one of: ${packages.join(', ')}`);
|
|
230
|
+
const examplePkg = packages[0];
|
|
231
|
+
const handlerName = alias.replace(/[:-]/g, '_') + 'Handler';
|
|
232
|
+
console.error(`import { ${handlerName} } from '${examplePkg}';`);
|
|
233
|
+
}
|
|
234
|
+
console.error('');
|
|
235
|
+
console.error('export default {');
|
|
236
|
+
console.error(' plugins: [');
|
|
237
|
+
for (const plugin of config.plugins ?? []) {
|
|
238
|
+
console.error(` '${plugin}',`);
|
|
239
|
+
}
|
|
240
|
+
console.error(' ],');
|
|
241
|
+
console.error(' aliases: {');
|
|
242
|
+
for (const [alias] of this.conflicts.entries()) {
|
|
243
|
+
const handlerName = alias.replace(/[:-]/g, '_') + 'Handler';
|
|
244
|
+
console.error(` '${alias}': ${handlerName},`);
|
|
245
|
+
}
|
|
246
|
+
console.error(' }');
|
|
247
|
+
console.error('};\n');
|
|
248
|
+
throw new Error('Unresolved command alias conflicts. Please update your configuration.');
|
|
249
|
+
}
|
|
250
|
+
async loadPlugins(configPath) {
|
|
251
|
+
debug('Loading plugins from config: %s', configPath);
|
|
252
|
+
// Check if config file exists (skip for testing)
|
|
253
|
+
if (!this.loadConfig && !fs.existsSync(configPath)) {
|
|
254
|
+
debugConfig('Config file not found, using default empty config');
|
|
255
|
+
return this.commands;
|
|
256
|
+
}
|
|
257
|
+
const config = await this.loadConfigFile(configPath);
|
|
258
|
+
if (!config) {
|
|
259
|
+
return this.commands;
|
|
260
|
+
}
|
|
261
|
+
debugConfig('Config loaded with %d plugins', config.plugins?.length ?? 0);
|
|
262
|
+
// Load each plugin
|
|
263
|
+
const aliasMap = new Map();
|
|
264
|
+
for (const packageName of config.plugins ?? []) {
|
|
265
|
+
await this.processPlugin(packageName, aliasMap);
|
|
266
|
+
}
|
|
267
|
+
// Process aliases and detect conflicts
|
|
268
|
+
for (const [alias, candidates] of aliasMap.entries()) {
|
|
269
|
+
if (candidates.length === 1) {
|
|
270
|
+
// No conflict, register the command
|
|
271
|
+
const candidate = candidates[0];
|
|
272
|
+
debugPlugins('Registering command %s from %s', alias, candidate.packageName);
|
|
273
|
+
await this.registerCommand(alias, candidate);
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
// Conflict detected
|
|
277
|
+
await this.processConflictResolution(alias, candidates, config);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
// Process custom aliases (new command names mapping to handlers or existing commands)
|
|
281
|
+
await this.processCustomAliases(config, aliasMap);
|
|
282
|
+
// Report unresolved conflicts
|
|
283
|
+
this.reportConflicts(config);
|
|
284
|
+
debug('Plugin loading complete. Registered %d commands from %d plugins', this.commands.size, this.loadedPlugins.size);
|
|
285
|
+
return this.commands;
|
|
286
|
+
}
|
|
287
|
+
getLoadedPluginCount() {
|
|
288
|
+
return this.loadedPlugins.size;
|
|
289
|
+
}
|
|
290
|
+
async registerCommand(alias, candidate) {
|
|
291
|
+
// Store the command for CLI use with all metadata
|
|
292
|
+
this.commands.set(alias, {
|
|
293
|
+
handler: candidate.command.handler,
|
|
294
|
+
description: candidate.command.description,
|
|
295
|
+
package: candidate.packageName,
|
|
296
|
+
usage: candidate.command.usage,
|
|
297
|
+
examples: candidate.command.examples,
|
|
298
|
+
args: candidate.command.args,
|
|
299
|
+
options: candidate.command.options,
|
|
300
|
+
category: candidate.command.category,
|
|
301
|
+
});
|
|
302
|
+
// Register the command with the message bus
|
|
303
|
+
debugBus('Registering command %s with message bus', alias);
|
|
304
|
+
// Create a command handler for the message bus
|
|
305
|
+
const commandHandler = {
|
|
306
|
+
name: alias,
|
|
307
|
+
handle: async (command) => {
|
|
308
|
+
debugBus('Handling command %s via message bus', alias);
|
|
309
|
+
try {
|
|
310
|
+
// Load the actual handler from the plugin
|
|
311
|
+
const module = (await candidate.command.handler());
|
|
312
|
+
debugBus('Loaded module for %s', alias);
|
|
313
|
+
// Look for standard handler export patterns
|
|
314
|
+
const handlerName = `handle${alias
|
|
315
|
+
.split(':')
|
|
316
|
+
.map((s) => s[0].toUpperCase() + s.slice(1))
|
|
317
|
+
.join('')}Command`;
|
|
318
|
+
const moduleHandler = module[handlerName];
|
|
319
|
+
const defaultHandler = module.default;
|
|
320
|
+
const namedHandler = module.handler;
|
|
321
|
+
let handler = null;
|
|
322
|
+
if (moduleHandler !== undefined) {
|
|
323
|
+
handler = moduleHandler;
|
|
324
|
+
}
|
|
325
|
+
else if (defaultHandler !== undefined) {
|
|
326
|
+
handler = defaultHandler;
|
|
327
|
+
}
|
|
328
|
+
else if (namedHandler !== undefined) {
|
|
329
|
+
handler = namedHandler;
|
|
330
|
+
}
|
|
331
|
+
if (handler === null) {
|
|
332
|
+
debugBus('Available exports: %o', Object.keys(module));
|
|
333
|
+
throw new Error(`No handler found for command ${alias} in ${candidate.packageName}`);
|
|
334
|
+
}
|
|
335
|
+
debugBus('Found handler for %s, type: %s', alias, typeof handler);
|
|
336
|
+
// Execute the handler with the command
|
|
337
|
+
debugBus('Calling handler with command: %o', command);
|
|
338
|
+
const handlerFunc = handler;
|
|
339
|
+
await handlerFunc(command);
|
|
340
|
+
debugBus('Handler execution complete for %s', alias);
|
|
341
|
+
}
|
|
342
|
+
catch (error) {
|
|
343
|
+
debugBus('Error handling command %s: %O', alias, error);
|
|
344
|
+
throw error;
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
// Register with the message bus
|
|
349
|
+
this.messageBus.registerCommandHandler(commandHandler);
|
|
350
|
+
// Set up event listener for command responses if needed
|
|
351
|
+
const responseEventName = `${alias}Response`;
|
|
352
|
+
debugBus('Setting up response listener for %s', responseEventName);
|
|
353
|
+
this.messageBus.subscribeToEvent(responseEventName, {
|
|
354
|
+
name: `${alias}ResponseHandler`,
|
|
355
|
+
handle: async (event) => {
|
|
356
|
+
debugBus('Received response for %s: %O', alias, event);
|
|
357
|
+
// Handle response if needed (logging, analytics, etc.)
|
|
358
|
+
},
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
async executeCommand(commandAlias, data) {
|
|
362
|
+
debugBus('Executing command %s through message bus', commandAlias);
|
|
363
|
+
// Create command object that matches the Command interface
|
|
364
|
+
const command = {
|
|
365
|
+
type: commandAlias,
|
|
366
|
+
data: data,
|
|
367
|
+
timestamp: new Date(),
|
|
368
|
+
requestId: `cli-${Date.now()}-${Math.random().toString(36).substring(2, 11)}`,
|
|
369
|
+
};
|
|
370
|
+
await this.messageBus.sendCommand(command);
|
|
371
|
+
}
|
|
372
|
+
getCommands() {
|
|
373
|
+
return this.commands;
|
|
374
|
+
}
|
|
375
|
+
getConflicts() {
|
|
376
|
+
return this.conflicts;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
export async function loadPlugins(configPath) {
|
|
380
|
+
const loader = new PluginLoader();
|
|
381
|
+
return loader.loadPlugins(configPath);
|
|
382
|
+
}
|
|
383
|
+
//# sourceMappingURL=plugin-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-loader.js","sourceRoot":"","sources":["../../src/plugin-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,UAAU,MAAM,MAAM,CAAC;AAC9B,OAAO,WAAW,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,4BAA4B,CAAC;AAI/E,MAAM,KAAK,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC;AAC/C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