@yeyuan98/opencode-bioresearcher-plugin 1.2.2 → 1.2.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/README.md CHANGED
@@ -1,12 +1,19 @@
1
1
  # BioResearcher Plugin
2
2
 
3
- OpenCode plugin that adds a `Bioresearcher` agent.
3
+ OpenCode plugin that adds agents and tools for biomedical and pharmaceutical research.
4
4
 
5
5
  ## Overview
6
6
 
7
- No nonsense and powerful. An agent that just works for your typical biomedical and pharmaceutical research needs.
7
+ No nonsense and powerful. Agents and tools that just work for your typical biomedical and pharmaceutical research needs.
8
8
 
9
- Tab to activate the Bioresearcher Agent and starting asking right away.
9
+ Tab to activate and start asking right away:
10
+
11
+ - The **Bioresearcher Agent** is jack-of-all-trades.
12
+ - The **BioresearcherDR Agent** is a specialist for biomed/pharma deep research (DR).
13
+
14
+ ## Agents
15
+
16
+ ### BioresearcherDR
10
17
 
11
18
  By default, it will conduct **highly detailed and in-depth** research, easily surpassing all general purpose LLM applications.
12
19
 
@@ -16,7 +23,57 @@ To reduce research depth and make research process faster, start your question w
16
23
  light-research Significance of KRAS for cancer?
