itismyskillmarket 1.3.5 → 1.3.6
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/CHANGELOG.md +90 -0
- package/dist/index.js +22 -2
- package/package.json +1 -1
- package/src/cli.ts +17 -8
- package/src/commands/sync.ts +62 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,93 @@
|
|
|
1
|
+
# SkillMarket v1.3.6 更新日志
|
|
2
|
+
|
|
3
|
+
**日期**: 2026-05-07
|
|
4
|
+
**版本**: 1.3.6
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 🎉 新功能:skm sync <skill-name> 同步 Skill 到最新版本
|
|
9
|
+
|
|
10
|
+
### 功能说明
|
|
11
|
+
|
|
12
|
+
新增 `skm sync <skill-name>` 命令,一键将指定 skill 同步到 npm 最新版本,并强制安装到所有已检测平台。
|
|
13
|
+
|
|
14
|
+
### 使用方法
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# 同步 brainstorming 到最新版本(安装到所有平台)
|
|
18
|
+
skm sync brainstorming
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 执行流程
|
|
22
|
+
|
|
23
|
+
1. 从 npm 获取最新版本信息
|
|
24
|
+
2. 强制安装到所有已检测平台(`--force` 模式)
|
|
25
|
+
3. 更新注册表记录
|
|
26
|
+
|
|
27
|
+
### 输出示例
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
Syncing brainstorming to latest version...
|
|
31
|
+
Latest version: 1.2.0
|
|
32
|
+
Installing to 3 platform(s)...
|
|
33
|
+
|
|
34
|
+
OpenCode ✅ Installed successfully
|
|
35
|
+
Claude Code ✅ Installed successfully
|
|
36
|
+
VSCode ✅ Installed successfully
|
|
37
|
+
|
|
38
|
+
📊 Summary: 3 installed, 0 skipped, 0 failed
|
|
39
|
+
|
|
40
|
+
✅ brainstorming synced to v1.2.0
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 🐛 Bug 修复:skm platforms 显示所有平台
|
|
46
|
+
|
|
47
|
+
### 问题
|
|
48
|
+
|
|
49
|
+
`skm platforms` 命令只显示 OpenCode、Claude Code、VSCode,不显示 OpenClaw 和 Hermes Agent。
|
|
50
|
+
|
|
51
|
+
### 原因
|
|
52
|
+
|
|
53
|
+
`src/cli.ts` 中 `platforms` 命令使用硬编码平台列表,未使用已注册的适配器系统。
|
|
54
|
+
|
|
55
|
+
### 修复
|
|
56
|
+
|
|
57
|
+
改用 `getAllAdapters()` 动态获取所有已注册平台,新增平台无需修改 cli.ts。
|
|
58
|
+
|
|
59
|
+
### 修复后输出
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
📍 Available Platforms:
|
|
63
|
+
|
|
64
|
+
OpenCode ✅ Available (1 skills installed)
|
|
65
|
+
Claude Code ✅ Available (0 skills installed)
|
|
66
|
+
VSCode ✅ Available (0 skills installed)
|
|
67
|
+
OpenClaw ✅ Available (0 skills installed)
|
|
68
|
+
Hermes Agent ✅ Available (0 skills installed)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 📦 完整版本历史
|
|
74
|
+
|
|
75
|
+
| 版本 | 日期 | 描述 |
|
|
76
|
+
|------|------|------|
|
|
77
|
+
| 1.3.6 | 2026-05-07 | skm sync <skill-name> + platforms bug fix |
|
|
78
|
+
| 1.3.5 | 2026-05-07 | Fix platforms display |
|
|
79
|
+
| 1.3.4 | 2026-05-06 | OpenClaw/Hermes adapter support |
|
|
80
|
+
| 1.3.3 | 2026-04-30 | GitHub 第三方库支持 |
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 贡献者
|
|
85
|
+
|
|
86
|
+
- wxc2004 (wanxuchen)
|
|
87
|
+
- Sisyphus Agent
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
1
91
|
# SkillMarket v1.3.3 更新日志
|
|
2
92
|
|
|
3
93
|
**日期**: 2026-04-30
|
package/dist/index.js
CHANGED
|
@@ -864,6 +864,22 @@ async function syncPlatformLinks() {
|
|
|
864
864
|
}
|
|
865
865
|
console.log("\n\u2705 Sync complete!");
|
|
866
866
|
}
|
|
867
|
+
async function syncSkill(skillId) {
|
|
868
|
+
console.log(`Syncing ${skillId} to latest version...`);
|
|
869
|
+
const pkgInfo = await fetchSkillPackage(skillId);
|
|
870
|
+
if (!pkgInfo) {
|
|
871
|
+
throw new Error(`Package ${skillId} not found on npm`);
|
|
872
|
+
}
|
|
873
|
+
const latestVersion = pkgInfo["dist-tags"]?.latest;
|
|
874
|
+
if (!latestVersion) {
|
|
875
|
+
throw new Error(`No latest version found for ${skillId}`);
|
|
876
|
+
}
|
|
877
|
+
console.log(`Latest version: ${latestVersion}`);
|
|
878
|
+
console.log("Installing to all detected platforms...\n");
|
|
879
|
+
await installSkill(skillId, latestVersion, { force: true });
|
|
880
|
+
console.log(`
|
|
881
|
+
\u2705 ${skillId} synced to v${latestVersion}`);
|
|
882
|
+
}
|
|
867
883
|
|
|
868
884
|
// src/commands/update.ts
|
|
869
885
|
async function updateSkill(skillId) {
|
|
@@ -1501,9 +1517,13 @@ updateCmd.argument("[skill]", "Skill ID to update (optional, updates all if not
|
|
|
1501
1517
|
process.exit(1);
|
|
1502
1518
|
}
|
|
1503
1519
|
});
|
|
1504
|
-
program.command("sync").description("Synchronize platform links").action(async () => {
|
|
1520
|
+
program.command("sync [skill]").description("Synchronize platform links or sync skill to latest version").action(async (skill) => {
|
|
1505
1521
|
try {
|
|
1506
|
-
|
|
1522
|
+
if (skill) {
|
|
1523
|
+
await syncSkill(skill);
|
|
1524
|
+
} else {
|
|
1525
|
+
await syncPlatformLinks();
|
|
1526
|
+
}
|
|
1507
1527
|
} catch (err) {
|
|
1508
1528
|
console.error("Sync failed:", err);
|
|
1509
1529
|
process.exit(1);
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -45,7 +45,7 @@ import { listSkills } from './commands/ls.js'; // 列表命令
|
|
|
45
45
|
import { searchSkills } from './commands/search.js'; // 搜索命令
|
|
46
46
|
import { showSkillInfo } from './commands/info.js'; // 信息命令
|
|
47
47
|
import { installSkill } from './commands/install.js'; // 安装命令
|
|
48
|
-
import { syncPlatformLinks } from './commands/sync.js'; // 同步命令
|
|
48
|
+
import { syncPlatformLinks, syncSkill } from './commands/sync.js'; // 同步命令
|
|
49
49
|
import { updateSkill } from './commands/update.js'; // 更新命令
|
|
50
50
|
import { uninstallSkill, uninstallAll } from './commands/uninstall.js'; // 卸载命令
|
|
51
51
|
import { installFromGitHub, parseGitHubUrl } from './commands/github-install.js'; // GitHub 安装
|
|
@@ -379,22 +379,31 @@ updateCmd
|
|
|
379
379
|
});
|
|
380
380
|
|
|
381
381
|
// -----------------------------------------------------------------------------
|
|
382
|
-
// 同步命令 (skm sync)
|
|
382
|
+
// 同步命令 (skm sync [skill-name])
|
|
383
383
|
// -----------------------------------------------------------------------------
|
|
384
384
|
|
|
385
385
|
/**
|
|
386
386
|
* 同步命令
|
|
387
387
|
*
|
|
388
|
-
*
|
|
388
|
+
* - skm sync: 同步各平台的软链接
|
|
389
|
+
* - skm sync <skill-name>: 同步指定 skill 到最新版本
|
|
389
390
|
*
|
|
390
|
-
* 用法:
|
|
391
|
+
* 用法:
|
|
392
|
+
* skm sync
|
|
393
|
+
* skm sync brainstorming
|
|
391
394
|
*/
|
|
392
395
|
program
|
|
393
|
-
.command('sync')
|
|
394
|
-
.description('Synchronize platform links')
|
|
395
|
-
.action(async () => {
|
|
396
|
+
.command('sync [skill]')
|
|
397
|
+
.description('Synchronize platform links or sync skill to latest version')
|
|
398
|
+
.action(async (skill) => {
|
|
396
399
|
try {
|
|
397
|
-
|
|
400
|
+
if (skill) {
|
|
401
|
+
// 同步指定 skill 到最新版本
|
|
402
|
+
await syncSkill(skill);
|
|
403
|
+
} else {
|
|
404
|
+
// 同步平台软链接
|
|
405
|
+
await syncPlatformLinks();
|
|
406
|
+
}
|
|
398
407
|
} catch (err) {
|
|
399
408
|
console.error('Sync failed:', err);
|
|
400
409
|
process.exit(1);
|
package/src/commands/sync.ts
CHANGED
|
@@ -3,12 +3,18 @@
|
|
|
3
3
|
* SkillMarket 同步命令模块
|
|
4
4
|
* =============================================================================
|
|
5
5
|
*
|
|
6
|
-
* 本模块实现 `skm sync`
|
|
6
|
+
* 本模块实现 `skm sync` 命令,用于:
|
|
7
|
+
* - `skm sync`:同步平台软链接
|
|
8
|
+
* - `skm sync <skill-name>`:同步指定 skill 到最新版本
|
|
7
9
|
*
|
|
8
|
-
*
|
|
10
|
+
* 同步流程 (skm sync):
|
|
9
11
|
* 1. 遍历所有支持的平台
|
|
10
12
|
* 2. 对每个已安装的 skill,创建平台特定的软链接
|
|
11
13
|
*
|
|
14
|
+
* 同步流程 (skm sync <skill-name>):
|
|
15
|
+
* 1. 从 npm 获取最新版本
|
|
16
|
+
* 2. 强制安装到所有已检测平台
|
|
17
|
+
*
|
|
12
18
|
* 软链接结构:
|
|
13
19
|
* ~/.skillmarket/
|
|
14
20
|
* ├── skills/ # 实际 skill 文件
|
|
@@ -42,11 +48,13 @@ import {
|
|
|
42
48
|
} from '../utils/dirs.js';
|
|
43
49
|
|
|
44
50
|
import { loadRegistry } from './registry.js';
|
|
51
|
+
import { installSkill } from './install.js';
|
|
52
|
+
import { fetchSkillPackage } from './npm.js';
|
|
45
53
|
|
|
46
54
|
import { PLATFORMS, LATEST_LINK } from '../constants.js';
|
|
47
55
|
|
|
48
56
|
// -----------------------------------------------------------------------------
|
|
49
|
-
//
|
|
57
|
+
// 同步平台链接函数
|
|
50
58
|
// -----------------------------------------------------------------------------
|
|
51
59
|
|
|
52
60
|
/**
|
|
@@ -135,3 +143,54 @@ export async function syncPlatformLinks(): Promise<void> {
|
|
|
135
143
|
|
|
136
144
|
console.log('\n✅ Sync complete!');
|
|
137
145
|
}
|
|
146
|
+
|
|
147
|
+
// -----------------------------------------------------------------------------
|
|
148
|
+
// 同步 Skill 到最新版本
|
|
149
|
+
// -----------------------------------------------------------------------------
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* 同步指定 skill 到最新版本
|
|
153
|
+
*
|
|
154
|
+
* 从 npm 获取最新版本,并强制安装到所有已检测平台。
|
|
155
|
+
* 确保 skill 在所有平台都是最新版本。
|
|
156
|
+
*
|
|
157
|
+
* @param {string} skillId - Skill 标识符
|
|
158
|
+
* @returns {Promise<void>}
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* // 同步 brainstorming 到最新版本
|
|
162
|
+
* await syncSkill('brainstorming');
|
|
163
|
+
*/
|
|
164
|
+
export async function syncSkill(skillId: string): Promise<void> {
|
|
165
|
+
// ==========================================================================
|
|
166
|
+
// 步骤 1: 获取 npm 最新版本信息
|
|
167
|
+
// ==========================================================================
|
|
168
|
+
|
|
169
|
+
console.log(`Syncing ${skillId} to latest version...`);
|
|
170
|
+
|
|
171
|
+
const pkgInfo = await fetchSkillPackage(skillId);
|
|
172
|
+
if (!pkgInfo) {
|
|
173
|
+
throw new Error(`Package ${skillId} not found on npm`);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const latestVersion = pkgInfo['dist-tags']?.latest;
|
|
177
|
+
if (!latestVersion) {
|
|
178
|
+
throw new Error(`No latest version found for ${skillId}`);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// ==========================================================================
|
|
182
|
+
// 步骤 2: 强制安装到所有已检测平台
|
|
183
|
+
// ==========================================================================
|
|
184
|
+
|
|
185
|
+
console.log(`Latest version: ${latestVersion}`);
|
|
186
|
+
console.log('Installing to all detected platforms...\n');
|
|
187
|
+
|
|
188
|
+
// 使用 force: true 确保安装到所有平台(即使已安装)
|
|
189
|
+
await installSkill(skillId, latestVersion, { force: true });
|
|
190
|
+
|
|
191
|
+
// ==========================================================================
|
|
192
|
+
// 完成
|
|
193
|
+
// ==========================================================================
|
|
194
|
+
|
|
195
|
+
console.log(`\n✅ ${skillId} synced to v${latestVersion}`);
|
|
196
|
+
}
|