ContractProvider
public interface ContractProvider
io/agentscope/extensions/controlplane/transport/ContractProvider.java:27–111定义契约提供者契约的接口。位于 io.agentscope.extensions.controlplane.transport 包。核心成员包括 info、sessions、sessionState、context、messages、subagents。
Backing data for the /agentscope/* HTTP contract, implemented by the bridge.
Every method returns JSON-serializable maps and lists. Throwing NotFoundException maps
to 404 and UnsupportedOperationException to 501; anything else becomes a 500.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
NotFoundException | 类class | 未找到异常,表示执行过程中的错误。 Signals that the requested session or resource does not exist on this instance. |
BusyException | 类class | Busy 异常,表示执行过程中的错误。 Signals the session is busy and the caller should wait until idle. |
UnauthorizedException | 类class | Unauthorized 异常,表示执行过程中的错误。 Signals a missing or invalid internal token on a write endpoint. |
方法摘要Method Summary
方法详情Method Detail
info
public Map<String, Object> info()
返回信息。
Returns the info.
Map<String, Object>io/agentscope/extensions/controlplane/transport/ContractProvider.java:29sessions
public List<Map<String, Object>> sessions()
返回会话。
Returns the sessions.
List<Map<String, Object>>io/agentscope/extensions/controlplane/transport/ContractProvider.java:31sessionState
public Map<String, Object> sessionState(String sessionId)
设置会话状态。
Performs the session state operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
Map<String, Object>io/agentscope/extensions/controlplane/transport/ContractProvider.java:33context
public Map<String, Object> context(String sessionId)
设置上下文。
Performs the context operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
Map<String, Object>io/agentscope/extensions/controlplane/transport/ContractProvider.java:35messages
public Map<String, Object> messages(String sessionId, int offset, int limit)
执行消息相关操作。
Performs the messages operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
offset | int | 偏移量(类型 `int`)。The offset. |
limit | int | 数量上限(类型 `int`)。The limit. |
Map<String, Object>io/agentscope/extensions/controlplane/transport/ContractProvider.java:37subagents
public List<Map<String, Object>> subagents()
返回 subagents 结果。
Returns the subagents.
List<Map<String, Object>>io/agentscope/extensions/controlplane/transport/ContractProvider.java:39workspaces
public List<Map<String, Object>> workspaces()
返回 workspaces 结果。
Returns the workspaces.
List<Map<String, Object>>io/agentscope/extensions/controlplane/transport/ContractProvider.java:41compress
public void compress(String sessionId)
设置压缩。
Performs the compress operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
io/agentscope/extensions/controlplane/transport/ContractProvider.java:43terminate
public void terminate(String sessionId)
设置该参数。
Performs the terminate operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
io/agentscope/extensions/controlplane/transport/ContractProvider.java:45abort
public void abort(String sessionId)
设置中止。
Aborts the current turn without terminating the session.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
io/agentscope/extensions/controlplane/transport/ContractProvider.java:48tasks
public Map<String, Object> tasks(String sessionId)
设置任务。
Session task inventory.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
Map<String, Object>io/agentscope/extensions/controlplane/transport/ContractProvider.java:54subagentTasks
default public Map<String, Object> subagentTasks(String sessionId)
设置子智能体任务。
Background subagent tasks (not todolist).
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
Map<String, Object>io/agentscope/extensions/controlplane/transport/ContractProvider.java:59–61cancelSubagentTask
default public void cancelSubagentTask(String sessionId, String taskId)
执行取消子智能体任务相关操作。
Cancel a background subagent task.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
taskId | String | 任务标识(类型 `String`)。The task id. |
io/agentscope/extensions/controlplane/transport/ContractProvider.java:64–66planMode
default public void planMode(String sessionId, byte[] body)
执行计划模式相关操作。
Enter/exit plan mode.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
body | byte[] | 正文(类型 `byte[]`)。The body. |
io/agentscope/extensions/controlplane/transport/ContractProvider.java:69–71postMessage
default public void postMessage(String sessionId, byte[] body)
执行后置消息相关操作。
Inject a user message into the live session.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
body | byte[] | 正文(类型 `byte[]`)。The body. |
io/agentscope/extensions/controlplane/transport/ContractProvider.java:77–79exportTranscript
default public Map<String, Object> exportTranscript(String sessionId)
设置该参数。
Optional transcript export.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
Map<String, Object>io/agentscope/extensions/controlplane/transport/ContractProvider.java:82–84sessionPhase
default public String sessionPhase(String sessionId)
设置会话阶段。
Current phase string for command success responses.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
Stringio/agentscope/extensions/controlplane/transport/ContractProvider.java:87–89嵌套类详情Nested Class Detail
NotFoundException
class NotFoundException extends RuntimeException未找到异常,表示执行过程中的错误。位于 io.agentscope.extensions.controlplane.transport 包,继承自 RuntimeException。核心成员包括 NotFoundException。
Signals that the requested session or resource does not exist on this instance.
BusyException
class BusyException extends RuntimeExceptionBusy 异常,表示执行过程中的错误。位于 io.agentscope.extensions.controlplane.transport 包,继承自 RuntimeException。核心成员包括 BusyException。
Signals the session is busy and the caller should wait until idle.
UnauthorizedException
class UnauthorizedException extends RuntimeExceptionUnauthorized 异常,表示执行过程中的错误。位于 io.agentscope.extensions.controlplane.transport 包,继承自 RuntimeException。核心成员包括 UnauthorizedException。
Signals a missing or invalid internal token on a write endpoint.