@omnicrawl/cli-win32-ia32 0.4.1 → 0.4.3
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/bin/omnicrawl.exe +0 -0
- package/host/omnicrawl/config/templates/config.example.toml +84 -14
- package/host/omnicrawl/config/templates/decision_models.example.toml +4 -7
- package/host/omnicrawl/templates/plan.md +1 -1
- package/host/omnicrawl/templates/programming.md +65 -0
- package/host/omnicrawl/templates/subagents/explore.md +5 -1
- package/host/omnicrawl/templates/subagents/general-purpose.md +6 -2
- package/host/omnicrawl/templates/subagents/plan.md +5 -1
- package/host/omnicrawl/templates/subagents/review.md +5 -1
- package/host/omnicrawl/templates/subagents/verify.md +5 -1
- package/host/omnicrawl/templates/system_prompt.md +2 -1
- package/host/omnicrawl-api.exe +0 -0
- package/host/omnicrawl-decision.exe +0 -0
- package/host/omnicrawl-fetch.exe +0 -0
- package/host/omnicrawl-host.exe +0 -0
- package/host/omnicrawl-mcp-server.exe +0 -0
- package/host/omnicrawl-tui.exe +0 -0
- package/host/omnicrawl.exe +0 -0
- package/host/rust/assets/config-templates/config.example.toml +84 -14
- package/host/rust/assets/config-templates/decision_models.example.toml +4 -7
- package/host/rust/assets/templates/plan.md +1 -1
- package/host/rust/assets/templates/programming.md +65 -0
- package/host/rust/assets/templates/subagents/explore.md +5 -1
- package/host/rust/assets/templates/subagents/general-purpose.md +6 -2
- package/host/rust/assets/templates/subagents/plan.md +5 -1
- package/host/rust/assets/templates/subagents/review.md +5 -1
- package/host/rust/assets/templates/subagents/verify.md +5 -1
- package/host/rust/assets/templates/system_prompt.md +2 -1
- package/package.json +2 -1
- package/version.json +4 -4
- package/host/omnicrawl/extensions/node_runner.mjs +0 -402
- package/host/rust/assets/extensions/node_runner.mjs +0 -402
package/bin/omnicrawl.exe
CHANGED
|
Binary file
|
|
@@ -21,6 +21,7 @@ base_url = "https://api.openai.com/v1"
|
|
|
21
21
|
# 凭据只写明文;留空时首启向导会在启动前补问。
|
|
22
22
|
api_key = ""
|
|
23
23
|
# 可选:覆盖该渠道请求使用的 HTTP User-Agent。
|
|
24
|
+
# 留空时统一报 `omnicrawl/<版本>`(版本来自 packages/cli/package.json)。
|
|
24
25
|
# user_agent = "OmniCrawl/1.0"
|
|
25
26
|
default_protocol = "openai_chat_completions"
|
|
26
27
|
default_context_window_tokens = 128000
|
|
@@ -149,6 +150,7 @@ mode = "review"
|
|
|
149
150
|
# 自动审查使用的独立模型(可选):留空时沿用 [llm] model。
|
|
150
151
|
# 审查请求与主对话完全隔离(不携带主对话上下文),独立模型不影响主对话成本,
|
|
151
152
|
# 且主模型被提示词注入时也不影响审查独立性;建议指定更便宜/更严格的模型。
|
|
153
|
+
# 审查范围是删除类、下载即执行类与高风险 Git 调用;memory_delete 不在其中。
|
|
152
154
|
review_model = ""
|
|
153
155
|
|
|
154
156
|
# 对话区思考块显示:关闭后思考内容仍照常产生并进入推理链路,只是不在
|
|
@@ -170,7 +172,6 @@ enabled = true
|
|
|
170
172
|
# powershell = false
|
|
171
173
|
# bash = true
|
|
172
174
|
# read_image = true
|
|
173
|
-
# windows_screenshot = true
|
|
174
175
|
|
|
175
176
|
# 运行节奏护栏:Reasoning 死循环保护、白名单临时错误恢复与有限自动续跑。
|
|
176
177
|
# 自动续跑会增加模型请求次数和 Token 消耗;保存后从下一次回合生效。
|
|
@@ -257,19 +258,6 @@ failure_fallback = "deterministic"
|
|
|
257
258
|
# detect_license_plate = true # 中国大陆车牌
|
|
258
259
|
# gitleaks 开源规则:默认加载内置离线快照(rust/crates/omnicrawl-llm/data/gitleaks.toml);
|
|
259
260
|
# gitleaks_config_path 指向自定义文件时按规则 id 覆盖 / 追加(失败回退内置快照)。
|
|
260
|
-
# NER 兜底层(BiLSTM-CRF:人名 / 地名 / 机构名):结构 / 规则 / 熵之外的最后一道语义
|
|
261
|
-
# 兜底,输入是前几层处理后的文本且只对中文片段兜底(非中文字符已等长隔离);
|
|
262
|
-
# 需要可选依赖 torch(pip install -e .[ner])。
|
|
263
|
-
# 权重随包分发,可用 ner_model_path 或环境变量 OMNICRAWL_NER_MODEL 覆盖;
|
|
264
|
-
# torch / 权重缺失时本层静默跳过,不影响既有脱敏链路。
|
|
265
|
-
# ner_enabled = false # 默认关闭;开启后作为语义兜底
|
|
266
|
-
# ner_model_path = "" # checkpoint 路径;留空用随包权重 / 环境变量
|
|
267
|
-
# ner_device = "auto" # auto 优先 CUDA、不可用回退 CPU
|
|
268
|
-
# ner_entity_types = ["PER", "ORG", "LOC"] # 需要识别的实体类型
|
|
269
|
-
# ner_min_entity_chars = 2 # 最小实体长度(2 规避单字地名歧义)
|
|
270
|
-
# 推理结果缓存:按「块」(≤200 字符)缓存,长会话中未变历史不再重复推理;
|
|
271
|
-
# 容量单位是块数,默认 2048(约 400KB 文本),0 关闭。
|
|
272
|
-
# ner_cache_size = 2048
|
|
273
261
|
|
|
274
262
|
[api]
|
|
275
263
|
bearer_token = "请替换为随机长令牌"
|
|
@@ -283,6 +271,32 @@ confirmation_timeout_seconds = 300
|
|
|
283
271
|
# 每个 worker 会各自创建一个 Agent 与独立隔离 worktree,按机器核数与内存设置。
|
|
284
272
|
workers = 1
|
|
285
273
|
|
|
274
|
+
# 网页抓取接口:把 fetcher 工具的抓取能力以 REST 暴露给本机其它程序
|
|
275
|
+
# (Python 等批量脚本、CLI、Skill),它们不必经 Agent 回合就能抓网页。
|
|
276
|
+
#
|
|
277
|
+
# 端点(成功回 {"data": ...},失败回 {"error": {code, message}}):
|
|
278
|
+
# GET /health 健康检查
|
|
279
|
+
# GET /v1/status 服务自检(监听地址、URL 上限、固定指纹)
|
|
280
|
+
# POST /v1/fetch {urls | url, max_chars?, max_html?, timeout?, parallel?,
|
|
281
|
+
# insecure?, impersonate?, run_scripts?, force_scripts?}
|
|
282
|
+
# → {count, elapsed_seconds, results: [{url, error, status,
|
|
283
|
+
# final_url, title, content}]}
|
|
284
|
+
#
|
|
285
|
+
# 接口不做鉴权、不做参数校验:只要监听地址可达就能直接抓取。因此 host 只允许
|
|
286
|
+
# 回环地址(127.0.0.1 / localhost / ::1),即只有本机程序能调用。
|
|
287
|
+
# 抓取语义与 fetcher 工具同源:robots.txt 校验、浏览器指纹传输、正文提取与
|
|
288
|
+
# 脚本重建都不变,因此同样不绕过验证码。
|
|
289
|
+
# 随 OmniCrawl 启动时自动拉起,本机已有服务则直接复用。默认关闭。
|
|
290
|
+
[fetch_api]
|
|
291
|
+
enabled = false
|
|
292
|
+
host = "127.0.0.1"
|
|
293
|
+
# 端口:与本地 API(8765)、决策接口(8767)错开。
|
|
294
|
+
port = 8768
|
|
295
|
+
# 固定浏览器指纹族:chrome / firefox / safari / edge。留空表示按请求参数(默认 chrome)。
|
|
296
|
+
impersonate = ""
|
|
297
|
+
# 单次请求的 URL 上限:0 表示用默认上限 20,否则按 1–20 收窄。
|
|
298
|
+
max_urls = 0
|
|
299
|
+
|
|
286
300
|
[agent_temp]
|
|
287
301
|
enabled = true
|
|
288
302
|
directory = ".omnicrawl/.agent_tmp"
|
|
@@ -343,3 +357,59 @@ require_confirmation_for_write = true
|
|
|
343
357
|
require_confirmation_for_command = true
|
|
344
358
|
allow_external_network_tools = false
|
|
345
359
|
audit_log_enabled = true
|
|
360
|
+
|
|
361
|
+
# --- MQTT 自动化回路(遥测进、动作出;详见 assets/docs/MQTT.md)---------------------------
|
|
362
|
+
# 与消息平台连接器不同:入口是传感器报文,出口是带 request_id 与 TTL 的下发指令。
|
|
363
|
+
# 规则层永远在线,只在命中时唤醒一次模型。规划器二选一:agent(内核回合 + 工具白名单,
|
|
364
|
+
# 默认)或 decision(单次结构化决策,决策模型优先、未配置时回落主模型)。
|
|
365
|
+
# 启动:omnicrawl-host connector mqtt
|
|
366
|
+
#
|
|
367
|
+
# [mqtt]
|
|
368
|
+
# enabled = true
|
|
369
|
+
# broker = "mqtt://192.168.1.10:1883" # 也支持 mqtts://host:8883
|
|
370
|
+
# client_id = "omnicrawl-farm"
|
|
371
|
+
# username = "farm"
|
|
372
|
+
# password_env = "OMNICRAWL_MQTT_PASSWORD"
|
|
373
|
+
# keepalive_seconds = 120
|
|
374
|
+
# qos = 1
|
|
375
|
+
# topics = ["farm/+/env"]
|
|
376
|
+
# zone_field = "zone"
|
|
377
|
+
# zone_topic_level = 1
|
|
378
|
+
# window_seconds = 30
|
|
379
|
+
# cooldown_seconds = 1800
|
|
380
|
+
# poll_seconds = 1
|
|
381
|
+
# command_topic = "farm/{zone}/command"
|
|
382
|
+
# ack_topic = "farm/{zone}/ack"
|
|
383
|
+
# ack_timeout_seconds = 15
|
|
384
|
+
# ttl_seconds = 300
|
|
385
|
+
# recent_actions = 5
|
|
386
|
+
# audit_path = "~/.OmniCrawl/mqtt/audit.jsonl"
|
|
387
|
+
#
|
|
388
|
+
# 规划器:agent = 内核回合(可查资料、多步推理,工具受白名单约束);
|
|
389
|
+
# decision = 单次结构化决策(决策模型优先,未配置时回落主模型)。
|
|
390
|
+
# planner = "agent"
|
|
391
|
+
# turn_timeout_seconds = 120
|
|
392
|
+
# 无人值守白名单:不在表里的工具既不声明给模型,宿主也不执行。
|
|
393
|
+
# 默认只读 + 记忆/知识库/联网检索;追加 bash / write_file 前先想清楚报文来源是否可信。
|
|
394
|
+
# tools = ["read", "list", "find", "grep", "memory_search", "memory_read", "kb_search",
|
|
395
|
+
# "web_search", "fetcher"]
|
|
396
|
+
#
|
|
397
|
+
# [[mqtt.actions]]
|
|
398
|
+
# id = "open_vent"
|
|
399
|
+
# label = "打开通风口"
|
|
400
|
+
# description = "温度偏高、湿度偏大时通风降温除湿"
|
|
401
|
+
#
|
|
402
|
+
# [[mqtt.actions]]
|
|
403
|
+
# id = "do_nothing"
|
|
404
|
+
# label = "维持现状"
|
|
405
|
+
# description = "指标已在合适范围,无需干预"
|
|
406
|
+
#
|
|
407
|
+
# [[mqtt.rules]]
|
|
408
|
+
# id = "high_temp"
|
|
409
|
+
# metric = "temp"
|
|
410
|
+
# op = "gt"
|
|
411
|
+
# value = 28.0
|
|
412
|
+
# sustain_seconds = 300
|
|
413
|
+
# clear_value = 26.0
|
|
414
|
+
# actions = ["open_vent", "do_nothing"]
|
|
415
|
+
# fallback = "open_vent"
|
|
@@ -62,13 +62,10 @@ skill_search_rerank = false
|
|
|
62
62
|
# 显式给了 max_results 才收窄总数。决策服务不可用时回退本地顺序,搜索不会因此失败。
|
|
63
63
|
web_search_rerank = false
|
|
64
64
|
|
|
65
|
-
#
|
|
66
|
-
#
|
|
67
|
-
#
|
|
68
|
-
#
|
|
69
|
-
# (未配渠道、无凭据、请求失败)才回退决策模型排序;决策模型也不可用时回退本地关键词排序,
|
|
70
|
-
# 搜索不会因此失败。向量通路不依赖决策模型服务,因此不必先配决策渠道。
|
|
71
|
-
web_search_embedding_rerank = false
|
|
65
|
+
# 联网搜索的 BM25 排序是固定行为,不是开关:每一路渠道结果本地算 BM25(k1=1.2、b=0.75;
|
|
66
|
+
# 中文按二字片段切分),按得分排序后每路保留前 5 条。本地算分,不需要模型渠道,也没有网络往返。
|
|
67
|
+
# 该路候选没有一个命中查询词时才回退到上面的 web_search_rerank(若开启),再不可用则回退本地
|
|
68
|
+
# 关键词覆盖度排序,搜索不会因此失败。
|
|
72
69
|
|
|
73
70
|
# 提问由决策模型自动作答:开启后模型调用 ask_user 且带选项时,不再弹面板等你作答,
|
|
74
71
|
# 而是把提问正文、你本回合的请求与本回合已有的顾问答复交给决策模型,让它选最符合
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
|
|
4
|
+
|
|
5
|
+
**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
|
|
6
|
+
|
|
7
|
+
## 1. Think Before Coding
|
|
8
|
+
|
|
9
|
+
**Don't assume. Don't hide confusion. Surface tradeoffs.**
|
|
10
|
+
|
|
11
|
+
Before implementing:
|
|
12
|
+
- State your assumptions explicitly. If uncertain, ask.
|
|
13
|
+
- If multiple interpretations exist, present them - don't pick silently.
|
|
14
|
+
- If a simpler approach exists, say so. Push back when warranted.
|
|
15
|
+
- If something is unclear, stop. Name what's confusing. Ask.
|
|
16
|
+
|
|
17
|
+
## 2. Simplicity First
|
|
18
|
+
|
|
19
|
+
**Minimum code that solves the problem. Nothing speculative.**
|
|
20
|
+
|
|
21
|
+
- No features beyond what was asked.
|
|
22
|
+
- No abstractions for single-use code.
|
|
23
|
+
- No "flexibility" or "configurability" that wasn't requested.
|
|
24
|
+
- No error handling for impossible scenarios.
|
|
25
|
+
- If you write 200 lines and it could be 50, rewrite it.
|
|
26
|
+
|
|
27
|
+
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
|
|
28
|
+
|
|
29
|
+
## 3. Surgical Changes
|
|
30
|
+
|
|
31
|
+
**Touch only what you must. Clean up only your own mess.**
|
|
32
|
+
|
|
33
|
+
When editing existing code:
|
|
34
|
+
- Don't "improve" adjacent code, comments, or formatting.
|
|
35
|
+
- Don't refactor things that aren't broken.
|
|
36
|
+
- Match existing style, even if you'd do it differently.
|
|
37
|
+
- If you notice unrelated dead code, mention it - don't delete it.
|
|
38
|
+
|
|
39
|
+
When your changes create orphans:
|
|
40
|
+
- Remove imports/variables/functions that YOUR changes made unused.
|
|
41
|
+
- Don't remove pre-existing dead code unless asked.
|
|
42
|
+
|
|
43
|
+
The test: Every changed line should trace directly to the user's request.
|
|
44
|
+
|
|
45
|
+
## 4. Goal-Driven Execution
|
|
46
|
+
|
|
47
|
+
**Define success criteria. Loop until verified.**
|
|
48
|
+
|
|
49
|
+
Transform tasks into verifiable goals:
|
|
50
|
+
- "Add validation" → "Write tests for invalid inputs, then make them pass"
|
|
51
|
+
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
|
|
52
|
+
- "Refactor X" → "Ensure tests pass before and after"
|
|
53
|
+
|
|
54
|
+
For multi-step tasks, state a brief plan:
|
|
55
|
+
```
|
|
56
|
+
1. [Step] → verify: [check]
|
|
57
|
+
2. [Step] → verify: [check]
|
|
58
|
+
3. [Step] → verify: [check]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
**These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.
|
|
@@ -15,7 +15,11 @@ tools:
|
|
|
15
15
|
- bash
|
|
16
16
|
- powershell
|
|
17
17
|
disallowedTools:
|
|
18
|
-
-
|
|
18
|
+
- subagent_run
|
|
19
|
+
- subagent_list
|
|
20
|
+
- subagent_cancel
|
|
21
|
+
- subagent_apply_worktree
|
|
22
|
+
- subagent_discard_worktree
|
|
19
23
|
- switch_model
|
|
20
24
|
- switch_skill
|
|
21
25
|
- load_skill
|
|
@@ -36,7 +40,7 @@ background: false
|
|
|
36
40
|
5. 完成后用简洁中文总结:改了什么、为什么、如何验证、残留风险。
|
|
37
41
|
|
|
38
42
|
约束:
|
|
39
|
-
- 禁止调用
|
|
43
|
+
- 禁止调用 subagent_run、subagent_list、subagent_cancel、subagent_apply_worktree、subagent_discard_worktree、switch_model、switch_skill、load_skill、search_skills。
|
|
40
44
|
- 不要提交 git commit、push 或改远程。
|
|
41
45
|
- 不要删除用户未明确要求删除的文件。
|
|
42
46
|
- isolation=worktree 时,结果会以分支/diff 形式返回父 Agent,由父决定是否应用。
|
|
@@ -49,7 +49,7 @@ Todo 规划协议:
|
|
|
49
49
|
- 只在系统边界做输入验证(用户输入、外部 API)。
|
|
50
50
|
- 在编写前端 UI 文案时,请保持极简主义(Minimalism)。拒绝流水账:严禁在标签、按钮或标题后使用括号进行大白话解释。
|
|
51
51
|
|
|
52
|
-
omnicrawl文档(共
|
|
52
|
+
omnicrawl文档(共 15 篇,均以 `omnicrawl://docs/<文件名>` 读取,按需只读相关场景):
|
|
53
53
|
- MCP 配置、调用或故障排查:优先使用 MCP 能力;读取 `omnicrawl://docs/MCP_USAGE.md`;实现细节位于 `rust/crates/omnicrawl-mcp/`。
|
|
54
54
|
- Skill 安装、编写或渐进式披露:读取 `omnicrawl://docs/SKILL_INSTALLATION.md`;实现细节位于 `rust/crates/omnicrawl-extensions/src/skill.rs`。
|
|
55
55
|
- 本地 HTTP/SSE API 接入(启动、鉴权、接口清单、事件流):读取 `omnicrawl://docs/API.md`;实现位于 `rust/crates/omnicrawl-api/`。
|
|
@@ -63,6 +63,7 @@ omnicrawl文档(共 14 篇,均以 `omnicrawl://docs/<文件名>` 读取,
|
|
|
63
63
|
- AI 消息脱敏(可逆占位符、匹配引擎、序号注册表、流式还原、`[desensitization]` 配置、设置面板「消息脱敏」):读取 `omnicrawl://docs/agent_gateway_desensitization_design.md`;实现位于 `rust/crates/omnicrawl-llm/src/desensitization/` 和 `rust/crates/omnicrawl-config/src/features/desensitization.rs`。
|
|
64
64
|
- TTS 语音合成(Kokoro-82M ONNX CPU:配置、tts_synthesize 工具、CLI、音素化、模型下载):读取 `omnicrawl://docs/TTS.md`;实现位于 `rust/crates/omnicrawl-tts/` 和 `rust/crates/omnicrawl-config/src/features/tts.rs`。
|
|
65
65
|
- 决策接口(结构化决策模型的本地 REST 服务:启动、无鉴权的回环访问、decide/choice/rank/review 端点、常驻与复用、脱敏与安全边界):读取 `omnicrawl://docs/decision_api.md`;实现位于 `rust/crates/omnicrawl-decision/` 和 `rust/crates/omnicrawl-config/src/features/decision_model.rs`。
|
|
66
|
+
- 抓取接口(fetcher 的本机 REST 通道:`[fetch_api]` 配置、`/v1/fetch` 端点、无鉴权回环访问、Python 批量脚本调用、与工具同源的抓取语义与安全边界):读取 `omnicrawl://docs/fetch_api.md`;实现位于 `rust/crates/omnicrawl-fetch/`、`rust/crates/omnicrawl-config/src/features/fetch_api.rs` 和 `rust/crates/omnicrawl-host/src/tools/fetcher.rs`。
|
|
66
67
|
- FSAPP 接入(文件系统应用侧的接入约定):读取 `omnicrawl://docs/FSAPP.md`。
|
|
67
68
|
|
|
68
69
|
脱敏占位符引用规则:
|
package/host/omnicrawl-api.exe
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/host/omnicrawl-host.exe
CHANGED
|
Binary file
|
|
Binary file
|
package/host/omnicrawl-tui.exe
CHANGED
|
Binary file
|
package/host/omnicrawl.exe
CHANGED
|
Binary file
|
|
@@ -21,6 +21,7 @@ base_url = "https://api.openai.com/v1"
|
|
|
21
21
|
# 凭据只写明文;留空时首启向导会在启动前补问。
|
|
22
22
|
api_key = ""
|
|
23
23
|
# 可选:覆盖该渠道请求使用的 HTTP User-Agent。
|
|
24
|
+
# 留空时统一报 `omnicrawl/<版本>`(版本来自 packages/cli/package.json)。
|
|
24
25
|
# user_agent = "OmniCrawl/1.0"
|
|
25
26
|
default_protocol = "openai_chat_completions"
|
|
26
27
|
default_context_window_tokens = 128000
|
|
@@ -149,6 +150,7 @@ mode = "review"
|
|
|
149
150
|
# 自动审查使用的独立模型(可选):留空时沿用 [llm] model。
|
|
150
151
|
# 审查请求与主对话完全隔离(不携带主对话上下文),独立模型不影响主对话成本,
|
|
151
152
|
# 且主模型被提示词注入时也不影响审查独立性;建议指定更便宜/更严格的模型。
|
|
153
|
+
# 审查范围是删除类、下载即执行类与高风险 Git 调用;memory_delete 不在其中。
|
|
152
154
|
review_model = ""
|
|
153
155
|
|
|
154
156
|
# 对话区思考块显示:关闭后思考内容仍照常产生并进入推理链路,只是不在
|
|
@@ -170,7 +172,6 @@ enabled = true
|
|
|
170
172
|
# powershell = false
|
|
171
173
|
# bash = true
|
|
172
174
|
# read_image = true
|
|
173
|
-
# windows_screenshot = true
|
|
174
175
|
|
|
175
176
|
# 运行节奏护栏:Reasoning 死循环保护、白名单临时错误恢复与有限自动续跑。
|
|
176
177
|
# 自动续跑会增加模型请求次数和 Token 消耗;保存后从下一次回合生效。
|
|
@@ -257,19 +258,6 @@ failure_fallback = "deterministic"
|
|
|
257
258
|
# detect_license_plate = true # 中国大陆车牌
|
|
258
259
|
# gitleaks 开源规则:默认加载内置离线快照(rust/crates/omnicrawl-llm/data/gitleaks.toml);
|
|
259
260
|
# gitleaks_config_path 指向自定义文件时按规则 id 覆盖 / 追加(失败回退内置快照)。
|
|
260
|
-
# NER 兜底层(BiLSTM-CRF:人名 / 地名 / 机构名):结构 / 规则 / 熵之外的最后一道语义
|
|
261
|
-
# 兜底,输入是前几层处理后的文本且只对中文片段兜底(非中文字符已等长隔离);
|
|
262
|
-
# 需要可选依赖 torch(pip install -e .[ner])。
|
|
263
|
-
# 权重随包分发,可用 ner_model_path 或环境变量 OMNICRAWL_NER_MODEL 覆盖;
|
|
264
|
-
# torch / 权重缺失时本层静默跳过,不影响既有脱敏链路。
|
|
265
|
-
# ner_enabled = false # 默认关闭;开启后作为语义兜底
|
|
266
|
-
# ner_model_path = "" # checkpoint 路径;留空用随包权重 / 环境变量
|
|
267
|
-
# ner_device = "auto" # auto 优先 CUDA、不可用回退 CPU
|
|
268
|
-
# ner_entity_types = ["PER", "ORG", "LOC"] # 需要识别的实体类型
|
|
269
|
-
# ner_min_entity_chars = 2 # 最小实体长度(2 规避单字地名歧义)
|
|
270
|
-
# 推理结果缓存:按「块」(≤200 字符)缓存,长会话中未变历史不再重复推理;
|
|
271
|
-
# 容量单位是块数,默认 2048(约 400KB 文本),0 关闭。
|
|
272
|
-
# ner_cache_size = 2048
|
|
273
261
|
|
|
274
262
|
[api]
|
|
275
263
|
bearer_token = "请替换为随机长令牌"
|
|
@@ -283,6 +271,32 @@ confirmation_timeout_seconds = 300
|
|
|
283
271
|
# 每个 worker 会各自创建一个 Agent 与独立隔离 worktree,按机器核数与内存设置。
|
|
284
272
|
workers = 1
|
|
285
273
|
|
|
274
|
+
# 网页抓取接口:把 fetcher 工具的抓取能力以 REST 暴露给本机其它程序
|
|
275
|
+
# (Python 等批量脚本、CLI、Skill),它们不必经 Agent 回合就能抓网页。
|
|
276
|
+
#
|
|
277
|
+
# 端点(成功回 {"data": ...},失败回 {"error": {code, message}}):
|
|
278
|
+
# GET /health 健康检查
|
|
279
|
+
# GET /v1/status 服务自检(监听地址、URL 上限、固定指纹)
|
|
280
|
+
# POST /v1/fetch {urls | url, max_chars?, max_html?, timeout?, parallel?,
|
|
281
|
+
# insecure?, impersonate?, run_scripts?, force_scripts?}
|
|
282
|
+
# → {count, elapsed_seconds, results: [{url, error, status,
|
|
283
|
+
# final_url, title, content}]}
|
|
284
|
+
#
|
|
285
|
+
# 接口不做鉴权、不做参数校验:只要监听地址可达就能直接抓取。因此 host 只允许
|
|
286
|
+
# 回环地址(127.0.0.1 / localhost / ::1),即只有本机程序能调用。
|
|
287
|
+
# 抓取语义与 fetcher 工具同源:robots.txt 校验、浏览器指纹传输、正文提取与
|
|
288
|
+
# 脚本重建都不变,因此同样不绕过验证码。
|
|
289
|
+
# 随 OmniCrawl 启动时自动拉起,本机已有服务则直接复用。默认关闭。
|
|
290
|
+
[fetch_api]
|
|
291
|
+
enabled = false
|
|
292
|
+
host = "127.0.0.1"
|
|
293
|
+
# 端口:与本地 API(8765)、决策接口(8767)错开。
|
|
294
|
+
port = 8768
|
|
295
|
+
# 固定浏览器指纹族:chrome / firefox / safari / edge。留空表示按请求参数(默认 chrome)。
|
|
296
|
+
impersonate = ""
|
|
297
|
+
# 单次请求的 URL 上限:0 表示用默认上限 20,否则按 1–20 收窄。
|
|
298
|
+
max_urls = 0
|
|
299
|
+
|
|
286
300
|
[agent_temp]
|
|
287
301
|
enabled = true
|
|
288
302
|
directory = ".omnicrawl/.agent_tmp"
|
|
@@ -343,3 +357,59 @@ require_confirmation_for_write = true
|
|
|
343
357
|
require_confirmation_for_command = true
|
|
344
358
|
allow_external_network_tools = false
|
|
345
359
|
audit_log_enabled = true
|
|
360
|
+
|
|
361
|
+
# --- MQTT 自动化回路(遥测进、动作出;详见 assets/docs/MQTT.md)---------------------------
|
|
362
|
+
# 与消息平台连接器不同:入口是传感器报文,出口是带 request_id 与 TTL 的下发指令。
|
|
363
|
+
# 规则层永远在线,只在命中时唤醒一次模型。规划器二选一:agent(内核回合 + 工具白名单,
|
|
364
|
+
# 默认)或 decision(单次结构化决策,决策模型优先、未配置时回落主模型)。
|
|
365
|
+
# 启动:omnicrawl-host connector mqtt
|
|
366
|
+
#
|
|
367
|
+
# [mqtt]
|
|
368
|
+
# enabled = true
|
|
369
|
+
# broker = "mqtt://192.168.1.10:1883" # 也支持 mqtts://host:8883
|
|
370
|
+
# client_id = "omnicrawl-farm"
|
|
371
|
+
# username = "farm"
|
|
372
|
+
# password_env = "OMNICRAWL_MQTT_PASSWORD"
|
|
373
|
+
# keepalive_seconds = 120
|
|
374
|
+
# qos = 1
|
|
375
|
+
# topics = ["farm/+/env"]
|
|
376
|
+
# zone_field = "zone"
|
|
377
|
+
# zone_topic_level = 1
|
|
378
|
+
# window_seconds = 30
|
|
379
|
+
# cooldown_seconds = 1800
|
|
380
|
+
# poll_seconds = 1
|
|
381
|
+
# command_topic = "farm/{zone}/command"
|
|
382
|
+
# ack_topic = "farm/{zone}/ack"
|
|
383
|
+
# ack_timeout_seconds = 15
|
|
384
|
+
# ttl_seconds = 300
|
|
385
|
+
# recent_actions = 5
|
|
386
|
+
# audit_path = "~/.OmniCrawl/mqtt/audit.jsonl"
|
|
387
|
+
#
|
|
388
|
+
# 规划器:agent = 内核回合(可查资料、多步推理,工具受白名单约束);
|
|
389
|
+
# decision = 单次结构化决策(决策模型优先,未配置时回落主模型)。
|
|
390
|
+
# planner = "agent"
|
|
391
|
+
# turn_timeout_seconds = 120
|
|
392
|
+
# 无人值守白名单:不在表里的工具既不声明给模型,宿主也不执行。
|
|
393
|
+
# 默认只读 + 记忆/知识库/联网检索;追加 bash / write_file 前先想清楚报文来源是否可信。
|
|
394
|
+
# tools = ["read", "list", "find", "grep", "memory_search", "memory_read", "kb_search",
|
|
395
|
+
# "web_search", "fetcher"]
|
|
396
|
+
#
|
|
397
|
+
# [[mqtt.actions]]
|
|
398
|
+
# id = "open_vent"
|
|
399
|
+
# label = "打开通风口"
|
|
400
|
+
# description = "温度偏高、湿度偏大时通风降温除湿"
|
|
401
|
+
#
|
|
402
|
+
# [[mqtt.actions]]
|
|
403
|
+
# id = "do_nothing"
|
|
404
|
+
# label = "维持现状"
|
|
405
|
+
# description = "指标已在合适范围,无需干预"
|
|
406
|
+
#
|
|
407
|
+
# [[mqtt.rules]]
|
|
408
|
+
# id = "high_temp"
|
|
409
|
+
# metric = "temp"
|
|
410
|
+
# op = "gt"
|
|
411
|
+
# value = 28.0
|
|
412
|
+
# sustain_seconds = 300
|
|
413
|
+
# clear_value = 26.0
|
|
414
|
+
# actions = ["open_vent", "do_nothing"]
|
|
415
|
+
# fallback = "open_vent"
|
|
@@ -62,13 +62,10 @@ skill_search_rerank = false
|
|
|
62
62
|
# 显式给了 max_results 才收窄总数。决策服务不可用时回退本地顺序,搜索不会因此失败。
|
|
63
63
|
web_search_rerank = false
|
|
64
64
|
|
|
65
|
-
#
|
|
66
|
-
#
|
|
67
|
-
#
|
|
68
|
-
#
|
|
69
|
-
# (未配渠道、无凭据、请求失败)才回退决策模型排序;决策模型也不可用时回退本地关键词排序,
|
|
70
|
-
# 搜索不会因此失败。向量通路不依赖决策模型服务,因此不必先配决策渠道。
|
|
71
|
-
web_search_embedding_rerank = false
|
|
65
|
+
# 联网搜索的 BM25 排序是固定行为,不是开关:每一路渠道结果本地算 BM25(k1=1.2、b=0.75;
|
|
66
|
+
# 中文按二字片段切分),按得分排序后每路保留前 5 条。本地算分,不需要模型渠道,也没有网络往返。
|
|
67
|
+
# 该路候选没有一个命中查询词时才回退到上面的 web_search_rerank(若开启),再不可用则回退本地
|
|
68
|
+
# 关键词覆盖度排序,搜索不会因此失败。
|
|
72
69
|
|
|
73
70
|
# 提问由决策模型自动作答:开启后模型调用 ask_user 且带选项时,不再弹面板等你作答,
|
|
74
71
|
# 而是把提问正文、你本回合的请求与本回合已有的顾问答复交给决策模型,让它选最符合
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
|
|
4
|
+
|
|
5
|
+
**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
|
|
6
|
+
|
|
7
|
+
## 1. Think Before Coding
|
|
8
|
+
|
|
9
|
+
**Don't assume. Don't hide confusion. Surface tradeoffs.**
|
|
10
|
+
|
|
11
|
+
Before implementing:
|
|
12
|
+
- State your assumptions explicitly. If uncertain, ask.
|
|
13
|
+
- If multiple interpretations exist, present them - don't pick silently.
|
|
14
|
+
- If a simpler approach exists, say so. Push back when warranted.
|
|
15
|
+
- If something is unclear, stop. Name what's confusing. Ask.
|
|
16
|
+
|
|
17
|
+
## 2. Simplicity First
|
|
18
|
+
|
|
19
|
+
**Minimum code that solves the problem. Nothing speculative.**
|
|
20
|
+
|
|
21
|
+
- No features beyond what was asked.
|
|
22
|
+
- No abstractions for single-use code.
|
|
23
|
+
- No "flexibility" or "configurability" that wasn't requested.
|
|
24
|
+
- No error handling for impossible scenarios.
|
|
25
|
+
- If you write 200 lines and it could be 50, rewrite it.
|
|
26
|
+
|
|
27
|
+
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
|
|
28
|
+
|
|
29
|
+
## 3. Surgical Changes
|
|
30
|
+
|
|
31
|
+
**Touch only what you must. Clean up only your own mess.**
|
|
32
|
+
|
|
33
|
+
When editing existing code:
|
|
34
|
+
- Don't "improve" adjacent code, comments, or formatting.
|
|
35
|
+
- Don't refactor things that aren't broken.
|
|
36
|
+
- Match existing style, even if you'd do it differently.
|
|
37
|
+
- If you notice unrelated dead code, mention it - don't delete it.
|
|
38
|
+
|
|
39
|
+
When your changes create orphans:
|
|
40
|
+
- Remove imports/variables/functions that YOUR changes made unused.
|
|
41
|
+
- Don't remove pre-existing dead code unless asked.
|
|
42
|
+
|
|
43
|
+
The test: Every changed line should trace directly to the user's request.
|
|
44
|
+
|
|
45
|
+
## 4. Goal-Driven Execution
|
|
46
|
+
|
|
47
|
+
**Define success criteria. Loop until verified.**
|
|
48
|
+
|
|
49
|
+
Transform tasks into verifiable goals:
|
|
50
|
+
- "Add validation" → "Write tests for invalid inputs, then make them pass"
|
|
51
|
+
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
|
|
52
|
+
- "Refactor X" → "Ensure tests pass before and after"
|
|
53
|
+
|
|
54
|
+
For multi-step tasks, state a brief plan:
|
|
55
|
+
```
|
|
56
|
+
1. [Step] → verify: [check]
|
|
57
|
+
2. [Step] → verify: [check]
|
|
58
|
+
3. [Step] → verify: [check]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
**These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.
|
|
@@ -15,7 +15,11 @@ tools:
|
|
|
15
15
|
- bash
|
|
16
16
|
- powershell
|
|
17
17
|
disallowedTools:
|
|
18
|
-
-
|
|
18
|
+
- subagent_run
|
|
19
|
+
- subagent_list
|
|
20
|
+
- subagent_cancel
|
|
21
|
+
- subagent_apply_worktree
|
|
22
|
+
- subagent_discard_worktree
|
|
19
23
|
- switch_model
|
|
20
24
|
- switch_skill
|
|
21
25
|
- load_skill
|
|
@@ -36,7 +40,7 @@ background: false
|
|
|
36
40
|
5. 完成后用简洁中文总结:改了什么、为什么、如何验证、残留风险。
|
|
37
41
|
|
|
38
42
|
约束:
|
|
39
|
-
- 禁止调用
|
|
43
|
+
- 禁止调用 subagent_run、subagent_list、subagent_cancel、subagent_apply_worktree、subagent_discard_worktree、switch_model、switch_skill、load_skill、search_skills。
|
|
40
44
|
- 不要提交 git commit、push 或改远程。
|
|
41
45
|
- 不要删除用户未明确要求删除的文件。
|
|
42
46
|
- isolation=worktree 时,结果会以分支/diff 形式返回父 Agent,由父决定是否应用。
|