dsh-auth-remote 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,15 @@ This file records user-visible changes to the released package. Version numbers
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## 0.3.6 - 2026-11-13
10
+
11
+ - Preserve the native DSH `0.2.2-rc.2` account entry, notification children and ownership through real client/native-component HMR, disposal and later-writer protection. Older entries without children retain public registration. Document the private adaptation and its evidence boundaries in both languages.
12
+ - Declare eight exact hosts, with minimum support `0.2.1-rc.1` and recommended development/migration RC prerelease `0.2.2-rc.2`. Retire maintenance of `0.2.1-alpha.3`, `0.2.1-alpha.4` and `0.2.1-alpha.5`, preserving the original window and last-supporting plugin `0.3.5`. Technical admission remains `>=0.2.1-alpha.3`, including prereleases without a new upper bound.
13
+ - Pin DSH `0.2.2-rc.2` development dependencies and the merged account provider. Local Platform/notification stand-ins cover account lifecycles and native Search/Fetch billing, credential save/replace/remove, refusal and restart persistence, without real external authorization or paid services.
14
+ - Remove LiveShare Owner/Relay product-flow E2E and exclusive fixtures. Retain production Origin adaptation, real native viewer, Connection business-Origin/configuration-HMR and shared authentication checks; product flows are unverified.
15
+ - Keep complete eight-host CLI/browser/smoke in ordinary/full. Only plugin `0.3.6` full/releases add three maintenance-retirement targets; independent `0.2.1-alpha.2` technical refusal remains. An unpackaged index binds each producer’s source, same archive, actual runtimes/SDKs and raw reports, refusing omissions, wrong hashes and partial suites.
16
+ - Synchronize published `0.3.5` facts, full backups/independent-profile migration and rollback with matching host/plugin/configuration/data. This date records release preparation; final same-archive acceptance, Actions and publication remain pending.
17
+
9
18
  ## 0.3.5 - 2026-11-06
10
19
 
11
20
  - Prepare plugin `0.3.5` for release with exact DSH `0.2.2-rc.1` support, retaining all nine existing targets. Use this RC prerelease as the development default, recommended host and current migration target; admission and legacy/retirement history stay unchanged.
@@ -6,6 +6,15 @@
6
6
 
7
7
  ## 未发布
8
8
 
9
+ ## 0.3.6 - 2026-11-13
10
+
11
+ - 保留 DSH `0.2.2-rc.2` 原生账号入口、通知子槽及其所有权,支持真实客户端/原生组件 HMR、卸载和后写保护;无children的旧宿主继续公开注册。新增私有适配维护条目及双语证据边界。
12
+ - 声明八个精确宿主,最低支持 `0.2.1-rc.1`;默认及推荐迁移目标为RC预发布 `0.2.2-rc.2`。维护退役 `0.2.1-alpha.3`、`0.2.1-alpha.4`、`0.2.1-alpha.5`,保留原窗口及最后支持插件 `0.3.5`;技术准入仍为 `>=0.2.1-alpha.3`,包含预发布、无新增上限。
13
+ - 固定 `0.2.2-rc.2` 开发依赖及合并账号provider;以本地Platform/通知协议替身覆盖账号生命周期与新版Search/Fetch独立计费、凭据保存/替换/移除、拒绝和重启持久化,不访问真实外部授权或付费服务。
14
+ - 移除LiveShare Owner/Relay产品流程E2E及专用夹具,保留生产Origin适配、真实native viewer、Connection业务Origin/配置HMR和共享认证安全验证;不宣称产品流程已验证。
15
+ - ordinary/full均完整验证八版CLI/browser/smoke;仅0.3.6 full/发布增加三版维护退役专项,独立 `0.2.1-alpha.2` 技术拒绝保持。包外索引绑定每个producer的源码、同一归档、实际runtime/SDK和原始报告,拒绝缺失、错摘要和部分套件。
16
+ - 同步已发布0.3.5事实、完整备份/独立profile迁移及匹配宿主/插件/配置/数据的回退说明。日期为发布准备日;最终同包验收、Actions和公开发布仍待完成。
17
+
9
18
  ## 0.3.5 - 2026-11-06
