Skip to content

Add Xquik as an optional Twitter read backend - #471

Closed
kriptoburak wants to merge 1 commit into
Panniantong:mainfrom
kriptoburak:codex/add-xquik-twitter-backend
Closed

Add Xquik as an optional Twitter read backend#471
kriptoburak wants to merge 1 commit into
Panniantong:mainfrom
kriptoburak:codex/add-xquik-twitter-backend

Conversation

@kriptoburak

@kriptoburak kriptoburak commented Jul 3, 2026

Copy link
Copy Markdown

概要

  • 在当前 main 上重建 Xquik 的可选 Twitter/X 只读后端。
  • 支持 XQUIK_API_KEYxquik_api_keyagent-reach configure xquik-key
  • doctor 只报告配置存在。它不会发送、验证或打印密钥。
  • 补全搜索、单条推文、用户资料、用户时间线与 X Article 示例。
  • 使用 xquik-api-contract: 2026-04-29next_cursor 分页。
  • 保留当前 Cookie-Editor-only 安全策略和真实 active_backend 语义。

独立仓库修复

Closes #368.

Windows 上的 Chrome 127+ 与新版 Edge 使用应用绑定 Cookie 加密。自动浏览器读取可能报 Unable to get key for cookie decryption。文档现在说明该限制,并使用 Cookie-Editor 与当前 PowerShell 会话变量作为安全路径。

Reviewer 问题

  1. Xquik 是可选的 X 只读 API 后端。公开文档:https://docs.xquik.com。
  2. 用户从 https://dashboard.xquik.com 创建 key。Agent Reach 支持环境变量或本地私有配置。
  3. 配额取决于账号方案。当前额度以 dashboard 为准。本仓库不硬编码价格或额度。

Xquik is an independent third-party service. Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp.

架构与安全

  • Agent Reach 仍然没有包装层。Agent 直接调用公开上游读取端点。
  • doctor 不发网络请求,也不把未验证配置标记为 active。
  • 没有恢复 twitter status、自动浏览器 Cookie 读取或 legacy 探测行为。
  • Fork owner 已确认是 kriptoburak

验证

  • Python 3.10:432 passed
  • Python 3.13:432 passed
  • Python 3.14:432 passed
  • Wheel build、内容 gate 与 clean-venv smoke install 通过
  • 新增 Python 路径 Ruff 通过
  • cli.py 的 17 个 Ruff findings 与 1 个 MyPy finding 和当前 upstream baseline 完全一致;本 PR 没有新增 finding
  • git diff --check 通过
  • 当前 upstream main 上只有 1 个 SSH-signed commit

@moxxxskaifa moxxxskaifa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

添加 Xquik API 作为 Twitter 的备选后端,52 行改动。

几个问题:

  1. Xquik API 是什么?有公开文档吗?
  2. XQUIK_API_KEY 从哪里获取?
  3. 是否有免费额度限制?

代码结构合理,确认上述问题后可合并。

@kriptoburak

Copy link
Copy Markdown
Author

感谢 review,补充说明:

  1. Xquik 是 X 自动化与 API 平台。公开文档: https://docs.xquik.com。OpenAPI schema: https://xquik.com/openapi.json。
  2. 用户在 Xquik dashboard 创建 XQUIK_API_KEY,并通过本地环境变量提供。当前实现不会打印 key,也不会在启动时验证 key。
  3. 配额取决于用户账号计划,并由 API 侧执行。这个 PR 保持 Xquik 可选:未配置 key 时,现有 Twitter channel 行为不变。

@kriptoburak

Copy link
Copy Markdown
Author

感谢之前的 review。这个更新已把 3 个问题落实到代码和文档中:

  1. 公开文档是 https://docs.xquik.com,OpenAPIhttps://xquik.com/openapi.json。
  2. 用户从 Xquik dashboard 创建 key,然后设置 XQUIK_API_KEY,也可以在 Agent Reach config 中设置 xquik_api_keydoctor 不会打印或发送 key。
  3. 配额由账号方案决定,当前额度在 dashboard 查看。Agent Reach 不硬编码额度或价格。

我也补全了真正可执行的 search/read curl 命令和 fallback 路由,并修复了一个独立问题:原来的域名子串判断会把 notx.comtwitter.com.example.org 错认成 Twitter。现在只接受真实的 x.comtwitter.com 及其子域名。

已在最新 main 上重建为 1 个 GitHub 验证签名 commit。完整 pytest 201/201 通过,修改的 Python 文件 Ruff 通过。

@kriptoburak
kriptoburak force-pushed the codex/add-xquik-twitter-backend branch from 2aa5551 to ee5c1e7 Compare July 29, 2026 02:30
@kriptoburak kriptoburak changed the title Add Xquik API as a Twitter backend option Add Xquik as an optional Twitter read backend Jul 29, 2026
@kriptoburak

Copy link
Copy Markdown
Author

已按当前 main 完整重建,并保留了最新的 Cookie 安全架构:

  • 当前 head:ee5c1e7,GitHub 已验证 SSH signature
  • PR 已从 conflicting 变为 mergeable
  • Xquik key 只做存在性检查;doctor 不发送、不验证、不打印,也不标记 active
  • 已补全搜索、推文、用户、时间线、Article 与分页示例
  • 独立修复关联 Docs: note Windows limitation for twitter-cli cookie auth (app-bound encryption) — see twitter-cli#66 #368,补充 Windows app-bound Cookie 加密限制和 Cookie-Editor 路径
  • Python 3.10 / 3.13 / 3.14 各 432 tests passed
  • wheel build、内容检查、clean-venv smoke install passed

GitHub Actions 当前显示 action_required,且尚未创建任何 job。这是 fork PR 的 workflow approval gate,需要 maintainer 批准后才会运行。代码侧目前没有失败 check 可修复。

@Panniantong

Copy link
Copy Markdown
Owner

感谢探索 Xquik。当前实现会绕过最新隐藏秘密输入边界、把密钥暴露在 curl 参数中、只登记不真实探活,而且上游已经演进为付费官方 CLI 和 MCP;若未来接入应重新评估并直接路由官方工具。

@Panniantong Panniantong closed this Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: note Windows limitation for twitter-cli cookie auth (app-bound encryption) — see twitter-cli#66

3 participants