@yeyuan98/opencode-bioresearcher-plugin 1.5.2-alpha.3 → 1.5.2-alpha.4
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/dist/tools/skill/registry.js +26 -0
- package/package.json +1 -1
|
@@ -29,6 +29,32 @@ export class SkillConflictError extends Error {
|
|
|
29
29
|
}
|
|
30
30
|
function getPluginSkillsDir() {
|
|
31
31
|
const currentDir = path.dirname(fileURLToPath(import.meta.url));
|
|
32
|
+
const pathSep = path.sep;
|
|
33
|
+
const isDist = currentDir.includes(`${pathSep}dist${pathSep}`);
|
|
34
|
+
const isSrc = currentDir.includes(`${pathSep}src${pathSep}`);
|
|
35
|
+
if (isDist) {
|
|
36
|
+
return path.join(currentDir, "..", "..", "..", "skills");
|
|
37
|
+
}
|
|
38
|
+
else if (isSrc) {
|
|
39
|
+
return path.join(currentDir, "..", "..", "..", "..", "skills");
|
|
40
|
+
}
|
|
41
|
+
let searchDir = currentDir;
|
|
42
|
+
for (let i = 0; i < 6; i++) {
|
|
43
|
+
const skillsPath = path.join(searchDir, "skills");
|
|
44
|
+
if (existsSync(skillsPath)) {
|
|
45
|
+
return skillsPath;
|
|
46
|
+
}
|
|
47
|
+
const pkgJson = path.join(searchDir, "package.json");
|
|
48
|
+
if (existsSync(pkgJson)) {
|
|
49
|
+
const directSkills = path.join(searchDir, "skills");
|
|
50
|
+
const distSkills = path.join(searchDir, "dist", "skills");
|
|
51
|
+
if (existsSync(distSkills))
|
|
52
|
+
return distSkills;
|
|
53
|
+
if (existsSync(directSkills))
|
|
54
|
+
return directSkills;
|
|
55
|
+
}
|
|
56
|
+
searchDir = path.dirname(searchDir);
|
|
57
|
+
}
|
|
32
58
|
return path.join(currentDir, "..", "..", "..", "skills");
|
|
33
59
|
}
|
|
34
60
|
async function loadSkillsFromDir(dir, source) {
|
package/package.json
CHANGED