ai-developer-skill-os 8.1.9 → 8.1.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.
- package/bin/install.js +39 -1
- package/package.json +1 -1
package/bin/install.js
CHANGED
|
@@ -71,7 +71,7 @@ function runInstall(ideChoice, scopeChoice) {
|
|
|
71
71
|
if (isGlobal) {
|
|
72
72
|
const homeDir = os.homedir();
|
|
73
73
|
if (ide === 'antigravity') {
|
|
74
|
-
targetDir = path.join(homeDir, '.gemini', 'config'
|
|
74
|
+
targetDir = path.join(homeDir, '.gemini', 'config');
|
|
75
75
|
} else {
|
|
76
76
|
targetDir = path.join(homeDir, '.ai-developer-skill-os', '.agents');
|
|
77
77
|
}
|
|
@@ -87,6 +87,44 @@ function runInstall(ideChoice, scopeChoice) {
|
|
|
87
87
|
if (fs.existsSync(sourceDir)) {
|
|
88
88
|
copyRecursiveSync(sourceDir, targetDir);
|
|
89
89
|
console.log(`✅ Đã copy toàn bộ kiến trúc .agents vào: ${targetDir}`);
|
|
90
|
+
|
|
91
|
+
if (isGlobal && ide === 'antigravity') {
|
|
92
|
+
const targetDirPosix = targetDir.replace(/\\/g, '/');
|
|
93
|
+
|
|
94
|
+
function walkAndReplace(dir) {
|
|
95
|
+
const files = fs.readdirSync(dir);
|
|
96
|
+
for (const file of files) {
|
|
97
|
+
const fullPath = path.join(dir, file);
|
|
98
|
+
if (fs.statSync(fullPath).isDirectory()) {
|
|
99
|
+
walkAndReplace(fullPath);
|
|
100
|
+
} else if (fullPath.endsWith('.md') || fullPath.endsWith('.yml') || fullPath.endsWith('.yaml') || fullPath.endsWith('.json')) {
|
|
101
|
+
let content = fs.readFileSync(fullPath, 'utf8');
|
|
102
|
+
let modified = false;
|
|
103
|
+
|
|
104
|
+
const dirsToRewrite = ['skills', 'registry', 'rules', 'workflows', 'knowledge', 'examples', 'docs'];
|
|
105
|
+
for (const d of dirsToRewrite) {
|
|
106
|
+
const regex = new RegExp(`\\.agents/${d}`, 'g');
|
|
107
|
+
if (regex.test(content)) {
|
|
108
|
+
content = content.replace(regex, `${targetDirPosix}/${d}`);
|
|
109
|
+
modified = true;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (content.includes('.agents/skills.json')) {
|
|
114
|
+
content = content.replace(/\.agents\/skills\.json/g, `${targetDirPosix}/skills.json`);
|
|
115
|
+
modified = true;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (modified) {
|
|
119
|
+
fs.writeFileSync(fullPath, content, 'utf8');
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
walkAndReplace(targetDir);
|
|
126
|
+
console.log(`✅ Đã cập nhật đường dẫn tuyệt đối cho cấu hình Global Antigravity`);
|
|
127
|
+
}
|
|
90
128
|
} else {
|
|
91
129
|
console.error(`❌ Lỗi: Không tìm thấy thư mục nguồn ${sourceDir}`);
|
|
92
130
|
return;
|
package/package.json
CHANGED