generator-agent 1.0.26 → 1.0.27
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/.github/agents/Generator.agent.md +2 -2
- package/README.md +0 -4
- package/bin/cli.js +2 -2
- package/bin/install.js +25 -9
- package/package.json +2 -2
|
@@ -10,13 +10,13 @@ Responsible for building generators that follow strict rules and guidelines base
|
|
|
10
10
|
|
|
11
11
|
## What to do
|
|
12
12
|
|
|
13
|
-
1. Read all generator type definitions
|
|
13
|
+
1. Read all generator type definitions in the Generator_Patterns folder to understand their rules and structures, then use them to create generators based on the OAS file’s schema and dependencies.
|
|
14
14
|
|
|
15
15
|
2. **Strict Rule (Non-Negotiable):** Add only dependencies, fields, and parameters explicitly mentioned by the user. Do not guess from old generators, past outputs, OAS specs, or optional fields. Do not auto-create additional dependency generators unless explicitly asked.
|
|
16
16
|
|
|
17
17
|
3. For user-requested dependencies, ensure generators extract the required values from API responses so downstream generators can consume them clearly and correctly.
|
|
18
18
|
|
|
19
|
-
4. Refer to the
|
|
19
|
+
4. Refer to the `PathConfig.properties` file to find the paths for OAS files and existing generator files. Always use these paths when reading or referencing OAS or generator files.
|
|
20
20
|
|
|
21
21
|
6. You may use tools if necessary to generate the generators correctly.
|
|
22
22
|
|
package/README.md
CHANGED
|
@@ -20,10 +20,6 @@
|
|
|
20
20
|
# Step2 : Run the initialization command to set up the extension:
|
|
21
21
|
- npx generatoragent init
|
|
22
22
|
|
|
23
|
-
This will copy only `.github/agents` and `PathConfig.properties` to your project root.
|
|
24
|
-
`Generator_Patterns` and `Created_Generators` will not be copied.
|
|
25
|
-
Generator pattern files are read directly from `node_modules/generator-agent/Generator_Patterns`.
|
|
26
|
-
|
|
27
23
|
# Step3: Reload VS Code window to activate the extension.
|
|
28
24
|
- Reload VS Code window after adding agents
|
|
29
25
|
|
package/bin/cli.js
CHANGED
|
@@ -101,7 +101,7 @@ function main() {
|
|
|
101
101
|
log('Usage: agentpublish [command]\n', 'cyan');
|
|
102
102
|
log('Commands:', 'green');
|
|
103
103
|
log(' list List all installed agents (default)');
|
|
104
|
-
log(' init Copy .github
|
|
104
|
+
log(' init Copy .github and Generator_Patterns to project root');
|
|
105
105
|
log(' --version Show version');
|
|
106
106
|
log(' --help Show this help message\n');
|
|
107
107
|
return;
|
|
@@ -115,7 +115,7 @@ function main() {
|
|
|
115
115
|
|
|
116
116
|
if (command === 'init') {
|
|
117
117
|
runInstall(process.cwd());
|
|
118
|
-
log('✅ Copied
|
|
118
|
+
log('✅ Copied files to project root.', 'green');
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
121
121
|
|
package/bin/install.js
CHANGED
|
@@ -21,7 +21,8 @@ function copyRecursive(src, dest) {
|
|
|
21
21
|
function runInstall(targetRoot = process.cwd()) {
|
|
22
22
|
const pkgRoot = path.resolve(__dirname, '..');
|
|
23
23
|
|
|
24
|
-
const foldersToCopy = ['.github
|
|
24
|
+
const foldersToCopy = ['.github', 'Generator_Patterns', 'Created_Generators'];
|
|
25
|
+
const filesToCopy = ['README.md'];
|
|
25
26
|
|
|
26
27
|
console.log(`[GeneratorAgent] Installing to: ${targetRoot}`);
|
|
27
28
|
console.log(`[GeneratorAgent] Package root: ${pkgRoot}`);
|
|
@@ -33,17 +34,32 @@ function runInstall(targetRoot = process.cwd()) {
|
|
|
33
34
|
copyRecursive(src, dest);
|
|
34
35
|
});
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
filesToCopy.forEach(file => {
|
|
38
|
+
const src = path.join(pkgRoot, file);
|
|
39
|
+
const dest = path.join(targetRoot, file);
|
|
40
|
+
if (fs.existsSync(src)) {
|
|
41
|
+
console.log(`[GeneratorAgent] Copying file ${src} to ${dest}`);
|
|
42
|
+
fs.copyFileSync(src, dest);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
38
45
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
// Delete the entire generator-agent package from node_modules after copying
|
|
47
|
+
try {
|
|
48
|
+
const nodeModulesPath = path.join(targetRoot, 'node_modules', 'generator-agent');
|
|
49
|
+
console.log(`[GeneratorAgent] Attempting to remove: ${nodeModulesPath}`);
|
|
50
|
+
if (fs.existsSync(nodeModulesPath)) {
|
|
51
|
+
console.log(`[GeneratorAgent] Found generator-agent in node_modules, removing...`);
|
|
52
|
+
fs.rmSync(nodeModulesPath, { recursive: true, force: true });
|
|
53
|
+
console.log(`[GeneratorAgent] Successfully removed generator-agent from node_modules`);
|
|
54
|
+
} else {
|
|
55
|
+
console.log(`[GeneratorAgent] generator-agent not found in node_modules`);
|
|
56
|
+
}
|
|
57
|
+
} catch (err) {
|
|
58
|
+
console.log(`[GeneratorAgent] Error removing package: ${err.message}`);
|
|
44
59
|
}
|
|
45
60
|
|
|
46
|
-
|
|
61
|
+
// eslint-disable-next-line no-console
|
|
62
|
+
console.log('GeneratorAgent: Copied .github, Generator_Patterns, and Created_Generators to project root. Package removed from node_modules.');
|
|
47
63
|
}
|
|
48
64
|
|
|
49
65
|
if (require.main === module) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "generator-agent",
|
|
3
3
|
"displayName": "GeneratorAgent",
|
|
4
4
|
"description": "Custom agent that responds with greetings and follows specific instructions",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.27",
|
|
6
6
|
"publisher": "Ishwarya",
|
|
7
7
|
"author": "Ishwarya",
|
|
8
8
|
"license": "MIT",
|
|
@@ -73,4 +73,4 @@
|
|
|
73
73
|
"@vscode/test-cli": "^0.0.12",
|
|
74
74
|
"@vscode/test-electron": "^2.5.2"
|
|
75
75
|
}
|
|
76
|
-
}
|
|
76
|
+
}
|