aixxai 1.7.23 → 1.7.24
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/aixx.js +15 -0
- package/package.json +1 -1
package/bin/aixx.js
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
import { readFileSync } from 'fs';
|
|
21
|
+
import { homedir } from 'os';
|
|
21
22
|
import { fileURLToPath } from 'url';
|
|
22
23
|
import { dirname, join } from 'path';
|
|
23
24
|
import { install } from '../src/commands/install.js';
|
|
@@ -116,6 +117,20 @@ async function main() {
|
|
|
116
117
|
|
|
117
118
|
const entry = COMMANDS.find(c => c.name === command || c.aliases?.includes(command));
|
|
118
119
|
if (entry) {
|
|
120
|
+
// B方案(1202 K哥拍板): 每条命令检测本机skill版本——旧则醒目提示升级(只提示不动用户文件·install自身免提示)
|
|
121
|
+
if (command !== 'install') try {
|
|
122
|
+
const rd = (p) => { try { const m = readFileSync(p, 'utf8').match(/^version:\s*(.+)$/m); return m ? m[1].trim() : null; } catch { return null; } };
|
|
123
|
+
const packVer = rd(join(dirname(fileURLToPath(import.meta.url)), '..', 'templates', 'SKILL.md'));
|
|
124
|
+
let local = null;
|
|
125
|
+
for (const d of [join(homedir(), '.agents', 'skills', 'aixx'), join(homedir(), '.claude', 'skills', 'aixx'), join(homedir(), '.zcode', 'skills', 'aixx'), join(homedir(), '.aixx', 'skills', 'aixx')]) {
|
|
126
|
+
local = rd(join(d, 'SKILL.md'));
|
|
127
|
+
if (local) break;
|
|
128
|
+
}
|
|
129
|
+
if (packVer && local && local !== packVer) {
|
|
130
|
+
console.error('⬆️ [萬安云] 技能有新版 v' + local + ' → v' + packVer + '(行情全貌+主动推荐)');
|
|
131
|
+
console.error(' 跑一次 npx aixxai install 即升级——身份/key/余额全不动。\n');
|
|
132
|
+
}
|
|
133
|
+
} catch { /* 版本检测失败不阻塞命令 */ }
|
|
119
134
|
await entry.run(subArgs);
|
|
120
135
|
return;
|
|
121
136
|
}
|