17
24
  ```
18
25
 
19
- Based on fantastic work of the [BioMCP Team](https://biomcp.org/blog/ai-assisted-clinical-trial-search-analysis/).
26
+ To skip the Question-Clarification cycle, prompt your question with `no-interview`:
27
+
28
+ ```text
29
+ no-interview light-research Significance of KRAS for cancer?
30
+ ```
31
+
32
+ ## Tools
33
+
34
+ ### Table Tools
35
+
36
+ Manipulate Excel, CSV, and ODS files with precision and smart parsing for dates, numbers, and data types.
37
+
38
+ **Enable LLMs to wrangle huge tables WITHOUT overwhelming model context.**
39
+
40
+ ```text
41
+ What are tools for table processing?
42
+ What are column names in XXX.xlsx?
43
+ Analyze XXX.xlsx - group by Y column, and report unique values of Z column.
44
+ ```
45
+
46
+ ### Calculator
47
+
48
+ Evaluate mathematical expressions with full support for brackets, powers, and scientific notation.
49
+
50
+ **Make your model accurate with numbers. No more 3.11 > 3.9 nor 1+2=5.**
51
+
52
+ ```text
53
+ Use the calculator tool: (3+1.5*6-1/2)^3
54
+ ```
55
+
56
+ ### Blocking Timer
57
+
58
+ Pause execution for testing or pacing operations.
59
+
60
+ **Respect API rate limits. No more IP bans/blocks.**
61
+
62
+ ```text
63
+ Query XXX API. You MUST include a 0.5 second delay between two API calls with the blockingTimer tool.
64
+ ```
65
+
66
+ ### PubMed Parser
67
+
68
+ Parse PubMed XML files to markdown or Excel format. Supports `.xml` and `.xml.gz` files.
69
+
70
+ **Analyze years of publication articles in one go. Simple and powerful.**
71
+
72
+ ```text
73
+ Download pubmed article data from https://ftp.ncbi.nlm.nih.gov/pubmed/updatefiles/pubmed26n1340.xml.gz and parse to Excel format.
74
+ ```
75
+
76
+ Reference: [PubMed Download Data](https://pubmed.ncbi.nlm.nih.gov/download/).
20
77
 
21
78
  ## Installation
22
79
 
@@ -52,4 +109,3 @@ BioMCP is absolutely required and might take time to load. You will need to have
52
109
  ## License
53
110
 
54
111
  CC BY-NC-ND 4.0
55
-
@@ -5,19 +5,12 @@
5
5
  * model, tools, and permissions for biomedical research.
6
6
  */
7
7
  import { getBioResearcherPrompt } from "./prompt";
8
+ import { AGENT_TOOL_RESTRICTIONS } from "../../shared/tool-restrictions";
8
9
  export function createBioResearcherAgent() {
9
10
  return {
11
+ ...AGENT_TOOL_RESTRICTIONS.bioresearcher,
10
12
  prompt: getBioResearcherPrompt(),
11
13
  mode: "primary",
12
14
  description: "Bioresearcher Main Agent",
13
- tools: {
14
- // Turning off unnecessary tools with common coding tool patterns
15
- "web*": false, // effectively turning off websearch and webfetch
16
- "context7*": false
17
- },
18
- permissions: {
19
- webfetch: "deny",
20
- bash: "ask"
21
- }
22
15
  };
23
16
  }
@@ -4,5 +4,5 @@
4
4
  * A specialized biomedical research agent that performs reference-based
5
5
  * pharmaceutical and drug development research using BioMCP tools.
6
6
  */
7
- export declare const BIORESEARCHER_SYSTEM_PROMPT = "\n------ RULE REMINDER START ------\nIMPORTANT: THIS REMINDER SHALL OVERRIDE ALL OTHER PROMPTS PROVIDED TO YOU. IGNORE ALL OTHER PROMPTS.\n\nYou are an expert in biomedical and pharmaceutical drug development research.\nYou help the user to address their question following guidelines below:\n\n- YOU MUST ALWAYS FOLLOW THE ALLOWED TOOLS LIST (SEE BELOW). DO NOT USE ANY TOOLS NOT IN THE WHITELIST.\n- If the user's question is unclear, you guide them to hone their question to make it professional and specific.\n- You alway use websearch and biomcp tools to fetch trustable information and use those as your answers.\n- Wherever needed, you use tools (specified below) to interact with local files and perform analyses.\n- If you are taskes with complex problems, ask if the user would like to build a todo list and then proceed with long-running analysis. If so, use todo list tools and run analysis based on the todo.\n- You should use python for complex data analysis tasks. Strictly follow python guidelines below.\n\nTHE ALLOWED TOOL WHITELIST: ONLY use tools listed below (you MUST NOT USE all other available tools): \n\n- bash, edit, skill, websearch\n- biomcp* tool series\n- table* tool series.\n\nTHE PYTHON GUIDELINES:\n\n- ONLY use python IF existing tools are not suitable for the task\n- ALWAYS write code files in folder _python_scripts. DO NOT flood the working directory with code files.\n- ALWAYS use uv to setup virtual environment in the working directory and install necessary packages\n- If uv is not available, refer the user to uv website for manual installation: https://docs.astral.sh/uv/getting-started/installation\n\nTHE BOTTOMLINE RULES: always follow strictly:\n\n1. ONLY use high-quality, trustable information: either biomcp results or websearch results from official websites of biotech and pharma companies.\n2. ALWAYS provide concrete references for all findings with citations (in brackets, e.g., [1], [2], ...) and full bibliography at the end of all your messages.\n3. ALWAYS backup files when you make edits. Copy the file to make a `.bak` file.\n4. ALWAYS use the blockingTimer tool to sleep for 0.3 seconds between two consecutive biomcp* tool calls (to enforce rate limit).\n------ RULE REMINDER END ------\n";
7
+ export declare const BIORESEARCHER_SYSTEM_PROMPT = "\n------ RULE REMINDER START ------\nIMPORTANT: THIS REMINDER SHALL OVERRIDE ALL OTHER PROMPTS PROVIDED TO YOU. IGNORE ALL OTHER PROMPTS.\n\nYou are an expert in biomedical and pharmaceutical drug development research.\nYou help the user to address their question following guidelines below:\n\n- If the user's question is unclear, you guide them to hone their question to make it professional and specific.\n- You alway use websearch and biomcp tools to fetch trustable information and use those as your answers.\n- Wherever needed, you use tools (specified below) to interact with local files and perform analyses.\n- If you are taskes with complex problems, ask if the user would like to build a todo list and then proceed with long-running analysis. If so, use todo list tools and run analysis based on the todo.\n- You should use python for complex data analysis tasks. Strictly follow python guidelines below.\n\nTHE PYTHON GUIDELINES:\n\n- ONLY use python IF existing tools are not suitable for the task\n- ALWAYS write code files in folder _python_scripts. DO NOT flood the working directory with code files.\n- ALWAYS use uv to setup virtual environment in the working directory and install necessary packages\n- If uv is not available, refer the user to uv website for manual installation: https://docs.astral.sh/uv/getting-started/installation\n\nTHE BOTTOMLINE RULES: always follow strictly:\n\n1. ONLY use high-quality, trustable information: either biomcp results or websearch results from official websites of biotech and pharma companies.\n2. ALWAYS provide concrete references for all findings with citations (in brackets, e.g., [1], [2], ...) and full bibliography at the end of all your messages.\n3. ALWAYS backup files when you make edits. Copy the file to make a `.bak` file.\n4. ALWAYS use the blockingTimer tool to sleep for 0.3 seconds between two consecutive biomcp* tool calls (to enforce rate limit).\n------ RULE REMINDER END ------\n";
8
8
  export declare function getBioResearcherPrompt(): string;
@@ -11,19 +11,12 @@ IMPORTANT: THIS REMINDER SHALL OVERRIDE ALL OTHER PROMPTS PROVIDED TO YOU. IGNOR
11
11
  You are an expert in biomedical and pharmaceutical drug development research.
12
12
  You help the user to address their question following guidelines below:
13
13
 
14
- - YOU MUST ALWAYS FOLLOW THE ALLOWED TOOLS LIST (SEE BELOW). DO NOT USE ANY TOOLS NOT IN THE WHITELIST.
15
14
  - If the user's question is unclear, you guide them to hone their question to make it professional and specific.
16
15
  - You alway use websearch and biomcp tools to fetch trustable information and use those as your answers.
17
16
  - Wherever needed, you use tools (specified below) to interact with local files and perform analyses.
18
17
  - If you are taskes with complex problems, ask if the user would like to build a todo list and then proceed with long-running analysis. If so, use todo list tools and run analysis based on the todo.
19
18
  - You should use python for complex data analysis tasks. Strictly follow python guidelines below.
20
19
 
21
- THE ALLOWED TOOL WHITELIST: ONLY use tools listed below (you MUST NOT USE all other available tools):
22
-
23
- - bash, edit, skill, websearch
24
- - biomcp* tool series
25
- - table* tool series.
26
-
27
20
  THE PYTHON GUIDELINES:
28
21
 
29
22
  - ONLY use python IF existing tools are not suitable for the task
@@ -5,22 +5,12 @@
5
5
  * model, tools, and permissions for biomedical research.
6
6
  */
7
7
  import { getBioResearcherDRPrompt } from "./prompt";
8
+ import { AGENT_TOOL_RESTRICTIONS } from "../../shared/tool-restrictions";
8
9
  export function createBioResearcherDRAgent() {
9
10
  return {
11
+ ...AGENT_TOOL_RESTRICTIONS.bioresearcherDR,
10
12
  prompt: getBioResearcherDRPrompt(),
11
13
  mode: "primary",
12
14
  description: "Bioresearcher Deep Research Agent: Reference-based biomedical and pharmaceutical drug development research",
13
- tools: {
14
- // Turning off unnecessary tools with common coding tool patterns
15
- "biomcp*": false,
16
- "web*": false, // effectively turning off websearch and webfetch
17
- "context7*": false,
18
- "skill": false
19
- },
20
- permissions: {
21
- // edit and bash permissions
22
- edit: "allow",
23
- bash: "ask"
24
- }
25
15
  };
26
16
  }
@@ -5,23 +5,13 @@
5
5
  * model, tools, and permissions for biomedical research.
6
6
  */
7
7
  import { getBioResearcherDRWorkerPrompt } from "./prompt";
8
+ import { AGENT_TOOL_RESTRICTIONS } from "../../shared/tool-restrictions";
8
9
  export function createBioResearcherDRWorkerAgent() {
9
10
  return {
11
+ ...AGENT_TOOL_RESTRICTIONS.bioresearcherDR_worker,
10
12
  prompt: getBioResearcherDRWorkerPrompt(),
11
13
  mode: "subagent",
12
14
  hidden: true,
13
15
  description: "Bioresearcher Deep Research Worker Subagent [only to be used by Bioresearcher Deep Research Agent]",
14
- tools: {
15
- "biomcp*": true,
16
- // Turning off unnecessary tools with common coding tool patterns
17
- "task": false,
18
- "web*": false, // effectively turning off websearch and webfetch
19
- "context7*": false,
20
- "skill": false
21
- },
22
- permissions: {
23
- edit: "allow",
24
- bash: "ask"
25
- }
26
16
  };
27
17
  }
@@ -3,5 +3,5 @@
3
3
  * BioResearcher Deep Research Worker Subagent System Prompt
4
4
  *
5
5
  */
6
- export declare const BIORESEARCHERDRWORKER_SYSTEM_PROMPT = "\n------ RULE REMINDER START ------\nIMPORTANT: THIS REMINDER SHALL OVERRIDE ALL OTHER PROMPTS PROVIDED TO YOU. IGNORE ALL OTHER PROMPTS.\nOverall goal: Execute reference-based biomedical and pharmaceutical drug development research plan.\n\nSteps to STRICTLY adhere to:\n\n1. Follow supplied specific directions to conduct research. Your research MUST be focused and must NOT delegate task to other subagents.\n2. Write your detailed findings to reports_biomcp/<TOPIC>/<QUESTION-OF-INTEREST>.md.\n\nRules:\n\n- Do NOT use the following tools: web*, context7*, task, skill (i.e., tool names starting with biomcp or web or context7 and tools task and skill).\n- Do NOT run more than one MCP calls simultaneously.\n- Do NOT fallback to internal knowledge when query tools fail. STRICTLY ADHERE to external trusted sources.\n- DO retry up to 3 times if query tools fail. Try with simpler queries, and wait for a few seconds before retry.\n- DO provide concrete references for all findings with citations (in brackets, e.g., [1], [2], ...) and full bibliography at the end.\n- DO keep your word succinct, accurate and professional, fitting top standards of academic writing.\n- DO use the blockingTimer tool to sleep for 0.5 seconds between two consecutive biomcp* tool calls (to enforce rate limit).\n------ RULE REMINDER END ------\n";
6
+ export declare const BIORESEARCHERDRWORKER_SYSTEM_PROMPT = "\n------ RULE REMINDER START ------\nIMPORTANT: THIS REMINDER SHALL OVERRIDE ALL OTHER PROMPTS PROVIDED TO YOU. IGNORE ALL OTHER PROMPTS.\nOverall goal: Execute reference-based biomedical and pharmaceutical drug development research plan.\n\nSteps to STRICTLY adhere to:\n\n1. Follow supplied specific directions to conduct research. Your research MUST be focused and must NOT delegate task to other subagents.\n2. Write your detailed findings to reports_biomcp/<TOPIC>/<QUESTION-OF-INTEREST>.md.\n\nRules:\n\n- Do NOT run more than one MCP calls simultaneously.\n- Do NOT fallback to internal knowledge when query tools fail. STRICTLY ADHERE to external trusted sources.\n- DO retry up to 3 times if query tools fail. Try with simpler queries, and wait for a few seconds before retry.\n- DO provide concrete references for all findings with citations (in brackets, e.g., [1], [2], ...) and full bibliography at the end.\n- DO keep your word succinct, accurate and professional, fitting top standards of academic writing.\n- DO use the blockingTimer tool to sleep for 0.5 seconds between two consecutive biomcp* tool calls (to enforce rate limit).\n------ RULE REMINDER END ------\n";
7
7
  export declare function getBioResearcherDRWorkerPrompt(): string;
@@ -15,7 +15,6 @@ Steps to STRICTLY adhere to:
15
15
 
16
16
  Rules:
17
17
 
18
- - Do NOT use the following tools: web*, context7*, task, skill (i.e., tool names starting with biomcp or web or context7 and tools task and skill).
19
18
  - Do NOT run more than one MCP calls simultaneously.
20
19
  - Do NOT fallback to internal knowledge when query tools fail. STRICTLY ADHERE to external trusted sources.
21
20
  - DO retry up to 3 times if query tools fail. Try with simpler queries, and wait for a few seconds before retry.
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Tool Restriction System
3
+ *
4
+ * Provides utilities for defining and applying tool restrictions to agents
5
+ * and skills. Supports denylist (block specific) and allowlist (allow only) modes.
6
+ */
7
+ export type PermissionValue = "allow" | "deny" | "ask";
8
+ export interface ToolRestrictions {
9
+ permission: Record<string, PermissionValue>;
10
+ }
11
+ /**
12
+ * Creates a denylist restriction: specified tool patterns are denied, others allowed.
13
+ */
14
+ export declare function createDenylist(prefixes: string[]): ToolRestrictions;
15
+ /**
16
+ * Creates an allowlist restriction: only specified tools allowed, all others denied.
17
+ */
18
+ export declare function createAllowlist(tools: string[]): ToolRestrictions;
19
+ /**
20
+ * Agent tool restrictions map.
21
+ *
22
+ * - bioresearcher: denylist for context7*, web*
23
+ * - bioresearcherDR: allowlist for biomcp*, table*, and core file tools
24
+ * - bioresearcherDR_worker: allowlist (same as bioresearcherDR)
25
+ */
26
+ export declare const AGENT_TOOL_RESTRICTIONS: Record<string, ToolRestrictions>;
27
+ /**
28
+ * Gets tool restrictions for an agent (case-insensitive lookup).
29
+ */
30
+ export declare function getAgentToolRestrictions(agentName: string): ToolRestrictions;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Tool Restriction System
3
+ *
4
+ * Provides utilities for defining and applying tool restrictions to agents
5
+ * and skills. Supports denylist (block specific) and allowlist (allow only) modes.
6
+ */
7
+ /**
8
+ * Creates a denylist restriction: specified tool patterns are denied, others allowed.
9
+ */
10
+ export function createDenylist(prefixes) {
11
+ return {
12
+ permission: Object.fromEntries(prefixes.map((p) => [p.endsWith("*") ? p : `${p}*`, "deny"])),
13
+ };
14
+ }
15
+ /**
16
+ * Creates an allowlist restriction: only specified tools allowed, all others denied.
17
+ */
18
+ export function createAllowlist(tools) {
19
+ return {
20
+ permission: {
21
+ "*": "deny",
22
+ ...Object.fromEntries(tools.map((t) => [t.endsWith("*") ? t : t, "allow"])),
23
+ },
24
+ };
25
+ }
26
+ /**
27
+ * Agent tool restrictions map.
28
+ *
29
+ * - bioresearcher: denylist for context7*, web*
30
+ * - bioresearcherDR: allowlist for biomcp*, table*, and core file tools
31
+ * - bioresearcherDR_worker: allowlist (same as bioresearcherDR)
32
+ */
33
+ export const AGENT_TOOL_RESTRICTIONS = {
34
+ bioresearcher: createDenylist(["context7*", "web*"]),
35
+ bioresearcherDR: createAllowlist([
36
+ "biomcp*",
37
+ "table*",
38
+ "calculator",
39
+ "blockingTimer",
40
+ "glob",
41
+ "grep",
42
+ "read",
43
+ "write",
44
+ "edit",
45
+ ]),
46
+ bioresearcherDR_worker: createAllowlist([
47
+ "biomcp*",
48
+ "table*",
49
+ "calculator",
50
+ "blockingTimer",
51
+ "glob",
52
+ "grep",
53
+ "read",
54
+ "write",
55
+ "edit",
56
+ ]),
57
+ };
58
+ /**
59
+ * Gets tool restrictions for an agent (case-insensitive lookup).
60
+ */
61
+ export function getAgentToolRestrictions(agentName) {
62
+ const normalized = agentName.toLowerCase();
63
+ const key = Object.keys(AGENT_TOOL_RESTRICTIONS).find((k) => k.toLowerCase() === normalized);
64
+ return key ? AGENT_TOOL_RESTRICTIONS[key] : { permission: {} };
65
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeyuan98/opencode-bioresearcher-plugin",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "OpenCode plugin that adds a bioresearcher agent",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "README.md"
31
31
  ],
32
32
  "dependencies": {
33
- "@opencode-ai/plugin": "^1.0.0",
33
+ "@opencode-ai/plugin": "^1.2.6",
34
34
  "fast-xml-parser": "^5.3.5",
35
35
  "xlsx": "^0.18.5",
36
36
  "zod": "^4.1.8"