dsh-github-copilot 0.4.0-alpha.59 → 0.4.0-alpha.60

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/AGENTS.md CHANGED
@@ -34,12 +34,12 @@ Use native DSH tools for goals, background jobs and scoped subagents. Use local
34
34
  This repository owns eleven narrow surfaces:
35
35
 
36
36
  1. A conditional authorization-service bootstrap plus Host controller that joins DSH authorization, credentials, and settings.
37
- 2. A Client Models provider-card contribution with one shared account-state owner and Client-safe Remote descriptors; embed in an existing configured canonical row, suppress its separate footer controller, and retain footer/old-Core section fallback when no such row is mounted.
37
+ 2. A Client Models provider-card contribution with one shared account-state owner, Client-safe Remote descriptors and a nested plugin-owned model-preferences disclosure; embed in an existing configured canonical row, suppress its separate footer controller, and retain footer/old-Core section fallback when no such row is mounted.
38
38
  3. Strict JSON normalization of pi-ai's provider-owned Copilot OAuth grant.
39
39
  4. Preserve intentional absence of `llm-pi-ai.providers.github-copilot`; reconcile only existing legacy profiles and verified ownership journals. Fresh installations use the single account-discovered route; existing profiles require explicit migration, never silent removal.
40
40
  5. Direct provider-hosted search using the same Host-side credential lifecycle.
41
41
  6. Provider-scoped tool-schema compatibility for Copilot payload behaviors; Core remains the tool and execution owner.
42
- 7. A bounded account-discovery route that supplies validated endpoint/capability metadata to the published native adapter, without maintaining model-ID routing rules or changing Core's catalog.
42
+ 7. A bounded account-discovery route that supplies validated endpoint/capability metadata to the published native adapter, plus exact plugin-owned model exclusions enforced across its directory, Auto pools and direct admission, without maintaining model-ID routing rules or changing Core's catalog.
43
43
  8. Optional, provider-scoped Chat presentation for completed empty reasoning disclosures; durable content and encrypted replay metadata remain Core-owned.
