Class AgentScopeAdapter

java.lang.Object
io.agentscope.extensions.aistio.adapter.AgentScopeAdapter
All Implemented Interfaces:
FrameworkAdapter

public final class AgentScopeAdapter extends Object implements FrameworkAdapter
Bypass-observation adapter for a self-deployed AgentScope Java agent.

This is the BYO path: the user writes and runs their own agent, and aistio observes it from the side. It is unrelated to managed-agents mode, where the data plane service implements the /agentscope/* contract directly because it owns the runtime.

Observation rides on AistioObserverMiddleware, which passes every input and event through untouched. Context and history are read from AgentState, which is the same buffer the agent will hand to its next model call, so what the console shows is what the model sees.

Middlewares are fixed when a ReActAgent is built, so the event stream requires registering middleware() at build time:


 AgentScopeAdapter adapter = new AgentScopeAdapter();
 ReActAgent agent = ReActAgent.builder()
         .middleware(adapter.middleware())
         .build();
 SessionBridge bridge = Aistio.instrument(agent, config, adapter);
 

An already-built agent can still be instrumented — snapshots, context, history and commands all read live state — but it produces no Level-2 events.