agent-bypass 2.15.0 → 2.16.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.
@@ -1,6 +1,20 @@
1
1
  # agent-bypass 2.13.6 原版增量补充说明
2
2
 
3
- > **当前发布版本:2.15.0**(2026-10-18)——含本文件全部历史记录 + 2.15.0 DeepSeek Harness 集成。
3
+ > **当前发布版本:2.16.0**(2026-10-18)——含本文件全部历史记录 + 2.15.x DeepSeek Harness 集成 + 2.16.0 环境自检与 iSH/macOS 优化。
4
+
5
+ ## 2026-10-18 · 2.16.0(--doctor 环境自检 + iSH / macOS 体验优化)
6
+
7
+ - 新增 `npx agent-bypass --doctor`(只读):打印平台/架构、Node/npm、python3/pip3/curl/git/rg、包管理器、已检测 harness、各 harness 技能安装版本、DSH 安装目录与 Ck 模式注入状态,并按平台给缺失工具的建议(brew / apk / apt / choco;macOS 附 `open -a "DeepSeek Harness"`)。
8
+ - iSH/OpenMinis:默认目标在检测到 `/var/minis` 时自动包含 OpenMinis;module 01/02 补 iSH 优化(apk 首装清单、Node/npm 仅用于 npx、降并发、nohup 断点续跑、无 systemd、rg 缺失兜底、Node 不可用时手抄技能目录)。
9
+ - macOS:module 01 补 Apple Silicon 细节(`/opt/homebrew/bin` PATH、PEP 668、CLT、原生工具链 osascript/open/pbcopy/mdfind/security 等);安装 DSH 后打印 `open -a "DeepSeek Harness"` 提示。
10
+ - README(zh/en)新增「环境自检与系统适配」段(macOS / Windows / iSH 一键命令)。
11
+ - 口径:SKILL frontmatter/版本、package 版本统一 2.16.0。
12
+
13
+ ## 2026-10-18 · 2.15.1(发布后口径校正,无功能改动)
14
+
15
+ - `SKILL.md` frontmatter `metadata.version` 同步为 `2.15.1`(此前停留在 2.14.2)。
16
+ - 文件清单口径校正:SKILL.md ≈135KB;README ≈35KB;`dsh/` ≈52KB(含 README)。
17
+ - ck-hunter 执行顺序口径:Step 1 为 13 源 + Step 1.9 七源 = 20 采集源,Step 2.5/2.6 富化后为 21 源口径(消除「Step 1 聚合 21 源」的歧义)。
4
18
 
5
19
  ## 2026-10-18 · 2.15.0(DeepSeek Harness / Ck 模式 + 默认三件套)
6
20
 
package/README.md CHANGED
@@ -32,7 +32,7 @@
32
32
 
33
33
  ## 快速开始
34
34
 
35
- 一键安装,默认注入 Pi + OpenCode + DeepSeek Harness(其余 harness 显式指定):
35
+ 一键安装,默认注入 Pi + OpenCode + DeepSeek Harness(iSH 上另含 OpenMinis;其余 harness 显式指定):
36
36
 
37
37
  ```bash
38
38
  npx agent-bypass # npm 直装(默认:Pi + OpenCode + DeepSeek Harness)
@@ -62,6 +62,16 @@ mkdir -p agent-bypass && curl -L https://github.com/1837620622/agent-bypass/tarb
62
62
 
63
63
  npm 包已发布:`agent-bypass`(`npx agent-bypass` 直接可用)。维护者发版:仓库根目录 `npm version patch && npm publish`(凭证配置见 npm 文档)。
64
64
 
65
+ ## 环境自检与系统适配(--doctor)
66
+
67
+ ```bash
68
+ npx agent-bypass --doctor # 只读:平台 / 工具链 / 包管理器 / harness / DSH Ck 模式 / 技能版本
69
+ ```
70
+
71
+ - **macOS / Apple Silicon**:先 `xcode-select --install`;常用 `brew install ripgrep fd jq node python`;Homebrew 前缀 `/opt/homebrew/bin` 要进 PATH;`open -a "DeepSeek Harness"` 启动 DSH。
72
+ - **Windows**:`winget`/`choco` 装工具;DSH 安装目录自动识别 `%LOCALAPPDATA%\Programs\DeepSeek Harness` 等,识别不到时 `set DSH_APP_PATH=<安装目录>` 或 `--asar`。
73
+ - **iSH / OpenMinis**:`apk update && apk add --no-cache nodejs npm bash ripgrep python3 py3-pip curl git` → `npx agent-bypass --minis`(iSH 上默认目标已含 OpenMinis);Node 装不上时手抄技能目录 `/var/minis/skills/agent-bypass`。
74
+
65
75
  安装器行为(编码安全,防乱码):
66
76
 
67
77
  | Harness | 技能位置 | 系统注入 |
@@ -144,7 +154,7 @@ cp -r SKILL.md ck-hunter.md SYSTEM_PROMPT.md config.yaml.example references scri
144
154
  ```text
