SandboxState
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") public abstract class SandboxState
io/agentscope/harness/agent/sandbox/SandboxState.java:34–85沙箱状态,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.agent.sandbox 包。核心成员包括 getSessionId、setSessionId、getWorkspaceSpec、setWorkspaceSpec、getSnapshot、setSnapshot。
Serializable state of a sandbox, persisted by SessionSandboxStateStore so a sandbox can
be resumed across calls.
The #workspaceRootReady flag drives the 4-branch start logic: it records whether
the workspace was fully initialized at the last stop.
Concrete subtypes are registered for Jackson via io.agentscope.harness.agent.sandbox.json.HarnessSandboxJacksonModule (and optional com.fasterxml.jackson.databind.ObjectMapper#registerSubtypes for extension types), not via
@JsonSubTypes on this class.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String getSessionId() | 获取会话标识。 Returns the session id. |
public void setSessionId(String sessionId) | 设置会话标识。 Sets the session id. |
public WorkspaceSpec getWorkspaceSpec() | 获取工作区规格。 Returns the workspace spec. |
public void setWorkspaceSpec(WorkspaceSpec workspaceSpec) | 设置工作区规格。 Sets the workspace spec. |
public SandboxSnapshot getSnapshot() | 获取快照。 Returns the snapshot. |
public void setSnapshot(SandboxSnapshot snapshot) | 设置快照。 Sets the snapshot. |
public String getWorkspaceProjectionHash() | 获取 `getWorkspaceProjectionHash`。 Returns the workspace projection hash. |
public void setWorkspaceProjectionHash(String workspaceProjectionHash) | 设置 `setWorkspaceProjectionHash`。 Sets the workspace projection hash. |
public boolean isWorkspaceRootReady() | 判断是否工作区根就绪。 Returns whether the workspace root ready. |
public void setWorkspaceRootReady(boolean workspaceRootReady) | 设置工作区根就绪。 Sets the workspace root ready. |
方法详情Method Detail
getSessionId
public String getSessionId()
获取会话标识。
Returns the session id.
Stringio/agentscope/harness/agent/sandbox/SandboxState.java:46–48setSessionId
public void setSessionId(String sessionId)
设置会话标识。
Sets the session id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
io/agentscope/harness/agent/sandbox/SandboxState.java:50–52getWorkspaceSpec
public WorkspaceSpec getWorkspaceSpec()
获取工作区规格。
Returns the workspace spec.
WorkspaceSpecio/agentscope/harness/agent/sandbox/SandboxState.java:54–56setWorkspaceSpec
public void setWorkspaceSpec(WorkspaceSpec workspaceSpec)
设置工作区规格。
Sets the workspace spec.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspaceSpec | WorkspaceSpec | 工作区规格(类型 `WorkspaceSpec`)。The workspace spec. |
io/agentscope/harness/agent/sandbox/SandboxState.java:58–60getSnapshot
public SandboxSnapshot getSnapshot()
获取快照。
Returns the snapshot.
SandboxSnapshotio/agentscope/harness/agent/sandbox/SandboxState.java:62–64setSnapshot
public void setSnapshot(SandboxSnapshot snapshot)
设置快照。
Sets the snapshot.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
snapshot | SandboxSnapshot | 快照(类型 `SandboxSnapshot`)。The snapshot. |
io/agentscope/harness/agent/sandbox/SandboxState.java:66–68getWorkspaceProjectionHash
public String getWorkspaceProjectionHash()
获取 getWorkspaceProjectionHash。
Returns the workspace projection hash.
Stringio/agentscope/harness/agent/sandbox/SandboxState.java:70–72setWorkspaceProjectionHash
public void setWorkspaceProjectionHash(String workspaceProjectionHash)
设置 setWorkspaceProjectionHash。
Sets the workspace projection hash.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspaceProjectionHash | String | 工作区 Projection Hash(类型 `String`)。The workspace projection hash. |
io/agentscope/harness/agent/sandbox/SandboxState.java:74–76isWorkspaceRootReady
public boolean isWorkspaceRootReady()
判断是否工作区根就绪。
Returns whether the workspace root ready.
booleanio/agentscope/harness/agent/sandbox/SandboxState.java:78–80setWorkspaceRootReady
public void setWorkspaceRootReady(boolean workspaceRootReady)
设置工作区根就绪。
Sets the workspace root ready.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspaceRootReady | boolean | 工作区根就绪(类型 `boolean`)。The workspace root ready. |
io/agentscope/harness/agent/sandbox/SandboxState.java:82–84