generator-agent 1.0.9 → 1.0.10

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 (2) hide show
  1. package/extension.js +51 -2
  2. package/package.json +10 -1
package/extension.js CHANGED
@@ -16,6 +16,55 @@ function activate(context) {
16
16
  // This line of code will only be executed once when your extension is activated
17
17
  console.log('Generator Agent is now active!');
18
18
 
19
+ // Register chat participant for Copilot integration
20
+ const chatParticipant = vscode.chat.createChatParticipant('generator.agent',
21
+ async (request, context, stream, token) => {
22
+ try {
23
+ stream.markdown('**Generator Agent**: Processing your request...\n\n');
24
+
25
+ const userPrompt = request.prompt;
26
+
27
+ // Show what we're analyzing
28
+ stream.markdown(`📋 **Request**: ${userPrompt}\n\n`);
29
+
30
+ stream.markdown('**Steps:**\n');
31
+ stream.markdown('1. Reading OpenAPI specifications...\n');
32
+ stream.markdown('2. Analyzing generator patterns...\n');
33
+ stream.markdown('3. Creating generator configuration...\n\n');
34
+
35
+ // Create sample generator output
36
+ const generatorTemplate = {
37
+ generators: {
38
+ example_generator: [
39
+ {
40
+ type: 'dynamic',
41
+ name: 'example_data',
42
+ generatorOperationId: 'service.Entity.getEntity',
43
+ dataPath: '$.response.body:$.data[0].id'
44
+ }
45
+ ]
46
+ }
47
+ };
48
+
49
+ stream.markdown('**Generated Configuration:**\n\n');
50
+ stream.markdown('```json\n');
51
+ stream.markdown(JSON.stringify(generatorTemplate, null, 2));
52
+ stream.markdown('\n```\n\n');
53
+
54
+ stream.markdown('✅ **Next Steps:**\n');
55
+ stream.markdown('1. Review the generator configuration above\n');
56
+ stream.markdown('2. Adjust params and dependencies as needed\n');
57
+ stream.markdown('3. Add to your `test_data_generation_configurations.json`\n');
58
+
59
+ } catch (error) {
60
+ stream.markdown(`❌ **Error**: ${error.message}`);
61
+ }
62
+ }
63
+ );
64
+
65
+ // Set icon for chat participant
66
+ chatParticipant.iconPath = new vscode.ThemeIcon('sparkles');
67
+
19
68
  // Register the main generator creation command
20
69
  const createGenerator = vscode.commands.registerCommand('generator.createGenerator', async function () {
21
70
  // Show input box to get user's generator requirements
@@ -83,7 +132,7 @@ Create the generator configuration and save it to the appropriate location in th
83
132
 
84
133
  progress.report({ increment: 100, message: "Done!" });
85
134
 
86
- vscode.window.showInformationMessage('Generator template created! Use GitHub Copilot Chat to complete the generator based on your requirements.');
135
+ vscode.window.showInformationMessage('Generator template created! Use @Generator in Copilot Chat to complete the generator based on your requirements.');
87
136
 
88
137
  } catch (error) {
89
138
  vscode.window.showErrorMessage(`Error creating generator: ${error.message}`);
@@ -111,7 +160,7 @@ Create the generator configuration and save it to the appropriate location in th
111
160
  }
112
161
  });
113
162
 
114
- context.subscriptions.push(createGenerator, viewPatterns);
163
+ context.subscriptions.push(createGenerator, viewPatterns, chatParticipant);
115
164
  }
116
165
 
117
166
  // This method is called when your extension is deactivated
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "generator-agent",
3
3
  "displayName": "Generator-Agent",
4
4
  "description": "Create a generator for given use case",
5
- "version": "1.0.9",
5
+ "version": "1.0.10",
6
6
  "engines": {
7
7
  "vscode": "^1.109.0"
8
8
  },
@@ -21,6 +21,15 @@
21
21
  "command": "generator.viewPatterns",
22
22
  "title": "Generator: View Generator Patterns"
23
23
  }
24
+ ],
25
+ "chatParticipants": [
26
+ {
27
+ "id": "generator.agent",
28
+ "name": "Generator",
29
+ "description": "Creates generators using OpenAPI specifications and defined generator patterns. Ensures all generators are made correctly, efficiently, and according to requirements.",
30
+ "fullName": "Generator Creation Agent",
31
+ "isSticky": true
32
+ }
24
33
  ]
25
34
  },
26
35
  "scripts": {