feat(claude-code): 增加动态 CLI 客户端画像并按官方发布刷新版本

- 将 Claude Code 传输身份拆分为带版本的静态模板(Stainless/运行时/beta 策略)与动态 CLI 画像(cli_version / User-Agent),请求按快照读取保证 UA 与 billing cc_version 一致
- 将 codex_profile 泛化为 cli_client_profile,Codex 与 Claude Code 共享发布校验、缓存恢复、防回退与每日刷新逻辑
- Claude Code 跟随 npm latest,要求 8 个平台包版本与主包一致;支持 AETHER_CLAUDE_CODE_CLIENT_PROFILE_REFRESH 与 AETHER_CLAUDE_CODE_CLIENT_VERSION
- 新增定时任务 maintenance.claude_code.client.profile,启动时与 Codex 画像并发预热
- 额度查询 User-Agent 改用动态画像,移除硬编码 CLAUDE_CODE_USAGE_USER_AGENT
This commit is contained in:
dalamudx
2026-10-01 15:56:21 +08:00
parent 54fbcc25a1
commit d13f52bdf8
15 changed files with 975 additions and 556 deletions
@@ -20,8 +20,11 @@ pub use policy::{
supports_local_claude_code_transport_with_network,
};
pub use profile::{
current_claude_code_transport_identity_profile, ClaudeCodeBodyCapabilityGate,
claude_code_client_profile, claude_code_client_user_agent, claude_code_client_version,
current_claude_code_transport_identity_profile, set_claude_code_cli_version,
set_claude_code_client_profile, ClaudeCodeBodyCapabilityGate, ClaudeCodeClientProfile,
ClaudeCodeTransportIdentityProfile, ClaudeCodeTransportIdentityProfileVersion,
ClaudeCodeTransportIdentityTemplate, CLAUDE_CODE_BUILTIN_CLI_VERSION,
CLAUDE_CODE_CONTEXT_MANAGEMENT_BETA, CLAUDE_CODE_TRANSPORT_IDENTITY_2026_04,
};
pub use request::{