소스 검색

tweak: whitelist

Aiden Cline 11 달 전
부모
커밋
0a2fffa9b5
1개의 변경된 파일과 3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      packages/opencode/src/tool/read.ts

+ 3 - 3
packages/opencode/src/tool/read.ts

@@ -49,14 +49,14 @@ export const ReadTool = Tool.define("read", {
       }
     }
 
-    const block = (() => {
-      const whitelist = [".env.example", ".env.sample"]
+    const block = iife(() => {
+      const whitelist = [".env.sample", ".example"]
 
       if (whitelist.some((w) => filepath.endsWith(w))) return false
       if (filepath.includes(".env")) return true
 
       return false
-    })()
+    })
 
     if (block) {
       throw new Error(`The user has blocked you from reading ${filepath}, DO NOT make further attempts to read it`)