dsh-github-copilot 0.4.0-alpha.128 → 0.4.0-alpha.129

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
@@ -43,7 +43,15 @@ This repository owns twelve 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, supported low summary effort only when no effort is already resolved, and default-off lossless gzip for explicitly opted-in account-proven HTTP Responses requests. See [compaction budgets](./docs/copilot-compaction.md). Preserve truthful capacities, requested output caps, native errors/replay and transaction ownership; no hidden history trimming, wire chunking, competing compaction service or automatic model switch. The separately selected, single-service [recovery engine](./docs/manual-compaction-recovery.md) defaults to automatic segmented recovery for known oversized summaries or one typed native capacity failure through the public subclass hook. Preserve `automaticRecovery: false`, native `auto: false`, scopes and custom engines; at most 16 physical calls including a failed first attempt, no recursive retry or 408/network/auth/quota fallback. Installation alone never selects or migrates an engine.
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. A separate plugin-owned historical context projection may diagnose failed-zero readings, never filter shared native usage, replace Core's meter, infer current occupancy/percentages or rewrite history. See [quota boundaries](./docs/copilot-usage.md).
46
+ 11. Optional account quota reads and a session-scoped composer usage control
47
+ through public credentials, strict Remotes and additive slots. Keep account
48
+ billing-cycle credits separate from context tokens and session cost. Missing,
49
+ pooled, legacy and stale data must retain their real semantics; never infer credits
50
+ from token estimates or account deltas. A separate plugin-owned historical context
51
+ projection may diagnose concrete failed-zero or invalid-sample incidents; ordinary
52
+ request progress and absent fresh sampling stay quiet. Never filter shared native
53
+ usage, replace Core's meter, infer current occupancy/percentages or rewrite history.
54
+ See [quota boundaries](./docs/copilot-usage.md).
47
55
  12. Default-off local account/Checking/compaction diagnostics through public storage-domain and strict additive Remotes. Keep fixed-dimension Client/Host and logical/physical populations separate, with bounded handles/rows, 14-day retention, explicit loss/uncertainty and native commit evidence. Isolate the home-wide backend by public profile context, never account/Session identity; one writer per profile is required. No content, raw errors, identities/hashes, credential/history reads, ad-hoc files, Settings logs, upload, daily task or automatic repair. Enable/pause uses only the hidden volatile `diagnosticsEnabled` CAS leaf; clear is a separately confirmed epoch fence. Missing/corrupt storage remains unavailable, never healthy empty data. Publication does not enable collection. See [local diagnostics](./docs/plugin-diagnostics.md).
48
56
 
49
57
  ## Session-policy compaction replay consent (#349, #352)
@@ -97,7 +105,15 @@ Alpha.25 admits native `subagent/descriptor` v3, already v3 in the retained rc.1
97
105
  - `src/reasoning-presentation.ts`: guarded native Chat delegation and historical Copilot provenance; filters temporary view props only, never messages, signatures, replay indexes or usage.
98
106
  - `src/remote.ts`: Typert Remote contribution. Never add credential payloads here.
99
107
  - `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, quota-specific credential owner or general model wire.
100
- - `src/context-usage.ts`, `src/context-evidence.ts`, `src/context-evidence-ui.ts`: diagnostic-only failed-zero classification and bounded numeric historical evidence through a plugin-owned public projection and additive composer disclosure. Never filter native usage chunks to protect context readings: shared samples also feed Core's turn and cumulative accounting. Historical counts never become current occupancy; Core pressure, billing and durable events stay under Core ownership.
108
+ - `src/context-usage.ts`, `src/context-evidence.ts`,
109
+ `src/context-evidence-ui.ts`: diagnostic-only failed-zero/invalid-sample
110
+ incidents and bounded numeric historical evidence through a plugin-owned public
111
+ projection and additive composer disclosure. Keep ordinary progress quiet;
112
+ dismissal is bounded Client presentation keyed by Session/incident, and a valid
113
+ applicable sample clears the incident. Never filter native usage chunks to
114
+ protect context readings: shared samples also feed Core's turn and cumulative
115
+ accounting. Historical counts never become current occupancy; Core pressure,
116
+ billing and durable events stay under Core ownership.
101
117
  - `src/current-provider.ts`: selected DSH route plus installed pi-ai catalog facts.
102
118
  - `src/temporary-models.ts`: exact, account-gated corrections with semantic protocol/capability retirement.
103
119
  - `src/model-protocol.ts`: explicit Core capability detection and conservative legacy fallback.
@@ -301,6 +317,9 @@ above the composer, with shared native secondary typography. Do not restore long
301
317
  notices to the nonwrapping statistics row or mutate its parent DOM. Scope errors
302
318
  keep concise recovery guidance; bounded dispatch counts are separate Host diagnostics,
303
319
  not proof of the rejected item, account-switch failure or recovery success.
320
+ Ordinary context-request progress stays quiet. Only concrete sequenced sampling
321
+ incidents may notify, with bounded Session/incident dismissal; missing or unknown
322
+ projection evidence remains a named diagnostic and never fabricated health.
304
323
 
305
324
  Completed-turn Usage diagnostics (#259) are read-only plugin conversation data and an additive assistant-actions explanation. Official rc.2 hides its total if any attempt lacks complete accounting; the plugin's finish-only pre-dispatch pressure block can trigger this rule even after recovery. Never fabricate zero usage or replace it with successful-step partial totals. Identify local interception only from its exact recorded finish-only diagnostic, keep other missing samples and paged evidence uncertain, and suppress the explanation whenever native `tokenUsage` exists. Preserve native accounting, history, pressure and recovery; see `docs/copilot-usage.md`.
306
325
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0-alpha.129
4
+
5
+ - Keep ordinary post-compaction steps and requests without a fresh usage sample quiet instead of repeatedly showing context-sampling uncertainty (#367).
6
+ - Notify only for a concrete failed-zero or invalid-sample incident. Bind dismissal to the Session and incident across ordinary remounts/switches; a later applicable valid sample clears the incident and a newer incident can notify.
7
+ - Preserve the existing eight-second native-confirmed compaction result, historical-count labeling, unknown-evidence diagnostics, native usage/context meters and Core-owned compaction/accounting without replacement percentages, retries or live installation.
8
+
3
9
  ## 0.4.0-alpha.128
4
10
 
5
11
  - Separate native compaction commit, subsequent ordinary-request outcome and applicable historical input sampling in one composer disclosure (#364).
package/README.md CHANGED
@@ -27,7 +27,7 @@ Visible Models and Credits resolve missing names for saved accounts without acti
27
27
 
28
28
  Adding an account now keeps the device-authorization link, selectable URL, one-time code, Copy code action and Cancel together while authorization is pending. After GitHub authorizes, identity and model verification are shown as a separate phase. Adding never changes the global default; use the existing explicit **Switch** action when ready. Technical diagnostics are secondary, and account/turn identity fallbacks never expose opaque account IDs or infer historical identity from today's settings.
29
29
 
30
- **Package version: `0.4.0-alpha.128` (prepared). Supported host: official DSH / Windows Desktop `0.2.0-rc.2`.** Earlier DSH pins are historical evidence, not supported installation targets. Publication, profile installation and the version loaded by a running Host are separate states. Verify the published Release and assets before using the versioned commands below; these instructions do not prove publication or installation.
30
+ **Package version: `0.4.0-alpha.129` (prepared). Supported host: official DSH / Windows Desktop `0.2.0-rc.2`.** Earlier DSH pins are historical evidence, not supported installation targets. Publication, profile installation and the version loaded by a running Host are separate states. Verify the published Release and assets before using the versioned commands below; these instructions do not prove publication or installation.
31
31
 
32
32
  ## What you can do
33
33
 
@@ -93,10 +93,10 @@ Supply any launcher patches with repeated `--patch /absolute/file`. Require `sup
93
93
  For a **standalone named profile**:
