PermissionContextState
@JsonPropertyOrder({"mode", "working_directories", "allow_rules", "deny_rules", "ask_rules"}) public final class PermissionContextState
io/agentscope/core/permission/PermissionContextState.java:36–249权限上下文状态,驱动智能体的推理、工具调用与会话执行。位于 io.agentscope.core.permission 包。核心成员包括 getMode、isTrivial、getWorkingDirectories、getAllowRules、getDenyRules、getAskRules。
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.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
Builder | 类class | 构建器,用于构建并配置目标实例。 A class in io.agentscope.core.permission that drives agent reasoning, tool calls and conversation execution. |
方法摘要Method Summary
方法详情Method Detail
getMode
public PermissionMode getMode()
获取模式。
Returns the mode.
PermissionModeio/agentscope/core/permission/PermissionContextState.java:95–98isTrivial
public boolean isTrivial()
判断是否 isTrivial。
Whether this context is "trivial" — built from Builder#build() with no further customisation.
booleanio/agentscope/core/permission/PermissionContextState.java:106–113getWorkingDirectories
public Map<String, AdditionalWorkingDirectory> getWorkingDirectories()
获取 getWorkingDirectories。
Returns the working directories.
Map<String, AdditionalWorkingDirectory>io/agentscope/core/permission/PermissionContextState.java:115–118getAllowRules
public Map<String, List<PermissionRule>> getAllowRules()
获取 getAllowRules。
Returns the allow rules.
Map<String, List<PermissionRule>>io/agentscope/core/permission/PermissionContextState.java:120–123getDenyRules
public Map<String, List<PermissionRule>> getDenyRules()
获取拒绝规则。
Returns the deny rules.
Map<String, List<PermissionRule>>io/agentscope/core/permission/PermissionContextState.java:125–128getAskRules
public Map<String, List<PermissionRule>> getAskRules()
获取 getAskRules。
Returns the ask rules.
Map<String, List<PermissionRule>>io/agentscope/core/permission/PermissionContextState.java:130–133builder
public static Builder builder()
返回构建器实例。
Returns the builder.
Builderio/agentscope/core/permission/PermissionContextState.java:135–137withMode
public PermissionContextState withMode(PermissionMode newMode)
执行使用模式相关操作。
Returns a copy of this context with the PermissionMode replaced and every working directory and rule preserved.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
newMode | PermissionMode | 新建模式(类型 `PermissionMode`)。the mode the returned context should use |
PermissionContextStateio/agentscope/core/permission/PermissionContextState.java:148–159equals
public boolean equals(Object o)
设置该参数。
Performs the equals operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
o | Object | o(类型 `Object`)。The o. |
booleanio/agentscope/core/permission/PermissionContextState.java:161–174hashCode
public int hashCode()
返回 hashCode 结果。
Returns the hash code.
intio/agentscope/core/permission/PermissionContextState.java:176–179toString
public String toString()
返回 toString 结果。
Returns the to string.
Stringio/agentscope/core/permission/PermissionContextState.java:181–194嵌套类详情Nested Class Detail
Builder
public static final class Builder构建器,用于构建并配置目标实例。位于 io.agentscope.core.permission 包。核心成员包括 mode、addWorkingDirectory、addAllowRule、addDenyRule、addAskRule、build。
A class in io.agentscope.core.permission that drives agent reasoning, tool calls and conversation execution. Declared in io.agentscope.core.permission.