@lythos/skill-deck 0.9.1 → 0.9.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/package.json +1 -1
- package/src/link.ts +9 -0
- package/src/prune.ts +14 -0
package/package.json
CHANGED
package/src/link.ts
CHANGED
|
@@ -79,6 +79,15 @@ export function findSource(name: string, coldPool: string, projectDir: string):
|
|
|
79
79
|
if (existsSync(join(directPath, "SKILL.md"))) return { path: directPath };
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
// 0.5 localhost skills: localhost/skill → cold_pool/skill
|
|
83
|
+
if (name.startsWith('localhost/')) {
|
|
84
|
+
const skill = name.slice('localhost/'.length);
|
|
85
|
+
if (skill) {
|
|
86
|
+
const localPath = join(coldPool, skill);
|
|
87
|
+
if (existsSync(join(localPath, "SKILL.md"))) return { path: localPath };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
82
91
|
// 1. 直接路径
|
|
83
92
|
const direct = resolve(coldPool, name);
|
|
84
93
|
if (existsSync(join(direct, "SKILL.md"))) return { path: direct };
|
package/src/prune.ts
CHANGED
|
@@ -48,9 +48,23 @@ function scanColdPoolRepos(coldPool: string): string[] {
|
|
|
48
48
|
for (const host of readdirSync(coldPool, { withFileTypes: true })) {
|
|
49
49
|
if (!host.isDirectory() || host.name.startsWith(".")) continue;
|
|
50
50
|
const hostPath = join(coldPool, host.name);
|
|
51
|
+
|
|
52
|
+
// Flat skill: cold-pool/skill-name/ (localhost style)
|
|
53
|
+
if (existsSync(join(hostPath, "SKILL.md"))) {
|
|
54
|
+
repos.push(hostPath);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
|
|
51
58
|
for (const owner of readdirSync(hostPath, { withFileTypes: true })) {
|
|
52
59
|
if (!owner.isDirectory() || owner.name.startsWith(".")) continue;
|
|
53
60
|
const ownerPath = join(hostPath, owner.name);
|
|
61
|
+
|
|
62
|
+
// Standalone repo: cold-pool/host.tld/owner/repo/
|
|
63
|
+
if (existsSync(join(ownerPath, "SKILL.md"))) {
|
|
64
|
+
repos.push(ownerPath);
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
|
|
54
68
|
for (const repo of readdirSync(ownerPath, { withFileTypes: true })) {
|
|
55
69
|
if (!repo.isDirectory() || repo.name.startsWith(".")) continue;
|
|
56
70
|
repos.push(join(ownerPath, repo.name));
|