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

@agenticforge/agents

v1.5.0

Published

Agent implementations for AgenticFORGE

Readme

@agenticforge/agents

npm License: CC BY-NC-SA 4.0

AgenticFORGE Agent 实现包,内置 ReAct、Plan-and-Solve、Reflection、FunctionCall、Simple、SkillAgent、WorkflowAgent 七种 Agent 工作流。

安装

npm install @agenticforge/agents

内置 Agent

| Agent | 适用场景 | |-------|----------| | SimpleAgent | 简单对话 Agent,支持多轮上下文 | | FunctionCallAgent | 工具调用驱动,适合任务型场景 | | ReActAgent | 推理-行动-观察循环,适合复杂推理 | | PlanSolveAgent | 先规划后逐步执行,适合多步骤任务 | | ReflectionAgent | 带自我反思与批评机制,适合高质量生成 | | SkillAgent | 自动路由到最合适的 Skill,适合多能力切换场景 | | WorkflowAgent | DAG 工作流编排,支持并发节点执行 |

SkillAgent

SkillAgent 将用户请求自动路由到最合适的 Skill。Skill 可以是 Markdown 文件或 TypeScript 类,详见 @agenticforge/skills

import { SkillAgent } from "@agenticforge/agents";
import { SkillLoader } from "@agenticforge/skills";

const mdSkills = await SkillLoader.fromDirectory(".cursor/skills");

const agent = new SkillAgent({
  name: "assistant",
  llm,
  skills: [...mdSkills, new StockSkill()],
});

// 自动路由到最合适的 Skill
const reply = await agent.run("东京今天下雨吗?");

// 直接调用指定 Skill
const result = await agent.runSkill("stock-query", "苹果股票现在多少?");
console.log(result.output);

使用示例

import {FunctionCallAgent, LLMClient} from "@agenticforge/agents";
import {Tool, toolAction} from "@agenticforge/tools";
import {z} from "zod";

const calcTool = new Tool({
  name: "calculator",
  description: "执行数学计算",
  parameters: [{name: "expr", type: "string", required: true}],
  action: toolAction(z.object({expr: z.string()}), async ({expr}) => String(eval(expr))),
});

const agent = new FunctionCallAgent({
  llm: new LLMClient({provider: "openai", model: "gpt-4o"}),
  tools: [calcTool],
});

const result = await agent.run("计算 (123 + 456) * 2");
console.log(result);

WorkflowAgent

WorkflowAgent 按 DAG 拓扑顺序执行节点,无相互依赖的节点在同一波次内并发执行。每个节点的输出以 nodeId 为 key 写入共享 context,后续节点可通过 {nodeId} 插值引用。

支持节点类型:tool · llm · fn · passthrough

import { WorkflowAgent, LLMClient } from "@agenticforge/agents";
import type { WorkflowDefinition } from "@agenticforge/workflow"; // 类型定义现已独立至 @agenticforge/workflow

const agent = new WorkflowAgent({
  name: "report-workflow",
  llm: new LLMClient({ provider: "openai", model: "gpt-4o" }),
  verbose: true,
});

const definition: WorkflowDefinition = {
  name: "fan-out-report",
  nodes: [
    { id: "fetch",     type: "tool", toolName: "search", inputTemplate: "{input}",                          depends: [] },
    { id: "analyze",   type: "llm",  promptTemplate: "分析以下内容:\n{fetch}",                              depends: ["fetch"] },
    { id: "translate", type: "llm",  promptTemplate: "将以下内容翻译成英文:\n{fetch}",                      depends: ["fetch"] },
    { id: "report",    type: "llm",  promptTemplate: "综合分析与翻译写出双语简报:\n{analyze}\n{translate}",  depends: ["analyze", "translate"] },
  ],
};

// analyze 与 translate 在 fetch 完成后并发执行
const result = await agent.runWorkflow(definition, "2024年AI行业发展趋势");
console.log(result.output);
console.log(result.nodeResults); // 每个节点的耗时与状态

链接