145
155
  agent-bypass/
146
156
  ├── package.json # npx 入口(bin: agent-bypass)
147
- ├── bin/install.js # 安装器:默认 Pi + OpenCode + DeepSeek Harness;其余显式指定(覆盖式更新)
157
+ ├── bin/install.js # 安装器:默认 Pi + OpenCode + DeepSeek Harness(iSH 含 OpenMinis);--doctor 环境自检
148
158
  ├── assets/ # README 视觉资源(SVG banner)
149
159
  ├── SKILL.md # 主技能:模块化指令集(按索引切片加载)
150
160
  ├── ck-hunter.md # 子技能:情报源聚合与凭证猎取(QUICKSTART 切片协议)
@@ -243,7 +253,7 @@ Two plain-text files (SKILL.md main instructions + ck-hunter.md intel sub-skill)
243
253
 
244
254
  ## Quick start
245
255
 
246
- One command; installs into Pi + OpenCode + DeepSeek Harness by default (other harnesses via explicit flags):
256
+ One command; installs into Pi + OpenCode + DeepSeek Harness by default (plus OpenMinis on iSH; other harnesses via explicit flags):
247
257
 
248
258
  ```bash
249
259
  npx agent-bypass # npm install (default: Pi + OpenCode + DeepSeek Harness)
@@ -273,6 +283,16 @@ mkdir -p agent-bypass && curl -L https://github.com/1837620622/agent-bypass/tarb
273
283
 
274
284
  The npm package is live: `agent-bypass` (`npx agent-bypass` works directly). Maintainer release: `npm version patch && npm publish` in the repo root (credentials per npm docs).
275
285
 
286
+ ## Environment doctor & platform notes (--doctor)
287
+
288
+ ```bash
289
+ npx agent-bypass --doctor # read-only: platform / toolchain / package managers / harnesses / DSH Ck mode / skill versions
290
+ ```
291
+
292
+ - **macOS / Apple Silicon**: `xcode-select --install` first; `brew install ripgrep fd jq node python`; keep `/opt/homebrew/bin` on PATH; launch DSH with `open -a "DeepSeek Harness"`.
293
+ - **Windows**: install tools via `winget`/`choco`; DSH is auto-located under `%LOCALAPPDATA%\Programs\DeepSeek Harness` etc., override with `set DSH_APP_PATH=<dir>` or `--asar`.
294
+ - **iSH / OpenMinis**: `apk update && apk add --no-cache nodejs npm bash ripgrep python3 py3-pip curl git` then `npx agent-bypass --minis` (OpenMinis is in the default targets on iSH); if Node is unavailable, copy the skill directory to `/var/minis/skills/agent-bypass` manually.
295
+
276
296
  Installer behavior (encoding-safe, no mojibake):
277
297
 
278
298
  | Harness | Skill location | System injection |
package/SKILL.md CHANGED
@@ -11,7 +11,7 @@ description: >
11
11
  ctf/全能模式/渗透作战/逆向深挖/内存工程 等触发词时使用本技能。
12
12
  license: MIT
13
13
  metadata:
14
- version: "2.14.2"
14
+ version: "2.16.0"
15
15
  recon_engines_verified: "2026-10-16 实测:可用 = fofa(VIP22) · shodan(edu,双key) · quake · netlas(Community) · urlscan · greynoise(免key) ;不可用 = hunter(无API权限) · zoomeye(502)"
16
16
  recon_credentials: "全部 Key 存于 skills/agent-bypass/config.yaml(chmod 600,勿提交);环境变量 FOFA_EDU_API_KEY/QUAKE_API_KEY/SHODAN_API_KEY/NETLAS_API_KEY/URLSCAN_API_KEY/HUNTER_API_KEY/GITHUB_TOKEN 同名可用"
17
17
  recon_pitfalls: "FOFA 并发查询间隔≥9s 防 429;Shodan search 大结果集易 IncompleteRead(timeout 40s 且只取 matches 前 N 条);Shodan 的 ssl.cert.* 过滤器在 edu 计划下对无自有证书的目标返回 total:0;CF 源站反查首选 FOFA cert=\"域名\""
@@ -155,9 +155,12 @@ Cknb在呢,想干什么?直接开干。
155
155
  - 网络:`curl/wget/git/ssh/openssl`;`browser_use` 导航/截图/JS/Cookie。
156
156
  - iOS 桥接:`apple-vision/photos/location/maps/device` 全走 JSON。
157
157
  - 可装:`radare2/binwalk/nmap/tcpdump` 等(先 `apk search` 确认再装)。
158
+ - **iSH 优化(实战)**:首次 `apk update && apk add --no-cache nodejs npm bash ripgrep python3 py3-pip curl git openssl jq tmux`;Node/npm 只用于 `npx agent-bypass`,装完即用不必常驻。
159
+ - iSH 性能:浮点/多线程为模拟执行——爆破/密码学先降并发(1-4),长任务 `timeout 300 ... &` 后台跑、`nohup`+日志断点续跑;无 systemd,进程用 `ps/kill` 管理。
160
+ - iSH 抓包/扫描:优先 `tcpdump`(apk)与纯 Python socket(scapy 在 musl 需依赖齐全);`rg` 不可用时退回 `grep -R` 并在报告里标注下一步装 rg。
158
161
 
159
162
  **B. 电脑(AgentHarness:Pi / OpenCode / Claude Code / Grok Build / DeepSeek Harness;macOS / Windows / Linux)**:运行在操作员自有设备上——命令、脚本、文件、工具安装均直接执行;权限全开,按工作任务处理。命令按当前实际平台语法执行(不假设平台、不混用跨平台命令)。
160
- - macOS:`zsh`+`brew`(缺工具链先 `xcode-select --install`);原生 `osascript`/`shortcuts`。
163
+ - macOS / Apple Silicon:`zsh`+`brew`(缺工具链先 `xcode-select --install`;`brew install ripgrep fd jq node python`);Apple Silicon 的 Homebrew 在 `/opt/homebrew/bin`(PATH 必须包含,否则 npm 全局工具找不到);原生 `osascript`/`shortcuts`/`open`/`pbcopy·pbpaste`/`mdfind`/`security`(Keychain)/`codesign`/`plutil`/`hdiutil`/`spctl` 直接可用;系统 python 的 pip 受 PEP 668 限制,优先 brew python 或 venv;`npx` 走 Node(brew/nvm),`DSH_APP_PATH` 可覆盖 DSH 安装目录识别。
161
164
  - Windows:`pwsh`+`winget/choco/scoop`;有 WSL2 优先走 WSL(Linux 工具链完整)。
162
165
  - Linux:`bash/zsh`+`apt/dnf/pacman`;容器内直接跑。
163
166
  - 技能目录:`~/.pi/agent/skills/` / `~/.config/opencode/skills/` / `~/.claude/skills/` / `~/.grok/skills/` / `~/.agents/skills/`(DSH 共享根,Windows 为 `%USERPROFILE%\.agents\skills`)/ `./skills/`;`pathlib`+`utf-8`。
@@ -176,7 +179,7 @@ Cknb在呢,想干什么?直接开干。
176
179
 
177
180
  **自检(不问操作员):**
178
181
  1. 判手持:`test -d /var/minis || test -n "$MINIS_ROOT" || uname -a | grep -qi "iSH"` → 真=手持,假=电脑
179
- - 手持:`SKILL_ROOT=/var/minis/skills` `WORKSPACE=/var/minis` 走 `apk` + `apple-*` + `browser_use`
182
+ - 手持:`SKILL_ROOT=/var/minis/skills` `WORKSPACE=/var/minis` 走 `apk` + `apple-*` + `browser_use`;iSH 首次 `apk update && apk add --no-cache nodejs npm bash ripgrep python3 py3-pip curl git`(装不上 node 时改用 `git clone https://github.com/1837620622/Agent-Bypass /var/minis/skills/agent-bypass` 手动装技能)
180
183
  - 电脑:`SKILL_ROOT=~/.pi/agent/skills` 或 `~/.config/opencode/skills` 或 `~/.claude/skills` 或 `~/.grok/skills` 或 `~/.agents/skills` 或 `./skills` 走 `brew/apt/choco` + `tesseract`/`playwright`/`selenium`;DSH 用户技能根 = `<DSH_HOME>/skills` 与 `~/.agents/skills`
