atabey-shared 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +25 -26
  2. package/package.json +3 -2
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # [GOV] Atabey Shared — Core Utility Library for AI Governance Platform
1
+ # [GOV] Atabey Shared — Core Utility Library for the AI Governance Platform
2
2
 
3
- [![Version](https://img.shields.io/badge/Version-v0.1.0-blue.svg)](https://github.com/ysf-bkr/atabey)
3
+ [![Version](https://img.shields.io/badge/Version-v0.1.2-blue.svg)](https://github.com/ysf-bkr/atabey)
4
4
  [![npm](https://img.shields.io/npm/v/atabey-shared)](https://www.npmjs.com/package/atabey-shared)
5
5
  [![License: AGPL-3.0](https://img.shields.io/badge/License-AGPL--3.0-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
6
6
 
7
- **Atabey Shared** is the foundational utility package of the 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).
7
+ **Atabey Shared** is the foundational utility package of the Atabey framework: shared constants and branded types, security filters (PII, secrets, TLS, policy gate), the SQLite holder and migrations, structured logging, audit chain, concurrency primitives (locks, job queue, worker pool) and the sandbox runtime — used by both `atabey` (core CLI/orchestrator) and `atabey-mcp` (MCP server).
8
8
 
9
9
  ---
10
10
 
@@ -24,7 +24,7 @@
24
24
 
25
25
  ## 🚀 Installation
26
26
 
27
- This package is designed as an **internal shared module** for the Atabey monorepo workspace, but it can be installed independently if needed:
27
+ Designed as an **internal shared module** for the Atabey monorepo workspace, but installable independently:
28
28
 
29
29
  ```bash
30
30
  npm install atabey-shared
@@ -35,9 +35,9 @@ npm install atabey-shared
35
35
  ## 🧩 Module Structure
36
36
 
37
37
  The package is organized into focused **module groups**. `src/index.ts` is a barrel
38
- that re-exports everything flat **plus** a `Modules.<Group>` namespace per group;
39
- the flat `atabey-shared/*.js` entry points are kept as thin re-export shims for
40
- backward compatibility.
38
+ that re-exports everything flat **plus** a `Modules.<Group>` namespace per group; the
39
+ flat `atabey-shared/*.js` entry points are kept as thin re-export shims for backward
40
+ compatibility.
41
41
 
42
42
  ```
43
43
  packages/shared/
@@ -73,21 +73,16 @@ import { maskText } from "atabey-shared/security/pii.js";
73
73
  ## ⚙️ Core Modules Detail
74
74
 
75
75
  ### 1. PII Protection (KVKK/GDPR Compliance)
76
- 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.
76
+ The `pii.ts` module scans and redacts sensitive data before it is logged to disk or sent to external LLM providers.
77
77
  ```typescript
78
78
  import { maskText } from "atabey-shared";
79
79
 
80
- const sensitiveInput = "My phone is +90 555 123 45 67 and email is admin@company.com";
81
- const sanitizedText = maskText(sensitiveInput);
82
- console.log(sanitizedText);
83
- // Output: "My phone is ***-***-**** and email is ***@***"
80
+ const sanitized = maskText("My phone is +90 555 123 45 67 and email is admin@company.com");
81
+ // "My phone is ***-***-**** and email is ***@***"
84
82
  ```
85
83
 
86
84
  ### 2. Distributed Resource Locking
87
- The `lock.ts` module provides a SQLite-backed `DistributedLock` (server-authoritative,
88
- with stale-lock reclaim) that prevents race conditions between parallel agents writing
89
- to shared resources (e.g. `PROJECT_MEMORY.md`). For a lightweight file-based lock, use
90
- `AtomicFileLock` from `file-lock.ts`.
85
+ `lock.ts` provides a SQLite-backed `DistributedLock` (server-authoritative, with stale-lock reclaim) that prevents race conditions between parallel agents writing to shared resources. For a lightweight file-based lock, use `AtomicFileLock` from `file-lock.ts`.
91
86
  ```typescript
92
87
  import { DistributedLock } from "atabey-shared";
93
88
 
@@ -104,21 +99,16 @@ if (DistributedLock.acquire("PROJECT_MEMORY.md", owner, { ttlMs: 10000, reason:
104
99
  ```
105
100
 
106
101
  ### 3. Structured Logger
107
- Structured logger wrapping `process.stdout` and `process.stderr` supporting log file logging and JSON output format.
102
+ Structured logger wrapping `process.stdout`/`process.stderr`, with file logging and JSON output.
108
103
  ```typescript
109
104
  import { logger, LogLevel } from "atabey-shared";
110
105
 
111
- logger.configure({
112
- minLevel: LogLevel.DEBUG,
113
- jsonFormat: true,
114
- logFile: "./.atabey/logs/system.log"
115
- });
116
-
106
+ logger.configure({ minLevel: LogLevel.DEBUG, jsonFormat: true, logFile: "./.atabey/logs/system.log" });
117
107
  logger.info("Database migration completed", { durationMs: 142 });
118
108
  ```
119
109
 
120
110
  ### 4. Branded Types
121
- Ensures compile-time validation for workspace ID primitives to prevent mixing up agent names, message IDs, and task IDs.
111
+ Compile-time validation for workspace ID primitives to prevent mixing agent names, message IDs and task IDs.
122
112
  ```typescript
123
113
  import { AgentID, TaskID, asAgentID, asTaskID } from "atabey-shared";
124
114
 
@@ -130,10 +120,19 @@ const task: TaskID = asTaskID("TASK-102");
130
120
 
131
121
  ## 📦 Dependencies
132
122
 
133
- - **js-tiktoken**: `cl100k_base` BPE tokenizer for token/cost accounting
123
+ - **js-tiktoken**: `cl100k_base` BPE tokenizer for token accounting
134
124
  - **better-sqlite3**, **chalk**, **zod** _(peer)_: storage, terminal styling and runtime validation
135
125
 
136
- ---
126
+ ## 🔗 Related Packages
127
+
128
+ | Package | Role | Links |
129
+ |---------|------|-------|
130
+ | **atabey** | Core engine — CLI, agents, engines, orchestrator | [npm](https://www.npmjs.com/package/atabey) · [source](https://github.com/ysf-bkr/atabey/tree/main/packages/atabey) |
131
+ | **atabey-mcp** | MCP server — 40 tools & governance pipeline | [npm](https://www.npmjs.com/package/atabey-mcp) · [source](https://github.com/ysf-bkr/atabey/tree/main/packages/atabey-mcp) |
132
+ | **atabey-shared** | Shared utilities — constants, storage, PII, audit, locks | [npm](https://www.npmjs.com/package/atabey-shared) · [source](https://github.com/ysf-bkr/atabey/tree/main/packages/shared) |
133
+
134
+ > Full bilingual documentation (TR + EN): **[github.com/ysf-bkr/atabey](https://github.com/ysf-bkr/atabey#readme)**
135
+
137
136
 
138
137
  ## License
139
138
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atabey-shared",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Shared utility modules for Atabey — Local AI Control Plane & Discipline Layer",
5
5
  "author": "Yusuf BEKAR",
6
6
  "license": "AGPL-3.0",
@@ -81,7 +81,8 @@
81
81
  "build": "tsc",
82
82
  "test": "vitest run",
83
83
  "test:watch": "vitest",
84
- "test:coverage": "vitest run --coverage"
84
+ "test:coverage": "vitest run --coverage",
85
+ "prepublishOnly": "node ../../scripts/build-readmes.mjs && npm run build"
85
86
  },
86
87
  "peerDependencies": {
87
88
  "better-sqlite3": "^13.0.2",