类 PermissionContextState
java.lang.Object
io.agentscope.core.permission.PermissionContextState
Permission evaluation context: mode + working directories + three rule tables.
Rule tables are keyed by tool name; each value is the ordered list of rules registered for
that tool. The engine evaluates denyRules first, then askRules, then tool
self-check, then allowRules; see the PermissionEngine javadoc for full ordering.
-
嵌套类概要
嵌套类 -
方法概要
修饰符和类型方法说明builder()booleangetMode()inthashCode()booleanWhether this context is "trivial" — built fromPermissionContextState.Builder.build()with no further customisation.toString()withMode(PermissionMode newMode) Returns a copy of this context with thePermissionModereplaced and every working directory and rule preserved.
-
方法详细资料
-
getMode
-
isTrivial
public boolean isTrivial()Whether this context is "trivial" — built fromPermissionContextState.Builder.build()with no further customisation. Used by ReAct agents to decide whether to engage the full permission engine (rules + mode + tool self-check) or fall back to the lightweight, pre-2.0 path that only gates on the tool's owncheckPermissionsself-check. -
getWorkingDirectories
-
getAllowRules
-
getDenyRules
-
getAskRules
-
builder
-
withMode
Returns a copy of this context with thePermissionModereplaced and every working directory and rule preserved. Used to switch the evaluation mode at runtime (e.g. flipping a session intoPermissionMode.BYPASS) without losing the configured rules.- 参数:
newMode- the mode the returned context should use- 返回:
- a new context identical to this one except for its mode (returns
thiswhen the mode is unchanged)
-
equals
-
hashCode
public int hashCode() -
toString
-