weflow-cli 1.5.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/LICENSE +21 -0
- package/README.md +149 -0
- package/bin/weflow-cli-electron.cjs +59 -0
- package/bin/weflow-cli.ts +2311 -0
- package/cli.cjs +3 -0
- package/dist/bin/weflow-cli.d.ts +3 -0
- package/dist/bin/weflow-cli.d.ts.map +1 -0
- package/dist/bin/weflow-cli.js +2270 -0
- package/dist/bin/weflow-cli.js.map +1 -0
- package/dist/mcp-server/index.d.ts +3 -0
- package/dist/mcp-server/index.d.ts.map +1 -0
- package/dist/mcp-server/index.js +690 -0
- package/dist/mcp-server/index.js.map +1 -0
- package/dist/src/core/dbPathService.d.ts +40 -0
- package/dist/src/core/dbPathService.d.ts.map +1 -0
- package/dist/src/core/dbPathService.js +324 -0
- package/dist/src/core/dbPathService.js.map +1 -0
- package/dist/src/core/keyService.d.ts +59 -0
- package/dist/src/core/keyService.d.ts.map +1 -0
- package/dist/src/core/keyService.js +368 -0
- package/dist/src/core/keyService.js.map +1 -0
- package/dist/src/core/ntCore.d.ts +62 -0
- package/dist/src/core/ntCore.d.ts.map +1 -0
- package/dist/src/core/ntCore.js +191 -0
- package/dist/src/core/ntCore.js.map +1 -0
- package/dist/src/core/sqlcipherCore.d.ts +119 -0
- package/dist/src/core/sqlcipherCore.d.ts.map +1 -0
- package/dist/src/core/sqlcipherCore.js +693 -0
- package/dist/src/core/sqlcipherCore.js.map +1 -0
- package/dist/src/core/wcdbCore.d.ts +738 -0
- package/dist/src/core/wcdbCore.d.ts.map +1 -0
- package/dist/src/core/wcdbCore.js +4545 -0
- package/dist/src/core/wcdbCore.js.map +1 -0
- package/dist/src/core/wechatClient.d.ts +23 -0
- package/dist/src/core/wechatClient.d.ts.map +1 -0
- package/dist/src/core/wechatClient.js +166 -0
- package/dist/src/core/wechatClient.js.map +1 -0
- package/dist/src/services/chatService.d.ts +25 -0
- package/dist/src/services/chatService.d.ts.map +1 -0
- package/dist/src/services/chatService.js +291 -0
- package/dist/src/services/chatService.js.map +1 -0
- package/dist/src/services/configService.d.ts +43 -0
- package/dist/src/services/configService.d.ts.map +1 -0
- package/dist/src/services/configService.js +156 -0
- package/dist/src/services/configService.js.map +1 -0
- package/dist/src/services/exportService.d.ts +30 -0
- package/dist/src/services/exportService.d.ts.map +1 -0
- package/dist/src/services/exportService.js +273 -0
- package/dist/src/services/exportService.js.map +1 -0
- package/dist/src/services/wechat-formatter.d.ts +69 -0
- package/dist/src/services/wechat-formatter.d.ts.map +1 -0
- package/dist/src/services/wechat-formatter.js +248 -0
- package/dist/src/services/wechat-formatter.js.map +1 -0
- package/dist/src/services/wechatMessageService.d.ts +28 -0
- package/dist/src/services/wechatMessageService.d.ts.map +1 -0
- package/dist/src/services/wechatMessageService.js +341 -0
- package/dist/src/services/wechatMessageService.js.map +1 -0
- package/dist/src/services/wereadService.d.ts +206 -0
- package/dist/src/services/wereadService.d.ts.map +1 -0
- package/dist/src/services/wereadService.js +145 -0
- package/dist/src/services/wereadService.js.map +1 -0
- package/dist/src/services/whitelistService.d.ts +20 -0
- package/dist/src/services/whitelistService.d.ts.map +1 -0
- package/dist/src/services/whitelistService.js +60 -0
- package/dist/src/services/whitelistService.js.map +1 -0
- package/dist/src/types.d.ts +140 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils/errors.d.ts +25 -0
- package/dist/src/utils/errors.d.ts.map +1 -0
- package/dist/src/utils/errors.js +43 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/pathUtils.d.ts +5 -0
- package/dist/src/utils/pathUtils.d.ts.map +1 -0
- package/dist/src/utils/pathUtils.js +16 -0
- package/dist/src/utils/pathUtils.js.map +1 -0
- package/dist/src/utils/pythonRunner.d.ts +27 -0
- package/dist/src/utils/pythonRunner.d.ts.map +1 -0
- package/dist/src/utils/pythonRunner.js +62 -0
- package/dist/src/utils/pythonRunner.js.map +1 -0
- package/dist/src/utils/talkerUtils.d.ts +14 -0
- package/dist/src/utils/talkerUtils.d.ts.map +1 -0
- package/dist/src/utils/talkerUtils.js +73 -0
- package/dist/src/utils/talkerUtils.js.map +1 -0
- package/mcp-server/index.ts +757 -0
- package/package.json +72 -0
- package/resources/key/win32/x64/wx_key.dll +0 -0
- package/resources/wcdb/win32/x64/SDL2.dll +0 -0
- package/resources/wcdb/win32/x64/WCDB.dll +0 -0
- package/resources/wcdb/win32/x64/msvcp140.dll +0 -0
- package/resources/wcdb/win32/x64/msvcp140_1.dll +0 -0
- package/resources/wcdb/win32/x64/vcruntime140.dll +0 -0
- package/resources/wcdb/win32/x64/vcruntime140_1.dll +0 -0
- package/resources/wcdb/win32/x64/wcdb_api.dll +0 -0
- package/scripts/_batch_link_sources.py +73 -0
- package/scripts/_utils.py +531 -0
- package/scripts/annual_report.py +796 -0
- package/scripts/auto_tag.py +128 -0
- package/scripts/biz_daily.py +896 -0
- package/scripts/chat_report.py +397 -0
- package/scripts/chat_stats.py +702 -0
- package/scripts/classify_daily.py +411 -0
- package/scripts/compile_wiki.py +258 -0
- package/scripts/create_reading_notes.py +370 -0
- package/scripts/enrich_backlinks.py +163 -0
- package/scripts/export_chat_html.py +766 -0
- package/scripts/extract_3x_key.py +86 -0
- package/scripts/extract_todos.py +404 -0
- package/scripts/fav_server.py +392 -0
- package/scripts/fix_topics.py +111 -0
- package/scripts/generate_ai_report.py +367 -0
- package/scripts/generate_html.py +1372 -0
- package/scripts/generate_review.py +170 -0
- package/scripts/mcp_bridge.py +398 -0
- package/scripts/nt_decrypt.py +562 -0
- package/scripts/pipeline.py +145 -0
- package/scripts/promote_all.py +310 -0
- package/scripts/promote_ideas.py +297 -0
- package/scripts/rag_chat.py +191 -0
- package/scripts/scan_decrypt_4x.py +329 -0
- package/scripts/semantic_search.py +431 -0
- package/scripts/sync_fav.py +146 -0
- package/scripts/sync_weread.py +192 -0
- package/scripts/vault_rag.py +139 -0
- package/scripts/vault_search.py +141 -0
- package/src/core/dbPathService.ts +348 -0
- package/src/core/keyService.ts +409 -0
- package/src/core/ntCore.ts +224 -0
- package/src/core/sqlcipherCore.ts +764 -0
- package/src/core/wcdbCore.ts +4568 -0
- package/src/core/wechatClient.ts +204 -0
- package/src/lz4.d.ts +10 -0
- package/src/services/chatService.ts +296 -0
- package/src/services/configService.ts +197 -0
- package/src/services/exportService.ts +305 -0
- package/src/services/wechat-formatter.ts +348 -0
- package/src/services/wechatMessageService.ts +383 -0
- package/src/services/wereadService.ts +308 -0
- package/src/services/whitelistService.ts +72 -0
- package/src/types.ts +141 -0
- package/src/utils/errors.ts +42 -0
- package/src/utils/pathUtils.ts +16 -0
- package/src/utils/pythonRunner.ts +81 -0
- package/src/utils/talkerUtils.ts +84 -0
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "weflow-cli",
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"description": "让 AI 读懂你的微信 — 公众号日报·聊天导出·知识库搜索·MCP Server",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"weflow-cli": "./cli.cjs"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"cli.cjs",
|
|
11
|
+
"dist/",
|
|
12
|
+
"scripts/**/*.py",
|
|
13
|
+
"mcp-server/",
|
|
14
|
+
"bin/",
|
|
15
|
+
"src/",
|
|
16
|
+
"resources/",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"keywords": [
|
|
21
|
+
"wechat",
|
|
22
|
+
"weixin",
|
|
23
|
+
"mcp",
|
|
24
|
+
"rss",
|
|
25
|
+
"daily",
|
|
26
|
+
"公众号",
|
|
27
|
+
"聊天记录",
|
|
28
|
+
"ai",
|
|
29
|
+
"deepseek",
|
|
30
|
+
"claude"
|
|
31
|
+
],
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/zhuobichen/weflow-cli"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsc",
|
|
38
|
+
"dev": "npx tsx bin/weflow-cli.ts",
|
|
39
|
+
"start": "node cli.cjs",
|
|
40
|
+
"prepublishOnly": "npm run build"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
44
|
+
"@wenyan-md/core": "^3.0.10",
|
|
45
|
+
"chalk": "^5.4.1",
|
|
46
|
+
"commander": "^13.1.0",
|
|
47
|
+
"css-tree": "^3.2.1",
|
|
48
|
+
"exceljs": "^4.4.0",
|
|
49
|
+
"form-data-encoder": "^4.1.0",
|
|
50
|
+
"formdata-node": "^6.0.3",
|
|
51
|
+
"front-matter": "^4.0.2",
|
|
52
|
+
"fzstd": "^0.1.1",
|
|
53
|
+
"highlight.js": "^11.11.1",
|
|
54
|
+
"inquirer": "^13.4.3",
|
|
55
|
+
"jsdom": "^27.4.0",
|
|
56
|
+
"koffi": "^2.9.0",
|
|
57
|
+
"lz4": "^0.6.5",
|
|
58
|
+
"marked": "^18.0.4",
|
|
59
|
+
"marked-highlight": "^2.2.4",
|
|
60
|
+
"qrcode-terminal": "^0.12.0"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@types/node": "^22.0.0",
|
|
64
|
+
"@types/qrcode-terminal": "^0.12.2",
|
|
65
|
+
"electron": "^42.0.1",
|
|
66
|
+
"tsx": "^4.19.0",
|
|
67
|
+
"typescript": "^5.7.0"
|
|
68
|
+
},
|
|
69
|
+
"engines": {
|
|
70
|
+
"node": ">=18"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"""Batch add local_source links to existing V2 notes."""
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
import re
|
|
4
|
+
|
|
5
|
+
vault = Path('output/wechat-vault')
|
|
6
|
+
lit_dir = vault / '002_Literature' / 'WeChat'
|
|
7
|
+
biz = Path('output/biz-daily')
|
|
8
|
+
|
|
9
|
+
updated = 0
|
|
10
|
+
for date_dir in sorted(lit_dir.iterdir()):
|
|
11
|
+
if not date_dir.is_dir():
|
|
12
|
+
continue
|
|
13
|
+
date_str = date_dir.name
|
|
14
|
+
for note_file in date_dir.glob('*.md'):
|
|
15
|
+
content = note_file.read_text(encoding='utf-8')
|
|
16
|
+
if 'local_source:' in content:
|
|
17
|
+
continue
|
|
18
|
+
|
|
19
|
+
title_match = re.search(r'title:\s*"(.+?)"', content)
|
|
20
|
+
source_match = re.search(r'source:\s*"(.+?)"', content)
|
|
21
|
+
if not title_match:
|
|
22
|
+
continue
|
|
23
|
+
|
|
24
|
+
title = title_match.group(1)
|
|
25
|
+
source = source_match.group(1) if source_match else ''
|
|
26
|
+
|
|
27
|
+
# Find matching biz-daily article
|
|
28
|
+
found = False
|
|
29
|
+
for topic_dir in biz.glob(f'{date_str}/*'):
|
|
30
|
+
if not topic_dir.is_dir():
|
|
31
|
+
continue
|
|
32
|
+
for article in topic_dir.glob('*.md'):
|
|
33
|
+
if article.name == 'README.md':
|
|
34
|
+
continue
|
|
35
|
+
try:
|
|
36
|
+
ac = article.read_text(encoding='utf-8')
|
|
37
|
+
except Exception:
|
|
38
|
+
continue
|
|
39
|
+
if f'title: "{title}"' in ac or f"title: '{title}'" in ac:
|
|
40
|
+
local_path = 'file:///' + str(article.resolve()).replace('\\', '/')
|
|
41
|
+
|
|
42
|
+
# Add local_source in frontmatter
|
|
43
|
+
content = content.replace(
|
|
44
|
+
'source_type: wechat-article\n',
|
|
45
|
+
f'source_type: wechat-article\nlocal_source: "{local_path}"\n'
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
# Update callout: rename 链接→网页, add 本地
|
|
49
|
+
if '📂 打开源文件' not in content:
|
|
50
|
+
# Replace the link line in callout
|
|
51
|
+
content = content.replace(
|
|
52
|
+
'- **链接**: [',
|
|
53
|
+
'- **网页**: [微信原文]('
|
|
54
|
+
)
|
|
55
|
+
# Find where to insert local line (after 网页 line)
|
|
56
|
+
lines = content.split('\n')
|
|
57
|
+
for i, line in enumerate(lines):
|
|
58
|
+
if line.strip().startswith('- **网页**: ['):
|
|
59
|
+
# Insert local file line after this
|
|
60
|
+
lines.insert(i + 1, f'> - **本地**: [📂 打开源文件]({local_path})')
|
|
61
|
+
break
|
|
62
|
+
content = '\n'.join(lines)
|
|
63
|
+
|
|
64
|
+
note_file.write_text(content, encoding='utf-8')
|
|
65
|
+
updated += 1
|
|
66
|
+
found = True
|
|
67
|
+
break
|
|
68
|
+
if found:
|
|
69
|
+
break
|
|
70
|
+
|
|
71
|
+
print(f' {date_str}: {updated} total')
|
|
72
|
+
|
|
73
|
+
print(f'\nBatch done: {updated} notes updated')
|