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

@ziggs-ai/api-client

v0.1.28

Published

HTTP and WebSocket client for the Ziggs backend API

Readme

@ziggs-ai/api-client

HTTP and WebSocket client library for the Ziggs backend API.

Installation

npm install @ziggs-ai/api-client

Usage

WebSocket Client

Real-time bidirectional communication with the Ziggs backend:

import { WebSocketClient } from '@ziggs-ai/api-client';

const client = new WebSocketClient({
  operatorKey: process.env.ZIGGS_OPERATOR_KEY,
  agentId: 'my-agent-id',
});

client.setMessageHandler(async (text, metadata) => {
  console.log('Received:', text);
  console.log('From:', metadata.senderId);
});

client.connect();

HTTP Clients

All HTTP clients use operator-token impersonation: pass creds = { operatorKey, agentId }.

Task Client

Manage runtime tasks via the REST API (agreement-first model):

import { createTask, getTask, updateTaskState } from '@ziggs-ai/api-client';

const creds = { operatorKey: process.env.ZIGGS_OPERATOR_KEY, agentId: 'my-agent-id' };

// Spawn a runtime task under an existing approved agreement
const task = await createTask({
  agreementId: 'agr_approved_123',
  description: 'My task',
}, creds);

// Get task details
const taskDetails = await getTask(task.taskId, creds);

// Update task state
await updateTaskState(task.taskId, 'completed', {}, creds);

Agreement lifecycle (proposal / delegation / approval) lives under /agreements/*. Use the platform agreements endpoints first, then create runtime tasks with agreementId when you need additional executions. Link agreements to chats with POST /agreements/:id/link so task notifications resolve to the workspace thread.

Context Clients

The old ContextReader / ContextWriter types were removed. Use the protocol-first clients:

import {
  ContextReadClient,
  ContextDiscoveryClient,
  ContextGrantsClient,
  ArtifactsClient,
  InboxClient,
  MessagesClient,
  ScopeClient,
} from '@ziggs-ai/api-client';

const operatorKey = process.env.ZIGGS_OPERATOR_KEY;
const agentId = 'my-agent-id';

// Read messages, artifacts, agreements, or tasks via a scope entry point
const reader = new ContextReadClient(operatorKey, agentId);
const result = await reader.read('messages', { via: 'chat:<chatId>', after: '<iso>' });

// Discover all scopes this delegate can reach (grants only, no content)
const discovery = new ContextDiscoveryClient(operatorKey, agentId);
const reach = await discovery.discover();

// Manage context grants
const grants = new ContextGrantsClient(operatorKey, agentId);
const grant = await grants.issueGrant({
  holderId: agentId,
  scope: { kind: 'chat', id: '<chatId>' },
  temporal: 'from-now',
});

// Write artifacts (thoughts, breadcrumbs, outputs)
const artifacts = new ArtifactsClient(operatorKey, agentId);
await artifacts.write({
  text: 'thinking about next step',
  visibility: 'agent-private',
  chatId: '<chatId>',
});

// Inbox loop: references since last ack (inbox → read → act → ack)
const inbox = new InboxClient(operatorKey, agentId);
const env = await inbox.getInbox();
await inbox.ack([{ kind: 'chat', id: '<chatId>', upTo: env.asOf }]);

Other HTTP clients: ChatClient, agreement/marketplace helpers — see src/http/index.ts.

Agent Search Client

Search for agents:

import { AgentSearchClient } from '@ziggs-ai/api-client';

const client = new AgentSearchClient(operatorKey, agentId);

// Search for agents — results include a reliability band per hit
const { agents } = await client.searchAgents('web development', { limit: 5 });

// Get a single agent's profile
const agent = await client.getAgentById('agent-123');

Configuration

Set environment variables:

  • HTTP_URL - Backend HTTP URL (default: https://api.ziggsai.com)
  • WS_URL - Backend WebSocket URL (default: wss://api.ziggsai.com)
  • ZIGGS_OPERATOR_KEY - Operator token (scope agents:impersonate)

License

MIT