44
44
  9. Compatibility-only policy restoration and request recovery for existing dedicated planner/executor Sessions. Model roles UI, settings writes and new dedicated roots are retired (#158); never reintroduce them or migrate histories implicitly.
45
45
  10. Managed-route estimated input/output admission, optional exact-request pressure signalling through official compaction recovery, and supported low summary effort only when no effort is already resolved. See [compaction budgets](./docs/copilot-compaction.md). Preserve truthful capacities, requested output caps, native errors/replay and transaction ownership; no hidden history trimming, chunking, new retry loop, competing compaction service or automatic model switch. Preventive guards do not claim recovery of an already oversized manual summary.
@@ -47,7 +47,7 @@ This repository owns eleven narrow surfaces:
47
47
 
48
48
  ## Retired model-role compatibility boundary (#158)
49
49
 
50
- `src/dual-model-host.ts`, `dual-model-types.ts` and `dual-model-remote.ts` retain compatibility for existing histories; see `docs/dual-model.md`. Do not restore the removed Client card or either Settings entry. `view` reports read-only retirement without discovery; `save` rejects; `create` can only recover a matching already-created request, never create a new root. The three strict Remote wire contracts and eight authorization/migration descriptors retain their identities. Restore existing captured policy through the namespaced projection without deleting settings, converting history or changing routes/defaults. Unknown recovery evidence remains uncertain, not permission to create with another UUID. Existing dedicated tool restrictions remain workflow controls, not a sandbox against shell code. Ordinary Session/subagent behavior stays Core-owned; the pending native parent-model rules are separate work, not a new dependency or a shipped capability of this plugin.
50
+ `src/dual-model-host.ts`, `dual-model-types.ts` and `dual-model-remote.ts` retain compatibility for existing histories; see `docs/dual-model.md`. Do not restore the removed Client card or either Settings entry. `view` reports read-only retirement without discovery; `save` rejects; `create` can only recover a matching already-created request, never create a new root. The three strict Remote wire contracts and ten authorization/model-preference/migration descriptors retain their identities. Restore existing captured policy through the namespaced projection without deleting settings, converting history or changing routes/defaults. Unknown recovery evidence remains uncertain, not permission to create with another UUID. Existing dedicated tool restrictions remain workflow controls, not a sandbox against shell code. Ordinary Session/subagent behavior stays Core-owned; the pending native parent-model rules are separate work, not a new dependency or a shipped capability of this plugin.
51
51
 
52
52
  Alpha.25 admits native `subagent/descriptor` v3, already v3 in the retained rc.1 baseline; the old v1 assumption was a plugin/test bug. Projection cache `stateVersion: 2` forces refolding, not history conversion. Unknown/v1/v2 or invalid child descriptors fail closed unmodified; review the original child's work and explicitly create a new child if needed, never relabel or fabricate a descriptor. Strict Remote codecs provide alpha.2 `create()` factories and retain the legacy `schema` bridge to the same strict parser, with no `src-json` downgrade.
53
53
 
@@ -108,7 +108,7 @@ Alpha.25 admits native `subagent/descriptor` v3, already v3 in the retained rc.1
108
108
 
109
109
  - Use no-argument `githubCopilot.migrationStatus()` for fresh live-Agent evidence; generic `session/list` may be stale and plugin inventory alone has no loaded-version evidence. `src/migration-status.ts` reads public leaves synchronously and reports loaded build `plugin.name/version`, `protocolVersion: 1`, `observedAt`, capability flags and completeness flags. Missing/unknown/incomplete is not safe absence.
110
110
  - Capabilities are `agentsList`, `sessionProjections`, `settingsCas`, `providerRegistry`, `defaultSelection`; `complete.sessions/defaultSelection/routes` describes evidence completeness, not migration approval. Effective selection uses pending projection, request-header config, then default only for genuinely empty Sessions with known projection state. Running `activeRequestSelection` is the latest recorded header, not proven in-flight LLM work. Native effective configuration and native/managed registration are separate flags.
111
- - This read invokes no auth status/model discovery, credentials or network and mutates no settings/Sessions. No normal UI/global current-model/search card is added. Seven ordinary authorization Remotes retain their codec; the eighth migration Remote uses a separate strict `GitHubCopilotMigrationStatus` codec.
111
+ - This read invokes no auth status/model discovery, credentials or network and mutates no settings/Sessions. No normal UI/global current-model/search card is added. Nine ordinary authorization/model-preference Remotes retain their codec; the tenth migration Remote uses a separate strict `GitHubCopilotMigrationStatus` codec.
112
112
  - `historyScope: live-agents-only` excludes cold stored histories. Require operator acknowledgement that older conversations may need a new explicit selection later. Loaded version/structural capability self-reports are not full Desktop/Core byte attestation or an atomic cross-namespace guarantee; recheck immediately before CAS.
113
113
  - The planned `cloga/dsh-windows-ops` command `tools/migrate-copilot-managed-route.ps1` is separate config-only maintenance after release. V1 performs no automated Session/default writes, cold-history scan, plugin install, restart or full Desktop-baseline acceptance. Resolve selection blockers separately with explicit approval; never report this planned command or live migration as published/installed/completed without evidence.
114
114
 
@@ -144,7 +144,7 @@ These pins document compatibility evidence. They do not authorize creating anoth
144
144
  - Route activation: the dormant `llm-pi-ai` mount observes the profile and registers the route.
145
145
  - Client activation: package metadata injects DSH remotes and Models UI; `./client` mounts `./remote`.
146
146
  - Provider headers: rc.1 validates configured headers through Fetch and reuses Host-owned headers during model discovery.
147
- - Remote results: the seven ordinary authorization methods retain the Zod v4 `GitHubCopilotAuthorizationView` strict codec required by rc.2 and accepted by rc.1. The eighth no-argument `migrationStatus()` method has a separate strict `GitHubCopilotMigrationStatus` codec; it does not change the ordinary auth contract.
147
+ - Remote results: the nine ordinary authorization/model-preference methods retain the Zod v4 `GitHubCopilotAuthorizationView` strict codec required by rc.2 and accepted by rc.1. The tenth no-argument `migrationStatus()` method has a separate strict `GitHubCopilotMigrationStatus` codec; it does not change the ordinary auth contract.
148
148
 
149
149
  When upgrading DSH or pi-ai, inspect the exact tagged public exports and update the baseline, compatibility guard, tests, and docs together. Apply the **official-first policy**: compare each customization's purpose against exact official source/contracts, classify complete/partial/unverified support, choose retain/migrate/retire, and record the remaining gap plus a concrete retirement trigger. Unverified parity is not evidence of absence. Prefer official behavior only after configuration/data migration, safety and runtime acceptance are reviewed; remove redundant paths and their obsolete tests without losing user-visible acceptance coverage. The current comparison is [official-first alpha.2](./docs/official-first-016-alpha2.md).
150
150
 
package/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## 0.4.0-alpha.59 (prepared)
3
+ ## 0.4.0-alpha.60 (prepared)
4
+
5
+ - Add exact account-model exclusions under **GitHub Copilot → Manage → Model preferences**, with local search, visible/excluded counts, explicit **Exclude/Restore** actions, and retained rows for excluded IDs temporarily absent from account metadata (#192).
6
+ - Remove excluded IDs from the managed picker, every Auto candidate pool, aggregate Auto modalities, hosted-search route facts, and request-budget admission. Stale picker or direct requests fail with `COPILOT_PREVIEW_MODEL_EXCLUDED`; Auto fails closed when no eligible model remains.
7
+ - Protect the current fixed managed selection using public default and live Session projection/request-header evidence. Exclusion writes use path-level settings CAS and never rewrite history, switch a Session, mutate the account grant, or change Core's flat picker layout.
8
+
9
+ ## 0.4.0-alpha.59 (released)
4
10
 
5
11
  - Fix unavailable Web search routing on official rc.2 by exposing the plugin's live routing fields through native Config projection (#216). Retain narrow CAS writes, separate legacy override reset, ordinary safety configuration and live snapshot consumption without remounting.
6
12
  - Replace the manually populated settings test double with a disposable native Loader/ConfigEditor/SettingsForms fixture covering projection, save, conflict rejection and restart persistence.
package/README.md CHANGED
@@ -11,7 +11,7 @@ A focused DSH companion for GitHub Copilot sign-in, account-aware model profiles
11
11
 
12
12
  ## Current experience
13
13
 
14
- - **Account and models:** sign in, inspect account-discovered models, refresh metadata, and manage the account from the native GitHub Copilot row under **Settings → Models**.
14
+ - **Account and models:** sign in, inspect account-discovered models, refresh metadata, and manage the account from the native GitHub Copilot row under **Settings → Models**. **Manage → Model preferences** can exclude exact models from both the managed picker and Auto without changing Core's flat picker.
15
15
  - **Search routing:** choose the primary and fallback search providers under **Plugins → dsh-github-copilot → Details**. The page intentionally exposes only those user-facing choices; protocol probes, timeouts, allowlists, and transport switches are not presented as routine UI. It also keeps the rc.2 lifecycle warning visible before disable/remove/upgrade actions. If the updated routed service is not active yet, the card reports **Restart required** instead of presenting a broken form.
16
16
  - **Usage:** eligible Copilot sessions get an optional **Credits** control beside the composer, with provider-reported billing-cycle data and explicit unavailable/stale states. The quota request alone combines Node default and OS trust roots without disabling certificate verification or relying on Desktop launcher environment inheritance.
17
17
  - **Compatibility:** the plugin applies Copilot-only tool-schema, reasoning-presentation, request-budget, and account-model compatibility through published DSH APIs. It does not patch Core or maintain a second model catalog.
@@ -98,7 +98,7 @@ The Host reads GitHub's internal quota endpoint using the existing canonical OAu
98
98
 
99
99
  ## Install and sign in
100
100
 
101
- The commands below target the package version `0.4.0-alpha.59`. Versioned URLs describe the intended release artifacts, not proof that publication or local activation has completed; use them only once that Release and its checksums are available. Install into the profile you use (replace `web` when targeting another profile):
101
+ The commands below target the package version `0.4.0-alpha.60`. Versioned URLs describe the intended release artifacts, not proof that publication or local activation has completed; use them only once that Release and its checksums are available. Install into the profile you use (replace `web` when targeting another profile):
102
102
 
103
103
  Before installing/updating, unpack the **checksum-verified** archive into a temporary directory and run its read-only composition preflight (replace all paths with absolute paths for the intended profile):
104
104
 
@@ -111,10 +111,10 @@ Include any launcher patch files with repeated `--patch /absolute/file` argument
111
111
  For a standalone named profile only, the supported CLI command is:
112
112
 
113
113
  ```sh
114
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.59/dsh-github-copilot-0.4.0-alpha.59.tgz
114
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/dsh-github-copilot-0.4.0-alpha.60.tgz
115
115
  ```
116
116
 
117
- For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.59` after the same preflight and only when registry access is permitted. Desktop reserves its `desktop` profile from CLI management. If registry access is blocked or unavailable, stop; the documented [controlled offline CLI procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles) is not a Desktop workaround.
117
+ For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.60` after the same preflight and only when registry access is permitted. Desktop reserves its `desktop` profile from CLI management. If registry access is blocked or unavailable, stop; the documented [controlled offline CLI procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles) is not a Desktop workaround.
118
118
 
119
119
  Then open the Models UI listed above, find **GitHub Copilot**, select **Sign in**, and complete the GitHub device-code flow. Plugin installation changes the selected profile; activation follows that profile's normal reload/restart policy.
120
120
 
@@ -124,11 +124,11 @@ Then open the Models UI listed above, find **GitHub Copilot**, select **Sign in*
124
124
  2. Select **Sign in with GitHub**. The authorization area expands automatically with a prominent one-time code, **Open GitHub verification page**, **Copy code**, and **Cancel sign-in**. No extra **Manage** click is needed. Recognized Desktop v1 hosts use their existing same-window external-navigation handoff to the system browser instead of a popup; web hosts retain a new tab. If nothing opens, select and copy the displayed verification address into your browser. The plugin cannot confirm that the system browser opened.
125
125
  3. Copy the code, open the verification link, and complete authorization in your own GitHub browser session. Copy success/failure is announced accessibly; manual copying remains available. Never paste a GitHub token into DSH.
126
126
  4. DSH polls only while authorization is in flight. Successful explicit **Start sign-in** (the **Sign in with GitHub** button), including a UI account switch, forces exactly one bounded discovery after immediate or polled success. The code and verification link clear, the automatic authorization area closes, and the account shows **Signed in** and **Manage**. Manually opened details stay open; cancellation clears the old code. Failures show only a safe stage diagnostic: `COPILOT_AUTHORIZATION_BEGIN_FAILED` means authorization did not complete; `COPILOT_ROUTE_REPAIR_FAILED` means authorization completed but local route repair failed. A failed begin can also show a fixed **latest observed milestone** (`AUTHORIZATION_REQUESTED`, `INTERACTION_PROMPT_OBSERVED`, or `INTERACTION_NOTICE_OBSERVED`). It reports only progress observed through the public interaction callbacks, not the failing operation or a credential commit. The latter route-repair code retains authentication and directs you to **Manage → Repair model configuration**. These codes and milestones do not explain or resolve the underlying sign-in failure; raw provider details are never displayed or logged.
127
- 5. Choose an accepted model under **GitHub Copilot** (stable route ID `github-copilot-preview`). Normal opening/use maintains metadata without requiring **Refresh models**. **Manage** contains the optional manual refresh, model details and sign-out. The compatibility disclosure is removed; legacy configuration diagnostics and explicit repair remain available when needed, and the [migration guide](./docs/single-route-migration.md) remains in the documentation. Errors remain visible with **Retry**, including when details are collapsed; neither discovery nor retry changes your current/default model or replays messages.
127
+ 5. Choose an accepted model under **GitHub Copilot** (stable route ID `github-copilot-preview`). Normal opening/use maintains metadata without requiring **Refresh models**. **Manage** contains manual refresh, model details, **Model preferences**, and sign-out. Model preferences provide local search and explicit **Exclude/Restore** actions. Excluded exact IDs disappear from the managed picker and every Auto pool; temporarily absent excluded IDs remain restorable. The current fixed managed model is locked until another model is selected. No exclusion rewrites history, changes selection, or mutates account entitlement. Legacy configuration diagnostics and explicit repair remain available when needed, and the [migration guide](./docs/single-route-migration.md) remains in the documentation.
128
128
 
129
129
  ### Auto model routing
130
130
 
131
- The managed GitHub Copilot group includes **Auto · Balance**, **Auto · Efficiency**, and **Auto · Intelligence** as flat virtual picker rows. They share one account-verified eligible pool. Before preference, routing evaluates input headroom against each candidate's hard input budget, filtering out candidates that cannot accommodate current messages. Soft preferences distribute across upper/lower/center candidate bands using deterministic in-memory seeds to avoid monopolizing a single top candidate across Sessions. If no candidate fits, Auto selects the largest input capacity model and triggers compaction pressure on compressible history. Auto resolves once per Core turn to a real model; every tool step, retry and automatic compaction recovery in that turn stays on that model, while a later Chat or Goal turn may choose again. Image turns require an account-verified image-capable candidate. New turns retain Core's actual model/usage details without adding unsafe plugin events. Search keeps its independent provider-owned model policy, and subagents / Team teammates continue to inherit Core's concrete route rather than being relabeled as Auto. See the [policy and mockup](./docs/automatic-model-routing.md); model exclusions and a nested picker are still proposals.
131
+ The managed GitHub Copilot group includes **Auto · Balance**, **Auto · Efficiency**, and **Auto · Intelligence** as flat virtual picker rows. They share one account-verified eligible pool after applying exact model exclusions. Before preference, routing evaluates input headroom against each candidate's hard input budget, filtering out candidates that cannot accommodate current messages. Soft preferences distribute across upper/lower/center candidate bands using deterministic in-memory seeds to avoid monopolizing a single top candidate across Sessions. If no candidate fits, Auto selects the largest input capacity model and triggers compaction pressure on compressible history; if exclusions leave no eligible model, Auto fails closed. Auto resolves once per Core turn to a real model; every tool step, retry and automatic compaction recovery in that turn stays on that model, while a later Chat or Goal turn may choose again. Image turns require a non-excluded account-verified image-capable candidate. New turns retain Core's actual model/usage details without adding unsafe plugin events. Search keeps its independent provider-owned model policy, and subagents / Team teammates continue to inherit Core's concrete route rather than being relabeled as Auto. See the [policy and mockup](./docs/automatic-model-routing.md). The nested management disclosure is plugin-owned; Core's picker remains flat.
132
132
 
133
133
  Completed Copilot replies show **Auto (preference)** and an expandable recorded reason after native Usage/time, or **Manual** only with captured explicit fixed-selection evidence. Missing evidence shows **Selection unknown**, never a guess from today's picker. There is no repeated model name or separate Model details button: actual model display stays in native Usage, whose missing-route behavior is unchanged. New selection records are bounded and Host-local; restart, disposal or eviction loses them. Compatible historical Auto records remain readable. The public assistant-actions slot supports internal wrapping only, not changing the native fixed-height row.
134
134
 
@@ -157,7 +157,7 @@ Agents should treat the browser authorization as a human handoff, not as a token
157
157
  5. Confirm **Signed in** and inspect the automatic discovery result before asking the user to choose a model. Already-signed-in Models opening ensures missing/stale metadata automatically; fresh ready cache makes no request. Use visible **Retry** for errors or **Manage → Refresh models** for an intentional forced update, not routine setup. Status alone does not discover, and login, metadata and successful model calls remain separate evidence.
158
158
  6. Use **Sign out** only when the user explicitly asks to disconnect the account. It deletes the Copilot credential record but preserves route settings.
159
159
 
160
- GitHub Releases and npm are the default distribution channels for each new version, using the same verified tarball. Pin the version and verify the evidence for the channel used: Release `SHA256SUMS`, and npm `dist.integrity` when installing from npm. Install into Desktop profiles only through Desktop's native package manager; the reserved `desktop` profile is not managed by the DSH CLI. After npm publication is verified, the native manager accepts `dsh-github-copilot@0.4.0-alpha.59`, not a URL or file. Controlled offline CLI maintenance is documented for standalone named profiles only, never Desktop-managed profiles. Follow the mandatory search-composition preflight, backup, single-writer and post-install checks; do not bypass a corporate registry ban, disable TLS verification or restart without separate approval. See [distribution and publication requirements](./docs/npm-distribution.md).
160
+ GitHub Releases and npm are the default distribution channels for each new version, using the same verified tarball. Pin the version and verify the evidence for the channel used: Release `SHA256SUMS`, and npm `dist.integrity` when installing from npm. Install into Desktop profiles only through Desktop's native package manager; the reserved `desktop` profile is not managed by the DSH CLI. After npm publication is verified, the native manager accepts `dsh-github-copilot@0.4.0-alpha.60`, not a URL or file. Controlled offline CLI maintenance is documented for standalone named profiles only, never Desktop-managed profiles. Follow the mandatory search-composition preflight, backup, single-writer and post-install checks; do not bypass a corporate registry ban, disable TLS verification or restart without separate approval. See [distribution and publication requirements](./docs/npm-distribution.md).
161
161
 
162
162
  **Desktop package-update and Web-lifecycle boundaries:** the native manager's `restart-required` result for an in-place installed-package upgrade is authoritative and distinct from plugin-bundle removal/re-add behavior. Any disable, removal, or upgrade involving service recomposition (`cordis.patch.yml`, such as the isolated routed web search layer) may leave dependent entries pending until Desktop is fully exited and cold-restarted. If the native manager reports only entries such as `pending (waiting for service: web)` while this plugin already shows **Off**, the requested disabled state has been persisted; cold-restart Desktop instead of repeatedly toggling or reinstalling the plugin. Other errors are not covered by this guidance and must still be investigated.
163
163
 
@@ -430,8 +430,8 @@ Report the published Release URL, version, tag/commit and verified asset SHA-256
430
430
  `package.json` declares public npm distribution. A release tag must equal `v${package.json.version}`. Versions use standard SemVer prerelease labels (`alpha`, `beta`, or `rc`), each with its matching npm dist-tag; only stable versions use `latest`. The Release workflow performs the frozen install and complete verification gate, packs once (or recovers the original archive on retry), verifies `SHA256SUMS`, publishes the immutable GitHub Release and then publishes those same bytes to npm through OIDC. Either channel failing means delivery is incomplete. First package creation needs an authorized maintainer; staging requires an existing package and is not a first-package bootstrap. Historical releases are not republished.
431
431
 
432
432
  ```sh
433
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.59/dsh-github-copilot-0.4.0-alpha.59.tgz
434
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.59/SHA256SUMS
433
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/dsh-github-copilot-0.4.0-alpha.60.tgz
434
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/SHA256SUMS
435
435
  sha256sum --check SHA256SUMS
436
436
  ```
437
437
 
@@ -439,7 +439,7 @@ PowerShell can verify the same two downloaded files with:
439
439
 
440
440
  ```powershell
441
441
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
442
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.59.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
442
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.60.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
443
443
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
444
444
  ```
445
445
 
package/README.zh.md CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
  ## 当前体验
13
13
 
14
- - **账号与模型:**在 **设置 → 模型** 的原生 GitHub Copilot 行内完成登录、查看账号发现模型、刷新元数据及账号管理。
14
+ - **账号与模型:**在 **设置 → 模型** 的原生 GitHub Copilot 行内完成登录、查看账号发现模型、刷新元数据及账号管理。可在 **Manage → Model preferences** 中按精确 ID 排除模型,使其同时退出托管 picker 与 Auto 候选池;Core 原生 picker 仍保持平铺。
15
15
  - **搜索路由:**在 **插件 → dsh-github-copilot → 详情**选择主搜索 Provider 与兜底 Provider。页面只保留用户真正需要的两项选择,不再把协议探测、超时、白名单或传输开关作为日常配置暴露;同时会在停用/移除/升级前常驻显示 rc.2 生命周期提示。更新后的路由服务尚未激活时,卡片会明确显示 **需要重启生效(Restart required)**,而不是继续展示无法使用的表单。
16
16
  - **用量:**符合条件的 Copilot 会话会在输入框旁显示可选的 **Credits / 额度** 控件,展示供应方明确返回的计费周期数据,并如实区分不可用与历史快照。仅额度请求组合 Node 默认证书与系统信任根,无需依赖 Desktop launcher 的环境变量继承,且保持 TLS 验签。
17
17
  - **兼容处理:**插件通过 DSH 已发布公开接口提供 Copilot 专用 Tool Schema、Thinking 展示、请求预算及账号模型兼容,不修改 Core,也不维护第二套模型目录。
@@ -20,7 +20,7 @@
20
20
 
21
21
  截图来自当前构建 Client 的隔离浏览器 fixture,使用合成 Provider。它只证明已发布配置界面的形态,不证明真实凭据、账号权限、搜索成功或当前 Desktop 已加载。
22
22
 
23
- > 当前文档与安装命令对应版本 `0.4.0-alpha.59`。源码、发布制品、已安装版本和实际加载运行时需分别确认;本地升级和中断会话的重启仍需用户批准。
23
+ > 当前文档与安装命令对应版本 `0.4.0-alpha.60`。源码、发布制品、已安装版本和实际加载运行时需分别确认;本地升级和中断会话的重启仍需用户批准。
24
24
 
25
25
  Web search 路由现在优先显示在插件详情页;宿主不支持详情页插槽时才回退到 **设置 → 模型**或独立 Web search section。搜索子 Fiber 仍独立等待 Remote,不影响账号控件和既有搜索安全检查。
26
26
 
@@ -113,10 +113,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
113
113
  仅对独立的具名 profile,获准且网络可用时,可通过受支持的 CLI 命令安装:
114
114
 
115
115
  ```sh
116
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.59/dsh-github-copilot-0.4.0-alpha.59.tgz
116
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/dsh-github-copilot-0.4.0-alpha.60.tgz
117
117
  ```
118
118
 
119
- Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.59`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
119
+ Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.60`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
120
120
 
121
121
  随后打开上表对应的 Models UI,找到 **GitHub Copilot**,点击 **Sign in** 并完成 GitHub device-code 流程。安装会修改指定 profile;是否立即激活取决于该 profile 的常规 reload/restart 策略。
122
122
 
@@ -126,11 +126,11 @@ Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理
126
126
  2. 点击 **Sign in with GitHub** 后,验证码区域自动展开,提供醒目的一次性验证码、**Open GitHub verification page**、**Copy code** 和 **Cancel sign-in**。不需要再点一次 **Manage**。识别到 Desktop v1 宿主时,通过现有的同窗口外部导航处理交给系统浏览器,不依赖弹出窗口;网页版仍打开新标签页。如果没有打开,可选中并复制界面显示的验证网址到浏览器。插件无法确认系统浏览器是否已打开。
127
127
  3. 复制验证码,打开验证链接,在自己的 GitHub 浏览器会话中完成授权。复制成功/失败均有可访问的反馈;手工复制仍可用。不要把 GitHub token 粘贴到 DSH。
128
128
  4. DSH 只在授权进行中轮询。显式 **Start sign-in**(**Sign in with GitHub** 按钮,包括界面切换账号)成功后,无论立即返回还是轮询观察到成功,都只强制执行一次有界发现。验证码和验证链接清除,自动授权区域收起,账号显示 **Signed in、Manage**。手动打开的详情保持展开;取消清除旧验证码。失败仅显示安全的阶段诊断:`COPILOT_AUTHORIZATION_BEGIN_FAILED` 表示授权流程未完成;`COPILOT_ROUTE_REPAIR_FAILED` 表示授权已完成但本地路由修复失败。begin 失败还可以显示固定的“最近观察到的里程碑” (`AUTHORIZATION_REQUESTED`、`INTERACTION_PROMPT_OBSERVED` 或 `INTERACTION_NOTICE_OBSERVED`);它只表示公开 interaction callback 已观察到的进度,不代表失败操作或 credential commit。后者会保留认证,并提示前往 **Manage → Repair model configuration**。这些代码和里程碑不解释或解决底层登录失败,原始 provider 详情不会显示或记录。
129
- 5. 在 **GitHub Copilot** 分组选择接受的模型(稳定路由 ID 为 `github-copilot-preview`)。正常打开/使用会自动维护元数据,无需手动 **Refresh models**。**Manage** 内保留可选的手动刷新、模型明细与退出登录,移除兼容说明折叠区;需要时仍显示旧配置诊断和显式修复操作,[迁移指南](./docs/single-route-migration.md)继续保留在文档中。错误即使在详情折叠时也会显示并提供 **Retry**;发现或重试均不切换当前/默认模型,也不重放消息。
129
+ 5. 在 **GitHub Copilot** 分组选择接受的模型(稳定路由 ID 为 `github-copilot-preview`)。正常打开/使用会自动维护元数据,无需手动 **Refresh models**。**Manage** 内包含手动刷新、模型明细、**Model preferences** 与退出登录。模型偏好提供本地搜索和明确的 **Exclude/Restore** 操作;被排除的精确 ID 会退出托管 picker 与所有 Auto 候选,暂时不在账号元数据中的排除 ID 仍可恢复。当前固定托管模型在切换到其他模型前不可排除。排除不会改写历史、切换选择或修改账号权限。
130
130
 
131
131
  ### Auto 模型路由
132
132
 
133
- 托管 GitHub Copilot 分组提供三个平铺的虚拟选择:**Auto · Balance**(均衡)、**Auto · Efficiency**(效率)和 **Auto · Intelligence**(智能)。三档共用当前账号验证过的合格模型池。在应用偏好前,路由会根据候选模型的硬输入预算计算输入余量,剔除无法容纳当前消息的候选。软偏好通过确定性内存种子在候选区间(上段/下段/中段)内分布,避免单一顶配模型跨 Session 被垄断。若所有候选均超限,Auto 会选择输入容量最大的模型并对可压缩历史触发 compaction pressure。Auto 在每个 Core turn 只解析一次;同轮工具步骤、重试和自动 compact 恢复使用同一真实模型,新轮次可重新选择。图片轮次必须有验证过的图片候选。新轮次保留 Core 的真实模型/用量信息,不追加不兼容的插件事件。搜索仍由独立策略管理;原生子代理与 Team 队友继承 Core 的具体模型,不被重新标为 Auto。详见[策略与 mockup](./docs/automatic-model-routing.md);模型排除与嵌套菜单仍只是提案。
133
+ 托管 GitHub Copilot 分组提供三个平铺的虚拟选择:**Auto · Balance**(均衡)、**Auto · Efficiency**(效率)和 **Auto · Intelligence**(智能)。三档先应用精确模型排除,再共用当前账号验证过的合格模型池。在应用偏好前,路由会根据候选模型的硬输入预算计算输入余量,剔除无法容纳当前消息的候选。软偏好通过确定性内存种子在候选区间(上段/下段/中段)内分布,避免单一顶配模型跨 Session 被垄断。若所有候选均超限,Auto 会选择输入容量最大的模型并对可压缩历史触发 compaction pressure;若排除后没有任何合格模型,则 Auto 关闭式失败。Auto 在每个 Core turn 只解析一次;同轮工具步骤、重试和自动 compact 恢复使用同一真实模型,新轮次可重新选择。图片轮次必须有未被排除且已验证的图片候选。新轮次保留 Core 的真实模型/用量信息,不追加不兼容的插件事件。搜索仍由独立策略管理;原生子代理与 Team 队友继承 Core 的具体模型,不被重新标为 Auto。详见[策略与 mockup](./docs/automatic-model-routing.md)。嵌套管理折叠区由插件提供;Core picker 仍保持平铺。
134
134
 
135
135
  已完成的 Copilot 回复在原生 Usage/时间后显示 **Auto(偏好)**,点信息按钮查看本轮记录的选择原因;只有捕获到明确固定选择才显示**手动**。缺记录显示**选择方式未知**,不借当前 picker 推断历史。不重复模型名、不另设 Model details 按钮:实际模型仍由原生 Usage 显示,其缺失归属行为未改变。新选择记录仅限当前 Host 内存且有容量上限,重启、释放 Agent 或淘汰后会丢失;兼容历史 Auto 记录仍可读取。公开 assistant-actions slot 只允许插件内部换行,不能改变原生固定高度尾栏。
136
136
 
@@ -159,7 +159,7 @@ Agent 应把浏览器授权视为需要用户完成的 handoff,而不是自行
159
159
  5. 确认 **Signed in** 并检查自动发现结果,再请用户选择模型。已登录时打开 Models 会自动确保缺失/过期元数据,新鲜 ready 缓存不发请求。错误可使用 **Retry**,有意强制更新时使用 **Manage → Refresh models**,不作为常规设置步骤。状态读取本身不发现;登录、元数据与真实调用成功是独立证据。
160
160
  6. 只有用户明确要求断开账号时才使用 **Sign out**;它会删除 Copilot credential record,但保留 route settings。
161
161
 
162
- 每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.59`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
162
+ 每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.60`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
163
163
 
164
164
  **Desktop package 更新与 Web 生命周期边界:**原生 manager 对已安装 package 原位升级返回的 `restart-required` 是权威结果,与移除/重加 plugin bundle 的行为是两个不同问题。涉及服务重编排补丁(`cordis.patch.yml`,如本插件所采用的隔离路由 Web 搜索层)的停用、移除或升级,可能让依赖条目保持 pending,直到完全退出并冷重启 Desktop。若原生 manager 只报告类似 `pending (waiting for service: web)` 的条目,同时本插件已经显示 **Off**,说明请求的停用状态已经落盘;请冷重启 Desktop,不要反复切换或重装插件。其它错误不属于此提示范围,仍需单独排查。
165
165
 
@@ -441,8 +441,8 @@ node scripts/agent.mjs attribution "DeepSeek Harness (DSH)"
441
441
  `package.json` 声明公开 npm 分发。Release tag 必须严格等于 `v${package.json.version}`。预发布使用 `alpha`、`beta` 或 `rc` 及对应 npm dist-tag,只有稳定版使用 `latest`。Release workflow 执行 frozen install 和完整门禁,只打包一次(重试恢复原始归档),验证 `SHA256SUMS`,发布不可变 GitHub Release,再通过 OIDC 将同一份字节发布到 npm。任一渠道失败都表示交付未完成。首次建包须由获准环境中的维护者完成;staging 要求包已存在,不能代替首次建包。不会批量补发历史版本。
442
442
 
443
443
  ```sh
444
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.59/dsh-github-copilot-0.4.0-alpha.59.tgz
445
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.59/SHA256SUMS
444
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/dsh-github-copilot-0.4.0-alpha.60.tgz
445
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.60/SHA256SUMS
446
446
  sha256sum --check SHA256SUMS
447
447
  ```
448
448
 
@@ -450,7 +450,7 @@ PowerShell 可以对已下载的同一组文件执行:
450
450
 
451
451
  ```powershell
452
452
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
453
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.59.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
453
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.60.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
454
454
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
455
455
  ```
456
456
 
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "package": {
10
10
  "name": "dsh-github-copilot",
11
- "version": "0.4.0-alpha.59"
11
+ "version": "0.4.0-alpha.60"
12
12
  },
13
13
  "evidence": {
14
14
  "kind": "source-and-synthetic-test-inventory",
@@ -195,14 +195,14 @@ Synthetic tests prove composition and contracts only. They do not prove a live a
195
195
  - side-effect replay;
196
196
  - automatic changes to existing Session selections, settings, or histories.
197
197
 
198
- ## Exploration: excluded models and richer picker (not implemented)
198
+ ## Model exclusions and richer picker boundary
199
199
 
200
- **Tracking:** [#192](https://github.com/cloga/dsh-github-copilot/issues/192). **Interactive proposal:** [`output/auto-model-mockup/tiers.html`](../output/auto-model-mockup/tiers.html). This is a local, synthetic UI exercise, not a claim of current Core picker behavior. The three virtual preferences and capacity matrix above are implemented; model exclusions and nested picker controls in the mockup are **not**.
200
+ **Tracking:** [#192](https://github.com/cloga/dsh-github-copilot/issues/192). **Interactive proposal:** [`output/auto-model-mockup/tiers.html`](../output/auto-model-mockup/tiers.html). This is a local, synthetic UI exercise, not a claim of current Core picker behavior. The three virtual preferences, capacity matrix, and plugin-owned model exclusions are implemented. The mockup's nested Core picker is not.
201
201
 
202
202
  The attached Copilot example uses one Auto switch with a nested Efficiency / Balance / Intelligence menu. The supported DSH model picker is owned by Core and receives a flat provider directory from `PreviewAdapter.listModels()`; the plugin's Models provider-card and bundle-config slots cannot restructure that picker. The plugin advertises three rows under **GitHub Copilot**, with the existing `auto` ID as Balance for previously selected Sessions and defaults. A nested switch like the screenshot requires a separately reviewed public Core UI seam and is not a dependency of the plugin-only preferences.
203
203
 
204
- The proposed exclusions are a separate **hard filter**, not a fourth preference. Today all three preferences share account entitlement and turn-required verified capabilities; no exclusion setting has been wired. The mockup uses illustrative capacity scores and simulated responses, not live evaluation of model quality, cost, or latency.
204
+ Exclusions are a separate **hard filter**, not a fourth preference. All three preferences share account entitlement and turn-required verified capabilities, then remove the exact IDs stored in `github-copilot.excludedModelIds`. The mockup uses illustrative capacity scores and simulated responses, not live evaluation of model quality, cost, or latency.
205
205
 
206
- The model-management surface should be a small **GitHub Copilot · model preferences** section in the plugin's own settings UI, not a replacement of Core's picker. Offer search, a visible/hidden count, **Exclude** and **Restore** per currently validated account model, and a reason when an action is unavailable. Store excluded **exact account model IDs** in a plugin-owned path with revision-checked writes; validate entries against the current directory and preserve exclusion intent for temporarily absent IDs without pretending they are entitled. Do not mutate pi-ai's catalog, account grant, Core settings, or another provider's models. The plugin's advertised directory and every Auto candidate set exclude these IDs. A stale picker row or direct request for an excluded model must also fail with a named, actionable diagnostic rather than silently routing through it. Existing Session history is never rewritten: an old fixed selection can be restored or changed explicitly, but is not automatically moved. Prevent excluding the currently selected fixed model until another selection is made; allow restoring an excluded model. If exclusion or catalog changes leave no eligible candidate, Auto must fail closed. Account change and unavailable metadata must not be interpreted as permission to re-enable or guess models.
206
+ The model-management surface is the nested **GitHub Copilot → Manage → Model preferences** disclosure in the plugin's own settings UI, not a replacement of Core's picker. It offers local search, visible/excluded counts, **Exclude** and **Restore**, a selected-model lock reason, and retained restore rows for exact IDs temporarily absent from current account metadata. Writes are revision-checked path mutations. The plugin does not mutate pi-ai's catalog, the account grant, Core settings, or another provider's models. Its advertised directory, every Auto candidate set, aggregate Auto modalities, hosted-search route facts and managed admission remove excluded IDs. A stale picker row or direct request fails with `COPILOT_PREVIEW_MODEL_EXCLUDED`. Existing Session history is never rewritten or silently moved. The current fixed managed model cannot be excluded until another model is selected. If exclusions leave no eligible candidate, Auto fails closed with `COPILOT_AUTO_NO_ELIGIBLE_MODEL`. Account change or unavailable metadata never re-enables or guesses models.
207
207
 
208
- The native picker already owns provider groups and text search; listing the three virtual rows first and keeping excluded Copilot models out of its directory is achievable through the existing plugin-owned adapter. Custom section headers inside a provider, nested Auto menus, hiding other providers' models, and replacing Core search/layout are **not** available through the current additive slots. Before implementing, verify cold picker and `/model` refresh behavior, Session-local pending selection versus real request headers, selected-model exclusion, stale directories, concurrent settings edits, account switching, image admission, and zero-candidate failures against unchanged pinned Core. The prototype's invented model capacity order and response are illustrative only.
208
+ The native picker still owns provider groups and text search. It remains flat: the three virtual rows are listed first and excluded Copilot models are omitted from the plugin-owned directory. Custom section headers inside a provider, nested Auto menus, hiding other providers' models, and replacing Core search/layout are **not** available through the current additive slots. Focused regressions cover directory refresh, selected-model exclusion, stale direct requests, concurrent settings conflicts, Auto/image eligibility and zero-candidate failures against unchanged pinned Core. The prototype's invented model capacity order and response remain illustrative only.
package/lib/client.js CHANGED
@@ -5755,6 +5755,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5755
5755
  discoveredAt: number().int().nonnegative().optional(),
5756
5756
  error: string().optional()
5757
5757
  }).strict().optional(),
5758
+ modelPreferences: object({
5759
+ state: _enum(["ready", "error"]),
5760
+ writable: boolean(),
5761
+ revision: number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).optional(),
5762
+ excludedModelIds: array(string().min(1).max(512)).max(512),
5763
+ lockedModelIds: array(string().min(1).max(512)).max(512),
5764
+ unavailableExcludedModelIds: array(string().min(1).max(512)).max(512),
5765
+ error: _enum([
5766
+ "COPILOT_MODEL_PREFERENCES_UNAVAILABLE",
5767
+ "COPILOT_MODEL_EXCLUSION_SELECTED",
5768
+ "COPILOT_MODEL_EXCLUSION_CONFLICT",
5769
+ "COPILOT_MODEL_EXCLUSION_SAVE_FAILED"
5770
+ ]).optional()
5771
+ }).strict().optional(),
5758
5772
  route: object({
5759
5773
  state: _enum([
5760
5774
  "ready",
@@ -5843,6 +5857,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5843
5857
  parameters: [],
5844
5858
  result
5845
5859
  })),
5860
+ ...["excludeModel", "restoreModel"].map((method) => ({
5861
+ id: `dsh-github-copilot:githubCopilot.${method}`,
5862
+ service: "githubCopilotAuthorization",
5863
+ namespace: "githubCopilot",
5864
+ method,
5865
+ invocation: direct,
5866
+ parameters: [{
5867
+ name: "modelId",
5868
+ wire: "modelId",
5869
+ source: "json",
5870
+ codec: strictRemoteCodec("dsh-github-copilot#GitHubCopilotModelId", string().min(1).max(512))
5871
+ }],
5872
+ result
5873
+ })),
5846
5874
  {
5847
5875
  id: "dsh-github-copilot:githubCopilot.migrationStatus",
5848
5876
  service: "githubCopilotAuthorization",
@@ -7787,6 +7815,99 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7787
7815
  };
7788
7816
  }
7789
7817
  //#endregion
7818
+ //#region lib/types/model-preferences-card.js
7819
+ function GitHubCopilotModelPreferencesPanel(props) {
7820
+ const [query, setQuery] = (0, react.useState)("");
7821
+ const [preferences, setPreferences] = (0, react.useState)(props.preferences);
7822
+ const [busyModel, setBusyModel] = (0, react.useState)();
7823
+ const [error, setError] = (0, react.useState)();
7824
+ (0, react.useEffect)(() => {
7825
+ setPreferences(props.preferences);
7826
+ setError(void 0);
7827
+ }, [props.preferences]);
7828
+ const available = props.models?.models ?? [];
7829
+ if (preferences === void 0) return (0, react.createElement)("details", { "data-dsh-github-copilot-model-preferences": true }, (0, react.createElement)("summary", null, "Model preferences"), (0, react.createElement)("p", { role: "status" }, "Model exclusions are unavailable in this profile."));
7830
+ const excluded = new Set(preferences.excludedModelIds);
7831
+ const locked = new Set(preferences.lockedModelIds);
7832
+ const rows = [...available.map((model) => ({
7833
+ id: model.id,
7834
+ name: model.name,
7835
+ available: true
7836
+ })), ...preferences.unavailableExcludedModelIds.filter((id) => !available.some((model) => model.id === id)).map((id) => ({
7837
+ id,
7838
+ name: id,
7839
+ available: false
7840
+ }))];
7841
+ const needle = query.trim().toLocaleLowerCase();
7842
+ const filtered = rows.filter((model) => needle.length === 0 || model.id.toLocaleLowerCase().includes(needle) || model.name.toLocaleLowerCase().includes(needle));
7843
+ const visibleCount = available.filter((model) => !excluded.has(model.id)).length;
7844
+ const update = async (modelId, restore) => {
7845
+ if (busyModel !== void 0) return;
7846
+ setBusyModel(modelId);
7847
+ setError(void 0);
7848
+ try {
7849
+ const result = restore ? await props.remote.restoreModel(modelId) : await props.remote.excludeModel(modelId);
7850
+ if (!result.ok) {
7851
+ setError("COPILOT_MODEL_EXCLUSION_SAVE_FAILED");
7852
+ return;
7853
+ }
7854
+ const parsed = GitHubCopilotAuthorizationViewSchema.safeParse(result.value);
7855
+ if (!parsed.success || parsed.data.modelPreferences === void 0) {
7856
+ setError("COPILOT_MODEL_PREFERENCES_UNAVAILABLE");
7857
+ return;
7858
+ }
7859
+ setPreferences(parsed.data.modelPreferences);
7860
+ setError(parsed.data.modelPreferences.error);
7861
+ } catch {
7862
+ setError("COPILOT_MODEL_EXCLUSION_SAVE_FAILED");
7863
+ } finally {
7864
+ setBusyModel(void 0);
7865
+ }
7866
+ };
7867
+ return (0, react.createElement)("details", { "data-dsh-github-copilot-model-preferences": true }, (0, react.createElement)("summary", null, `Model preferences · ${visibleCount} visible · ${preferences.excludedModelIds.length} excluded`), (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Excluded models disappear from the managed picker and are never considered by Auto. Restoring a model does not select it."), (0, react.createElement)("label", { style: {
7868
+ display: "grid",
7869
+ gap: "4px",
7870
+ fontSize: "13px"
7871
+ } }, "Search models", (0, react.createElement)("input", {
7872
+ type: "search",
7873
+ value: query,
7874
+ onChange: (event) => setQuery(event.currentTarget.value),
7875
+ placeholder: "Search by name or exact model ID",
7876
+ "data-dsh-github-copilot-model-search": true
7877
+ })), error === void 0 && preferences.error === void 0 ? null : (0, react.createElement)("p", {
7878
+ role: "alert",
7879
+ "data-dsh-github-copilot-model-preferences-error": true
7880
+ }, error ?? preferences.error), filtered.length === 0 ? (0, react.createElement)("p", { role: "status" }, "No models match this search.") : (0, react.createElement)("ul", { style: {
7881
+ listStyle: "none",
7882
+ padding: 0,
7883
+ display: "grid",
7884
+ gap: "8px"
7885
+ } }, filtered.map((model) => {
7886
+ const isExcluded = excluded.has(model.id);
7887
+ const isLocked = locked.has(model.id);
7888
+ const disabled = busyModel !== void 0 || !isExcluded && isLocked;
7889
+ return (0, react.createElement)("li", {
7890
+ key: model.id,
7891
+ style: {
7892
+ display: "flex",
7893
+ gap: "10px",
7894
+ alignItems: "center"
7895
+ }
7896
+ }, (0, react.createElement)("span", { style: {
7897
+ flex: 1,
7898
+ minWidth: 0,
7899
+ overflowWrap: "anywhere"
7900
+ } }, (0, react.createElement)("strong", null, model.name), (0, react.createElement)("br"), (0, react.createElement)("code", null, model.id), model.available ? null : (0, react.createElement)("span", null, " · Temporarily absent from account metadata"), !isExcluded && isLocked ? (0, react.createElement)("span", null, " · Select another model before excluding") : null), (0, react.createElement)("button", {
7901
+ type: "button",
7902
+ disabled,
7903
+ onClick: () => void update(model.id, isExcluded),
7904
+ title: !isExcluded && isLocked ? "Select another fixed model before excluding this one." : void 0,
7905
+ "data-dsh-github-copilot-model-action": isExcluded ? "restore" : "exclude",
7906
+ "data-model-id": model.id
7907
+ }, busyModel === model.id ? "Saving…" : isExcluded ? "Restore" : "Exclude"));
7908
+ })));
7909
+ }
7910
+ //#endregion
7790
7911
  //#region lib/types/client.js
