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

@gtc-tech/agent-core-ui

v1.0.0

Published

Agent Core - React UI for task monitoring

Readme

Agent Core UI

React 组件库,用于可视化 Agent Core 任务执行。

安装

npm install @gtc-tech/agent-core-ui

使用

基础用法

import { AgentPanel } from '@gtc-tech/agent-core-ui';
import '@gtc-tech/agent-core-ui/styles.css';

function App() {
  return (
    <AgentPanel
      wsUrl="ws://localhost:8080/ws"
      theme="light"
      onTaskComplete={(result) => {
        console.log('Task completed:', result);
      }}
    />
  );
}

使用 Hook

import { useAgent } from '@gtc-tech/agent-core-ui';

function CustomUI() {
  const {
    connected,
    state,
    plan,
    result,
    logs,
    submitTask,
    cancelTask,
  } = useAgent({
    wsUrl: 'ws://localhost:8080/ws',
  });

  return (
    <div>
      <p>状态: {state}</p>
      <button onClick={() => submitTask('分析数据')}>
        开始任务
      </button>
    </div>
  );
}

组件

| 组件 | 说明 | |------|------| | AgentPanel | 完整的任务面板(推荐) | | TaskInput | 任务输入框 | | PlanView | 执行计划展示 | | StepCard | 单个步骤卡片 | | LogPanel | 日志面板 | | ResultView | 结果展示 |

Props

AgentPanel

| Prop | 类型 | 默认值 | 说明 | |------|------|--------|------| | wsUrl | string | ws://localhost:8080/ws | WebSocket 地址 | | theme | 'light' \| 'dark' \| 'auto' | 'auto' | 主题 | | onTaskComplete | (result) => void | - | 任务完成回调 | | onError | (error) => void | - | 错误回调 | | className | string | - | 自定义类名 |

useAgent

| 返回值 | 类型 | 说明 | |--------|------|------| | connected | boolean | 是否已连接 | | state | AgentState | 当前状态 | | plan | ExecutionPlan \| null | 执行计划 | | currentStepId | string \| null | 当前步骤ID | | result | TaskResult \| null | 执行结果 | | logs | LogEntry[] | 日志 | | tools | ToolDefinition[] | 可用工具 | | submitTask | (task, context?) => void | 提交任务 | | cancelTask | () => void | 取消任务 | | confirmStep | (stepId, approved) => void | 确认步骤 |

开发

# 安装依赖
npm install

# 启动开发服务器
npm run dev

# 构建库
npm run build:lib

样式定制

CSS 变量:

:root {
  --agent-primary: #6366f1;
  --agent-success: #10b981;
  --agent-warning: #f59e0b;
  --agent-error: #ef4444;
  --agent-bg: #ffffff;
  --agent-text: #111827;
  /* ... */
}