94
94
 
95
95
  ```sh
96
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.128/dsh-github-copilot-0.4.0-alpha.128.tgz
96
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.129/dsh-github-copilot-0.4.0-alpha.129.tgz
97
97
  ```
98
98
 
99
- For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.128` after publication. Official rc.2's **Desktop-bundled CLI** also supports reserved-profile plugin management; a global/generic `dsh` shim is not equivalent. Qualify the installed entry before use. See [Desktop CLI qualification](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2) and the distinct [standalone offline procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles). Neither path authorizes registry-policy bypass, peer patches or configuration deletion.
99
+ For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.129` after publication. Official rc.2's **Desktop-bundled CLI** also supports reserved-profile plugin management; a global/generic `dsh` shim is not equivalent. Qualify the installed entry before use. See [Desktop CLI qualification](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2) and the distinct [standalone offline procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles). Neither path authorizes registry-policy bypass, peer patches or configuration deletion.
100
100
 
101
101
  After an approved reload/restart:
102
102
 
@@ -165,7 +165,7 @@ canonical inline path; it is not a third routed fallback. Fetch is unchanged.
165
165
 
166
166
  **Credits** shows validated account billing-cycle data, not context tokens or Session cost. Stale, pooled and unavailable readings keep their real meanings. The quota request alone uses Node plus system CA roots with TLS verification enabled; it does not change trust for sign-in, models, search or Desktop globally.
167
167
 
168
- Native context occupancy and Turn Usage remain Core-owned. The plugin forwards usage unchanged, including zero samples on failure/cancellation. Its separate context disclosure reports historical evidence, never current occupancy or a replacement `0%` meter. **Turn Usage incomplete** explains missing samples/lifecycle and recorded local blocks; it invents neither zero usage nor partial totals. Cancellation can retain usage, but does not guarantee a final supplier receipt. [Usage boundaries](./docs/copilot-usage.md).
168
+ Native context occupancy and Turn Usage remain Core-owned. The plugin forwards usage unchanged, including zero samples on failure/cancellation. Ordinary in-progress requests and missing new samples stay quiet; only a concrete failed-zero or invalid-sample incident opens the separate, dismissible context warning. Any retained count is labeled historical evidence, never current occupancy or a replacement percentage. **Turn Usage incomplete** explains missing samples/lifecycle and recorded local blocks; it invents neither zero usage nor partial totals. Cancellation can retain usage, but does not guarantee a final supplier receipt. [Usage boundaries](./docs/copilot-usage.md).
169
169
 
170
170
  Owned timeout/replay errors preserve native usage before terminal failure restoration, including nonzero samples. A failed zero can still make the native ring show `0%`; this is not proof of an empty request. Retry-entry times describe backoff, not the failed request's duration. These accounting fixes do not cure supplier HTTP 408 or change retry policy.
171
171
 
@@ -177,7 +177,7 @@ For continuing steps with a committed managed route and no pending model change,
177
177
 
178
178
  **Visible-history continuation also covers this Session's native managed Responses compaction**, including automatic summaries: no extra manual recovery command or failure-first retry is required when enabled. Old encrypted reasoning and embedded summaries are omitted from outgoing input; hidden context may be lost. Visible messages/tool pairs and source history remain intact, and only the native transaction commits a smaller checkpoint. A composer notice identifies degradation and distinguishes committed, failed and cancelled outcomes. When off, an exact replay-scope rejection offers the same loss-disclosed enable control; unknown failures do not authorize loss. `/copilot-compact visible-history` remains a one-time alternative through the selected recovery engine. Read [recovery consent and limits](./docs/manual-compaction-recovery.md#explicit-visible-history-summary-recovery); this does not enable an absent engine or repair capacity, quota or timeout failures.
179
179
 
