SessionOperations
public final class SessionOperations
io/agentscope/spring/boot/admin/service/SessionOperations.java:50–450会话 Operations,承载智能体的部署、调度与服务化运行。位于 io.agentscope.spring.boot.admin.service 包。核心成员包括 listSessions、listMessages、exportMarkdown、dumpStateJson、abort、compact。
Business logic for the per-session data-plane admin actions.
Designed so that the REST controller is a thin shell: it parses the request, defers to one
method here, and serializes the result. All blocking I/O (AgentStateStore reads, JSON serialization) is
pushed off the request thread via Schedulers#boundedElastic().
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
UndoResult | 记录record | 承载 Undo 结果数据的记录类型。 Outcome of an undo/redo invocation. |
构造器摘要Constructor Summary
方法摘要Method Summary
构造器详情Constructor Detail
SessionOperations
public SessionOperations(AgentRegistry registry, SummarizationStrategy summarizer, AdminProperties properties, SnapshotStore snapshots)
初始化 SessionOperations 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
registry | AgentRegistry | 注册表(类型 `AgentRegistry`)。The registry. |
summarizer | SummarizationStrategy | summarizer(类型 `SummarizationStrategy`)。The summarizer. |
properties | AdminProperties | 属性(类型 `AdminProperties`)。The properties. |
snapshots | SnapshotStore | snapshots(类型 `SnapshotStore`)。The snapshots. |
io/agentscope/spring/boot/admin/service/SessionOperations.java:57–66方法详情Method Detail
listSessions
public Mono<List<String>> listSessions(AgentStateStore stateStore)
列出会话。
Read-only listing of known session ids from AgentStateStore#listSessionIds(String).
| 名称Name | 类型Type | 说明Description |
|---|---|---|
stateStore | AgentStateStore | 状态存储(类型 `AgentStateStore`)。The state store. |
Mono<List<String>>io/agentscope/spring/boot/admin/service/SessionOperations.java:69–84listMessages
public Mono<List<MessageView>> listMessages(String agentIdOrSessionId)
列出消息。
Return the in-memory message list of a registered agent.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentIdOrSessionId | String | 智能体标识或会话标识(类型 `String`)。The agent id or session id. |
Mono<List<MessageView>>io/agentscope/spring/boot/admin/service/SessionOperations.java:87–98exportMarkdown
public Mono<String> exportMarkdown(String agentIdOrSessionId)
设置该参数。
Render the conversation as a Markdown transcript.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentIdOrSessionId | String | 智能体标识或会话标识(类型 `String`)。The agent id or session id. |
Mono<String>io/agentscope/spring/boot/admin/service/SessionOperations.java:101–136dumpStateJson
public Mono<String> dumpStateJson(String agentIdOrSessionId)
设置该参数。
Dump the full AgentState JSON for a session.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentIdOrSessionId | String | 智能体标识或会话标识(类型 `String`)。The agent id or session id. |
Mono<String>io/agentscope/spring/boot/admin/service/SessionOperations.java:139–141abort
public Mono<Void> abort(String agentIdOrSessionId)
设置中止。
Cooperatively interrupt the agent.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentIdOrSessionId | String | 智能体标识或会话标识(类型 `String`)。The agent id or session id. |
Mono<Void>io/agentscope/spring/boot/admin/service/SessionOperations.java:144–146compact
public Mono<CompactResponse> compact(String agentIdOrSessionId, CompactRequest request)
执行 compact 方法。
Compact a session: summarize the older portion of the context, truncate to the last keepLast messages, and persist via the agent's AgentStateStore.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentIdOrSessionId | String | 智能体标识或会话标识(类型 `String`)。The agent id or session id. |
request | CompactRequest | 请求(类型 `CompactRequest`)。The request. |
Mono<CompactResponse>io/agentscope/spring/boot/admin/service/SessionOperations.java:155–215undo
public Mono<UndoResult> undo(String agentIdOrSessionId)
设置该参数。
Restore the agent's state to the snapshot stored before the most recent mutation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentIdOrSessionId | String | 智能体标识或会话标识(类型 `String`)。The agent id or session id. |
Mono<UndoResult>io/agentscope/spring/boot/admin/service/SessionOperations.java:221–245redo
public Mono<UndoResult> redo(String agentIdOrSessionId)
设置该参数。
Reverse a previous #undo(String).
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentIdOrSessionId | String | 智能体标识或会话标识(类型 `String`)。The agent id or session id. |
Mono<UndoResult>io/agentscope/spring/boot/admin/service/SessionOperations.java:248–272planState
public Mono<PlanModeView> planState(String agentIdOrSessionId)
设置计划状态。
Read the current plan-mode state of a session.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentIdOrSessionId | String | 智能体标识或会话标识(类型 `String`)。The agent id or session id. |
Mono<PlanModeView>io/agentscope/spring/boot/admin/service/SessionOperations.java:285–293enterPlanMode
public Mono<PlanModeView> enterPlanMode(String agentIdOrSessionId)
设置该参数。
Switch the agent into plan mode.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentIdOrSessionId | String | 智能体标识或会话标识(类型 `String`)。The agent id or session id. |
Mono<PlanModeView>io/agentscope/spring/boot/admin/service/SessionOperations.java:301–320exitPlanMode
public Mono<PlanModeView> exitPlanMode(String agentIdOrSessionId)
设置该参数。
Exit plan mode.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentIdOrSessionId | String | 智能体标识或会话标识(类型 `String`)。The agent id or session id. |
Mono<PlanModeView>io/agentscope/spring/boot/admin/service/SessionOperations.java:323–341listAgentTasks
public Mono<List<AgentTaskView>> listAgentTasks(String agentIdOrSessionId)
列出智能体任务。
List the per-io.agentscope.core.state.AgentState task records of a session.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
agentIdOrSessionId | String | 智能体标识或会话标识(类型 `String`)。The agent id or session id. |
Mono<List<AgentTaskView>>io/agentscope/spring/boot/admin/service/SessionOperations.java:354–367嵌套类详情Nested Class Detail
UndoResult
public record UndoResult(String sessionId, boolean restored, int undoDepth, int redoDepth)承载 Undo 结果数据的记录类型。位于 io.agentscope.spring.boot.admin.service 包。核心成员包括 sessionId、restored、undoDepth、redoDepth。
Outcome of an undo/redo invocation.