원클릭으로
xrk-crawl
当你需要开发/排查 HTTP 抓取、SSRF、Playwright 受控浏览器、本地字体增强截图,或判断 web_fetch 与 browser 工作流如何选型时使用。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
当你需要开发/排查 HTTP 抓取、SSRF、Playwright 受控浏览器、本地字体增强截图,或判断 web_fetch 与 browser 工作流如何选型时使用。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | xrk-crawl |
| description | 当你需要开发/排查 HTTP 抓取、SSRF、Playwright 受控浏览器、本地字体增强截图,或判断 web_fetch 与 browser 工作流如何选型时使用。 |
src/infrastructure/crawl/index.js — 插件、workflow、HTTP 只从这里 import(#infrastructure/crawl/index.js)。
import {
fetchWithPolicy,
runWebFetch,
buildWebFetchRuntime,
assertUrlSafeForFetch,
PlaywrightAgentSession,
createLocalFontScreenshotHelper,
DEFAULT_DEVICE_SCALE_FACTOR,
DOM_TWEAK_LABEL_COLON_HALF,
} from '#infrastructure/crawl/index.js'
fetchWithPolicy 实现在 #utils/fetch-with-retry.js,由 crawl 门面 re-export。
| 场景 | 能力 | 实现文件(均在 src/infrastructure/crawl/) |
|---|---|---|
| 简单 API / 无需 JS 渲染 | fetchWithPolicy | #utils/fetch-with-retry.js |
| 正文提取、Readability、Firecrawl | runWebFetch | web-fetch-executor.js |
| 开放域检索 | runWebSearch | web-search-executor.js + web-search-registry.js |
| 零配置免费检索 | runParallelFreeSearch | web-search-parallel-free.js + web-search-mcp-client.js |
| 浏览器运行时 | buildBrowserRuntime | crawl-config.js(ai-workflow.crawl + renderer.playwright) |
MCP web_fetch / web_search | workflow/web.js | 内部用 crawl |
| JS 渲染、交互、截图 | PlaywrightAgentSession | playwright-session.js |
| MCP 受控浏览器 | workflow/browser.js | browser_* 工具 |
| 截图字体/样式与线上一致 | createLocalFontScreenshotHelper | page-screenshot-enhance.js |
选型:HTTP 能拿正文 → runWebFetch;要渲染或 PNG → Playwright。
ssrf-policy.js:allowlist、legacy IP、DNS pinning、createPinnedDispatcherssrf-guard.js:对外 re-export assertUrlSafeForFetchfetch-guard.js:fetchWithSsrFGuard(每跳 pin DNS + 重定向环)browser-navigation-guard.js:gotoWithNavigationGuard(page.route 拦截)| 方法 | 说明 |
|---|---|
roleSnapshot() | ARIA ref 树 + storeRoleRefsOnPage |
runAct({ kind, ref, ... }) | 含 batch、scrollIntoView、fill fields |
listTabs / newTab / closeTab / focusTab | 多标签 |
getConsoleMessages / getNetworkRequests | 页面观测 |
armDialog / respondDialog | 弹窗 |
goto(url) | gotoWithNavigationGuard + 交互后 SSRF 复检 |
src/infrastructure/crawl/
index.js
ssrf-*.js / fetch-guard.js / browser-navigation-guard.js
playwright-session.js / pw-*.js / act-policy.js
web-fetch-*.js / web-search-*.js / crawl-config.js
page-screenshot-enhance.js
Schema:core/system-Core/commonconfig/system.js → ai-workflow.fields.crawl
默认模板:config/default_config/ai-workflow.yaml → crawl:
运行时数据:data/server_bots/{port}/ai-workflow.yaml → crawl.webFetch / crawl.webSearch / crawl.browser
优先级:调用方 overrides > ai-workflow.crawl > renderer.playwright(browser 启动)> 默认
单一实现:crawl-config.js — resolveWebFetchRuntime / resolveWebSearchConfig / buildBrowserRuntime
禁止在 crawl 模块内读取 process.env 做业务配置;凭据与参数一律写 data/server_bots/{port}/ai-workflow.yaml → crawl.*。
core/system-Core/workflow/web.js → web_fetch / web_searchcore/system-Core/workflow/browser.js → 全量 browser_*(见 docs/system-core.md)src/infrastructure/crawl/ 内并在 index.js 导出,不要在 Core 内复制一份。fetch-with-retry.js、web-fetch-executor.js 已用全局 fetch + AbortSignal.timeout;扩展时沿用,禁止 node-fetch。toBase64() / Uint8Array.fromBase64(),勿 toString('base64')。Error.isError / normalizeError(skill xrk-node-runtime)。docs/system-core.md(web / browser 章节)core/system-Core/plugin/ 下未写入 .gitignore 白名单的 .js 仍会加载,但不计入框架 baseline当你需要从“应用视角”看 XRK-AGT(启动流程、Web 控制台、前后端协作、典型技术栈组合)时使用。
当你需要开发或排查 HTTP API(core/*/http/*.js)、理解 HttpApi 基类、HttpApiLoader、业务层约定时使用。
编写或审查 core/*/www 静态页、校园 WebView 兼容、HttpResponse 前端解包时使用。浏览器环境 ≠ Node 26。
编写或审查 core/src 代码时的写法与性能规范(全局裸名、状态、I/O、异步、HTTP)。改 Core 前必读。
当你需要快速理解 system-Core 提供哪些 HTTP API/工作流/插件/Tasker/Web 控制台能力,或定位某个模块在哪实现时使用。
当需要从整体理解 XRK-AGT 的架构、目录、运行流程和技术栈时使用。