flue-eve

Client Package

import { Client, ClientSession, ClientError } from 'flue-eve/client'

Client

APIDescription
new Client(options?)Bind a host, auth policy, headers, and reconnect budget
client.health()Call GET /eve/v1/health
client.info()Call GET /eve/v1/info
client.fetch(path, init?)Fetch a route with configured auth and headers
client.session(state?)Create or restore a ClientSession

ClientSession

APIDescription
session.stateCurrent { sessionId, continuationToken, streamIndex }
session.send(input)Post a first or follow-up turn and return MessageResponse
session.stream(options?)Stream an existing session from the stored or provided index

MessageResponse

APIDescription
response.sessionIdSession ID returned by the server
response.continuationTokenContinuation token returned for the next turn
for await (const event of response)Consume current-turn Eve events
response.result()Consume the turn and return { status, message, data, events }

Persistence helpers

loadSessionState, saveSessionState, clearSessionState, and isSessionState support browser storage or any Storage-like object.