dsh-github-copilot 0.4.0-alpha.71 → 0.4.0-alpha.73
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 +4 -1
- package/CHANGELOG.md +12 -0
- package/README.md +9 -8
- package/README.zh.md +9 -8
- package/deployment-baseline.json +20 -1
- package/docs/copilot-usage.md +12 -0
- package/lib/client.js +248 -101
- package/lib/client.js.map +1 -1
- package/lib/index.js +203 -3
- package/lib/types/context-evidence-ui.d.ts +11 -0
- package/lib/types/context-evidence.d.ts +108 -0
- package/lib/types/context-usage-guard.d.ts +10 -0
- package/package.json +2 -1
package/AGENTS.md
CHANGED
|
@@ -43,7 +43,7 @@ This repository owns eleven narrow surfaces:
|
|
|
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. The separately selected, single-service [manual recovery engine](./docs/manual-compaction-recovery.md) may use bounded, explicit intermediate summaries through the public subclass hook; the preventive default never claims recovery of an already oversized manual summary.
|
|
46
|
-
11. Optional account quota reads and a session-scoped composer usage control through public credentials, strict Remotes and additive slots. Keep account billing-cycle credits separate from context tokens and session cost. Missing, pooled, legacy and stale data must retain their real semantics; never infer credits from token estimates or account deltas. See [quota boundaries](./docs/copilot-usage.md).
|
|
46
|
+
11. Optional account quota reads and a session-scoped composer usage control through public credentials, strict Remotes and additive slots. Keep account billing-cycle credits separate from context tokens and session cost. Missing, pooled, legacy and stale data must retain their real semantics; never infer credits from token estimates or account deltas. Managed terminal failed-zero usage protection and a separate plugin-owned historical context projection may diagnose invalid readings, never replace Core's meter, infer current occupancy/percentages or rewrite history. See [quota boundaries](./docs/copilot-usage.md).
|
|
47
47
|
|
|
48
48
|
## Retired model-role compatibility boundary (#158)
|
|
49
49
|
|
|
@@ -61,6 +61,7 @@ Alpha.25 admits native `subagent/descriptor` v3, already v3 in the retained rc.1
|
|
|
61
61
|
- `src/reasoning-presentation.ts`: guarded native Chat delegation and historical Copilot provenance; filters temporary view props only, never messages, signatures, replay indexes or usage.
|
|
62
62
|
- `src/remote.ts`: Typert Remote contribution. Never add credential payloads here.
|
|
63
63
|
- `src/copilot-usage-host.ts`, `src/copilot-usage-remote.ts`, `src/copilot-usage-card.ts`, `src/copilot-usage-ui.ts`: bounded Host quota snapshots, an independent strict namespace and reversible composer presentation. No real account fetches in tests, private Client store/DOM injection, new credential owner or general model wire.
|
|
64
|
+
- `src/context-usage-guard.ts`, `src/context-evidence.ts`, `src/context-evidence-ui.ts`: managed-only terminal failed-zero protection and bounded numeric historical evidence through a plugin-owned public projection and additive composer disclosure. Historical counts never become current occupancy; Core pressure, billing and durable events stay unchanged.
|
|
64
65
|
- `src/current-provider.ts`: selected DSH route plus installed pi-ai catalog facts.
|
|
65
66
|
- `src/temporary-models.ts`: exact, account-gated corrections with semantic protocol/capability retirement.
|
|
66
67
|
- `src/model-protocol.ts`: explicit Core capability detection and conservative legacy fallback.
|
|
@@ -240,6 +241,8 @@ Parent-model following uses the profile-wide `github-copilot.followParentModel`
|
|
|
240
241
|
|
|
241
242
|
Model preferences must survive the Client's owned-field projection before strict decoding. `excludedModelIds` is a hidden volatile Config leaf, read via `readInlineConfig`; exercise native SettingsForms CAS, fiber preservation and restart persistence, not only map-backed settings mocks. Missing preference/selection evidence leaves model rows read-only with named diagnostics and status-only Retry. Unknown exclusion state is not an empty exclusion set. Discovery diagnostics stay in a separate Manage disclosure.
|
|
242
243
|
|
|
244
|
+
Capture the traced `remote.githubCopilot` namespace once per account UI registration, shared by provider/footer/section renders. Native namespace property reads create fresh proxy identities; rereading during parent renders resets the mounted account controller and can block exclusion changes on redundant status/discovery work. Actual registration teardown and credential/connection invalidation retain their existing safety semantics.
|
|
245
|
+
|
|
243
246
|
Auto history compatibility (alpha.54, #204): official rc.2 `Session.append()` has no public ignorable-envelope option. Do not emit optional `github-copilot/auto-model-decision` events or borrow another event type; retain native real-model provenance and durable Auto selection without new durable decision recording. The assistant-actions selection footer reads bounded Host-lifetime decisions through native agent-scoped lookup and compatible historical events. Explicit captured fixed selection alone proves Manual; missing evidence is unknown, never reconstructed from today's picker. Do not repeat model names, add Model details, change native Usage/context metering or modify parent DOM. `scripts/repair-auto-model-history.mjs` is explicit source-checkout maintenance, not a runtime hook: strict pinned official v4 validation, check-only by default, optional detached repaired copy plus byte-exact backup. It never replaces live history. Applying a copy requires separately approved stopped writers and a fresh source-hash check. See `docs/automatic-model-routing.md`.
|
|
244
247
|
|
|
245
248
|
1. Identify the owning seam using `agent-contract.json`; do not duplicate an upstream owner.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0-alpha.73 (prepared)
|
|
4
|
+
|
|
5
|
+
- Prevent managed Copilot failure/cancellation terminal zero-usage samples from resetting native context pressure; preserve successful zero and real nonzero usage (#242).
|
|
6
|
+
- Add a strict plugin-owned historical context projection and an additive composer disclosure for replayed failed-zero readings. Last input-plus-cache samples are historical evidence, never current occupancy or inferred percentages.
|
|
7
|
+
- Revoke old samples on route changes, compaction, surface replacement and invalid attribution. Keep the Core meter, account Credits, durable history, retries and compaction ownership unchanged.
|
|
8
|
+
|
|
9
|
+
## 0.4.0-alpha.72 (prepared)
|
|
10
|
+
|
|
11
|
+
- Retain the mounted account controller and model metadata across exclusion-driven Models rerenders by capturing the native traced Copilot Remote once per UI registration (#240).
|
|
12
|
+
- Avoid redundant account status and model-discovery work on provider/footer/section rerenders; preserve real registration teardown, credential invalidation, selection locks and exclusion CAS.
|
|
13
|
+
- Add regressions with fresh Remote proxies and a blocked second status read, plus exact published-gateway namespace identity evidence. No Core changes or Desktop install/restart.
|
|
14
|
+
|
|
3
15
|
## 0.4.0-alpha.71 (prepared)
|
|
4
16
|
|
|
5
17
|
- Decouple the Auto selection footer from optional conversation projections and wait for its exact Remote namespace (#238).
|
package/README.md
CHANGED
|
@@ -19,6 +19,7 @@ Core still owns image conversion and history. See [image compatibility limits](.
|
|
|
19
19
|
- **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.
|
|
20
20
|
- **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.
|
|
21
21
|
- **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.
|
|
22
|
+
- **Context evidence:** managed requests suppress terminal all-zero usage on failure or cancellation. A separate composer disclosure can identify historical failed-zero readings and show the last applicable input sample, including cache. This is not current occupancy, does not replace the native `0%` meter, and does not rewrite history. See [context evidence boundaries](./docs/copilot-usage.md#historical-context-evidence).
|
|
22
23
|
- **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.
|
|
23
24
|
|
|
24
25
|

|
|
@@ -103,7 +104,7 @@ The Host reads GitHub's internal quota endpoint using the existing canonical OAu
|
|
|
103
104
|
|
|
104
105
|
## Install and sign in
|
|
105
106
|
|
|
106
|
-
The commands below target the package version `0.4.0-alpha.
|
|
107
|
+
The commands below target the package version `0.4.0-alpha.73`. 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):
|
|
107
108
|
|
|
108
109
|
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):
|
|
109
110
|
|
|
@@ -116,10 +117,10 @@ Include any launcher patch files with repeated `--patch /absolute/file` argument
|
|
|
116
117
|
For a standalone named profile only, the supported CLI command is:
|
|
117
118
|
|
|
118
119
|
```sh
|
|
119
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
120
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.73/dsh-github-copilot-0.4.0-alpha.73.tgz
|
|
120
121
|
```
|
|
121
122
|
|
|
122
|
-
For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.
|
|
123
|
+
For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.73` 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.
|
|
123
124
|
|
|
124
125
|
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.
|
|
125
126
|
|
|
@@ -129,7 +130,7 @@ Then open the Models UI listed above, find **GitHub Copilot**, select **Sign in*
|
|
|
129
130
|
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.
|
|
130
131
|
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.
|
|
131
132
|
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.
|
|
132
|
-
5. Choose an accepted model under **GitHub Copilot** (stable route ID `github-copilot-preview`). Normal opening/use maintains metadata without requiring **Refresh models**. **Manage → Model preferences** provides search, **All / Enabled / Excluded** filters, and immediate **Exclude/Restore** actions. Excluded exact IDs disappear from the managed picker and every Auto pool; temporarily absent excluded IDs remain restorable. Models selected by a live session or the future default are locked until those fixed selections change. No exclusion rewrites history, changes selection, or mutates account entitlement. **Discovery details** contains metadata diagnostics separately from the model controls. Legacy configuration diagnostics and explicit repair remain available when needed, and the [migration guide](./docs/single-route-migration.md) remains in the documentation.
|
|
133
|
+
5. Choose an accepted model under **GitHub Copilot** (stable route ID `github-copilot-preview`). Normal opening/use maintains metadata without requiring **Refresh models**. **Manage → Model preferences** provides search, **All / Enabled / Excluded** filters, and immediate **Exclude/Restore** actions. Excluded exact IDs disappear from the managed picker and every Auto pool; temporarily absent excluded IDs remain restorable. Exclusion-driven parent renders retain the mounted account controller and metadata without restarting status checks or model discovery. Models selected by a live session or the future default are locked until those fixed selections change. No exclusion rewrites history, changes selection, or mutates account entitlement. **Discovery details** contains metadata diagnostics separately from the model controls. Legacy configuration diagnostics and explicit repair remain available when needed, and the [migration guide](./docs/single-route-migration.md) remains in the documentation.
|
|
133
134
|
|
|
134
135
|
If preferences cannot be read, available account rows remain visible but read-only. Unknown exclusion status is not shown as enabled. A named diagnostic distinguishes unavailable/invalid settings from incomplete selection evidence; **Retry** reads Host status only, without refreshing OAuth or discovering models. Failed writes retain the last confirmed state. Exclusions use native live, hidden Config fields and path-level settings CAS, so saving does not remount the plugin. Account model discovery alone does not prove that preference settings or model transport are working.
|
|
135
136
|
|
|
@@ -172,7 +173,7 @@ Agents should treat the browser authorization as a human handoff, not as a token
|
|
|
172
173
|
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.
|
|
173
174
|
6. Use **Sign out** only when the user explicitly asks to disconnect the account. It deletes the Copilot credential record but preserves route settings.
|
|
174
175
|
|
|
175
|
-
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.
|
|
176
|
+
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.73`, 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).
|
|
176
177
|
|
|
177
178
|
**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.
|
|
178
179
|
|
|
@@ -447,8 +448,8 @@ Report the published Release URL, version, tag/commit and verified asset SHA-256
|
|
|
447
448
|
`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.
|
|
448
449
|
|
|
449
450
|
```sh
|
|
450
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
451
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
451
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.73/dsh-github-copilot-0.4.0-alpha.73.tgz
|
|
452
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.73/SHA256SUMS
|
|
452
453
|
sha256sum --check SHA256SUMS
|
|
453
454
|
```
|
|
454
455
|
|
|
@@ -456,7 +457,7 @@ PowerShell can verify the same two downloaded files with:
|
|
|
456
457
|
|
|
457
458
|
```powershell
|
|
458
459
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
459
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
460
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.73.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
460
461
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
461
462
|
```
|
|
462
463
|
|
package/README.zh.md
CHANGED
|
@@ -19,13 +19,14 @@ Core 管理。详见[图片兼容性与限制](./docs/image-input-compatibility.
|
|
|
19
19
|
- **账号与模型:**在 **设置 → 模型** 的原生 GitHub Copilot 行内完成登录、查看账号发现模型、刷新元数据及账号管理。可在 **Manage → Model preferences** 中按精确 ID 排除模型,使其同时退出托管 picker 与 Auto 候选池;Core 原生 picker 仍保持平铺。
|
|
20
20
|
- **搜索路由:**在 **插件 → dsh-github-copilot → 详情**选择主搜索 Provider 与兜底 Provider。页面只保留用户真正需要的两项选择,不再把协议探测、超时、白名单或传输开关作为日常配置暴露;同时会在停用/移除/升级前常驻显示 rc.2 生命周期提示。更新后的路由服务尚未激活时,卡片会明确显示 **需要重启生效(Restart required)**,而不是继续展示无法使用的表单。
|
|
21
21
|
- **用量:**符合条件的 Copilot 会话会在输入框旁显示可选的 **Credits / 额度** 控件,展示供应方明确返回的计费周期数据,并如实区分不可用与历史快照。仅额度请求组合 Node 默认证书与系统信任根,无需依赖 Desktop launcher 的环境变量继承,且保持 TLS 验签。
|
|
22
|
+
- **上下文证据:**托管请求失败或取消时,不再传递终止前的全零用量。独立的输入框提示可识别历史失败零值,并显示仍适用的最后输入采样(含缓存);它不是当前占用率,不替换原生 `0%` 表盘,也不改写历史。详见[上下文证据边界](./docs/copilot-usage.md#historical-context-evidence)。
|
|
22
23
|
- **兼容处理:**插件通过 DSH 已发布公开接口提供 Copilot 专用 Tool Schema、Thinking 展示、请求预算及账号模型兼容,不修改 Core,也不维护第二套模型目录。
|
|
23
24
|
|
|
24
25
|

|
|
25
26
|
|
|
26
27
|
截图来自当前构建 Client 的隔离浏览器 fixture,使用合成 Provider。它只证明已发布配置界面的形态,不证明真实凭据、账号权限、搜索成功或当前 Desktop 已加载。
|
|
27
28
|
|
|
28
|
-
> 当前文档与安装命令对应版本 `0.4.0-alpha.
|
|
29
|
+
> 当前文档与安装命令对应版本 `0.4.0-alpha.73`。源码、发布制品、已安装版本和实际加载运行时需分别确认;本地升级和中断会话的重启仍需用户批准。
|
|
29
30
|
|
|
30
31
|
Web search 路由现在优先显示在插件详情页;宿主不支持详情页插槽时才回退到 **设置 → 模型**或独立 Web search section。搜索子 Fiber 仍独立等待 Remote,不影响账号控件和既有搜索安全检查。
|
|
31
32
|
|
|
@@ -118,10 +119,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
|
|
|
118
119
|
仅对独立的具名 profile,获准且网络可用时,可通过受支持的 CLI 命令安装:
|
|
119
120
|
|
|
120
121
|
```sh
|
|
121
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
122
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.73/dsh-github-copilot-0.4.0-alpha.73.tgz
|
|
122
123
|
```
|
|
123
124
|
|
|
124
|
-
Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.
|
|
125
|
+
Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.73`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
|
|
125
126
|
|
|
126
127
|
随后打开上表对应的 Models UI,找到 **GitHub Copilot**,点击 **Sign in** 并完成 GitHub device-code 流程。安装会修改指定 profile;是否立即激活取决于该 profile 的常规 reload/restart 策略。
|
|
127
128
|
|
|
@@ -131,7 +132,7 @@ Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理
|
|
|
131
132
|
2. 点击 **Sign in with GitHub** 后,验证码区域自动展开,提供醒目的一次性验证码、**Open GitHub verification page**、**Copy code** 和 **Cancel sign-in**。不需要再点一次 **Manage**。识别到 Desktop v1 宿主时,通过现有的同窗口外部导航处理交给系统浏览器,不依赖弹出窗口;网页版仍打开新标签页。如果没有打开,可选中并复制界面显示的验证网址到浏览器。插件无法确认系统浏览器是否已打开。
|
|
132
133
|
3. 复制验证码,打开验证链接,在自己的 GitHub 浏览器会话中完成授权。复制成功/失败均有可访问的反馈;手工复制仍可用。不要把 GitHub token 粘贴到 DSH。
|
|
133
134
|
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 详情不会显示或记录。
|
|
134
|
-
5. 在 **GitHub Copilot** 分组选择接受的模型(稳定路由 ID 为 `github-copilot-preview`)。正常打开/使用会自动维护元数据,无需手动 **Refresh models**。**Manage → Model preferences** 提供搜索、**All / Enabled / Excluded** 筛选,以及立即保存的 **Exclude/Restore** 操作;被排除的精确 ID 会退出托管 picker 与所有 Auto 候选,暂时不在账号元数据中的排除 ID
|
|
135
|
+
5. 在 **GitHub Copilot** 分组选择接受的模型(稳定路由 ID 为 `github-copilot-preview`)。正常打开/使用会自动维护元数据,无需手动 **Refresh models**。**Manage → Model preferences** 提供搜索、**All / Enabled / Excluded** 筛选,以及立即保存的 **Exclude/Restore** 操作;被排除的精确 ID 会退出托管 picker 与所有 Auto 候选,暂时不在账号元数据中的排除 ID 仍可恢复。排除触发父级重绘时,保留已挂载的账号控制器及元数据,不重新启动状态检查或模型发现。被实时会话或未来默认设置选中的固定模型,在对应选择改变前不可排除。排除不会改写历史、切换选择或修改账号权限。发现说明及能力警告收纳在独立的 **Discovery details** 中。
|
|
135
136
|
|
|
136
137
|
偏好读取失败时,已有账号模型仍以只读列表显示,未知排除状态不会伪装成已启用。明确的诊断码区分设置不可用、设置无效与选择证据不完整;**Retry** 仅重读 Host 状态,不刷新 OAuth 或发现模型。保存失败保留最后确认的状态。排除设置使用原生动态隐藏 Config 字段及路径级 CAS,保存无需重新挂载插件。账号模型发现成功不等于偏好设置或模型调用已正常工作。
|
|
137
138
|
|
|
@@ -174,7 +175,7 @@ Agent 应把浏览器授权视为需要用户完成的 handoff,而不是自行
|
|
|
174
175
|
5. 确认 **Signed in** 并检查自动发现结果,再请用户选择模型。已登录时打开 Models 会自动确保缺失/过期元数据,新鲜 ready 缓存不发请求。错误可使用 **Retry**,有意强制更新时使用 **Manage → Refresh models**,不作为常规设置步骤。状态读取本身不发现;登录、元数据与真实调用成功是独立证据。
|
|
175
176
|
6. 只有用户明确要求断开账号时才使用 **Sign out**;它会删除 Copilot credential record,但保留 route settings。
|
|
176
177
|
|
|
177
|
-
每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.
|
|
178
|
+
每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.73`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
|
|
178
179
|
|
|
179
180
|
**Desktop package 更新与 Web 生命周期边界:**原生 manager 对已安装 package 原位升级返回的 `restart-required` 是权威结果,与移除/重加 plugin bundle 的行为是两个不同问题。涉及服务重编排补丁(`cordis.patch.yml`,如本插件所采用的隔离路由 Web 搜索层)的停用、移除或升级,可能让依赖条目保持 pending,直到完全退出并冷重启 Desktop。若原生 manager 只报告类似 `pending (waiting for service: web)` 的条目,同时本插件已经显示 **Off**,说明请求的停用状态已经落盘;请冷重启 Desktop,不要反复切换或重装插件。其它错误不属于此提示范围,仍需单独排查。
|
|
180
181
|
|
|
@@ -458,8 +459,8 @@ node scripts/agent.mjs attribution "DeepSeek Harness (DSH)"
|
|
|
458
459
|
`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 要求包已存在,不能代替首次建包。不会批量补发历史版本。
|
|
459
460
|
|
|
460
461
|
```sh
|
|
461
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
462
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
462
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.73/dsh-github-copilot-0.4.0-alpha.73.tgz
|
|
463
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.73/SHA256SUMS
|
|
463
464
|
sha256sum --check SHA256SUMS
|
|
464
465
|
```
|
|
465
466
|
|
|
@@ -467,7 +468,7 @@ PowerShell 可以对已下载的同一组文件执行:
|
|
|
467
468
|
|
|
468
469
|
```powershell
|
|
469
470
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
470
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
471
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.73.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
471
472
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
472
473
|
```
|
|
473
474
|
|
package/deployment-baseline.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"package": {
|
|
10
10
|
"name": "dsh-github-copilot",
|
|
11
|
-
"version": "0.4.0-alpha.
|
|
11
|
+
"version": "0.4.0-alpha.73"
|
|
12
12
|
},
|
|
13
13
|
"evidence": {
|
|
14
14
|
"kind": "source-and-synthetic-test-inventory",
|
|
@@ -288,6 +288,25 @@
|
|
|
288
288
|
]
|
|
289
289
|
},
|
|
290
290
|
"capabilities": [
|
|
291
|
+
{
|
|
292
|
+
"id": "historical-context-evidence",
|
|
293
|
+
"required": true,
|
|
294
|
+
"evidenceScope": "synthetic-stream-replay-and-additive-ui-not-current-occupancy-or-live-desktop",
|
|
295
|
+
"sourceMarkers": [
|
|
296
|
+
{"file": "src/preview-route.ts", "marker": "guardContextUsage"},
|
|
297
|
+
{"file": "src/index.ts", "marker": "installContextEvidence(ctx)"},
|
|
298
|
+
{"file": "src/client.ts", "marker": "registerContextEvidenceUi"},
|
|
299
|
+
{"file": "src/context-evidence.ts", "marker": "githubCopilotContextEvidence"},
|
|
300
|
+
{"file": "docs/copilot-usage.md", "marker": "historical input sample, not current occupancy"}
|
|
301
|
+
],
|
|
302
|
+
"tests": [
|
|
303
|
+
{"file": "tests/context-usage-guard.spec.ts", "name": "does not report failed zero usage on %s"},
|
|
304
|
+
{"file": "tests/context-evidence.spec.ts", "name": "replays failed zero samples without discarding the last valid input sample"},
|
|
305
|
+
{"file": "tests/context-evidence-ui.spec.ts", "name": "labels counts as historical rather than current occupancy in %s"},
|
|
306
|
+
{"file": "tests/fixtures/session-context-core.fixture.ts", "name": "cold-folds native model selections independently without replacing the controller projection"},
|
|
307
|
+
{"file": "tests/preview-route.spec.ts", "name": "does not let native SDK failed zero usage reset context evidence or fabricate settled usage"}
|
|
308
|
+
]
|
|
309
|
+
},
|
|
291
310
|
{
|
|
292
311
|
"id": "account-quota-composer-usage",
|
|
293
312
|
"required": true,
|
package/docs/copilot-usage.md
CHANGED
|
@@ -18,6 +18,18 @@ Detailed amounts are rounded to two decimal places for display; a positive amoun
|
|
|
18
18
|
|
|
19
19
|
Provider or Session changes, unmounting and missing supported runtime seams revoke the presentation's ownership. Optional capability failure must not disable sign-in, Models, search or ordinary chat. The installed/loaded Client determines the exact dock placement; the standalone design mockup is not proof of native placement.
|
|
20
20
|
|
|
21
|
+
## Historical context evidence
|
|
22
|
+
|
|
23
|
+
Official rc.2 can replace the native context-pressure sample with the adapter's all-zero usage on a failed attempt. The message breakdown is a separate heuristic projection, so a native `0%` reading can coexist with substantial message tokens. Neither that zero nor the breakdown proves the current exact occupancy.
|
|
24
|
+
|
|
25
|
+
The managed route delays one terminal all-zero usage chunk. An adjacent error or aborted finish discards that sample while preserving the finish; a thrown error or truncated stream also cannot certify that zero. Successful stop, max-tokens and tool-calls finishes preserve reported zero usage. Nonzero samples, billing counts, content ordering and failure semantics remain unchanged. This guard applies only to `github-copilot-preview`, not the Core-owned canonical adapter. It adds no retry, compaction, trimming or model switch.
|
|
26
|
+
|
|
27
|
+
The separate, strict `githubCopilotContextEvidence` session projection reads only routing and numeric usage from ordinary durable events. It keeps the last applicable input-plus-cache sample when a failed all-zero attempt is replayed. Model changes, compaction, surface replacement, conflicting source attribution and invalid metadata revoke the sample. It never reads message content or opaque replay, registers under a Core key, changes the native pressure projection, or rewrites durable history.
|
|
28
|
+
|
|
29
|
+
An additive composer disclosure identifies missing or unreliable context evidence for the current open Copilot Session. Any retained count is explicitly a **historical input sample, not current occupancy**; no capacity or percentage is inferred. The native context ring and account Credits control remain separate and unchanged. Missing public projection/slot/runtime seams produce named diagnostics rather than guessed counts. Old histories can therefore still show native `0%`; the disclosure explains the uncertainty instead of claiming an in-place native-meter repair.
|
|
30
|
+
|
|
31
|
+
Local synthetic tests establish guarded-stream, historical-fold and presentation behavior only. Exact published-adapter and public-registry acceptance, complete CI, publication and loaded Desktop state must be verified separately. No live provider call or Session restart is needed for these tests.
|
|
32
|
+
|
|
21
33
|
## Account data boundary
|
|
22
34
|
|
|
23
35
|
The Host uses the existing `llm-pi-ai/github-copilot` OAuth grant through public credential APIs. GitHub's `copilot_internal/user` endpoint uses the GitHub grant, not a second sign-in or a newly pasted token. Access-token renewal remains owned by pi-ai; quota inspection must not introduce a refresh implementation or credential persistence.
|