This is a WebSocket-based AI agent service. Connect using a WebSocket client to interact with agents.
All API and WebSocket endpoints require a JWT token. Generate one with:
npx tsx scripts/generate-token.ts --tenantId=my-tenant
Pass via Authorization: Bearer <token> header, or ?token=<jwt> query parameter for WebSocket connections.
ws://<host>/ws/agents/theme?token=<jwt>&sessionId=<session>
ws://<host>/ws/agents/flowchart?token=<jwt>&sessionId=<session>
ws://<host>/ws/agents/flow_recommendation?token=<jwt>&sessionId=<session>
Query parameters: token (required, JWT) · sessionId (optional, auto-generated if omitted)
/api/agents — List all available agents/api/agents/:agentType — Get agent schema details/health — Health check (no auth required)// Generate a token first:
// npx tsx scripts/generate-token.ts --tenantId=my-tenant
const TOKEN = "<your-jwt-token>";
const ws = new WebSocket("ws://localhost:8787/ws/agents/theme?token=" + TOKEN + "&sessionId=my-session");
ws.onopen = () => {
ws.send(JSON.stringify({
id: crypto.randomUUID(),
type: "user.message",
timestamp: Date.now(),
sessionId: "my-session",
agentType: "theme",
payload: { content: "Hello, agent!" }
}));
};
ws.onmessage = (event) => {
const frame = JSON.parse(event.data);
console.log(frame.type, frame);
};