mirror of
https://github.com/anomalyco/opencode.git
synced 2026-09-04 10:54:38 +00:00
refactor(core): reuse execute visibility predicate (#45699)
This commit is contained in:
parent
b4bd14864a
commit
792f84b59d
1 changed files with 1 additions and 2 deletions
|
|
@ -211,8 +211,7 @@ const layer = Layer.effect(
|
|||
}
|
||||
const direct = new Map(Array.from(active).filter(([, tool]) => tool.options?.codemode === false))
|
||||
const codemode = new Map(Array.from(active).filter(([, tool]) => tool.options?.codemode !== false))
|
||||
const executeRule = rules.findLast((rule) => Wildcard.match("execute", rule.action))
|
||||
const codemodeEnabled = executeRule?.resource !== "*" || executeRule.effect !== "deny"
|
||||
const codemodeEnabled = !whollyDisabled("execute", rules)
|
||||
const codemodeTool = codemodeEnabled
|
||||
? CodeModeTool.create(codemode, (name, tool, input, context) =>
|
||||
beforeExecute(name, input, context).pipe(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue