@chainlesschain/personal-data-hub 0.4.0 → 0.4.1

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 +45 -25
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,25 +4,38 @@ Personal Data Hub — UnifiedSchema, validators, batch helpers, SQLCipher
4
4
  LocalVault, and AdapterRegistry for the "data back to the individual"
5
5
  middleware.
6
6
 
7
- > **Phase 0 + Phase 1 + Phase 2 + Phase 3 + Phase 3.5 landed** of the 13-phase plan in
8
- > [`docs/design/Personal_Data_Hub_Architecture.md`](../../docs/design/Personal_Data_Hub_Architecture.md).
9
- > Phase 0 covers schema + validation + ID generation.
10
- > Phase 1 adds SQLCipher LocalVault + pluggable key providers + migrations.
11
- > Phase 2 adds AdapterRegistry + KG/RAG derivation + MockAdapter (1000
12
- > events ingest in ~600ms 50× under the 30s target).
13
- > Phase 3 adds the natural-language AnalysisEngine: query parser → vault
14
- > facts prompt builder LLM citation validation, with a privacy gate
15
- > that refuses non-local LLMs unless caller opts in. **MockLLMClient**
16
- > for tests, **OllamaClient** for standalone use.
17
- > Phase 3.5 wires production bridges: **CcLLMAdapter** wraps the existing
18
- > cc llm-manager (Ollama / Volcengine / Anthropic / Gemini / DeepSeek)
19
- > via dependency injection; **CcKgSink** translates hub triples into the
20
- > existing knowledge-graph addEntity + addRelation; **CcRagSink** feeds
21
- > hub RagDocs into BM25 (Qdrant vector store wiring left as future work).
22
- > Hub package stays decoupled bridges take cc functions as constructor
23
- > args rather than importing cc modules directly.
24
- > Sync engine UI, real KG/RAG wiring, and the actual adapters (Email,
25
- > Alipay, AI Chat × 8, WeChat, ...) come in later phases.
7
+ > **v0.4.0 (ships with ChainlessChain v5.0.3.99, 2026-06-08).** Phase 0–13
8
+ > of the 13-phase plan in
9
+ > [`docs/design/Personal_Data_Hub_Architecture.md`](../../docs/design/Personal_Data_Hub_Architecture.md)
10
+ > have landed, plus the multi-platform collection layer. The foundation is
11
+ > unchanged: schema + validation + UUID v7 (Phase 0); SQLCipher LocalVault +
12
+ > pluggable key providers + migrations (Phase 1); AdapterRegistry + KG/RAG
13
+ > derivation (Phase 2); the natural-language AnalysisEngine with a hard
14
+ > privacy gate that refuses non-local LLMs unless the caller opts in
15
+ > (Phase 3); and production bridges **CcLLMAdapter** (wraps cc llm-manager:
16
+ > Ollama / Volcengine / Anthropic / Gemini / DeepSeek), **CcKgSink**, **CcRagSink**
17
+ > injected at the desktop/CLI entry so this package stays decoupled (Phase 3.5).
18
+ >
19
+ > **51 adapters are now live** (no longer "later phases"): Email IMAP,
20
+ > Alipay bill, 9 AI-chat vendors, WeChat / QQ / Weibo / Bilibili / Douyin /
21
+ > Xiaohongshu / Toutiao / Kuaishou social, Telegram / WhatsApp messaging,
22
+ > Taobao / JD / Meituan / Pinduoduo shopping, Amap / Baidu-map / Tencent-map /
23
+ > Ctrip / 12306 travel, system-data (contacts / calls / sms / location),
24
+ > and the developer-activity set (git / shell / vscode / browser-history /
25
+ > local-files / win-recent).
26
+ >
27
+ > **New in v0.4.0 (v5.0.3.99):** adapter **readiness** — split out from the
28
+ > loose `healthCheck` sync gate into a real ready/needs_setup/unavailable
29
+ > judgment (`registry.readiness()`) with a one-line reason, so "config looks
30
+ > fine but nothing collects" is no longer silent; an `adapter-guide.js`
31
+ > single-source of import steps reused across web-shell / desktop / CLI /
32
+ > Android; new local-direct-read sources (Douyin, WeChat PC, QQ-NT, DingTalk,
33
+ > Feishu, WeRead, Apple Health, NetEase Music); email-bill LLM gap-fill
34
+ > (Phase 5.5); and iOS encrypted-backup decryption (Phase 7.5b).
35
+ >
36
+ > Editing `lib/**` requires bumping the package version + `npm publish` +
37
+ > the Android `USR_VERSION` sentinel, or real devices keep running stale code
38
+ > (see hidden-risk-traps #27/#28).
26
39
 
27
40
  ## What's in here
28
41
 
@@ -40,6 +53,14 @@ lib/
40
53
  │ typed put/get, queryEvents, watermarks, audit, key
41
54
  │ rotation (WAL-safe), destroy
42
55
  ├── adapter-spec.js PersonalDataAdapter contract + assertAdapter check
56
+ ├── adapter-readiness.js readiness() — ready/needs_setup/unavailable + reason,
57
+ │ split out from the loose healthCheck sync gate
58
+ ├── adapter-guide.js category-driven import guides (single source of import
59
+ │ steps reused across web-shell / desktop / CLI / Android)
60
+ ├── adapters/ 51 live adapters (email-imap, alipay-bill, ai-chat-history,
61
+ │ wechat / wechat-pc, qq-pc, dingtalk-pc, feishu-pc, weread,
62
+ │ apple-health, netease-music, social-*, shopping-*,
63
+ │ travel-*, system-data, git-activity, vscode, ...)
43
64
  ├── kg-derive.js UnifiedSchema → KG triples (rdf:type / by / involves /
44
65
  │ happened-at / etc.) — engine-agnostic
45
66
  ├── rag-derive.js UnifiedSchema → RAG (text, metadata) docs for indexing
@@ -217,7 +238,7 @@ cd packages/personal-data-hub
217
238
  npm test
218
239
  ```
219
240
 
220
- **268 tests** across 17 files covering ID generation, all 5 entity validators,
241
+ **2040 tests** across 121 files covering ID generation, all 5 entity validators,
221
242
  batch helpers, key providers, vault open/migrations, entity round-trips,
222
243
  transactional putBatch with rollback, raw_events archive, queryEvents
223
244
  filters + pagination, sync watermarks, audit log, key rotation (WAL-safe),
@@ -230,11 +251,10 @@ tolerance), and the 1k events <30s ingest perf gate.
230
251
 
231
252
  | Concern | Lives in |
232
253
  |-----------------------|---------------------------------------------------|
233
- | Platform KeyProviders (DPAPI/Keychain/Keystore) | Phase 1.5 — desktop-app-vue main process bridge |
234
- | AdapterRegistry | Phase 2 same package or sibling |
235
- | KG ingestor / RAG | Phase 2/4 wired into existing KG / RAG engines |
236
- | Email/Alipay/AI/WeChat adapters | Phase 5-12separate sub-packages |
237
- | AI analysis skills | Phase 11 — `skills/personal-analysis-*/` |
254
+ | Platform KeyProviders (DPAPI/Keychain/Keystore) | desktop-app-vue main-process bridge (the package ships the contract + InMemory/File providers) |
255
+ | Qdrant vector retrieval | wired into the existing RAG engine at the cc entry (BM25 derivation ships here) |
256
+ | AI analysis skills | `skills/personal-analysis-*/` (the 5 built-in analysis skills) |
257
+ | Native SQLCipher build | `better-sqlite3-multiple-ciphers`host/Electron ABI dual-load handled at the cc entry |
238
258
 
239
259
  ## License
240
260
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainlesschain/personal-data-hub",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Personal Data Hub — UnifiedSchema + validators + KG ingest helpers for the data-back-to-the-individual middleware",
5
5
  "type": "commonjs",
6
6
  "main": "lib/index.js",