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

@aiknox/taskflow

v0.0.28

Published

Task-driven AI execution system — controllable, observable, interruptible

Readme

TaskFlow

Task-driven AI execution system — controllable, observable, interruptible.

安装

# 全局安装 — 命令名为 knox
npm install -g @aiknox/taskflow

# 或从源码
npm install && npm run build

快速开始

knox setup          # 配置 API key 和模型
knox agents         # 查看可用 Agent
knox run "Read package.json"   # 执行任务

TaskFlow 是一个由 LLM 驱动的编码代理系统。你给它一个自然语言任务(如"重构 auth 模块"),它自主通过工具调用(读文件、写文件、搜索、执行命令)完成,整个过程实时可见。

knox run "Add a CLI flag --verbose to the logger"
Agent      default
Model      claude-sonnet-4-20250514
Pricing    $3/1M in  $15/1M out
Task       "Add a CLI flag --verbose to the logger"
──────────────────────────────────────────────────
[0.0s] Agent "default" started
[0.3s]   think Let me first find the logger implementation...
[0.5s]   search  Logger
[0.6s]     ok    213ms
[0.8s]   read    src/logger.ts
[0.8s]     ok    5ms
[1.2s]   write   src/logger.ts
[1.3s]     ok    18ms

✓ Done · 2 turn(s) · in 452 out 128 · $0.003276 (Anthropic) · 1.3s

Quick Start

1. 安装

git clone <repo>
cd TaskFlow
npm install
npm run build

2. 配置

# 交互式向导 — 选择 provider、输入 API key、挑选模型
node packages/cli/dist/cli.js setup

或手动创建 .env

AI_PROVIDER=openai
AI_BASE_URL=https://api.example.com
AI_API_KEY=sk-xxx
AI_MODEL=deepseek-v4-flash

3. 运行

# 查看帮助
node packages/cli/dist/cli.js --help

# 执行任务
node packages/cli/dist/cli.js run "Read package.json and summarize its dependencies"

# 查看历史
node packages/cli/dist/cli.js log

4. 快捷方式

npm run cli -- run "your task"
npm run cli -- setup

CLI 命令参考

所有命令通过 knox 调用(npm install -g @aiknox/taskflow 后可用)。

| 命令 | 用途 | |------|------| | knox run <task> | 执行任务 — Agent 模式,实时流式输出 | | knox | 交互式会话 — 连续接受任务,保留上下文 | | knox log [taskId] | 列出历史任务 / 查看事件时间线 | | knox agents | 列出所有 Agent 配置 | | knox models | 列出 API 端点可用的模型(标记当前默认模型) | | knox update | 从 npm 更新 Knox 到最新版本 |

选项

| 选项 | 说明 | |------|------| | --workspace, -w <path> | 工作目录(默认: cwd) | | --model, -m <name> | 覆盖默认模型(默认: .env 中的 AI_MODEL) | | --agent, -a <name> | Agent 配置名(默认: default) | | --quiet, -q | 最小输出模式 |


Agent 配置

TaskFlow 使用 YAML 配置文件定义 Agent 行为。默认配置在 .taskflow/agents/default.yaml

name: default
description: General-purpose coding agent
systemPromptFile: default.system.md
tools:
  - read
  - write
  - bash
  - search
maxTurns: 50
maxTokens: 16384
timeout: 600000      # ms

可以创建多个配置(如 coder.yamlreviewer.yaml),通过 --agent 切换:

knox run --agent coder "Build the API endpoint"
knox agents   # 列出所有可用配置

工具

| 工具 | 说明 | |------|------| | read <path> | 读取文件或列出目录 | | write <path> <content> | 写入文件(自动创建中间目录) | | bash <command> | 在工作目录执行 shell 命令 | | search <pattern> [path] | grep 搜索文件内容 |


架构

packages/
├── schema/      — 核心类型 + 定价数据
├── scheduler/   — LLM 适配器 (Anthropic/OpenAI/流式) + ToolRunner + 存储
├── agent/       — Agent 类 + 工具系统 + 配置加载 ← 执行核心
└── cli/         — CLI 界面

执行流程:

用户输入 → CLI → Agent.run(task)
  → LLM 流式循环:
    → 实时 emit thinking/tool_call/tool_result
  → AgentResult{output, tokenUsage, turns}

开发

# 构建全部
npm run build

# 测试全部
npm test

# 单包测试
npm -w @aiknox/schema run test
npm -w @aiknox/scheduler run test
npm -w @aiknox/agent run test
npm -w @aiknox/cli run test

# 类型检查
npm run typecheck

发布与更新

维护者一条命令发版、用户 knox update 升级,详见 RELEASE.md

npm run release    # clean → build → test → 升版本 → 发布 npm
knox update        # 用户更新

添加新模型定价

编辑 packages/schema/src/pricing.json,按格式添加条目即可。


License

MIT