核心新增(面向 AI Agent 程序化使用): - 结构化错误码体系:E_CONFIG/E_AUTH/E_NETWORK/E_RATE_LIMIT/E_PARSE/E_EMPTY/E_INPUT/E_INTERNAL classify_error() 自动分类异常,JSON 错误输出含 error_code 字段 - JSON Lines 流式输出 (--stream):每条结果独立一行,AI 可增量处理 - 进度事件 (--progress):JSON Lines 事件流到 stderr(start/cache_hit/fetch_ok/done 等) 测试补全(+154 例,覆盖全部高风险盲区): - HTML 回退搜索路径 (19) - --fetch 自动抓取 (21) - --verify 健康检查 (15) - 输出格式化 (15) - 实例解析链 (20) - 并行多实例搜索 (10) - CLI 入口与端到端 (17) - 错误码分类 (27) - 流式输出与进度事件 (10) 源码改进: - search.py: h3 内 a 标签 href 作为 url fallback,提升 SearXNG 主题兼容性 - common.py: 新增 classify_error/emit_progress/set_progress_enabled 文档同步:SKILL.md 新增 AI Agent Integration Guide 章节,README.md 更新参数与错误码表
12 lines
339 B
Python
12 lines
339 B
Python
"""Package-level constants for searxng-cli scripts.
|
|
|
|
Import in sibling scripts with:
|
|
from _config import VERSION, USER_AGENT
|
|
|
|
Retry settings and shared HTTP utilities now live in ``common.py`` so that
|
|
both ``search.py`` and ``fetch.py`` share one consistent implementation.
|
|
"""
|
|
|
|
VERSION = "1.7.0"
|
|
USER_AGENT = f"searxng-cli/{VERSION}"
|