This release is a pre-release and may not be stable for production use.
buddy-agent-auth
多品牌 Agent 账号与认证库,源代码与 workbuddy2api 同仓库、独立发行,不依赖 WorkBuddy2API 或 DailyCheckin。品牌协议按 provider 隔离:
buddy_agent_auth.providers.codebuddy:WorkBuddy/CodeBuddy 账号与 token 管理。buddy_agent_auth.providers.trae:Trae 原生登录态、凭据解密、凭据文件校验与 token 生命周期。使用 Trae 功能时安装buddy-agent-auth[trae]。
各 provider 实现轻量的 SessionProvider 接口,返回品牌自己的会话类型;未来添加新品牌时新增 provider,不把不同平台的 token 或设备协议混为一谈。现有顶层 WorkBuddy 导入保持兼容。Trae 的独立浏览器 OAuth 登录、设备注册、硬件配置和账号设备绑定由 Trae provider 提供;不依赖 DailyCheckin。默认设备数据位于 ~/.traeapi,可用 TRAE2API_HOME 指定。独立登录可调用 buddy_agent_auth.providers.trae.login.TraeLoginFlow 或 run_login。
from buddy_agent_auth.providers.trae import TraeNativeProvider
identity = TraeNativeProvider(device_id_source="get-device-id").load()
identity.ensure_current() # 登录态发生变化时抛出异常
from buddy_agent_auth import AccountStore
store = AccountStore() # 默认 ~/.workbuddy2api/accounts,兼容现有账号数据
accounts = store.list_accounts()
client = store.get_client(accounts[0]['id'])
client.ensure_authenticated(open_browser=False, allow_login=False)
headers = client.auth_headers()
登录可通过 CodeBuddyClient.login() 完成,再通过 AccountStore.import_client() 导入;后台操作不应自动启动浏览器。账号目录事务使用跨进程锁,token 刷新使用每个 session 的独立跨进程锁,刷新前重新读取磁盘,保存时检查旧状态。进程中发生重关联或删除时,较早的刷新响应不会覆盖新数据。为兼容仍在运行的旧版客户端,账号目录内的锁文件保留旧名称 .workbuddy-auth.lock;账号文件路径和格式不变。
在仓库开发时:python -m pip install -e packages/buddy-agent-auth。发行前需先发布该包及 DailyCheckin 的匹配版本;目前没有执行任何公开发布。
Metadata
Release files for buddy-agent-auth 0.1.0.dev1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| buddy_agent_auth-0.1.0.dev1.tar.gz | 56.2 kB | With provenance | Details for buddy_agent_auth-0.1.0.dev1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| buddy_agent_auth-0.1.0.dev1-py3-none-any.whl | Python 3 | none | any | Details for buddy_agent_auth-0.1.0.dev1-py3-none-any.whl |
Total release size: 122.4 kB
Release files / buddy_agent_auth-0.1.0.dev1.tar.gz
| Download URL | buddy_agent_auth-0.1.0.dev1.tar.gz |
|---|---|
| Size | 56.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0690383ae8a7fa9c76ab828d0c1a1417d60003758c07b29f74e3faaeb1963510
|
|
BLAKE2b-256 checksum How to use checksums |
e08ecf826a1a1821a80eacc77a44b38c255368bee027242a9b40bae0afccffdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logRelease files / buddy_agent_auth-0.1.0.dev1-py3-none-any.whl
| Download URL | buddy_agent_auth-0.1.0.dev1-py3-none-any.whl |
|---|---|
| Size | 66.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
840625edf421646f7977d0eb4d4529ed69b54d638ba2f3c617eb247ba647c5c2
|
|
BLAKE2b-256 checksum How to use checksums |
010a3dab4851e9892b1f475a674d3965e93517e4ed7c49bf80e87d45205a327f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logSecurity for buddy-agent-auth 0.1.0.dev1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for buddy_agent_auth-0.1.0.dev1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.