180
- Compaction feedback separates **compaction completed**, **subsequent request succeeded** and **applicable input sampling** in one composer disclosure. A native `0%` is not proof of empty context; even a successful subsequent request with a valid historical input sample does not establish exact current occupancy. The plugin sends no extra test request, adds no retry and leaves the native context ring, Usage accounting and expandable compaction history unchanged. See [context evidence](./docs/copilot-usage.md#historical-context-evidence).
180
+ Compaction feedback separates **compaction completed** and **subsequent request succeeded** during the existing eight-second result window. It does not turn ordinary request progress or absence of a fresh sample into a persistent composer warning. A later concrete sampling incident can appear independently and may include a labeled historical count, but never an occupancy percentage. The plugin sends no extra test request, adds no retry and leaves the native context ring, Usage accounting and expandable compaction history unchanged. See [context evidence](./docs/copilot-usage.md#historical-context-evidence).
181
181
 
182
182
  Running visible-history compaction notices stay visible. Confirmed success disappears eight seconds after first observation; settled failures, cancellation, unavailable status and enable prompts stay until **Close** (or the existing **Cancel**). Closing only hides this Session/operation/status notice, never changes consent, history or native proof, and never sends or retries. A bounded Client registration retains expiry/dismissal across incidental remounts and Session switches, not across teardown or eviction.
183
183
 
@@ -229,7 +229,7 @@ The Credits account panel shows the current account and **Switch**. Its dropdown
229
229
 
230
230
  [Visible-history continuation](./docs/session-continuation.md) is configured beside account switching, not permanently above the composer. New unseeded Sessions default on after the feature's first successful activation; existing Sessions and inherited histories remain off unless explicitly authorized. Global defaults affect new Sessions only; Session on/off overrides persist across accounts/restarts until disabled. With continuation off, a different-account switch offers persistent enable, keep off or cancel, without a one-turn mode. Each new enabled turn omits prior encrypted reasoning and embedded summaries, even on the same account; current-turn reasoning, visible messages, tools and disk history remain unchanged. Authorization never auto-sends/retries and is not a quota/context cure. Exact replay failures expose the same policy and require a separate native retry. The pinned Core lacks a public Models deep link; Chat omits the nonfunctional management entry. Full management remains in Settings → Models → GitHub Copilot → Manage.
231
231
 
232
- Context evidence and Replay recovery use compact, centered notices bounded by the native composer width. Model/item counts and status refresh live in collapsed technical details; loss consent remains explicit. The context notice explains that native 0% does not establish an empty context; native statistics stay unchanged. Switching accounts does not make old encrypted reasoning portable. The concise scope error points to explicit recovery or a new conversation; bounded, sanitized dispatch counts stay in Host diagnostics, not the main error. **Authorized** means permission is ready, not that a message was sent or recovery succeeded.
232
+ Context evidence and Replay recovery use compact, centered notices bounded by the native composer width. Model/item counts and status refresh live in collapsed technical details; loss consent remains explicit. Context sampling warns only for a concrete incident, can be dismissed for that Session/incident, and never asserts the native meter's current value; native statistics stay unchanged. Switching accounts does not make old encrypted reasoning portable. The concise scope error points to explicit recovery or a new conversation; bounded, sanitized dispatch counts stay in Host diagnostics, not the main error. **Authorized** means permission is ready, not that a message was sent or recovery succeeded.
233
233
 
234
234
  ## Ownership and further reading
235
235
 
@@ -269,14 +269,14 @@ Commit attribution uses `Assisted-by` with the actual tool, never the model prov
269
269
  GitHub Releases and npm distribute the same original verified tarball. Pin a version; verify Release SHA-256 or npm `dist.integrity`. Never repack an immutable release or move/reuse its tag.
270
270
 
271
271
  ```sh
272
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.128/dsh-github-copilot-0.4.0-alpha.128.tgz
273
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.128/SHA256SUMS
272
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.129/dsh-github-copilot-0.4.0-alpha.129.tgz
273
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.129/SHA256SUMS
274
274
  sha256sum --check SHA256SUMS
275
275
  ```
276
276
 
277
277
  ```powershell
278
278
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
279
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.128.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
279
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.129.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
280
280
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
281
281
  ```
282
282
 
package/README.zh.md CHANGED
@@ -24,7 +24,7 @@ Models 和 Chat 共用不透明、随主题适配的账号下拉层;原生菜
24
24
 
25
25
  添加账号时,设备授权链接、可选择的网址、一次性授权码、复制授权码和取消操作会同时显示。GitHub 授权完成后,会单独显示身份与可用模型验证阶段。添加账号不会更改全局默认;准备好后仍需显式执行现有的**切换**操作。技术诊断收在次级折叠区;账号/历史 turn 缺少身份时不会暴露不透明账号 ID,也不会根据当前设置推断历史身份。
26
26
 
27
- **包版本:`0.4.0-alpha.128`(准备中)。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。** 较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。执行下方带版本的命令前须核验正式发布与资产;这些说明不证明已发布或已安装。
27
+ **包版本:`0.4.0-alpha.129`(准备中)。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。** 较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。执行下方带版本的命令前须核验正式发布与资产;这些说明不证明已发布或已安装。
28
28
 
29
29
  ## 你可以做什么
30
30
 
@@ -83,10 +83,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
83
83
  **独立具名 profile**:
84
84
 
85
85
  ```sh
86
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.128/dsh-github-copilot-0.4.0-alpha.128.tgz
86
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.129/dsh-github-copilot-0.4.0-alpha.129.tgz
87
87
  ```
88
88
 
89
- **Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.128`。官方 rc.2 **Desktop 随附的专属 CLI**也支持管理保留 profile;全局/普通 `dsh` shim 不等价。使用前核验实际安装入口,参见[Desktop CLI 核验](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2)及独立的[具名 profile 离线流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)。两种路径都不授权绕过包源政策、修改 peer 或删除配置。
89
+ **Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.129`。官方 rc.2 **Desktop 随附的专属 CLI**也支持管理保留 profile;全局/普通 `dsh` shim 不等价。使用前核验实际安装入口,参见[Desktop CLI 核验](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2)及独立的[具名 profile 离线流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)。两种路径都不授权绕过包源政策、修改 peer 或删除配置。
90
90
 
91
91
  经批准 reload/restart 后:
92
92
 
@@ -155,7 +155,7 @@ Copilot 搜索要求当前账号/协议证据及能力 proof。固定/fallba
155
155
 
156
156
  **Credits**展示已验证账号计费周期数据,不是上下文 tokens 或会话成本。过期、组织共享及不可用数据保留真实语义。仅额度请求在保持 TLS 验签下合并 Node 与系统 CA;不改变登录、模型、搜索或整个 Desktop 的信任配置。
157
157
 
158
- 原生上下文占用与 Turn Usage 由 Core 所有。插件原样转发 usage,包括失败/取消时的零样本。独立上下文说明展示历史证据,不推断当前占用、不替换原生 `0%`。**Turn Usage incomplete**解释缺失样本/生命周期及已记录本地阻断,不编造零用量或部分总和。取消可以保留 usage,但不保证收到供应方最终回执。[用量边界](./docs/copilot-usage.md)。
158
+ 原生上下文占用与 Turn Usage 由 Core 所有。插件原样转发 usage,包括失败/取消时的零样本。普通请求进行中或暂时没有新采样时保持安静;只有明确的失败零采样或无效采样事件才显示可关闭的独立上下文警告。保留的计数只标记为历史证据,不推断当前占用或替代百分比。**Turn Usage incomplete**解释缺失样本/生命周期及已记录本地阻断,不编造零用量或部分总和。取消可以保留 usage,但不保证收到供应方最终回执。[用量边界](./docs/copilot-usage.md)。
159
159
 
160
160
  插件恢复 timeout/replay 结构化错误前会保留原生 usage,包括非零采样。失败的零采样仍可能让原生圆环显示 `0%`,不代表请求上下文为空。重试条目的耗时表示退避等待,不是失败请求耗时;用量修复不等于解决供应方 HTTP 408,也不改变重试策略。
161
161
 
@@ -167,7 +167,7 @@ Copilot 搜索要求当前账号/协议证据及能力 proof。固定/fallba
167
167
 
168
168
  **“降级续聊”也覆盖本 Session 的原生托管 Responses 压缩,包括自动摘要**:开启后不需要额外手动恢复命令,也不必先失败再重试。发出的输入省略旧加密 reasoning 及其内嵌摘要,隐藏上下文可能丢失;可见消息、工具调用/结果关系和原历史保留,仅由原生事务提交更小的检查点。输入区提示降级,并区分已提交、失败和取消。关闭时,明确的回放作用域拒绝提供同一个带损失说明的开启入口;未知错误不授权降级。`/copilot-compact visible-history` 保留为已选用恢复引擎的一次性高级入口。参见[授权与恢复限制](./docs/manual-compaction-recovery.md#explicit-visible-history-summary-recovery);这不启用缺失的引擎,也不修复容量、额度或超时问题。
169
169
 
170
- 输入区在同一个可展开提示中分别说明**压缩已完成**、**后续请求已成功**和**有效输入采样是否仍适用**。原生 `0%` 不代表上下文为空;即使后续请求成功且有有效历史输入采样,也不能据此确认当前精确占用。插件不额外发送测试请求、不增加重试,保留原生圆环、Usage 记账及可展开的压缩历史。参见[上下文证据](./docs/copilot-usage.md#historical-context-evidence)。
170
+ 输入区在原有八秒结果窗口内分别说明**压缩已完成**和**后续请求已成功**,不会把普通请求进度或暂时没有新采样变成常驻警告。后续明确的采样事件可独立出现,并可展示标记清楚的历史计数,但绝不推算占用百分比。插件不额外发送测试请求、不增加重试,保留原生圆环、Usage 记账及可展开的压缩历史。参见[上下文证据](./docs/copilot-usage.md#historical-context-evidence)。
171
171
 
172
172
  可见历史压缩进行中时提示持续可见。确认成功后从首次观察起八秒自动消失;失败、取消、状态不可用和开启提示保留至手动**关闭**(或原有**取消**)。关闭仅隐藏当前 Session/操作/状态的提示,不改变授权、历史或原生证据,不发送或重试。Client 注册范围内的有界状态使临时重挂载和会话切换不会重置期限;注册销毁或记录淘汰后不保留。
173
173
 
@@ -219,7 +219,7 @@ Credits 账号面板显示当前账号和 **切换**,下拉菜单只列已有
219
219
 
220
220
  [可见历史续聊模式](./docs/session-continuation.md)放在账号切换旁,不再常驻输入框上方。功能首次成功激活后创建的非继承 Session 默认开启;已有 Session、继承历史仍需明确授权。全局默认只影响新 Session,Session 开关跨账号及重启保留,直到关闭。关闭时切换到不同账号,提供持续开启、保持关闭或取消,不再提供仅下一轮模式。启用后的每个新 turn 省略旧加密推理及其内嵌摘要,同账号也适用;当前轮新推理、可见消息、工具记录和磁盘历史不变。授权不自动发送或重试,不解决额度或上下文超限。精确回放失败使用同一个持久策略,用户另行点击原生重试。当前 Core 没有公开 Models 直达 API,Chat 不展示不可用的管理入口;完整管理仍在设置 → 模型 → GitHub Copilot → 管理。
221
221
 
222
- 上下文证据与回放恢复以紧凑、居中提示显示在输入框上方,宽度遵循原生输入框。模型、项数和状态刷新收进默认折叠的技术详情;有损恢复仍需明确确认。上下文提示直接说明原生 0% 不代表上下文为空,原生统计不变。切换账号不会让旧加密推理自动变得可跨账号使用。简短 scope 错误指向显式恢复或新会话;有界、脱敏的请求结构计数留在 Host 诊断中,不挤占主错误。**已授权**只表示授权已准备好,不表示消息已发送或恢复已成功。
222
+ 上下文证据与回放恢复以紧凑、居中提示显示在输入框上方,宽度遵循原生输入框。模型、项数和状态刷新收进默认折叠的技术详情;有损恢复仍需明确确认。上下文采样只在明确事件时告警,可按 Session/事件关闭,且不会断言原生仪表当前值;原生统计不变。切换账号不会让旧加密推理自动变得可跨账号使用。简短 scope 错误指向显式恢复或新会话;有界、脱敏的请求结构计数留在 Host 诊断中,不挤占主错误。**已授权**只表示授权已准备好,不表示消息已发送或恢复已成功。
223
223
 
224
224
  ## 所有权与深入阅读
225
225
 
@@ -259,14 +259,14 @@ Agent 从 `node scripts/agent.mjs describe --json`、`doctor --json`及`plan <ta
259
259
  GitHub Releases 和 npm 分发同一原始已校验 tarball。固定版本并核验 Release SHA-256 或 npm `dist.integrity`;不重打包不可变 Release、不移动/复用 tag。
260
260
 
261
261
  ```sh
262
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.128/dsh-github-copilot-0.4.0-alpha.128.tgz
263
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.128/SHA256SUMS
262
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.129/dsh-github-copilot-0.4.0-alpha.129.tgz
263
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.129/SHA256SUMS
264
264
  sha256sum --check SHA256SUMS
265
265
  ```
266
266
 
267
267
  ```powershell
268
268
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
269
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.128.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
269
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.129.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
270
270
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
271
271
  ```
272
272
 
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "package": {
10
10
  "name": "dsh-github-copilot",
11
- "version": "0.4.0-alpha.128"
11
+ "version": "0.4.0-alpha.129"
12
12
  },
13
13
  "evidence": {
14
14
  "kind": "source-and-synthetic-test-inventory",
@@ -406,7 +406,7 @@
406
406
  {"file": "src/index.ts", "marker": "installContextEvidence(ctx)"},
407
407
  {"file": "src/client.ts", "marker": "registerContextEvidenceUi"},
408
408
  {"file": "src/context-evidence.ts", "marker": "githubCopilotContextEvidence"},
409
- {"file": "src/context-evidence-ui.ts", "marker": "conversation.input.dock"},
409
+ {"file": "src/context-evidence-ui.ts", "marker": "ContextIncidentPresentation"},
410
410
  {"file": "src/replay-recovery-ui.ts", "marker": "conversation.input.dock"},
411
411
  {"file": "src/composer-notice-style.ts", "marker": "var(--dsh-content-font-size-secondary, 13px)"},
412
412
  {"file": "docs/copilot-usage.md", "marker": "historical input sample, not current occupancy"}
@@ -416,7 +416,10 @@
416
416
  {"file": "tests/context-evidence.spec.ts", "name": "replays failed zero samples without discarding the last valid input sample"},
417
417
  {"file": "tests/context-evidence.spec.ts", "name": "separates committed compaction, subsequent request success and applicable input sampling"},
418
418
  {"file": "tests/context-evidence.spec.ts", "name": "tracks unchanged-header native steps and reads only the settled message source leaves"},
419
+ {"file": "tests/context-evidence.spec.ts", "name": "keeps ordinary repeated steps and unsampled success quiet after compaction"},
419
420
  {"file": "tests/context-evidence-ui.spec.ts", "name": "labels counts as historical rather than current occupancy in %s"},
421
+ {"file": "tests/context-evidence-ui.spec.ts", "name": "reacts to only the current open Session and pending selection, preserving the native meter"},
422
+ {"file": "tests/context-evidence-ui.spec.ts", "name": "keeps unknown projection evidence diagnostic-only"},
420
423
  {"file": "tests/replay-recovery-ui.spec.ts", "name": "uses native auxiliary typography for the entire notice and inherited controls in an independent dock row"},
421
424
  {"file": "tests/fixtures/session-context-core.fixture.ts", "name": "cold-folds native model selections independently without replacing the controller projection"},
422
425
  {"file": "tests/preview-route.spec.ts", "name": "forwards native SDK failed zero usage without changing the shared accounting stream"},
@@ -40,13 +40,13 @@ The time beside **Retried model request** is the recorded retry backoff, not the
40
40
 
41
41
  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.
42
42
 
43
- 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.
43
+ An additive composer disclosure identifies only a concrete failed-zero or invalid-sample incident for the current open Copilot Session. Ordinary request progress, a newly opened step and absence of a fresh sample do not create a warning. Any retained count is explicitly a **historical input sample, not current occupancy**; no capacity or percentage is inferred, and the copy does not assert what the separate native meter currently displays. The native context ring and account Credits control remain separate and unchanged. Missing, malformed or otherwise unknown projection/slot/runtime evidence produces a named diagnostic instead of a success-shaped UI or guessed count.
44
44
 
45
- Compaction feedback shares this disclosure instead of requiring users to combine a recovery notice with a separate zero-context warning. **Compaction completed · context occupancy awaiting confirmation** requires a matching native checkpoint and successful end, or the account-bound Host's confirmed native commit. Running, failed, cancelled and unconfirmed outcomes are distinct. The native expandable **Context compacted** history row remains unchanged.
45
+ Compaction feedback shares this disclosure without turning sampling absence into a second warning. **Compaction completed** requires a matching native checkpoint and successful end, or the account-bound Host's confirmed native commit. The existing eight-second result can separately report a subsequent request outcome; running, failed, cancelled and unconfirmed compaction outcomes remain distinct. Once that transient result expires, ordinary post-compaction steps stay quiet unless they produce a concrete sampling incident. The native expandable **Context compacted** history row remains unchanged.
46
46
 
47
- The independent projection retains only the latest compaction bracket and subsequent ordinary-request evidence. A normal successful settlement after that bracket is reported separately from an applicable input-plus-cache sample. It observes public step/header and same-step source/terminal metadata, including unchanged-header steps and retries; summary output is never a subsequent chat success. Missing usage can coexist with request success. Only a positive applicable input sample confirms sampling; successful zero input stays unknown, and a new request without usage cannot borrow an older sample to certify itself. Failed zero, route changes, incompatible sources and surface replacement revoke sampling applicability; they never prove an empty context or restore Session health. A recorded post-compaction count is still historical, not exact current occupancy. No extra test message, automatic retry, content/replay read, durable event or replacement percentage is added. Projection state version 2 requests a native refold, not history conversion.
47
+ The independent projection retains only the latest compaction bracket, subsequent ordinary-request evidence and latest sequenced sampling incident. A normal successful settlement after that bracket is reported separately from an applicable input-plus-cache sample. It observes public step/header and same-step source/terminal metadata, including unchanged-header steps and retries; summary output is never a subsequent chat success. Missing usage can coexist with request success without becoming an incident. A failed zero or malformed/conflicting usage sample creates an incident; a later applicable valid sample clears it. Model changes, compaction and surface replacement revoke the old incident rather than allowing it to reappear for another route. A recorded post-compaction count is still historical, not exact current occupancy. No extra test message, automatic retry, content/replay read, durable event or replacement percentage is added. Projection state version 3 requests a native refold, not history conversion.
48
48
 
49
- The transient commit/loss status follows the eight-second completion expiry and manual Close rules. Its registration-owned presentation bound moves with the notice into the context UI. Expiry and Close remove only that result; independent context uncertainty and subsequent-request evidence remain when sampling is unreliable. Once applicable valid input sampling is available, the expired warning can disappear without inventing a current percentage. Native compaction history remains expandable throughout.
49
+ The transient commit/loss status follows the eight-second completion expiry and manual Close rules. Its registration-owned presentation bound moves with the notice into the context UI. A separate bounded Client presentation remembers dismissal by Session and incident sequence across ordinary remounts and Session switches. Dismissal hides only that incident; a newer independent incident can notify, and a later applicable valid sample clears the projection incident. Registration teardown or bounded eviction may discard presentation-only dismissal. Native compaction history remains expandable throughout.
50
50
 
51
51
  Local synthetic tests establish native-stream preservation, 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.
52
52
 
package/lib/client.js CHANGED
@@ -6988,7 +6988,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6988
6988
  };
6989
6989
  //#endregion
6990
6990
  //#region package.json
6991
- var version = "0.4.0-alpha.128";
6991
+ var version = "0.4.0-alpha.129";
6992
6992
  //#endregion
6993
6993
  //#region lib/types/diagnostics-client.js
6994
6994
  let owner;
@@ -11727,6 +11727,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11727
11727
  seq: count,
11728
11728
  route: routeSchema
11729
11729
  }).strict();
11730
+ const incidentSchema = object({
11731
+ kind: _enum(["failed-zero", "invalid-sample"]),
11732
+ seq: count
11733
+ }).strict();
11730
11734
  const stepSchema = object({
11731
11735
  turn: count,
11732
11736
  step: count
@@ -11761,10 +11765,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11761
11765
  reason: _enum([
11762
11766
  "none",
11763
11767
  "failed-zero",
11768
+ "invalid-sample",
11764
11769
  "compaction",
11765
11770
  "selection",
11766
11771
  "unknown"
11767
11772
  ]),
11773
+ incident: incidentSchema.nullable(),
11768
11774
  compaction: compactionSchema.nullable().optional(),
11769
11775
  activeStep: stepSchema.nullable().optional()
11770
11776
  }).strict();
@@ -11945,6 +11951,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11945
11951
  //#region lib/types/context-evidence-ui.js
11946
11952
  const slot = "conversation.input.dock";
11947
11953
  const noop$1 = () => {};
11954
+ const subscribeNoop = () => noop$1;
11955
+ const zeroSnapshot = () => 0;
11948
11956
  function record$1(value) {
11949
11957
  return typeof value === "object" && value !== null && !Array.isArray(value);
11950
11958
  }
@@ -11959,25 +11967,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11959
11967
  }
11960
11968
  const copy = {
11961
11969
  en: {
11962
- title: "Context unknown · native 0% is not an empty-context reading",
11963
- explanation: "A failed Copilot attempt reported zero usage. The native 0% is not evidence of an empty context.",
11970
+ failedZeroTitle: "Context sample unreliable · failed attempt reported zero usage",
11971
+ invalidSampleTitle: "Context sample invalid · current occupancy is unknown",
11972
+ failedZero: "A failed Copilot attempt recorded a zero usage sample. It is not reliable context-occupancy evidence.",
11973
+ invalidSample: "The latest context usage sample was malformed or conflicted with the active route.",
11964
11974
  sample: "Last valid input sample (including cache)",
11965
11975
  historical: "Historical sample, not current occupancy. No percentage is inferred.",
11966
11976
  revoked: "No applicable historical input sample is available. Model changes, compaction and incomplete history invalidate earlier samples.",
11967
- missing: "COPILOT_CONTEXT_PROJECTION_UNAVAILABLE: historical context evidence is unavailable.",
11968
- unknown: "Context sampling evidence is incomplete. No current occupancy can be inferred.",
11969
- completed: "Compaction completed · context occupancy awaiting confirmation",
11970
- completedSucceeded: "Compaction completed · subsequent request succeeded · context occupancy awaiting confirmation",
11971
- completedFailed: "Compaction completed · subsequent request failed · context occupancy awaiting confirmation",
11972
- completedCancelled: "Compaction completed · subsequent request cancelled · context occupancy awaiting confirmation",
11973
- contextPending: "Context occupancy awaiting confirmation",
11974
- contextSucceeded: "Subsequent request succeeded · context occupancy awaiting confirmation",
11975
- contextFailed: "Subsequent request failed · context occupancy unknown",
11976
- contextCancelled: "Subsequent request cancelled · context occupancy unknown",
11977
+ completed: "Compaction completed",
11978
+ completedSucceeded: "Compaction completed · subsequent request succeeded",
11979
+ completedFailed: "Compaction completed · subsequent request failed",
11980
+ completedCancelled: "Compaction completed · subsequent request cancelled",
11977
11981
  running: "Compacting with visible history; hidden reasoning context may be lost.",
11978
11982
  failed: "Visible-history compaction failed; no recovery summary commit is confirmed. Check the native failure.",
11979
11983
  cancelled: "Visible-history compaction cancelled; no recovery summary commit is confirmed.",
11980
- nativeRunning: "Compacting context · context occupancy awaiting confirmation",
11984
+ nativeRunning: "Compacting context",
11981
11985
  nativeFailed: "Compaction did not complete · check the native result",
11982
11986
  nativeUnknown: "Compaction commit could not be confirmed · check the native result",
11983
11987
  omitted: "Hidden reasoning context was omitted from the summary. Visible messages and tool relations were preserved.",
@@ -11988,29 +11992,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11988
11992
  requestRunning: "Subsequent request in progress; success is not yet confirmed.",
11989
11993
  requestUnknown: "Subsequent request outcome is unconfirmed.",
11990
11994
  sampled: "An applicable post-compaction input sample is recorded. It is historical evidence, not current occupancy.",
11991
- unsampled: "No applicable valid post-compaction input sample is confirmed. Request success alone does not establish occupancy.",
11992
- zero: "Native 0% does not prove an empty context. No replacement percentage is estimated."
11995
+ dismiss: "Dismiss",
11996
+ dismissLabel: "Dismiss context sample warning"
11993
11997
  },
11994
11998
  zh: {
11995
- title: "上下文未知 · 原生 0% 不代表上下文为空",
11996
- explanation: "失败的 Copilot 请求记录了零用量。原生 0% 不代表上下文为空。",
11999
+ failedZeroTitle: "上下文采样不可靠 · 失败请求记录了零用量",
12000
+ invalidSampleTitle: "上下文采样无效 · 当前占用未知",
12001
+ failedZero: "失败的 Copilot 请求记录了零用量采样,不能将其作为可靠的上下文占用证据。",
12002
+ invalidSample: "最近的上下文用量采样格式无效,或与当前路由冲突。",
11997
12003
  sample: "最后有效输入采样(含缓存)",
11998
12004
  historical: "这是历史采样,不是当前占用;不会据此推算百分比。",
11999
12005
  revoked: "没有仍适用的历史输入采样。模型切换、压缩或历史证据不完整会使旧采样失效。",
12000
- missing: "COPILOT_CONTEXT_PROJECTION_UNAVAILABLE:无法获取历史上下文证据。",
12001
- unknown: "上下文采样证据不完整,无法据此推断当前占用。",
12002
- completed: "压缩已完成 · 当前上下文占用待确认",
12003
- completedSucceeded: "压缩已完成 · 后续请求已成功 · 上下文占用待确认",
12004
- completedFailed: "压缩已完成 · 后续请求失败 · 上下文占用待确认",
12005
- completedCancelled: "压缩已完成 · 后续请求已取消 · 上下文占用待确认",
12006
- contextPending: "当前上下文占用待确认",
12007
- contextSucceeded: "后续请求已成功 · 上下文占用待确认",
12008
- contextFailed: "后续请求失败 · 上下文占用未知",
12009
- contextCancelled: "后续请求已取消 · 上下文占用未知",
12006
+ completed: "压缩已完成",
12007
+ completedSucceeded: "压缩已完成 · 后续请求已成功",
12008
+ completedFailed: "压缩已完成 · 后续请求失败",
12009
+ completedCancelled: "压缩已完成 · 后续请求已取消",
12010
12010
  running: "正在使用可见历史降级压缩,隐藏推理上下文可能丢失。",
12011
12011
  failed: "可见历史压缩失败;未确认提交恢复摘要。请查看原生失败原因。",
12012
12012
  cancelled: "可见历史压缩已取消;未确认提交恢复摘要。",
12013
- nativeRunning: "正在压缩上下文 · 当前上下文占用待确认",
12013
+ nativeRunning: "正在压缩上下文",
12014
12014
  nativeFailed: "压缩未完成 · 请查看原生结果",
12015
12015
  nativeUnknown: "无法确认压缩摘要已提交 · 请查看原生结果",
12016
12016
  omitted: "隐藏推理上下文未带入摘要;可见消息与工具调用关系保留。",
@@ -12021,11 +12021,44 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12021
12021
  requestRunning: "后续请求进行中;尚未确认成功。",
12022
12022
  requestUnknown: "后续请求结果尚未确认。",
12023
12023
  sampled: "已记录仍适用的压缩后输入采样;这是历史证据,不是当前占用。",
12024
- unsampled: "尚未确认仍适用的有效压缩后输入采样;请求成功不能单独证明占用。",
12025
- zero: "原生 0% 不代表上下文为空;不会用另一个估算百分比替代。"
12024
+ dismiss: "关闭",
12025
+ dismissLabel: "关闭上下文采样警告"
12026
12026
  }
12027
12027
  };
12028
- function ContextEvidenceNotice({ evidence, locale = "en", applicable = true, compactionStatus, showCompactionResult = true, controls }) {
12028
+ var ContextIncidentPresentation = class {
12029
+ dismissed = /* @__PURE__ */ new Map();
12030
+ listeners = /* @__PURE__ */ new Set();
12031
+ version = 0;
12032
+ subscribe = (listener) => {
12033
+ this.listeners.add(listener);
12034
+ return () => {
12035
+ this.listeners.delete(listener);
12036
+ };
12037
+ };
12038
+ snapshot = () => this.version;
12039
+ key(sessionId, incident) {
12040
+ return JSON.stringify([
12041
+ sessionId,
12042
+ incident.kind,
12043
+ incident.seq
12044
+ ]);
12045
+ }
12046
+ visible(sessionId, incident) {
12047
+ return !this.dismissed.has(this.key(sessionId, incident));
12048
+ }
12049
+ dismiss(sessionId, incident) {
12050
+ this.dismissed.set(this.key(sessionId, incident), true);
12051
+ while (this.dismissed.size > 128) this.dismissed.delete(this.dismissed.keys().next().value);
12052
+ this.version++;
12053
+ for (const listener of this.listeners) listener();
12054
+ }
12055
+ dispose() {
12056
+ this.dismissed.clear();
12057
+ this.listeners.clear();
12058
+ }
12059
+ };
12060
+ function ContextEvidenceNotice({ evidence, locale = "en", applicable = true, compactionStatus, showCompactionResult = true, controls, sessionId, presentation }) {
12061
+ (0, react.useSyncExternalStore)(presentation?.subscribe ?? subscribeNoop, presentation?.snapshot ?? zeroSnapshot, presentation?.snapshot ?? zeroSnapshot);
12029
12062
  const text = locale.startsWith("zh") ? copy.zh : copy.en;
12030
12063
  const native = evidence?.compaction;
12031
12064
  const status = showCompactionResult ? compactionStatus ?? (native ? {
@@ -12033,11 +12066,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12033
12066
  state: native.state
12034
12067
  } : void 0) : void 0;
12035
12068
  const sample = applicable ? evidence?.sample : null;
12069
+ const incident = applicable ? evidence?.incident : null;
12070
+ const incidentVisible = incident !== null && incident !== void 0 && (sessionId === void 0 || presentation === void 0 || presentation.visible(sessionId, incident));
12036
12071
  const completed = status?.state === "completed";
12037
12072
  const following = applicable && native?.state === "completed" && (status === void 0 || native.id === status.id) ? native : void 0;
12038
12073
  const sampled = following?.endSeq !== null && following?.endSeq !== void 0 && sample !== null && sample !== void 0 && sample.tokens > 0 && sample.seq > following.endSeq && !evidence?.invalid;
12039
- if (!status && evidence !== void 0 && !evidence.invalid && (!following || sampled)) return null;
12040
- const title = status ? completed ? following?.request === "succeeded" ? text.completedSucceeded : following?.request === "failed" ? text.completedFailed : following?.request === "cancelled" ? text.completedCancelled : text.completed : status.state === "running" ? compactionStatus ? text.running : text.nativeRunning : status.state === "cancelled" ? text.cancelled : status.state === "failed" ? compactionStatus ? text.failed : text.nativeFailed : text.nativeUnknown : following ? following.request === "succeeded" ? text.contextSucceeded : following.request === "failed" ? text.contextFailed : following.request === "cancelled" ? text.contextCancelled : text.contextPending : text.title;
12074
+ if (!status && !incidentVisible) return null;
12075
+ const title = status ? completed ? following?.request === "succeeded" ? text.completedSucceeded : following?.request === "failed" ? text.completedFailed : following?.request === "cancelled" ? text.completedCancelled : text.completed : status.state === "running" ? compactionStatus ? text.running : text.nativeRunning : status.state === "cancelled" ? text.cancelled : status.state === "failed" ? compactionStatus ? text.failed : text.nativeFailed : text.nativeUnknown : incident?.kind === "invalid-sample" ? text.invalidSampleTitle : text.failedZeroTitle;
12076
+ const dismiss = incidentVisible && sessionId !== void 0 && presentation !== void 0 ? (0, react.createElement)("button", {
12077
+ type: "button",
12078
+ style: composerNoticeQuietButtonStyle,
12079
+ "aria-label": text.dismissLabel,
12080
+ onClick: () => presentation.dismiss(sessionId, incident)
12081
+ }, text.dismiss) : null;
12041
12082
  const disclosure = (0, react.createElement)("details", {
12042
12083
  "data-copilot-composer-notice": controls === void 0 ? "context" : void 0,
12043
12084
  style: composerNoticeStyle
@@ -12052,13 +12093,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12052
12093
  role: "status",
12053
12094
  "aria-live": "polite",
12054
12095
  style: composerNoticeParagraphStyle
12055
- }, following?.request === "succeeded" ? text.succeeded : following?.request === "failed" ? text.requestFailed : following?.request === "cancelled" ? text.requestCancelled : following?.request === "pending" ? text.requestRunning : following?.request === "idle" ? text.pending : text.requestUnknown) : null, completed || following ? (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, sampled ? text.sampled : text.unsampled) : null, compactionStatus && completed ? (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, text.omitted) : null, status || following ? (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, text.zero) : null, evidence === void 0 || evidence.reason === "unknown" || evidence.reason === "failed-zero" ? (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, evidence === void 0 ? text.missing : evidence.reason === "unknown" ? text.unknown : text.explanation) : null, sample && sample.tokens > 0 ? (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, `${text.sample}: ${new Intl.NumberFormat(locale.startsWith("zh") ? "zh-CN" : "en-US").format(sample.tokens)} tokens`) : null, evidence === void 0 ? null : (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, sample && sample.tokens > 0 ? text.historical : text.revoked));
12056
- return controls === void 0 ? disclosure : (0, react.createElement)("section", {
12096
+ }, following?.request === "succeeded" ? text.succeeded : following?.request === "failed" ? text.requestFailed : following?.request === "cancelled" ? text.requestCancelled : following?.request === "pending" ? text.requestRunning : following?.request === "idle" ? text.pending : text.requestUnknown) : null, completed && sampled ? (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, text.sampled) : null, compactionStatus && completed ? (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, text.omitted) : null, incidentVisible ? (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, incident?.kind === "invalid-sample" ? text.invalidSample : text.failedZero) : null, sample && sample.tokens > 0 ? (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, `${text.sample}: ${new Intl.NumberFormat(locale.startsWith("zh") ? "zh-CN" : "en-US").format(sample.tokens)} tokens`) : null, incidentVisible ? (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, sample && sample.tokens > 0 ? text.historical : text.revoked) : null);
12097
+ const actions = controls === void 0 ? dismiss : controls;
12098
+ return actions === null || actions === void 0 ? disclosure : (0, react.createElement)("section", {
12057
12099
  "data-copilot-composer-notice": "context",
12058
12100
  style: composerNoticeStyle
12059
- }, disclosure, controls);
12101
+ }, disclosure, actions, controls === void 0 ? null : dismiss);
12060
12102
  }
12061
- function Surface$1({ runtime, locale, diagnostic, continuation, presentation }) {
12103
+ function Surface$1({ runtime, locale, diagnostic, continuation, presentation, incidentPresentation }) {
12062
12104
  const valid = runtime.useSession((value) => record$1(value) && value.sessionId === runtime.sessionId && value.removed === false && value.openState === "open");
12063
12105
  const selection = runtime.useProjection("modelSelection");
12064
12106
  const raw = runtime.useProjection(COPILOT_CONTEXT_EVIDENCE);
@@ -12068,6 +12110,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12068
12110
  (0, react.useEffect)(() => {
12069
12111
  if (!parsed.success) diagnostic("COPILOT_CONTEXT_PROJECTION_UNAVAILABLE");
12070
12112
  }, [parsed.success, diagnostic]);
12113
+ (0, react.useEffect)(() => {
12114
+ if (parsed.success && parsed.data.reason === "unknown") diagnostic("COPILOT_CONTEXT_EVIDENCE_INCOMPLETE");
12115
+ }, [
12116
+ parsed.success,
12117
+ parsed.success ? parsed.data.reason : void 0,
12118
+ diagnostic
12119
+ ]);
12071
12120
  if (!valid || !record$1(selection) || !record$1(selection.next)) return null;
12072
12121
  const next = selection.next;
12073
12122
  if (next.provider !== "github-copilot" && next.provider !== "github-copilot-preview") return null;
@@ -12079,8 +12128,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12079
12128
  ...evidence,
12080
12129
  compaction: null,
12081
12130
  sample: null,
12082
- invalid: true,
12083
- reason: "compaction"
12131
+ invalid: false,
12132
+ reason: "compaction",
12133
+ incident: null
12084
12134
  } : evidence;
12085
12135
  const renderEvidence = (compactionStatus, controls, transient = true) => (0, react.createElement)(ContextEvidenceNotice, {
12086
12136
  evidence: shown,
@@ -12088,7 +12138,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12088
12138
  applicable,
12089
12139
  compactionStatus,
12090
12140
  controls,
12091
- showCompactionResult: transient
12141
+ showCompactionResult: transient,
12142
+ sessionId: runtime.sessionId,
12143
+ presentation: incidentPresentation
12092
12144
  });
12093
12145
  return next.provider === "github-copilot-preview" && compact.success && compact.data.id !== null ? (0, react.createElement)(CompactionContinuationNotice, {
12094
12146
  key: runtime.sessionId,
@@ -12118,6 +12170,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12118
12170
  const locale = isLocale$1(candidate) ? candidate : void 0;
12119
12171
  let faces;
12120
12172
  const presentation = new CompactionNoticePresentation();
12173
+ const incidentPresentation = new ContextIncidentPresentation();
12121
12174
  const remove = slots.inject(slot, () => {
12122
12175
  const spec = slots.spec(slot);
12123
12176
  if (spec?.kind !== "list" || spec.scope !== "session") {
@@ -12140,13 +12193,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12140
12193
  locale,
12141
12194
  diagnostic,
12142
12195
  continuation,
12143
- presentation
12196
+ presentation,
12197
+ incidentPresentation
12144
12198
  });
12145
12199
  });
12146
12200
  });
12147
12201
  return () => {
12148
12202
  remove();
12149
12203
  presentation.dispose();
12204
+ incidentPresentation.dispose();
12150
12205
  };
12151
12206
  }
12152
12207
  //#endregion