10
19
 
11
20
  - 准备发布插件 `0.3.5`,新增精确 DSH `0.2.2-rc.1` 支持并保留现有九版;此 RC 预发布宿主作为开发默认、推荐宿主和当前迁移目标,准入及 legacy/退役历史保持。
package/CONTRIBUTING.md CHANGED
@@ -6,7 +6,7 @@ Thanks for helping improve dsh-auth-remote. Changes to authentication or deploym
6
6
 
7
7
  ## Prepare a checkout
8
8
 
9
- Use Linux with `/proc`, Node.js 24 or newer, and pnpm 12.5.1. Install dependencies and the managed browser from the repository root:
9
+ Use Linux with `/proc`, Node.js 24 (at least `24.9.0` for the default host), and pnpm 12.5.1. Install dependencies and the managed browser from the repository root:
10
10
 
11
11
  ```sh
12
12
  pnpm install --frozen-lockfile
@@ -26,4 +26,4 @@ Create a focused branch from `master`. Include the reason for the change, its us
26
26
 
27
27
  The `CI Verify` check runs on pull requests and again after a merge to `master`. A maintainer updates the version and dated changelog entry before creating a release tag. The [release guide](docs/releasing.md) describes that process.
28
28
 
29
- Version `0.3.5` is prepared for release with ten exact DSH targets, defaulting to recommended RC prerelease `0.2.2-rc.1`. Published `0.3.4` retains nine historical declarations without retroactive RC support; availability is confirmed by the release workflow and npm registry. Support/shared-host changes require one final archive across ten complete CLI/browser/smoke targets. Follow PR CI, master CI, annotated-tag and trusted publication in the release guide. Full/releases also require independent `0.2.1-alpha.2` refusal; ordinary runs no real retired-host negative job. The six-host one-time negative acceptance belongs to the `0.3.1` migration history. Never rebuild or pack in the final consumer loop.
29
+ Current source candidate `0.3.6` declares eight exact DSH targets, defaulting to recommended RC prerelease `0.2.2-rc.2`. Published `0.3.5` retains ten historical declarations and is the last supporting plugin for `0.2.1-alpha.3`, `0.2.1-alpha.4` and `0.2.1-alpha.5`. Support/shared-host changes require one final archive across all eight complete CLI/browser/smoke targets; ordinary/full both keep complete eight-host coverage. Full/releases retain independent `0.2.1-alpha.2` technical refusal. Only validated plugin `0.3.6` full/releases add the three Alpha maintenance-retirement checks; they must not block other plugin versions. Each local/PR/master/tag producer has an unpackaged acceptance index linking source, archive, actual runtime/SDK and raw reports. Follow PR CI, master CI, annotated-tag and trusted publication; never rebuild or pack in the final consumer loop. Current LiveShare verification retains native viewer/Origin/authentication boundaries; Owner/Relay product flows are unverified.
@@ -8,7 +8,7 @@
8
8
 
9
9
  ## 准备源码环境
10
10
 
11
- 使用带 `/proc` 的 Linux、Node.js 24 或更高版本、pnpm 12.5.1。在仓库根目录安装依赖和测试浏览器:
11
+ 使用带 `/proc` 的 Linux、Node.js 24(默认宿主至少 `24.9.0`)、pnpm 12.5.1。在仓库根目录安装依赖和测试浏览器:
12
12
 
13
13
  ```sh
14
14
  pnpm install --frozen-lockfile
@@ -26,4 +26,4 @@ pnpm check
26
26
 
27
27
  `CI Verify` 会在 Pull Request 和合入 `master` 后运行。维护者在创建发布标签前更新版本号和带日期的更新日志;具体流程见[发布指南](docs/releasing.zh-CN.md)。
