AgentSyncClient class
Client for communicating with local or remote Agentation Model Context Protocol (MCP) servers.
Constructors
- AgentSyncClient({required String endpoint, String? webhookUrl, HttpTransport? httpTransport})
Properties
- endpoint → String
-
The root server endpoint URL (e.g.
http://localhost:4747).final - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transport → HttpTransport
-
Underlying HTTP transport function.
no setter
- webhookUrl → String?
-
Optional webhook URL for dispatching asynchronous events.
final
Methods
-
copyWith(
{String? endpoint, String? webhookUrl, HttpTransport? httpTransport}) → AgentSyncClient - Creates a copy of this client with updated endpoint, webhookUrl, or transport.
-
createSession(
{String? url}) → Future< Map< String, dynamic> > - Creates a new session on the server for the current app context.
-
deleteAnnotation(
String annotationId) → Future< void> - Deletes an annotation from the server.
-
dispatchWebhook(
String targetUrl, {required String event, required Map< String, dynamic> payload}) → Future<bool> - Dispatches an event payload to a webhook URL matching agentation-main structure.
-
getSession(
String sessionId) → Future< Map< String, dynamic> > - Fetches an existing session and all associated annotations.
-
listSessions(
) → Future< List< Map< >String, dynamic> > - Lists all active sessions registered on the server.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
ping(
) → Future< bool> - Pings the MCP server endpoint to verify connectivity.
-
requestAction(
String sessionId, String output) → Future< Map< String, dynamic> > - Requests the connected AI agent to act upon active annotations.
-
sendWebhook(
{required String event, required Map< String, dynamic> payload, String? overrideUrl}) → Future<bool> - Dispatches an event to the configured webhook URL or a specified override.
-
syncAnnotation(
String sessionId, Annotation annotation) → Future< Map< String, dynamic> > - Pushes a newly created or updated annotation to the active session.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateAnnotation(
String annotationId, Map< String, dynamic> data) → Future<Map< String, dynamic> > - Partially updates an existing annotation on the server.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited