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

@coregit/agent

v0.2.0

Published

Universal AI agent runtime — CLI + SDK for tool-using LLM agents

Readme

@coregit/agent

Universal AI agent runtime — CLI + SDK for tool-using LLM agents.

A self-contained agent loop that takes a user prompt, calls an LLM with tool definitions, executes tools (read/write/edit/exec/grep/glob/ls/web-search/fetch/image-gen/HITL/sub-agents/todos), and streams JSON-per-line events to stdout. Works as a CLI binary or as an importable SDK.

Install

npm install @coregit/agent

CLI

Bundled at dist/agent.js (registered as coregit-agent):

coregit-agent --prompt "fix the bug in app.ts" --model pro --work-dir ./my-project

Common flags:

| Flag | Default | Meaning | |---|---|---| | --prompt | required | User message | | --model | pro | auto | light | pro | deep | | --mode | normal | normal | plan | implement | | --work-dir | cwd | Project root | | --session-id | random | Resume across runs | | --skills-dir | ./skills | SKILL.md plugin directory | | --hitl-dir | /tmp/hitl | Human-in-the-loop request files | | --blocked-tools | "" | Comma-separated tool names to disable | | --max-iterations | 200 | Hard stop for the agent loop | | --image PATH | — | Attach an image to the user message (repeatable) | | --history-file PATH | — | Resume from prior message history (JSON) | | --restore-checkpoint PATH | — | Resume from a saved checkpoint |

Events are emitted one-per-line as JSON: session-start, text-delta, reasoning-delta, tool-call-start, tool-result, usage-update, session-end, etc. See src/types.ts (AgentEvent).

SDK

import { runAgent } from "@coregit/agent";

await runAgent({
  model: "pro",
  userMessage: "implement /health endpoint",
  sessionId: crypto.randomUUID(),
  workDir: process.cwd(),
  env: process.env as Record<string, string>,
  maxIterations: 100,
});

Types: AgentConfig, AgentEvent, Message, ToolCall, ToolContext, ToolDefinition, ToolExecutionResult, Middleware.

Environment

Required in proxy mode (production):

| Variable | Purpose | |---|---| | AGENT_API_URL | Base URL of the proxy that holds provider API keys (e.g. https://api.example.com) | | AGENT_SESSION_TOKEN | Bearer token for the proxy | | AGENT_USERNAME | Forwarded to the proxy via X-Agent-Project | | AGENT_PROJECT_SLUG | Same |

Optional:

| Variable | Purpose | |---|---| | AGENT_PROXY_FORMAT | openai (default) or anthropic — wire format the proxy speaks | | AGENT_TENANT | Storage tenant override | | AGENT_AUTH_TOKEN | Used with direct storage mode | | STORAGE_API_URL | Direct mode only — your storage backend | | ANTHROPIC_API_KEY | Direct mode only — for Anthropic models |

Local development (no proxy):

AGENT_LLM_DIRECT=1 \
  GOOGLE_GENERATIVE_AI_API_KEY=... \
  OPENROUTER_API_KEY=... \
  ANTHROPIC_API_KEY=... \
  coregit-agent --prompt "..." --model pro

Proxy formats

The runtime supports two wire formats for the upstream proxy. Pick one with AGENT_PROXY_FORMAT:

openai (default)

Agent sends POST ${AGENT_API_URL}/v1/chat/completions in OpenAI Chat Completions shape. Proxy is expected to authenticate the request, inject provider keys (selected via the X-Agent-Model header), and forward to the actual provider (OpenRouter, OpenAI, etc.). The proxy may translate to provider-native formats if needed.

anthropic

Agent sends POST ${AGENT_API_URL}/v1/messages in Anthropic Messages shape (with cache_control breakpoints, tool_use/tool_result blocks, adaptive thinking, etc.). Proxy authenticates the request and forwards as-is to api.anthropic.com/v1/messages with the real x-api-key. Use this when your proxy backs onto Anthropic only.

Both modes share the same agent-side env (AGENT_API_URL, AGENT_SESSION_TOKEN) and headers (X-Agent-Model, X-Agent-Session, X-Agent-OpenAI-Token). Only the request/response body shape differs.

Skills

Skills are markdown plugins (SKILL.md files) loaded from --skills-dir. Each subdirectory becomes a skill the agent can read on demand. Ship your own skill packs as separate npm packages.

Build

npm install
npm run build           # tsc → dist/*.{js,d.ts}  + esbuild bundle → dist/agent.js
npm run typecheck
npm test

License

MIT