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

@anek-codes/sdk

v0.1.1

Published

TypeScript SDK for the Anek API

Readme

Anek TypeScript SDK

A TypeScript SDK for the Anek API. It uses HTTP calls and an API key (Bearer token by default).

Install

npm install @anek-codes/sdk

Quick start

import { AnekClient } from '@anek-codes/sdk'
import type { Task, TaskLogEntry } from '@anek-codes/sdk'

const client = new AnekClient({
  baseUrl: 'http://localhost:3000',
  apiKey: 'YOUR_PERSONAL_ACCESS_TOKEN',
})

const task = await client.agents.create({
  prompt: 'Add a health check endpoint to the API',
  repos: [
    {
      url: 'https://github.com/acme/my-repo',
      baseBranch: 'main',
    },
  ],
  selectedAgent: 'claude',
})

const status = await client.agents.status(task.id)
const logs = await client.agents.logs(task.id, { limit: 100 })
const messages = await client.agents.messages(task.id)

Available AI Models

Anek supports multiple AI agents and models. You can specify both selectedAgent and selectedModel when creating tasks.

Supported Agents

  • claude - Anthropic's Claude models (default: claude-sonnet-4-5-20250929)
  • codex - OpenAI GPT models optimized for code (default: openai/gpt-5.1)
  • copilot - GitHub Copilot models (default: claude-sonnet-4.5)
  • cursor - Cursor AI models (default: auto)
  • gemini - Google's Gemini models (default: gemini-3-pro-preview)
  • opencode - Open-source and general models (default: gpt-5)

Example with Different Models

// Use Claude Opus for complex tasks
const task = await client.agents.create({
  prompt: 'Refactor the authentication system',
  repos: [{ url: 'https://github.com/acme/my-repo', baseBranch: 'main' }],
  selectedAgent: 'claude',
  selectedModel: 'claude-opus-4-5-20250201',
})

// Use GPT-5.1 Codex for code generation
const codeTask = await client.agents.create({
  prompt: 'Generate REST API endpoints',
  repos: [{ url: 'https://github.com/acme/my-repo', baseBranch: 'main' }],
  selectedAgent: 'codex',
  selectedModel: 'openai/gpt-5.1-codex',
})

For the complete list of available models, visit the documentation at docs.anek.codes/concepts/models

Sequences (multi-agent)

const sequence = await client.sequences.create({
  repos: [
    {
      url: 'https://github.com/acme/my-repo',
      baseBranch: 'main',
    },
  ],
  steps: [
    {
      name: 'analysis',
      prompt: 'Analyze the repo and write an analysis.md with changes needed.',
      selectedAgent: 'gemini',
    },
    {
      name: 'implement',
      prompt: 'Apply the plan from {{previousStep.response}} and update the code.',
      selectedAgent: 'claude',
    },
  ],
})

const taskId = sequence.task.id

You can also call client.agents.createSequence as a convenience alias.

For local development in this repo, you can also import from ./sdk/typescript.

Wait for completion

const completed = await client.agents.waitForCompletion(task.id, {
  intervalMs: 2000,
})

Stream messages and logs (SSE)

Real-time streaming of messages, logs, and task updates:

await client.tasks.streamMessages(task.id, {
  onInit: (data) => {
    console.log(`Initial: ${data.messages.length} messages, ${data.logs.length} logs`)
  },
  onMessage: (message) => {
    console.log(`[${message.role}] ${message.content}`)
  },
  onLog: (log) => {
    console.log(`[${log.type}] ${log.message}`)
  },
  onTaskUpdate: (task) => {
    console.log(`Status: ${task.status}, Progress: ${task.progress}%`)
  },
  onComplete: (data) => {
    console.log(`Completed with status: ${data.status}`)
  },
})

See sdk-e2e-test/STREAMING_API.md for detailed documentation.

Stream logs (polling)

for await (const log of client.agents.watchLogs(task.id, { intervalMs: 1500 })) {
  handleLogEntry(log)
}

Authentication

  • apiKey is sent as a Bearer token in the Authorization header by default.
  • Override apiKeyHeader or apiKeyPrefix if your deployment uses a different scheme.
const client = new AnekClient({
  baseUrl: 'https://api.example.com',
  apiKey: 'YOUR_API_KEY',
  apiKeyHeader: 'x-api-key',
  apiKeyPrefix: '',
})

Build and test

cd sdk/typescript
npm install
npm run build
npm test

Publish (npm)

Publishing is automated via GitHub Actions in /.github/workflows/publish-anek-sdk.yml.

  1. Update the version in sdk/typescript/package.json.
  2. Create a git tag like anek-sdk-v0.1.0 and push it.
  3. Ensure the repo has the NPM_TOKEN secret configured.

The workflow builds, tests, and publishes the package from sdk/typescript.

API surface

  • client.agents: create/status/logs/messages helpers plus polling utilities
  • client.tasks: full task API (files, diffs, PRs, sandbox control, deployments)
  • client.auth: session, PATs, OAuth connect helpers
  • client.apiKeys: store/check model provider keys
  • client.git, client.github, client.gitlab, client.bitbucket: repo discovery and metadata
  • client.repos: commits, issues, pull requests
  • client.sandboxes: list, health, lifecycle
  • client.deployments, client.deploymentTokens: deployment logs and tokens
  • client.credits, client.payments: billing APIs
  • client.vercel: scope listing
  • client.connectors, client.taskManagement: connector management
  • client.mcp: JSON-RPC interface
  • client.webhooks: webhook helpers
  • client.misc: health, OpenAPI, GitHub stars, Sentry test