瀏覽代碼

fix(mcp): hide denied resource template tool (#33686)

Aiden Cline 2 月之前
父節點
當前提交
116ac93ddb
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/opencode/src/permission/index.ts

+ 1 - 1
packages/opencode/src/permission/index.ts

@@ -214,7 +214,7 @@ export function merge(...rulesets: PermissionV1.Ruleset[]): PermissionV1.Rule[]
 
 
 export function disabled(tools: string[], ruleset: PermissionV1.Ruleset): Set<string> {
 export function disabled(tools: string[], ruleset: PermissionV1.Ruleset): Set<string> {
   const edits = ["edit", "write", "apply_patch"]
   const edits = ["edit", "write", "apply_patch"]
-  const reads = ["list_mcp_resources", "read_mcp_resource"]
+  const reads = ["list_mcp_resources", "list_mcp_resource_templates", "read_mcp_resource"]
   return new Set(
   return new Set(
     tools.filter((tool) => {
     tools.filter((tool) => {
       const permission = edits.includes(tool) ? "edit" : reads.includes(tool) ? "read" : tool
       const permission = edits.includes(tool) ? "edit" : reads.includes(tool) ? "read" : tool