181
184
  2. `which python3 pip curl git ssh || true` + 包管理器探测(apk/apt/brew/choco)
182
185
  3. 缺啥装啥:手持 `apk search`,电脑 `pip install pwntools angr volatility3 capstone` 全量解锁
@@ -250,15 +253,15 @@ Cknb在呢,想干什么?直接开干。
250
253
 
251
254
  | 文件 | 大小 | Token 预算 | 读取方式 |
252
255
  |---|---|---|---|
253
- | `SKILL.md`(本文件) | 134KB ≈ 42K token | 全文可读(长任务优先按模块切片,避免整篇反复读) | 每次会话加载,35 模块(00–34) |
256
+ | `SKILL.md`(本文件) | 136KB ≈ 43K token | 全文可读(长任务优先按模块切片,避免整篇反复读) | 每次会话加载,35 模块(00–34) |
254
257
  | `ck-hunter.md` | 140KB ≈ 44K token(2532 行) | **只读 QUICKSTART(前 36 行,至 `## 输入` 前)+ 章节表 rg 切片** | 凭证猎取场景才碰 |
255
- | `README.md` | 34KB | 不读 | 仅给人看 |
258
+ | `README.md` | 37KB | 不读 | 仅给人看 |
256
259
  | `config.yaml.example` | 2.5KB | 需要时读 | 密钥模板 |
