npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gedatou/cadenza-ai

v0.7.5

Published

Thin TanStack AI facade — provider-agnostic chat runtime, conventions and conversation views built on cadenza-ui

Readme

@gedatou/cadenza-ai

TanStack AI 的薄门面:useChat 等 React API 原样可用,provider 接入、思考强度、会话列表、 用量、附件与会话视图(基于 @gedatou/cadenza-ui)作为包默认提供。

文档与交互 demo:https://cadenza-ui-docs.vercel.app/docs/ai/conversation

用法

pnpm add @gedatou/cadenza-ai @gedatou/cadenza-ui
pnpm add @tanstack/ai-openai   # 用到哪家装哪家;adapter 都是 optional peer
// 客户端
import { fetchServerSentEvents, useChat } from '@gedatou/cadenza-ai'
// 服务端 route handler
import { openai } from '@gedatou/cadenza-ai/providers/openai'
import { createChatHandler } from '@gedatou/cadenza-ai/server'

export const { POST, GET } = createChatHandler({ providers: [openai] })

preset 一家一个子路径(只 import 自家 adapter):openai / anthropic / gemini / openrouter / grok / groq / mistral / vercel-gateway / llmgateway / bedrock / vertex / ollama / deepseek; providers/openai-compatible 的 openaiCompatiblePreset(config) 接任何 OpenAI 兼容端点; byteplus 是占位。

// 无密钥的假流(demo / 测试)
import { useChat } from '@gedatou/cadenza-ai'
import { scripted, text } from '@gedatou/cadenza-ai/mock'

function Demo() {
  const chat = useChat({ fetcher: scripted(() => [text('Hello')]) })
  return <pre>{JSON.stringify(chat.messages)}</pre>
}

入口 CSS(streamdown 的样式与 KaTeX 都在里面;再让 Tailwind 扫到 streamdown 的产物):

@import "@gedatou/cadenza-ai/styles.css";
@source "../node_modules/streamdown/dist/*.js";

文档

  • 会话 — useChat 接线与 Transcript 家族
  • 消息部件 — Markdown、推理、工具、审批、附件、来源、结构化输出
  • 输入区 — 输入、附件、模型与思考强度、建议、排队、听写
  • 会话列表 — 线程索引与本地持久化
  • 接入提供者 — 目录、thinking 映射、BYOK、route handler
  • 脚本化传输 — ./mock 的步骤 DSL
  • 试玩 — 用自己的 key 跑真模型

与官方 API 的差异

  • 根入口 export * from '@tanstack/ai-react',不覆盖任何上游导出;本包新增的导出不与上游同名。
  • 密钥走官方 BYOK relay 形态(浏览器 x-byok-<id> 头 → 你的 route handler),不做浏览器直连。
  • 思考强度统一为七级 ThinkingLevel(off | minimal | low | medium | high | xhigh | max), 由各 provider preset 翻译成自己的 modelOptions。
  • 服务端只从 forwardedProps 读 provider / model / thinking 三个键。

License

MIT