docs: clarify Python module responsibilities

Rewrite the module-level descriptions for all 28 Python files and remove the obsolete integration note from grok_register_ttk.py. Verified on Python 3.9 and Python 3.12.
This commit is contained in:
Aaron Liang
2026-07-15 12:26:57 +08:00
committed by GitHub
parent 2b0fe10d5b
commit 4b030214d9
28 changed files with 41 additions and 30 deletions
+2
View File
@@ -1,3 +1,5 @@
"""导出 CPA xAI OIDC 凭证生成流程的公共接口。"""
from .mint import mint_and_export
__all__ = ["mint_and_export"]
+1 -6
View File
@@ -1,9 +1,4 @@
"""Approve xAI device-code in Chromium (DrissionPage).
Paths resolve relative to the project root.
Token polling is the source of truth; browser automation is only used to
log in and approve the device authorization page.
"""
"""自动完成 xAI 登录、设备授权确认和相关页面交互。"""
from __future__ import annotations
+1 -1
View File
@@ -1,4 +1,4 @@
"""CPA Chromium session lifecycle, reuse, cleanup, and cookies."""
"""管理 CPA 授权浏览器会话、代理、Cookie 注入和资源清理。"""
from __future__ import annotations
import os
+1 -1
View File
@@ -1,4 +1,4 @@
"""High-level OIDC mint + export pipeline."""
"""协调浏览器授权、OAuth 轮询和 CPA 凭证导出流程。"""
from .browser_confirm import mint_with_browser
from .schema import DEFAULT_BASE_URL, build_cpa_xai_auth
+1 -1
View File
@@ -1,4 +1,4 @@
"""xAI OAuth device-code flow for Build/CLI credentials."""
"""实现 OAuth Device Authorization 的发现、启动和 token 轮询。"""
import json
import time
+1 -8
View File
@@ -1,11 +1,4 @@
"""Proxy helpers for CPA/OIDC export.
The OAuth HTTP calls can use ``http://user:pass@host:port`` directly, but
Chromium cannot reliably use proxy credentials embedded in --proxy-server.
When an authenticated HTTP/HTTPS proxy is configured we start a tiny localhost
bridge that injects Proxy-Authorization for Chromium, matching the main
registration browser behavior.
"""
"""解析认证代理并为 CPA 浏览器提供本地代理桥。"""
import base64
import os
+1 -1
View File
@@ -1,4 +1,4 @@
"""Build CLIProxyAPI-compatible xAI OAuth auth payloads."""
"""定义并规范化 CPA xAI 凭证文件的数据结构。"""
import base64
import json
+1 -1
View File
@@ -1,4 +1,4 @@
"""Atomic write of xAI auth files."""
"""将 CPA xAI 凭证安全写入本地 JSON 文件。"""
import json
import os