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

@chatbi-v/xcml

v2.1.3

Published

XCML 是一种用于 AI 聊天场景的结构化标记语言,旨在提供一种在 AI 与 UI 组件之间高效传递配置和数据的方式。

Downloads

27

Readme

XCML (eXtensible Chat Markup Language)

XCML 是一种用于 AI 聊天场景的结构化标记语言,旨在提供一种在 AI 与 UI 组件之间高效传递配置和数据的方式。

1. 核心结构

XCML 组件由三部分组成:<x-tag [props]>[body]</x-tag>

  • x-tag: 标签名。xcml:tag 为系统内部标识名,x-tag 为对外公开使用的标签名。
  • props: 组件的属性配置(Attributes),位于标签的开始标记内。
  • body: 组件的数据配置(Content),位于标签对的中间。

2. 配置方式

XCML 支持两种等效的配置方式,方便 AI 根据场景选择最简洁的输出:

方式 A:全属性模式 (Attributes-only)

所有配置(包括 propsbody 中定义的属性)都放置在标签属性位置。

<x-tag title="标题" content="内容"></x-tag>

方式 B:全内容模式 (Body-only)

所有配置都以 JSON 格式放置在标签 Body 中。这是复杂数据推荐的使用方式。

<x-tag>
{
  "title": "标题",
  "content": "内容"
}
</x-tag>

3. 数据解析规则

Schema 定义

  • props: 定义在标签属性位置的配置项。
  • body: 定义在 Body 位置的配置项(原 dataProps)。

Body 处理逻辑

  1. JSON 格式: 如果 Body 内容是合法的 JSON 字符串,解析后将其内部属性与 props 合并。
  2. String 格式: 如果 Body 内容是普通字符串,它将被自动映射为组件定义的默认内容属性(通常为 contentvalue)。

4. 开发规范

  • 优先保证 schema 定义的准确性。
  • 组件渲染层应通过 mergePropsAndBody 后的统一对象获取配置。
  • 强制要求 UTF-8 编码,代码注释和文档使用简体中文。