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

contextvault-client

v0.4.0

Published

Typed SDK + CLI for Context Vault — talk to the daemon at contextvault.metisos.co from Node, browsers, agents, or the terminal.

Readme

contextvault-client

Typed SDK and CLI for Context Vault — talk to the daemon from Node, browsers, agents, or the terminal.

npm install contextvault-client          # SDK + cv CLI
npm install -g contextvault-client       # also puts `cv` on PATH

Two ways to use it

From code — import { CVClient } …

import { CVClient } from "contextvault-client";

const cv = new CVClient({
  baseUrl: "https://contextvault.metisos.co/api/cv",
  token: process.env.CV_TOKEN!,
  workspaceId: "ws-mngwr1n8-uhqfgq",
});

// Upsert — creates the artifact, or updates it if the URI already exists
const result = await cv.artifacts.save(
  "ctx://ws-…/engineering/architecture.md",
  "# Architecture\n\n…",
);

// Search the typed graph
const hits = await cv.search.query({ q: "vector DB", limit: 5 });

// Walk the catalog
const ws = await cv.catalog.workspace();
const eng = await cv.catalog.dept("engineering");

// Subscribe to live changes (Node / server-side)
for await (const event of cv.subscriptions.stream({ pattern: "ctx://ws-…/engineering/**" })) {
  console.log(event.event_type, event.artifact_uri);
}

From the terminal — cv

cv login                                 # device-flow auth (opens browser)
cv workspaces                            # list workspaces you can access
cv use ws-mngwr1n8-uhqfgq                # set the active workspace
cv ls engineering/                       # list artifacts at a path
cv cat ctx://ws-…/engineering/foo.md     # print an artifact
cv push ./local-file.md ctx://ws-…/…/foo.md
cv push-folder ./docs/ ctx://ws-…/product/
cv watch ./docs/ --to ctx://ws-…/product/
cv agent register --name "my-bot" --grants 'read:ctx://ws-…/**'

Both interfaces are the same package, sharing the same types and error classes — switching between a script and the terminal doesn't change the contract.

Typed errors

Every method throws a typed CVError subclass:

import { CVConflictError, CVForbiddenError } from "contextvault-client";

try {
  await cv.artifacts.create({ uri, name, content_type, content });
} catch (e) {
  if (e instanceof CVConflictError) {
    // URI already exists — use save() instead, or update()
  } else if (e instanceof CVForbiddenError) {
    // Actor lacks the grant
  } else {
    throw e;
  }
}

| Status | Class | Retryable | | -------- | ----------------------------- | --------- | | 400, 422 | CVValidationError | no | | 401 | CVAuthError | no | | 403 | CVForbiddenError | no | | 404 | CVNotFoundError | no | | 409 | CVConflictError | sometimes | | 412 | CVPreconditionFailedError | yes | | 5xx | CVServerError | yes | | network | CVNetworkError | yes | | n/a | CVSchemaError (wire drift) | no |

Resources

| Resource | What it covers | | --------------------- | ----------------------------------------------------------------------------------- | | client.artifacts | get / create / update / save (upsert) / delete / history / list / neighborhood / blob / move | | client.search | FTS5 keyword search | | client.catalog | workspace / stats / dept / folder | | client.edges | create / remove / query / listAll / neighbors | | client.workers | list / operators / agents | | client.provenance | query / forUri | | client.folders | list / get / upsert / remove (folder metadata) | | client.actors | create / list / get / heartbeat | | client.permissions | create / list / revoke / effective / explain | | client.subscriptions| stream (SSE AsyncIterable) | | client.chat | send (MetisOS turn) | | client.health | check |

Wire types

All wire shapes are exported as inferred Zod types:

import type { Artifact, SearchResponse, ChangeEvent } from "contextvault-client";

Or, for runtime validation:

import * as schemas from "contextvault-client/schemas";
const parsed = schemas.ArtifactSchema.parse(unknownInput);

License

Apache-2.0