28
28
 
29
- 版本 `0.3.5` 正在准备发布,声明十个精确 DSH 目标,开发默认及推荐宿主为 RC 预发布 `0.2.2-rc.1`。已发布 `0.3.4` 保留九版历史声明,不追溯增加 RC;可用性由发布工作流和 npm registry 确认。支持或共享宿主变更须按发布指南消费同一最终归档,十版完整 CLI/browser/smoke。依次完成 PR CI、master CI、附注标签及可信发布;full/发布还要求独立 `0.2.1-alpha.2` 退役拒绝,ordinary 不运行真实旧宿主负向。六版一次性负向属于 `0.3.1` 迁移历史。不要在最终消费循环重建或打包。
29
+ 当前源码候选 `0.3.6` 声明八个精确 DSH 目标,默认及推荐迁移宿主为 RC 预发布 `0.2.2-rc.2`。已发布 `0.3.5` 保留十版历史声明,是 `0.2.1-alpha.3`、`0.2.1-alpha.4`、`0.2.1-alpha.5` 的最后支持插件。支持或共享宿主变更须消费同一最终归档,八版完整 CLI/browser/smoke;ordinary/full 均完整验证八版。full/发布保留独立 `0.2.1-alpha.2` 技术拒绝;仅已校验插件 `0.3.6` 的 full/发布增加三个 Alpha 的维护退役专项,其他版本不能被其阻塞。每个本地/PR/master/tag producer 的源码、归档、实际 runtime/SDK 和原始报告由包外验收索引关联。依次完成 PR CI、master CI、附注标签及可信发布;最终消费循环禁止重建或打包。当前 LiveShare 验证保留 native viewer/Origin/认证边界,未验证 Owner/Relay 产品流程。
package/README.md CHANGED
@@ -6,39 +6,37 @@ Single-user remote sign-in for DeepSeek Harness (DSH), with password, TOTP, one-
6
6
 
7
7
  ## Requirements
8
8
 
9
- - Linux with `/proc` and Node.js 24. DSH `0.2.2-rc.1` requires Node.js `>=24.9.0`.
9
+ - Linux with `/proc` and Node.js 24. DSH `0.2.2-rc.2` requires Node.js `>=24.9.0`.
10
10
  - A supported DSH release and a `web` profile. One account and its sessions belong to that profile.
11
11
 
12
12
  ## DSH compatibility
13
13
 
14
- Version **`0.3.5`** is prepared for release with these ten exact DSH declarations. **`0.2.2-rc.1`** is the development default and recommended host, an upstream RC prerelease. Actual availability is established by the release workflow and npm registry. Published `0.3.4` retains its nine declarations, including `0.2.2-alpha.3`, without retroactive RC support.
14
+ Source candidate **`0.3.6`** declares these eight exact DSH releases. **`0.2.2-rc.2`** is the development default and recommended migration host, still an upstream RC prerelease. The candidate is unpublished; final same-archive acceptance and PR/master/tag gates must precede publication. Declarations do not establish testing or distribution. Published `0.3.5` retains its original ten declarations and archive.
15
15
 
16
- | DSH release | Maintenance |
17
- | --------------- | -------------------------------- |
18
- | `0.2.1-alpha.3` | Legacy; supported |
19
- | `0.2.1-alpha.4` | Legacy; supported |
20
- | `0.2.1-alpha.5` | Legacy; supported |
21
- | `0.2.1-rc.1` | Supported |
22
- | `0.2.1-rc.2` | Supported |
23
- | `0.2.1-rc.3` | Supported |
24
- | `0.2.1-rc.4` | Supported |
25
- | `0.2.1-rc.5` | Supported |
26
- | `0.2.2-alpha.3` | Supported |
27
- | `0.2.2-rc.1` | Recommended host (RC prerelease) |
16
+ | DSH release | Maintenance |
17
+ | --------------- | ------------------------------------ |
18
+ | `0.2.1-rc.1` | Supported; minimum supported release |
19
+ | `0.2.1-rc.2` | Supported |
20
+ | `0.2.1-rc.3` | Supported |
21
+ | `0.2.1-rc.4` | Supported |
22
+ | `0.2.1-rc.5` | Supported |
23
+ | `0.2.2-alpha.3` | Supported |
24
+ | `0.2.2-rc.1` | Supported |
25
+ | `0.2.2-rc.2` | Recommended host (RC prerelease) |
28
26
 
