generator-agent 1.0.0 → 1.0.2
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/.vscode/agents.json +1 -1
- package/.vscode/settings.json +6 -0
- package/package.json +1 -1
- package/post-install.js +30 -4
package/.vscode/agents.json
CHANGED
package/package.json
CHANGED
package/post-install.js
CHANGED
|
@@ -11,8 +11,16 @@ const fs = require('fs');
|
|
|
11
11
|
console.log('🔧 Generator Agent post-install starting...');
|
|
12
12
|
|
|
13
13
|
try {
|
|
14
|
-
//
|
|
15
|
-
|
|
14
|
+
// Detect if running from node_modules and get the parent project root
|
|
15
|
+
let cwd = process.cwd();
|
|
16
|
+
|
|
17
|
+
// If we're inside node_modules, go up to the project root
|
|
18
|
+
if (cwd.includes('node_modules')) {
|
|
19
|
+
const nodeModulesIndex = cwd.indexOf('node_modules');
|
|
20
|
+
cwd = cwd.substring(0, nodeModulesIndex - 1); // -1 to remove trailing slash
|
|
21
|
+
console.log('📂 Detected installation in node_modules, registering in parent project');
|
|
22
|
+
}
|
|
23
|
+
|
|
16
24
|
const agentDir = path.join(cwd, '.vscode');
|
|
17
25
|
|
|
18
26
|
if (!fs.existsSync(agentDir)) {
|
|
@@ -35,13 +43,31 @@ try {
|
|
|
35
43
|
const configPath = path.join(agentDir, 'agents.json');
|
|
36
44
|
fs.writeFileSync(configPath, JSON.stringify(agentsConfig, null, 2));
|
|
37
45
|
|
|
46
|
+
// Create VS Code settings to enable Copilot agents
|
|
47
|
+
const settingsPath = path.join(agentDir, 'settings.json');
|
|
48
|
+
let settings = {};
|
|
49
|
+
|
|
50
|
+
if (fs.existsSync(settingsPath)) {
|
|
51
|
+
settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Add GitHub Copilot agent settings
|
|
55
|
+
settings['github.copilot.chat.experimental.agents'] = true;
|
|
56
|
+
settings['github.copilot.chat.experimental.agentLocations'] = [
|
|
57
|
+
'.vscode/agents.json'
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2));
|
|
61
|
+
|
|
38
62
|
console.log('✅ Agent registered in:', cwd);
|
|
39
63
|
console.log('📍 Config saved to:', configPath);
|
|
64
|
+
console.log('⚙️ VS Code settings updated');
|
|
40
65
|
console.log('');
|
|
41
|
-
console.log('
|
|
66
|
+
console.log('🔄 Reload VS Code window to activate the agent:');
|
|
42
67
|
console.log(' Press Ctrl+Shift+P (or Cmd+Shift+P on Mac)');
|
|
43
|
-
console.log(' Type "Reload Window" and press Enter');
|
|
68
|
+
console.log(' Type "Developer: Reload Window" and press Enter');
|
|
44
69
|
console.log('');
|
|
70
|
+
console.log('💡 Use @Generators in Copilot Chat');
|
|
45
71
|
console.log('✨ Post-install complete!');
|
|
46
72
|
process.exit(0);
|
|
47
73
|
} catch (error) {
|