Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.svantic.com/llms.txt

Use this file to discover all available pages before exploring further.

Streaming & Events

Svantic supports real-time streaming via the A2A protocol’s SSE (Server-Sent Events) mechanism, enabling clients to receive progressive updates as tasks execute.

A2A Streaming

When a client sends a task to Svantic via message/stream, the response is an SSE stream of A2A events: A2A streaming sequence: client sends message/stream, receives SSE events for status updates, messages, artifacts, and completion

Event Types

TaskStatusUpdateEvent

Reports task lifecycle changes:
StateMeaning
submittedTask received, queued for processing
workingExecution in progress
input-requiredWaiting for user input (form, approval)
completedTask finished successfully
failedTask failed with error
canceledTask was canceled

Message

An agent response containing one or more Parts:
Part KindContent
TextPartPlain text (thoughts, explanations, answers)
DataPartStructured JSON (tool results, forms, capability invocations)
FilePartFile content or reference

TaskArtifactUpdateEvent

Emitted when the agent produces a tangible output — a file, a structured document, or a final result.

Consuming Streams

Using RemoteAgent (SDK)

import { RemoteAgent } from '@svantic/sdk';

const remote = await RemoteAgent.connect('http://savant:3000');
const stream = remote.send_stream('Analyze this codebase', 'session-1');

for await (const event of stream) {
    if (event.kind === 'status-update') {
        console.log('Status:', event.status.state);
    }
    if (event.kind === 'message') {
        for (const part of event.message.parts) {
            if (part.kind === 'text') {
                process.stdout.write(part.text);
            }
        }
    }
}

Using the REST API

For direct HTTP access, use POST /send with method: "message/stream" — see the Using the API guide.

Event Conversion

Svantic’s internal engine events are automatically converted to A2A events by the EventConverter:
Internal EventA2A Event
Agent text outputMessage with TextPart
Tool call startTaskStatusUpdateEvent (working)
Tool resultMessage with DataPart
Plan approval requestMessage with DataPart (form)
A2UI formMessage with DataPart (form fields)
Execution completeTaskStatusUpdateEvent (completed)
ErrorTaskStatusUpdateEvent (failed)