7791
7912
  /**
7792
7913
  * Browser companion for the Models provider-card slot.
@@ -8477,7 +8598,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8477
8598
  }, (0, react.createElement)("p", { style: {
8478
8599
  margin: "0 0 10px",
8479
8600
  fontSize: "13px"
8480
- } }, "Signing in here fetches your account models once. Opening this view refreshes missing or stale metadata when needed. No manual model definitions are needed. Refresh models updates account metadata; it does not verify a model call or change your selected model."), signedIn ? actionButton(refreshing ? "Refreshing models…" : "Refresh models", account.refreshModels, pendingAction, { "data-dsh-github-copilot-refresh-models": true }) : null, models === void 0 ? (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Account model metadata is not available yet.") : (0, react.createElement)(GitHubCopilotAccountModelsSummary, { snapshot: models }), routeStatusMessage(view) === void 0 ? null : (0, react.createElement)("p", { role: "status" }, routeStatusMessage(view)), view?.route?.state === "needs-repair" && signedIn ? actionButton("Repair model configuration", account.reconcile, pendingAction) : null, signedIn ? actionButton(state.operation === "signOut" ? "Signing out…" : "Sign out", account.signOut, pendingAction || view?.writable === false) : null, view?.writable === false ? (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Credentials are read-only in this profile.") : null) : null);
8601
+ } }, "Signing in here fetches your account models once. Opening this view refreshes missing or stale metadata when needed. No manual model definitions are needed. Refresh models updates account metadata; it does not verify a model call or change your selected model."), signedIn ? actionButton(refreshing ? "Refreshing models…" : "Refresh models", account.refreshModels, pendingAction, { "data-dsh-github-copilot-refresh-models": true }) : null, signedIn ? (0, react.createElement)(GitHubCopilotModelPreferencesPanel, {
8602
+ remote: props.remote,
8603
+ models,
8604
+ preferences: view?.modelPreferences
8605
+ }) : null, models === void 0 ? (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Account model metadata is not available yet.") : (0, react.createElement)(GitHubCopilotAccountModelsSummary, { snapshot: models }), routeStatusMessage(view) === void 0 ? null : (0, react.createElement)("p", { role: "status" }, routeStatusMessage(view)), view?.route?.state === "needs-repair" && signedIn ? actionButton("Repair model configuration", account.reconcile, pendingAction) : null, signedIn ? actionButton(state.operation === "signOut" ? "Signing out…" : "Sign out", account.signOut, pendingAction || view?.writable === false) : null, view?.writable === false ? (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Credentials are read-only in this profile.") : null) : null);
8481
8606
  }
8482
8607
  /** Standalone footer presentation; registered Models seats use the shared surface coordinator. */
8483
8608
  function GitHubCopilotPreviewFooter(props) {
@@ -8861,6 +8986,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8861
8986
  exports.GitHubCopilotAccountSurface = GitHubCopilotAccountSurface;
8862
8987
  exports.GitHubCopilotAuthorizationNotice = GitHubCopilotAuthorizationNotice;
8863
8988
  exports.GitHubCopilotCompactAccount = GitHubCopilotCompactAccount;
8989
+ exports.GitHubCopilotModelPreferencesPanel = GitHubCopilotModelPreferencesPanel;
8864
8990
  exports.GitHubCopilotPreviewFooter = GitHubCopilotPreviewFooter;
8865
8991
  exports.GitHubCopilotProviderCard = GitHubCopilotProviderCard;
8866
8992
  exports.GitHubCopilotSettingsSection = GitHubCopilotSettingsSection;