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

@shuttle-ai/type

v0.0.17

Published

Shuttle AI 类型定义

Downloads

2,114

Readme

@shuttle-ai/type

@shuttle-ai/type 为 Shuttle AI 框架提供完整的 TypeScript 类型定义,涵盖工具定义、消息结构、代理通信等核心概念(nodejs环境和浏览器均可运行)。

安装

npm install @shuttle-ai/type
# 或
yarn add @shuttle-ai/type
# 或
pnpm add @shuttle-ai/type

命名空间

ShuttleAi.Tool

工具相关类型定义:

  • Scope: 工具作用域 (autoRun | read | write)
  • Extras: 工具额外配置
  • Result: 工具执行结果
  • ConfirmResult: 工具调用确认结果
  • Call: 工具调用信息
  • Define: 工具定义结构

ShuttleAi.SubAgent

子代理类型定义:

  • Define: 子代理定义结构

ShuttleAi.Message

消息类型定义:

  • User: 用户消息
  • AI: AI 响应消息
  • AIChunk: AI 流式输出片段
  • AITool: AI 工具调用请求
  • Tool: 工具执行结果消息

ShuttleAi.Ask

框架向外部请求的类型:

  • Ping: 心跳检测
  • Chunk: 流式输出片段
  • AgentStart: 代理开始
  • AgentEnd: 代理结束
  • ToolStart: 工具开始执行
  • ToolEnd: 工具执行结束
  • StartWork: 工作开始
  • EndWork: 工作结束

ShuttleAi.Report

框架向上报的类型:

  • ConfirmTool: 工具调用确认
  • AgentStart: 代理启动上报

使用示例

import { ShuttleAi } from '@shuttle-ai/type'

// 定义一个工具
const toolDefine: ShuttleAi.Tool.Define = {
  name: 'search',
  description: '搜索内容',
  schema: {
    type: 'object',
    properties: {
      query: { type: 'string' },
    },
    required: ['query'],
  },
  extras: {
    scope: 'autoRun',
  },
}

// 创建消息
const aiMessage: ShuttleAi.Message.AI = {
  role: 'assistant',
  id: 'msg_001',
  agentId: 'agent_001',
  workId: 'work_001',
  content: '我将帮你搜索相关内容',
  toolCalls: [
    {
      id: 'call_001',
      name: 'search',
      args: { query: 'TypeScript 类型' },
    },
  ],
}

依赖

  • zod: 用于 schema 验证的类型定义