@suluk/chat - v0.2.1
    Preparing search index...

    Function sanitizeMessages

    @suluk/chat — a contract-driven chat AGENT for any suluk app. The same OpenAPI v4 operations that drive the API, SDK, docs, admin, panel, and MCP server are projected (via @suluk/mcp) into tools an in-page assistant can call; an OpenRouter tool-use loop drives them, with the model chosen by @suluk/models (never hardcoded) and every call executed through the store's own access gate — so the agent can BROWSE and, when the user is permitted, ACT. Ships the server loop (chatApp, Hono-mountable SSE) + a theme-aware floating chatWidget. Pure pieces (runAgent, parseSSEStream, toolsToOpenAI) are independently testable. CANDIDATE tooling — NOT official OAS.

    • Sanitize client-supplied history: ONLY user/assistant text turns survive — no client-forged system/tool turns or tool_calls (which would be a prompt-injection / fake-result vector). Trim to the last MAX_TURNS.

      Parameters

      • input: unknown

      Returns ChatMessage[]