Hostile 99% javascript Download

@chat-adapter/web 4.45.0

legitimate chat adapter package

“Web adapter for Chat SDK — browser chat UI over the AI SDK or AG-UI (TanStack AI) stream protocols”

Declares TypeScript development dependencyLicense text starts MIT/ISC/Apache/BSD
SHA-256d3ea986cf557f79a758411a3e09e5b9ba2fe6c009e209d44751f04b147fdcfa2

Evidence

Repeated computed-property calls (3+) lines 1–14
1[![Web adapter for Chat SDK](https://chat-sdk.dev/en/adapters/official/web/og)](https://chat-sdk.dev/adapters/official/web)
2
3# @chat-adapter/web
4
5> npm package: [`@chat-adapter/web`](https://www.npmjs.com/package/@chat-adapter/web)
6
7[![Agent Stack](https://img.shields.io/badge/Agent%20Stack-000?style=flat-square&logo=vercel&logoColor=FFF&labelColor=000&color=000)](https://vercel.com/kb/agent-stack)
8[![MIT License](https://img.shields.io/badge/License-MIT-000?style=flat-square&logo=opensourceinitiative&logoColor=white&labelColor=000&color=000)](../../LICENSE)
9
10Web adapter for [Chat SDK](https://chat-sdk.dev). Lets a chat-sdk bot serve a browser chat UI alongside Slack, Teams, Discord, etc. — the same `bot.onDirectMessage(...)` handler fires for every platform.
11
12The adapter speaks the [AI SDK UI message stream protocol](https://ai-sdk.dev/docs/ai-sdk-ui/stream-protocol) by default, so React, Vue, and Svelte AI SDK clients work against the server endpoint. Set `protocol: "ag-ui"` to speak [AG-UI](https://docs.ag-ui.com/concepts/events) instead, for [TanStack AI](#tanstack-ai) and other AG-UI clients. The server has no runtime dependency on either client SDK.
13
14Documentation: [chat-sdk.dev/ …
At least four Markdown-style heading lines lines 14–25
14:102… ides: [vercel.com/kb/chat-sdk](https://vercel.com/kb/chat-sdk)
15
16## Installation
17
18```bash
19pnpm add @chat-adapter/web
20```
21
22Then install the client packages that match your UI:
23
24| Client | Packages | Import from | `protocol` |
25|--------|----------|--------- …
Markdown-style heading precedes a code fence lines 70–91
⋯9 lines
79### Client
80
81#### React
82
83```tsx
84// app/chat/page.tsx
85"use client";
86import { useChat } from "@chat-adapter/web/react";
87
88export default function ChatPage() {
89 const { messages, sendMessage, status, stop } = useChat();
90 // Render with `ai-elements` (<Conversation>, <Message>, <PromptInput>)
91 // or your own components — `messa …
Calls a SendMessage/sendMessage method lines 335–340
335:39… e return the `Chat` instance directly. Access `chat.messages`, `chat.sendMessage()`, `chat.status`, and `chat.stop()` on that object instead of destructuring.
336
337## Configuration
338
339| Option | Required | Description |
340|--------|----------|----- …
Claude agent identity reference lines 416–422
416:69… essage"
417
418- The adapter only handles new user turns. Client-side tool results and automatic resubmits (for example, `useChat`'s `sendAutomaticallyWhen`) send a body ending in an assistant or tool message, which isn't supported.
419
420## AI Coding Agents
421
422If you use an AI coding agent such as OpenAI Codex, Claude Code, or Cursor, install the Chat SDK skill so it knows the SDK APIs, adapter patterns, and project conventions before writing code. …

Showing the top 5 files — 2 more files (18 regions) not shown.

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.