Package io.agentscope.extensions.aistio
Interface FrameworkAdapter
- All Known Implementing Classes:
AgentScopeAdapter
public interface FrameworkAdapter
One adapter per agent framework, presenting a uniform view of that framework's sessions to
SessionBridge. The Java counterpart of the Python SDK's FrameworkAdapter.
Bypass principle: interception copies data, it never replaces or blocks the framework's own path, and a failed report is swallowed rather than propagated. An instrumented agent must behave exactly as an uninstrumented one.
Optional operations default to failing with UnsupportedOperationException. Declare only
what you actually implement in capabilities() — the control plane gates its UI on that
list, so over-declaring produces buttons that fail.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionvoidattach(Object target, Consumer<SessionEvent> emit) Attaches to the framework object.Effective Definition snapshot forGET /agentscope/info→agentConfig.default reactor.core.publisher.Mono<Void>cancelSubagentTask(String sessionId, String taskId) Cancel one background subagent task.booleanWhether this adapter can instrumenttarget.Capabilities contributed by this adapter.voiddetach()Removes the interception and restores the framework object.reactor.core.publisher.Mono<ContextSnapshot>extractContext(String sessionId) Level 4: the context that the session's next model call will actually see.Framework identifier reported on every snapshot, e.g.default StringFramework version, or an empty string when it cannot be determined.default reactor.core.publisher.Mono<Void>handleAgentTask(AgentTaskAssignment assignment) Materializes a downstream AgentTask delivery as an isolated execution.default reactor.core.publisher.Mono<Void>handleCommand(String sessionId, String command, byte[] params) default reactor.core.publisher.Mono<Void>injectUserMessage(String sessionId, String content) Inject a console/control-plane user message into the live session.default reactor.core.publisher.Mono<MessagePage>listMessages(String sessionId, int offset, int limit) Level 3: full history including messages already compacted away.default reactor.core.publisher.Mono<List<Inventory.SubagentInfo>>listSubagentTasks(String sessionId) Background subagent tasks forGET .../subagent-tasks(not todolist).Session task list forGET .../tasks.default reactor.core.publisher.Mono<List<Inventory.WorkspaceInfo>>default voidonBridgeAttached(SessionBridge bridge) Called once the adapter is mounted, giving it a handle for metadata the event stream cannot carry — system prompt, tool list, context window — viaSessionBridge.describeSession(java.lang.String, java.lang.String, java.util.List<io.agentscope.extensions.aistio.model.ContextSnapshot.ToolInfo>, int).default reactor.core.publisher.Mono<String>runConversationTurn(String sessionId, String content) Run a control-plane conversation turn and return its terminal assistant reply.default reactor.core.publisher.Mono<Void>setPlanMode(String sessionId, byte[] params) Enter or exit plan mode for the session.
-
Field Details
-
CAP_CONTEXT_QUERY
- See Also:
-
CAP_MESSAGE_QUERY
- See Also:
-
CAP_SUBAGENT_INVENTORY
- See Also:
-
CAP_WORKSPACE_INVENTORY
- See Also:
-
CAP_SESSION_COMMAND
- See Also:
-
CAP_SESSION_ABORT
- See Also:
-
CAP_TASK_QUERY
- See Also:
-
CAP_SUBAGENT_TASK_QUERY
- See Also:
-
CAP_SUBAGENT_TASK_COMMAND
- See Also:
-
CAP_PLAN_MODE
- See Also:
-
CAP_AGENT_TASK
- See Also:
-
CAP_EXPORT_TRANSCRIPT
- See Also:
-
CAP_CONVERSATION_INBOUND
- See Also:
-
COMMAND_COMPRESS
- See Also:
-
COMMAND_TERMINATE
- See Also:
-
COMMAND_ABORT
- See Also:
-
-
Method Details
-
frameworkName
String frameworkName()Framework identifier reported on every snapshot, e.g.agentscope-java. -
frameworkVersion
Framework version, or an empty string when it cannot be determined. -
canHandle
Whether this adapter can instrumenttarget. Must be side-effect free. -
attach
Attaches to the framework object. Session activity is published throughemit, which must never be allowed to break the framework's main path. -
detach
void detach()Removes the interception and restores the framework object. -
onBridgeAttached
Called once the adapter is mounted, giving it a handle for metadata the event stream cannot carry — system prompt, tool list, context window — viaSessionBridge.describeSession(java.lang.String, java.lang.String, java.util.List<io.agentscope.extensions.aistio.model.ContextSnapshot.ToolInfo>, int). -
extractContext
Level 4: the context that the session's next model call will actually see. -
listMessages
default reactor.core.publisher.Mono<MessagePage> listMessages(String sessionId, int offset, int limit) Level 3: full history including messages already compacted away. -
listSubagents
-
listWorkspaces
-
listTasks
Session task list forGET .../tasks. Each map follows the frozen Task shape:id,subject,state,owner,blockedBy,updatedAt,frameworkMeta. -
listSubagentTasks
Background subagent tasks forGET .../subagent-tasks(not todolist). Each map is framework-shaped; typical keys:id,status,subject/label. -
cancelSubagentTask
Cancel one background subagent task. Capability:subagent-task-command. -
setPlanMode
Enter or exit plan mode for the session. Capability:plan-mode.paramsis a JSON object with"active": true|false. -
injectUserMessage
Inject a console/control-plane user message into the live session. Must use the framework's official continue-turn API. -
runConversationTurn
Run a control-plane conversation turn and return its terminal assistant reply. Unlike message injection, completion must carry the answer, not just acknowledge input. -
buildAgentConfig
Effective Definition snapshot forGET /agentscope/info→agentConfig. -
handleCommand
-
handleAgentTask
Materializes a downstream AgentTask delivery as an isolated execution. -
capabilities
Capabilities contributed by this adapter. Push-side capabilities (session-reporting,event-reporting,context-reporting) are added by the bridge.
-