dsh-github-copilot 0.4.0-alpha.78 → 0.4.0-alpha.80
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 +7 -0
- package/CHANGELOG.md +12 -0
- package/README.md +14 -7
- package/README.zh.md +14 -7
- package/deployment-baseline.json +10 -1
- package/docs/automatic-model-routing.md +24 -0
- package/docs/copilot-compaction.md +4 -0
- package/docs/model-compatibility-acceptance.md +1 -0
- package/lib/index.js +273 -44
- package/lib/types/config.d.ts +9 -4
- package/lib/types/copilot-stream-liveness.d.ts +23 -0
- package/lib/types/preview-provider.d.ts +5 -0
- package/lib/types/preview-route.d.ts +2 -0
- package/lib/types/turn-selection-host.d.ts +11 -0
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -73,6 +73,7 @@ Alpha.25 admits native `subagent/descriptor` v3, already v3 in the retained rc.1
|
|
|
73
73
|
- `src/traditional-search.ts`: `github-copilot-hosted` `ctx.web` provider.
|
|
74
74
|
- `src/serialize.ts`, `src/sse.ts`, `src/failure.ts`: protocol conversion and bounded error handling.
|
|
75
75
|
- `src/response-error-body.ts`, `src/request-body-timeout.ts`: bounded clone-only HTTP error evidence and safe managed upload-timeout guidance. Exact verified `408/user_request_timeout` preserves native failure classification/retry metadata; final JSON bytes are not tokens or a payload limit. Never infer overflow, auto-compact, trim history, switch models or add retries from a 408.
|
|
76
|
+
- `src/copilot-stream-liveness.ts`: request-local HTTP/SSE byte-idle observation, paired with the public native adapter's bounded assistant-chunk deadline. Default five-minute byte idle and ten-minute semantic silence; no fake assistant output, private watchdog access, new retry or Core patch. Consumer think time is excluded; explicit WebSocket/auto stays native-only. `chatStreamLiveness: false` restores native-only timing. `chatMaxRequestImageBytes` retains Core's 20 MiB default; smaller explicit settings authorize only native image offload, not hidden history trimming or a guessed supplier limit. Synthetic heartbeat evidence is not production heartbeat proof.
|
|
76
77
|
- `tests/`: unit and integration evidence; mirror the source area being changed.
|
|
77
78
|
- `deployment-baseline.json`: declared machine-readable compatibility and capability evidence inventory.
|
|
78
79
|
- `scripts/verify-deployment-baseline.mjs`: invariant drift gate.
|
|
@@ -239,6 +240,12 @@ Never say GPT-6/search works merely because settings, typecheck or a package imp
|
|
|
239
240
|
|
|
240
241
|
## Changing capabilities
|
|
241
242
|
|
|
243
|
+
The turn selection Host endpoint must use `TurnSelectionController`, extending
|
|
244
|
+
public `TypertRemoteService` with `@Remote get`. A plain `ctx.provide` object
|
|
245
|
+
cannot supply the native gateway binding or source method discovery. Test both
|
|
246
|
+
actual Client and Host gateways; a synthetic RPC success cannot prove Host
|
|
247
|
+
reachability. Preserve native Agent lookup and bounded store ownership (#254).
|
|
248
|
+
|
|
242
249
|
Automatic pressure and Auto recovery availability resolve the initiating Agent's bound preset through public `agentPresets.composedPreset()` / `serviceFor(agent, 'compaction')`. A bound preset without an engine must not borrow global recovery. Only non-preset Agents use their own `agent.ctx.get('compaction')`; never scan Core's private registry or cache an engine across preset replacement. Native transactions, cancellation, retry policy and manual-only segmented recovery remain unchanged.
|
|
243
250
|
|
|
244
251
|
Selection footer Remote calls carry an explicit viewed Session ID and turn.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0-alpha.80 (prepared)
|
|
4
|
+
|
|
5
|
+
- Observe real HTTP/SSE byte progress on managed requests, retaining the original five-minute byte-idle bound while allowing at most ten minutes without a native assistant chunk (#253).
|
|
6
|
+
- Preserve native SDK parsing, exact stream bytes, caller cancellation and retry ownership; endless heartbeats remain bounded and explicit WebSocket/auto transport keeps native behavior.
|
|
7
|
+
- Add separate managed-chat timeout/opt-out settings and a configurable native image-request budget with the unchanged 20 MiB default. No hidden history trimming, automatic model switch, extra retry or claim to cure HTTP 408.
|
|
8
|
+
- Reproduce heartbeat-only semantic timeouts and verify real late output, actual byte stalls and cleanup through unchanged native adapters.
|
|
9
|
+
|
|
10
|
+
## 0.4.0-alpha.79 (prepared)
|
|
11
|
+
|
|
12
|
+
- Bind retained turn selection reads through the public `TypertRemoteService` and `@Remote get`, fixing the Host registration missing from the alpha.76 Client-only correction (#254).
|
|
13
|
+
- Cover actual Client-to-Host calls in source-discovery and strict modes, including Auto/Manual, missing evidence, missing/denied identities and unload; preserve lookup checks and the existing bounded decision store.
|
|
14
|
+
|
|
3
15
|
## 0.4.0-alpha.78 (prepared)
|
|
4
16
|
|
|
5
17
|
- Optimize individual Exclude/Restore saves with a strict preferences-only Remote response, avoiding credential/account-status reads and live-session scans (#252). Keep single-row immediate persistence, CAS conflicts, invalidation and failure recovery; no batch UI.
|
package/README.md
CHANGED
|
@@ -32,6 +32,8 @@ On official rc.2, routing is exposed through native live `Config` fields, not a
|
|
|
32
32
|
|
|
33
33
|
Managed Copilot HTTP `408 / user_request_timeout` with the verified request-body timeout message now reports `COPILOT_REQUEST_BODY_TIMEOUT` and the final JSON request's UTF-8 byte count when observable. Bytes are not context tokens, and a request-body timeout does not prove context overflow. Native retries and failure classification remain unchanged. If retries exhaust, explicitly compact the conversation or reduce attachments/tool output before retrying, and check network/proxy health and [GitHub service status](https://www.githubstatus.com/). Compaction is not guaranteed to succeed or cure network/service faults; increasing a client timeout cannot change the server timeout. No automatic history trimming, model switch, compaction or new retry loop is introduced. Unknown errors retain native behavior.
|
|
34
34
|
|
|
35
|
+
Managed HTTP/SSE chat now distinguishes **byte idle** from **assistant-output silence**. Native Core ignores SSE heartbeats when timing assistant chunks; synthetic unchanged-adapter tests reproduce a timeout despite incoming bytes. By default, five minutes without response headers/nonempty body bytes still fails, but real byte progress permits up to ten minutes without an assistant chunk. Endless heartbeats cannot postpone failure indefinitely, and consumer think time is excluded. `chatStreamLiveness: false` restores native-only timing; explicit WebSocket/`auto` transport remains native-only. This fixes the reproduced false-idle mechanism, not every retry or upstream HTTP 408, and does not establish heartbeat activity in a production incident.
|
|
36
|
+
|
|
35
37
|
| DSH surface | Exact source pin | Models UI seam |
|
|
36
38
|
|---|---|---|
|
|
37
39
|
| Controlled Desktop `0.1.1-rc.2` baseline | Controlled Core commit [`a772dbb`](https://github.com/cloga/deepseek-harness/commit/a772dbbde82780bff2b9394427e9f0a24cafa1d5) on `cloga-pi-ai-model-api` | Dedicated **Settings → GitHub Copilot** section |
|
|
@@ -106,7 +108,7 @@ The Host reads GitHub's internal quota endpoint using the existing canonical OAu
|
|
|
106
108
|
|
|
107
109
|
## Install and sign in
|
|
108
110
|
|
|
109
|
-
The commands below target the package version `0.4.0-alpha.
|
|
111
|
+
The commands below target the package version `0.4.0-alpha.80`. 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):
|
|
110
112
|
|
|
111
113
|
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):
|
|
112
114
|
|
|
@@ -119,10 +121,10 @@ Include any launcher patch files with repeated `--patch /absolute/file` argument
|
|
|
119
121
|
For a standalone named profile only, the supported CLI command is:
|
|
120
122
|
|
|
121
123
|
```sh
|
|
122
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
124
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.80/dsh-github-copilot-0.4.0-alpha.80.tgz
|
|
123
125
|
```
|
|
124
126
|
|
|
125
|
-
For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.
|
|
127
|
+
For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.80` 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.
|
|
126
128
|
|
|
127
129
|
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.
|
|
128
130
|
|
|
@@ -146,6 +148,8 @@ Completed Copilot replies show **Auto (preference)** and an expandable recorded
|
|
|
146
148
|
|
|
147
149
|
The selection footer mounts independently of optional conversation projections. Native completed-turn evidence lets retained Auto/Manual records remain visible if those projections are unavailable; incomplete attribution stays explicit in the information disclosure. This does not restore lost selection records or prove that an installed update is loaded in Desktop.
|
|
148
150
|
|
|
151
|
+
Alpha.79 also fixes the Host half of selection reads: the retained decision store is now exposed through the public Remote service binding and method marker, not a plain provided object rejected by the native gateway. Actual Client-to-Host roundtrips cover both source discovery and strict descriptors. This complements alpha.76's Client argument fix; it does not recover lost records or change Auto model selection.
|
|
152
|
+
|
|
149
153
|
Auto input fitting uses Core's native TokenMeter for every entered message, including reasoning and tool history, plus its current-surface/tool-envelope floor. Missing or invalid native measurement fails Auto explicitly rather than silently selecting from an undercount. This prevents the known estimation error but does not rescue history whose summary input already exceeds every eligible model's budget; see [compaction limits](./docs/copilot-compaction.md#existing-oversized-history-and-recovery-limits).
|
|
150
154
|
|
|
151
155
|
Alpha.63 fixes a missing footer on official Desktop by supporting its native ChatNodeStore rather than requiring a JavaScript Map. It does not change Auto selection or recover reasons already lost on Host restart.
|
|
@@ -175,7 +179,7 @@ Agents should treat the browser authorization as a human handoff, not as a token
|
|
|
175
179
|
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.
|
|
176
180
|
6. Use **Sign out** only when the user explicitly asks to disconnect the account. It deletes the Copilot credential record but preserves route settings.
|
|
177
181
|
|
|
178
|
-
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.
|
|
182
|
+
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.80`, 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).
|
|
179
183
|
|
|
180
184
|
**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.
|
|
181
185
|
|
|
@@ -361,6 +365,9 @@ The plugin details page exposes only **Search provider** and **Fallback provider
|
|
|
361
365
|
|---|---:|---|
|
|
362
366
|
| `accountModelTtlMs` | `86400000` | Maximum account-metadata reuse window in milliseconds (24h); does not extend credentials or proof validity. |
|
|
363
367
|
| `accountModelFailureCooldownMs` | `300000` | Failure cooldown in milliseconds (5min) for non-forcing discovery; no periodic retries. |
|
|
368
|
+
| `chatStreamIdleTimeoutMs` | `300000` | Managed chat byte-idle interval; native assistant-chunk silence is bounded to twice this interval when liveness is enabled (maximum 2147483647 ms). Separate from hosted search. |
|
|
369
|
+
| `chatStreamLiveness` | `true` | Observe actual HTTP/SSE bytes without synthetic assistant output; `false` restores native-only timing. Explicit WebSocket/`auto` transport is unchanged. |
|
|
370
|
+
| `chatMaxRequestImageBytes` | `20971520` | Native outgoing image budget (20 MiB), not a total JSON/supplier limit. A smaller explicit value lets Core offload older images to mapped read-only paths; original history stays intact, but outgoing image visibility changes. |
|
|
364
371
|
| `requestBudgetSafetyTokens` | `4096` | Non-negative safe-integer estimated input allowance; larger values reduce available input. |
|
|
365
372
|
| `requestBudgetPressureRatio` | `0.9` | Fraction (0.01–1, step 0.01) for early local pressure, only with supported enabled stock recovery. |
|
|
366
373
|
| `compactionReasoning` | `prefer-low` | Choose supported minimal/low only when summary effort is absent; `preserve` keeps native defaults. |
|
|
@@ -454,8 +461,8 @@ Report the published Release URL, version, tag/commit and verified asset SHA-256
|
|
|
454
461
|
`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.
|
|
455
462
|
|
|
456
463
|
```sh
|
|
457
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
458
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
464
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.80/dsh-github-copilot-0.4.0-alpha.80.tgz
|
|
465
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.80/SHA256SUMS
|
|
459
466
|
sha256sum --check SHA256SUMS
|
|
460
467
|
```
|
|
461
468
|
|
|
@@ -463,7 +470,7 @@ PowerShell can verify the same two downloaded files with:
|
|
|
463
470
|
|
|
464
471
|
```powershell
|
|
465
472
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
466
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
473
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.80.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
467
474
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
468
475
|
```
|
|
469
476
|
|
package/README.zh.md
CHANGED
|
@@ -26,7 +26,7 @@ Core 管理。详见[图片兼容性与限制](./docs/image-input-compatibility.
|
|
|
26
26
|
|
|
27
27
|
截图来自当前构建 Client 的隔离浏览器 fixture,使用合成 Provider。它只证明已发布配置界面的形态,不证明真实凭据、账号权限、搜索成功或当前 Desktop 已加载。
|
|
28
28
|
|
|
29
|
-
> 当前文档与安装命令对应版本 `0.4.0-alpha.
|
|
29
|
+
> 当前文档与安装命令对应版本 `0.4.0-alpha.80`。源码、发布制品、已安装版本和实际加载运行时需分别确认;本地升级和中断会话的重启仍需用户批准。
|
|
30
30
|
|
|
31
31
|
Web search 路由现在优先显示在插件详情页;宿主不支持详情页插槽时才回退到 **设置 → 模型**或独立 Web search section。搜索子 Fiber 仍独立等待 Remote,不影响账号控件和既有搜索安全检查。
|
|
32
32
|
|
|
@@ -36,6 +36,8 @@ Web search 路由现在优先显示在插件详情页;宿主不支持详情页
|
|
|
36
36
|
|
|
37
37
|
托管 Copilot 返回 `408 / user_request_timeout` 且确认是读取请求体超时时,现会显示 `COPILOT_REQUEST_BODY_TIMEOUT`,并在可观测时给出最终 JSON 请求的 UTF-8 字节数。字节不是上下文 token,上传超时也不证明上下文超限。原生重试与失败分类保持不变。重试耗尽后,可显式压缩会话或减少附件/工具输出再试,并检查网络/代理及 [GitHub 服务状态](https://www.githubstatus.com/)。压缩不保证成功,也无法修复网络或服务故障;调大客户端超时不会改变服务端超时。插件不会自动裁剪历史、切换模型、压缩或新增重试循环,未识别错误仍由原生流程处理。
|
|
38
38
|
|
|
39
|
+
托管 HTTP/SSE 聊天现区分**字节空闲**与**助手输出静默**。Core 原生计时只看助手 chunk,忽略 SSE 心跳;未修改原生适配器的合成测试已复现“仍有字节却超时”。默认连续五分钟无响应头/非空响应体字节仍失败;实际字节进展只允许助手输出静默延长到十分钟,持续心跳也不能无限等待,消费者处理输出的时间不计入空闲。`chatStreamLiveness: false` 恢复纯原生计时;显式 WebSocket/`auto` transport 保持原生行为。这修复已复现的误判机制,不保证消除所有重试或服务端 HTTP 408,也不证明某次生产故障中实际存在心跳。
|
|
40
|
+
|
|
39
41
|
| DSH 表面 | 精确源码 pin | Models UI 接口 |
|
|
40
42
|
|---|---|---|
|
|
41
43
|
| 受控 Desktop `0.1.1-rc.2` 基线 | `cloga-pi-ai-model-api` 上的受控 Core commit [`a772dbb`](https://github.com/cloga/deepseek-harness/commit/a772dbbde82780bff2b9394427e9f0a24cafa1d5) | 独立的 **Settings → GitHub Copilot** section |
|
|
@@ -121,10 +123,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
|
|
|
121
123
|
仅对独立的具名 profile,获准且网络可用时,可通过受支持的 CLI 命令安装:
|
|
122
124
|
|
|
123
125
|
```sh
|
|
124
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
126
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.80/dsh-github-copilot-0.4.0-alpha.80.tgz
|
|
125
127
|
```
|
|
126
128
|
|
|
127
|
-
Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.
|
|
129
|
+
Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.80`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
|
|
128
130
|
|
|
129
131
|
随后打开上表对应的 Models UI,找到 **GitHub Copilot**,点击 **Sign in** 并完成 GitHub device-code 流程。安装会修改指定 profile;是否立即激活取决于该 profile 的常规 reload/restart 策略。
|
|
130
132
|
|
|
@@ -148,6 +150,8 @@ Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理
|
|
|
148
150
|
|
|
149
151
|
选择标记独立于可选会话投影挂载。投影不可用时,原生已完成回合证据仍允许显示保留的 Auto/手动记录;归属证据不完整会在信息弹层中明确说明。这不会恢复丢失的选择记录,也不证明已安装的更新已在 Desktop 加载。
|
|
150
152
|
|
|
153
|
+
Alpha.79 进一步修复选模读取的 Host 端:通过官方 Remote 服务绑定与方法标记暴露现有决策存储,不再使用会被原生网关拒绝的普通对象。实际 Client→Host 连通回归覆盖源码发现和严格描述符两种方式。这补齐 alpha.76 的 Client 参数修复,不恢复已丢失记录,也不改变 Auto 的选模逻辑。
|
|
154
|
+
|
|
151
155
|
Auto 输入适配通过 Core 原生 TokenMeter 逐条估算消息,包含推理与工具历史,并保留原生当前上下文/工具定义测量值作为下限。缺失或无效的测量会明确报错,不再静默漏算后选模型。这能修复已知估算错误,但不能救回摘要输入已经超出所有合格模型预算的历史;详见[压缩恢复边界](./docs/copilot-compaction.md#existing-oversized-history-and-recovery-limits)。
|
|
152
156
|
|
|
153
157
|
Alpha.63 通过支持官方 Desktop 的原生 ChatNodeStore、移除必须为 JavaScript Map 的错误限制,修复尾栏不显示的问题。不改变 Auto 选择策略,也不能恢复 Host 重启后已丢失的选择原因。
|
|
@@ -177,7 +181,7 @@ Agent 应把浏览器授权视为需要用户完成的 handoff,而不是自行
|
|
|
177
181
|
5. 确认 **Signed in** 并检查自动发现结果,再请用户选择模型。已登录时打开 Models 会自动确保缺失/过期元数据,新鲜 ready 缓存不发请求。错误可使用 **Retry**,有意强制更新时使用 **Manage → Refresh models**,不作为常规设置步骤。状态读取本身不发现;登录、元数据与真实调用成功是独立证据。
|
|
178
182
|
6. 只有用户明确要求断开账号时才使用 **Sign out**;它会删除 Copilot credential record,但保留 route settings。
|
|
179
183
|
|
|
180
|
-
每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.
|
|
184
|
+
每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.80`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
|
|
181
185
|
|
|
182
186
|
**Desktop package 更新与 Web 生命周期边界:**原生 manager 对已安装 package 原位升级返回的 `restart-required` 是权威结果,与移除/重加 plugin bundle 的行为是两个不同问题。涉及服务重编排补丁(`cordis.patch.yml`,如本插件所采用的隔离路由 Web 搜索层)的停用、移除或升级,可能让依赖条目保持 pending,直到完全退出并冷重启 Desktop。若原生 manager 只报告类似 `pending (waiting for service: web)` 的条目,同时本插件已经显示 **Off**,说明请求的停用状态已经落盘;请冷重启 Desktop,不要反复切换或重装插件。其它错误不属于此提示范围,仍需单独排查。
|
|
183
187
|
|
|
@@ -364,6 +368,9 @@ Copilot Session 如需更宽的文件或命令权限,必须在调用前选择
|
|
|
364
368
|
|---|---:|---|
|
|
365
369
|
| `accountModelTtlMs` | `86400000` | 最大账号元数据复用窗口,毫秒(24 小时);不延长凭据或 proof 有效期。 |
|
|
366
370
|
| `accountModelFailureCooldownMs` | `300000` | 非强制发现的失败冷却,毫秒(5 分钟);不设周期重试。 |
|
|
371
|
+
| `chatStreamIdleTimeoutMs` | `300000` | 托管聊天字节空闲间隔;启用 liveness 时,原生助手 chunk 静默上限为此间隔的两倍(最高 2147483647 毫秒)。与 hosted search 分开。 |
|
|
372
|
+
| `chatStreamLiveness` | `true` | 观察实际 HTTP/SSE 字节,不伪造助手输出;`false` 恢复纯原生计时。显式 WebSocket/`auto` transport 不变。 |
|
|
373
|
+
| `chatMaxRequestImageBytes` | `20971520` | 原生出站图片预算(20 MiB),不是总 JSON/供应方上限。显式减小后由 Core 将较旧图片 offload 到映射的只读路径;原始历史保留,但出站图片可见性会改变。 |
|
|
367
374
|
| `requestBudgetSafetyTokens` | `4096` | 非负安全整数的估算输入余量;增加会减少可用输入空间。 |
|
|
368
375
|
| `requestBudgetPressureRatio` | `0.9` | 提前压力比例,0.01–1、步长 0.01;仅在官方自动恢复已启用且接口可用时使用。 |
|
|
369
376
|
| `compactionReasoning` | `prefer-low` | 摘要等级缺省时选择已支持的 minimal/low;`preserve` 保留原生默认。 |
|
|
@@ -465,8 +472,8 @@ node scripts/agent.mjs attribution "DeepSeek Harness (DSH)"
|
|
|
465
472
|
`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 要求包已存在,不能代替首次建包。不会批量补发历史版本。
|
|
466
473
|
|
|
467
474
|
```sh
|
|
468
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
469
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
475
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.80/dsh-github-copilot-0.4.0-alpha.80.tgz
|
|
476
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.80/SHA256SUMS
|
|
470
477
|
sha256sum --check SHA256SUMS
|
|
471
478
|
```
|
|
472
479
|
|
|
@@ -474,7 +481,7 @@ PowerShell 可以对已下载的同一组文件执行:
|
|
|
474
481
|
|
|
475
482
|
```powershell
|
|
476
483
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
477
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
484
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.80.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
478
485
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
479
486
|
```
|
|
480
487
|
|
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.80"
|
|
12
12
|
},
|
|
13
13
|
"evidence": {
|
|
14
14
|
"kind": "source-and-synthetic-test-inventory",
|
|
@@ -553,6 +553,8 @@
|
|
|
553
553
|
{"file": "src/remote.ts", "marker": "githubCopilot.setModelExcluded"},
|
|
554
554
|
{"file": "src/preview-provider.ts", "marker": "native.streamSimple"},
|
|
555
555
|
{"file": "src/request-body-timeout.ts", "marker": "COPILOT_REQUEST_BODY_TIMEOUT"},
|
|
556
|
+
{"file": "src/copilot-stream-liveness.ts", "marker": "COPILOT_STREAM_IDLE_TIMEOUT"},
|
|
557
|
+
{"file": "src/preview-route.ts", "marker": "Math.min(idle * 2, 2_147_483_647)"},
|
|
556
558
|
{"file": "src/response-error-body.ts", "marker": "readResponseErrorJson"},
|
|
557
559
|
{"file": "src/pi-provider-bridge.ts", "marker": "PiStreamPublicCompatibility"}
|
|
558
560
|
],
|
|
@@ -570,6 +572,12 @@
|
|
|
570
572
|
{"file": "tests/preview-route.spec.ts", "name": "enriches only a verified 408 while preserving native failure classification and retry ownership"},
|
|
571
573
|
{"file": "tests/preview-provider.spec.ts", "name": "observes verified %s timeout without changing bytes, Response, native retries or credential ownership"},
|
|
572
574
|
{"file": "tests/request-body-timeout.spec.ts", "name": "bounds stalled response observation and gives cancellation priority"},
|
|
575
|
+
{"file": "tests/copilot-stream-liveness.spec.ts", "name": "does not count consumer think time as provider idle"},
|
|
576
|
+
{"file": "tests/copilot-stream-adapter.spec.ts", "name": "reproduces native semantic timeout despite ongoing SSE bytes"},
|
|
577
|
+
{"file": "tests/copilot-stream-adapter.spec.ts", "name": "allows real late output after the original semantic-idle boundary"},
|
|
578
|
+
{"file": "tests/copilot-stream-adapter.spec.ts", "name": "retains a native hard semantic deadline for an endless heartbeat stream"},
|
|
579
|
+
{"file": "tests/preview-route.spec.ts", "name": "restores byte-idle failures as TIMEOUT without adding a native wire attempt"},
|
|
580
|
+
{"file": "tests/preview-route.spec.ts", "name": "excludes actual Core consumer think time despite eager SDK event forwarding"},
|
|
573
581
|
{"file": "tests/pi-provider-bridge.spec.ts", "name": "preserves the stream object rather than copying or replacing its private queue"},
|
|
574
582
|
{"file": "tests/pi-provider-bridge.spec.ts", "name": "passes the checked simple input through and rejects unsupported advanced entry without I/O"}
|
|
575
583
|
]
|
|
@@ -1066,6 +1074,7 @@
|
|
|
1066
1074
|
{"file": "src/turn-model-provenance.ts", "marker": "assistant/message"},
|
|
1067
1075
|
{"file": "src/turn-selection-card.ts", "marker": "Selection unknown"},
|
|
1068
1076
|
{"file": "src/turn-selection-remote.ts", "marker": "lookup: 'agent'"},
|
|
1077
|
+
{"file": "src/turn-selection-host.ts", "marker": "extends TypertRemoteService"},
|
|
1069
1078
|
{"file": "src/turn-selection-card.ts", "marker": "Selection unavailable"},
|
|
1070
1079
|
{"file": "docs/automatic-model-routing.md", "marker": "plugin-only"}
|
|
1071
1080
|
],
|
|
@@ -109,6 +109,30 @@ Chat Auto does not own or alter the independent `github-copilot-hosted` search p
|
|
|
109
109
|
|
|
110
110
|
## Attribution and explanation
|
|
111
111
|
|
|
112
|
+
**Host binding follow-up (alpha.79, #254):** alpha.76 fixed Client argument
|
|
113
|
+
projection, but the Host still provided selection reads as an ordinary
|
|
114
|
+
`ctx.provide(..., { get })` object. That is not a Typert Remote service.
|
|
115
|
+
The native strict Host gateway rejects it with `gateway/binding-invalid`
|
|
116
|
+
before reading the store; source-mode discovery cannot expose the endpoint
|
|
117
|
+
without a Remote binding and method marker. A fresh master reply can therefore
|
|
118
|
+
show **Selection unavailable** even after the Client fix.
|
|
119
|
+
|
|
120
|
+
`TurnSelectionController` now extends the published `TypertRemoteService` and
|
|
121
|
+
marks `get` with `@Remote`, following the other plugin Host controllers. It wraps
|
|
122
|
+
the same bounded `TurnSelectionStore`, with unchanged explicit Session/turn
|
|
123
|
+
arguments, native Agent lookup/access checks, missing-evidence semantics and
|
|
124
|
+
disposal. It does not append history, grant child access, infer a selection or
|
|
125
|
+
alter Auto routing.
|
|
126
|
+
|
|
127
|
+
Regression coverage crosses the actual Client gateway, in-process native Host
|
|
128
|
+
connection and actual Host gateway in both source-discovery and strict modes.
|
|
129
|
+
It reproduces the old registration failure and checks Auto, Manual, missing
|
|
130
|
+
records, missing/denied identities, removal and service unload. An isolated
|
|
131
|
+
process also exercised the unchanged rc.2 public modules bundled in the installed
|
|
132
|
+
Desktop; this is contract evidence, not a query of the running Host or live
|
|
133
|
+
model transport. The previous Client-only mock transport was insufficient
|
|
134
|
+
evidence for Host reachability.
|
|
135
|
+
|
|
112
136
|
**Fresh master/lead selection reads (alpha.76, #249):** the footer explicitly
|
|
113
137
|
calls `get(viewedSessionId, turn)`. Its old Remote descriptor also declared an
|
|
114
138
|
automatic `agent` scope projection. The unchanged rc.2 Client gateway prefers
|
|
@@ -91,6 +91,10 @@ Current scoped-recovery evidence additionally targets unchanged official `639ed0
|
|
|
91
91
|
|
|
92
92
|
## Verification boundary
|
|
93
93
|
|
|
94
|
+
Managed HTTP/SSE liveness is separate from compaction and HTTP 408. Core's idle watchdog measures translated assistant chunks, not heartbeat bytes. The plugin observes actual nonempty bytes without parsing or fabricating output: the default byte-idle limit stays five minutes, while native semantic silence is bounded to ten minutes. Consumer think time does not count; endless heartbeats still fail. Caller cancellation and native retry ownership remain unchanged. Explicit WebSocket/auto transport and `chatStreamLiveness: false` retain native-only timing.
|
|
95
|
+
|
|
96
|
+
`github-copilot.chatMaxRequestImageBytes` exposes the existing native image projection budget with its unchanged 20971520-byte default. An explicit smaller budget can reduce outgoing image payloads by offloading older images into mapped read-only paths; original history is retained, but outgoing image visibility changes. This is not a total request cap, automatic compaction, or a supplier size limit. No live budget reduction is performed by installation or by a 408. Fixed text/tool prefixes and network/service faults may still cause upload timeouts.
|
|
97
|
+
|
|
94
98
|
Pure arithmetic and policy tests, public-middleware fixtures, and the real published native adapter/SDK with synthetic transport cover separate layers. Required cases include independent/combined bounds, changed prefixes, explicit/default output and effort, metadata/credential invalidation, direct/prepared parity, concurrent calls, cancellation, output truncation and oversized manual input. Existing full plugin gates and exact-Core compatibility fixtures remain required; source inventory is not their execution result.
|
|
95
99
|
|
|
96
100
|
No live model inference, local Desktop installation, activation or restart is implied by unit tests or publication. Preserve immutable GitHub/npm byte identity and coordinate Desktop/Ops pins separately after release verification.
|
|
@@ -21,6 +21,7 @@ Follow the [plugin-only boundary](../AGENTS.md#plugin-only-implementation-bounda
|
|
|
21
21
|
- Cover missing/conflicting endpoints, missing/invalid limits, duplicate conflicting IDs, explicit denial, stale account snapshots, unsupported reasoning labels, unknown fields and hostile extra getters.
|
|
22
22
|
- Exercise real published adapter/SDK code against local synthetic HTTP for all supported protocols, including tools, public summaries, two-turn opaque replay, images and interruption/retry paths. Synthetic results are not claims of live account availability.
|
|
23
23
|
- Verify managed request-body timeout guidance only for the observed HTTP `408`, exact `user_request_timeout` code and request-body message. Bound clone reads to 8 KiB/250 ms, retain the original native response, and expose only fixed guidance plus final string-body UTF-8 bytes. Preserve failure code, retry metadata, cancellation, unchanged retry payloads and independent dispatches. Do not reclassify 408 as overflow, invent a safe byte threshold, change client timeouts, refresh OAuth, compact automatically or promise elimination of upstream failures.
|
|
24
|
+
- Verify byte-aware managed HTTP/SSE liveness through unchanged published and tagged adapters: heartbeat bytes may cross the original semantic deadline before actual output, but endless heartbeat-only output must hit the bounded native deadline. Real header/body stalls retain the original interval and a dispatch-local TIMEOUT; consumer think time, caller/credential cancellation, exact bytes, parser ownership and one native wire attempt remain unchanged. Explicit WebSocket/auto and opt-out retain native-only behavior. Preserve the 20 MiB native image budget by default; explicit smaller budgets must use native offload and retain mapped read-only paths/history, never hidden trimming or a claimed supplier threshold. These synthetic cases do not attest production heartbeat activity or cure HTTP 408.
|
|
24
25
|
- Run source/test typechecks, complete repository tests, built Host/Client/Remote smoke, archive verification, and relevant unchanged-Core compatibility fixtures. Do not suppress type or test failures to bridge incompatible SDK versions.
|
|
25
26
|
|
|
26
27
|
## Explicit public-interface limits
|
package/lib/index.js
CHANGED
|
@@ -21,12 +21,12 @@ import { estimateContextTokens, estimateMessageTokens } from "@earendil-works/pi
|
|
|
21
21
|
import { buildCopilotDynamicHeaders, hasCopilotVisionInput } from "@earendil-works/pi-ai/api/github-copilot-headers";
|
|
22
22
|
//#region lib/types/dual-model-host.js
|
|
23
23
|
/** Retired planner/executor entry points; retained policies stay enforceable without migration. */
|
|
24
|
-
var __runInitializers$
|
|
24
|
+
var __runInitializers$4 = function(thisArg, initializers, value) {
|
|
25
25
|
var useValue = arguments.length > 2;
|
|
26
26
|
for (var i = 0; i < initializers.length; i++) value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
27
27
|
return useValue ? value : void 0;
|
|
28
28
|
};
|
|
29
|
-
var __esDecorate$
|
|
29
|
+
var __esDecorate$4 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
30
30
|
function accept(f) {
|
|
31
31
|
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
32
32
|
return f;
|
|
@@ -272,7 +272,7 @@ let GitHubCopilotDualModel = (() => {
|
|
|
272
272
|
_view_decorators = [Remote];
|
|
273
273
|
_save_decorators = [Remote];
|
|
274
274
|
_create_decorators = [Remote];
|
|
275
|
-
__esDecorate$
|
|
275
|
+
__esDecorate$4(this, null, _view_decorators, {
|
|
276
276
|
kind: "method",
|
|
277
277
|
name: "view",
|
|
278
278
|
static: false,
|
|
@@ -283,7 +283,7 @@ let GitHubCopilotDualModel = (() => {
|
|
|
283
283
|
},
|
|
284
284
|
metadata: _metadata
|
|
285
285
|
}, null, _instanceExtraInitializers);
|
|
286
|
-
__esDecorate$
|
|
286
|
+
__esDecorate$4(this, null, _save_decorators, {
|
|
287
287
|
kind: "method",
|
|
288
288
|
name: "save",
|
|
289
289
|
static: false,
|
|
@@ -294,7 +294,7 @@ let GitHubCopilotDualModel = (() => {
|
|
|
294
294
|
},
|
|
295
295
|
metadata: _metadata
|
|
296
296
|
}, null, _instanceExtraInitializers);
|
|
297
|
-
__esDecorate$
|
|
297
|
+
__esDecorate$4(this, null, _create_decorators, {
|
|
298
298
|
kind: "method",
|
|
299
299
|
name: "create",
|
|
300
300
|
static: false,
|
|
@@ -312,7 +312,7 @@ let GitHubCopilotDualModel = (() => {
|
|
|
312
312
|
value: _metadata
|
|
313
313
|
});
|
|
314
314
|
}
|
|
315
|
-
owner = __runInitializers$
|
|
315
|
+
owner = __runInitializers$4(this, _instanceExtraInitializers);
|
|
316
316
|
lifetime = new AbortController();
|
|
317
317
|
creates = /* @__PURE__ */ new Map();
|
|
318
318
|
overlays = /* @__PURE__ */ new Map();
|
|
@@ -740,12 +740,12 @@ const SearchProviderCatalogSchema = z$1.object({
|
|
|
740
740
|
}).strict();
|
|
741
741
|
//#endregion
|
|
742
742
|
//#region lib/types/search-routing-host.js
|
|
743
|
-
var __runInitializers$
|
|
743
|
+
var __runInitializers$3 = function(thisArg, initializers, value) {
|
|
744
744
|
var useValue = arguments.length > 2;
|
|
745
745
|
for (var i = 0; i < initializers.length; i++) value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
746
746
|
return useValue ? value : void 0;
|
|
747
747
|
};
|
|
748
|
-
var __esDecorate$
|
|
748
|
+
var __esDecorate$3 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
749
749
|
function accept(f) {
|
|
750
750
|
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
751
751
|
return f;
|
|
@@ -788,7 +788,7 @@ let SearchRoutingController = (() => {
|
|
|
788
788
|
static {
|
|
789
789
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
790
790
|
_providers_decorators = [Remote];
|
|
791
|
-
__esDecorate$
|
|
791
|
+
__esDecorate$3(this, null, _providers_decorators, {
|
|
792
792
|
kind: "method",
|
|
793
793
|
name: "providers",
|
|
794
794
|
static: false,
|
|
@@ -808,7 +808,7 @@ let SearchRoutingController = (() => {
|
|
|
808
808
|
}
|
|
809
809
|
constructor(ctx) {
|
|
810
810
|
super(ctx, "githubCopilotSearchRouting");
|
|
811
|
-
__runInitializers$
|
|
811
|
+
__runInitializers$3(this, _instanceExtraInitializers);
|
|
812
812
|
}
|
|
813
813
|
providers() {
|
|
814
814
|
const unavailable = {
|
|
@@ -1250,12 +1250,12 @@ function normalizeCopilotUsage(input, observedAt) {
|
|
|
1250
1250
|
}
|
|
1251
1251
|
//#endregion
|
|
1252
1252
|
//#region lib/types/copilot-usage-host.js
|
|
1253
|
-
var __runInitializers$
|
|
1253
|
+
var __runInitializers$2 = function(thisArg, initializers, value) {
|
|
1254
1254
|
var useValue = arguments.length > 2;
|
|
1255
1255
|
for (var i = 0; i < initializers.length; i++) value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
1256
1256
|
return useValue ? value : void 0;
|
|
1257
1257
|
};
|
|
1258
|
-
var __esDecorate$
|
|
1258
|
+
var __esDecorate$2 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
1259
1259
|
function accept(f) {
|
|
1260
1260
|
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
1261
1261
|
return f;
|
|
@@ -1595,7 +1595,7 @@ let GitHubCopilotUsageController = (() => {
|
|
|
1595
1595
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
1596
1596
|
_get_decorators = [Remote];
|
|
1597
1597
|
_refresh_decorators = [Remote];
|
|
1598
|
-
__esDecorate$
|
|
1598
|
+
__esDecorate$2(this, null, _get_decorators, {
|
|
1599
1599
|
kind: "method",
|
|
1600
1600
|
name: "get",
|
|
1601
1601
|
static: false,
|
|
@@ -1606,7 +1606,7 @@ let GitHubCopilotUsageController = (() => {
|
|
|
1606
1606
|
},
|
|
1607
1607
|
metadata: _metadata
|
|
1608
1608
|
}, null, _instanceExtraInitializers);
|
|
1609
|
-
__esDecorate$
|
|
1609
|
+
__esDecorate$2(this, null, _refresh_decorators, {
|
|
1610
1610
|
kind: "method",
|
|
1611
1611
|
name: "refresh",
|
|
1612
1612
|
static: false,
|
|
@@ -1624,7 +1624,7 @@ let GitHubCopilotUsageController = (() => {
|
|
|
1624
1624
|
value: _metadata
|
|
1625
1625
|
});
|
|
1626
1626
|
}
|
|
1627
|
-
source = __runInitializers$
|
|
1627
|
+
source = __runInitializers$2(this, _instanceExtraInitializers);
|
|
1628
1628
|
constructor(ctx) {
|
|
1629
1629
|
super(ctx, "githubCopilotUsage");
|
|
1630
1630
|
const credentials = createGitHubCopilotCredentialStore(ctx);
|
|
@@ -1847,7 +1847,7 @@ function installContextEvidence(ctx) {
|
|
|
1847
1847
|
//#endregion
|
|
1848
1848
|
//#region package.json
|
|
1849
1849
|
var name$1 = "dsh-github-copilot";
|
|
1850
|
-
var version = "0.4.0-alpha.
|
|
1850
|
+
var version = "0.4.0-alpha.80";
|
|
1851
1851
|
//#endregion
|
|
1852
1852
|
//#region lib/types/probe.js
|
|
1853
1853
|
/**
|
|
@@ -2175,9 +2175,8 @@ const WebSearchRoutingConfigSchema = z.object({
|
|
|
2175
2175
|
//#endregion
|
|
2176
2176
|
//#region lib/types/config.js
|
|
2177
2177
|
/**
|
|
2178
|
-
* Settings
|
|
2179
|
-
*
|
|
2180
|
-
* configurable through the settings seam; defaults follow the chat route.
|
|
2178
|
+
* Settings for managed account requests and inline hosted search, including
|
|
2179
|
+
* separate stream bounds. Credentials and model transport remain native-owned.
|
|
2181
2180
|
* @module dsh-github-copilot/config
|
|
2182
2181
|
*/
|
|
2183
2182
|
/** Keep native live references at the boundary; request code consumes plain snapshots. */
|
|
@@ -2206,6 +2205,9 @@ const Config = z.object({
|
|
|
2206
2205
|
includeSources: z.boolean().default(true),
|
|
2207
2206
|
stripServerTools: z.boolean().default(true),
|
|
2208
2207
|
idleTimeoutMs: z.number().step(1).min(1).max(MAX_TIMEOUT_MS).default(3e5),
|
|
2208
|
+
chatStreamIdleTimeoutMs: z.number().step(1).min(1).max(MAX_TIMEOUT_MS).default(3e5),
|
|
2209
|
+
chatStreamLiveness: z.boolean().default(true),
|
|
2210
|
+
chatMaxRequestImageBytes: z.number().step(1).min(1).max(Number.MAX_SAFE_INTEGER).default(20971520),
|
|
2209
2211
|
probe: z.boolean().default(true),
|
|
2210
2212
|
probeTimeoutMs: z.number().step(1).min(1).max(MAX_TIMEOUT_MS).default(3e4),
|
|
2211
2213
|
accountModelTtlMs: z.number().step(1).min(0).max(MAX_TIMEOUT_MS).default(864e5),
|
|
@@ -4416,12 +4418,12 @@ function excludedModelSet(value) {
|
|
|
4416
4418
|
* Host-side bridge between the Models-page companion UI and DSH's neutral
|
|
4417
4419
|
* authorization, credential-record, and settings seams.
|
|
4418
4420
|
*/
|
|
4419
|
-
var __runInitializers = function(thisArg, initializers, value) {
|
|
4421
|
+
var __runInitializers$1 = function(thisArg, initializers, value) {
|
|
4420
4422
|
var useValue = arguments.length > 2;
|
|
4421
4423
|
for (var i = 0; i < initializers.length; i++) value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
4422
4424
|
return useValue ? value : void 0;
|
|
4423
4425
|
};
|
|
4424
|
-
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
4426
|
+
var __esDecorate$1 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
4425
4427
|
function accept(f) {
|
|
4426
4428
|
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
4427
4429
|
return f;
|
|
@@ -4751,7 +4753,7 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4751
4753
|
_start_decorators = [Remote];
|
|
4752
4754
|
_cancel_decorators = [Remote];
|
|
4753
4755
|
_signOut_decorators = [Remote];
|
|
4754
|
-
__esDecorate(this, null, _migrationStatus_decorators, {
|
|
4756
|
+
__esDecorate$1(this, null, _migrationStatus_decorators, {
|
|
4755
4757
|
kind: "method",
|
|
4756
4758
|
name: "migrationStatus",
|
|
4757
4759
|
static: false,
|
|
@@ -4762,7 +4764,7 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4762
4764
|
},
|
|
4763
4765
|
metadata: _metadata
|
|
4764
4766
|
}, null, _instanceExtraInitializers);
|
|
4765
|
-
__esDecorate(this, null, _status_decorators, {
|
|
4767
|
+
__esDecorate$1(this, null, _status_decorators, {
|
|
4766
4768
|
kind: "method",
|
|
4767
4769
|
name: "status",
|
|
4768
4770
|
static: false,
|
|
@@ -4773,7 +4775,7 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4773
4775
|
},
|
|
4774
4776
|
metadata: _metadata
|
|
4775
4777
|
}, null, _instanceExtraInitializers);
|
|
4776
|
-
__esDecorate(this, null, _excludeModel_decorators, {
|
|
4778
|
+
__esDecorate$1(this, null, _excludeModel_decorators, {
|
|
4777
4779
|
kind: "method",
|
|
4778
4780
|
name: "excludeModel",
|
|
4779
4781
|
static: false,
|
|
@@ -4784,7 +4786,7 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4784
4786
|
},
|
|
4785
4787
|
metadata: _metadata
|
|
4786
4788
|
}, null, _instanceExtraInitializers);
|
|
4787
|
-
__esDecorate(this, null, _restoreModel_decorators, {
|
|
4789
|
+
__esDecorate$1(this, null, _restoreModel_decorators, {
|
|
4788
4790
|
kind: "method",
|
|
4789
4791
|
name: "restoreModel",
|
|
4790
4792
|
static: false,
|
|
@@ -4795,7 +4797,7 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4795
4797
|
},
|
|
4796
4798
|
metadata: _metadata
|
|
4797
4799
|
}, null, _instanceExtraInitializers);
|
|
4798
|
-
__esDecorate(this, null, _setModelExcluded_decorators, {
|
|
4800
|
+
__esDecorate$1(this, null, _setModelExcluded_decorators, {
|
|
4799
4801
|
kind: "method",
|
|
4800
4802
|
name: "setModelExcluded",
|
|
4801
4803
|
static: false,
|
|
@@ -4806,7 +4808,7 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4806
4808
|
},
|
|
4807
4809
|
metadata: _metadata
|
|
4808
4810
|
}, null, _instanceExtraInitializers);
|
|
4809
|
-
__esDecorate(this, null, _discoverModels_decorators, {
|
|
4811
|
+
__esDecorate$1(this, null, _discoverModels_decorators, {
|
|
4810
4812
|
kind: "method",
|
|
4811
4813
|
name: "discoverModels",
|
|
4812
4814
|
static: false,
|
|
@@ -4817,7 +4819,7 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4817
4819
|
},
|
|
4818
4820
|
metadata: _metadata
|
|
4819
4821
|
}, null, _instanceExtraInitializers);
|
|
4820
|
-
__esDecorate(this, null, _ensureModels_decorators, {
|
|
4822
|
+
__esDecorate$1(this, null, _ensureModels_decorators, {
|
|
4821
4823
|
kind: "method",
|
|
4822
4824
|
name: "ensureModels",
|
|
4823
4825
|
static: false,
|
|
@@ -4828,7 +4830,7 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4828
4830
|
},
|
|
4829
4831
|
metadata: _metadata
|
|
4830
4832
|
}, null, _instanceExtraInitializers);
|
|
4831
|
-
__esDecorate(this, null, _reconcile_decorators, {
|
|
4833
|
+
__esDecorate$1(this, null, _reconcile_decorators, {
|
|
4832
4834
|
kind: "method",
|
|
4833
4835
|
name: "reconcile",
|
|
4834
4836
|
static: false,
|
|
@@ -4839,7 +4841,7 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4839
4841
|
},
|
|
4840
4842
|
metadata: _metadata
|
|
4841
4843
|
}, null, _instanceExtraInitializers);
|
|
4842
|
-
__esDecorate(this, null, _start_decorators, {
|
|
4844
|
+
__esDecorate$1(this, null, _start_decorators, {
|
|
4843
4845
|
kind: "method",
|
|
4844
4846
|
name: "start",
|
|
4845
4847
|
static: false,
|
|
@@ -4850,7 +4852,7 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4850
4852
|
},
|
|
4851
4853
|
metadata: _metadata
|
|
4852
4854
|
}, null, _instanceExtraInitializers);
|
|
4853
|
-
__esDecorate(this, null, _cancel_decorators, {
|
|
4855
|
+
__esDecorate$1(this, null, _cancel_decorators, {
|
|
4854
4856
|
kind: "method",
|
|
4855
4857
|
name: "cancel",
|
|
4856
4858
|
static: false,
|
|
@@ -4861,7 +4863,7 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4861
4863
|
},
|
|
4862
4864
|
metadata: _metadata
|
|
4863
4865
|
}, null, _instanceExtraInitializers);
|
|
4864
|
-
__esDecorate(this, null, _signOut_decorators, {
|
|
4866
|
+
__esDecorate$1(this, null, _signOut_decorators, {
|
|
4865
4867
|
kind: "method",
|
|
4866
4868
|
name: "signOut",
|
|
4867
4869
|
static: false,
|
|
@@ -4879,7 +4881,7 @@ let GitHubCopilotAuthorizationController = (() => {
|
|
|
4879
4881
|
value: _metadata
|
|
4880
4882
|
});
|
|
4881
4883
|
}
|
|
4882
|
-
notices = (__runInitializers(this, _instanceExtraInitializers), []);
|
|
4884
|
+
notices = (__runInitializers$1(this, _instanceExtraInitializers), []);
|
|
4883
4885
|
failure;
|
|
4884
4886
|
reconciliationFailed = false;
|
|
4885
4887
|
attempt;
|
|
@@ -5551,6 +5553,112 @@ async function requestBodyTimeoutDiagnostic(response, body, signal) {
|
|
|
5551
5553
|
return `COPILOT_REQUEST_BODY_TIMEOUT: Copilot returned HTTP 408 / user_request_timeout while reading the request body; this is not context-window overflow. ${body === void 0 ? "Request body size unavailable." : `Request body: ${Buffer.byteLength(body, "utf8")} UTF-8 bytes (not context tokens).`} Native retry policy is unchanged. If retries exhaust, explicitly compact the conversation or reduce attachments/tool output before retrying; also check network/proxy health and GitHub service status. A larger client timeout does not change this server timeout. No history was trimmed or model switched.`;
|
|
5552
5554
|
}
|
|
5553
5555
|
//#endregion
|
|
5556
|
+
//#region lib/types/copilot-stream-liveness.js
|
|
5557
|
+
var CopilotStreamIdleError = class extends Error {
|
|
5558
|
+
timeoutMs;
|
|
5559
|
+
constructor(timeoutMs, stage = "waiting for HTTP response", requestBytes) {
|
|
5560
|
+
const size = requestBytes === void 0 ? "Request body size unavailable." : `Request body: ${requestBytes} UTF-8 bytes (not context tokens).`;
|
|
5561
|
+
super(`COPILOT_STREAM_IDLE_TIMEOUT: No HTTP response or nonempty response-body bytes for ${timeoutMs}ms while ${stage}. ${size} Native retry ownership is unchanged; no history was trimmed or model switched.`);
|
|
5562
|
+
this.timeoutMs = timeoutMs;
|
|
5563
|
+
this.name = "CopilotStreamIdleError";
|
|
5564
|
+
}
|
|
5565
|
+
};
|
|
5566
|
+
/** A request-local byte-idle bound; the native adapter separately bounds semantic silence. */
|
|
5567
|
+
var CopilotStreamLiveness = class {
|
|
5568
|
+
timeoutMs;
|
|
5569
|
+
controller = new AbortController();
|
|
5570
|
+
timer;
|
|
5571
|
+
disposed = false;
|
|
5572
|
+
paused = false;
|
|
5573
|
+
stage = "waiting for HTTP response";
|
|
5574
|
+
requestBytes;
|
|
5575
|
+
signal;
|
|
5576
|
+
constructor(timeoutMs, upstream) {
|
|
5577
|
+
this.timeoutMs = timeoutMs;
|
|
5578
|
+
if (!Number.isInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs > 2147483647) throw new Error("COPILOT_STREAM_IDLE_INTERVAL_INVALID");
|
|
5579
|
+
this.signal = AbortSignal.any([upstream, this.controller.signal]);
|
|
5580
|
+
this.signal.addEventListener("abort", this.dispose, { once: true });
|
|
5581
|
+
if (this.signal.aborted) this.dispose();
|
|
5582
|
+
this.pulse();
|
|
5583
|
+
}
|
|
5584
|
+
pulse() {
|
|
5585
|
+
if (this.disposed || this.paused || this.signal.aborted) return;
|
|
5586
|
+
if (this.timer !== void 0) clearTimeout(this.timer);
|
|
5587
|
+
this.timer = setTimeout(() => this.controller.abort(new CopilotStreamIdleError(this.timeoutMs, this.stage, this.requestBytes)), this.timeoutMs);
|
|
5588
|
+
}
|
|
5589
|
+
beginRequest(body) {
|
|
5590
|
+
this.stage = "waiting for HTTP response";
|
|
5591
|
+
this.requestBytes = body === void 0 ? void 0 : Buffer.byteLength(body, "utf8");
|
|
5592
|
+
this.pulse();
|
|
5593
|
+
}
|
|
5594
|
+
pause() {
|
|
5595
|
+
this.paused = true;
|
|
5596
|
+
if (this.timer !== void 0) clearTimeout(this.timer);
|
|
5597
|
+
}
|
|
5598
|
+
resume() {
|
|
5599
|
+
this.paused = false;
|
|
5600
|
+
this.pulse();
|
|
5601
|
+
}
|
|
5602
|
+
observe(response) {
|
|
5603
|
+
if (!response.ok || !response.headers.get("content-type")?.toLowerCase().includes("text/event-stream") || response.body === null) return response;
|
|
5604
|
+
this.stage = "reading the SSE response body";
|
|
5605
|
+
this.pulse();
|
|
5606
|
+
const reader = response.body.getReader();
|
|
5607
|
+
const owner = this;
|
|
5608
|
+
let output;
|
|
5609
|
+
const onAbort = () => {
|
|
5610
|
+
reader.cancel(owner.signal.reason).catch((error) => {
|
|
5611
|
+
output?.error(owner.signal.reason ?? error);
|
|
5612
|
+
});
|
|
5613
|
+
};
|
|
5614
|
+
this.signal.addEventListener("abort", onAbort, { once: true });
|
|
5615
|
+
if (this.signal.aborted) onAbort();
|
|
5616
|
+
return new Response(new ReadableStream({
|
|
5617
|
+
start(controller) {
|
|
5618
|
+
output = controller;
|
|
5619
|
+
},
|
|
5620
|
+
async pull(controller) {
|
|
5621
|
+
try {
|
|
5622
|
+
const next = await reader.read();
|
|
5623
|
+
if (next.done) {
|
|
5624
|
+
controller.close();
|
|
5625
|
+
owner.signal.removeEventListener("abort", onAbort);
|
|
5626
|
+
reader.releaseLock();
|
|
5627
|
+
owner.dispose();
|
|
5628
|
+
} else {
|
|
5629
|
+
if (next.value.byteLength > 0) owner.pulse();
|
|
5630
|
+
controller.enqueue(next.value);
|
|
5631
|
+
}
|
|
5632
|
+
} catch (error) {
|
|
5633
|
+
owner.dispose();
|
|
5634
|
+
owner.signal.removeEventListener("abort", onAbort);
|
|
5635
|
+
reader.releaseLock();
|
|
5636
|
+
controller.error(error);
|
|
5637
|
+
}
|
|
5638
|
+
},
|
|
5639
|
+
async cancel(reason) {
|
|
5640
|
+
owner.dispose();
|
|
5641
|
+
owner.signal.removeEventListener("abort", onAbort);
|
|
5642
|
+
try {
|
|
5643
|
+
await reader.cancel(reason);
|
|
5644
|
+
} finally {
|
|
5645
|
+
reader.releaseLock();
|
|
5646
|
+
}
|
|
5647
|
+
}
|
|
5648
|
+
}), {
|
|
5649
|
+
status: response.status,
|
|
5650
|
+
statusText: response.statusText,
|
|
5651
|
+
headers: response.headers
|
|
5652
|
+
});
|
|
5653
|
+
}
|
|
5654
|
+
dispose = () => {
|
|
5655
|
+
if (this.disposed) return;
|
|
5656
|
+
this.disposed = true;
|
|
5657
|
+
if (this.timer !== void 0) clearTimeout(this.timer);
|
|
5658
|
+
this.signal.removeEventListener("abort", this.dispose);
|
|
5659
|
+
};
|
|
5660
|
+
};
|
|
5661
|
+
//#endregion
|
|
5554
5662
|
//#region lib/types/preview-provider.js
|
|
5555
5663
|
/** Identity, not upstream error text, proves that the plugin revoked this wire. */
|
|
5556
5664
|
var ManagedWireAbortError = class extends Error {
|
|
@@ -5730,6 +5838,24 @@ function createAccountProvider(descriptors, guard, baseURL) {
|
|
|
5730
5838
|
lease.release();
|
|
5731
5839
|
throw new Error("COPILOT_MANAGED_OAUTH_REQUIRED");
|
|
5732
5840
|
}
|
|
5841
|
+
let liveness;
|
|
5842
|
+
try {
|
|
5843
|
+
if (guard.streamIdleTimeoutMs !== void 0) {
|
|
5844
|
+
liveness = new CopilotStreamLiveness(guard.streamIdleTimeoutMs, lease.signal);
|
|
5845
|
+
guard.onStreamLiveness?.(liveness);
|
|
5846
|
+
}
|
|
5847
|
+
} catch (error) {
|
|
5848
|
+
liveness?.dispose();
|
|
5849
|
+
lease.release();
|
|
5850
|
+
throw error;
|
|
5851
|
+
}
|
|
5852
|
+
let idleReported = false;
|
|
5853
|
+
const reportIdleFailure = () => {
|
|
5854
|
+
if (!idleReported && liveness?.signal.reason instanceof CopilotStreamIdleError && !lease.signal.aborted && !options.signal?.aborted) {
|
|
5855
|
+
idleReported = true;
|
|
5856
|
+
guard.onStreamIdleTimeout?.(liveness.signal.reason);
|
|
5857
|
+
}
|
|
5858
|
+
};
|
|
5733
5859
|
const headers = {};
|
|
5734
5860
|
for (const [name, value] of Object.entries(options.headers ?? {})) if (name.toLowerCase() !== "authorization" && name.toLowerCase() !== "x-api-key") headers[name] = value;
|
|
5735
5861
|
Object.assign(headers, buildCopilotDynamicHeaders({
|
|
@@ -5744,6 +5870,7 @@ function createAccountProvider(descriptors, guard, baseURL) {
|
|
|
5744
5870
|
try {
|
|
5745
5871
|
retry = responses ? guard.retryReplay?.begin(context, guard.retrySignal, options?.sessionId, model.id) : void 0;
|
|
5746
5872
|
} catch (error) {
|
|
5873
|
+
liveness?.dispose();
|
|
5747
5874
|
lease.release();
|
|
5748
5875
|
throw error;
|
|
5749
5876
|
}
|
|
@@ -5767,6 +5894,7 @@ function createAccountProvider(descriptors, guard, baseURL) {
|
|
|
5767
5894
|
const fetch = options.fetch ?? globalThis.fetch;
|
|
5768
5895
|
const observeResponse = async (input, init) => {
|
|
5769
5896
|
guard.onRequestBodyTimeout?.(void 0);
|
|
5897
|
+
liveness?.beginRequest(typeof init?.body === "string" ? init.body : void 0);
|
|
5770
5898
|
let response;
|
|
5771
5899
|
try {
|
|
5772
5900
|
response = await fetch(input, init);
|
|
@@ -5783,33 +5911,37 @@ function createAccountProvider(descriptors, guard, baseURL) {
|
|
|
5783
5911
|
if (responses && await isCopilotInputItemScopeError(response, lease.signal)) reportReplayFailure(new CopilotResponsesReplayError("scope-mismatch"));
|
|
5784
5912
|
else unauthorized = true;
|
|
5785
5913
|
}
|
|
5786
|
-
return response;
|
|
5914
|
+
return liveness?.observe(response) ?? response;
|
|
5787
5915
|
};
|
|
5788
5916
|
const wireOptions = model.api === "anthropic-messages" ? {
|
|
5789
5917
|
...options,
|
|
5790
|
-
signal: lease.signal,
|
|
5918
|
+
signal: liveness?.signal ?? lease.signal,
|
|
5791
5919
|
apiKey: void 0,
|
|
5792
5920
|
headers,
|
|
5793
5921
|
fetch: observeResponse
|
|
5794
5922
|
} : {
|
|
5795
5923
|
...options,
|
|
5796
|
-
signal: lease.signal,
|
|
5924
|
+
signal: liveness?.signal ?? lease.signal,
|
|
5797
5925
|
headers,
|
|
5798
5926
|
fetch: observeResponse,
|
|
5799
5927
|
onPayload
|
|
5800
5928
|
};
|
|
5801
5929
|
if (!hasApi(model, "openai-responses") && !hasApi(model, "openai-completions") && !hasApi(model, "anthropic-messages")) {
|
|
5802
5930
|
retry?.finish();
|
|
5931
|
+
liveness?.dispose();
|
|
5803
5932
|
lease.release();
|
|
5804
5933
|
throw new Error("COPILOT_MANAGED_PROTOCOL_UNSUPPORTED");
|
|
5805
5934
|
}
|
|
5806
5935
|
return (async function* () {
|
|
5807
5936
|
try {
|
|
5808
5937
|
for await (const event of native.streamSimple(model, context, wireOptions)) {
|
|
5938
|
+
reportIdleFailure();
|
|
5809
5939
|
if (event.type === "error" && event.reason === "aborted" && lease.signal.reason instanceof ManagedWireAbortError) guard.onWireAbort?.(lease.signal.reason.code);
|
|
5810
5940
|
yield event;
|
|
5811
5941
|
}
|
|
5812
5942
|
} finally {
|
|
5943
|
+
reportIdleFailure();
|
|
5944
|
+
liveness?.dispose();
|
|
5813
5945
|
if (lease.signal.aborted || options.signal?.aborted) retry?.observe(void 0, 0);
|
|
5814
5946
|
retry?.finish();
|
|
5815
5947
|
lease.release();
|
|
@@ -6893,6 +7025,85 @@ var TurnSelectionStore = class {
|
|
|
6893
7025
|
}
|
|
6894
7026
|
};
|
|
6895
7027
|
//#endregion
|
|
7028
|
+
//#region lib/types/turn-selection-host.js
|
|
7029
|
+
var __runInitializers = function(thisArg, initializers, value) {
|
|
7030
|
+
var useValue = arguments.length > 2;
|
|
7031
|
+
for (var i = 0; i < initializers.length; i++) value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
7032
|
+
return useValue ? value : void 0;
|
|
7033
|
+
};
|
|
7034
|
+
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
7035
|
+
function accept(f) {
|
|
7036
|
+
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
7037
|
+
return f;
|
|
7038
|
+
}
|
|
7039
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
7040
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
7041
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7042
|
+
var _, done = false;
|
|
7043
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
7044
|
+
var context = {};
|
|
7045
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
7046
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
7047
|
+
context.addInitializer = function(f) {
|
|
7048
|
+
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
7049
|
+
extraInitializers.push(accept(f || null));
|
|
7050
|
+
};
|
|
7051
|
+
var result = (0, decorators[i])(kind === "accessor" ? {
|
|
7052
|
+
get: descriptor.get,
|
|
7053
|
+
set: descriptor.set
|
|
7054
|
+
} : descriptor[key], context);
|
|
7055
|
+
if (kind === "accessor") {
|
|
7056
|
+
if (result === void 0) continue;
|
|
7057
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
7058
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
7059
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
7060
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
7061
|
+
} else if (_ = accept(result)) {
|
|
7062
|
+
if (kind === "field") initializers.unshift(_);
|
|
7063
|
+
else descriptor[key] = _;
|
|
7064
|
+
}
|
|
7065
|
+
}
|
|
7066
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
7067
|
+
done = true;
|
|
7068
|
+
};
|
|
7069
|
+
/** Public Host binding for the existing bounded, runtime-only decision store. */
|
|
7070
|
+
let TurnSelectionController = (() => {
|
|
7071
|
+
let _classSuper = TypertRemoteService;
|
|
7072
|
+
let _instanceExtraInitializers = [];
|
|
7073
|
+
let _get_decorators;
|
|
7074
|
+
return class TurnSelectionController extends _classSuper {
|
|
7075
|
+
static {
|
|
7076
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
7077
|
+
_get_decorators = [Remote];
|
|
7078
|
+
__esDecorate(this, null, _get_decorators, {
|
|
7079
|
+
kind: "method",
|
|
7080
|
+
name: "get",
|
|
7081
|
+
static: false,
|
|
7082
|
+
private: false,
|
|
7083
|
+
access: {
|
|
7084
|
+
has: (obj) => "get" in obj,
|
|
7085
|
+
get: (obj) => obj.get
|
|
7086
|
+
},
|
|
7087
|
+
metadata: _metadata
|
|
7088
|
+
}, null, _instanceExtraInitializers);
|
|
7089
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, {
|
|
7090
|
+
enumerable: true,
|
|
7091
|
+
configurable: true,
|
|
7092
|
+
writable: true,
|
|
7093
|
+
value: _metadata
|
|
7094
|
+
});
|
|
7095
|
+
}
|
|
7096
|
+
selections = __runInitializers(this, _instanceExtraInitializers);
|
|
7097
|
+
constructor(ctx, selections) {
|
|
7098
|
+
super(ctx, "githubCopilotTurnSelection");
|
|
7099
|
+
this.selections = selections;
|
|
7100
|
+
}
|
|
7101
|
+
get(agent, turn) {
|
|
7102
|
+
return this.selections.get(agent, turn);
|
|
7103
|
+
}
|
|
7104
|
+
};
|
|
7105
|
+
})();
|
|
7106
|
+
//#endregion
|
|
6896
7107
|
//#region lib/types/parent-model-follow.js
|
|
6897
7108
|
const PARENT_MODEL_FOLLOW_PROJECTION = "githubCopilotParentModelFollow";
|
|
6898
7109
|
function object(value) {
|
|
@@ -7087,7 +7298,7 @@ function actualNotice(agent, model) {
|
|
|
7087
7298
|
/** Resolve virtual Auto once per Core turn before request/header persistence. */
|
|
7088
7299
|
function installAutoModelRouting(ctx, dependencies) {
|
|
7089
7300
|
const selections = new TurnSelectionStore();
|
|
7090
|
-
|
|
7301
|
+
new TurnSelectionController(ctx, selections);
|
|
7091
7302
|
const captured = /* @__PURE__ */ new WeakMap();
|
|
7092
7303
|
const routed = /* @__PURE__ */ new WeakMap();
|
|
7093
7304
|
const agentDisposers = /* @__PURE__ */ new WeakMap();
|
|
@@ -7757,6 +7968,7 @@ var PreviewAdapter = class extends PiAiAdapter {
|
|
|
7757
7968
|
let requestFailure;
|
|
7758
7969
|
let wireAbort;
|
|
7759
7970
|
let bodyTimeout;
|
|
7971
|
+
let liveness;
|
|
7760
7972
|
const inspectRequest = (_model, context, nativeOptions) => {
|
|
7761
7973
|
if (signal.aborted) throw abortFailure(signal);
|
|
7762
7974
|
const imageFailure = imageInputFailure(lease.descriptor, context.messages);
|
|
@@ -7786,6 +7998,12 @@ var PreviewAdapter = class extends PiAiAdapter {
|
|
|
7786
7998
|
onRequestBodyTimeout(diagnostic) {
|
|
7787
7999
|
bodyTimeout = diagnostic;
|
|
7788
8000
|
},
|
|
8001
|
+
onStreamIdleTimeout(error) {
|
|
8002
|
+
requestFailure = new LlmError(error.message, "TIMEOUT", { cause: error });
|
|
8003
|
+
},
|
|
8004
|
+
onStreamLiveness(control) {
|
|
8005
|
+
liveness = control;
|
|
8006
|
+
},
|
|
7789
8007
|
onReplayFailure(error) {
|
|
7790
8008
|
if (!signal.aborted) requestFailure = new LlmError(error.message, "INVALID_REQUEST");
|
|
7791
8009
|
}
|
|
@@ -7799,6 +8017,7 @@ var PreviewAdapter = class extends PiAiAdapter {
|
|
|
7799
8017
|
...effort === void 0 ? {} : { reasoningEffort: ReasoningEffortId(effort) }
|
|
7800
8018
|
};
|
|
7801
8019
|
for await (const chunk of native.stream(request)) {
|
|
8020
|
+
let delivered = chunk;
|
|
7802
8021
|
if (requestFailure !== void 0) {
|
|
7803
8022
|
if (signal.aborted) throw abortFailure(signal);
|
|
7804
8023
|
throw requestFailure;
|
|
@@ -7810,7 +8029,7 @@ var PreviewAdapter = class extends PiAiAdapter {
|
|
|
7810
8029
|
if (chunk.type === "finish" && chunk.reason.kind === "error" && chunk.reason.failure.code === "UNKNOWN_MODEL") await owner.refreshRejected(lease.snapshot, signal);
|
|
7811
8030
|
if (chunk.type === "finish" && chunk.reason.kind === "error" && bodyTimeout !== void 0 && chunk.reason.failure.code !== "ABORTED") {
|
|
7812
8031
|
if (signal.aborted) throw abortFailure(signal);
|
|
7813
|
-
|
|
8032
|
+
delivered = {
|
|
7814
8033
|
...chunk,
|
|
7815
8034
|
reason: {
|
|
7816
8035
|
...chunk.reason,
|
|
@@ -7820,9 +8039,13 @@ var PreviewAdapter = class extends PiAiAdapter {
|
|
|
7820
8039
|
}
|
|
7821
8040
|
}
|
|
7822
8041
|
};
|
|
7823
|
-
continue;
|
|
7824
8042
|
}
|
|
7825
|
-
|
|
8043
|
+
liveness?.pause();
|
|
8044
|
+
try {
|
|
8045
|
+
yield delivered;
|
|
8046
|
+
} finally {
|
|
8047
|
+
liveness?.resume();
|
|
8048
|
+
}
|
|
7826
8049
|
}
|
|
7827
8050
|
if (requestFailure !== void 0) throw requestFailure;
|
|
7828
8051
|
} catch (cause) {
|
|
@@ -7838,7 +8061,7 @@ var PreviewAdapter = class extends PiAiAdapter {
|
|
|
7838
8061
|
};
|
|
7839
8062
|
/** Register one stable account route; attach/status remain network-free. */
|
|
7840
8063
|
function apply$1(ctx, config = {}) {
|
|
7841
|
-
const { accountModelTtlMs, accountModelFailureCooldownMs, accountModelSettings, requestBudget, requestBudgetSettings, ...requestConfig } = config;
|
|
8064
|
+
const { accountModelTtlMs, accountModelFailureCooldownMs, accountModelSettings, requestBudget, requestBudgetSettings, streamLiveness, chatRequestSettings, ...requestConfig } = config;
|
|
7842
8065
|
const cacheSettings = accountModelSettings ?? (() => ({
|
|
7843
8066
|
accountModelTtlMs,
|
|
7844
8067
|
accountModelFailureCooldownMs,
|
|
@@ -8061,9 +8284,13 @@ function apply$1(ctx, config = {}) {
|
|
|
8061
8284
|
} catch {}
|
|
8062
8285
|
};
|
|
8063
8286
|
const optionsFor = (lease, hooks = {}) => {
|
|
8287
|
+
const settings = chatRequestSettings?.();
|
|
8288
|
+
const idle = settings?.chatStreamIdleTimeoutMs ?? template.streamIdleTimeoutMs;
|
|
8289
|
+
const enabled = (settings?.chatStreamLiveness ?? streamLiveness ?? true) && (template.transport === void 0 || template.transport === "sse");
|
|
8064
8290
|
const guard = {
|
|
8065
8291
|
...lifetime.guard(lease),
|
|
8066
8292
|
...hooks,
|
|
8293
|
+
...enabled ? { streamIdleTimeoutMs: idle } : {},
|
|
8067
8294
|
onUnauthorized() {
|
|
8068
8295
|
if (lease === void 0 || !lifetime.isCurrent(lease.revision) || source.readDisplaySnapshot() !== lease.snapshot || provenSnapshot !== lease.snapshot || snapshotProof !== lease.proof) return;
|
|
8069
8296
|
rejectedAuth = lease.proof;
|
|
@@ -8074,9 +8301,10 @@ function apply$1(ctx, config = {}) {
|
|
|
8074
8301
|
}
|
|
8075
8302
|
};
|
|
8076
8303
|
const { provider } = createAccountProvider(lease?.snapshot.models ?? [], guard, lease?.proof.baseURL ?? "https://api.individual.githubcopilot.com");
|
|
8077
|
-
const profile =
|
|
8078
|
-
...
|
|
8079
|
-
|
|
8304
|
+
const profile = resolvedProfile(provider, {
|
|
8305
|
+
...requestConfig,
|
|
8306
|
+
streamIdleTimeoutMs: enabled ? Math.min(idle * 2, 2147483647) : idle,
|
|
8307
|
+
maxRequestImageBytes: settings?.chatMaxRequestImageBytes ?? template.maxRequestImageBytes
|
|
8080
8308
|
});
|
|
8081
8309
|
const profiles = /* @__PURE__ */ new Map([[GITHUB_COPILOT_PREVIEW_PROVIDER_ID, profile]]);
|
|
8082
8310
|
return {
|
|
@@ -8328,6 +8556,7 @@ function activate(ctx, config) {
|
|
|
8328
8556
|
};
|
|
8329
8557
|
ctx.plugin(preview_route_default, {
|
|
8330
8558
|
accountModelSettings: () => current(),
|
|
8559
|
+
chatRequestSettings: () => current(),
|
|
8331
8560
|
requestBudgetSettings: () => {
|
|
8332
8561
|
const selected = current();
|
|
8333
8562
|
return {
|
package/lib/types/config.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Settings
|
|
3
|
-
*
|
|
4
|
-
* configurable through the settings seam; defaults follow the chat route.
|
|
2
|
+
* Settings for managed account requests and inline hosted search, including
|
|
3
|
+
* separate stream bounds. Credentials and model transport remain native-owned.
|
|
5
4
|
* @module dsh-github-copilot/config
|
|
6
5
|
*/
|
|
7
6
|
import z from '@deepseek-ai/schemastery';
|
|
@@ -11,7 +10,7 @@ import type { LiveSetting } from './settings-reader.ts';
|
|
|
11
10
|
import type { ParentModelBinding } from './parent-model-follow.ts';
|
|
12
11
|
/** Plugin configuration. Defaults make the current chat route decide. */
|
|
13
12
|
export interface InlineConfig {
|
|
14
|
-
/**
|
|
13
|
+
/** Hosted-search switch; managed chat requests remain enabled. */
|
|
15
14
|
enabled: boolean;
|
|
16
15
|
/**
|
|
17
16
|
* Provider whitelist (llm-pi-ai route keys). Empty = follow the current
|
|
@@ -24,6 +23,12 @@ export interface InlineConfig {
|
|
|
24
23
|
stripServerTools: boolean;
|
|
25
24
|
/** Idle bound for one inline request, in milliseconds. */
|
|
26
25
|
idleTimeoutMs: number;
|
|
26
|
+
/** Managed chat byte-idle interval; separate from hosted search. */
|
|
27
|
+
chatStreamIdleTimeoutMs?: number;
|
|
28
|
+
/** Enable bounded HTTP byte-aware liveness without fabricated assistant progress. */
|
|
29
|
+
chatStreamLiveness?: boolean;
|
|
30
|
+
/** Native request image projection budget; changing it can offload older images. */
|
|
31
|
+
chatMaxRequestImageBytes?: number;
|
|
27
32
|
/** Verify the endpoint executes native search before serving. */
|
|
28
33
|
probe: boolean;
|
|
29
34
|
/** Bound on one probe request, in milliseconds. */
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare class CopilotStreamIdleError extends Error {
|
|
2
|
+
readonly timeoutMs: number;
|
|
3
|
+
constructor(timeoutMs: number, stage?: string, requestBytes?: number);
|
|
4
|
+
}
|
|
5
|
+
/** A request-local byte-idle bound; the native adapter separately bounds semantic silence. */
|
|
6
|
+
export declare class CopilotStreamLiveness {
|
|
7
|
+
private readonly timeoutMs;
|
|
8
|
+
private readonly controller;
|
|
9
|
+
private timer;
|
|
10
|
+
private disposed;
|
|
11
|
+
private paused;
|
|
12
|
+
private stage;
|
|
13
|
+
private requestBytes;
|
|
14
|
+
readonly signal: AbortSignal;
|
|
15
|
+
constructor(timeoutMs: number, upstream: AbortSignal);
|
|
16
|
+
pulse(): void;
|
|
17
|
+
beginRequest(body?: string): void;
|
|
18
|
+
pause(): void;
|
|
19
|
+
resume(): void;
|
|
20
|
+
observe(response: Response): Response;
|
|
21
|
+
dispose: () => void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=copilot-stream-liveness.d.ts.map
|
|
@@ -4,6 +4,7 @@ import type { CoreCompatibleProvider } from './pi-provider-bridge.ts';
|
|
|
4
4
|
import type { GitHubCopilotOAuthCredential } from './copilot-grant.ts';
|
|
5
5
|
import { CopilotResponsesReplayError } from './responses-replay-compat.ts';
|
|
6
6
|
import type { ResponsesRetryReplay } from './responses-replay-compat.ts';
|
|
7
|
+
import { CopilotStreamIdleError, CopilotStreamLiveness } from './copilot-stream-liveness.ts';
|
|
7
8
|
export type ManagedWireAbortCode = 'COPILOT_PREVIEW_CREDENTIAL_CHANGED' | 'COPILOT_PREVIEW_DISPOSED';
|
|
8
9
|
/** Identity, not upstream error text, proves that the plugin revoked this wire. */
|
|
9
10
|
export declare class ManagedWireAbortError extends Error {
|
|
@@ -27,6 +28,10 @@ export interface PreviewProviderGuard {
|
|
|
27
28
|
onWireAbort?(code: ManagedWireAbortCode): void;
|
|
28
29
|
/** Request-local safe guidance from a verified HTTP response; undefined clears prior evidence. */
|
|
29
30
|
onRequestBodyTimeout?(diagnostic: string | undefined): void;
|
|
31
|
+
/** Optional HTTP byte-idle bound paired with a separate native semantic deadline. */
|
|
32
|
+
readonly streamIdleTimeoutMs?: number;
|
|
33
|
+
onStreamLiveness?(control: Pick<CopilotStreamLiveness, 'pause' | 'resume'>): void;
|
|
34
|
+
onStreamIdleTimeout?(error: CopilotStreamIdleError): void;
|
|
30
35
|
}
|
|
31
36
|
/** Guard for one selected model in an account-bound descriptor snapshot. */
|
|
32
37
|
export interface AccountProviderGuard extends PreviewProviderGuard {
|
|
@@ -7,6 +7,8 @@ import type { InlineConfig } from './config.ts';
|
|
|
7
7
|
import type { RequestBudgetPolicy } from './request-budget.ts';
|
|
8
8
|
/** Safe request knobs; identities, model tables, endpoints and credentials are not configurable. */
|
|
9
9
|
export type PreviewRouteConfig = Pick<PiAiProviderProfile, 'reasoning' | 'cacheRetention' | 'transport' | 'timeoutMs' | 'websocketConnectTimeoutMs' | 'streamIdleTimeoutMs' | 'maxRequestImageBytes' | 'requestImagePixelBudget' | 'requestImageMaxBytes' | 'retryPolicy'> & Pick<InlineConfig, 'accountModelTtlMs' | 'accountModelFailureCooldownMs'> & {
|
|
10
|
+
readonly streamLiveness?: boolean;
|
|
11
|
+
readonly chatRequestSettings?: () => Pick<InlineConfig, 'chatStreamIdleTimeoutMs' | 'chatStreamLiveness' | 'chatMaxRequestImageBytes'>;
|
|
10
12
|
readonly accountModelSettings?: () => Pick<InlineConfig, 'accountModelTtlMs' | 'accountModelFailureCooldownMs' | 'excludedModelIds' | 'parentModelFollow' | 'followParentModel'>;
|
|
11
13
|
readonly requestBudget?: Partial<RequestBudgetPolicy>;
|
|
12
14
|
readonly requestBudgetSettings?: () => Partial<RequestBudgetPolicy>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
4
|
+
import type { TurnSelection, TurnSelectionStore } from './turn-selection.ts';
|
|
5
|
+
/** Public Host binding for the existing bounded, runtime-only decision store. */
|
|
6
|
+
export declare class TurnSelectionController extends TypertRemoteService {
|
|
7
|
+
private readonly selections;
|
|
8
|
+
constructor(ctx: Context, selections: TurnSelectionStore);
|
|
9
|
+
get(agent: Agent, turn: number): TurnSelection;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=turn-selection-host.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-github-copilot",
|
|
3
3
|
"description": "DSH companion for GitHub Copilot sign-in, account-aware model profiles, tool compatibility, and provider-hosted search.",
|
|
4
|
-
"version": "0.4.0-alpha.
|
|
4
|
+
"version": "0.4.0-alpha.80",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|