ai-agent-config 2.7.1 → 2.7.3
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/package.json +1 -1
- package/scripts/config-manager.js +11 -10
- package/scripts/external-sync.js +0 -26
- package/scripts/platforms.js +3 -2
- package/scripts/postinstall.js +13 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Config Manager Module
|
|
3
|
-
* Manages user configuration for ai-agent-config
|
|
3
|
+
* Manages user configuration for ai-agent-config
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
const fs = require("fs");
|
|
@@ -10,6 +10,7 @@ const os = require("os");
|
|
|
10
10
|
const CONFIG_DIR = path.join(os.homedir(), ".ai-agent");
|
|
11
11
|
const CONFIG_FILE = path.join(CONFIG_DIR, "config.json");
|
|
12
12
|
const OFFICIAL_SOURCES = path.join(__dirname, "../config/official-sources.json");
|
|
13
|
+
const CONFIG_VERSION = require("../package.json").version;
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Get user config path
|
|
@@ -49,7 +50,7 @@ function loadOfficialSources() {
|
|
|
49
50
|
*/
|
|
50
51
|
function createDefaultConfig() {
|
|
51
52
|
const config = {
|
|
52
|
-
version:
|
|
53
|
+
version: CONFIG_VERSION,
|
|
53
54
|
repository: {
|
|
54
55
|
url: null,
|
|
55
56
|
branch: "main",
|
|
@@ -96,11 +97,11 @@ function initConfig(force = false) {
|
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
/**
|
|
99
|
-
* Migrate config from older versions to
|
|
100
|
+
* Migrate config from older versions to current version
|
|
100
101
|
*/
|
|
101
102
|
function migrateConfig(oldConfig) {
|
|
102
103
|
const newConfig = {
|
|
103
|
-
version:
|
|
104
|
+
version: CONFIG_VERSION,
|
|
104
105
|
repository: {
|
|
105
106
|
url: oldConfig.repository?.url || null,
|
|
106
107
|
branch: oldConfig.repository?.branch || "main",
|
|
@@ -137,9 +138,9 @@ function loadConfig() {
|
|
|
137
138
|
const data = fs.readFileSync(CONFIG_FILE, "utf-8");
|
|
138
139
|
let config = JSON.parse(data);
|
|
139
140
|
|
|
140
|
-
// Auto-migrate from
|
|
141
|
-
if (config.version !==
|
|
142
|
-
console.log(`🔄 Migrating config from v${config.version} to
|
|
141
|
+
// Auto-migrate from older versions
|
|
142
|
+
if (config.version !== CONFIG_VERSION) {
|
|
143
|
+
console.log(`🔄 Migrating config from v${config.version} to v${CONFIG_VERSION}...`);
|
|
143
144
|
config = migrateConfig(config);
|
|
144
145
|
saveConfig(config);
|
|
145
146
|
console.log("✅ Config migrated successfully!");
|
|
@@ -188,10 +189,10 @@ function validateConfig(config) {
|
|
|
188
189
|
}
|
|
189
190
|
}
|
|
190
191
|
|
|
191
|
-
//
|
|
192
|
-
if (config.version ===
|
|
192
|
+
// Current version validation
|
|
193
|
+
if (config.version === CONFIG_VERSION) {
|
|
193
194
|
if (!config.repository) {
|
|
194
|
-
errors.push(
|
|
195
|
+
errors.push(`Missing repository field in v${CONFIG_VERSION} config`);
|
|
195
196
|
} else {
|
|
196
197
|
if (config.repository.url && typeof config.repository.url !== "string") {
|
|
197
198
|
errors.push("repository.url must be a string");
|
package/scripts/external-sync.js
CHANGED
|
@@ -119,30 +119,6 @@ function copyDirRecursive(src, dest, excludePaths = []) {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
/**
|
|
123
|
-
* Add attribution to SKILL.md file
|
|
124
|
-
*/
|
|
125
|
-
function addAttribution(skillPath, attribution) {
|
|
126
|
-
const skillFile = path.join(skillPath, "SKILL.md");
|
|
127
|
-
|
|
128
|
-
if (!fs.existsSync(skillFile)) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
let content = fs.readFileSync(skillFile, "utf-8");
|
|
133
|
-
|
|
134
|
-
// Check if attribution already exists
|
|
135
|
-
if (content.includes(attribution)) {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// Add attribution at the top
|
|
140
|
-
const attributionBlock = `---\nsource: external\nattribution: ${attribution}\n---\n\n`;
|
|
141
|
-
content = attributionBlock + content;
|
|
142
|
-
|
|
143
|
-
fs.writeFileSync(skillFile, content, "utf-8");
|
|
144
|
-
}
|
|
145
|
-
|
|
146
122
|
/**
|
|
147
123
|
* Sync all external skills
|
|
148
124
|
*/
|
|
@@ -203,8 +179,6 @@ function syncAll(options = {}) {
|
|
|
203
179
|
const result = copySkill(sourcePath, targetPath, true, excludePaths);
|
|
204
180
|
|
|
205
181
|
if (result.copied) {
|
|
206
|
-
// Skip attribution to save tokens - attribution is already in external-skills.json
|
|
207
|
-
// addAttribution(targetPath, src.attribution);
|
|
208
182
|
console.log(` ✓ ${skillDef.name}`);
|
|
209
183
|
results.copied++;
|
|
210
184
|
} else {
|
package/scripts/platforms.js
CHANGED
|
@@ -141,8 +141,9 @@ const SUPPORTED = [
|
|
|
141
141
|
return path.join(HOME, this.configDir, this.instructionsFile);
|
|
142
142
|
},
|
|
143
143
|
detect() {
|
|
144
|
-
// Copilot
|
|
145
|
-
|
|
144
|
+
// Check for actual Copilot instructions file, not just ~/.github directory
|
|
145
|
+
// (which is created by gh CLI for auth tokens, causing false positives)
|
|
146
|
+
return fs.existsSync(this.instructionsPath);
|
|
146
147
|
},
|
|
147
148
|
},
|
|
148
149
|
];
|
package/scripts/postinstall.js
CHANGED
|
@@ -59,16 +59,21 @@ function main() {
|
|
|
59
59
|
console.log("📦 Repository: https://github.com/dongitran/ai-agent-config\n");
|
|
60
60
|
|
|
61
61
|
// Auto-install Bitwarden MCP server to Antigravity
|
|
62
|
+
// Skip if AI_AGENT_NO_AUTOCONFIG is set (opt-out for security/trust)
|
|
63
|
+
if (process.env.AI_AGENT_NO_AUTOCONFIG === "1" || process.env.AI_AGENT_NO_AUTOCONFIG === "true") {
|
|
64
|
+
console.log("⏭️ Skipping auto-config (AI_AGENT_NO_AUTOCONFIG is set)\n");
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
62
68
|
const fs = require("fs");
|
|
63
69
|
const path = require("path");
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
);
|
|
70
|
+
|
|
71
|
+
// Use platforms.js to get Antigravity MCP config path (avoid hardcoding)
|
|
72
|
+
const antigravityPlatform = platforms.getByName("antigravity");
|
|
73
|
+
if (!antigravityPlatform) {
|
|
74
|
+
return; // Antigravity platform not available
|
|
75
|
+
}
|
|
76
|
+
const antigravityMcpPath = antigravityPlatform.mcpConfigPath;
|
|
72
77
|
|
|
73
78
|
if (fs.existsSync(path.dirname(antigravityMcpPath))) {
|
|
74
79
|
try {
|