Skip to content

KuralleChatRouterOptions

type KuralleChatRouterOptions = object;
optional resolveSignalActor?: (c) => SignalActor | undefined | Promise<SignalActor | undefined>;

Who a /api/chat/resume decision is attributed to in the durable audit log.

Derive this from your own authentication — a session cookie, a bearer token, the request context. It is deliberately NOT read from the request body: a client that could name its own actor could approve as anyone.

Omitted, decisions are attributed to the service itself (hono-resume), which is honest but means the audit log cannot tell you which human approved.

Parameter Type

c

Context

SignalActor | undefined | Promise<SignalActor | undefined>


runtime: OpenAICompatRuntime;

optional sendWidgetWelcomeMessage?: boolean;

Whether /agents/chat/:sessionId should auto-greet on socket open. Deprecated. Use widgetWelcomeMode instead. Backward compatibility mapping:

  • false => off
  • true + widgetWelcomeMessage => static
  • true + no message => model

optional streamFilter?: StreamEventFilter;

Controls which StreamPart events are sent to external clients (SSE + widget/flow WebSockets).

  • 'safe': events classified as client by core, with errors sanitized.
  • 'all': full stream (Studio / dev tooling).
  • function: custom predicate; return true to emit.
'safe'

optional upgradeWebSocket?: UpgradeWebSocket;

optional widgetWelcomeMessage?: string;

Optional static welcome text to send immediately on socket open. If provided, this is sent directly instead of running a runtime turn.


optional widgetWelcomeMode?: WidgetWelcomeMode;

Controls widget welcome behavior for /agents/chat/:sessionId.

  • off: do not send a welcome turn on connect.
  • model: generate welcome by calling runtime.stream(...).
  • static: send widgetWelcomeMessage directly without model inference.