@auto-engineer/frontend-implementer 0.1.4 → 0.2.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,5 +1,5 @@
1
1
 
2
- > @auto-engineer/frontend-implementer@0.1.4 build /Users/sam/WebstormProjects/top/auto-engineer/packages/frontend-implementer
3
- > tsc && tsx ../../scripts/fix-esm-imports.ts
2
+ > @auto-engineer/frontend-implementer@0.2.0 build /home/runner/work/auto-engineer/auto-engineer/packages/frontend-implementer
3
+ > tsc && tsx ../../scripts/fix-esm-imports.ts && cp src/*.html dist/src/ 2>/dev/null || true
4
4
 
5
5
  Fixed ESM imports in dist/
@@ -1,14 +1,12 @@
1
-
2
- 
3
- > @auto-engineer/frontend-implementer@0.1.4 test /Users/sam/WebstormProjects/top/auto-engineer/packages/frontend-implementer
4
- > vitest run
5
-
6
- [?25l
7
-  RUN  v3.2.4 /Users/sam/WebstormProjects/top/auto-engineer/packages/frontend-implementer
8
-
9
- No test files found, exiting with code 0
10
-
11
- include: **/*.specs.{js,ts}
12
- exclude: **/.tmp/**, **/node_modules/**, **/dist/**
13
- 
14
- [?25h
1
+
2
+ > @auto-engineer/frontend-implementer@0.2.0 test /home/runner/work/auto-engineer/auto-engineer/packages/frontend-implementer
3
+ > vitest run
4
+
5
+
6
+  RUN  v3.2.4 /home/runner/work/auto-engineer/auto-engineer/packages/frontend-implementer
7
+
8
+ No test files found, exiting with code 0
9
+
10
+ include: **/*.specs.{js,ts}
11
+ exclude: **/.tmp/**, **/node_modules/**, **/dist/**
12
+
@@ -1,5 +1,4 @@
1
-
2
- 
3
- > @auto-engineer/frontend-implementer@0.1.4 type-check /Users/sam/WebstormProjects/top/auto-engineer/packages/frontend-implementer
4
- > tsc --noEmit
5
-
1
+
2
+ > @auto-engineer/frontend-implementer@0.2.0 type-check /home/runner/work/auto-engineer/auto-engineer/packages/frontend-implementer
3
+ > tsc --noEmit
4
+
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @auto-engineer/frontend-implementer
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - add command details in dashboard
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @auto-engineer/ai-gateway@0.7.0
13
+ - @auto-engineer/message-bus@0.6.0
14
+
3
15
  ## 0.1.4
4
16
 
5
17
  ### Patch Changes
@@ -1,44 +1,4 @@
1
- import { type CommandHandler, type Command, type Event } from '@auto-engineer/message-bus';
2
- export declare const implementClientManifest: {
3
- handler: () => Promise<{
4
- default: CommandHandler<Readonly<{
5
- type: "ImplementClient";
6
- data: Readonly<{
7
- projectDir: string;
8
- iaSchemeDir: string;
9
- designSystemPath: string;
10
- }>;
11
- timestamp?: Date;
12
- requestId?: string;
13
- correlationId?: string;
14
- }>, Readonly<{
15
- type: "ClientImplemented";
16
- data: {
17
- projectDir: string;
18
- };
19
- timestamp?: Date;
20
- requestId?: string;
21
- correlationId?: string;
22
- }> | Readonly<{
23
- type: "ClientImplementationFailed";
24
- data: {
25
- error: string;
26
- projectDir: string;
27
- };
28
- timestamp?: Date;
29
- requestId?: string;
30
- correlationId?: string;
31
- }>>;
32
- }>;
33
- description: string;
34
- usage: string;
35
- examples: string[];
36
- args: {
37
- name: string;
38
- description: string;
39
- required: boolean;
40
- }[];
41
- };
1
+ import { type Command, type Event } from '@auto-engineer/message-bus';
42
2
  export type ImplementClientCommand = Command<'ImplementClient', {
43
3
  projectDir: string;
44
4
  iaSchemeDir: string;
@@ -51,6 +11,16 @@ export type ClientImplementationFailedEvent = Event<'ClientImplementationFailed'
51
11
  error: string;
52
12
  projectDir: string;
53
13
  }>;
54
- export declare const implementClientCommandHandler: CommandHandler<ImplementClientCommand, ClientImplementedEvent | ClientImplementationFailedEvent>;
55
- export default implementClientCommandHandler;
14
+ export declare const commandHandler: import("@auto-engineer/message-bus").UnifiedCommandHandler<Readonly<{
15
+ type: "ImplementClient";
16
+ data: Readonly<{
17
+ projectDir: string;
18
+ iaSchemeDir: string;
19
+ designSystemPath: string;
20
+ }>;
21
+ timestamp?: Date;
22
+ requestId?: string;
23
+ correlationId?: string;
24
+ }>>;
25
+ export default commandHandler;
56
26
  //# sourceMappingURL=implement-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"implement-client.d.ts","sourceRoot":"","sources":["../../src/commands/implement-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAM3F,eAAO,MAAM,uBAAuB;;;;;4BAgBpB,MAAM;6BACL,MAAM;kCACD,MAAM;;;;;;;;4BAOZ,MAAM;;;;;;;;uBAOX,MAAM;4BACD,MAAM;;;;;;;;;;;;;;;CAtBrB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAC1C,iBAAiB,EACjB;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CACF,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,KAAK,CACxC,mBAAmB,EACnB;IACE,UAAU,EAAE,MAAM,CAAC;CACpB,CACF,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,KAAK,CACjD,4BAA4B,EAC5B;IACE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,CACF,CAAC;AAuCF,eAAO,MAAM,6BAA6B,EAAE,cAAc,CACxD,sBAAsB,EACtB,sBAAsB,GAAG,+BAA+B,CAczD,CAAC;AAGF,eAAe,6BAA6B,CAAC"}
1
+ {"version":3,"file":"implement-client.d.ts","sourceRoot":"","sources":["../../src/commands/implement-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAwB,MAAM,4BAA4B,CAAC;AAM5F,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAC1C,iBAAiB,EACjB;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CACF,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,KAAK,CACxC,mBAAmB,EACnB;IACE,UAAU,EAAE,MAAM,CAAC;CACpB,CACF,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,KAAK,CACjD,4BAA4B,EAC5B;IACE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,CACF,CAAC;AAEF,eAAO,MAAM,cAAc;;;oBArBX,MAAM;qBACL,MAAM;0BACD,MAAM;;;;;GAoD1B,CAAC;AAwCH,eAAe,cAAc,CAAC"}
@@ -1,18 +1,40 @@
1
+ import { defineCommandHandler } from '@auto-engineer/message-bus';
1
2
  import { runAIAgent } from '../agent.js';
2
3
  import createDebug from 'debug';
3
4
  const debug = createDebug('frontend-implementer:implement-client');
4
- export const implementClientManifest = {
5
- handler: () => Promise.resolve({ default: implementClientCommandHandler }),
5
+ export const commandHandler = defineCommandHandler({
6
+ name: 'ImplementClient',
7
+ alias: 'implement:client',
6
8
  description: 'AI implements client',
7
- usage: 'implement:client <client> <context> <principles> <design>',
8
- examples: ['$ auto implement:client ./client ./.context ./design-principles.md ./design-system.md'],
9
- args: [
10
- { name: 'client', description: 'Client directory path', required: true },
11
- { name: 'context', description: 'Context directory path', required: true },
12
- { name: 'principles', description: 'Design principles file', required: true },
13
- { name: 'design', description: 'Design system file', required: true },
9
+ category: 'implement',
10
+ fields: {
11
+ projectDir: {
12
+ description: 'Client directory path',
13
+ required: true,
14
+ },
15
+ iaSchemeDir: {
16
+ description: 'Context directory path',
17
+ required: true,
18
+ },
19
+ designSystemPath: {
20
+ description: 'Design system file',
21
+ required: true,
22
+ },
23
+ },
24
+ examples: [
25
+ '$ auto implement:client --project-dir=./client --ia-scheme-dir=./.context --design-system-path=./design-system.md',
14
26
  ],
15
- };
27
+ handle: async (command) => {
28
+ const result = await handleImplementClientCommandInternal(command);
29
+ if (result.type === 'ClientImplemented') {
30
+ debug('Client implemented successfully');
31
+ }
32
+ else {
33
+ debug('Failed: %s', result.data.error);
34
+ }
35
+ return result;
36
+ },
37
+ });
16
38
  async function handleImplementClientCommandInternal(command) {
17
39
  const { projectDir, iaSchemeDir, designSystemPath } = command.data;
18
40
  try {
@@ -44,19 +66,6 @@ async function handleImplementClientCommandInternal(command) {
44
66
  };
45
67
  }
46
68
  }
47
- export const implementClientCommandHandler = {
48
- name: 'ImplementClient',
49
- handle: async (command) => {
50
- const result = await handleImplementClientCommandInternal(command);
51
- if (result.type === 'ClientImplemented') {
52
- debug('Client implemented successfully');
53
- }
54
- else {
55
- debug('Failed: %s', result.data.error);
56
- }
57
- return result;
58
- },
59
- };
60
69
  // Default export is the command handler
61
- export default implementClientCommandHandler;
70
+ export default commandHandler;
62
71
  //# sourceMappingURL=implement-client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"implement-client.js","sourceRoot":"","sources":["../../src/commands/implement-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,WAAW,MAAM,OAAO,CAAC;AAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,uCAAuC,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,6BAA6B,EAAE,CAAC;IAC1E,WAAW,EAAE,sBAAsB;IACnC,KAAK,EAAE,2DAA2D;IAClE,QAAQ,EAAE,CAAC,uFAAuF,CAAC;IACnG,IAAI,EAAE;QACJ,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE,QAAQ,EAAE,IAAI,EAAE;QACxE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,wBAAwB,EAAE,QA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,EACX,OAA+B,EACoC,EAAE;QACrE,MAAM,MAAM,GAAG,MAAM,oCAAoC,CAAC,OAAO,CAAC,CAAC;QACnE,IAAI,MAAM,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;YACxC,KAAK,CAAC,iCAAiC,CAAC,CAAC;QAC3C,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC;AAEF,wCAAwC;AACxC,eAAe,6BAA6B,CAAC"}
1
+ {"version":3,"file":"implement-client.js","sourceRoot":"","sources":["../../src/commands/implement-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,WAAW,MAAM,OAAO,CAAC;AAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,uCAAuC,CAAC,CAAC;AA0BnE,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,CAAyB;IACzE,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,sBAAsB;IACnC,QAAQ,EAAE,WAAW;IACrB,MAAM,EAAE;QACN,UAAU,EAAE;YACV,WAAW,EAAE,uBAAuB;YACpC,QAAQ,EAAE,IAAI;SACf;QACD,WAAW,EAAE;YACX,WAAW,EAAE,wBAAwB;YACrC,QAAQ,EAAE,IAAI;SACf;QACD,gBAAgB,EAAE;YAChB,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,IAAI;SACf;KACF;IACD,QAAQ,EAAE;QACR,mHAAmH;KACpH;IACD,MAAM,EAAE,KAAK,EACX,OAA+B,EACoC,EAAE;QACrE,MAAM,MAAM,GAAG,MAAM,oCAAoC,CAAC,OAAO,CAAC,CAAC;QACnE,IAAI,MAAM,CAAC,IAAI,KA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* from './commands/implement-client';
2
- export { CLI_MANIFEST } from './cli-manifest';
1
+ export declare const COMMANDS: import("@auto-engineer/message-bus").UnifiedCommandHandler<Readonly<{
2
+ type: "ImplementClient";
3
+ data: Readonly<{
4
+ projectDir: string;
5
+ iaSchemeDir: string;
6
+ designSystemPath: string;
7
+ }>;
8
+ timestamp?: Date;
9
+ requestId?: string;
10
+ correlationId?: string;
11
+ }>>[];
12
+ export { type ImplementClientCommand, type ClientImplementedEvent, type ClientImplementationFailedEvent, } from './commands/implement-client.js';
3
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA+TA,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;;;;;;;;;;KAA2B,CAAC;AACjD,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,GACrC,MAAM,gCAAgC,CAAC"}
package/dist/index.js CHANGED
@@ -1,265 +1,4 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
- import { z } from 'zod';
4
- import * as fs from 'fs/promises';
5
- import * as path from 'path';
6
- import createDebug from 'debug';
7
- const debug = createDebug('frontend-impl:mcp');
8
- const debugTools = createDebug('frontend-impl:mcp:tools');
9
- const debugServer = createDebug('frontend-impl:mcp:server');
10
- const debugLifecycle = createDebug('frontend-impl:mcp:lifecycle');
11
- // Helper to recursively list files
12
- async function listFiles(dir, base = dir) {
13
- const entries = await fs.readdir(dir, { withFileTypes: true });
14
- const files = await Promise.all(entries.map(async (entry) => {
15
- const res = path.resolve(dir, entry.name);
16
- if (entry.isDirectory()) {
17
- return listFiles(res, base);
18
- }
19
- else {
20
- return [path.relative(base, res)];
21
- }
22
- }));
23
- return files.flat();
24
- }
25
- // Helper to read auto-ia-scheme.json
26
- async function readAutoIAScheme(directory) {
27
- const filePath = path.join(directory, 'auto-ia-scheme.json');
28
- const content = await fs.readFile(filePath, 'utf-8');
29
- return JSON.parse(content);
30
- }
31
- function buildEntities(scheme) {
32
- const entities = [];
33
- if (scheme.atoms)
34
- entities.push({ type: 'atoms', items: Object.keys(scheme.atoms.items ?? {}) });
35
- if (scheme.molecules)
36
- entities.push({ type: 'molecules', items: Object.keys(scheme.molecules.items ?? {}) });
37
- if (scheme.organisms)
38
- entities.push({ type: 'organisms', items: Object.keys(scheme.organisms.items ?? {}) });
39
- if (scheme.pages)
40
- entities.push({ type: 'pages', items: Object.keys(scheme.pages.items ?? {}) });
41
- return entities;
42
- }
43
- debugServer('Initializing MCP server with name: frontend-implementer, version: 0.1.0');
44
- const server = new McpServer({
45
- name: 'frontend-implementer',
46
- version: '0.1.0',
47
- });
48
- debugServer('MCP server instance created');
49
- // Tool: List all files in the project
50
- debugTools('Registering tool: listFiles');
51
- server.registerTool('listFiles', {
52
- title: 'List Project Files',
53
- description: 'List all files in the given project directory.',
54
- inputSchema: {
55
- directory: z.string().min(1, 'Directory is required'),
56
- },
57
- }, async ({ directory }) => {
58
- debugTools('listFiles called with directory: %s', directory);
59
- try {
60
- const files = await listFiles(directory);
61
- debugTools('Found %d files in directory', files.length);
62
- return {
63
- content: [
64
- {
65
- type: 'text',
66
- text: JSON.stringify(files, null, 2),
67
- },
68
- ],
69
- };
70
- }
71
- catch (error) {
72
- debugTools('Error listing files: %O', error);
73
- return {
74
- isError: true,
75
- content: [
76
- {
77
- type: 'text',
78
- text: `Error listing files: ${error instanceof Error ? error.message : String(error)}`,
79
- },
80
- ],
81
- };
82
- }
83
- });
84
- // Tool: Read a file
85
- debugTools('Registering tool: readFile');
86
- server.registerTool('readFile', {
87
- title: 'Read File',
88
- description: 'Read the contents of a file in the project.',
89
- inputSchema: {
90
- directory: z.string().min(1, 'Directory is required'),
91
- relativePath: z.string().min(1, 'Relative file path is required'),
92
- },
93
- }, async ({ directory, relativePath }) => {
94
- debugTools('readFile called - directory: %s, relativePath: %s', directory, relativePath);
95
- try {
96
- const filePath = path.join(directory, relativePath);
97
- debugTools('Reading file from: %s', filePath);
98
- const content = await fs.readFile(filePath, 'utf-8');
99
- debugTools('File read successfully, size: %d bytes', content.length);
100
- return {
101
- content: [
102
- {
103
- type: 'text',
104
- text: content,
105
- },
106
- ],
107
- };
108
- }
109
- catch (error) {
110
- debugTools('Error reading file: %O', error);
111
- return {
112
- isError: true,
113
- content: [
114
- {
115
- type: 'text',
116
- text: `Error reading file: ${error instanceof Error ? error.message : String(error)}`,
117
- },
118
- ],
119
- };
120
- }
121
- });
122
- // Tool: Create or update a file
123
- debugTools('Registering tool: createOrUpdateFile');
124
- server.registerTool('createOrUpdateFile', {
125
- title: 'Create or Update File',
126
- description: 'Create or overwrite a file in the given React project directory.',
127
- inputSchema: {
128
- directory: z.string().min(1, 'Directory is required'),
129
- relativePath: z.string().min(1, 'Relative file path is required'),
130
- content: z.string().min(1, 'File content is required'),
131
- },
132
- }, async ({ directory, relativePath, content }) => {
133
- debugTools('createOrUpdateFile called - directory: %s, relativePath: %s, content size: %d', directory, relativePath, content.length);
134
- try {
135
- const filePath = path.join(directory, relativePath);
136
- debugTools('Writing file to: %s', filePath);
137
- await fs.mkdir(path.dirname(filePath), { recursive: true });
138
- await fs.writeFile(filePath, content, 'utf-8');
139
- debugTools('File written successfully');
140
- return {
141
- content: [
142
- {
143
- type: 'text',
144
- text: `File created/updated: ${filePath}`,
145
- },
146
- ],
147
- };
148
- }
149
- catch (error) {
150
- debugTools('Error creating/updating file: %O', error);
151
- return {
152
- isError: true,
153
- content: [
154
- {
155
- type: 'text',
156
- text: `Error creating/updating file: ${error instanceof Error ? error.message : String(error)}`,
157
- },
158
- ],
159
- };
160
- }
161
- });
162
- // Tool: Read auto-ia-scheme.json
163
- debugTools('Registering tool: readAutoIAScheme');
164
- server.registerTool('readAutoIAScheme', {
165
- title: 'Read auto-ia-scheme.json',
166
- description: 'Read and return the parsed auto-ia-scheme.json from the project root.',
167
- inputSchema: {
168
- directory: z.string().min(1, 'Directory is required'),
169
- },
170
- }, async ({ directory }) => {
171
- debugTools('readAutoIAScheme called with directory: %s', directory);
172
- try {
173
- const scheme = await readAutoIAScheme(directory);
174
- debugTools('IA scheme loaded successfully');
175
- return {
176
- content: [
177
- {
178
- type: 'text',
179
- text: JSON.stringify(scheme, null, 2),
180
- },
181
- ],
182
- };
183
- }
184
- catch (error) {
185
- debugTools('Error reading auto-ia-scheme.json: %O', error);
186
- return {
187
- isError: true,
188
- content: [
189
- {
190
- type: 'text',
191
- text: `Error reading auto-ia-scheme.json: ${error instanceof Error ? error.message : String(error)}`,
192
- },
193
- ],
194
- };
195
- }
196
- });
197
- // Tool: List entities from auto-ia-scheme.json
198
- debugTools('Registering tool: listAutoIASchemeEntities');
199
- server.registerTool('listAutoIASchemeEntities', {
200
- title: 'List Entities from auto-ia-scheme.json',
201
- description: 'List all atoms, molecules, organisms, and pages defined in auto-ia-scheme.json.',
202
- inputSchema: {
203
- directory: z.string().min(1, 'Directory is required'),
204
- },
205
- }, async ({ directory }) => {
206
- try {
207
- const scheme = await readAutoIAScheme(directory);
208
- const entities = buildEntities(scheme);
209
- return {
210
- content: [
211
- {
212
- type: 'text',
213
- text: JSON.stringify(entities, null, 2),
214
- },
215
- ],
216
- };
217
- }
218
- catch (error) {
219
- return {
220
- isError: true,
221
- content: [
222
- {
223
- type: 'text',
224
- text: `Error listing entities: ${error instanceof Error ? error.message : String(error)}`,
225
- },
226
- ],
227
- };
228
- }
229
- });
230
- const transport = new StdioServerTransport();
231
- async function cleanup() {
232
- debug('Cleanup initiated');
233
- console.log('Cleaning up...');
234
- await transport.close();
235
- debug('Transport closed, exiting process');
236
- process.exit(0);
237
- }
238
- process.on('SIGTERM', () => {
239
- void cleanup();
240
- });
241
- process.on('SIGINT', () => {
242
- void cleanup();
243
- });
244
- async function startServer() {
245
- debugLifecycle('Starting MCP server');
246
- debugServer('Connecting server to transport');
247
- await server.connect(transport);
248
- console.error('Frontend Implementation MCP Server running on stdio');
249
- debugLifecycle('MCP server connected and running');
250
- debugServer('Server ready to handle requests');
251
- }
252
- // Only start the server if this file is run directly
253
- if (process.argv[1] && import.meta.url === `file://${process.argv[1]}`) {
254
- debugLifecycle('Running as main module, starting server');
255
- startServer().catch((error) => {
256
- debugLifecycle('Fatal error starting server: %O', error);
257
- console.error(error);
258
- });
259
- }
260
- else {
261
- debugLifecycle('Module imported, not starting MCP server');
262
- }
263
- export * from './commands/implement-client.js';
264
- export { CLI_MANIFEST } from './cli-manifest.js';
1
+ // Command exports
2
+ import { commandHandler as implementClientHandler } from './commands/implement-client.js';
3
+ export const COMMANDS = [implementClientHandler];
265
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,WAAW,MAAM,OAAO,CAAC;AAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC;AAC/C,MAAM,UAAU,GAAG,WAAW,CAAC,yBAAyB,CAAC,CAAC;AAC1D,MAAM,WAAW,GAAG,WAAW,CAAC,0BAA0B,CAAC,CAAC;AAC5D,MAAM,cAAc,GAAG,WAAW,CAAC,6BAA6B,CAAC,CAAC;AA2BlE,mCAAmC;AACnC,KAAK,UAAU,SAAS,CAAC,GAAW,EAAE,IA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CAAC;IACvE,cAAc,CAAC,yCAAyC,CAAC,CAAC;IAC1D,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,cAAc,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;QACzD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC;KAAM,CAAC;IACN,cAAc,CAAC,0CAA0C,CAAC,CAAC;AAC7D,CAAC;AAED,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAC1F,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,sBAAsB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auto-engineer/frontend-implementer",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -14,8 +14,8 @@
14
14
  "access": "public"
15
15
  },
16
16
  "dependencies": {
17
- "@auto-engineer/ai-gateway": "^0.6.3",
18
- "@auto-engineer/message-bus": "^0.5.5",
17
+ "@auto-engineer/ai-gateway": "^0.7.0",
18
+ "@auto-engineer/message-bus": "^0.6.0",
19
19
  "@modelcontextprotocol/sdk": "^1.3.0",
20
20
  "debug": "^4.4.1",
21
21
  "jsdom": "^26.1.0",
@@ -24,12 +24,12 @@
24
24
  "zod": "^3.25.67"
25
25
  },
26
26
  "devDependencies": {
27
- "@auto-engineer/cli": "^0.7.6",
27
+ "@auto-engineer/cli": "^0.8.0",
28
28
  "playwright": "^1.54.1"
29
29
  },
30
30
  "scripts": {
31
31
  "start": "tsx src/index.ts",
32
- "build": "tsc && tsx ../../scripts/fix-esm-imports.ts",
32
+ "build": "tsc && tsx ../../scripts/fix-esm-imports.ts && cp src/*.html dist/src/ 2>/dev/null || true",
33
33
  "dev": "tsc --watch",
34
34
  "test": "vitest run",
35
35
  "ai-agent": "tsx -r dotenv/config src/agent-cli.ts",
@@ -1,22 +1,9 @@
1
- import { type CommandHandler, type Command, type Event } from '@auto-engineer/message-bus';
1
+ import { type Command, type Event, defineCommandHandler } from '@auto-engineer/message-bus';
2
2
  import { runAIAgent } from '../agent';
3
3
  import createDebug from 'debug';
4
4
 
5
5
  const debug = createDebug('frontend-implementer:implement-client');
6
6
 
7
- export const implementClientManifest = {
8
- handler: () => Promise.resolve({ default: implementClientCommandHandler }),
9
- description: 'AI implements client',
10
- usage: 'implement:client <client> <context> <principles> <design>',
11
- examples: ['$ auto implement:client ./client ./.context ./design-principles.md ./design-system.md'],
12
- args: [
13
- { name: 'client', description: 'Client directory path', required: true },
14
- { name: 'context', description: 'Context directory path', required: true },
15
- { name: 'principles', description: 'Design principles file', required: true },
16
- { name: 'design', description: 'Design system file', required: true },
17
- ],
18
- };
19
-
20
7
  export type ImplementClientCommand = Command<
21
8
  'ImplementClient',
22
9
  {
@@ -41,6 +28,41 @@ export type ClientImplementationFailedEvent = Event<
41
28
  }
42
29
  >;
43
30
 
31
+ export const commandHandler = defineCommandHandler<ImplementClientCommand>({
32
+ name: 'ImplementClient',
33
+ alias: 'implement:client',
34
+ description: 'AI implements client',
35
+ category: 'implement',
36
+ fields: {
37
+ projectDir: {
38
+ description: 'Client directory path',
39
+ required: true,
40
+ },
41
+ iaSchemeDir: {
42
+ description: 'Context directory path',
43
+ required: true,
44
+ },
45
+ designSystemPath: {
46
+ description: 'Design system file',
47
+ required: true,
48
+ },
49
+ },
50
+ examples: [
51
+ '$ auto implement:client --project-dir=./client --ia-scheme-dir=./.context --design-system-path=./design-system.md',
52
+ ],
53
+ handle: async (
54
+ command: ImplementClientCommand,
55
+ ): Promise<ClientImplementedEvent | ClientImplementationFailedEvent> => {
56
+ const result = await handleImplementClientCommandInternal(command);
57
+ if (result.type === 'ClientImplemented') {
58
+ debug('Client implemented successfully');
59
+ } else {
60
+ debug('Failed: %s', result.data.error);
61
+ }
62
+ return result;
63
+ },
64
+ });
65
+
44
66
  async function handleImplementClientCommandInternal(
45
67
  command: ImplementClientCommand,
46
68
  ): Promise<ClientImplementedEvent | ClientImplementationFailedEvent> {
@@ -78,23 +100,5 @@ async function handleImplementClientCommandInternal(
78
100
  }
79
101
  }
80
102
 
81
- export const implementClientCommandHandler: CommandHandler<
82
- ImplementClientCommand,
83
- ClientImplementedEvent | ClientImplementationFailedEvent
84
- > = {
85
- name: 'ImplementClient',
86
- handle: async (
87
- command: ImplementClientCommand,
88
- ): Promise<ClientImplementedEvent | ClientImplementationFailedEvent> => {
89
- const result = await handleImplementClientCommandInternal(command);
90
- if (result.type === 'ClientImplemented') {
91
- debug('Client implemented successfully');
92
- } else {
93
- debug('Failed: %s', result.data.error);
94
- }
95
- return result;
96
- },
97
- };
98
-
99
103
  // Default export is the command handler
100
- export default implementClientCommandHandler;
104
+ export default commandHandler;