PlanModeContextState
@JsonPropertyOrder({"plan_active", "current_plan_file"}) public final class PlanModeContextState
io/agentscope/core/state/PlanModeContextState.java:36–97计划模式上下文状态,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.core.state 包。核心成员包括 isPlanActive、setPlanActive、getCurrentPlanFile、setCurrentPlanFile、equals、hashCode。
Persisted plan-mode flag for an agent.
Plan mode is a read-only "design first" phase: while #planActive is true, the
PlanModeMiddleware denies mutating tool calls so the agent can investigate and draft a
plan without changing anything. #currentPlanFile is the workspace-relative path of the
markdown blueprint the agent is editing (if any).
This lives inside AgentState (rather than in volatile in-process memory) precisely
because agentscope agents are distributed and resumable: a plan-mode session must survive process
restarts and hand-offs across nodes. Toggling the flag and persisting the AgentState is
therefore the canonical way to switch modes dynamically at runtime.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public PlanModeContextState() | 初始化 `PlanModeContextState` 实例。 Creates a new instance. |
public PlanModeContextState(boolean planActive, String currentPlanFile) | 初始化 `PlanModeContextState` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public boolean isPlanActive() | 判断是否 `isPlanActive`。 Returns whether the plan active. |
public void setPlanActive(boolean planActive) | 设置 `setPlanActive`。 Sets the plan active. |
public String getCurrentPlanFile() | 获取当前计划文件。 Returns the current plan file. |
public void setCurrentPlanFile(String currentPlanFile) | 设置当前计划文件。 Sets the current plan file. |
public boolean equals(Object o) | 设置该参数。 Performs the equals operation. |
public int hashCode() | 返回 `hashCode` 结果。 Returns the hash code. |
public String toString() | 返回 `toString` 结果。 Returns the to string. |
构造器详情Constructor Detail
PlanModeContextState
public PlanModeContextState()
初始化 PlanModeContextState 实例。
Creates a new instance.
io/agentscope/core/state/PlanModeContextState.java:42–44PlanModeContextState
public PlanModeContextState(boolean planActive, String currentPlanFile)
初始化 PlanModeContextState 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
planActive | boolean | 计划 Active(类型 `boolean`)。The plan active. |
currentPlanFile | String | 当前计划文件(类型 `String`)。The current plan file. |
io/agentscope/core/state/PlanModeContextState.java:46–52方法详情Method Detail
isPlanActive
public boolean isPlanActive()
判断是否 isPlanActive。
Returns whether the plan active.
booleanio/agentscope/core/state/PlanModeContextState.java:54–57setPlanActive
public void setPlanActive(boolean planActive)
设置 setPlanActive。
Sets the plan active.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
planActive | boolean | 计划 Active(类型 `boolean`)。The plan active. |
io/agentscope/core/state/PlanModeContextState.java:59–61getCurrentPlanFile
public String getCurrentPlanFile()
获取当前计划文件。
Returns the current plan file.
Stringio/agentscope/core/state/PlanModeContextState.java:63–66setCurrentPlanFile
public void setCurrentPlanFile(String currentPlanFile)
设置当前计划文件。
Sets the current plan file.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
currentPlanFile | String | 当前计划文件(类型 `String`)。The current plan file. |
io/agentscope/core/state/PlanModeContextState.java:68–70equals
public boolean equals(Object o)
设置该参数。
Performs the equals operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
o | Object | o(类型 `Object`)。The o. |
booleanio/agentscope/core/state/PlanModeContextState.java:72–82hashCode
public int hashCode()
返回 hashCode 结果。
Returns the hash code.
intio/agentscope/core/state/PlanModeContextState.java:84–87toString
public String toString()
返回 toString 结果。
Returns the to string.
Stringio/agentscope/core/state/PlanModeContextState.java:89–96