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

atabey-shared

v0.0.28

Published

Shared utility modules for Atabey — AI Governance & Multi-Agent Platform / Orchestrator

Readme

[GOV] Atabey Shared — Core Utility Library for AI Governance Platform

Version npm License: AGPL-3.0

Atabey Shared is the foundational utility package of the Agent Atabey framework. It provides the shared codebase, data structures, constants, security filters, database holders, logging layers, and locking mechanisms used by both atabey (Core CLI/Orchestrator) and atabey-mcp (MCP Server).


📋 Package Overview

| Module | Files | Core Responsibilities | |--------|-------|-----------------------| | PII Masking | pii.ts | Regex-based sanitization of 20+ sensitive patterns (emails, phones, credit cards, IP addresses, JWT tokens, API keys) | | Distributed Locking | lock.ts | Multi-process file-based lock implementation with stale lock detection (10s TTL) and retry backoff | | Enterprise Logger | logger.ts | Multi-destination structured logging (Stdout/Stderr + local files) supporting min-level and JSON formatting | | Data Retention | retention.ts | KVKK/GDPR-compliant telemetry and log pruning based on 30-day and 90-day retention policies | | Audit Logs | audit.ts | Unified JSON audit trail capturing agent actions, timestamps, trace IDs, and results | | Error Handling | errors.ts | Custom error classes (AtabeyBaseError, LockError, ComplianceError) preserving stack traces | | Constants & Types | constants.ts, types.ts | Centralized constants (Phase paths, candidate directories, MCP constants) and strictly branded types | | File System | fs.ts | Safe file write wrapper with automatic parent directory creation and encoding validation | | Database Holder | database.ts | Singleton SQLite database holder for shared workspace storage |


🚀 Installation

This package is designed as an internal shared module for the Atabey monorepo workspace, but it can be installed independently if needed:

npm install atabey-shared

⚙️ Core Modules Detail

1. PII Protection (KVKK/GDPR Compliance)

The pii.ts module scans and redacts sensitive data before it is logged to disk or sent to external LLM providers, ensuring absolute data privacy.

import { maskText } from "atabey-shared";

const sensitiveInput = "My phone is +90 555 123 45 67 and email is [email protected]";
const sanitizedText = maskText(sensitiveInput);
console.log(sanitizedText);
// Output: "My phone is ***-***-**** and email is ***@***"

2. Distributed Resource Locking

The lock.ts module prevents race conditions between parallel running agents writing to shared resources (e.g. PROJECT_MEMORY.md).

import { AtabeyLock } from "atabey-shared";

const lock = new AtabeyLock("project-memory", { ttlMs: 10000, retryCount: 3 });

try {
    const acquired = await lock.acquire();
    if (acquired) {
        // Safe region: write to file
    }
} finally {
    await lock.release();
}

3. Enterprise Logger

Structured logger wrapping process.stdout and process.stderr supporting log file logging and JSON output format.

import { logger, LogLevel } from "atabey-shared";

logger.configure({
    minLevel: LogLevel.DEBUG,
    jsonFormat: true,
    logFile: "./.atabey/logs/system.log"
});

logger.info("Database migration completed", { durationMs: 142 });

4. Branded Types

Ensures compile-time validation for workspace ID primitives to prevent mixing up agent names, message IDs, and task IDs.

import { AgentID, TaskID, asAgentID, asTaskID } from "atabey-shared";

const agent: AgentID = asAgentID("@backend");
const task: TaskID = asTaskID("TASK-102");

📦 Dependencies

  • better-sqlite3: SQLite database engine for storage shims
  • typescript: Type safety enforcement

License

AGPL-3.0 — Yusuf BEKAR

Developer: Yusuf BEKAR — "Order from Chaos"