Repository navigation
feat(console): 账号页批量导入(自动识别 + 确认区) - #395
Merged
Merged
Conversation
顶栏「批量导入」选 JSON,固定 provider=workbuddy/region=cn,复用 现有 POST /api/accounts/import(ImportAll)。normalize 与结果文案抽到 lib/workbuddyImport,与 AddAccountModal 共用。
Detect credential packs on file pick, confirm WorkBuddy CN/Global in a modal, then reuse ImportAll. Other providers are detected but not imported yet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
结论
账号页顶栏「刷新额度」与「添加账号」之间增加 批量导入:选 JSON → 自动识别 format / provider / region → 确认 Modal 后再导入。当前仅 WorkBuddy 真正写入(可改选 CN / Global);其它已识别供应商暂不支持批量。复用现有
POST /api/accounts/import(#393 ImportAll)。请 review 后自行 merge,本 PR 不自动合入。新 UX
detectImportBundle:format / provider / region / warningsimportAccount识别规则(
lib/accountImportDetect.ts)bundle.format映射 registry formats:workbuddy-accounts/workbuddy-oauth-v1、qoder-native-v1、trae-oauth-v1、devin-session-v1、command-key-v1、codex-oauth-v1、zhipu-key-v1、qwenwork-oauth-v1…accounts[]+token/domain → workbuddy-accounts;user_blob+machine_id→ qoder 等codebuddy.cn→ cn;workbuddy.ai/workbuddy.com→ global;混包 → ambiguous 强制人选;无 domain → 默认 cn 并标「请确认」改动
BatchImportConfirmModal→ 确认后importWorkbuddyBundle({ region })frontend/scripts/accountImportDetect.test.ts(npx tsx frontend/scripts/accountImportDetect.test.ts)不做
新后端 endpoint;其它供应商真正批量写入;chat/指纹/签到;改 release;自动 merge。
手动验收
workbuddy-accountsJSON(CN domain)→ Modal 识别 WorkBuddy / CN → 确认导入;toast 成功 N / 失败 M。