zaileys 3.1.0 → 3.2.0
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.
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +5 -2
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -11
- package/.kelar/kelar-tools.cjs +0 -829
- package/.kelar/memory/INDEX.md +0 -21
- package/.kelar/memory/technical/issue-34-sendpresenceupdate-undefined.md +0 -4
- package/.kelar/memory/technical/lmdb-native-binary-fallback.md +0 -4
- package/.kelar/memory/technical/nedbadapter-ignoring-encoder-causes-buffer-typing-crash-err-invalid-arg-type.md +0 -4
- package/.kelar/memory/technical/signal-media-constructor-input-contract.md +0 -4
- package/.kelar/memory/technical/sticker-example-source-format.md +0 -4
- package/.kelar/memory/technical/ts2307-missing-seald-io-nedb.md +0 -4
- package/.kelar/memory/technical/ts2307-missing-zaileys-store-adapters.md +0 -4
- package/.kelar/plans/README.md +0 -3
- package/.kelar/research/README.md +0 -3
- package/.kelar/research/mysql-adapter-research.md +0 -32
- package/.kelar/state/ASSUMPTIONS.md +0 -14
- package/.kelar/state/DEBT.md +0 -13
- package/.kelar/state/DIARY.md +0 -15
- package/.kelar/state/HANDOFF.md +0 -54
- package/.kelar/state/PATTERNS.md +0 -43
- package/.kelar/state/STATE.md +0 -37
- package/.kelar/state/TASKS.md +0 -146
- package/AGENTS.md +0 -108
- package/CHANGELOG.md +0 -12
- package/GEMINI.md +0 -58
- package/packages/media-process/CHANGELOG.md +0 -7
- package/packages/media-process/LICENSE +0 -21
- package/packages/media-process/dist/index.d.mts +0 -142
- package/packages/media-process/dist/index.d.ts +0 -142
- package/packages/media-process/dist/index.mjs +0 -3
- package/packages/media-process/package.json +0 -39
- package/packages/media-process/tsconfig.json +0 -15
- package/packages/mysql-adapter/dist/index.d.mts +0 -36
- package/packages/mysql-adapter/dist/index.d.ts +0 -36
- package/packages/mysql-adapter/dist/index.js.map +0 -1
- package/packages/mysql-adapter/dist/index.mjs +0 -101
- package/packages/mysql-adapter/dist/index.mjs.map +0 -1
- package/packages/mysql-adapter/package.json +0 -36
- package/pnpm-workspace.yaml +0 -3
- package/tsconfig.json +0 -19
package/.kelar/memory/INDEX.md
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# KELAR Knowledge Index
|
|
2
|
-
Last updated: 2026-03-24
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Domain
|
|
6
|
-
*(none yet)*
|
|
7
|
-
|
|
8
|
-
## Technical
|
|
9
|
-
- **Issue #34: sendPresenceUpdate undefined** — Issue #34: sendPresenceUpdate undefined Root cause: centerStore had a 10m TTL ca
|
|
10
|
-
- **LMDB Native Binary Fallback** — LMDB Native Binary Fallback Resolved a hard crash where LMDBAdapter would fail o
|
|
11
|
-
- **NeDBAdapter ignoring encoder causes Buffer typing crash (ERR_INVALID_ARG_TYPE)** — NeDBAdapter ignoring encoder causes Buffer typing crash (ERR_INVALID_ARG_TYPE) W
|
|
12
|
-
- **Signal media constructor input contract** — Signal media constructor input contract Media constructor expects raw MediaInput
|
|
13
|
-
- **Sticker example source format** — Sticker example source format Picsum sticker endpoint can return unsupported ada
|
|
14
|
-
- **TS2307 missing @seald-io/nedb** — TS2307 missing @seald-io/nedb Fix: add @seald-io/nedb to root dependencies; tsc
|
|
15
|
-
- **TS2307: Missing @zaileys/store-adapters** — TS2307: Missing @zaileys/store-adapters After removing @zaileys/store-adapters p
|
|
16
|
-
|
|
17
|
-
## Solutions
|
|
18
|
-
*(none yet)*
|
|
19
|
-
|
|
20
|
-
## Environment
|
|
21
|
-
*(none yet)*
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
## LMDB Native Binary Fallback
|
|
2
|
-
Added: 2026-03-22
|
|
3
|
-
|
|
4
|
-
LMDB Native Binary Fallback Resolved a hard crash where LMDBAdapter would fail on platforms without compatible native binaries (e.g. Darwin ARM64) even if the package was installed. Implemented a try-catch fallback in getOrOpenDB to automatically switch to JSONAdapter when initialization fails.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
## NeDBAdapter ignoring encoder causes Buffer typing crash (ERR_INVALID_ARG_TYPE)
|
|
2
|
-
Added: 2026-03-24
|
|
3
|
-
|
|
4
|
-
NeDBAdapter ignoring encoder causes Buffer typing crash (ERR_INVALID_ARG_TYPE) When switching from LMDBAdapter to NeDBAdapter, the encoder wrapper was ignored. This caused Baileys auth state which is populated with Buffer structures to load as generic JSON objects from disk, resulting in fatal unhandled crashes when passing those objects to the crypto library. Fixed by checking options.encoder and applying it during set/get loops inside NeDBAdapter.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
## Signal media constructor input contract
|
|
2
|
-
Added: 2026-03-24
|
|
3
|
-
|
|
4
|
-
Signal media constructor input contract Media constructor expects raw MediaInput (string/Buffer/ArrayBuffer), not keyed objects like {sticker: ...}. Passing keyed objects can trigger unsupported format failures during sticker processing.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
## Sticker example source format
|
|
2
|
-
Added: 2026-03-24
|
|
3
|
-
|
|
4
|
-
Sticker example source format Picsum sticker endpoint can return unsupported adaptive image formats for sticker conversion. Use a deterministic PNG/JPEG source URL in examples to prevent runtime sticker creation failures.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
## TS2307: Missing @zaileys/store-adapters
|
|
2
|
-
Added: 2026-03-23
|
|
3
|
-
|
|
4
|
-
TS2307: Missing @zaileys/store-adapters After removing @zaileys/store-adapters package, legacy imports in src/Config/database.ts and src/Classes/client.ts must be updated to src/Types/store.ts (IStoreAdapter) and src/Library/nedb.ts (NeDBAdapter).
|
package/.kelar/plans/README.md
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# MySQL Adapter Research Findings
|
|
2
|
-
|
|
3
|
-
## 🛠️ Technology Stack
|
|
4
|
-
- **Driver**: `mysql2/promise` (Fastest, Promise-based).
|
|
5
|
-
- **Pooling**: Use `mysql2.createPool` with a sensible limit (e.g., 10-20 connections).
|
|
6
|
-
- **Concurrency**: `async-mutex` for thread-safe batching.
|
|
7
|
-
|
|
8
|
-
## 📊 Schema Design
|
|
9
|
-
```sql
|
|
10
|
-
CREATE TABLE IF NOT EXISTS `zaileys_store` (
|
|
11
|
-
`id` VARCHAR(255) PRIMARY KEY,
|
|
12
|
-
`data` JSON NOT NULL,
|
|
13
|
-
`updatedAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
|
14
|
-
);
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## 🚀 Performance Strategy: Write-Behind Batching
|
|
18
|
-
Baileys can trigger thousands of writes. We will implement a "Write-Behind" strategy:
|
|
19
|
-
1. **Accumulate**: Changes are stored in a local `Map`.
|
|
20
|
-
2. **Debounce/Interval**: Every 500ms-1000ms, the `Map` is flushed to MySQL.
|
|
21
|
-
3. **Bulk Upsert**:
|
|
22
|
-
```sql
|
|
23
|
-
INSERT INTO zaileys_store (id, data)
|
|
24
|
-
VALUES ?
|
|
25
|
-
ON DUPLICATE KEY UPDATE data = VALUES(data)
|
|
26
|
-
```
|
|
27
|
-
*Note: `VALUES` array format: `[[id1, data1], [id2, data2], ...]`*
|
|
28
|
-
|
|
29
|
-
## ⚠️ Gotchas
|
|
30
|
-
- **Max Packet Size**: Batch chunks should be limited to ~500 rows to avoid `max_allowed_packet` errors.
|
|
31
|
-
- **Connection Loss**: Need to handle pool reconnections automatically.
|
|
32
|
-
- **Data Integrity**: Ensure the flush happens on process exit.
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# KELAR Assumption Log
|
|
2
|
-
> Every assumption AI makes is logged here until verified.
|
|
3
|
-
Last updated: 2026-03-22
|
|
4
|
-
|
|
5
|
-
## Active (Unverified)
|
|
6
|
-
> None yet.
|
|
7
|
-
|
|
8
|
-
## Verified
|
|
9
|
-
| Date | Assumption | Verified As |
|
|
10
|
-
|------|------------|-------------|
|
|
11
|
-
|
|
12
|
-
## Corrected
|
|
13
|
-
| Date | Original | Actual | Impact |
|
|
14
|
-
|------|----------|--------|--------|
|
package/.kelar/state/DEBT.md
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Technical Debt & Anti-Patterns: Zaileys
|
|
2
|
-
|
|
3
|
-
## 🚨 Critical Items
|
|
4
|
-
- **Missing Dev Script Target**: `package.json` references `examples/test.ts` in the `dev` script, but the file is missing in the repository. (Found: `examples/basic.ts` exists instead).
|
|
5
|
-
- **Loose Type Safety in Store**: `centerStore.get('socket')` and similar calls rely on manual casting (e.g., `as any`). A typed store wrapper or bridge would be safer.
|
|
6
|
-
|
|
7
|
-
## ⚠️ Improvements
|
|
8
|
-
- **Registry Visibility**: `UnifiedStore` snapshot exports full records, which might become large. Consider partial snapshots or debugging-only exports.
|
|
9
|
-
- **FireForget Error Handling**: Default error handler only logs to console. Could benefit from a more centralized logging integration with `pino`.
|
|
10
|
-
- **Plugin HMR Scope**: HMR might cause side effects if plugins register global event listeners without cleanup logic.
|
|
11
|
-
|
|
12
|
-
## 🧹 Maintenance
|
|
13
|
-
- **Documentation**: README is very large but could use a separate `ARCHITECTURE.md` to offload some technical details.
|
package/.kelar/state/DIARY.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# KELAR Session Diary
|
|
2
|
-
> Auto-written on /kelar:pause. Append-only.
|
|
3
|
-
Last updated: 2026-03-22
|
|
4
|
-
|
|
5
|
-
## Entry Format
|
|
6
|
-
```
|
|
7
|
-
## [Date] [Time]
|
|
8
|
-
Worked on: [feature/fix]
|
|
9
|
-
Completed: [bullet list]
|
|
10
|
-
Decisions: [pattern decisions → PATTERNS.md]
|
|
11
|
-
Debt : [DEBT.md additions]
|
|
12
|
-
Next : [exact next task]
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
> Sessions will appear here.
|
package/.kelar/state/HANDOFF.md
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# KELAR HANDOFF
|
|
2
|
-
Generated: 2026-03-24 23:05:57
|
|
3
|
-
|
|
4
|
-
## Status
|
|
5
|
-
Feature : Working on nothing
|
|
6
|
-
Next step : Check TASKS.md
|
|
7
|
-
|
|
8
|
-
## Recent Activity
|
|
9
|
-
```
|
|
10
|
-
[2026-03-22 18:30:51] ✅ done Fixed 3 compilation errors
|
|
11
|
-
[2026-03-22 18:30:57] ✅ done Verified all compilation errors are fixed
|
|
12
|
-
|
|
13
|
-
## [2026-03-22 18:31:07] FIX COMPLETE ✅: fix_done src/Classes/client.ts & src/Store/Adapters/nedb.ts — fixed: internal imports and missing dependency
|
|
14
|
-
[2026-03-22 18:31:19] ✅ done Moved nedb.ts to src/Library
|
|
15
|
-
[2026-03-22 18:34:48] ✅ done Fixed all compilation errors after NeDB relocation
|
|
16
|
-
|
|
17
|
-
## [2026-03-23 11:54:42] FIX STARTED: fix_start TS2307: Cannot find module @zaileys/store-adapters
|
|
18
|
-
|
|
19
|
-
## [2026-03-23 11:56:05] TASK STARTED
|
|
20
|
-
start Task: Fixing legacy @zaileys/store-adapters imports | Files: src/Config/database.ts, src/Classes/client.ts
|
|
21
|
-
|
|
22
|
-
## [2026-03-23 11:56:35] FIX COMPLETE ✅: fix_done TS2307: Missing @zaileys/store-adapters — fixed by updating legacy imports to point to local core files
|
|
23
|
-
|
|
24
|
-
## [2026-03-24 07:22:18] FIX STARTED: fix_start The data argument must be of type string or an instance of Buffer
|
|
25
|
-
|
|
26
|
-
## [2026-03-24 07:32:06] FIX COMPLETE ✅: fix_done The data argument must be of type string or an instance of Buffer — fixed: NeDBAdapter properly utilizes encoder to serialize and revive Baileys Buffer objects
|
|
27
|
-
|
|
28
|
-
## [2026-03-24 08:44:18] FIX STARTED: fix_start Sticker creation failed unsupported image format
|
|
29
|
-
|
|
30
|
-
## [2026-03-24 15:52:46] TASK STARTED
|
|
31
|
-
start Task: Fix TS2307 missing @seald-io/nedb | Files: package.json,pnpm-lock.yaml
|
|
32
|
-
[2026-03-24 15:53:26] ✅ done Task: Fixed TS2307 by adding @seald-io/nedb dependency; bun tsc --noEmit passes
|
|
33
|
-
|
|
34
|
-
## [2026-03-24 16:04:08] TASK STARTED
|
|
35
|
-
start Task: Fix sticker input buffer format crash | Files: src/Signal/index.ts, src/Classes/client.ts, src/Listener/connection.ts
|
|
36
|
-
[2026-03-24 16:06:02] ✅ done Task: Fixed sticker crash by switching example sticker media source to deterministic PNG URL
|
|
37
|
-
|
|
38
|
-
## [2026-03-24 16:09:22] TASK STARTED
|
|
39
|
-
start Task: Root fix sticker unsupported format in Signal flow | Files: src/Signal/index.ts
|
|
40
|
-
[2026-03-24 16:09:57] ✅ done Task: Fixed Signal media branches to pass raw inputs to Media constructor
|
|
41
|
-
[2026-03-24 16:52:07] ✅ done Task: Removed debug instrumentation from Signal sticker flow after confirmed fix
|
|
42
|
-
|
|
43
|
-
## [2026-03-24 23:04:01] FEATURE STARTED: feature_start clean-logging
|
|
44
|
-
|
|
45
|
-
## [2026-03-24 23:04:52] TASK STARTED
|
|
46
|
-
start Task: 1 | Files: src/Classes/logs.ts
|
|
47
|
-
[2026-03-24 23:05:54] ✅ done Task 1: Updated logs.ts format to be more intuitive
|
|
48
|
-
|
|
49
|
-
## [2026-03-24 23:05:57] FEATURE COMPLETE ✅: feature_done Clean Logging System — Completed refactoring
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Resume
|
|
53
|
-
1. Run /kelar:resume
|
|
54
|
-
2. Confirm next step
|
package/.kelar/state/PATTERNS.md
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# Approved Patterns: Zaileys
|
|
2
|
-
|
|
3
|
-
## 1. Registry Pattern (Unified Store)
|
|
4
|
-
All memory-resident state should be managed via the `store` singleton.
|
|
5
|
-
```typescript
|
|
6
|
-
import { store } from '../Store';
|
|
7
|
-
const myStore = store.ns('my-feature');
|
|
8
|
-
myStore.set('key', value);
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## 2. Prioritized Background Tasks
|
|
12
|
-
Use the `fireForget` engine for tasks that shouldn't block the main event loop.
|
|
13
|
-
```typescript
|
|
14
|
-
import { fireForget, Priority } from '../Library/fire-forget';
|
|
15
|
-
fireForget.add(async () => {
|
|
16
|
-
// task logic
|
|
17
|
-
}, { priority: Priority.HIGH });
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## 3. Class Injection (Proxy)
|
|
21
|
-
Extend Client functionality by injecting specialized classes rather than huge inheritance chains.
|
|
22
|
-
```typescript
|
|
23
|
-
// In Client constructor
|
|
24
|
-
const proxy = classInjection(this, [
|
|
25
|
-
new NewFeature(this),
|
|
26
|
-
]);
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## 4. Input Validation
|
|
30
|
-
Use `valibot` for all public-facing configurations.
|
|
31
|
-
```typescript
|
|
32
|
-
import * as v from 'valibot';
|
|
33
|
-
const Schema = v.object({...});
|
|
34
|
-
const data = parseValibot(Schema, input);
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## 5. Event Handling
|
|
38
|
-
Emit and listen to events via `store.events`.
|
|
39
|
-
```typescript
|
|
40
|
-
store.events.on('event-name', (data) => {
|
|
41
|
-
// handler
|
|
42
|
-
});
|
|
43
|
-
```
|
package/.kelar/state/STATE.md
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# Project State: Zaileys
|
|
2
|
-
|
|
3
|
-
## 🏗️ Architecture
|
|
4
|
-
Zaileys is a high-level, type-safe wrapper for the Baileys WhatsApp library. It follows a layered, modular architecture focused on performance and developer experience.
|
|
5
|
-
|
|
6
|
-
### Core Components
|
|
7
|
-
- **Client (src/Classes/client.ts)**: The main entry point. Uses a `class-proxy` to combine multiple specialized classes (`Signal`, `SignalGroup`, `SignalPrivacy`, etc.) into a single interface.
|
|
8
|
-
- **Unified Store (src/Store/unified-store.ts)**: Implements a Registry Pattern. Provides namespaced memory stores using `LRUCache` for efficiency and `async-mutex` for thread safety.
|
|
9
|
-
- **Fire & Forget (src/Library/fire-forget.ts)**: A prioritized task execution engine. Handles background operations with configurable concurrency, timeouts, and retries.
|
|
10
|
-
- **Plugin System (src/Classes/plugins.ts)**: Automatically loads plugins from a directory with Hot Module Replacement (HMR) support.
|
|
11
|
-
- **Middleware (src/Classes/middleware.ts)**: Allows intercepting and processing events globally.
|
|
12
|
-
|
|
13
|
-
### Data Flow
|
|
14
|
-
1. **Events**: WhatsApp socket events are received by `Listener`.
|
|
15
|
-
2. **Context**: Events are wrapped into a rich `Context` object.
|
|
16
|
-
3. **Execution**: Handlers (listeners or plugins) are executed, often utilizing `fireForget` for non-blocking actions.
|
|
17
|
-
4. **Storage**: Persistent data (sessions, chats) is stored in `LMDB` via `Store` modules.
|
|
18
|
-
|
|
19
|
-
## 🛠️ Stack
|
|
20
|
-
- **Runtime**: Node.js (v20+)
|
|
21
|
-
- **Language**: TypeScript (v5+)
|
|
22
|
-
- **Base Library**: `baileys` (v7)
|
|
23
|
-
- **Database**: `lmdb`
|
|
24
|
-
- **Validation**: `valibot`
|
|
25
|
-
- **Utilities**: `radashi`, `gradient-string`, `figlet`, `nanospinner`
|
|
26
|
-
- **Logging**: `pino`
|
|
27
|
-
- **Build Tool**: `tsup`
|
|
28
|
-
- **Package Manager**: `pnpm`
|
|
29
|
-
|
|
30
|
-
## 📏 Conventions
|
|
31
|
-
- **Validation**: Always use `valibot` for external inputs or configuration.
|
|
32
|
-
- **Async Safety**: Use `async-mutex` for operations modifying shared state in `UnifiedStore`.
|
|
33
|
-
- **Background Work**: Wrap long-running or non-critical operations in `fireForget.add()`.
|
|
34
|
-
- **Namespacing**: Use the `store.ns(name)` pattern for all internal state.
|
|
35
|
-
- **Type Safety**: Prefer `v.InferOutput` for working with validated schemas.
|
|
36
|
-
|
|
37
|
-
Working on: Working on nothing
|
package/.kelar/state/TASKS.md
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
# KELAR Tasks
|
|
2
|
-
> Micro-task tracker. Updated after every completed task.
|
|
3
|
-
Last updated: 2026-03-22
|
|
4
|
-
|
|
5
|
-
## Active
|
|
6
|
-
None
|
|
7
|
-
|
|
8
|
-
## Micro-Tasks
|
|
9
|
-
> Populated during /kelar:feature or /kelar:fix
|
|
10
|
-
|
|
11
|
-
## Completed (append-only)
|
|
12
|
-
> [x] [timestamp] [task] — DONE
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## [2026-03-22 02:52:24] TASK STARTED
|
|
16
|
-
start Task: /kelar:map | Files: .kelar/state/STATE.md, .kelar/state/PATTERNS.md, .kelar/state/DEBT.md, .kelar/memory/INDEX.md
|
|
17
|
-
[2026-03-22 02:53:33] ✅ done Mapped codebase: Identified Registry pattern, Fire-Forget engine, and Client proxy architecture. Found debt in examples/test.ts.
|
|
18
|
-
|
|
19
|
-
## [2026-03-22 02:57:59] TASK STARTED
|
|
20
|
-
start Task: /kelar:feature | Feature: dev test file | Files: examples/test.ts
|
|
21
|
-
[2026-03-22 03:00:05] ✅ done Restored examples/test.ts for dev script.
|
|
22
|
-
|
|
23
|
-
## [2026-03-22 12:19:16] FIX STARTED: fix_start Issue #34: sendPresenceUpdate undefined after 10m idle
|
|
24
|
-
|
|
25
|
-
## [2026-03-22 12:20:40] FIX COMPLETE ✅: fix_done Issue #34 fixed by removing TTL from center/context stores and adding defensive checks.
|
|
26
|
-
|
|
27
|
-
## [2026-03-22 12:30:55] FIX STARTED: fix_start Finalizing sharp silent fallback
|
|
28
|
-
|
|
29
|
-
## [2026-03-22 12:31:44] FIX COMPLETE ✅: fix_done Issue #35: Sharp fallback implemented for Termux compatibility.
|
|
30
|
-
|
|
31
|
-
## [2026-03-22 12:40:05] FEATURE STARTED: feature_start Researching LMDB Android/Termux compatibility and fallback
|
|
32
|
-
|
|
33
|
-
## [2026-03-22 12:57:52] TASK STARTED
|
|
34
|
-
start Task: Removing explicit adapter option | Files: src/Types/client.ts, src/Config/database.ts, src/Classes/client.ts, src/Auth/state.ts, src/Auth/creds.ts
|
|
35
|
-
[2026-03-22 12:58:30] ✅ done Simplified storage system: removed explicit adapter option, made it fully automated via database.ts
|
|
36
|
-
[2026-03-22 12:58:39] ✅ done Storage system: fully automated LMDB/JSON selection integrated
|
|
37
|
-
[2026-03-22 13:02:34] ✅ done Hardened JSONAdapter: fixed case-sensitivity and atomic write loopholes via hex-sharding
|
|
38
|
-
|
|
39
|
-
## [2026-03-22 13:05:18] TASK STARTED
|
|
40
|
-
start Task: Removing package-lock.json from store-adapters | Files: store-adapters/package-lock.json
|
|
41
|
-
[2026-03-22 13:05:32] ✅ done Removed package-lock.json from store-adapters
|
|
42
|
-
|
|
43
|
-
## [2026-03-22 13:06:37] TASK STARTED
|
|
44
|
-
start Task: Migrating from @zaadevofc/media-process to @zaileys/media-process | Files: all
|
|
45
|
-
[2026-03-22 13:09:24] ✅ done Migrated to local @zaileys/media-process link and verified build
|
|
46
|
-
[2026-03-22 13:11:38] ✅ done Final build success after full migration
|
|
47
|
-
|
|
48
|
-
## [2026-03-22 13:12:33] TASK STARTED
|
|
49
|
-
start Task: Type checking with tsc --noEmit | Files: all
|
|
50
|
-
[2026-03-22 13:15:02] ✅ done All TypeScript errors resolved. Project is clean.
|
|
51
|
-
|
|
52
|
-
## [2026-03-22 13:16:03] TASK STARTED
|
|
53
|
-
start Task: Final Fix for Media process imports | Files: All affected
|
|
54
|
-
[2026-03-22 13:16:17] ✅ done All imports verified and clean
|
|
55
|
-
[2026-03-22 13:18:13] ✅ done Final verification success
|
|
56
|
-
[2026-03-22 13:19:41] ✅ done Stress test v2 passed successfully
|
|
57
|
-
[2026-03-22 13:24:04] ✅ done Stress test verified visually and cleaned up
|
|
58
|
-
[2026-03-22 13:27:57] ✅ done Package lock updated and verified
|
|
59
|
-
|
|
60
|
-
## [2026-03-22 13:30:09] TASK STARTED
|
|
61
|
-
start Task: Auditing package.json | Files: package.json
|
|
62
|
-
[2026-03-22 13:33:34] ✅ done Stress test verified visually and permanently cleaned up
|
|
63
|
-
|
|
64
|
-
## [2026-03-22 14:45:47] TASK STARTED
|
|
65
|
-
start Task: Swapping local links for official npm packages | Files: package.json
|
|
66
|
-
[2026-03-22 14:46:14] ✅ done Successfully migrated to official npm packages
|
|
67
|
-
[2026-03-22 16:07:18] ✅ done Fixed LMDB initialization crash with automated JSON fallback
|
|
68
|
-
|
|
69
|
-
## [2026-03-22 16:08:37] FIX STARTED: fix_start LMDB Crash Persistent Regression
|
|
70
|
-
[2026-03-22 16:09:03] ✅ done Restored database.ts fallback
|
|
71
|
-
|
|
72
|
-
## [2026-03-22 16:14:03] FEATURE STARTED: feature_start Rework: Pure JSON High-Performance Storage
|
|
73
|
-
[2026-03-22 16:26:53] ✅ done Linked store-adapters locally
|
|
74
|
-
[2026-03-22 16:27:22] ✅ done Completed storage rework to NeDB
|
|
75
|
-
[2026-03-22 16:29:05] ✅ done Locked database.ts to NeDB
|
|
76
|
-
[2026-03-22 16:33:40] ✅ done Completed Stress Testing and Optimization
|
|
77
|
-
[2026-03-22 16:54:19] ✅ done Cancelled SessionResilience service
|
|
78
|
-
[2026-03-22 16:54:37] ✅ done Restored build stability after SessionResilience removal
|
|
79
|
-
[2026-03-22 16:55:24] ✅ done Final verification successful. Mutex performance confirmed.
|
|
80
|
-
[2026-03-22 16:56:39] ✅ done Verified intense update resilience with Mutex
|
|
81
|
-
[2026-03-22 16:57:56] ✅ done Passed strategic complexity test with mixed ops and compaction
|
|
82
|
-
|
|
83
|
-
## [2026-03-22 17:09:44] FEATURE STARTED: feature_start Multi-Database Support (MySQL/Redis/Sequelize)
|
|
84
|
-
|
|
85
|
-
## [2026-03-22 17:33:01] FIX STARTED: fix_start Fix messy monorepo structure in Library folder
|
|
86
|
-
[2026-03-22 17:41:39] ✅ done Cleaned up old root files
|
|
87
|
-
|
|
88
|
-
## [2026-03-22 17:41:59] FIX COMPLETE ✅: fix_done Reorganized workspace to Zaileys-centric layout
|
|
89
|
-
|
|
90
|
-
## [2026-03-22 17:46:21] FIX STARTED: fix_start Fix 'changeset not found' error after workspace reorganization
|
|
91
|
-
[2026-03-22 17:46:48] ✅ done Installed dependencies in new root
|
|
92
|
-
[2026-03-22 17:47:04] ✅ done Verified changeset command
|
|
93
|
-
[2026-03-22 18:00:46] ✅ done Moved .changeset and .github into zaileys root
|
|
94
|
-
[2026-03-22 18:00:55] ✅ done Verified changeset is now found
|
|
95
|
-
|
|
96
|
-
## [2026-03-22 18:13:26] FEATURE STARTED: feature_start Simplify: Move NeDB to core and remove store-adapters package
|
|
97
|
-
[2026-03-22 18:19:25] ✅ done Migrated NeDB files to core
|
|
98
|
-
[2026-03-22 18:20:01] ✅ done Consolidated storage and removed store-adapters package
|
|
99
|
-
|
|
100
|
-
## [2026-03-22 18:20:16] FEATURE STARTED: feature_start MySQL Adapter (@zaileys/mysql-adapter)
|
|
101
|
-
[2026-03-22 18:23:10] ✅ done Scaffolded mysql-adapter directory
|
|
102
|
-
[2026-03-22 18:24:45] ✅ done Fixed types and built MySQL adapter
|
|
103
|
-
|
|
104
|
-
## [2026-03-22 18:25:04] FEATURE COMPLETE ✅: feature_done MySQL Adapter (@zaileys/mysql-adapter) — Built with Write-Behind Batching
|
|
105
|
-
|
|
106
|
-
## [2026-03-22 18:30:04] FIX STARTED: fix_start Fix 3 compilation errors after storage consolidation
|
|
107
|
-
[2026-03-22 18:30:51] ✅ done Fixed 3 compilation errors
|
|
108
|
-
[2026-03-22 18:30:57] ✅ done Verified all compilation errors are fixed
|
|
109
|
-
|
|
110
|
-
## [2026-03-22 18:31:07] FIX COMPLETE ✅: fix_done src/Classes/client.ts & src/Store/Adapters/nedb.ts — fixed: internal imports and missing dependency
|
|
111
|
-
[2026-03-22 18:31:19] ✅ done Moved nedb.ts to src/Library
|
|
112
|
-
[2026-03-22 18:34:48] ✅ done Fixed all compilation errors after NeDB relocation
|
|
113
|
-
|
|
114
|
-
## [2026-03-23 11:54:42] FIX STARTED: fix_start TS2307: Cannot find module @zaileys/store-adapters
|
|
115
|
-
|
|
116
|
-
## [2026-03-23 11:56:05] TASK STARTED
|
|
117
|
-
start Task: Fixing legacy @zaileys/store-adapters imports | Files: src/Config/database.ts, src/Classes/client.ts
|
|
118
|
-
|
|
119
|
-
## [2026-03-23 11:56:35] FIX COMPLETE ✅: fix_done TS2307: Missing @zaileys/store-adapters — fixed by updating legacy imports to point to local core files
|
|
120
|
-
|
|
121
|
-
## [2026-03-24 07:22:18] FIX STARTED: fix_start The data argument must be of type string or an instance of Buffer
|
|
122
|
-
|
|
123
|
-
## [2026-03-24 07:32:06] FIX COMPLETE ✅: fix_done The data argument must be of type string or an instance of Buffer — fixed: NeDBAdapter properly utilizes encoder to serialize and revive Baileys Buffer objects
|
|
124
|
-
|
|
125
|
-
## [2026-03-24 08:44:18] FIX STARTED: fix_start Sticker creation failed unsupported image format
|
|
126
|
-
|
|
127
|
-
## [2026-03-24 15:52:46] TASK STARTED
|
|
128
|
-
start Task: Fix TS2307 missing @seald-io/nedb | Files: package.json,pnpm-lock.yaml
|
|
129
|
-
[2026-03-24 15:53:26] ✅ done Task: Fixed TS2307 by adding @seald-io/nedb dependency; bun tsc --noEmit passes
|
|
130
|
-
|
|
131
|
-
## [2026-03-24 16:04:08] TASK STARTED
|
|
132
|
-
start Task: Fix sticker input buffer format crash | Files: src/Signal/index.ts, src/Classes/client.ts, src/Listener/connection.ts
|
|
133
|
-
[2026-03-24 16:06:02] ✅ done Task: Fixed sticker crash by switching example sticker media source to deterministic PNG URL
|
|
134
|
-
|
|
135
|
-
## [2026-03-24 16:09:22] TASK STARTED
|
|
136
|
-
start Task: Root fix sticker unsupported format in Signal flow | Files: src/Signal/index.ts
|
|
137
|
-
[2026-03-24 16:09:57] ✅ done Task: Fixed Signal media branches to pass raw inputs to Media constructor
|
|
138
|
-
[2026-03-24 16:52:07] ✅ done Task: Removed debug instrumentation from Signal sticker flow after confirmed fix
|
|
139
|
-
|
|
140
|
-
## [2026-03-24 23:04:01] FEATURE STARTED: feature_start clean-logging
|
|
141
|
-
|
|
142
|
-
## [2026-03-24 23:04:52] TASK STARTED
|
|
143
|
-
start Task: 1 | Files: src/Classes/logs.ts
|
|
144
|
-
[2026-03-24 23:05:54] ✅ done Task 1: Updated logs.ts format to be more intuitive
|
|
145
|
-
|
|
146
|
-
## [2026-03-24 23:05:57] FEATURE COMPLETE ✅: feature_done Clean Logging System — Completed refactoring
|
package/AGENTS.md
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
# AGENTS.md
|
|
2
|
-
> Universal agent config. Read by all AI tools.
|
|
3
|
-
> Agent-specific: CLAUDE.md · GEMINI.md
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 🧠 IDENTITY
|
|
8
|
-
|
|
9
|
-
You are a senior developer in the **KELAR multi-agent execution framework**.
|
|
10
|
-
Methodical. Research-first. Never improvises patterns — scans first.
|
|
11
|
-
Plans before coding. Logs everything. Verifies after executing.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## 🛠 KELAR TOOLS — USE THESE ALWAYS
|
|
16
|
-
|
|
17
|
-
KELAR has a CLI utility at `.kelar/kelar-tools.cjs`. **Use it instead of raw bash for all state operations.**
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
# Session start — ALWAYS run at start of every session
|
|
21
|
-
node .kelar/kelar-tools.cjs health
|
|
22
|
-
node .kelar/kelar-tools.cjs state snapshot
|
|
23
|
-
node .kelar/kelar-tools.cjs handoff read
|
|
24
|
-
node .kelar/kelar-tools.cjs memory search "[current topic]"
|
|
25
|
-
|
|
26
|
-
# Task logging — ALWAYS log actions
|
|
27
|
-
node .kelar/kelar-tools.cjs tasks log start "Task: [name] | Files: [list]"
|
|
28
|
-
node .kelar/kelar-tools.cjs tasks log done "Task [id]: [what was done]"
|
|
29
|
-
node .kelar/kelar-tools.cjs tasks log pause "[task id]" "[exact next step]"
|
|
30
|
-
|
|
31
|
-
# Memory — save discoveries
|
|
32
|
-
node .kelar/kelar-tools.cjs memory save technical "[title]" "[content]"
|
|
33
|
-
node .kelar/kelar-tools.cjs memory search "[query]"
|
|
34
|
-
|
|
35
|
-
# Git — use tools not raw git for consistency
|
|
36
|
-
node .kelar/kelar-tools.cjs git status
|
|
37
|
-
node .kelar/kelar-tools.cjs git commit "feat(kelar): [message]"
|
|
38
|
-
node .kelar/kelar-tools.cjs git checkpoint
|
|
39
|
-
|
|
40
|
-
# Debt — log out-of-scope issues
|
|
41
|
-
node .kelar/kelar-tools.cjs debt add "[file]" "[issue]" "MEDIUM"
|
|
42
|
-
|
|
43
|
-
# Patterns — check before inventing
|
|
44
|
-
node .kelar/kelar-tools.cjs patterns get "[category]"
|
|
45
|
-
node .kelar/kelar-tools.cjs patterns set "[category]" "[pattern]"
|
|
46
|
-
|
|
47
|
-
# Plan operations — for agents working with XML plans
|
|
48
|
-
node .kelar/kelar-tools.cjs plan validate .kelar/plans/[name]-plan.xml
|
|
49
|
-
node .kelar/kelar-tools.cjs plan wave .kelar/plans/[name]-plan.xml 1
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## 🤖 AGENT SYSTEM
|
|
55
|
-
|
|
56
|
-
Specialized sub-agents spawned via `Task()`:
|
|
57
|
-
|
|
58
|
-
| Agent | Role |
|
|
59
|
-
|-------|------|
|
|
60
|
-
| `kelar-planner` | XML task plans |
|
|
61
|
-
| `kelar-executor` | Task implementation |
|
|
62
|
-
| `kelar-researcher` | Domain + codebase research |
|
|
63
|
-
| `kelar-plan-checker` | Plan validation |
|
|
64
|
-
| `kelar-verifier` | Goal verification |
|
|
65
|
-
| `kelar-debugger` | Root cause analysis |
|
|
66
|
-
| `kelar-repair` | Autonomous failure recovery |
|
|
67
|
-
| `kelar-ui-designer` | UI design contracts |
|
|
68
|
-
| `kelar-codebase-mapper` | Architecture analysis |
|
|
69
|
-
|
|
70
|
-
**Every agent must:**
|
|
71
|
-
1. Run `node .kelar/kelar-tools.cjs health` on start
|
|
72
|
-
2. Read all files in its `<files_to_read>` block
|
|
73
|
-
3. Log start/end with kelar-tools tasks log
|
|
74
|
-
4. Save any new knowledge with kelar-tools memory save
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
## ⚡ MCP SERVERS
|
|
79
|
-
|
|
80
|
-
Scan at session start. Use proactively — don't ask, just use.
|
|
81
|
-
If an MCP server exists for the task, use it. Always.
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## 🚫 HARD RULES
|
|
86
|
-
|
|
87
|
-
1. No hardcoded values
|
|
88
|
-
2. No scope creep → `node .kelar/kelar-tools.cjs debt add`
|
|
89
|
-
3. No silent assumptions → ask one specific question
|
|
90
|
-
4. No symptom patching → root cause first
|
|
91
|
-
5. No code before plan → plan → approve → execute
|
|
92
|
-
6. No task complete without verify
|
|
93
|
-
7. No session without `kelar-tools health` check first
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## ✅ COMPLETION FORMAT
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
KELAR TASK COMPLETE
|
|
101
|
-
────────────────────
|
|
102
|
-
Done : [task]
|
|
103
|
-
Files : [list with summaries]
|
|
104
|
-
Result : [what user can now do]
|
|
105
|
-
Agents : [which agents ran]
|
|
106
|
-
Quality : [gates passed / issues]
|
|
107
|
-
Next : [suggestion]
|
|
108
|
-
```
|
package/CHANGELOG.md
DELETED
package/GEMINI.md
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# GEMINI.md
|
|
2
|
-
> Antigravity (Gemini CLI) specific configuration. Supplements AGENTS.md.
|
|
3
|
-
> Priority: This file > AGENTS.md (Antigravity reads both, this wins on conflicts)
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## KELAR FRAMEWORK ACTIVE
|
|
8
|
-
|
|
9
|
-
You are operating under the KELAR execution framework.
|
|
10
|
-
Read AGENTS.md for universal rules. This file contains Antigravity-specific additions only.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## ANTIGRAVITY-SPECIFIC RULES
|
|
15
|
-
|
|
16
|
-
### Loading AGENTS.md (Critical Fix for pre-v1.20.3)
|
|
17
|
-
If Antigravity is older than v1.20.3, AGENTS.md won't auto-load.
|
|
18
|
-
In that case, treat this file as the primary rules file AND read AGENTS.md manually
|
|
19
|
-
by looking for it in the project workspace.
|
|
20
|
-
|
|
21
|
-
Instruction: Check for the presence of AGENTS.md in the project workspace.
|
|
22
|
-
There may be additional AGENTS.md in sub-folders with specific instructions.
|
|
23
|
-
Apply all rules found in AGENTS.md as if they were written here.
|
|
24
|
-
|
|
25
|
-
### Skills location
|
|
26
|
-
`.gemini/skills/` (symlinked from `.kelar/skills/`)
|
|
27
|
-
|
|
28
|
-
### Workflows location
|
|
29
|
-
`.gemini/workflows/` (symlinked from `.kelar/workflows/`)
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## ANTIGRAVITY MULTI-AGENT NOTES
|
|
34
|
-
|
|
35
|
-
When spawning sub-agents:
|
|
36
|
-
- Each sub-agent must also read AGENTS.md on start
|
|
37
|
-
- Pass current TASKS.md state to sub-agents
|
|
38
|
-
- Sub-agent results must be logged back to TASKS.md
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## KNOWLEDGE ITEMS
|
|
43
|
-
|
|
44
|
-
When discovering reusable knowledge during a session:
|
|
45
|
-
- Save to Antigravity Knowledge Items AND to `.kelar/memory/[topic].md`
|
|
46
|
-
- This ensures knowledge persists even outside Antigravity
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## AUTO-CONTINUE SAFETY GUARDS
|
|
51
|
-
|
|
52
|
-
Auto-continue is enabled by default in Antigravity v1.20.3+.
|
|
53
|
-
ALWAYS pause and ask before:
|
|
54
|
-
- Writing to database
|
|
55
|
-
- Deleting files
|
|
56
|
-
- Deploying to production
|
|
57
|
-
- Running destructive commands
|
|
58
|
-
- Modifying files outside declared scope
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 zaadevofc
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|