Package io.agentscope.extensions.aistio
Class Aistio
java.lang.Object
io.agentscope.extensions.aistio.Aistio
Entry point for reporting a self-deployed agent to the aistio control plane.
Full instrumentation, including the Level-2 event stream, needs the observer middleware
registered while the agent is being built, because a ReActAgent's middleware list is
fixed at construction:
AgentScopeAdapter adapter = new AgentScopeAdapter();
ReActAgent agent = ReActAgent.builder()
.name("Friday")
.model(model)
.middleware(adapter.middleware())
.build();
SessionBridge bridge = Aistio.instrument(agent,
AistioConfig.builder("my-agentscope-agent")
.controlPlaneHttp("http://localhost:8081")
.internalToken(System.getenv("BUILDER_INTERNAL_TOKEN"))
.namespace("default")
.enableEvents(true)
.contractHttpPort(18090)
.build(),
adapter);
instrument(Object, AistioConfig) also works on an agent that is already built. It
reports session snapshots, effective context, history and commands — everything that reads live
state — but emits no events, since there is no way to add a middleware after construction.
The returned bridge is AutoCloseable; close it to detach and release both channels.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SessionBridgeinstrument(Object target, AistioConfig config) Instruments an already-built agent.static SessionBridgeinstrument(Object target, AistioConfig config, FrameworkAdapter adapter) Instrumentstargetwith a pre-built adapter, typically one already wired as a middleware on the agent.static SessionBridgenewBridge(AistioConfig config) Creates a bridge without attaching or starting it, for callers that need to hold the adapter before the agent exists.
-
Method Details
-
instrument
Instruments an already-built agent. No Level-2 events; see the class javadoc. -
instrument
public static SessionBridge instrument(Object target, AistioConfig config, FrameworkAdapter adapter) Instrumentstargetwith a pre-built adapter, typically one already wired as a middleware on the agent. -
newBridge
Creates a bridge without attaching or starting it, for callers that need to hold the adapter before the agent exists. CallSessionBridge.attach(java.lang.Object, io.agentscope.extensions.aistio.FrameworkAdapter)thenSessionBridge.start().
-