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

@marrowid/sdk

v1.0.11

Published

Typed Marrow client for evidence-grounded, correctable agent memory.

Readme

@marrowid/sdk

The official TypeScript client for Marrow. It provides one typed surface for source ingest, evidence-backed query, and correctable agent memory in modern Node.js and browsers.

Install

npm install @marrowid/[email protected]

Connect and retrieve context

Create a customer API key with only the scopes your application needs, then copy it into the client from secret storage. A customer API key is an application credential; it is not a Console login session or an admin token.

import { Marrow } from "@marrowid/sdk";

const marrow = new Marrow({
  apiKey: process.env.MARROW_API_KEY!,
});

const peer = marrow.peer("riley");
const context = await peer.ask("What should this assistant remember?");

if (context.status === "insufficient_evidence") {
  throw new Error("Add source material before using Marrow context");
}

const messages = context.toOpenAI();

Context.toOpenAI() returns an OpenAI-compatible system-message array. Context.toAnthropic() returns an Anthropic-compatible system prompt. These are plain data adapters and do not add provider SDK dependencies.

Every asynchronous method returns a named TypeScript response type. Use marrow.access() to inspect the active key's scopes, context boundaries, quotas, and credit balance before starting work.

Ingest sources

Dry runs preview a source without an idempotency key. Live ingest requires a caller-owned key between 8 and 160 characters; reuse it for an exact retry.

const preview = await marrow.ingest.url("https://example.com/onboarding-note");

const queued = await marrow.ingest.url("https://example.com/onboarding-note", {
  dryRun: false,
  datedAt: "2026-07-15",
  idempotencyKey: "onboarding-note-2026-07-15",
});

if (queued.schemaVersion === "marrow-ingest-job-v1") {
  const completed = await marrow.ingest.jobs.wait(queued.job.id);
  console.log(completed.job.status);
}

Browser and Node byte sources use the same file method:

await marrow.ingest.file({
  filename: "preferences.md",
  contentType: "text/markdown",
  content: new TextEncoder().encode("Prefers aisle seats."),
  dryRun: false,
  datedAt: "2026-07-15",
  idempotencyKey: "preferences-file-2026-07-15",
});

Write and correct memory

const session = marrow.session("project-update");
const receipt = await session.addMessages(
  [{ role: "user", content: "Lead project updates with the decision." }],
  { peerId: "riley", infer: true },
);

const event = await marrow.events.get(receipt.event_id);
if (event.status === "failed" || event.status === "quarantined") {
  throw new Error(`Memory event ended with ${event.status}`);
}

const claim = await marrow.claims.get("claim-id");
const corrected = await marrow.claims.update(
  claim.id,
  "Lead project updates with the decision and its cited source.",
  { headRevision: claim.head_revision, reason: "User clarified the preference." },
);

await marrow.claims.delete(claim.id, {
  headRevision: corrected.head_revision,
  reason: "User withdrew the preference.",
});

Claim corrections preserve history and use the current head_revision as an opaque concurrency token. A stale revision returns a typed ConflictError.

Delete a source, peer, or session through the same client. Each deletion is asynchronous and returns the existing job or event receipt for polling:

const sourceDeletion = await marrow.sources.delete(sourceId);
await marrow.ingest.jobs.wait(sourceDeletion.job.id);

const peerDeletion = await marrow.peer("riley").delete();
await marrow.events.get(peerDeletion.event_id);

Errors and transport

The client maps validation, wrong-credential, missing-scope, not-found, and conflict responses to typed errors. Malformed success bodies fail closed with MarrowResponseError. API keys are held in private in-memory fields and are never included in client JSON or error objects.

The default transport uses the platform fetch. Supply fetch in the constructor for a compatible runtime, test harness, or controlled proxy. Remote base URLs require HTTPS; plain HTTP is accepted only for loopback development.

Public surface

  • new Marrow({ apiKey, baseURL?, workspace?, timeoutMs?, fetch? })
  • marrow.access()
  • marrow.ingest.url() / .file() / .jobs.list() / .get() / .wait()
  • marrow.sources.delete(sourceId)
  • marrow.query()
  • marrow.workspaces.upsert() / .list()
  • marrow.peer(id).create() / .get() / .ask() / .context() / .representation() / .delete()
  • marrow.session(id).create() / .get() / .addMessages() / .messages() / .context() / .delete()
  • marrow.claims.query() / .list() / .get() / .history() / .update() / .delete()
  • marrow.events.get() / marrow.queue.status()

Proprietary. UNLICENSED means this package is a distribution channel, not an open-source grant.