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

@dva89/flare-chat-ui

v0.1.0

Published

Chat GUI 能力包。

Readme

flare-chat-ui

Chat GUI 能力包。

依赖:

  1. flare-chat-core
  2. flare-generative-ui
  3. flare-canvas-ui

职责:

  1. 会话列表。
  2. 消息时间线。
  3. 输入区与发送交互。
  4. ChatWorkspace 宿主编排。

不包含:

  1. kernel 调用实现。
  2. 业务领域写死逻辑。

development mode(本地调试)

用于纯组件调试,不依赖真实业务后端:

  1. cd packages/flare-chat-ui
  2. npm install
  3. npm run dev

默认地址:http://127.0.0.1:3000

约定:

  1. playground 默认使用本地 mock runtime(会话/消息/流式事件均为模拟)。
  2. 不接入真实采购业务逻辑。
  3. 端口与标题通过环境变量配置,不在代码里写死业务地址。

可选环境变量:

  1. FLARE_CHAT_UI_DEV_HOSTFLARE_CHAT_UI_DEV_PORT
  2. VITE_FLARE_CHAT_FUNCTION_TYPE
  3. VITE_FLARE_CHAT_DEFAULT_SESSION_TITLE
  4. VITE_FLARE_CHAT_PROJECT_NAME
  5. VITE_FLARE_CHAT_PROJECT_TITLE
  6. VITE_FLARE_CHAT_SOURCE_API_ENABLEDtrue 时启用真实文件 API)
  7. VITE_FLARE_CHAT_SOURCE_API_BASE_URL(如 http://127.0.0.1:8001
  8. VITE_FLARE_CHAT_SOURCE_API_TOKEN(Bearer token)

shell slots(配置化插槽)

ChatWorkspace 支持把壳层入口配置化,便于后续只改配置:

  1. projectSlot
  2. sidebarOperations
  3. modeQuickEntries
  4. uiLabels
  5. identityContext
  6. onProjectSourcesChange
  7. sourceAPI

最小示例:

<ChatWorkspace
  functionType="chat_component_debug"
  messageAPI={messageAPI}
  projectSlot={{
    key: 'project-learning-gpt',
    project_id: 'proj_001',
    subtitle: 'Project',
    name: '项目',
    sessionListParams: { project_id: 'proj_001' },
    sessionCreateParams: { project_id: 'proj_001' },
  }}
  identityContext={{
    user_id: 'user_001',
    project_id: 'proj_001',
  }}
  onProjectSourcesChange={({ project_id, user_id, sources }) => {
    // 宿主可在这里持久化项目资料与会话引用关系
  }}
  sourceAPI={{
    uploadSourceFile: (payload) => apiClient.uploadSourceFile(payload),
    listProjectSources: (projectId) => apiClient.listProjectSources(projectId),
    deleteProjectSource: (projectId, sourceId) => apiClient.deleteProjectSource(projectId, sourceId),
  }}
  sessionAPI={sessionAPI}
  sidebarOperations={[
    { key: 'new_thread', label: 'New thread' },
    { key: 'automations', label: 'Automations' },
    { key: 'skills', label: 'Skills' },
  ]}
  modeQuickEntries={[
    { key: 'requirement_canvas', label: '需求梳理', functionType: 'requirement_canvas' },
    { key: 'intelligent_sourcing', label: '智能寻源', functionType: 'intelligent_sourcing' },
  ]}
  uiLabels={{
    mode_quick_entry_title: '推荐模式',
    current_mode_label: '当前模式',
  }}
/>

sourceAPI 约定:

  1. uploadSourceFile({ file, project_id, session_id? }) => Promise<SourceRecord>
  2. listProjectSources(projectId) => Promise<{ project_id, sources }>
  3. deleteProjectSource(projectId, sourceId) => Promise<{ deleted: boolean }>

未传 sourceAPI 时,资料区仍使用本地状态模式(仅前端内存)。