稳定性修复: - 修复 cache.py SQLite 连接泄漏(contextlib.closing 包装) - 修复 fetch.py requests stream=True 连接泄漏(try/finally resp.close()) - RETRYABLE_STATUS 新增 403,激活 UA fallback 切换逻辑 - --cache-stats 移至实例解析前,无需实例即可查询 - classify_error 从错误消息提取 HTTP 状态码,正确分类 E_AUTH/E_RATE_LIMIT - --stream 与 --queries-file 互斥检查,违规报 E_INPUT - batch 退出码语义统一(0=有结果 / 1=全部错误 / 2=全部空结果) AI Agent 体验增强: - 错误码体系完善:E_CONFIG/E_AUTH/E_NETWORK/E_RATE_LIMIT/E_PARSE/E_EMPTY/E_INPUT/E_INTERNAL - recovery_hint 恢复提示字段,AI Agent 可程序化决策恢复策略 - stream 模式新增 error 事件类型(含 error_code + recovery_hint) - 进度事件扩展:instance_try/instance_ok/instance_fail - batch 模式统一 schema(status 字段区分 success/failed) - JSON 输出含 schema_version 字段确保版本兼容 测试与文档: - 测试覆盖:330 -> 352 - SKILL.md / README.md 同步更新
13 lines
378 B
Python
13 lines
378 B
Python
"""Package-level constants for searxng-cli scripts.
|
|
|
|
Import in sibling scripts with:
|
|
from _config import VERSION, USER_AGENT, SCHEMA_VERSION
|
|
|
|
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.8.0"
|
|
SCHEMA_VERSION = "1.0"
|
|
USER_AGENT = f"searxng-cli/{VERSION}"
|