AgentScopeContractController
@RestController @RequestMapping("/agentscope") public class AgentScopeContractController
io/agentscope/builder/web/api/AgentScopeContractController.java:54–471AgentScope 契约控制器,承载智能体的部署、调度与服务化运行。位于 io.agentscope.builder.web.api 包。核心成员包括 info、health、sessions、compress、terminate、context。
aistio data-plane HTTP contract (/agentscope/*). Public so the control-plane poller can
probe without a console JWT. Session rows come from the control plane; transcripts from the local
event log.
构造器摘要Constructor Summary
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Map<String, Object> info() | 返回信息。 Level-1 metadata for discovery / registry aggregation. |
public Map<String, String> health() | 返回健康状态。 Level-1 health probe. |
public Map<String, Object> sessions() | 返回会话。 Level-2 session snapshots for the aistiod poller. |
public Map<String, String> compress(String id) | 设置压缩。 Level-3 compress command (best-effort; no harness compact API yet). |
public Map<String, String> terminate(String id) | 设置该参数。 Level-3 terminate command. |
public Map<String, Object> context(String id) | 设置上下文。 Level-4 effective context exported from the event log + agent snapshot. |
public Map<String, Object> messages(String id, int offset, int limit) | 执行消息相关操作。 Level-3 paginated full-history messages from the event log. |
构造器详情Constructor Detail
AgentScopeContractController
public AgentScopeContractController(ControlPlaneClient controlPlaneClient, DataSessionService sessionService, SessionEventLog eventLog, SessionEventEntityRepository eventRepository, ManagedJsonHelper jsonHelper, int serverPort, String agentName, String version)
初始化 AgentScopeContractController 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
controlPlaneClient | ControlPlaneClient | 控制面客户端(类型 `ControlPlaneClient`)。The control plane client. |
sessionService | DataSessionService | 会话服务(类型 `DataSessionService`)。The session service. |
eventLog | SessionEventLog | 事件日志(类型 `SessionEventLog`)。The event log. |
eventRepository | SessionEventEntityRepository | 事件仓库(类型 `SessionEventEntityRepository`)。The event repository. |
jsonHelper | ManagedJsonHelper | JSON Helper(类型 `ManagedJsonHelper`)。The json helper. |
serverPort | int | 服务端 Port(类型 `int`)。The server port. |
agentName | String | 智能体名称(类型 `String`)。The agent name. |
version | String | 版本(类型 `String`)。The version. |
io/agentscope/builder/web/api/AgentScopeContractController.java:93–110方法详情Method Detail
info
public Map<String, Object> info()
返回信息。
Level-1 metadata for discovery / registry aggregation.
Map<String, Object>io/agentscope/builder/web/api/AgentScopeContractController.java:113–123health
public Map<String, String> health()
返回健康状态。
Level-1 health probe.
Map<String, String>io/agentscope/builder/web/api/AgentScopeContractController.java:126–129sessions
public Map<String, Object> sessions()
返回会话。
Level-2 session snapshots for the aistiod poller.
Map<String, Object>io/agentscope/builder/web/api/AgentScopeContractController.java:132–152compress
public Map<String, String> compress(String id)
设置压缩。
Level-3 compress command (best-effort; no harness compact API yet).
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
Map<String, String>io/agentscope/builder/web/api/AgentScopeContractController.java:155–168terminate
public Map<String, String> terminate(String id)
设置该参数。
Level-3 terminate command.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
Map<String, String>io/agentscope/builder/web/api/AgentScopeContractController.java:171–178context
public Map<String, Object> context(String id)
设置上下文。
Level-4 effective context exported from the event log + agent snapshot.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
Map<String, Object>io/agentscope/builder/web/api/AgentScopeContractController.java:181–210messages
public Map<String, Object> messages(String id, int offset, int limit)
执行消息相关操作。
Level-3 paginated full-history messages from the event log.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
offset | int | 偏移量(类型 `int`)。The offset. |
limit | int | 数量上限(类型 `int`)。The limit. |
Map<String, Object>io/agentscope/builder/web/api/AgentScopeContractController.java:213–241