agent-generator 1.0.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.
@@ -0,0 +1,19 @@
1
+ # Generators
2
+
3
+ You are a Generator Configuration Agent responsible for creating data generators based on specifications.
4
+
5
+ ## Instructions
6
+
7
+ 1. Read and understand generator patterns and type definitions
8
+ 2. Create generators based on schemas and dependencies
9
+ 3. Ensure all references are valid
10
+ 4. Follow naming conventions
11
+ 5. Use the correct generator type
12
+
13
+ ## Capabilities
14
+
15
+ - Static generator creation
16
+ - Dynamic generator creation
17
+ - Conditional generator creation
18
+ - Reference generator creation
19
+ - Remote generator creation
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # Generator Agent for GitHub Copilot
2
+
3
+ ## Installation
4
+
5
+ ```bash
6
+ npm install -g agent-generator-cli
7
+ ```
8
+
9
+ After installation, restart VS Code and the "Generators" agent will automatically appear in your GitHub Copilot agent list.
10
+
11
+ ## Usage
12
+
13
+ 1. Open GitHub Copilot Chat.
14
+ 2. Select the "Generators" agent.
15
+ 3. Start prompting.
16
+
17
+ ## Features
18
+
19
+ - Static generator
20
+ - Dynamic generator
21
+ - Conditional generator
22
+ - Reference generator
23
+ - Remote generator
24
+
25
+ ## Instructions
26
+
27
+ ### Getting Started
28
+
29
+ | Step | Action | Details |
30
+ |------|--------|------------------------------------------------------|
31
+ | 1 | Install| Follow the Quick Install steps |
32
+ | 2 | Setup | Copy `.github/agents` folder to your project root |
33
+ | 3 | Open | Launch GitHub Copilot Chat in VS Code |
34
+ | 4 | Select | Choose "Generators" agent |
35
+ | 5 | Prompt | Start using the agent with your requests |
36
+
37
+ ### Key Commands
38
+
39
+ - **Start Agent**: `Ctrl+Shift+P` → "Start Generators Agent"
40
+ - **Reload Window**: `Ctrl+Shift+P` → "Reload Window"
41
+ - **Copilot Chat**: `Ctrl+Shift+I` (Open Copilot Chat panel)
42
+
43
+ ### Best Practices
44
+
45
+ 1. Use the appropriate agent (Generators for configuration)
46
+ 2. Provide clear prompts for better generation results
47
+ 3. Test generated output before using in production
@@ -0,0 +1,99 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const os = require('os');
6
+
7
+ // Determine VS Code extensions directory based on OS
8
+ const homeDir = os.homedir();
9
+ let extensionsDir;
10
+
11
+ if (process.platform === 'win32') {
12
+ extensionsDir = path.join(homeDir, 'AppData', 'Roaming', 'Code', 'User', 'extensions');
13
+ } else if (process.platform === 'darwin') {
14
+ extensionsDir = path.join(homeDir, 'Library', 'Application Support', 'Code', 'User', 'extensions');
15
+ } else {
16
+ // Linux
17
+ extensionsDir = path.join(homeDir, '.vscode', 'extensions');
18
+ }
19
+
20
+ // Read version from package.json dynamically
21
+ const packageJson = require(path.join(__dirname, 'package.json'));
22
+ const extensionName = `${packageJson.name}-${packageJson.version}`;
23
+ const targetDir = path.join(extensionsDir, extensionName);
24
+
25
+ // Check if extensions directory exists
26
+ if (!fs.existsSync(extensionsDir)) {
27
+ console.log(`VS Code extensions directory not found at ${extensionsDir}`);
28
+ console.log('Please ensure VS Code is installed.');
29
+ process.exit(0);
30
+ }
31
+
32
+ // Create extension directory if it doesn't exist
33
+ if (!fs.existsSync(targetDir)) {
34
+ fs.mkdirSync(targetDir, { recursive: true });
35
+ }
36
+
37
+ // Copy extension files
38
+ const filesToCopy = ['main.js', 'package.json', 'Generator_Patterns', 'source', '.agents'];
39
+ const currentDir = __dirname;
40
+
41
+ filesToCopy.forEach(file => {
42
+ const src = path.join(currentDir, file);
43
+ const dest = path.join(targetDir, file);
44
+
45
+ if (fs.existsSync(src)) {
46
+ if (fs.statSync(src).isDirectory()) {
47
+ copyDir(src, dest);
48
+ } else {
49
+ fs.copyFileSync(src, dest);
50
+ }
51
+ }
52
+ });
53
+
54
+ // Also create package.json metadata file
55
+ const packageMetadata = {
56
+ name: packageJson.name,
57
+ version: packageJson.version,
58
+ engines: packageJson.engines,
59
+ activationEvents: packageJson.activationEvents,
60
+ contributes: packageJson.contributes,
61
+ main: packageJson.main,
62
+ displayName: packageJson.displayName,
63
+ description: packageJson.description,
64
+ publisher: packageJson.publisher
65
+ };
66
+
67
+ fs.writeFileSync(
68
+ path.join(targetDir, 'package.json'),
69
+ JSON.stringify(packageMetadata, null, 2)
70
+ );
71
+
72
+ console.log('');
73
+ console.log('✅ Generator Agent installed successfully!');
74
+ console.log(`📁 Location: ${targetDir}`);
75
+ console.log('');
76
+ console.log('🔄 Next steps:');
77
+ console.log('1. Restart VS Code (Ctrl+Shift+P → "Reload Window")');
78
+ console.log('2. Open GitHub Copilot Chat');
79
+ console.log('3. Look for "Generators" agent in the agent list');
80
+ console.log('');
81
+
82
+ // Helper function to recursively copy directories
83
+ function copyDir(src, dest) {
84
+ if (!fs.existsSync(dest)) {
85
+ fs.mkdirSync(dest, { recursive: true });
86
+ }
87
+
88
+ const files = fs.readdirSync(src);
89
+ files.forEach(file => {
90
+ const srcFile = path.join(src, file);
91
+ const destFile = path.join(dest, file);
92
+
93
+ if (fs.statSync(srcFile).isDirectory()) {
94
+ copyDir(srcFile, destFile);
95
+ } else {
96
+ fs.copyFileSync(srcFile, destFile);
97
+ }
98
+ });
99
+ }
package/main.js ADDED
@@ -0,0 +1,49 @@
1
+ const vscode = require('vscode');
2
+
3
+ // Agent objects that will be discovered by Copilot
4
+ const agents = [
5
+ {
6
+ id: 'generators',
7
+ name: 'Generators',
8
+ description: 'Generator Agent responsible for generating conditional rule-based data',
9
+ }
10
+ ];
11
+
12
+ function activate(context) {
13
+ console.log('Generator Agent is now active!');
14
+
15
+ // Export agents for Copilot discovery
16
+ if (vscode.window && vscode.window.registerChatAgents) {
17
+ try {
18
+ agents.forEach(agent => {
19
+ vscode.window.registerChatAgents(agent.id, agent.name, agent.description);
20
+ });
21
+ console.log('Agents registered:', agents.length);
22
+ } catch (e) {
23
+ console.log('Note: registerChatAgents API not available, agents may still work via .agents folder');
24
+ }
25
+ }
26
+
27
+ // Command to trigger the agent
28
+ let disposable = vscode.commands.registerCommand(
29
+ 'generator.start',
30
+ function () {
31
+ vscode.window.showInformationMessage('Generator Agent started!');
32
+ }
33
+ );
34
+
35
+ context.subscriptions.push(disposable);
36
+
37
+ // Export agents for external access
38
+ context.subscriptions.push({
39
+ agentsProvided: agents
40
+ });
41
+ }
42
+
43
+ function deactivate() { }
44
+
45
+ module.exports = {
46
+ activate,
47
+ deactivate,
48
+ agents
49
+ };
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "agent-generator",
3
+ "displayName": "Generator Agent",
4
+ "description": "A Copilot Agent for conditional rule-based data generation",
5
+ "version": "1.0.0",
6
+ "publisher": "IshwaryaRamesh",
7
+ "engines": {
8
+ "vscode": "^1.80.0"
9
+ },
10
+ "main": "main.js",
11
+ "activationEvents": [
12
+ "onStartupFinished"
13
+ ],
14
+ "contributes": {
15
+ "commands": [
16
+ {
17
+ "command": "generator.start",
18
+ "title": "Start Generator Agent"
19
+ }
20
+ ]
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/ishwaryaramesh200-byte/Generator-Agent.git"
25
+ },
26
+ "categories": [
27
+ "Other"
28
+ ],
29
+ "keywords": [
30
+ "agent",
31
+ "generator",
32
+ "copilot"
33
+ ],
34
+ "author": "Ishwarya",
35
+ "license": "MIT",
36
+ "files": [
37
+ "main.js",
38
+ "install-extension.js",
39
+ ".agents"
40
+ ],
41
+ "devDependencies": {
42
+ "@types/vscode": "^1.80.0",
43
+ "@vscode/vsce": "^2.32.0"
44
+ },
45
+ "scripts": {
46
+ "postinstall": "node install-extension.js"
47
+ }
48
+ }