weflow-cli 1.7.0 → 1.8.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/ARCHITECTURE.md +3 -2
- package/CHANGELOG.md +1949 -1
- package/OPERATIONS.md +774 -1
- package/README.en.md +93 -7
- package/README.md +31 -6
- package/bin/weflow-cli.ts +934 -27
- package/dist/bin/weflow-cli.js +952 -27
- package/dist/bin/weflow-cli.js.map +1 -1
- package/dist/mcp-server/index.js +39 -13
- package/dist/mcp-server/index.js.map +1 -1
- package/dist/src/core/appMsgFormat.d.ts +37 -0
- package/dist/src/core/appMsgFormat.d.ts.map +1 -0
- package/dist/src/core/appMsgFormat.js +106 -0
- package/dist/src/core/appMsgFormat.js.map +1 -0
- package/dist/src/core/ntCore.d.ts +19 -2
- package/dist/src/core/ntCore.d.ts.map +1 -1
- package/dist/src/core/ntCore.js +11 -1
- package/dist/src/core/ntCore.js.map +1 -1
- package/dist/src/core/sqlcipherCore.d.ts +0 -12
- package/dist/src/core/sqlcipherCore.d.ts.map +1 -1
- package/dist/src/core/sqlcipherCore.js +5 -64
- package/dist/src/core/sqlcipherCore.js.map +1 -1
- package/dist/src/core/wcdbCore.d.ts +1 -1
- package/dist/src/core/wcdbCore.d.ts.map +1 -1
- package/dist/src/core/wcdbCore.js +5 -1
- package/dist/src/core/wcdbCore.js.map +1 -1
- package/dist/src/panel/client.d.ts +25 -0
- package/dist/src/panel/client.d.ts.map +1 -0
- package/dist/src/panel/client.js +34 -0
- package/dist/src/panel/client.js.map +1 -0
- package/dist/src/panel/endpoint.d.ts +45 -0
- package/dist/src/panel/endpoint.d.ts.map +1 -0
- package/dist/src/panel/endpoint.js +132 -0
- package/dist/src/panel/endpoint.js.map +1 -0
- package/dist/src/panel/launch.d.ts +50 -0
- package/dist/src/panel/launch.d.ts.map +1 -0
- package/dist/src/panel/launch.js +74 -0
- package/dist/src/panel/launch.js.map +1 -0
- package/dist/src/panel/server.d.ts +23 -0
- package/dist/src/panel/server.d.ts.map +1 -0
- package/dist/src/panel/server.js +413 -0
- package/dist/src/panel/server.js.map +1 -0
- package/dist/src/panel/userId.d.ts +37 -0
- package/dist/src/panel/userId.d.ts.map +1 -0
- package/dist/src/panel/userId.js +56 -0
- package/dist/src/panel/userId.js.map +1 -0
- package/dist/src/services/assistantDaemon.d.ts +20 -3
- package/dist/src/services/assistantDaemon.d.ts.map +1 -1
- package/dist/src/services/assistantDaemon.js +46 -9
- package/dist/src/services/assistantDaemon.js.map +1 -1
- package/dist/src/services/assistantEval.d.ts +141 -0
- package/dist/src/services/assistantEval.d.ts.map +1 -0
- package/dist/src/services/assistantEval.js +497 -0
- package/dist/src/services/assistantEval.js.map +1 -0
- package/dist/src/services/assistantMemory.d.ts +106 -4
- package/dist/src/services/assistantMemory.d.ts.map +1 -1
- package/dist/src/services/assistantMemory.js +396 -61
- package/dist/src/services/assistantMemory.js.map +1 -1
- package/dist/src/services/assistantPrivacy.d.ts +15 -2
- package/dist/src/services/assistantPrivacy.d.ts.map +1 -1
- package/dist/src/services/assistantPrivacy.js +18 -4
- package/dist/src/services/assistantPrivacy.js.map +1 -1
- package/dist/src/services/assistantRouter.d.ts +41 -0
- package/dist/src/services/assistantRouter.d.ts.map +1 -0
- package/dist/src/services/assistantRouter.js +151 -0
- package/dist/src/services/assistantRouter.js.map +1 -0
- package/dist/src/services/assistantService.d.ts +209 -3
- package/dist/src/services/assistantService.d.ts.map +1 -1
- package/dist/src/services/assistantService.js +590 -75
- package/dist/src/services/assistantService.js.map +1 -1
- package/dist/src/services/assistantTools.d.ts +205 -1
- package/dist/src/services/assistantTools.d.ts.map +1 -1
- package/dist/src/services/assistantTools.js +1089 -58
- package/dist/src/services/assistantTools.js.map +1 -1
- package/dist/src/services/assistantTrace.d.ts +47 -0
- package/dist/src/services/assistantTrace.d.ts.map +1 -0
- package/dist/src/services/assistantTrace.js +150 -0
- package/dist/src/services/assistantTrace.js.map +1 -0
- package/dist/src/services/chatService.d.ts +1 -1
- package/dist/src/services/chatService.d.ts.map +1 -1
- package/dist/src/services/chatService.js +5 -2
- package/dist/src/services/chatService.js.map +1 -1
- package/dist/src/services/configService.d.ts +9 -0
- package/dist/src/services/configService.d.ts.map +1 -1
- package/dist/src/services/configService.js +15 -8
- package/dist/src/services/configService.js.map +1 -1
- package/dist/src/services/pythonBridge.d.ts +41 -0
- package/dist/src/services/pythonBridge.d.ts.map +1 -0
- package/dist/src/services/pythonBridge.js +119 -0
- package/dist/src/services/pythonBridge.js.map +1 -0
- package/dist/src/services/syncService.d.ts +8 -2
- package/dist/src/services/syncService.d.ts.map +1 -1
- package/dist/src/services/syncService.js +26 -7
- package/dist/src/services/syncService.js.map +1 -1
- package/dist/src/services/wechatMessageService.d.ts +25 -0
- package/dist/src/services/wechatMessageService.d.ts.map +1 -1
- package/dist/src/services/wechatMessageService.js +69 -7
- package/dist/src/services/wechatMessageService.js.map +1 -1
- package/dist/src/utils/atomicWrite.d.ts +4 -0
- package/dist/src/utils/atomicWrite.d.ts.map +1 -0
- package/dist/src/utils/atomicWrite.js +60 -0
- package/dist/src/utils/atomicWrite.js.map +1 -0
- package/dist/src/utils/dateRange.d.ts +15 -0
- package/dist/src/utils/dateRange.d.ts.map +1 -1
- package/dist/src/utils/dateRange.js +47 -0
- package/dist/src/utils/dateRange.js.map +1 -1
- package/dist/src/utils/text.d.ts +18 -0
- package/dist/src/utils/text.d.ts.map +1 -0
- package/dist/src/utils/text.js +20 -0
- package/dist/src/utils/text.js.map +1 -0
- package/docs/AI_INTERFACE.md +2 -0
- package/docs/DECISIONS.md +1424 -0
- package/docs/EXTENDING.md +187 -0
- package/docs/JEV/345/272/224/347/224/250/346/226/275/345/267/245/346/226/207/346/241/243.md +310 -0
- package/docs/MCP.md +23 -4
- package/docs/PROJECT_STATE.md +299 -98
- package/docs/SETUP.md +22 -0
- package/docs/SYNC_CONTRACT.md +31 -3
- package/mcp-server/index.ts +681 -657
- package/package.json +84 -83
- package/resources/panel/ball-position.cjs +153 -0
- package/resources/panel/index.html +46 -0
- package/resources/panel/main.cjs +447 -0
- package/resources/panel/mascot-focus.png +0 -0
- package/resources/panel/mascot-happy.png +0 -0
- package/resources/panel/mascot-sorry.png +0 -0
- package/resources/panel/mascot-tired.png +0 -0
- package/resources/panel/mascot.png +0 -0
- package/resources/panel/package.json +7 -0
- package/resources/panel/panel.css +407 -0
- package/resources/panel/preload.cjs +72 -0
- package/resources/panel/quick-menu.cjs +197 -0
- package/resources/panel/renderer.js +441 -0
- package/resources/panel/tray-menu.cjs +40 -0
- package/resources/panel/tray.png +0 -0
- package/scripts/_utils.py +403 -54
- package/scripts/annual_report.py +4 -2
- package/scripts/article_notes.py +423 -0
- package/scripts/backfill_articles.py +438 -0
- package/scripts/biz_daily.py +590 -105
- package/scripts/chat_notes.py +470 -0
- package/scripts/classify_daily.py +10 -18
- package/scripts/compile_wiki.py +1059 -46
- package/scripts/create_reading_notes.py +199 -14
- package/scripts/decide.py +253 -0
- package/scripts/draft_reply.py +671 -0
- package/scripts/export_chat_html.py +35 -33
- package/scripts/extract_todos.py +31 -5
- package/scripts/fav_notes.py +318 -0
- package/scripts/fix_topics.py +2 -1
- package/scripts/generate_ai_report.py +214 -9
- package/scripts/generate_html.py +18 -3
- package/scripts/generate_review.py +2 -2
- package/scripts/jev_client.py +294 -0
- package/scripts/jev_probe.py +440 -0
- package/scripts/nt_common.py +82 -0
- package/scripts/nt_decrypt.py +1755 -1460
- package/scripts/pipeline.py +27 -2
- package/scripts/promote_ideas.py +19 -4
- package/scripts/quality_eval.py +707 -0
- package/scripts/rag_chat.py +4 -4
- package/scripts/read_image.py +187 -0
- package/scripts/reply_debt.py +488 -0
- package/scripts/route_cards.py +453 -0
- package/scripts/semantic_search.py +208 -49
- package/scripts/user_notes.py +315 -0
- package/scripts/vault_rag.py +13 -7
- package/scripts/vault_search.py +21 -4
- package/scripts/wiki_lint.py +397 -0
- package/src/core/appMsgFormat.ts +117 -0
- package/src/core/ntCore.ts +27 -2
- package/src/core/sqlcipherCore.ts +5 -61
- package/src/core/wcdbCore.ts +6 -2
- package/src/panel/client.ts +49 -0
- package/src/panel/endpoint.ts +144 -0
- package/src/panel/launch.ts +101 -0
- package/src/panel/server.ts +424 -0
- package/src/panel/userId.ts +72 -0
- package/src/services/assistantDaemon.ts +57 -9
- package/src/services/assistantEval.ts +611 -0
- package/src/services/assistantMemory.ts +413 -57
- package/src/services/assistantPrivacy.ts +18 -4
- package/src/services/assistantRouter.ts +191 -0
- package/src/services/assistantService.ts +671 -74
- package/src/services/assistantTools.ts +1118 -57
- package/src/services/assistantTrace.ts +175 -0
- package/src/services/chatService.ts +6 -2
- package/src/services/configService.ts +403 -385
- package/src/services/pythonBridge.ts +139 -0
- package/src/services/syncService.ts +37 -9
- package/src/services/wechatMessageService.ts +73 -7
- package/src/utils/atomicWrite.ts +56 -0
- package/src/utils/dateRange.ts +46 -0
- package/src/utils/text.ts +20 -0
package/scripts/pipeline.py
CHANGED
|
@@ -48,6 +48,11 @@ def main():
|
|
|
48
48
|
parser.add_argument('--skip-html', action='store_true', help='跳过 HTML 生成')
|
|
49
49
|
parser.add_argument('--skip-ai-report', action='store_true', help='跳过 AI 深度阅读报告')
|
|
50
50
|
parser.add_argument('--no-ai', action='store_true', help='关闭所有 AI 调用,但保留抓取和本地输出')
|
|
51
|
+
parser.add_argument('--no-summary', action='store_true',
|
|
52
|
+
help='biz_daily 只做判断不做生成(不调 LLM 写摘要/标签/简报,'
|
|
53
|
+
'主题与相关度仍由 Jev 判断),因此**不需要 DeepSeek key**。'
|
|
54
|
+
'注意:下游步骤(行动建议/概念编译/AI 报告)仍会用 LLM,'
|
|
55
|
+
'要全关请再加 --skip-classify --skip-wiki --skip-ai-report')
|
|
51
56
|
parser.add_argument('--ai-report-range', type=int, default=1, help='AI 报告覆盖最近 N 天(默认 1=仅当天)')
|
|
52
57
|
parser.add_argument('--source', action='append', default=[], metavar='NAME',
|
|
53
58
|
help='仅处理指定公众号,可重复或用逗号分隔')
|
|
@@ -59,9 +64,20 @@ def main():
|
|
|
59
64
|
if str(config.get('dailyAiEnabled', 'true')).strip().lower() == 'false':
|
|
60
65
|
args.no_ai = True
|
|
61
66
|
|
|
62
|
-
# api_key:本地/ollama
|
|
67
|
+
# api_key:本地/ollama 引擎不需要;云端需要。
|
|
68
|
+
# `--no-summary` 时 biz_daily 不生成任何文字,所以这一步不需要 key——但**下游步骤
|
|
69
|
+
# 仍需要**,所以只在"下游也全关"时才整段跳过校验,否则照旧检查(免得后面某一步
|
|
70
|
+
# 在跑到一半时才发现没 key)。
|
|
71
|
+
#
|
|
72
|
+
# **只算真的会调 LLM 的那两步**(行动建议、概念编译):`generate_ai_report.py` 虽然
|
|
73
|
+
# 叫 AI 报告,但一次 LLM 都不调(它读已落盘的概率与判断),把它算进来会让
|
|
74
|
+
# `--no-summary --skip-classify --skip-wiki` 仍然索要 DeepSeek key——那正是这条
|
|
75
|
+
# 路要摆脱的东西。
|
|
63
76
|
api_key = args.api_key or ''
|
|
64
|
-
|
|
77
|
+
downstream_ai = not (args.skip_classify and args.skip_wiki)
|
|
78
|
+
needs_key = args.engine in ('deepseek', 'claude') and not args.no_ai and (
|
|
79
|
+
not args.no_summary or downstream_ai)
|
|
80
|
+
if needs_key and not api_key:
|
|
65
81
|
api_key = os.environ.get('DEEPSEEK_API_KEY', '') or get_api_key(config)
|
|
66
82
|
if not api_key:
|
|
67
83
|
print(f'[ERROR] --engine {args.engine} 需要 API key。请通过 --api-key、'
|
|
@@ -81,6 +97,15 @@ def main():
|
|
|
81
97
|
step1_args += ['--source', source]
|
|
82
98
|
if args.no_ai:
|
|
83
99
|
step1_args += ['--no-ai']
|
|
100
|
+
if args.no_summary and not args.no_ai:
|
|
101
|
+
# 只对 biz_daily 转发:它跳过摘要/简报的生成,判断仍走 Jev。
|
|
102
|
+
step1_args += ['--no-summary']
|
|
103
|
+
if downstream_ai:
|
|
104
|
+
print(' [提示] --no-summary 只关掉本步骤的 LLM 生成;下游仍会调 LLM 的步骤:'
|
|
105
|
+
'%s。要全关请补上对应 --skip-*'
|
|
106
|
+
% '、'.join(n for n, skipped in (('classify_daily(行动建议)', args.skip_classify),
|
|
107
|
+
('compile_wiki(概念编译)', args.skip_wiki))
|
|
108
|
+
if not skipped))
|
|
84
109
|
if not run_step('biz_daily — 抓取+摘要', step1_args):
|
|
85
110
|
sys.exit(1)
|
|
86
111
|
|
package/scripts/promote_ideas.py
CHANGED
|
@@ -86,6 +86,9 @@ def generate_ideas(articles: list[dict], api_key: str, vault_path: str) -> int:
|
|
|
86
86
|
for topic, arts in by_topic.items():
|
|
87
87
|
if len(arts) < 5:
|
|
88
88
|
continue
|
|
89
|
+
if not str(topic).strip():
|
|
90
|
+
# 同上:空主题会写出 `想法-.md` 这种畸形文件名
|
|
91
|
+
continue
|
|
89
92
|
# 取代表性文章(高概念数的)
|
|
90
93
|
samples = sorted(arts, key=lambda a: len(a.get('concepts', [])), reverse=True)[:10]
|
|
91
94
|
titles = '\n'.join(f'- {a["title"][:60]} (来源: {a["source"]})' for a in samples[:8])
|
|
@@ -178,6 +181,11 @@ def generate_moc(articles: list[dict], vault_path: str) -> int:
|
|
|
178
181
|
for topic, arts in by_topic.items():
|
|
179
182
|
if len(arts) < 5:
|
|
180
183
|
continue
|
|
184
|
+
if not str(topic).strip():
|
|
185
|
+
# **主题为空的不生成 MOC。** 否则就是一个叫 `MOC-.md` 的文件——畸形名字,
|
|
186
|
+
# 在文件列表里看着就是个坏掉的条目;而"没有主题的文章"本来也无从做主题导航。
|
|
187
|
+
# (2026-09-27 实测:全库 9 篇无主题,它确实生成了 `MOC-.md`。)
|
|
188
|
+
continue
|
|
181
189
|
|
|
182
190
|
# 按日期分组
|
|
183
191
|
by_date = defaultdict(list)
|
|
@@ -213,7 +221,11 @@ article_count: {len(arts)}
|
|
|
213
221
|
day_arts = by_date[date_str]
|
|
214
222
|
content += f'\n### {date_str} ({len(day_arts)} 篇)\n'
|
|
215
223
|
for a in day_arts[:8]:
|
|
216
|
-
|
|
224
|
+
# **链接用文件名(stem),不带目录、不带 `.md`。** 笔记自己的链接就是
|
|
225
|
+
# 这个形态(`create_reading_notes` 写 `[[{日期}-{标题}|{标题}]]`),
|
|
226
|
+
# Obsidian 按"最短唯一路径"解析得了;而原来的 `日期/文件名.md` 既不是
|
|
227
|
+
# 全路径、也不是文件名,很可能解析不了——链接会渲染成未解析的暗色条目。
|
|
228
|
+
content += f'- [[{a["path"].stem}|{a["title"][:60]}]] — {a["source"]}\n'
|
|
217
229
|
if len(day_arts) > 8:
|
|
218
230
|
content += f'- ... 等 {len(day_arts)} 篇\n'
|
|
219
231
|
|
|
@@ -234,15 +246,18 @@ article_count: {len(arts)}
|
|
|
234
246
|
if other != topic:
|
|
235
247
|
content += f'- [[MOC-{other}]]\n'
|
|
236
248
|
|
|
249
|
+
# 统计表这段查询与阅读笔记里那两处修的是同一对毛病:`SORT date` 排的字段在阅读
|
|
250
|
+
# 笔记里不存在(是 `published`),`contains(hasTopic, …)` 比的是嵌套列表
|
|
251
|
+
# (`hasTopic: [[AI]]` → `[['AI']]`)。见 `create_reading_notes.RELATED_QUERY` 的注释。
|
|
237
252
|
content += f'''
|
|
238
253
|
|
|
239
254
|
## 📊 统计
|
|
240
255
|
|
|
241
256
|
```dataview
|
|
242
|
-
TABLE
|
|
257
|
+
TABLE published AS 日期, source AS 来源, rating
|
|
243
258
|
FROM "002_Literature"
|
|
244
|
-
WHERE contains(hasTopic, "{topic}")
|
|
245
|
-
SORT
|
|
259
|
+
WHERE contains(string(hasTopic), "{topic}")
|
|
260
|
+
SORT published DESC
|
|
246
261
|
```
|
|
247
262
|
'''
|
|
248
263
|
|