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

@tekmemo/agentfs

v0.1.0

Published

AgentFS-backed MemoryStore adapter for TekMemo with sync and lease management.

Downloads

114

Readme

@tekmemo/agentfs

npm License: MIT Types CI Status

AgentFS-backed MemoryStore adapter for TekMemo.

This package lets TekMemo use an AgentFS-like remote file runtime while preserving the canonical local memory protocol:

.tekmemo/
  manifest.json
  memory/core.md
  memory/notes.md
  events/memory-events.jsonl
  events/conversations.jsonl
  indexes/chunks.jsonl
  graph/nodes.jsonl
  graph/edges.jsonl
  snapshots/snapshots.jsonl

Install

pnpm add tekmemo @tekmemo/agentfs

Basic usage

import { bootstrapMemoryStore, CORE_MEMORY_PATH } from "tekmemo";
import { createAgentfsMemoryStore } from "@tekmemo/agentfs";

const store = createAgentfsMemoryStore(agentfsClient, {
  scope: "project",
  projectId: "proj_123"
});

await bootstrapMemoryStore(store);
await store.write(CORE_MEMORY_PATH, "# Core Memory\n");

Behind the scenes, CORE_MEMORY_PATH resolves to:

/stores/project/proj_123/.tekmemo/memory/core.md

Supported scopes

createAgentfsMemoryStore(client, {
  scope: "project",
  projectId: "proj_123"
});

createAgentfsMemoryStore(client, {
  scope: "user",
  userId: "usr_123"
});

createAgentfsMemoryStore(client, {
  scope: "session",
  sessionId: "sess_123"
});

AgentFS-like client contract

AgentFS is still a beta surface, so this package intentionally accepts a small structural client instead of importing a hard SDK type. In production, pass the real AgentFS SDK/client object through this boundary as long as it provides the methods below.

interface AgentfsLikeClient {
  readText(path: string): Promise<string>;
  writeText(path: string, content: string): Promise<void>;
  appendText?(path: string, content: string): Promise<void>;
  exists?(path: string): Promise<boolean>;
  sync?: {
    pull?(): Promise<void>;
    push?(): Promise<void>;
    checkpoint?(label: string): Promise<void>;
  };
}

appendText and exists are optional. If appendText is missing, the store can fall back to same-instance serialized read/write append.

Missing file behavior

The default behavior matches the production TekMemo core store: missing reads throw MemoryNotFoundError.

createAgentfsMemoryStore(client, {
  scope: "project",
  projectId: "proj_123",
  missingFileBehavior: "throw"
});

For older relaxed behavior:

createAgentfsMemoryStore(client, {
  scope: "project",
  projectId: "proj_123",
  missingFileBehavior: "empty"
});

Sync hooks

import { syncBeforeSession, syncAfterSession } from "@tekmemo/agentfs";

await syncBeforeSession(agentfsClient);

// run agent session

await syncAfterSession(agentfsClient, "after-agent-session");

syncAfterSession checkpoints before pushing by default.

Leases

import { InMemoryLeaseManager, withMemoryLease } from "@tekmemo/agentfs";

const leaseManager = new InMemoryLeaseManager();

await withMemoryLease({
  leaseManager,
  storeId: "project:proj_123",
  ownerId: "worker-1",
  ttlMs: 30_000,
  operation: async () => {
    // critical memory operation
  }
});

The in-memory lease manager is useful for tests and single-process coordination. Distributed production leases should use a durable/shared implementation.

Edge cases handled

  • invalid AgentFS client shape
  • invalid scope
  • missing scope IDs
  • unsafe IDs with /, \\, .., null bytes, spaces, or unsupported characters
  • unsafe root prefixes
  • unsupported TekMemo memory paths
  • path traversal attempts
  • missing files
  • non-string provider responses
  • non-string write/append content
  • client read/write/append/exists failures
  • optional native append support
  • read/write fallback append
  • same-instance append serialization
  • sync no-op behavior
  • sync failure wrapping
  • checkpoint label validation
  • lease contention
  • expired leases
  • release-on-error lease behavior

Package boundary

@tekmemo/agentfs only adapts TekMemo's MemoryStore contract to an AgentFS-like file runtime.

It does not own:

  • the .tekmemo/ protocol itself
  • local filesystem storage
  • vector recall
  • embeddings
  • reranking
  • cloud billing
  • cloud tenancy
  • BYOK storage