Repository navigation
feat(capabilities,coding): integrate official jeik-web-fetch skill and fallback synergy - #69
modded-soldier-9 wants to merge 2 commits into
Conversation
…d fallback synergy Embed the official Jeik-Web-Fetch web extraction skill directly into JeikCode out of the box and establish smart engine escalation in web_fetch: - assets: embed official `jeik-web-fetch` skill template providing 3 categorized fetch modes (`--fast`, `--common`, `--complex`) for static pages, SPAs, and anti-bot protected targets. - coding: register `skills/jeik-web-fetch/SKILL.md` into `BUNDLED_ASSETS` with auto-selection on new installs and localized asset descriptions. - capabilities: add `jeik_fetch_fallback` in `WebFetchTool` to automatically escalate to `jeik fetch` / `jeik-web-fetch` CLI when encountering dynamic SPAs, client-side React/Vue rendering, or anti-bot 403 blocks. - capabilities: enhance `web_fetch` empty response and error guidance to recommend `jeik-web-fetch` and standalone CLI installation instructions. - teaches: sync official documentation and configuration guides (`03_mcp_and_skills.md`) in both Chinese and English. - tests: add unit tests for `jeik-web-fetch` asset bundling, offline mode suppression, and error guidance. --- 在 JeikCode 中开箱内置官方 `jeik-web-fetch` 网页高精度抓取技能,并在 `web_fetch` 中建立智能降级协同: - assets:内置官方 `jeik-web-fetch` 技能定义模板,提供面向静态页面、技术文档 SPA 与高风控反爬站点的三档抓取模式(`--fast`、`--common`、`--complex`)。 - coding:将 `skills/jeik-web-fetch/SKILL.md` 注册进 `BUNDLED_ASSETS`,在新安装与升级时自动预勾选同步,并补充中英文配置项说明。 - capabilities:在 `WebFetchTool` 中引入 `jeik_fetch_fallback`,当遇到复杂客户端渲染 SPA、React/Vue 骨架屏或 403 反爬拦截时,自动无缝升级至 `jeik fetch` / `jeik-web-fetch` 引擎执行抓取。 - capabilities:强化 `web_fetch` 无可读正文与错误提示信息,明确引导使用内置 `jeik-web-fetch` 技能及安装独立命令行工具。 - teaches:同步中英文官方配置与技能教学文档(`03_mcp_and_skills.md`)。 - tests:新增技能资产打包验证、离线模式静默防护以及错误引导单测。 Co-Authored-By: JeikCode <code@jeikcode.top>
🌟 JeikCode Code Review: PR #69
🇺🇸 English ReviewExecutive SummaryPR #69 introduces official out-of-the-box integration for the The packaging under Below are several key engineering recommendations regarding child process lifecycle management, concurrency safety, Windows GUI behavior, and fallback mode alignment to make this integration rock-solid before merging into Key Findings & Recommendations1. Process Lifecycle & Windows Console Window Flashing (
|
…solation, path enrichment, and binary dispatch Elevate `jeik_fetch_fallback` in `crates/jeikcode-capabilities/src/tools/web_fetch.rs` with robust process management, environment enrichment, and mode routing: - Environment PATH enrichment: Call `crate::process_utils::apply_enriched_path_env(&mut cmd)` so fallback CLI binaries located in user paths (~/.cargo/bin, ~/.local/bin, node/nvm/bun) are discovered in daemon and desktop environments. - Binary argument dispatch: Tailor CLI arguments per binary (`["fetch", url, mode]` for unified `jeik` tool; `[url, mode]` directly for standalone `jeik-web-fetch` CLI). - Windows console flashing prevention: Attach `crate::process_utils::suppress_console_window(&mut cmd)` to suppress transient console window popups when invoking fallback CLIs. - Process lifecycle & orphan cleanup: Switch execution to `crate::tools::output_with_timeout_secs(cmd, 15).await` so child and grandchild browser processes are bound to Windows Job Objects and automatically reaped on timeout or future drop. - Mode parameterization & cascade avoidance: Pass context-specific modes (`"--fast"` for transport failures, `"--complex"` for 403/503 anti-bot challenges, and `"--common"` for empty DOM/unrendered SPA skeletons); break immediately on timeout to prevent double timeout cascades (15s + 15s). - Unit tests: Verify offline isolation across all modes and test graceful fallback when CLI binaries are absent on PATH. --- 提升 `crates/jeikcode-capabilities/src/tools/web_fetch.rs` 中 `jeik_fetch_fallback` 的进程管理、环境变量与模式路由能力: - 注入丰富 PATH 环境变量:调用 `crate::process_utils::apply_enriched_path_env(&mut cmd)`,确保在桌面端或常驻服务环境中能够正确识别并执行安装在用户目录(~/.cargo/bin、~/.local/bin、node/nvm/bun 等)下的 CLI 工具。 - 二进制命令参数分发兼容:针对统一工具套件 `jeik` 传入 `["fetch", url, mode]`;针对独立发布的 `jeik-web-fetch` CLI 直接以 URL 和模式参数调用,避免冗余子命令解析异常。 - 抑制 Windows 命令行黑框弹出:调用 `crate::process_utils::suppress_console_window(&mut cmd)`,防止后台拉起降级 CLI 时闪烁终端窗口。 - 完善子进程生命周期与防残留机制:改用 `crate::tools::output_with_timeout_secs(cmd, 15).await`,借助 Windows Job Objects 机制确保超时或 Future drop 时彻底回收子进程及其派生的无头浏览器进程树。 - 模式参数化与防连环超时:根据错误场景自适应传参(网络重置/传输错误使用 `"--fast"`,403/503 反爬挑战使用 `"--complex"`,空正文/未渲染 SPA 骨架屏使用 `"--common"`);并在首个命令超时后立即退出循环,避免 15s + 15s 双重级联超时阻塞。 - 补齐单元测试:验证各模式下的 `offline` 离线隔离守卫以及外部 CLI 缺失时的静默安全返回。 Co-Authored-By: JeikCode <code@jeikcode.top>
8cf8488 to
5ba79ff
Compare
|
Hi there, thank you for your contribution! Due to the rapid pace of updates for jeik skills, I plan to transition it into a "skill marketplace" model going forward. I'll be creating a dedicated repository called jeik-skills-hub to host every skill I've handcrafted, ensuring cross-platform compatibility and a minimalist Skill.md prompt design. Additionally, I will add a small "Store" button to the jeikcode skills panel. Whenever updates are available, a green update indicator—matching the one in the top-right update popup—will appear for quick and easy syncing. Stay tuned for the upcoming updates! 你好,感谢你的贡献!由于 jeik 技能的更新频率极快,后续我计划将其转为“技能市场”的模式。我会单独新建一个 jeik-skills-hub 仓库,专门收录我亲手编写的每一个技能,并确保跨平台通用以及极简的 Skill.md 提示词设计。 此外,我会在 jeikcode 的技能面板中增加一个小小的“超市”入口。当有新更新时,它会像右上角更新弹窗一样显示绿色更新图标,方便大家快捷更新。请稍等我后续的更新推送! |
变更类型 / Change Type
基于的分支与版本号 / Base Branch & Version
upstream/betav7.3.0-beta.3(bcceb667a)🇺🇸 English Description
Current Problem & User Impact
As highlighted in PR #54 discussions, modern technical documentation websites frequently rely on Single Page Applications (SPA), client-side JavaScript rendering (React/Vue/Next.js/Nuxt), Monaco code editors, and Cloudflare anti-bot verification challenges. Standard HTTP probe fetchers (
web_fetch) struggle with these pages, often returning blank bodies, skeleton DOM, or 403 blocks, leaving AI agents without usable context.Maintainer @jeikl authored the high-performance Jeik-Web-Fetch web extraction engine to solve this issue and announced plans to integrate it out-of-the-box into JeikCode.
Solution
jeik-web-fetch):@jeikl's official skill definition undercrates/jeikcode-capabilities/assets/skills/jeik-web-fetch/SKILL.md.BUNDLED_ASSETS(crates/jeikcode-coding/src/config_sync.rs) so it is installed and auto-selected for new setups and upgrades while remaining customizable.web_fetchTool Synergy & Fallback Hardening:jeik_fetch_fallbacktocrates/jeikcode-capabilities/src/tools/web_fetch.rs. Whenweb_fetchencounters an empty body from an unrendered SPA, connection reset, or 403/503 anti-bot challenges, it automatically escalates tojeik fetch/jeik-web-fetchCLI if available on the system.apply_enriched_path_env(&mut cmd)so fallback CLI binaries located in user directories (~/.cargo/bin,~/.local/bin, node/nvm/bun) are reliably discovered in daemon and desktop environments.["fetch", url, mode]for unifiedjeiktool;[url, mode]directly for standalonejeik-web-fetchCLI).--fastfor connection/transport failures,--complexfor anti-bot 403/503 challenges,--commonfor empty/unrendered SPA bodies).suppress_console_window(&mut cmd)to eliminate console window popup flashing on Windows.output_with_timeout_secs(cmd, 15).awaitwith Windows Job Objects to guarantee child and browser process trees are killed cleanly on timeout or drop, and breaks immediately on timeout to prevent double timeout cascades.web_fetchempty response and error messages to guide the agent and user directly to the built-injeik-web-fetchskill (jeik fetch "<URL>" --common).jeik_fetch_fallbackwithis_offline_active()across all modes to guarantee zero network leakage in air-gapped environments.03_mcp_and_skills.mdin both Chinese and English with detailed documentation onjeik-web-fetchand its 3 categorized modes (--fast,--common,--complex).🇨🇳 中文说明
当前问题、对用户使用体验会产生什么问题或影响
在日常 AI 辅助开发中,大量前沿技术文档网站采用 SPA 单页客户端渲染架构(React / Vue / Next.js / Nuxt)、Monaco 代码编辑器以及 Cloudflare 反爬风控拦截。现有的纯静态 HTTP 请求工具(
web_fetch)往往只能获取到空白骨架屏、无代码正文或 403 阻断响应,导致 Agent 无法读取所需的技术规范与 API 手册。作者 @jeikl 在 PR #54 中同步了其亲自研发的 Jeik-Web-Fetch 网页高精度提取引擎,并计划将其开箱内置进 JeikCode。
解决方案
jeik-web-fetch):crates/jeikcode-capabilities/assets/skills/jeik-web-fetch/SKILL.md。crates/jeikcode-coding/src/config_sync.rs的BUNDLED_ASSETS,新安装与升级时自动预勾选同步,并配置中英文本地化描述。web_fetch内置工具智能协同与健壮性加固:crates/jeikcode-capabilities/src/tools/web_fetch.rs中引入jeik_fetch_fallback。当web_fetch抓取动态 SPA 产生空白正文、网络重置或遇到 403/503 反爬挑战时,系统会自动探测并升级调用宿主机的jeik fetch/jeik-web-fetch引擎执行高精度渲染提取。apply_enriched_path_env(&mut cmd),确保常驻后台与桌面客户端能准确寻址安装在用户目录(~/.cargo/bin、~/.local/bin、Node/Bun 等)的 CLI 工具。jeik套件传递["fetch", url, mode],对独立发布的jeik-web-fetchCLI 直接以 URL 和模式参数调用,避免冗余子命令报错。--fast、403/503 风控反爬采用--complex、空正文骨架屏采用--common精准调度。suppress_console_window(&mut cmd),杜绝后台拉起 CLI 时的黑框闪烁。output_with_timeout_secs(cmd, 15).await与 Windows Job Objects 自动在超时或 Future drop 时回收整棵进程树;超时立即中断,避免 15s + 15s 双重级联超时阻塞。jeik-web-fetch技能(jeik fetch "<URL>" --common)与安装指引。is_offline_active()校验,纯离线环境下全模式安全静默。03_mcp_and_skills.md知识库文档,详细介绍jeik-web-fetch的三档抓取模式(--fast、--common、--complex)。提交清单(组内独立、可单独回退)/ Commit List
543e84c445ba79ff61每项提交引起的变化和影响面 / Changes & Blast Radius
crates/jeikcode-capabilities/assets/skills/jeik-web-fetch/SKILL.md: 新增官方内置技能资产。crates/jeikcode-coding/src/config_sync.rs: 注册内置资产并配置同步与说明。crates/jeikcode-capabilities/src/tools/web_fetch.rs: 增强web_fetch降级协同逻辑、进程与窗口隔离、环境 PATH 注入、防连环超时、离线校验与引导提示。crates/jeikcode-capabilities/assets/teaches/03_mcp_and_skills.md: 同步技能文档。crates/jeikcode-capabilities/assets/teaches/en/03_mcp_and_skills.md: 同步英文技能文档。自检(与 CI 相同的命令)/ Self-Check
cargo fmt -- --checkcargo check --bin jeikcodecargo check --lib -p jeikcode-daemonweb_fetch27 项单测通过、config_sync单测通过)署名 / Attribution
modded-soldier-9)