mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
tweak: whitelist
This commit is contained in:
parent
bdfa213ccf
commit
0a2fffa9b5
1 changed files with 3 additions and 3 deletions
|
|
@ -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`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue