dsh-github-copilot 0.4.0-alpha.113 → 0.4.0-alpha.114

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
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0-alpha.114 (prepared)
4
+
5
+ - Simplify the Chat account menu to configured accounts only. Move Follow global default into a separate checkbox and keep account addition in Models (#328).
6
+ - Freeze the current effective account when following is disabled; restore inheritance when enabled. Explicit account choices, including the current default, remain Session overrides.
7
+ - Preserve continuation consent, cancellation, revision-checked saving, running-turn ownership and quota isolation; restore focus after controls become enabled. Record the approved interactive mock and localized experience.
8
+ - No Core changes, automatic sends, installation or restart.
9
+
3
10
  ## 0.4.0-alpha.113 (prepared)
4
11
 
5
12
  - Remove the continuation filter's whole-request 16 MiB refusal and recursive payload traversal. Large ordinary tool/image content is preserved; old encrypted reasoning is processed independently (#326).
package/README.md CHANGED
@@ -23,7 +23,7 @@ Visible Models and Credits resolve missing names for saved accounts without acti
23
23
 
24
24
  Adding an account now keeps the device-authorization link, selectable URL, one-time code, Copy code action and Cancel together while authorization is pending. After GitHub authorizes, identity and model verification are shown as a separate phase. Adding never changes the global default; use the existing explicit **Switch** action when ready. Technical diagnostics are secondary, and account/turn identity fallbacks never expose opaque account IDs or infer historical identity from today's settings.
25
25
 
26
- **Source candidate: `0.4.0-alpha.113` (unreleased). Supported host: official DSH / Windows Desktop `0.2.0-rc.2`.** Earlier DSH pins are historical evidence, not supported installation targets. Publication, profile installation and the version loaded by a running Host are separate states. The versioned commands below are for this candidate after publication, not evidence that its assets exist.
26
+ **Source candidate: `0.4.0-alpha.114` (unreleased). Supported host: official DSH / Windows Desktop `0.2.0-rc.2`.** Earlier DSH pins are historical evidence, not supported installation targets. Publication, profile installation and the version loaded by a running Host are separate states. The versioned commands below are for this candidate after publication, not evidence that its assets exist.
27
27
 
28
28
  ## What you can do
29
29
 
@@ -63,10 +63,10 @@ Supply any launcher patches with repeated `--patch /absolute/file`. Require `sup
63
63
  For a **standalone named profile**:
64
64
 
65
65
  ```sh
66
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.113/dsh-github-copilot-0.4.0-alpha.113.tgz
66
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.114/dsh-github-copilot-0.4.0-alpha.114.tgz
67
67
  ```
68
68
 
69
- For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.113` after publication. Official rc.2's **Desktop-bundled CLI** also supports reserved-profile plugin management; a global/generic `dsh` shim is not equivalent. Qualify the installed entry before use. See [Desktop CLI qualification](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2) and the distinct [standalone offline procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles). Neither path authorizes registry-policy bypass, peer patches or configuration deletion.
69
+ For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.114` after publication. Official rc.2's **Desktop-bundled CLI** also supports reserved-profile plugin management; a global/generic `dsh` shim is not equivalent. Qualify the installed entry before use. See [Desktop CLI qualification](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2) and the distinct [standalone offline procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles). Neither path authorizes registry-policy bypass, peer patches or configuration deletion.
70
70
 
71
71
  After an approved reload/restart:
72
72
 
@@ -176,7 +176,7 @@ Configuration is under `github-copilot`. Credentials, endpoint definitions and a
176
176
  | AUTH, Responses replay-scope or TLS failure | Review [request diagnostics](./docs/model-compatibility-acceptance.md#authentication-replay-and-request-diagnostics) and [usage TLS boundaries](./docs/copilot-usage.md#account-data-boundary). After an exact scope rejection, **Replay recovery** shows the same persistent Session continuation policy: when off, disclose loss and offer **Enable visible-history continuation** or Cancel; when already on, show diagnostic guidance without repeated authorization. No duration or next-turn-only choice. Evidence expiry does not disable the policy. Use native Retry separately; no automatic send/retry or history rewrite, and not a 408 fix. Never reset credentials or disable TLS as an automatic repair. |
177
177
  | Hosted search unavailable | Check account/protocol/probe diagnostics; a legacy override stays authoritative until explicitly reset |
178
178
 
179
- The Credits account panel shows the current account and **Switch**; Models has one **Manage** disclosure for account management and shared model preferences. Both use a compact dropdown without account search: the current choice is checked, long lists scroll internally, and Add sits at the bottom without selecting the new account. Models retains guarded local removal and reauthorization in a separate management disclosure. Exact-ID exclusions are shared across accounts; availability is account-specific. See the [approved experience and interactive mock](./docs/account-management-experience.md).
179
+ The Credits account panel shows the current account and **Switch**. Its dropdown lists only configured accounts, marks the effective account and scrolls long lists internally. **Follow global default** is a separate checkbox: enabling it clears the Session override; disabling it fixes the current account. Choosing any account also fixes it, even if it is today's default. Both actions retain continuation confirmation and revision-checked saving. Account addition belongs only in Models, where one **Manage** disclosure contains account management and shared model preferences. Models retains Add in its dropdown footer without selecting the new account, plus guarded local removal and reauthorization. Neither surface has account search. Exact-ID exclusions are shared across accounts; availability is account-specific. See the [approved experience and interactive mock](./docs/account-management-experience.md).
180
180
 
181
181
  [Visible-history continuation](./docs/session-continuation.md) is configured beside account switching, not permanently above the composer. New unseeded Sessions default on after the feature's first successful activation; existing Sessions and inherited histories remain off unless explicitly authorized. Global defaults affect new Sessions only; Session on/off overrides persist across accounts/restarts until disabled. With continuation off, a different-account switch offers persistent enable, keep off or cancel, without a one-turn mode. Each new enabled turn omits prior encrypted reasoning and embedded summaries, even on the same account; current-turn reasoning, visible messages, tools and disk history remain unchanged. Authorization never auto-sends/retries and is not a quota/context cure. Exact replay failures expose the same policy and require a separate native retry. The pinned Core lacks a public Models deep link; Chat omits the nonfunctional management entry. Full management remains in Settings → Models → GitHub Copilot → Manage.
182
182
 
@@ -220,14 +220,14 @@ Commit attribution uses `Assisted-by` with the actual tool, never the model prov
220
220
  GitHub Releases and npm distribute the same original verified tarball. Pin a version; verify Release SHA-256 or npm `dist.integrity`. Never repack an immutable release or move/reuse its tag.
221
221
 
222
222
  ```sh
223
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.113/dsh-github-copilot-0.4.0-alpha.113.tgz
224
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.113/SHA256SUMS
223
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.114/dsh-github-copilot-0.4.0-alpha.114.tgz
224
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.114/SHA256SUMS
225
225
  sha256sum --check SHA256SUMS
226
226
  ```
227
227
 
228
228
  ```powershell
229
229
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
230
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.113.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
230
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.114.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
231
231
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
232
232
  ```
233
233
 
package/README.zh.md CHANGED
@@ -21,7 +21,7 @@ Models 和 Chat 共用不透明、随主题适配的账号下拉层;原生菜
21
21
 
22
22
  添加账号时,设备授权链接、可选择的网址、一次性授权码、复制授权码和取消操作会同时显示。GitHub 授权完成后,会单独显示身份与可用模型验证阶段。添加账号不会更改全局默认;准备好后仍需显式执行现有的**切换**操作。技术诊断收在次级折叠区;账号/历史 turn 缺少身份时不会暴露不透明账号 ID,也不会根据当前设置推断历史身份。
23
23
 
24
- **源码候选版本:`0.4.0-alpha.113`(尚未发布)。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。** 较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。下方带版本的命令适用于候选版本发布后,不代表对应资产已经存在。
24
+ **源码候选版本:`0.4.0-alpha.114`(尚未发布)。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。** 较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。下方带版本的命令适用于候选版本发布后,不代表对应资产已经存在。
25
25
 
26
26
  ## 你可以做什么
27
27
 
@@ -61,10 +61,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
61
61
  **独立具名 profile**:
62
62
 
63
63
  ```sh
64
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.113/dsh-github-copilot-0.4.0-alpha.113.tgz
64
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.114/dsh-github-copilot-0.4.0-alpha.114.tgz
65
65
  ```
66
66
 
67
- **Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.113`。官方 rc.2 **Desktop 随附的专属 CLI**也支持管理保留 profile;全局/普通 `dsh` shim 不等价。使用前核验实际安装入口,参见[Desktop CLI 核验](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2)及独立的[具名 profile 离线流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)。两种路径都不授权绕过包源政策、修改 peer 或删除配置。
67
+ **Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.114`。官方 rc.2 **Desktop 随附的专属 CLI**也支持管理保留 profile;全局/普通 `dsh` shim 不等价。使用前核验实际安装入口,参见[Desktop CLI 核验](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2)及独立的[具名 profile 离线流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)。两种路径都不授权绕过包源政策、修改 peer 或删除配置。
68
68
 
69
69
  经批准 reload/restart 后:
70
70
 
@@ -174,7 +174,7 @@ HTTP/SSE liveness 默认区分 5 分钟字节 idle 和有界的 10 分钟助手
174
174
  | AUTH、Responses replay scope 或 TLS 错误 | 查看[请求诊断](./docs/model-compatibility-acceptance.md#authentication-replay-and-request-diagnostics)及[额度 TLS 边界](./docs/copilot-usage.md#account-data-boundary)。精确 scope 拒绝后,**回放恢复**使用同一个持久 Session 降级续聊策略:关闭时说明损失并提供**开启降级续聊**/取消,已开启时只显示诊断,不重复授权。不再选择授权范围或仅下一轮;失败证据过期不会关闭策略。需另行使用原生重试,不自动发送/重试、不改磁盘历史,也不是 408 修复。不自动重置凭据或关闭 TLS。 |
175
175
  | Hosted search 不可用 | 检查账号/协议/probe 诊断;旧 override 保留至显式 reset |
176
176
 
177
- Credits 账号面板只显示当前账号和 **切换**;Models 用一个 **管理** 展开账号管理与共享模型偏好。两处统一使用无账号搜索框的紧凑 dropdown:当前项打勾,长列表内部滚动,底部添加账号但不自动选中。Models 的独立管理 disclosure 保留重新授权与受保护的本地账号移除。按精确模型 ID 共享排除偏好,可用性仍按账号验证。参见[已确认体验与交互 mock](./docs/account-management-experience.md)。
177
+ Credits 账号面板显示当前账号和 **切换**,下拉菜单只列已有账号,为当前实际账号打勾,长列表内部滚动。**跟随全局默认**是独立复选框:开启时清除本会话指定,关闭时固定当前账号;手动选择账号也会固定,即使所选恰好是当前全局默认。两种操作均保持续聊确认和 revision 校验保存。添加账号只留在 Models,其 **管理** 展开账号管理与共享模型偏好,菜单底部添加账号但不自动选中,并保留重新授权与受保护的本地账号移除。两处都没有账号搜索框。按精确模型 ID 共享排除偏好,可用性仍按账号验证。参见[已确认体验与交互 mock](./docs/account-management-experience.md)。
178
178
 
179
179
  [可见历史续聊模式](./docs/session-continuation.md)放在账号切换旁,不再常驻输入框上方。功能首次成功激活后创建的非继承 Session 默认开启;已有 Session、继承历史仍需明确授权。全局默认只影响新 Session,Session 开关跨账号及重启保留,直到关闭。关闭时切换到不同账号,提供持续开启、保持关闭或取消,不再提供仅下一轮模式。启用后的每个新 turn 省略旧加密推理及其内嵌摘要,同账号也适用;当前轮新推理、可见消息、工具记录和磁盘历史不变。授权不自动发送或重试,不解决额度或上下文超限。精确回放失败使用同一个持久策略,用户另行点击原生重试。当前 Core 没有公开 Models 直达 API,Chat 不展示不可用的管理入口;完整管理仍在设置 → 模型 → GitHub Copilot → 管理。
180
180
 
@@ -218,14 +218,14 @@ Agent 从 `node scripts/agent.mjs describe --json`、`doctor --json`及`plan <ta
218
218
  GitHub Releases 和 npm 分发同一原始已校验 tarball。固定版本并核验 Release SHA-256 或 npm `dist.integrity`;不重打包不可变 Release、不移动/复用 tag。
219
219
 
220
220
  ```sh
221
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.113/dsh-github-copilot-0.4.0-alpha.113.tgz
222
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.113/SHA256SUMS
221
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.114/dsh-github-copilot-0.4.0-alpha.114.tgz
222
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.114/SHA256SUMS
223
223
  sha256sum --check SHA256SUMS
224
224
  ```
225
225
 
226
226
  ```powershell
227
227
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
228
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.113.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
228
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.114.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
229
229
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
230
230
  ```
231
231
 
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "package": {
10
10
  "name": "dsh-github-copilot",
11
- "version": "0.4.0-alpha.113"
11
+ "version": "0.4.0-alpha.114"
12
12
  },
13
13
  "evidence": {
14
14
  "kind": "source-and-synthetic-test-inventory",
@@ -329,6 +329,9 @@
329
329
  {"file": "tests/account-dropdown.spec.ts", "name": "backs translucent native menu tokens with opaque Canvas and uses a dark elevation shadow"},
330
330
  {"file": "tests/copilot-account-identity-cache.spec.ts", "name": "retains inactive verified names after freshness expiry without reads or network in status"},
331
331
  {"file": "tests/copilot-usage-card.spec.ts", "name": "settles quota before a slow identity renewal and uses nonforcing ensure on visible refresh cadence"},
332
+ {"file": "tests/copilot-usage-card.spec.ts", "name": "freezes the effective account when following is unchecked and restores following through the same CAS"},
333
+ {"file": "tests/copilot-usage-card.spec.ts", "name": "retains confirmed following when consent is cancelled and disables it during confirmation"},
334
+ {"file": "tests/copilot-usage-card.spec.ts", "name": "disables following when the Session selection cannot be read instead of treating it as a fixed account"},
332
335
  {"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "never writes a captured A refresh into B after an external selection change"},
333
336
  {"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "preserves uncertain commit ahead of missing-slot recovery"},
334
337
  {"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "rechecks externally started canonical authorization before selector CAS"},
@@ -1,6 +1,9 @@
1
1
  # Copilot account management and continuation experience
2
2
 
3
3
  Approved account switching reference: [dropdown mock](./mockups/copilot-account-dropdown.html).
4
+ The [Chat account selection mock](./mockups/copilot-chat-account-selection.html)
5
+ supersedes its Chat menu: only configured accounts appear in the list, with
6
+ following controlled separately.
4
7
  The [complete continuation mock](./mockups/copilot-account-management.html) retains
5
8
  the earlier search-form presentation as historical context; the dropdown replaces it.
6
9
  Open the HTML locally; append `?scenario=off-switch` to start with continuation
@@ -12,11 +15,18 @@ It performs no network requests and persists no credentials or settings.
12
15
 
13
16
  The Credits control opens a compact current-account summary and Switch button.
14
17
  Do not render all saved accounts until Switch is opened. A compact anchored dropdown
15
- marks the current choice, supports bounded internal scrolling, following the global
16
- account and adding an account. Do not add an account search field or repeat Switch
18
+ marks the effective current account and supports bounded internal scrolling.
19
+ List every configured account, not a hard-coded two-account limit. A separate
20
+ **Follow global default** checkbox clears the Session override when enabled;
21
+ disabling it freezes the currently effective account. Choosing any account,
22
+ including today's default, disables following and creates an explicit override.
23
+ Both paths use the same continuation confirmation, revision readback and CAS,
24
+ and remain disabled while selection is unknown, confirming or saving. Cancelled
25
+ confirmation retains the confirmed checkbox state; failed writes show uncertainty.
26
+ Add accounts only in Models, never in the Chat dropdown. Do not add an account search field or repeat Switch
17
27
  buttons per row. Escape closes only the dropdown and restores its trigger; arrows,
18
28
  Home and End navigate enabled options. Outside interaction dismisses the list.
19
- Adding an account does not select it. Quota is account billing-cycle data, not
29
+ Adding an account in Models does not select it. Quota is account billing-cycle data, not
20
30
  context occupancy or Session cost; missing and pooled data retain their semantics.
21
31
 
22
32
  Selection applies to subsequent turns of the viewed Session. An active turn
package/lib/client.js CHANGED
@@ -8745,13 +8745,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8745
8745
  }
8746
8746
  //#endregion
8747
8747
  //#region lib/types/copilot-accounts-card.js
8748
- function CopilotAccountAdd(props) {
8749
- return (0, react.createElement)(CopilotAccountControls, {
8750
- ...props,
8751
- addOnly: true,
8752
- expanded: true
8753
- });
8754
- }
8755
8748
  /** Copy owned presentation fields before decoding traced Client values. */
8756
8749
  function accountsViewFrom(value) {
8757
8750
  const record = (input) => {
@@ -9396,6 +9389,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9396
9389
  switchAccount: "Switch account",
9397
9390
  followGlobal: "Follow global default",
9398
9391
  sessionSpecified: "Session override",
9392
+ sessionAccount: "Session account",
9393
+ followHint: "Choosing an account fixes it for this Session. Enable following to use the global default again.",
9399
9394
  switchScope: "Applies to this Session’s subsequent turns. Running turns and other Sessions are unchanged.",
9400
9395
  accountSaveFailed: "Could not save the Session account. Refresh and try again.",
9401
9396
  accountLoading: "Loading account selection…",
@@ -9445,6 +9440,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9445
9440
  switchAccount: "切换账号",
9446
9441
  followGlobal: "跟随全局默认",
9447
9442
  sessionSpecified: "Session 已指定",
9443
+ sessionAccount: "本会话账号",
9444
+ followHint: "选择账号后固定用于本会话。重新开启跟随可恢复使用全局默认。",
9448
9445
  switchScope: "用于本 Session 后续 turn,不影响正在运行的 turn 或其他 Session。",
9449
9446
  accountSaveFailed: "无法保存 Session 账号,请刷新后重试。",
9450
9447
  accountLoading: "正在读取账号选择…",
@@ -9520,6 +9517,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9520
9517
  const [busy, setBusy] = (0, react.useState)(false);
9521
9518
  const [failed, setFailed] = (0, react.useState)(false);
9522
9519
  const [open, setOpen] = (0, react.useState)(false);
9520
+ const [restoreAccountFocus, setRestoreAccountFocus] = (0, react.useState)();
9523
9521
  const [position, setPosition] = (0, react.useState)({
9524
9522
  left: 12,
9525
9523
  bottom: 12
@@ -9528,6 +9526,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9528
9526
  const panel = (0, react.useRef)(null);
9529
9527
  const closeButton = (0, react.useRef)(null);
9530
9528
  const switchButton = (0, react.useRef)(null);
9529
+ const followCheckbox = (0, react.useRef)(null);
9531
9530
  const lifecycle = (0, react.useRef)({
9532
9531
  active: false,
9533
9532
  generation: 0,
@@ -9545,6 +9544,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9545
9544
  owner.controller?.abort();
9546
9545
  owner.controller = void 0;
9547
9546
  setOpen(false);
9547
+ setRestoreAccountFocus(void 0);
9548
9548
  setChoosingAccount(false);
9549
9549
  if (restore) trigger.current?.focus();
9550
9550
  }, []);
@@ -9662,7 +9662,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9662
9662
  unsubscribe();
9663
9663
  };
9664
9664
  }, [load, props.remote]);
9665
- const chooseAccount = async (accountId) => {
9665
+ const chooseAccount = async (accountId, focus = "switch") => {
9666
9666
  const owner = lifecycle.current;
9667
9667
  let revision = sessionAccount?.accounts.revision;
9668
9668
  if (!owner.active || owner.save !== void 0 || props.sessionAccount === void 0 || revision === void 0) return;
@@ -9716,7 +9716,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9716
9716
  owner.save = void 0;
9717
9717
  setSavingAccount(false);
9718
9718
  await load(false);
9719
- if (owner.active && owner.generation === generation + 1) switchButton.current?.focus();
9719
+ if (owner.active && owner.generation === generation + 1) setRestoreAccountFocus(focus);
9720
9720
  } catch {
9721
9721
  if (owner.active && owner.generation === generation) {
9722
9722
  setAccountSaveFailed(true);
@@ -9734,6 +9734,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9734
9734
  }
9735
9735
  }
9736
9736
  };
9737
+ (0, react.useLayoutEffect)(() => {
9738
+ if (!open || busy || savingAccount || restoreAccountFocus === void 0) return;
9739
+ if (restoreAccountFocus === "follow") followCheckbox.current?.focus();
9740
+ else switchButton.current?.focus();
9741
+ setRestoreAccountFocus(void 0);
9742
+ }, [
9743
+ open,
9744
+ busy,
9745
+ savingAccount,
9746
+ restoreAccountFocus
9747
+ ]);
9737
9748
  (0, react.useLayoutEffect)(() => {
9738
9749
  if (!open) return;
9739
9750
  panel.current?.showPopover?.();
@@ -9811,14 +9822,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9811
9822
  ...sessionAccount.accounts,
9812
9823
  activeAccountId: sessionAccount.runningAccountId
9813
9824
  });
9814
- const accountOptions = open && choosingAccount && sessionAccount ? [{
9815
- id: null,
9816
- label: t.followGlobal,
9817
- selected: sessionAccount.source === "global"
9818
- }, ...sessionAccount.accounts.accounts.filter((account) => account.configured).map((account) => ({
9825
+ const accountOptions = open && choosingAccount && sessionAccount ? [...sessionAccount.accounts.accounts.filter((account) => account.configured).map((account) => ({
9819
9826
  id: account.id,
9820
9827
  label: account.identity ? `@${account.identity.login}` : account.id === "canonical" ? `${t.originalAuthorization} · ${t.identityUnknown}` : `${t.savedAuthorization}${numberedUnknownAccounts.has(account.id) ? ` ${numberedUnknownAccounts.get(account.id)}` : ""} · ${t.identityUnknown}`,
9821
- selected: sessionAccount.source === "session" && sessionAccount.accountId === account.id
9828
+ selected: sessionAccount.accountId === account.id
9822
9829
  }))] : [];
9823
9830
  return (0, react.createElement)("span", { style: {
9824
9831
  display: "inline-flex",
@@ -9906,7 +9913,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9906
9913
  onClick: () => {
9907
9914
  close(true);
9908
9915
  }
9909
- }, "×")), props.sessionAccount === void 0 ? null : (0, react.createElement)("div", { style: separator }, (0, react.createElement)("div", { style: row }, (0, react.createElement)("p", { style: muted }, t.switchScope), (0, react.createElement)(AccountDropdown, {
9916
+ }, "×")), props.sessionAccount === void 0 ? null : (0, react.createElement)("div", { style: separator }, (0, react.createElement)("div", { style: row }, (0, react.createElement)("div", null, (0, react.createElement)("strong", null, t.sessionAccount), (0, react.createElement)("p", { style: muted }, currentIdentity)), (0, react.createElement)(AccountDropdown, {
9910
9917
  triggerRef: switchButton,
9911
9918
  triggerStyle: {
9912
9919
  ...button,
@@ -9921,16 +9928,30 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9921
9928
  if (!next) collapseAccounts();
9922
9929
  else setChoosingAccount(true);
9923
9930
  },
9924
- options: accountOptions.map((option) => ({
9925
- ...option,
9926
- id: option.id ?? "follow-global"
9927
- })),
9931
+ options: accountOptions,
9928
9932
  onSelect: (accountId) => {
9929
- chooseAccount(accountId === "follow-global" ? null : accountId);
9933
+ chooseAccount(accountId);
9930
9934
  },
9931
- listAttribute: "data-copilot-account-options",
9932
- footer: props.accountActions
9933
- })), sessionAccount?.runningAccountId === void 0 ? null : (0, react.createElement)("p", { style: muted }, `${t.runningAccount}: ${runningIdentity ?? t.identityUnknown} · ${t.nextAccount}: ${currentIdentity}`), savingAccount ? (0, react.createElement)("p", {
9935
+ listAttribute: "data-copilot-account-options"
9936
+ })), (0, react.createElement)("label", { style: {
9937
+ display: "flex",
9938
+ alignItems: "center",
9939
+ gap: 8
9940
+ } }, (0, react.createElement)("input", {
9941
+ ref: followCheckbox,
9942
+ type: "checkbox",
9943
+ "data-copilot-follow-global": "",
9944
+ checked: sessionAccount?.source === "global",
9945
+ disabled: sessionAccount === void 0 || sessionAccount.accounts.revision === void 0 || busy || savingAccount,
9946
+ "aria-describedby": `${id}-follow-hint`,
9947
+ onChange: (event) => {
9948
+ const accountId = event.currentTarget.checked ? null : sessionAccount?.accountId;
9949
+ if (accountId !== void 0) chooseAccount(accountId, "follow");
9950
+ }
9951
+ }), t.followGlobal), (0, react.createElement)("p", {
9952
+ id: `${id}-follow-hint`,
9953
+ style: muted
9954
+ }, t.followHint), (0, react.createElement)("p", { style: muted }, t.switchScope), sessionAccount?.runningAccountId === void 0 ? null : (0, react.createElement)("p", { style: muted }, `${t.runningAccount}: ${runningIdentity ?? t.identityUnknown} · ${t.nextAccount}: ${currentIdentity}`), savingAccount ? (0, react.createElement)("p", {
9934
9955
  role: "status",
9935
9956
  style: muted
9936
9957
  }, confirmingAccount ? t.confirmingAccount : t.savingAccount) : null, sessionAccount?.accounts.diagnostic === void 0 ? null : (0, react.createElement)("code", { style: muted }, sessionAccount.accounts.diagnostic), accountFailed || accountSaveFailed ? (0, react.createElement)("p", {
@@ -10451,7 +10472,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10451
10472
  if (!selection(next)) return void 0;
10452
10473
  return next.provider === "github-copilot" || next.provider === "github-copilot-preview" ? next : void 0;
10453
10474
  }
10454
- function Surface$2({ runtime, remote, accountsRemote, addRemote, sessionRemote, continuationRemote, locale, diagnostic }) {
10475
+ function Surface$2({ runtime, remote, accountsRemote, sessionRemote, continuationRemote, locale, diagnostic }) {
10455
10476
  const valid = runtime.useSession((session) => record$2(session) && session.sessionId === runtime.sessionId && session.removed === false && session.openState === "open");
10456
10477
  const projection = runtime.useProjection("modelSelection");
10457
10478
  const running = runtime.useSession((value) => !record$2(value) || value.running !== false);
@@ -10470,9 +10491,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10470
10491
  changesAccount,
10471
10492
  running
10472
10493
  });
10473
- const added = (0, react.useCallback)(() => {
10474
- accountPresentationChanges.begin()();
10475
- }, []);
10476
10494
  const bound = (0, react.useMemo)(() => {
10477
10495
  if (sessionRemote === void 0) return void 0;
10478
10496
  const id = runtime.sessionId;
@@ -10527,12 +10545,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10527
10545
  sessionAccount: current.provider === "github-copilot-preview" ? bound?.account : void 0,
10528
10546
  locale: language,
10529
10547
  continuation: current.provider === "github-copilot-preview" ? continuation.content : void 0,
10530
- beforeAccountChange: current.provider === "github-copilot-preview" ? continuation.beforeAccountChange : void 0,
10531
- accountActions: current.provider === "github-copilot-preview" ? (0, react.createElement)(CopilotAccountAdd, {
10532
- remote: addRemote,
10533
- locale: language,
10534
- onChanged: added
10535
- }) : void 0
10548
+ beforeAccountChange: current.provider === "github-copilot-preview" ? continuation.beforeAccountChange : void 0
10536
10549
  });
10537
10550
  }
10538
10551
  /** Public additive dock only; native composer, ContextMeter and other features stay owned by Core. */
@@ -10554,7 +10567,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10554
10567
  let accountsRemote;
10555
10568
  let sessionRemote;
10556
10569
  let continuationRemote;
10557
- let addRemote;
10558
10570
  try {
10559
10571
  const namespaces = ctx.remote;
10560
10572
  const face = record$2(namespaces) ? namespaces.githubCopilotUsage : void 0;
@@ -10563,8 +10575,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10563
10575
  const accounts = record$2(namespaces) ? namespaces.githubCopilotAccounts : void 0;
10564
10576
  if (record$2(accounts) && typeof accounts.get === "function" && typeof accounts.refreshIdentity === "function" && typeof accounts.ensureIdentity === "function") accountsRemote = accounts;
10565
10577
  else diagnostic("COPILOT_ACCOUNTS_REMOTE_UNAVAILABLE");
10566
- if (record$2(accounts) && typeof accounts.get === "function" && typeof accounts.add === "function" && typeof accounts.cancel === "function") addRemote = accounts;
10567
- else diagnostic("COPILOT_ACCOUNT_ADD_REMOTE_UNAVAILABLE");
10568
10578
  const session = record$2(namespaces) ? namespaces.githubCopilotSessionAccount : void 0;
10569
10579
  if (isSessionRemote(session)) sessionRemote = session;
10570
10580
  else diagnostic("COPILOT_SESSION_ACCOUNTS_REMOTE_UNAVAILABLE");
@@ -10602,7 +10612,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10602
10612
  runtime: props,
10603
10613
  remote,
10604
10614
  accountsRemote,
10605
- addRemote,
10606
10615
  sessionRemote,
10607
10616
  continuationRemote,
10608
10617
  locale,