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

agentmatrix

v0.1.15

Published

TypeScript SDK for AgentMatrix PaaS — teams, agents, threads, messages, attachments, skills, and volumes

Downloads

79

Readme

agentmatrix

TypeScript SDK for AgentMatrix PaaS — teams, agents, threads, messages, attachments, skills, and volumes.

Install

npm install agentmatrix

Quick Start

import { AgentMatrixClient } from "agentmatrix";

const client = new AgentMatrixClient({
  baseUrl: "https://your-paas-api.example.com",
  apiKey: "csp_your_api_key",
});

// Create a team (auto-creates a persistent Volume)
const team = await client.teams.create({ name: "my-team" });

// Add a Claude agent
const agent = await client.teams.addAgent(team.teamId, {
  agentId: "coder",
  acpxAgent: "claude",
  config: { systemPrompt: "You are a helpful coding assistant." },
});

// Upload an attachment
const attachment = await client.attachments.upload(
  team.teamId,
  new Blob(["task content"], { type: "text/plain" }),
  { filename: "task.txt", contentType: "text/plain" },
);

// Create a thread and send a message with the attachment
const thread = await client.threads.create(team.teamId);
const result = await client.messages.send(team.teamId, thread.threadId, "coder", {
  text: "Please read the attached file and complete the task.",
  attachmentIds: [attachment.attachmentId],
  timeoutMs: 300_000,
});

console.log(result.reply);

API

AgentMatrixClient

| Property | Description | |----------|-------------| | teams | Team & Agent CRUD | | threads | Thread CRUD | | messages | Send messages (sync/async), broadcast, multicast, query history | | attachments | Upload/download/list/delete attachments | | artifacts | Thread session file operations (list/read/write/delete/archive) | | skills | Create/update/list/delete reusable skill packages | | volumes | Direct volume file operations | | health | Health check | | admin | Admin operations (refresh env) | | apiKeys | API key lifecycle (create/list/revoke) |

Teams

client.teams.create({ name: "my-team", metadata?: { ... } })
client.teams.list()
client.teams.get(teamId)
client.teams.destroy(teamId)
client.teams.addAgent(teamId, { agentId, acpxAgent?, config?, envVars?, timeoutSeconds?, metadata? })
client.teams.getAgent(teamId, agentId)
client.teams.updateAgent(teamId, agentId, config)
client.teams.removeAgent(teamId, agentId)

Threads

client.threads.create(teamId, metadata?)
client.threads.list(teamId, { limit?, offset? })
client.threads.get(teamId, threadId)
client.threads.archive(teamId, threadId)

Messages

// Synchronous (waits for agent reply)
client.messages.send(teamId, threadId, agentId, { text, attachmentIds?, timeoutMs?, requestId? })

// Asynchronous (returns immediately)
client.messages.sendAsync(teamId, threadId, agentId, { text, attachmentIds?, timeoutMs?, requestId? })

// Broadcast to all agents
client.messages.sendAll(teamId, threadId, { text, attachmentIds?, timeoutMs?, requestId? })
client.messages.sendAllAsync(teamId, threadId, { text, attachmentIds?, timeoutMs?, requestId? })

// Multicast to specific agents
client.messages.sendSome(teamId, threadId, { text, agentIds, attachmentIds?, timeoutMs?, requestId? })
client.messages.sendSomeAsync(teamId, threadId, { text, agentIds, attachmentIds?, timeoutMs?, requestId? })

// Query history
client.messages.list(teamId, threadId, { limit?, offset? })

Attachments

// Upload (atomic: presigned URL → R2 direct upload → NFS sync)
client.attachments.upload(teamId, file, { filename, contentType? })

client.attachments.list(teamId)
client.attachments.getDownloadUrl(teamId, attachmentId)
client.attachments.delete(teamId, attachmentId)

Artifacts

// List artifacts in a thread session
client.artifacts.list(teamId, threadId, dir?)

// Read an artifact (returns download URL or content)
client.artifacts.read(teamId, threadId, path)

// Write content to an artifact
client.artifacts.write(teamId, threadId, { path, content, encoding? })

// Delete an artifact
client.artifacts.delete(teamId, threadId, path)

// Download all artifacts as tar.gz archive
client.artifacts.archive(teamId, threadId)

Skills

// Create + upload (atomic: metadata → upload zip → confirm)
const skill = await client.skills.create(teamId, {
  name: "code-reviewer",
  description: "Reviews code for bugs and security issues",
  file: readFileSync("./my-skill.zip"),  // optional, contains SKILL.md + resources
});

// Update
client.skills.update(teamId, skillId, { name?, description?, file? })

// CRUD
client.skills.list(teamId)
client.skills.get(teamId, skillId)
client.skills.delete(teamId, skillId)

// Bind to agent via config.skills
client.teams.addAgent(teamId, {
  agentId: "reviewer",
  config: { skills: [{ skillId: skill.skillId }] },
})

Volumes

client.volumes.uploadFile(volumeId, file, { filename })
client.volumes.getUploadUrl(volumeId, filename)
client.volumes.uploadToR2(presignedUrl, file)
client.volumes.sync(volumeId, r2Key)

Health

const status = await client.health.check();
// { ok: true, uptimeMs: 12345, agents: 3, wsClients: 1 }

Admin

const result = await client.admin.refreshEnv();
// { total: 5, success: 5, failed: [] }

API Keys

// Create (requires bootstrap key)
const { key } = await client.apiKeys.create("my-team");

client.apiKeys.list()
client.apiKeys.revoke(id)

Error Handling

import { AgentMatrixError } from "agentmatrix";

try {
  await client.teams.get("nonexistent");
} catch (err) {
  if (err instanceof AgentMatrixError) {
    console.log(err.statusCode); // 404
    console.log(err.message);    // "team not found"
  }
}

License

MIT