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

@postqode/agent

v0.9.0

Published

Pluggable agent loop and tool execution for PostQode. Built on @postqode/ai. Ships Agent class, Tool/Host/Hooks contracts, NodeHost, assistant-message parsing, and persistent MEMORY.md-indexed memory.

Readme

@postqode/agent

Pluggable agent loop and tool execution for PostQode. Built on @postqode/ai. Ships no tools or prompts — consumers supply their own or layer @postqode/coding-agent on top.

What ships

  • Agent class — drives the multi-turn LLM loop, executes tools, emits streaming events.
  • Contracts: Tool, ToolContext, ToolOutput, Host, FileSystem, Terminal, Logger, AgentEvent (union), Hooks, AgentConfig, AgentResult, AgentMessage.
  • NodeHost — default Host implementation using node:fs/promises and node:child_process. Works from any CLI or server context.
  • assistant-message/ — tool-use block parsing, diff construction helpers.
  • Persistent memoryAgentMemoryContext and TaskMemoryManager build a MEMORY.md-indexed store per agent or per task. Memory scopes: user / project / local; the home-dir resolver is a constructor callback so non-VS-Code hosts plug their own.

Minimal example

import { getProvider } from "@postqode/ai"
import { Agent } from "@postqode/agent"

const api = getProvider("anthropic")!(
	{ apiKey, agentModeApiModelId: "claude-sonnet-4-5-20250929", planModeApiModelId: "claude-sonnet-4-5-20250929" },
	"agent",
)

const agent = new Agent({ api, systemPrompt: "You are a helpful assistant." })
const { messages, usage } = await agent.run("Hello!")

Streaming + hooks

for await (const event of agent.runStream("Summarize foo.ts")) {
	if (event.type === "text_delta") process.stdout.write(event.delta)
}

// Or pass hooks:
new Agent({
	api,
	systemPrompt: "...",
	hooks: {
		onToolStart: ({ name }) => console.log("→", name),
		onToolEnd: ({ name, output }) => console.log("✓", name, output.content.slice(0, 80)),
		onEvent: (e) => metrics.record(e),
	},
})

Custom tools

import type { Tool } from "@postqode/agent"

const readTool: Tool<{ path: string }> = {
	name: "read_file",
	description: "Read a file's contents.",
	inputSchema: {
		type: "object",
		properties: { path: { type: "string" } },
		required: ["path"],
	},
	async execute({ path }, ctx) {
		return { content: await ctx.host.fs.read(path) }
	},
}

new Agent({ api, systemPrompt: "...", tools: [readTool] })

Config knobs

| Field | Default | Purpose | |---|---|---| | api | — | Required. From @postqode/ai. | | systemPrompt | — | Required. | | tools | [] | Provider-agnostic; converted per toolFormat. | | toolFormat | "anthropic" | "anthropic" or "openai". | | host | createNodeHost() | Filesystem + terminal injection. Override with a Vscode-backed host in extensions. | | hooks | {} | onTurnStart/End, onToolStart/End (with cancel), onEvent. | | maxTurns | 50 | Hard cap. | | maxParallelTools | 1 | Concurrency for tool execution. | | cwd | process.cwd() | Working directory for tools. | | signal | new AC | External abort signal. agent.abort() also trips it. |

Sibling packages