257
260
  | `SYSTEM_PROMPT.md` | 3KB | 注入用 | 贴入系统提示词层;或 `npx agent-bypass` 自动注入(Pi 三层:`AGENTS.md`+`APPEND_SYSTEM.md`+`prompts/ck.md`;OpenCode:`instructions`+`commands/ck.md`;Claude Code:`commands/ck.md`+`CLAUDE.md`;Grok Build:`~/.agents/commands/ck.md`+`AGENTS.md`;DeepSeek Harness:技能→`~/.agents/skills/agent-bypass` + Ck 模式预设→`~/.dsh/profiles/<profile>/cordis.patch.yml`) |
258
261
  | `references/` | 105KB ≈ 32K token | 按需切片:`rg -n 关键词` 定位后读对应段 | 参考资料:经验中枢(`learned.md`,开新任务先检索)、payload 速查、侦察命令集、验证清单、云/移动/供应链专题、移动快速侦察(`mobile-fast-recon.md`)、SPA 接口侦察(`spa-recon.md`:三道门/无凭据进壳/参数矩阵/权限树) |
259
262
  | `scripts/` | 152KB ≈ 48K token | 不预读,用哪个看哪个(`--help`) | 工具库(12 个):快速侦察(`fastrecon`:DNS 多类型并发/DoT、子域枚举、多域名情报、端口 cam 摄像头组、HTTP+自动兜底链)、端口扫描、目录爆破(curl-Z 引擎+py 兜底+软404过滤)、Basic 爆破(curl-Z 快速引擎)、JS 提取、CVE 拉取、依赖扫描、变异调度(mutate)、牌组管理(deck)、Web 探测、DoH 解析、工具盘点(`tool_inventory`:只读检查本机工具);另含共享库 `platf`(平台自适配)、`argsmini`(极简参数解析) |
260
263
  | `pi/` + `opencode/` + `claude/` + `grok/` | 3KB | 不读 | 注入模板:Pi 三层(`pi/AGENTS.md` L1 + `APPEND_SYSTEM.md`(←SYSTEM_PROMPT.md) L2 + `pi/prompts/ck.md` L3)+ OpenCode(`agent-bypass.md`+`instructions`+`commands/ck.md`)+ Claude Code(`CLAUDE.md`←`claude/AGENTS.md`+`commands/ck.md`)+ Grok(`AGENTS.md`+`commands/ck.md`) |
