dsh-github-copilot 0.4.0-alpha.45 → 0.4.0-alpha.48
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 +16 -0
- package/README.md +12 -8
- package/README.zh.md +12 -8
- package/deployment-baseline.json +1 -1
- package/docs/automatic-model-routing.md +2 -0
- package/docs/copilot-usage.md +2 -0
- package/lib/client.js +16 -9
- package/lib/client.js.map +1 -1
- package/lib/index.js +68 -23
- package/lib/remote.js +1 -0
- package/lib/types/copilot-usage-remote.d.ts +1 -0
- package/lib/types/copilot-usage-types.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0-alpha.48 (prepared)
|
|
4
|
+
|
|
5
|
+
- Keep the managed Copilot Auto model selected across turns when inherited as a new Session's default; record its durable intent before the first real-model request header and restore the virtual route on later turns (#189).
|
|
6
|
+
- Preserve explicit fixed-model selections, real request headers and per-turn Auto decisions without changing existing Sessions with a recorded concrete route.
|
|
7
|
+
- Supersede unpublished alpha.47 after its immutable pre-created tag failed the protected exact-annotation check; no alpha.47 GitHub Release or npm package was created.
|
|
8
|
+
|
|
9
|
+
## 0.4.0-alpha.47 (publication blocked)
|
|
10
|
+
|
|
11
|
+
- Publication stopped after packing and checksum verification because the immutable pre-created tag's annotation did not satisfy the protected exact-message check.
|
|
12
|
+
- The alpha.47 tag remains unchanged and is not reused; its prepared Copilot Auto selection fix is carried by alpha.48.
|
|
13
|
+
|
|
14
|
+
## 0.4.0-alpha.46 (prepared)
|
|
15
|
+
|
|
16
|
+
- Distinguish known TLS certificate-verification failures from other Copilot quota network errors without revealing provider errors or disabling certificate validation (#186).
|
|
17
|
+
- Keep unavailable quota details readable: omit empty large-value columns and budget placeholders, use an opaque popover background, and bound long values within the dialog.
|
|
18
|
+
|
|
3
19
|
## 0.4.0-alpha.45 (prepared)
|
|
4
20
|
|
|
5
21
|
- Add a fixed, allowlisted latest-observed authorization milestone to failed sign-in diagnostics without inspecting or retaining rejected values, provider responses, credentials, prompts, notices, or nested causes (#178).
|
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ The Host reads GitHub's internal quota endpoint using the existing canonical OAu
|
|
|
85
85
|
|
|
86
86
|
## Install and sign in
|
|
87
87
|
|
|
88
|
-
The commands below target the package version `0.4.0-alpha.
|
|
88
|
+
The commands below target the package version `0.4.0-alpha.48`. 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):
|
|
89
89
|
|
|
90
90
|
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):
|
|
91
91
|
|
|
@@ -98,10 +98,10 @@ Include any launcher patch files with repeated `--patch /absolute/file` argument
|
|
|
98
98
|
For a standalone named profile only, the supported CLI command is:
|
|
99
99
|
|
|
100
100
|
```sh
|
|
101
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
101
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.48/dsh-github-copilot-0.4.0-alpha.48.tgz
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.
|
|
104
|
+
For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.48` 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.
|
|
105
105
|
|
|
106
106
|
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.
|
|
107
107
|
|
|
@@ -117,6 +117,8 @@ Then open the Models UI listed above, find **GitHub Copilot**, select **Sign in*
|
|
|
117
117
|
|
|
118
118
|
The managed GitHub Copilot group includes a virtual **Auto** model. Auto resolves once per Core turn to a real model from the current authenticated account catalog; every tool step, retry and automatic compaction recovery in that turn stays on that real model, while a later Chat or Goal turn may choose again. Image turns require an account-verified image-capable candidate. The completed turn tail shows `Auto · <actual model>` with a compact `?` explanation. Search keeps its independent provider-owned model policy, and general native subagents continue to inherit Core's concrete route rather than being relabeled as Auto. The deterministic MVP uses advertised capacity only and makes no model-quality, latency, price, health or GitHub-private-router claim. See the [MVP contract and mockup](./docs/automatic-model-routing.md).
|
|
119
119
|
|
|
120
|
+
When Auto is inherited as the default in a new Session, the first resolved request records Auto as the Session's durable selection while its request header still records the real model. Later turns remain on Auto instead of locking to that header; explicitly selecting a real model switches to the fixed route. Existing Sessions with a concrete recorded choice are not migrated by a change to the global default.
|
|
121
|
+
|
|
120
122
|
One shared account-state owner survives transfer while another eligible surface remains mounted. Last-surface unmount or nonoverlapping declaration replacement stops polling; a later mount reads status and separately ensures metadata if needed. Status reads and details toggles themselves remain network-free, but opening Models can discover missing/stale signed-in metadata. Background credential/reset notifications clear Client state and read status rather than forcing discovery on every token event; the next open/use ensures metadata.
|
|
121
123
|
|
|
122
124
|
Concurrent status retries join the compact account's pending read. An obsolete read must settle before that controller reads for a new lifetime; Remote has no cancellation contract, so a permanently hung read still needs connection recovery. Authorization polling backs off from 500 ms to 1 s and then 2 s (32 reads in the first minute with immediate replies). Status errors stop polling and expose an explicit retry; sign-in, cancellation and other mutations are never automatically replayed. Credential invalidation and the bounded initial metadata check retain their existing behavior. These are plugin request-pressure safeguards, not a fix for incompatible Agent presets or Core-wide request scheduling.
|
|
@@ -167,9 +169,11 @@ Agents should treat the browser authorization as a human handoff, not as a token
|
|
|
167
169
|
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.
|
|
168
170
|
6. Use **Sign out** only when the user explicitly asks to disconnect the account. It deletes the Copilot credential record but preserves route settings.
|
|
169
171
|
|
|
170
|
-
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.
|
|
172
|
+
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.48`, 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).
|
|
173
|
+
|
|
174
|
+
**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. A pinned public Loader characterization records that, with the exact bundle IDs and an active provider, staged first-add can leave global `ctx.web` and an active consumer unavailable even after the routed row is enabled. A separate complete cold-loaded Web-routing composition works initially but loses global `ctx.web` and its consumer on removal and remains unavailable after re-add/reconciliation. An earlier temporary harness used alias IDs and no active provider, so its successful final add was not equivalent to the exact bundle fixture. These are synthetic Loader observations, not native Desktop manager coverage or proof of restart recovery. Do not use bundle removal/re-add as a hot-upgrade workaround; follow the manager's upgrade result and separately authorized restart requirements. See [the rc.2 lifecycle characterization and bounded public-API finding](https://github.com/cloga/dsh-github-copilot/blob/main/docs/web-lifecycle-rc2.md).
|
|
171
175
|
|
|
172
|
-
**
|
|
176
|
+
**Host TLS trust diagnostics:** no Desktop trust preference was found. The linked lifecycle note records a narrowly scoped, user-owned launcher option for a fresh Desktop process with Node system CA trust enabled; it expands the accepted CA set and is not a fix established for the prior sign-in failure. It requires a full quit first to avoid single-instance handoff and durable launcher/standard-I/O lifetime. It is documentation only: no launcher, global environment, Desktop profile, shortcut, trust store, or live process was changed.
|
|
173
177
|
|
|
174
178
|
No `copilot2api` process, external gateway, placeholder API key, pasted GitHub token, or separate `dsh-web-search-provider` installation is required.
|
|
175
179
|
|
|
@@ -435,8 +439,8 @@ Report the published Release URL, version, tag/commit and verified asset SHA-256
|
|
|
435
439
|
`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.
|
|
436
440
|
|
|
437
441
|
```sh
|
|
438
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
439
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
442
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.48/dsh-github-copilot-0.4.0-alpha.48.tgz
|
|
443
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.48/SHA256SUMS
|
|
440
444
|
sha256sum --check SHA256SUMS
|
|
441
445
|
```
|
|
442
446
|
|
|
@@ -444,7 +448,7 @@ PowerShell can verify the same two downloaded files with:
|
|
|
444
448
|
|
|
445
449
|
```powershell
|
|
446
450
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
447
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
451
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.48.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
448
452
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
449
453
|
```
|
|
450
454
|
|
package/README.zh.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
一个聚焦 GitHub Copilot 登录、通用账号模型发现、Copilot 专用 Tool 兼容与供应方托管搜索的 DSH companion。插件根据供应方返回的端点和能力元数据组装模型,复用公开的 `@deepseek-ai/dsh-llm-pi-ai` adapter 与 pi-ai SDK,不另写一套通用传输/序列化器,也不维护需要逐个添加新模型 ID 的静态目录。
|
|
11
11
|
|
|
12
|
-
> 下文自动维护账号模型元数据与 provider 集成控件描述目标版本 `0.4.0-alpha.
|
|
12
|
+
> 下文自动维护账号模型元数据与 provider 集成控件描述目标版本 `0.4.0-alpha.48`;这不代表已有的两条真实路由被合并或移除。版本化 URL 不表示 Release 已发布或本机已加载;仅在该 Release 与校验和可用后使用安装命令。源码、发布制品、已安装版本和实际加载运行时需分别确认,本地升级和中断会话的重启仍需用户批准。
|
|
13
13
|
|
|
14
14
|
Alpha.24 修复了 Web search 卡片缺少精确 Remote 依赖声明的问题。当时卡片位于 **设置 → 模型**(`settings.models.footer`,list/root),旧 Core 回退到独立 Web search section。现在优先显示在插件详情页;搜索子 Fiber 仍独立等待 routing namespace,不影响账号控件和既有搜索安全检查;实际打包 Desktop 验收仍是独立关卡。
|
|
15
15
|
|
|
@@ -100,10 +100,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
|
|
|
100
100
|
仅对独立的具名 profile,获准且网络可用时,可通过受支持的 CLI 命令安装:
|
|
101
101
|
|
|
102
102
|
```sh
|
|
103
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
103
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.48/dsh-github-copilot-0.4.0-alpha.48.tgz
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.
|
|
106
|
+
Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.48`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
|
|
107
107
|
|
|
108
108
|
随后打开上表对应的 Models UI,找到 **GitHub Copilot**,点击 **Sign in** 并完成 GitHub device-code 流程。安装会修改指定 profile;是否立即激活取决于该 profile 的常规 reload/restart 策略。
|
|
109
109
|
|
|
@@ -119,6 +119,8 @@ Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理
|
|
|
119
119
|
|
|
120
120
|
托管 GitHub Copilot 分组包含一个虚拟 **Auto** 模型。Auto 在每个 Core turn 只解析一次,从当前认证账号目录选择一个真实模型;同轮的工具步骤、重试和自动 compact 恢复始终使用该真实模型,后续 Chat 或 Goal 新轮次可以重新选择。图片轮次必须有账号元数据验证过的图片模型。完成回复的末尾显示 `Auto · <真实模型>`,同一行 `?` 提供简短原因。搜索继续使用独立的 Provider 内部模型策略;通用原生子代理仍继承 Core 的具体路由,不被重新标成 Auto。首版确定性策略只使用供应方公布的容量,不声称知道模型质量、延迟、价格、健康状态或 GitHub 私有 Auto 算法。详见 [MVP 合同与 mockup](./docs/automatic-model-routing.md)。
|
|
121
121
|
|
|
122
|
+
新 Session 继承默认 Auto 时,首次解析请求会把 Auto 记录为该 Session 的持久选择,请求头仍记录实际使用的模型。后续轮次继续处于 Auto,而不会固定到该请求头;只有显式手选真实模型才切换到固定路由。全局默认值变化不会迁移已有具体模型记录的 Session。
|
|
123
|
+
|
|
122
124
|
只有另一个符合条件的表面仍挂载时,切换才保留共享账号状态 owner。最后一个表面卸载或声明替换没有挂载重叠时停止轮询;以后挂载会先读状态,再按需另行确保元数据。状态读取和详情切换本身仍不访问网络,但打开 Models 可以发现缺失/过期的已登录账号元数据。后台凭据/reset 通知清除 Client 状态并只读查询,不在每次 token 事件强制发现;下次打开/使用时再确保元数据。
|
|
123
125
|
|
|
124
126
|
并发的状态重试共用紧凑账号控件尚未完成的读取。旧读取结束后,该控制器才为新的挂载生命周期读取;Remote 没有取消协议,因此永久挂起仍需恢复连接。授权轮询从 500 毫秒退避至 1 秒、再到 2 秒(响应立即返回时首分钟 32 次读取)。状态错误停止轮询并提供显式重试;登录、取消等写操作绝不自动重放。凭据失效通知和有界的首次元数据检查保留原有行为。这些措施只降低插件请求压力,不修复不兼容的 Agent preset 或 Core 全局请求调度。
|
|
@@ -169,9 +171,11 @@ Agent 应把浏览器授权视为需要用户完成的 handoff,而不是自行
|
|
|
169
171
|
5. 确认 **Signed in** 并检查自动发现结果,再请用户选择模型。已登录时打开 Models 会自动确保缺失/过期元数据,新鲜 ready 缓存不发请求。错误可使用 **Retry**,有意强制更新时使用 **Manage → Refresh models**,不作为常规设置步骤。状态读取本身不发现;登录、元数据与真实调用成功是独立证据。
|
|
170
172
|
6. 只有用户明确要求断开账号时才使用 **Sign out**;它会删除 Copilot credential record,但保留 route settings。
|
|
171
173
|
|
|
172
|
-
每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.
|
|
174
|
+
每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.48`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
|
|
175
|
+
|
|
176
|
+
**Desktop package 更新与 Web 生命周期边界:**原生 manager 对已安装 package 原位升级返回的 `restart-required` 是权威结果,与移除/重加 plugin bundle 的行为是两个不同问题。pinned public Loader characterization 记录了:使用 bundle 的精确 ID 且 provider 已激活时,分阶段首次添加可能在 routed row 启用后仍令全局 `ctx.web` 和 consumer 不可用;另一独立序列从完整冷加载且正常工作的 Web-routing composition 开始,移除后全局 `ctx.web` 与 consumer 不可用,重加/重试 reconciliation 仍未恢复。较早的临时 harness 使用别名 ID 且没有 active provider,因此其最终添加成功并不等同于精确 bundle fixture。这些都是合成 Loader 观察,不是原生 Desktop manager 覆盖,也不证明重启后恢复。不要用移除/重加 bundle 作为热升级绕行;遵循 manager 的升级结果及另行批准的重启要求。详见 [rc.2 生命周期 characterization 与有限的 public API 结论](https://github.com/cloga/dsh-github-copilot/blob/main/docs/web-lifecycle-rc2.md)。
|
|
173
177
|
|
|
174
|
-
**
|
|
178
|
+
**Host TLS trust 诊断:**未发现 Desktop trust 设置。上述生命周期说明记录了一个仅供未来选择的、用户自有 launcher 选项:为全新 Desktop process 启用 Node system CA trust;它会扩大可接受 CA 集合,且尚未证明能修复先前 sign-in 失败。必须先完整退出,以免单实例 handoff,并让 launcher 及其标准 I/O 在 Desktop 生命周期内保持有效。这仅是文档建议;没有创建 launcher,也没有修改全局环境、Desktop profile、快捷方式、trust store 或运行中的进程。
|
|
175
179
|
|
|
176
180
|
不需要运行 `copilot2api`,不需要外部 gateway、placeholder API key、原始 GitHub token 或单独安装 `dsh-web-search-provider`。
|
|
177
181
|
|
|
@@ -446,8 +450,8 @@ node scripts/agent.mjs attribution "DeepSeek Harness (DSH)"
|
|
|
446
450
|
`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 要求包已存在,不能代替首次建包。不会批量补发历史版本。
|
|
447
451
|
|
|
448
452
|
```sh
|
|
449
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
450
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
453
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.48/dsh-github-copilot-0.4.0-alpha.48.tgz
|
|
454
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.48/SHA256SUMS
|
|
451
455
|
sha256sum --check SHA256SUMS
|
|
452
456
|
```
|
|
453
457
|
|
|
@@ -455,7 +459,7 @@ PowerShell 可以对已下载的同一组文件执行:
|
|
|
455
459
|
|
|
456
460
|
```powershell
|
|
457
461
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
458
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
462
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.48.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
459
463
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
460
464
|
```
|
|
461
465
|
|
package/deployment-baseline.json
CHANGED
|
@@ -122,6 +122,8 @@ The plugin uses only published public seams:
|
|
|
122
122
|
|
|
123
123
|
The virtual Auto selection can remain pending while the real request header records the actual model. This is intentional: an unrelated real header must not consume the durable Auto preference. A later explicit picker selection replaces the pending Auto choice through Core's normal projection.
|
|
124
124
|
|
|
125
|
+
For an otherwise unselected Session that inherits Auto from the global default, the first virtual request persists a `model/selection` Auto intent before its real request header. Core's request-header fallback would otherwise make the next turn fixed. The plugin restores the pending Auto route during subsequent prompt assembly and request resolution without changing the real header, and yields immediately to a later explicit selection. It does not turn an existing Session with a real recorded route into Auto just because the global default changed.
|
|
126
|
+
|
|
125
127
|
## Acceptance criteria
|
|
126
128
|
|
|
127
129
|
The MVP is accepted only when unchanged official Core contract tests prove:
|
package/docs/copilot-usage.md
CHANGED
|
@@ -24,6 +24,8 @@ The Host uses the existing `llm-pi-ai/github-copilot` OAuth grant through public
|
|
|
24
24
|
|
|
25
25
|
Quota requests are lazy, single-flight and bounded by timeout, response size and cache/failure policy. Account continuity is checked around asynchronous work and before releasing cached data. Authentication denial, sign-out, account invalidation or disposal must not release a previous account's snapshot. A same-account transient failure may expose a timestamped last-known snapshot, never a current balance. Responses and diagnostics exclude tokens, raw provider bodies and account identifiers. Requests do not follow redirects with the credential; custom enterprise hosts are not guessed.
|
|
26
26
|
|
|
27
|
+
Known certificate-validation failures in the Host fetch are reported as `COPILOT_USAGE_TLS` instead of an undifferentiated network failure. This is a read-only diagnostic, not proof of the exact Desktop network path or authorization state; inspect the Host's trust store and approved proxy configuration without disabling TLS validation. Other fetch failures remain `COPILOT_USAGE_NETWORK`. When the account snapshot is unavailable, details show the diagnostic and guidance instead of empty oversized credit columns or an implied budget. The popover background is opaque even if the host's menu token contains transparency.
|
|
28
|
+
|
|
27
29
|
The Client receives only the separate strict `githubCopilotUsage` namespace (`get` and `refresh`). Existing authorization and migration methods retain their schemas. Refresh does not change settings, budget, plan, model selection or billing policy. This meter is informational and does not authorize spending or implement a budget enforcement loop.
|
|
28
30
|
|
|
29
31
|
## Source contracts and limitations
|
package/lib/client.js
CHANGED
|
@@ -5496,6 +5496,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5496
5496
|
"COPILOT_USAGE_POOLED_EXHAUSTED",
|
|
5497
5497
|
"COPILOT_USAGE_NO_ALLOCATION",
|
|
5498
5498
|
"COPILOT_USAGE_NETWORK",
|
|
5499
|
+
"COPILOT_USAGE_TLS",
|
|
5499
5500
|
"COPILOT_USAGE_TIMEOUT",
|
|
5500
5501
|
"COPILOT_USAGE_BODY_TOO_LARGE",
|
|
5501
5502
|
"COPILOT_USAGE_REDIRECT",
|
|
@@ -6824,6 +6825,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6824
6825
|
refreshing: "Refreshing…",
|
|
6825
6826
|
error: "Could not refresh usage. Try again.",
|
|
6826
6827
|
unavailableExplanation: "Account usage is currently unavailable.",
|
|
6828
|
+
tlsError: "Could not verify the connection to GitHub. Check your trusted certificates or network proxy; TLS verification stays enabled.",
|
|
6827
6829
|
signedOut: "Sign in to Copilot in Models to view account usage.",
|
|
6828
6830
|
lastUpdated: "Last updated",
|
|
6829
6831
|
reset: "Resets",
|
|
@@ -6855,6 +6857,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6855
6857
|
refreshing: "正在刷新…",
|
|
6856
6858
|
error: "无法刷新用量,请重试。",
|
|
6857
6859
|
unavailableExplanation: "当前无法获取账号用量。",
|
|
6860
|
+
tlsError: "无法验证与 GitHub 的连接。请检查受信任证书或网络代理;TLS 验证仍保持开启。",
|
|
6858
6861
|
signedOut: "请在模型设置中登录 Copilot,以查看账号用量。",
|
|
6859
6862
|
lastUpdated: "更新于",
|
|
6860
6863
|
reset: "重置时间",
|
|
@@ -7105,7 +7108,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7105
7108
|
border,
|
|
7106
7109
|
borderRadius: 14,
|
|
7107
7110
|
color: "var(--dsw-alias-label-primary, CanvasText)",
|
|
7108
|
-
background: "var(--dsw-specific-menu, Canvas)",
|
|
7111
|
+
background: "linear-gradient(var(--dsw-specific-menu, Canvas), var(--dsw-specific-menu, Canvas)), Canvas",
|
|
7109
7112
|
fontFamily: "var(--dsw-font-family, inherit)",
|
|
7110
7113
|
fontSize: 13,
|
|
7111
7114
|
boxShadow: "0 8px 32px color-mix(in srgb, CanvasText 16%, transparent)",
|
|
@@ -7131,17 +7134,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7131
7134
|
}, t.missing) : null, failed ? (0, react.createElement)("p", {
|
|
7132
7135
|
role: "alert",
|
|
7133
7136
|
style: muted
|
|
7134
|
-
}, t.error) : null, view?.state === "signed-out" ? (0, react.createElement)("p", { style: muted }, t.signedOut) : !available && !busy && props.remote !== void 0 ? (0, react.createElement)("p", { style: muted }, t.unavailableExplanation) : null, (0, react.createElement)("div", { style: {
|
|
7137
|
+
}, t.error) : null, view?.state === "signed-out" ? (0, react.createElement)("p", { style: muted }, t.signedOut) : !available && !busy && props.remote !== void 0 ? (0, react.createElement)("p", { style: muted }, view?.diagnostic === "COPILOT_USAGE_TLS" ? t.tlsError : t.unavailableExplanation) : null, available ? (0, react.createElement)("div", { style: {
|
|
7135
7138
|
display: "grid",
|
|
7136
|
-
gridTemplateColumns: "
|
|
7139
|
+
gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
|
|
7137
7140
|
gap: 12
|
|
7138
|
-
} }, (0, react.createElement)("div",
|
|
7141
|
+
} }, (0, react.createElement)("div", { style: { minWidth: 0 } }, (0, react.createElement)("p", { style: muted }, t.usedLabel), (0, react.createElement)("strong", { style: {
|
|
7142
|
+
display: "block",
|
|
7139
7143
|
fontSize: 22,
|
|
7140
|
-
fontVariantNumeric: "tabular-nums"
|
|
7141
|
-
|
|
7144
|
+
fontVariantNumeric: "tabular-nums",
|
|
7145
|
+
overflowWrap: "anywhere"
|
|
7146
|
+
} }, format(used)), (0, react.createElement)("p", { style: muted }, unit)), (0, react.createElement)("div", { style: { minWidth: 0 } }, (0, react.createElement)("p", { style: muted }, t.remaining), (0, react.createElement)("strong", { style: {
|
|
7147
|
+
display: "block",
|
|
7142
7148
|
fontSize: 22,
|
|
7143
|
-
fontVariantNumeric: "tabular-nums"
|
|
7144
|
-
|
|
7149
|
+
fontVariantNumeric: "tabular-nums",
|
|
7150
|
+
overflowWrap: "anywhere"
|
|
7151
|
+
} }, format(remaining)), (0, react.createElement)("p", { style: muted }, unit))) : null, percent === void 0 ? null : (0, react.createElement)("div", {
|
|
7145
7152
|
role: "progressbar",
|
|
7146
7153
|
"aria-label": t.progress,
|
|
7147
7154
|
"aria-valuemin": 0,
|
|
@@ -7160,7 +7167,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7160
7167
|
} })), view?.state === "ready" && percent !== void 0 && percent >= 90 ? (0, react.createElement)("p", {
|
|
7161
7168
|
role: "status",
|
|
7162
7169
|
style: muted
|
|
7163
|
-
}, t.low) : null, (0, react.createElement)("p", { style: muted },
|
|
7170
|
+
}, t.low) : null, available ? (0, react.createElement)("p", { style: muted }, view.budget === "pooled" ? t.pooled : limit === void 0 ? t.budgetUnknown : `${t.individual}: ${format(limit)} ${unit}`) : null, numbers ? (0, react.createElement)("p", { style: muted }, t.rounding) : null, reset === void 0 ? null : (0, react.createElement)("p", { style: muted }, `${t.reset}: ${reset}`), (0, react.createElement)("div", { style: {
|
|
7164
7171
|
...row,
|
|
7165
7172
|
...separator
|
|
7166
7173
|
} }, (0, react.createElement)("span", { style: muted }, observed === void 0 ? null : `${t.lastUpdated}: ${observed}`), (0, react.createElement)("button", {
|