29
- Legacy versions remain supported until an explicit retirement release; see the [support policy](docs/support-policy.md). Newer versions may load after capability checks, but are outside these exact compatibility declarations.
27
+ `0.2.1-alpha.3`, `0.2.1-alpha.4` and `0.2.1-alpha.5` leave maintenance in `0.3.6`; their last supporting plugin is available `0.3.5`. Technical admission remains `>=0.2.1-alpha.3`, including prereleases without a new upper bound. Retired hosts may run with a warning after necessary checks; that is not a compatibility commitment. See the [support policy](docs/support-policy.md) for dates and migration, and the [bidirectional history](docs/support-history.md) for exact historical pairs. Dates never change installed plugin behavior, and unknown newer releases inherit no exact support.
30
28
 
31
- DSH `0.2.2-alpha.2` is retired in plugin `0.3.4` because fresh SDK resolution breaks native settings updates. Upgrade to `0.2.2-rc.1`; historical plugin `0.3.3` support does not repair that host dependency combination. See the [retirement exception](docs/support-policy.md#upstream-failure-exception).
29
+ DSH `0.2.2-alpha.2` retired in plugin `0.3.4` because fresh SDK resolution breaks native settings updates; an old plugin cannot repair that dependency combination. Migrate to the recommended host with a verified matching plugin; see the [retirement exception](docs/support-policy.md#upstream-failure-exception).
32
30
 
33
31
  ## Install
34
32
 
35
33
  ```sh
36
34
  dsh --version
37
- dsh plugin --profile web add dsh-auth-remote@0.3.5
35
+ dsh plugin --profile web add dsh-auth-remote@0.3.6
38
36
  dsh plugin --profile web list
39
37
  ```
40
38
 
41
- Use this npm command after the release workflow has published the version. For an offline installation, substitute the absolute path to the verified release archive. Published `dsh-auth-remote@0.3.3` retains its nine declared hosts. Use the same data directory and profile for installation, initialization, and the running service. These commands use DSH's default `~/.dsh` directory and the `web` profile. First rehearse upgrades in an independent profile, following the [backup and rollback procedure](docs/deployment.md#backup-recovery-and-changes).
39
+ Use this npm command after the release workflow has published the version. For an offline installation, substitute the absolute path to the verified release archive. Published `0.3.5` remains available for its historical ten hosts, including the three retired Alphas. Use the same data directory and profile for installation, initialization, and the running service. These commands use DSH's default `~/.dsh` directory and the `web` profile. First rehearse upgrades in an independent profile, following the [backup and rollback procedure](docs/deployment.md#backup-recovery-and-changes).
42
40
 
43
41
  ## Initialize the account
44
42
 
@@ -85,10 +83,12 @@ Mutating commands require interactive confirmation. If a submitted command loses
85
83
 
86
84
  Browser text supports English, Chinese, Japanese, Spanish, French, German, Russian, and Brazilian Portuguese. The embedded page follows DSH's language setting. The standalone login page uses the remembered DSH preference, then the browser language, then English; it has no language selector. CLI output is English.
87
85
 
88
- On DSH `0.2.2-alpha.3` and `0.2.2-rc.1`, the native navigation uses a shield for this page; the other eight declared hosts retain their default icon.
86
+ On DSH `0.2.2-alpha.3`, `0.2.2-rc.1` and `0.2.2-rc.2`, the native navigation uses a shield for this page; the other five declared hosts retain their default icon.
89
87
 
90
88
  ## Sign in to an official DeepSeek account
91
89
 
90
+ On `0.2.2-rc.2`, the adapter preserves the native account entry and notification children; older hosts retain public registration. Notifications use local protocol stand-ins; cross-product notification localization mapping is not fully verified.
91
+
92
92
  Remote DeepSeek account sign-in is enabled by default (`manualAccountLogin: true`):
93
93
 
94
94
  1. Choose **Sign in** in the account menu, then **Open sign-in page** in the instruction dialog.
package/README.zh-CN.md CHANGED
@@ -6,39 +6,37 @@ DeepSeek Harness(DSH)的单用户远程登录插件,提供密码、TOTP、
6
6
 
7
7
  ## 前置条件
8
8
 
9
- - Linux(含 `/proc`)和 Node.js 24。DSH `0.2.2-rc.1` 要求 Node.js `>=24.9.0`。
9
+ - Linux(含 `/proc`)和 Node.js 24。DSH `0.2.2-rc.2` 要求 Node.js `>=24.9.0`。
10
10
  - 一个受支持的 DSH 版本和 `web` profile。一个账号及其会话属于该 profile。
11
11
 
12
12
  ## DSH 兼容性
13
13
 
14
- 版本 **`0.3.5`** 正在准备发布,声明以下十个精确 DSH 版本;**`0.2.2-rc.1`** 为开发默认和推荐宿主,是上游 RC 预发布版本。实际可用性以发布工作流和 npm registry 为准。已发布 `0.3.4` 保留其九版声明,包含 `0.2.2-alpha.3`,不追溯增加 RC。
14
+ 源码候选 **`0.3.6`** 声明以下八个精确 DSH 版本;**`0.2.2-rc.2`** 是开发默认和推荐迁移宿主,仍是上游 RC 预发布。候选尚未发布,最终同包验收及 PR/master/tag 门禁须完成后发布;声明不等于实测或分发。已发布 `0.3.5` 保留原十版声明和原归档。
15
15
 
16
- | DSH 版本 | 维护状态 |
17
- | --------------- | --------------------- |
18
- | `0.2.1-alpha.3` | Legacy;支持中 |
19
- | `0.2.1-alpha.4` | Legacy;支持中 |
20
- | `0.2.1-alpha.5` | Legacy;支持中 |
21
- | `0.2.1-rc.1` | 支持中 |
22
- | `0.2.1-rc.2` | 支持中 |
23
- | `0.2.1-rc.3` | 支持中 |
24
- | `0.2.1-rc.4` | 支持中 |
25
- | `0.2.1-rc.5` | 支持中 |
26
- | `0.2.2-alpha.3` | 受支持 |
27
- | `0.2.2-rc.1` | 推荐宿主(RC 预发布) |
16
+ | DSH 版本 | 维护状态 |
17
+ | --------------- | ---------------------- |
18
+ | `0.2.1-rc.1` | 支持中;最低受支持版本 |
19
+ | `0.2.1-rc.2` | 支持中 |
20
+ | `0.2.1-rc.3` | 支持中 |
21
+ | `0.2.1-rc.4` | 支持中 |
22
+ | `0.2.1-rc.5` | 支持中 |
23
+ | `0.2.2-alpha.3` | 支持中 |
24
+ | `0.2.2-rc.1` | 支持中 |
25
+ | `0.2.2-rc.2` | 推荐宿主(RC 预发布) |
28
26
 
29
- Legacy 版本在明确发布退役版本前继续支持,详见[支持规范](docs/support-policy.zh-CN.md)。更新版本可通过能力检查后加载,但不在上述精确兼容声明内。
27
+ `0.2.1-alpha.3`、`0.2.1-alpha.4`、`0.2.1-alpha.5` 在 `0.3.6` 撤回维护承诺,最后支持插件为可获取的 `0.3.5`。技术准入仍为 `>=0.2.1-alpha.3`,包含预发布、无新增上限;通过必要检查的退役宿主可带告警运行,这不构成兼容承诺。退役日期及迁移方法见[支持规范](docs/support-policy.zh-CN.md),历史精确组合见[双向支持历史](docs/support-history.zh-CN.md)。日期不会改变已安装插件行为,未知新版本也不继承精确支持。
30
28
 
31
- 插件 `0.3.4` 因新解析 SDK 导致原生设置更新失败,已退役 DSH `0.2.2-alpha.2`。请升级至 `0.2.2-rc.1`;插件 `0.3.3` 的历史支持声明不能修复该宿主依赖组合。详见[退役例外](docs/support-policy.zh-CN.md#upstream-failure-exception)。
29
+ DSH `0.2.2-alpha.2` 在插件 `0.3.4` 因新解析 SDK 导致原生设置更新失败而退役;旧插件不能修复该依赖组合。迁移至推荐宿主和已验证的匹配插件,详见[退役例外](docs/support-policy.zh-CN.md#upstream-failure-exception)。
32
30
 
33
31
  ## 安装
34
32
 
35
33
  ```sh
36
34
  dsh --version
37
- dsh plugin --profile web add dsh-auth-remote@0.3.5
35
+ dsh plugin --profile web add dsh-auth-remote@0.3.6
38
36
  dsh plugin --profile web list
39
37
  ```
40
38
 
41
- 发布工作流成功发布该版本后使用此 npm 命令;离线安装时替换为已验证发布归档的绝对路径。已发布 `dsh-auth-remote@0.3.3` 保留其九版宿主声明。安装、初始化和运行服务须使用相同的数据目录及 profile。这些命令使用 DSH 默认的 `~/.dsh` 目录和 `web` profile。升级前先在独立 profile 演练,按[备份与回滚步骤](docs/deployment.zh-CN.md#备份恢复与变更)操作。
39
+ 发布工作流成功发布该版本后使用此 npm 命令;离线安装时替换为已验证发布归档的绝对路径。已发布 `0.3.5` 仍可获取,保留含三个退役 Alpha 的十版历史声明。安装、初始化和运行服务须使用相同的数据目录及 profile。这些命令使用 DSH 默认的 `~/.dsh` 目录和 `web` profile。升级前先在独立 profile 演练,按[备份与回滚步骤](docs/deployment.zh-CN.md#备份恢复与变更)操作。
42
40
 
43
41
  ## 初始化账号
44
42
 
@@ -85,10 +83,12 @@ dsh plugin --profile web exec dsh-auth-remote revoke-sessions
85
83
 
86
84
  浏览器文案支持英、中、日、西、法、德、俄和巴西葡萄牙语。内嵌页面跟随 DSH 语言设置;独立登录页依次使用已记住的 DSH 偏好、浏览器语言、英文,不提供语言选择器。CLI 文案固定英语。
87
85
 
88
- DSH `0.2.2-alpha.3`、`0.2.2-rc.1` 的原生导航为此页显示盾牌;其余八个声明宿主保留默认图标。
86
+ DSH `0.2.2-alpha.3`、`0.2.2-rc.1`、`0.2.2-rc.2` 的原生导航为此页显示盾牌;其余五个声明宿主保留默认图标。
89
87
 
90
88
  ## 登录 DeepSeek 官方账号
91
89
 
90
+ 在 `0.2.2-rc.2`,适配保留原生账号入口和通知子槽;旧宿主沿用原公开注册路径。通知以本地协议替身验证,跨产品通知本地化映射未完全验证。
91
+
92
92
  远程 DeepSeek 账号登录默认开启(`manualAccountLogin: true`):
93
93
 
94
94
  1. 在账号菜单中选择“登录”,再点击步骤说明弹窗中的“打开登录页”。
package/dist/client.js CHANGED
@@ -6467,6 +6467,39 @@ function ManualSignInDialog({
6467
6467
  );
6468
6468
  }
6469
6469
 
6470
+ // src/client/account/native-entry.ts
6471
+ function decorateNativeAccountEntry(entry, wrapper, slots, deactivate) {
6472
+ const property = Object.getOwnPropertyDescriptor(entry, "component");
6473
+ if (!property?.writable || typeof entry.component !== "function" || typeof wrapper !== "function" || !entry.children || typeof entry.children !== "object" || Array.isArray(entry.children) || !entry.options || typeof entry.options !== "object" || typeof entry.inject !== "function" || typeof slots.provideRoot !== "function")
6474
+ throw new Error("auth-remote: native account entry cannot preserve child ownership");
6475
+ const native = entry.component;
6476
+ let release;
6477
+ let active = true;
6478
+ const dispose = () => {
6479
+ if (!active) return;
6480
+ active = false;
6481
+ try {
6482
+ deactivate();
6483
+ } finally {
6484
+ try {
6485
+ if (entry.component === wrapper) entry.component = native;
6486
+ } finally {
6487
+ release?.();
6488
+ }
6489
+ }
6490
+ };
6491
+ try {
6492
+ entry.component = wrapper;
6493
+ const redraw = slots.provideRoot({ props: { authRemoteAccountDecoration: true } });
6494
+ if (typeof redraw !== "function") throw new Error("auth-remote: account redraw is unavailable");
6495
+ release = redraw;
6496
+ } catch (error) {
6497
+ dispose();
6498
+ throw error;
6499
+ }
6500
+ return dispose;
6501
+ }
6502
+
6470
6503
  // src/client/account/index.tsx
6471
6504
  var import_jsx_runtime8 = require("react/jsx-runtime");
6472
6505
  function hasManualAccountClient(ctx, requireEntry = true) {
@@ -6558,15 +6591,38 @@ function installManualAccountLogin(ctx) {
6558
6591
  let unregister;
6559
6592
  const update = () => {
6560
6593
  const native = slots.entries(name2).find(
6561
- (entry) => entry.locale === "settings.account" && entry.inject !== void 0 && !wrappers.has(entry.component)
6594
+ (entry) => entry.locale === "settings.account" && entry.inject !== void 0 && (entry === current || !wrappers.has(entry.component))
6562
6595
  );
6563
6596
  if (native === current) return;
6564
6597
  current = native;
6565
- unregister?.();
6598
+ const releasePrevious = unregister;
6566
6599
  unregister = void 0;
6600
+ try {
6601
+ releasePrevious?.();
6602
+ } catch (error) {
6603
+ current = void 0;
6604
+ throw error;
6605
+ }
6567
6606
  if (!native) return;
6568
6607
  const Native = native.component;
6569
- function ManualAccountEntry(props) {
6608
+ let active = true;
6609
+ let ownedDialog;
6610
+ const showOwned = (owner) => {
6611
+ if (!active) return;
6612
+ if (ownedDialog?.complete) completions.delete(ownedDialog.complete);
6613
+ ownedDialog = owner;
6614
+ show(owner);
6615
+ };
6616
+ const deactivate = () => {
6617
+ active = false;
6618
+ if (ownedDialog?.complete) completions.delete(ownedDialog.complete);
6619
+ if (dialog && dialog === ownedDialog) {
6620
+ dialog = void 0;
6621
+ notify();
6622
+ }
6623
+ ownedDialog = void 0;
6624
+ };
6625
+ function ActiveManualAccountEntry(props) {
6570
6626
  const latest = (0, import_react6.useRef)(props);
6571
6627
  latest.current = props;
6572
6628
  const enabled = (0, import_react6.useSyncExternalStore)(subscribePreference, preference);
@@ -6577,6 +6633,7 @@ function installManualAccountLogin(ctx) {
6577
6633
  (0, import_react6.useEffect)(() => {
6578
6634
  if (name2 !== "settings.launcher" && manualOnboarding === true) {
6579
6635
  const complete = () => {
6636
+ if (!active) return;
6580
6637
  latest.current.showLogin?.(false);
6581
6638
  latest.current.complete?.();
6582
6639
  };
@@ -6584,13 +6641,15 @@ function installManualAccountLogin(ctx) {
6584
6641
  complete,
6585
6642
  ...latest.current.useApiKey ? {
6586
6643
  useApiKey: () => {
6644
+ if (!active) return;
6587
6645
  latest.current.showLogin?.(false);
6588
6646
  latest.current.useApiKey?.();
6589
6647
  }
6590
6648
  } : {}
6591
6649
  };
6592
- show(owner);
6650
+ showOwned(owner);
6593
6651
  return () => {
6652
+ if (ownedDialog === owner) ownedDialog = void 0;
6594
6653
  completions.delete(complete);
6595
6654
  if (dialog === owner && owner.useApiKey) {
6596
6655
  dialog = {};
@@ -6602,13 +6661,16 @@ function installManualAccountLogin(ctx) {
6602
6661
  return name2 === "settings.launcher" ? (0, import_react6.createElement)(Native, {
6603
6662
  ...props,
6604
6663
  start: async () => {
6664
+ if (!active) return;
6605
6665
  if (preference() === void 0) await mirror?.ensure();
6666
+ if (!active) return;
6606
6667
  const manual = preference();
6607
6668
  if (manual === void 0) return;
6608
6669
  if (!manual) return latest.current.start?.();
6609
- show(
6670
+ showOwned(
6610
6671
  latest.current.openOnboarding ? {
6611
6672
  useApiKey: () => {
6673
+ if (!active) return;
6612
6674
  latest.current.showLogin?.(false);
6613
6675
  latest.current.openOnboarding?.("deepseek-official");
6614
6676
  }
@@ -6617,20 +6679,48 @@ function installManualAccountLogin(ctx) {
6617
6679
  }
6618
6680
  }) : manualOnboarding === false ? (0, import_react6.createElement)(Native, props) : null;
6619
6681
  }
6682
+ function ManualAccountEntry(props) {
6683
+ return active ? (0, import_react6.createElement)(ActiveManualAccountEntry, props) : (0, import_react6.createElement)(Native, props);
6684
+ }
6620
6685
  wrappers.add(ManualAccountEntry);
6621
- unregister = slots.register(
6622
- {
6623
- name: name2,
6624
- priority: (native.options.priority ?? 0) - 100,
6625
- // Framework still binds the native menu's translations and Hooks.
6626
- ...native.locale ? { locale: native.locale } : {},
6627
- inject: native.inject
6628
- },
6629
- ManualAccountEntry
6630
- );
6686
+ try {
6687
+ if (native.children) {
6688
+ unregister = decorateNativeAccountEntry(
6689
+ native,
6690
+ ManualAccountEntry,
6691
+ activeSlots,
6692
+ deactivate
6693
+ );
6694
+ } else {
6695
+ const release = slots.register(
6696
+ {
6697
+ name: name2,
6698
+ priority: (native.options.priority ?? 0) - 100,
6699
+ // Framework still binds the native menu's translations and Hooks.
6700
+ ...native.locale ? { locale: native.locale } : {},
6701
+ inject: native.inject
6702
+ },
6703
+ ManualAccountEntry
6704
+ );
6705
+ unregister = () => {
6706
+ deactivate();
6707
+ release();
6708
+ };
6709
+ }
6710
+ } catch (error) {
6711
+ current = void 0;
6712
+ deactivate();
6713
+ throw error;
6714
+ }
6631
6715
  };
6632
6716
  const stop = slots.subscribe(name2, update);
6633
- update();
6717
+ try {
6718
+ update();
6719
+ } catch (error) {
6720
+ stop();
6721
+ unregister?.();
6722
+ throw error;
6723
+ }
6634
6724
  return () => {
6635
6725
  stop();
6636
6726
  unregister?.();