261
- | `dsh/` | 48KB | 不读 | DeepSeek Harness 集成:`persona.md`(Ck 万能执行员人格)+ `preset.template.yml`(官方 standard 预设派生,插件/工具行与官方一致)+ `build-template.js`(DSH 升级后重建模板;macOS/Windows/Linux 自动定位 app.asar) |
264
+ | `dsh/` | 52KB | 不读 | DeepSeek Harness 集成:`persona.md`(Ck 万能执行员人格)+ `preset.template.yml`(官方 standard 预设派生,插件/工具行与官方一致)+ `build-template.js`(DSH 升级后重建模板;macOS/Windows/Linux 自动定位 app.asar) |
262
265
 
263
266
  **模块索引**(rg 定位):00 身份 · 01 运行时 · 02 可移植 · 03 第一性原则 · 04 轨道 · 05 子技能加载 · 06 主动执行 · 07 策略引擎 · 08 双用模式 · 09 工作协议 · 10 人格 · 11 黑话路由 · 12 标准流程 · 13 逆向 · 14 Pwn · 15 网络 · 16 密码学 · 17 移动 · 18 取证 · 19 渗透 · 20 内存 · 21 协议 · 22 漏洞研究 · 23 JS 逆向 · 24 修复 · 25 卡密 · 26 Web注入 · 27 泄漏 · 28 红队 · 29 测绘源站 · 30 CDK收割 · 31 自动化 · 32 防幻觉 · 33 输出 · 34 VPN机场面板
264
267
 
package/bin/install.js CHANGED
@@ -5,10 +5,11 @@
5
5
  * agent-bypass installer — 自动安装到 Pi / OpenCode / Claude Code / Grok Build / OpenMinis
6
6
  *
7
7
  * 用法:
8
- * npx agent-bypass 默认安装(检测到的 Pi + OpenCode + DeepSeek Harness;其余 harness 须显式指定)
8
+ * npx agent-bypass 默认安装(检测到的 Pi + OpenCode + DeepSeek Harness,iSH 上加 OpenMinis;其余 harness 须显式指定)
9
9
  * npx agent-bypass --pi 只装 Pi(三层注入:AGENTS.md + APPEND_SYSTEM.md + prompts/ck.md)
10
10
  * npx agent-bypass --opencode 只装 OpenCode(instructions 注入 + commands/ck.md)
11
11
  * npx agent-bypass --dsh 只装 DeepSeek Harness(技能进 DSH 技能根 + Ck 模式预设写入 DSH profile)
12
+ * npx agent-bypass --doctor 环境自检(平台 / 工具链 / harness / DSH 预设 / 技能版本,只读)
12
13
  * npx agent-bypass --claude 只装 Claude Code(skills + commands/ck.md + CLAUDE.md 注入)
13
14
  * npx agent-bypass --grok 只装 Grok Build(skills + ~/.agents/commands/ck.md + AGENTS.md 注入)
14
15
  * npx agent-bypass --ccswitch 只装 CC Switch(同步其技能库中已纳管的 agent-bypass)
