feat(qoder): elevate NewQoder and Qoder IDE into 4 independent first-class platforms with isolated storage and multi-instance support - #2349
Open
zoutao212 wants to merge 3 commits into
Conversation
…ith isolated storage and multi-instance support - Elevate Qoder into 4 physically isolated first-class platforms (qoder, qoder_app, qoder_cn_ide, qoder_cn_app), perfectly mirroring the Trae family architecture - Support SQLite state.vscdb injection for IDE products and DPAPI AES-256-GCM auth.v1.dat encryption for Desktop App products - Provide dedicated multi-instance creation, custom user data directories, and independent launch arguments - Implement dual OpenAPI endpoint probing (openapi.qoder.sh / openapi.qoder.com.cn) and auto token renewal on 401 - Decouple quick settings popover and general settings cards into single-platform configuration views - Normalize UI display names and provide full i18n support across English and Chinese
…latform compiler warnings
This branch has not been deployed
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.
概述 (Summary)
本 PR 将 Qoder 从此前单一粗粒度的 Provider,彻底提升重构为 4 个物理隔离的一等公民独立系统平台,在架构设计上 100% 对齐现存成熟的 Trae 系列架构(
trae、trae_solo、trae_cn、trae_solo_cn)。Qoder 产品矩阵中的 4 款应用(国际版 IDE、国内版 IDE、国际版桌面 App、国内版桌面 App)均获得 Cockpit Tools 完整的独立平台地位:具备独立的路由页面、完全物理隔离的账号与凭据存储、独立的应用多开生命周期,以及完全解耦的启动路径与配置管理。
Qoder 四产品矩阵架构对照表
qoderstate.vscdb%APPDATA%\Qoder\User\globalStorageQoder IDE.exe/Qoder.exeC:\Program Files\Qoder IDE\Qoder IDE.exeqoder_cn_idestate.vscdb%APPDATA%\QoderCN\User\globalStorageQoder CN IDE.exe/Qoder.exeC:\Program Files\Qoder CN IDE\Qoder CN IDE.exeqoder_appauth.v1.dat%APPDATA%\com.qoder.app.stableQoder.exeC:\Program Files\Qoder\Qoder\Qoder.exeqoder_cn_appauth.v1.dat%APPDATA%\com.qodercn.app.stableQoder CN.exeC:\Program Files\Qoder CN\Qoder CN\Qoder CN.exe核心技术能力与实现细节
1. 四渠道凭据物理隔离(杜绝跨目录盲注与串号)
qoder,qoder_cn_ide):state.vscdbSQLite 数据库中;-wal/-shm临时缓存日志,彻底解决切换账号后被 SQLite 缓存回滚的顽疾。qoder_app,qoder_cn_app):Local State(DPAPI v10 机制),提取 AES-GCM 主密钥;auth.v1.dat结构,采用 12 字节高强度随机 IV 进行 AES-256-GCM 加密,并保留完整的校验头,保证 App 启动直接识别。2. 四平台独立应用多开管理 (Multi-Instance)
--user-data-dir用户目录隔离与自定义启动参数。3. 双端 OpenAPI 容灾互备与 Token 自动续期
https://openapi.qoder.sh;https://openapi.qoder.com.cn;refresh_token并调用POST /api/v1/deviceToken/refresh换取新令牌;orgResourcePackage(含cap上限),精准对齐为addOnQuota资源包展示。4. 设置页面与启动路径完全独立解耦
QuickSettingsPopover):SettingsGeneralPanel):Qoder IDE 设置、Qoder 设置、Qoder CN IDE 设置、Qoder CN 设置);scan_app_launch_targets)」。localStorage历史脏数据(如Qoder_app等下划线命名),升级为无下划线的规范大写单例组。验证与测试 (Verification)
src/types/qoder.test.ts,涵盖企业配额计算、资源包上限解析与渠道身份推导,执行node --test全部通过 (2/2 Passed);npm run typecheck(tsc --noEmit) 零错误通过;cargo check --manifest-path src-tauri/Cargo.toml零错误通过;npm run tauri build -- --no-bundle构建成功,验证产物体积达 94.7 MB(完整内置前端静态资源,非白屏残壳);Summary
Elevate Qoder from a single rudimentary provider into 4 physically isolated, first-class platforms, aligning 1:1 with the established multi-product architecture of the Trae family (
trae,trae_solo,trae_cn,trae_solo_cn).Each product in the Qoder matrix is now an independent citizen within Cockpit Tools, featuring dedicated routing, isolated credential storage, independent multi-instance lifecycles, and separate path/refresh configuration pages.
The Qoder 4-Product Matrix Architecture
qoderstate.vscdb%APPDATA%\Qoder\User\globalStorageQoder IDE.exe/Qoder.exeC:\Program Files\Qoder IDE\Qoder IDE.exeqoder_cn_idestate.vscdb%APPDATA%\QoderCN\User\globalStorageQoder CN IDE.exe/Qoder.exeC:\Program Files\Qoder CN IDE\Qoder CN IDE.exeqoder_appauth.v1.dat%APPDATA%\com.qoder.app.stableQoder.exeC:\Program Files\Qoder\Qoder\Qoder.exeqoder_cn_appauth.v1.dat%APPDATA%\com.qodercn.app.stableQoder CN.exeC:\Program Files\Qoder CN\Qoder CN\Qoder CN.exeKey Features & Implementations
1. Physical Isolation Across All 4 Channels (No Cross-Directory Pollution)
qoder,qoder_cn_ide):state.vscdbdatabases.-waland-shm) prior to launch to prevent credential reversion.qoder_app,qoder_cn_app):Local State(DPAPI v10) to obtain the AES-GCM master key.auth.v1.datusing 12-byte random IVs and AES-256-GCM payloads with strict binary integrity.2. Multi-Instance Management Across All 4 Products
qoder,qoder_app,qoder_cn_ide, andqoder_cn_app.--user-data-dir) and custom process arguments for each instance.3. Dual-Endpoint Fallback & Resilient Token Renewal
https://openapi.qoder.sh.https://openapi.qoder.com.cn.refresh_tokenfrom credentials and callsPOST /api/v1/deviceToken/refreshwhen access tokens expire.orgResourcePackageand enterprise resource plans intoaddOnQuotafor all accounts.4. Decoupled Settings & Navigation
SettingsGeneralPanel, with independent launch path inputs, file pickers, and live process detection (scan_app_launch_targets).Qoder_app,Qoder_cn_ide) into canonical platform identities without user data loss.Verification & Testing
src/types/qoder.test.tscovering enterprise quota models, orgResourcePackage calculations, and channel identity resolution.npm run typecheck(tsc --noEmit) passes with 0 errors.cargo check --manifest-path src-tauri/Cargo.tomlpasses with 0 errors.npm run tauri build -- --no-bundle, verified output executable size (~94.7 MB) with full embedded frontend assets.