chatlab-cli 0.0.0 → 0.21.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/README.md +115 -3
- package/bin/chatlab.mjs +2 -0
- package/dist/chunk-2AIOU3PW.mjs +26 -0
- package/dist/chunk-2AIOU3PW.mjs.map +1 -0
- package/dist/chunk-3DIWXYMJ.mjs +1344 -0
- package/dist/chunk-3DIWXYMJ.mjs.map +1 -0
- package/dist/chunk-EIRLEPXP.mjs +19145 -0
- package/dist/chunk-EIRLEPXP.mjs.map +1 -0
- package/dist/chunk-EWCSGYVT.mjs +144 -0
- package/dist/chunk-EWCSGYVT.mjs.map +1 -0
- package/dist/chunk-FBTHZU55.mjs +3400 -0
- package/dist/chunk-FBTHZU55.mjs.map +1 -0
- package/dist/chunk-NB4BIAYM.mjs +411 -0
- package/dist/chunk-NB4BIAYM.mjs.map +1 -0
- package/dist/chunk-XUHPCRVT.mjs +395 -0
- package/dist/chunk-XUHPCRVT.mjs.map +1 -0
- package/dist/cli.mjs +15 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/http-QVYJ5HER.mjs +32 -0
- package/dist/http-QVYJ5HER.mjs.map +1 -0
- package/dist/import-AJKL6JPR.mjs +41 -0
- package/dist/import-AJKL6JPR.mjs.map +1 -0
- package/dist/index.mjs +24 -0
- package/dist/index.mjs.map +1 -0
- package/dist/mcp-FRF3YAN5.mjs +405 -0
- package/dist/mcp-FRF3YAN5.mjs.map +1 -0
- package/dist/src-KOIGBZJX.mjs +339 -0
- package/dist/src-KOIGBZJX.mjs.map +1 -0
- package/dist/stream-import-URGOCXUH.mjs +33 -0
- package/dist/stream-import-URGOCXUH.mjs.map +1 -0
- package/dist-web/assets/DebugToolsPanel-dUV6pVqD.css +1 -0
- package/dist-web/assets/DebugToolsPanel.vue_vue_type_script_setup_true_lang-DFN1Co1H.js +155 -0
- package/dist-web/assets/EChartWordcloud-BYLFxPAX.js +1 -0
- package/dist-web/assets/MessageExportModal-BAf68-wB.js +1 -0
- package/dist-web/assets/electron-2m4Vdk2z.js +1 -0
- package/dist-web/assets/electron-8qi0d92j.js +1 -0
- package/dist-web/assets/electron-BHjOx6B6.js +1 -0
- package/dist-web/assets/electron-CTK4NJag.js +1 -0
- package/dist-web/assets/electron-DPsrYwTt.js +1 -0
- package/dist-web/assets/electron-DfpXsXsS.js +1 -0
- package/dist-web/assets/electron-HoVzpIVc.js +1 -0
- package/dist-web/assets/fetch-Ayp337Ng.js +17 -0
- package/dist-web/assets/fetch-BS4SlQjA.js +1 -0
- package/dist-web/assets/fetch-BWtpQwBZ.js +1 -0
- package/dist-web/assets/fetch-CclRWOHf.js +1 -0
- package/dist-web/assets/fetch-W43zfemj.js +1 -0
- package/dist-web/assets/fetch-o5NJ2uWE.js +3 -0
- package/dist-web/assets/http-CeXMt-Fv.js +1 -0
- package/dist-web/assets/index-BKFGuwJu.css +1 -0
- package/dist-web/assets/index-Bd5r2oFG.js +163 -0
- package/dist-web/assets/index-BfZM-q0T.js +7 -0
- package/dist-web/assets/index-CLGv8Den.css +1 -0
- package/dist-web/assets/index-CLYHD_f4.js +2 -0
- package/dist-web/assets/index-CaTRpNBK.js +16 -0
- package/dist-web/assets/index-CmU6x-uJ.css +1 -0
- package/dist-web/assets/index-CzR1sElx.css +1 -0
- package/dist-web/assets/index-Ksa--o23.js +173 -0
- package/dist-web/assets/sse-CACcGGWv.js +2 -0
- package/dist-web/assets/vendor-echarts-C13vDgZW.js +11 -0
- package/dist-web/assets/vendor-echarts-wordcloud-uVdwYsYa.js +1 -0
- package/dist-web/assets/vendor-nuxt-ui-CYMNNdeD.js +15 -0
- package/dist-web/assets/vendor-reka-ui-CW2cIgMu.js +11 -0
- package/dist-web/assets/vendor-snapdom-XnBoh1gd.js +8 -0
- package/dist-web/assets/vendor-zrender-5DcYjSZk.js +8 -0
- package/dist-web/assets/web-C5yfcwjn.js +1 -0
- package/dist-web/index.html +18 -0
- package/package.json +70 -15
- package/cli.js +0 -3
package/README.md
CHANGED
|
@@ -1,5 +1,117 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: light)" srcset="https://github.com/ChatLab/ChatLab/raw/main/public/images/banner-light.png">
|
|
4
|
+
<img src="https://github.com/ChatLab/ChatLab/raw/main/public/images/banner.png" alt="ChatLab" title="ChatLab" width="500" />
|
|
5
|
+
</picture>
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
Your chat history, finally yours.
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
English | [简体中文](./docs/README.zh-CN.md)
|
|
10
|
+
|
|
11
|
+
[Official Website](https://chatlab.fun/) · [Documentation](https://chatlab.fun/usage/) · [Roadmap](https://chatlab.fun/cn/roadmap/tasks)
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
ChatLab is an open-source desktop app for understanding your social conversations. It combines a flexible SQL engine with AI agents so you can explore patterns, ask better questions, and extract insights from chat data, all on your own machine.
|
|
16
|
+
|
|
17
|
+
Currently supported: **WhatsApp, LINE, WeChat, QQ, Discord, Instagram, and Telegram**. Coming next: **iMessage, Messenger, and KakaoTalk**.
|
|
18
|
+
|
|
19
|
+
## Core Features
|
|
20
|
+
|
|
21
|
+
- 🚀 **Built for large histories**: Stream parsing and multi-worker processing keep imports and analysis responsive, even at million-message scale.
|
|
22
|
+
- 🔒 **Private by default**: Your chat data and settings stay local. No mandatory cloud upload of raw conversations.
|
|
23
|
+
- 🤖 **AI that can actually operate on data**: Agent + Function Calling workflows can search, summarize, and analyze chat records with context.
|
|
24
|
+
- 📊 **Insight-rich visual views**: See trends, time patterns, interaction frequency, rankings, and more in one place.
|
|
25
|
+
- 🧩 **Cross-platform normalization**: Different export formats are mapped into a unified model so you can analyze them consistently.
|
|
26
|
+
|
|
27
|
+
## Usage Guides
|
|
28
|
+
|
|
29
|
+
- [Download Guide](https://chatlab.fun/?type=download)
|
|
30
|
+
- [Chat Record Export Guide](https://chatlab.fun/usage/how-to-export)
|
|
31
|
+
- [Standardized Format Specification](https://chatlab.fun/standard/chatlab-format)
|
|
32
|
+
- [Troubleshooting Guide](https://chatlab.fun/usage/troubleshooting)
|
|
33
|
+
|
|
34
|
+
## Preview
|
|
35
|
+
|
|
36
|
+
For more previews, please visit the official website: [chatlab.fun](https://chatlab.fun/)
|
|
37
|
+
|
|
38
|
+

|
|
39
|
+
|
|
40
|
+
## System Architecture
|
|
41
|
+
|
|
42
|
+
### Architecture Principles
|
|
43
|
+
|
|
44
|
+
- **Local-first by default**: Raw chat data, indexes, and settings remain on-device unless you explicitly choose otherwise.
|
|
45
|
+
- **Streaming over buffering**: Stream-first parsing and incremental processing keep large imports stable and memory-efficient.
|
|
46
|
+
- **Composable intelligence**: AI features are assembled through Agent + Tool Calling, not hard-coded into one model path.
|
|
47
|
+
- **Schema-first evolution**: Import, query, analysis, and visualization share a consistent data model that scales with new features.
|
|
48
|
+
|
|
49
|
+
### Runtime Architecture
|
|
50
|
+
|
|
51
|
+
- **Main Process (control plane)**: `apps/desktop/main/index.ts` handles lifecycle and windows. `apps/desktop/main/ipc/` defines domain-scoped IPC. Core AI, query, NLP, import, and merge logic lives in shared packages (`packages/core`, `packages/node-runtime`, `packages/tools`); `apps/desktop/main/ai/` and `apps/desktop/main/i18n/` are thin Electron adaptation layers.
|
|
52
|
+
- **Worker Layer (compute plane)**: `apps/desktop/main/worker/` runs import, indexing, and query tasks via `workerManager`, delegating core logic to `@openchatlab/core` and `@openchatlab/node-runtime`.
|
|
53
|
+
- **Renderer Layer (interaction plane)**: Vue 3 + Nuxt UI + Tailwind CSS drive management, private chat, group chat, and analysis interfaces. `apps/desktop/preload/index.ts` exposes tightly scoped APIs for secure process boundaries.
|
|
54
|
+
|
|
55
|
+
### Data Pipeline
|
|
56
|
+
|
|
57
|
+
1. **Ingestion**: `parser/` detects file format and dispatches to the matching parser module.
|
|
58
|
+
2. **Persistence**: Stream-based writes populate core local entities: sessions, members, and messages.
|
|
59
|
+
3. **Indexing**: Session- and time-oriented indexes are built for timeline navigation and retrieval.
|
|
60
|
+
4. **Query & Analysis**: `worker/query/*` powers activity metrics, interaction analysis, SQL Lab, and AI-assisted exploration.
|
|
61
|
+
5. **Presentation**: The renderer turns query output into charts, rankings, timelines, and conversational analysis flows.
|
|
62
|
+
|
|
63
|
+
### Extensibility & Reliability
|
|
64
|
+
|
|
65
|
+
- **Pluggable parser architecture**: Adding a new import source is mostly an extension in `parser/formats/*`, without reworking downstream query logic.
|
|
66
|
+
- **Full + incremental import paths**: `streamImport.ts` and `incrementalImport.ts` support both first-time onboarding and ongoing updates.
|
|
67
|
+
- **Modular IPC boundaries**: Domain-based IPC segmentation reduces cross-layer coupling and limits permission spread.
|
|
68
|
+
- **Unified i18n evolution**: Main and renderer processes share an i18n system that can evolve with product scope.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Local Development
|
|
73
|
+
|
|
74
|
+
### Requirements
|
|
75
|
+
|
|
76
|
+
- Node.js >= 20
|
|
77
|
+
- pnpm
|
|
78
|
+
|
|
79
|
+
### Setup
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# install dependencies
|
|
83
|
+
pnpm install
|
|
84
|
+
|
|
85
|
+
# run electron app in dev mode
|
|
86
|
+
pnpm dev
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
If Electron encounters exceptions during startup, you can try using `electron-fix`:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npm install electron-fix -g
|
|
93
|
+
electron-fix start
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Privacy Policy & User Agreement
|
|
98
|
+
|
|
99
|
+
Before using this software, please read the [Privacy Policy & User Agreement](./src/assets/docs/agreement_en.md).
|
|
100
|
+
|
|
101
|
+
## Community
|
|
102
|
+
|
|
103
|
+
Please follow these principles before submitting a Pull Request:
|
|
104
|
+
|
|
105
|
+
- Obvious bug fixes can be submitted directly.
|
|
106
|
+
- For new features, please submit an Issue for discussion first; **PRs submitted without prior discussion will be closed**.
|
|
107
|
+
- Keep one PR focused on one task; if changes are extensive, consider splitting them into multiple independent PRs.
|
|
108
|
+
|
|
109
|
+
Thanks to all contributors:
|
|
110
|
+
|
|
111
|
+
<a href="https://github.com/ChatLab/ChatLab/graphs/contributors">
|
|
112
|
+
<img src="https://contrib.rocks/image?repo=ChatLab/ChatLab" />
|
|
113
|
+
</a>
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
|
|
117
|
+
AGPL-3.0 License
|
package/bin/chatlab.mjs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { dirname as __pathDirname } from 'path';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
|
|
8
|
+
// src/version.ts
|
|
9
|
+
import { readFileSync } from "fs";
|
|
10
|
+
import { resolve } from "path";
|
|
11
|
+
var cached;
|
|
12
|
+
function getVersion() {
|
|
13
|
+
if (cached) return cached;
|
|
14
|
+
try {
|
|
15
|
+
const pkgPath = resolve(__dirname, "../package.json");
|
|
16
|
+
cached = JSON.parse(readFileSync(pkgPath, "utf-8")).version;
|
|
17
|
+
} catch {
|
|
18
|
+
cached = "0.0.0-dev";
|
|
19
|
+
}
|
|
20
|
+
return cached;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
getVersion
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=chunk-2AIOU3PW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["import { readFileSync } from 'fs'\nimport { resolve } from 'path'\n\nlet cached: string | undefined\n\n/**\n * Read version from apps/cli/package.json at runtime.\n * Works for both tsx dev (src/) and bundled (dist/).\n */\nexport function getVersion(): string {\n if (cached) return cached\n try {\n const pkgPath = resolve(__dirname, '../package.json')\n cached = JSON.parse(readFileSync(pkgPath, 'utf-8')).version\n } catch {\n cached = '0.0.0-dev'\n }\n return cached!\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,eAAe;AAExB,IAAI;AAMG,SAAS,aAAqB;AACnC,MAAI,OAAQ,QAAO;AACnB,MAAI;AACF,UAAM,UAAU,QAAQ,WAAW,iBAAiB;AACpD,aAAS,KAAK,MAAM,aAAa,SAAS,OAAO,CAAC,EAAE;AAAA,EACtD,QAAQ;AACN,aAAS;AAAA,EACX;AACA,SAAO;AACT;","names":[]}
|