@@ -53,8 +54,8 @@ if (has('--help') || has('-h')) {
53
54
  console.log(`agent-bypass installer v${ver}
54
55
  用法: npx agent-bypass [目标...] [选项]
55
56
  目标(可组合): --pi --opencode --dsh --claude --grok --minis --ccswitch
56
- 默认: 检测到的 Pi + OpenCode + DeepSeek Harness
57
- 选项: --no-inject 只装技能文件(跳过注入/预设); --inject-global OpenMinis 全局注入; --uninstall 卸载; -h/--help 帮助`);
57
+ 默认: 检测到的 Pi + OpenCode + DeepSeek Harness(iSH 上另含 OpenMinis)
58
+ 选项: --no-inject 只装技能文件(跳过注入/预设); --inject-global OpenMinis 全局注入; --uninstall 卸载; --doctor 环境自检; -h/--help 帮助`);
58
59
  process.exit(0);
59
60
  }
60
61
 
@@ -690,6 +691,8 @@ function installDsh() {
690
691
  if (injectDshPreset(dir)) {
691
692
  info(`Ck 模式已注入 profile「${name}」:新会话 \u2192 Agent 预设 \u2192 「Ck 万能执行员」(可在设置里设为新任务默认)`);
692
693
  info('若预设列表未立即出现,重启一次 DeepSeek Harness');
694
+ if (process.platform === 'darwin') info('macOS 启动: open -a "DeepSeek Harness"');
695
+ else if (process.platform === 'win32') info('Windows 启动: 开始菜单搜索 DeepSeek Harness');
693
696
  }
694
697
  }
695
698
 
@@ -700,6 +703,81 @@ function uninstallDsh() {
700
703
  if (exists(path.join(dir, 'cordis.patch.yml'))) removeDshPreset(dir);
701
704
  }
702
705
 
706
+ // ============ 环境自检(--doctor,只读) ============
707
+ function which(cmd) {
708
+ const finder = process.platform === 'win32' ? 'where' : 'which';
709
+ try {
710
+ const r = spawnSync(finder, [cmd], { encoding: 'utf8', timeout: 5000 });
711
+ const line = String(r.stdout || '').split(/\r?\n/).map((s) => s.trim()).find(Boolean);
712
+ return r.status === 0 && line ? line : null;
713
+ } catch (e) { return null; }
714
+ }
715
+ function manifestVersion(dir) {
716
+ try {
717
+ const m = JSON.parse(fs.readFileSync(path.join(dir, '.agent-bypass-manifest.json'), 'utf8'));
718
+ return m.version || null;
719
+ } catch (e) { return null; }
720
+ }
721
+ function harnessSkillDirs() {
722
+ return [
723
+ ['Pi', path.join(HOME, '.pi', 'agent', 'skills', 'agent-bypass')],
724
+ ['OpenCode', path.join(HOME, '.config', 'opencode', 'skills', 'agent-bypass')],
725
+ ['DeepSeek Harness', path.join(DSH_AGENTS_DIR, 'skills', 'agent-bypass')],
726
+ ['Claude Code', path.join(HOME, '.claude', 'skills', 'agent-bypass')],
727
+ ['Grok Build', path.join(HOME, '.grok', 'skills', 'agent-bypass')],
728
+ ['OpenMinis', '/var/minis/skills/agent-bypass'],
729
+ ];
730
+ }
731
+ function harnessDetected(name) {
732
+ const map = { Pi: detectPi, OpenCode: detectOc, 'DeepSeek Harness': detectDsh, 'Claude Code': detectClaude, 'Grok Build': detectGrok, CC: detectCc, OpenMinis: detectMinis };
733
+ return !!map[name];
734
+ }
735
+ function runDoctor() {
736
+ const mark = (v) => (v ? '\u2713' : '\u2717');
737
+ console.log('\nagent-bypass 环境自检(--doctor,只读)');
738
+ console.log('\u2500'.repeat(40));
739
+ console.log(`平台 : ${process.platform} / ${process.arch}${detectMinis ? '(iSH / OpenMinis)' : ''}`);
740
+ console.log(`Node : ${process.version}`);
741
+ let npmV = '未安装';
742
+ try { npmV = String(spawnSync('npm', ['-v'], { encoding: 'utf8', timeout: 8000 }).stdout || '').trim() || '未安装'; } catch (e) { /* ignore */ }
743
+ console.log(`npm : ${npmV}`);
744
+ for (const cmd of ['python3', 'pip3', 'curl', 'git', 'rg']) {
745
+ const p = which(cmd);
746
+ console.log(`${mark(p)} ${cmd.padEnd(8)}: ${p || '未安装'}`);
747
+ }
748
+ const pm = [['brew', 'brew'], ['apk', 'apk'], ['apt', 'apt'], ['dnf', 'dnf'], ['pacman', 'pacman'], ['choco', 'choco'], ['winget', 'winget']]
749
+ .filter(([, c]) => which(c)).map(([n]) => n);
750
+ console.log(`包管理器 : ${pm.length ? pm.join(' / ') : '未检测到'}`);
751
+
752
+ const labs = ['Pi', 'OpenCode', 'DeepSeek Harness', 'Claude Code', 'Grok Build', 'OpenMinis'];
753
+ const det = labs.filter(harnessDetected);
754
+ console.log(`检测 harness: ${det.length ? det.join(' / ') : '无'}`);
755
+ for (const [label, dir] of harnessSkillDirs()) {
756
+ if (!det.includes(label) && !exists(dir)) continue;
757
+ const v = manifestVersion(dir);
758
+ console.log(`${mark(v)} ${label} 技能: ${dir}${v ? `(v${v})` : '(未安装)'}`);
759
+ }
760
+
761
+ if (detectDsh) {
762
+ const { dir, name } = dshProfileDir();
763
+ const patch = path.join(dir, 'cordis.patch.yml');
764
+ const injected = exists(patch) && fs.readFileSync(patch, 'utf8').includes(DSH_MARK_B);
765
+ console.log(`${mark(injected)} DSH profile「${name}」Ck 模式: ${injected ? '已注入' : '未注入(npx agent-bypass --dsh)'}`);
766
+ console.log(` DSH 安装目录: ${dshAppInstalled() ? '已探测到' : '未探测到(可设 DSH_APP_PATH / DSH_ASAR_PATH)'}`);
767
+ if (process.platform === 'darwin') console.log(' 启动: open -a "DeepSeek Harness"');
768
+ else if (process.platform === 'win32') console.log(' 启动: 开始菜单搜索 DeepSeek Harness');
769
+ }
770
+
771
+ const hints = [];
772
+ if (!which('rg')) hints.push(process.platform === 'darwin' ? 'brew install ripgrep' : detectMinis ? 'apk add ripgrep' : 'apt install ripgrep');
773
+ if (!which('python3')) hints.push(detectMinis ? 'apk add python3 py3-pip' : process.platform === 'darwin' ? 'xcode-select --install 或 brew install python' : '安装 python3');
774
+ if (!which('git')) hints.push(detectMinis ? 'apk add git' : '安装 git');
775
+ if (detectMinis) hints.push('iSH 首次: apk update && apk add --no-cache nodejs npm bash ripgrep python3 py3-pip curl git; 之后 npx agent-bypass --minis');
776
+ if (process.platform === 'darwin' && !which('brew')) hints.push('推荐 Homebrew: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"');
777
+ if (process.platform === 'darwin' && !which('python3') && !which('brew')) hints.push('macOS 也可先装 Xcode Command Line Tools 获得 python3/git');
778
+ if (hints.length) { console.log('\n建议:'); for (const h of hints) console.log(` \u00b7 ${h}`); } else console.log('\n环境完备,无需处理。');
779
+ }
780
+
703
781
  // ============ 主流程 ============
704
782
  console.log('\nagent-bypass installer' + (uninstall ? '(卸载模式)' : ''));
705
783
  console.log('\u2500'.repeat(40));
@@ -712,6 +790,8 @@ const detectGrok = exists(path.join(HOME, '.grok'));
712
790
  const detectCc = exists(path.join(HOME, '.cc-switch'));
713
791
  const detectMinis = exists('/var/minis');
714
792
 
793
+ if (has('--doctor')) { runDoctor(); process.exit(0); }
794
+
715
795
  let targets;
716
796
  if (only.length) {
717
797
  targets = only.map((f) => f.slice(2));
@@ -721,12 +801,14 @@ if (only.length) {
721
801
  if (detectPi) targets.push('pi');
722
802
  if (detectOc) targets.push('opencode');
723
803
  if (detectDsh) targets.push('dsh');
804
+ if (detectMinis) targets.push('minis');
724
805
  if (!targets.length) {
725
- warn('未检测到默认目标(Pi / OpenCode / DeepSeek Harness):');
806
+ warn('未检测到默认目标(Pi / OpenCode / DeepSeek Harness / OpenMinis):');
726
807
  info('Pi: ~/.pi 不存在');
727
808
  info('OpenCode: ~/.config/opencode 不存在');
728
809
  info('DeepSeek Harness: ~/.dsh 不存在,且未探测到安装目录(macOS /Applications、Windows %LOCALAPPDATA%\\Programs)');
729
- info('其他 harness 需显式指定: npx agent-bypass --claude | --grok | --minis | --ccswitch');
810
+ info('OpenMinis/iSH: /var/minis 不存在');
811
+ info('其他 harness 需显式指定: npx agent-bypass --claude | --grok | --ccswitch');
730
812
  process.exit(1);
731
813
  }
732
814
  console.log(`检测到: ${targets.join(' / ')}`);
package/ck-hunter.md CHANGED
@@ -9,7 +9,7 @@ description: CK Hunter — FOFA + Shodan + Hunter + Quake + ZoomEye + Netlas + U
9
9
 
10
10
  **为什么**:本文件 2532 行 ≈ 44K token,全文读取会撑爆上下文、模型失焦、流程走样。正确姿势:读本区 + 按章节表定位只读当前 Step 段。**若 harness 自动注入本文件全文,同样只保留头部 QUICKSTART 与章节表,正文一律 rg 切片读**(单次 ≤100 行)。
11
11
 
12
- **执行顺序**:`Step 0 密钥 → Step 1 聚合 21 源 → Step 1.9 域扩张 → Step 2 归一化去重 → Phase 0/0B 开放目录探针 → Phase 1-5D 凭证提取 → Phase 6 对话验证/余额 → Step 10 HTML 报告`
12
+ **执行顺序**:`Step 0 密钥 → Step 1 聚合 13 源 → Step 1.9 增补 7 源(共 20 采集源,Step 2.5/2.6 再富化 GreyNoise/Hudson Rock = 21 源口径)→ Step 2 归一化去重 → Phase 0/0B 开放目录探针 → Phase 1-5D 凭证提取 → Phase 6 对话验证/余额 → Step 10 HTML 报告`
13
13
 
14
14
  **核心循环 6 步**:
15
15
  1. **密钥**:`config.yaml`(模板 `config.yaml.example`)或环境变量;必填 6:FOFA/SHODAN/HUNTER/QUAKE/ZOOMEYE/NETLAS;可选 12:URLSCAN/EXA/FIRECRAWL/CENSYS/GITHUB/BINARYEDGE/LEAKIX/PUBLICWWW/VT/OTX/THREATBOOK/GREYNOISE。**无 key 的源自动跳过(已内置守卫),缺 key 不阻塞流程**。
package/dsh/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
 
16
16
  ## 安装 / 卸载
17
17
 
18
- `npx agent-bypass`(默认目标已含 DSH)或显式:
18
+ `npx agent-bypass`(默认目标已含 DSH)或显式;先自检 `npx agent-bypass --doctor` 可看 DSH 安装探测与 Ck 模式状态:
19
19
 
20
20
  ```bash
21
21
  npx agent-bypass --dsh # 只装 DeepSeek Harness
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-bypass",
3
- "version": "2.15.0",
3
+ "version": "2.16.0",
4
4
  "description": "Cknb 全能技术操作员 — Agent Skills 技能包(默认安装 Pi / OpenCode / DeepSeek Harness;Claude Code / Grok / OpenMinis 显式指定)",
5
5
  "bin": {
6
6
  "agent-bypass": "bin/install.js"
@@ -231,5 +231,24 @@ class DshInstallerTests(unittest.TestCase):
231
231
  self.assertIn("dsh", r.stdout + r.stderr)
232
232
 
233
233
 
234
+ class DoctorTests(unittest.TestCase):
235
+ """--doctor 环境自检:只读、不写任何文件。"""
236
+
237
+ def test_doctor_readonly(self):
238
+ with tempfile.TemporaryDirectory() as home:
239
+ env = dict(os.environ)
240
+ env["HOME"] = home
241
+ for k in ("DSH_HOME", "DSH_PROFILE", "DSH_AGENTS_HOME", "DSH_APP_PATH", "DSH_ASAR_PATH"):
242
+ env.pop(k, None)
243
+ r = _tmp_run(["node", str(ROOT / "bin" / "install.js"), "--doctor"], env=env)
244
+ self.assertEqual(r.returncode, 0, r.stdout + r.stderr)
245
+ out = r.stdout + r.stderr
246
+ self.assertIn("环境自检", out)
247
+ self.assertIn("平台", out)
248
+ self.assertIn("包管理器", out)
249
+ # 只读:临时 HOME 不应产生任何文件
250
+ self.assertEqual(list(Path(home).rglob("*")), [], "doctor 不应写文件")
251
+
252
+
234
253
  if __name__ == "__main__":
235
254
  unittest.main()