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

@cloudbase/agent-react-ui

v0.0.24

Published

`@cloudbase/agent-react-ui` 提供可直接接入 React 项目的聊天界面组件,可用于快速对接**符合 AG-UI 协议的 AI Agent**。当前组件仅作参考,推荐使用 [@cloudbase/agent-react-core](https://www.npmjs.com/package/@cloudbase/agent-react-core) 自定义 UI。

Readme

@cloudbase/agent-react-ui

@cloudbase/agent-react-ui 提供可直接接入 React 项目的聊天界面组件,可用于快速对接符合 AG-UI 协议的 AI Agent。当前组件仅作参考,推荐使用 @cloudbase/agent-react-core 自定义 UI。

安装

npm install @cloudbase/agent-react-core @cloudbase/agent-react-ui @cloudbase/js-sdk

快速开始

导入样式:

import "@cloudbase/agent-react-ui/styles.css";

引用:

import cloudbase from "@cloudbase/js-sdk";
import { AgKit, CloudBaseTransport } from "@cloudbase/agent-react-core";
import { AgKitUI } from "@cloudbase/agent-react-ui";

const app = cloudbase.init({ env: "your-env-id" });

app.auth.signInAnonymously();

const transport = new CloudBaseTransport({
  app,
  agentId: "your-agent-id",
});

export function App() {
  return (
    <AgKit transport={transport}>
      {/* AgKitUI 默认继承父元素宽高 */}
      <div style={{ height: "600px", width: "800px" }}>
        <AgKitUI />
      </div>
    </AgKit>
  );
}


API 参考

AgKitUI

核心聊天界面组件,内置了完整的消息渲染、工具调用展示、输入框和国际化支持。

AgKitUIProps

| 选项 | 必填 | 类型 | 说明 | | --- | --- | --- | --- | | className | 否 | string | 聊天主体布局类名 | | containerClassName | 否 | string | 最外层根容器类名 | | messagesClassName | 否 | string | 消息列表区域类名 | | inputClassName | 否 | string | 输入框包裹层类名 | | emptyTitleClassName | 否 | string | 空状态标题类名 | | inputPlaceholder | 否 | string | 输入框占位文本,未提供时使用 locale 默认值 | | suggestions | 否 | string[] | 聊天为空时显示的建议问题列表 | | locale | 否 | zh-CN/en | 内置 UI 文案语言,默认 "zh-CN" | | onSuggestionClick | 否 | (suggestion: string) => void | 点击建议问题时触发的回调 |

示例:基础用法

<AgKitUI />

示例:自定义建议与语言

<AgKitUI
  locale="zh-CN"
  inputPlaceholder="输入你的问题"
  suggestions={[
    "帮我总结今天的工作",
    "生成一份周报模板",
    "解释这个接口的用途",
  ]}
  onSuggestionClick={(value) => {
    console.log("clicked suggestion:", value);
  }}
/>

示例:自定义样式

<AgKitUI
  containerClassName="my-chat-container"
  messagesClassName="my-messages"
  inputClassName="my-input"
  emptyTitleClassName="my-empty-title"
/>