@yeyuan98/opencode-bioresearcher-plugin 1.5.2-alpha.3 → 1.5.2-alpha.5

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.
@@ -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) {
@@ -109,7 +109,12 @@ export const SkillTool = tool({
109
109
  },
110
110
  });
111
111
  // Set description dynamically based on available skills
112
- getAllSkills().then((skills) => {
112
+ getAllSkills()
113
+ .then((skills) => {
113
114
  ;
114
115
  SkillTool.description = formatDescription(skills);
116
+ })
117
+ .catch((err) => {
118
+ console.error("[bioresearcher-plugin] Failed to load skills for tool description:", err);
119
+ SkillTool.description = formatDescription([]);
115
120
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeyuan98/opencode-bioresearcher-plugin",
3
- "version": "1.5.2-alpha.3",
3
+ "version": "1.5.2-alpha.5",
4
4
  "description": "OpenCode plugin that adds a bioresearcher agent",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",