@yeyuan98/opencode-bioresearcher-plugin 1.2.3 → 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.
@@ -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.3",
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"