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

@t-agent/core

v1.3.27

Published

TA Core 统一入口包 - 整合所有核心功能

Readme

@t-agent/core

统一的 TA Core 入口包,整合了所有核心功能模块。

概述

@t-agent/core 是一个统一的入口包,它将以下所有 TA Core 模块整合到一个包中:

  • @t-agent/api - API 客户端和接口
  • @t-agent/business - 业务逻辑组件
  • @t-agent/config - 配置管理
  • @t-agent/sdk - SDK 核心功能
  • @t-agent/types - TypeScript 类型定义
  • @t-agent/ui - UI 组件库
  • @t-agent/utils - 工具函数

安装

pnpm add @t-agent/core

使用方式

方式 1:命名空间导入(推荐)

这种方式可以避免类型冲突,并且提供清晰的模块边界:

import { API, Business, Config, SDK, Types, UI, Utils } from '@t-agent/core';

// 使用 API 模块
const apiClient = API.createApiClient();

// 使用工具函数
const formattedDate = Utils.formatDate(new Date());

// 使用配置
const config = Config.getConfig();

// 使用类型
const user: Types.User = {
  id: '1',
  name: 'Test User',
};

方式 2:默认导入

import TAgent from '@t-agent/core';

// 通过默认导出访问所有模块
const apiClient = TAgent.API.createApiClient();
const formattedDate = TAgent.Utils.formatDate(new Date());
const config = TAgent.Config.getConfig();

方式 3:直接导入

import { createApiClient, formatDate, getConfig } from '@t-agent/core';

// 直接使用函数
const apiClient = createApiClient();
const formattedDate = formatDate(new Date());
const config = getConfig();

注意: 方式 3 可能会遇到类型名称冲突,建议优先使用方式 1。

迁移指南

如果你之前使用多个 @t-agent/* 包,现在可以统一替换为 @t-agent/core

之前

import { createApiClient } from '@t-agent/api';
import { formatDate } from '@t-agent/utils';
import { getConfig } from '@t-agent/config';
import { User } from '@t-agent/types';
import { Button } from '@t-agent/ui';

现在

// 推荐方式
import { API, Utils, Config, Types, UI } from '@t-agent/core';

const apiClient = API.createApiClient();
const formattedDate = Utils.formatDate(new Date());
const config = Config.getConfig();
const user: Types.User = { id: '1', name: 'Test' };
const button = UI.Button;

// 或者直接导入(如果没有冲突)
import { createApiClient, formatDate, getConfig } from '@t-agent/core';

版本

当前版本:1.0.14

许可证

MIT