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

invoked

v0.1.3

Published

Build Claude-powered agents, cron jobs, and webhook automations — no API key needed.

Readme

invoked

Build Claude-powered agents — no API key needed.

Runs on your existing Claude Code subscription. Authentication is handled automatically.

npm install invoked

Quick start

import { Agent } from "invoked";

const agent = new Agent({
  name: "assistant",
  instructions: "You are a helpful assistant.",
});

const answer = await agent.generate("What is TypeScript?");
console.log(answer);

Install

npm install invoked zod

Core features

| Feature | Description | |---|---| | generate() | Full response as a string | | stream() | Real token-by-token streaming | | generateObject() | Typed structured output via Zod schemas | | Tools | Custom TypeScript functions Claude can call | | Skills | Delegate sub-tasks to specialised agents | | MCP servers | Connect to any MCP server — stdio or SSE | | Scratchpad | Opt-in internal notepad — agent tracks its own goal and notes | | Processors | Middleware pipeline to transform inputs and outputs |

Agents are stateless by default. No history is stored between calls unless you opt in.


Agents

import { Agent } from "invoked";

const agent = new Agent({
  name: "assistant",
  instructions: "You are a helpful assistant.",
});

// Full response
const answer = await agent.generate("Explain closures in JavaScript");

// Stream token by token
for await (const chunk of agent.stream("Write a short story")) {
  process.stdout.write(chunk);
}

Structured output

import { z } from "zod";

const result = await agent.generateObject(
  "Extract: Alice is 30 years old and knows TypeScript.",
  z.object({ name: z.string(), age: z.number() })
);
// result.name → "Alice"
// result.age  → 30

Built-in Claude Code tools

new Agent({
  allowedTools: ["Read", "Glob", "Grep"],   // read files
  // or
  allowedTools: ["Bash"],                   // shell commands
  // or
  allowedTools: ["WebSearch", "WebFetch"],  // web access
});

Scratchpad

Enable the scratchpad when your agent needs to track its own goal and progress across a complex multi-step task:

const agent = new Agent({
  name: "researcher",
  instructions: "You are a research analyst.",
  allowedTools: ["WebSearch", "WebFetch"],
  scratchpad: true,
});

Tools

import { Agent, defineTool } from "invoked";
import { z } from "zod";

const getWeather = defineTool({
  name: "get_weather",
  description: "Get current weather for a city",
  input: { city: z.string() },
  run: async ({ city }) => `22°C and sunny in ${city}`,
});

const agent = new Agent({
  name: "weather-bot",
  instructions: "You help with weather queries.",
  tools: [getWeather],
});

Skills

Skills are sub-agents the main agent can invoke autonomously to handle complete sub-tasks:

import { Agent } from "invoked";

const researcher = new Agent({
  name: "researcher",
  instructions: "Search the web and summarise findings.",
  allowedTools: ["WebSearch", "WebFetch"],
});

const orchestrator = new Agent({
  name: "orchestrator",
  instructions: "You coordinate tasks. Delegate research to your skills.",
  skills: [researcher.asSkill("Handles all web research")],
});

await orchestrator.generate("Research the latest TypeScript 6 news");

MCP servers

Connect agents to any Model Context Protocol server:

// Stdio server (local process)
const agent = new Agent({
  name: "coder",
  instructions: "You help with code tasks.",
  mcpServers: {
    filesystem: {
      command: "npx",
      args: ["-y", "@modelcontextprotocol/server-filesystem", "./src"],
    },
  },
});

// SSE server (remote HTTP)
const agent = new Agent({
  name: "assistant",
  instructions: "You are a helpful assistant.",
  mcpServers: {
    myApi: {
      type: "sse",
      url: "https://my-mcp-server.com/sse",
      headers: { Authorization: "Bearer my-token" },
    },
  },
});

Input / Output processors

Transform messages before Claude sees them, or results before they're returned:

import { createInputProcessor, createOutputProcessor } from "invoked";
import { appendFileSync } from "fs";

const addDate = createInputProcessor((ctx) => ({
  ...ctx,
  message: `[${ctx.timestamp.slice(0, 10)}] ${ctx.message}`,
}));

const auditLog = createOutputProcessor((ctx) => {
  appendFileSync("./audit.log", `${ctx.input.timestamp} | ${ctx.result.slice(0, 100)}\n`);
  return ctx;
});

const agent = new Agent({
  name: "audited",
  instructions: "You are a helpful assistant.",
  inputPipeline: [addDate],
  outputPipeline: [auditLog],
});

API reference

new Agent(config)

| Option | Type | Default | Description | |---|---|---|---| | name | string | required | Unique agent name | | instructions | string \| (ctx) => string | required | System prompt | | scratchpad | boolean | false | Enable internal goal + notes tracking | | allowedTools | string[] | [] | Built-in Claude Code tools to allow | | tools | ToolDef[] | [] | Custom tools | | skills | SkillDef[] | [] | Sub-agents to delegate to | | mcpServers | Record<string, McpServerConfig> | {} | External MCP servers | | inputPipeline | InputMiddleware[] | [] | Pre-process the message | | outputPipeline | OutputMiddleware[] | [] | Post-process the result |

Methods

| Method | Returns | Description | |---|---|---| | generate(prompt, metadata?) | Promise<string> | Full response | | stream(prompt, metadata?) | AsyncGenerator<string> | Token-by-token | | generateObject(prompt, schema, metadata?) | Promise<z.infer<T>> | Typed object | | clearMemory() | void | Clear scratchpad + session | | asSkill(description) | SkillDef | Expose as skill for another agent |


License

MIT