dsh-github-copilot 0.4.0-alpha.35 → 0.4.0-alpha.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +10 -7
- package/README.zh.md +10 -7
- package/deployment-baseline.json +25 -1
- package/docs/official-first-016-alpha2.md +8 -0
- package/lib/index.js +157 -15
- package/lib/types/preview-provider.d.ts +4 -1
- package/lib/types/responses-replay-compat.d.ts +11 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0-alpha.37 (prepared)
|
|
4
|
+
|
|
5
|
+
- Recognize both observed uncoded Responses scope-401 messages, including `input item does not belong to this connection` without `ID`, so that request-local rejection does not retire shared OAuth proof or abort neighboring calls (#164).
|
|
6
|
+
- Retain exact message matching, consistent outer/nested envelopes, genuine-auth code/type precedence, HTTP-status and bounded-body checks; do not broaden classification to arbitrary connection text.
|
|
7
|
+
- Exercise both variants through the real native adapter for concurrent isolation, same-lease independent dispatches, cancellation, credential reuse and genuine-auth renewal. The fixture reproduces the defect without cron.
|
|
8
|
+
- Keep payload normalization, encrypted history, model selection and transport unchanged. This contains a classification defect; it does not establish why the remaining historical item is rejected or claim complete live-session recovery. No Core, cron, dependency or installed-profile change is included.
|
|
9
|
+
|
|
10
|
+
## 0.4.0-alpha.36 (prepared)
|
|
11
|
+
|
|
12
|
+
- Add managed Responses wire-only replay normalization through the native SDK's public `onPayload` seam, preserving durable history, encrypted reasoning, message phases and tool-result pairing (#162). Reference-only or incomplete ID-bearing forms fail explicitly instead of silently discarding history.
|
|
13
|
+
- Recognize the exact structured input-item connection-scope HTTP 401 without retiring shared OAuth proof or aborting neighboring calls. Surface a sanitized, dispatch-local `INVALID_REQUEST`; genuine and unrecognized authentication failures retain existing recovery.
|
|
14
|
+
- Preserve native transport, caller callbacks, cancellation, credentials and model selection. No automatic request retry, alternate adapter, Core/SDK patch, canonical-route takeover or live-profile mutation is introduced.
|
|
15
|
+
- Add real-SDK/pinned-Core synthetic regressions for replay shape, caller callback composition, bounded response inspection, parallel isolation, cancellation and genuine authentication recovery. Real Copilot acceptance of existing conversations, deployment and activation remain separate acceptance steps.
|
|
16
|
+
|
|
3
17
|
## 0.4.0-alpha.35 (prepared)
|
|
4
18
|
|
|
5
19
|
- Match the account-usage control to native secondary statistics typography, line height and pill spacing (#160).
|
package/README.md
CHANGED
|
@@ -73,7 +73,7 @@ The Host reads GitHub's internal quota endpoint using the existing canonical OAu
|
|
|
73
73
|
|
|
74
74
|
## Install and sign in
|
|
75
75
|
|
|
76
|
-
The commands below target the package version `0.4.0-alpha.
|
|
76
|
+
The commands below target the package version `0.4.0-alpha.37`. 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):
|
|
77
77
|
|
|
78
78
|
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):
|
|
79
79
|
|
|
@@ -86,7 +86,7 @@ Include any launcher patch files with repeated `--patch /absolute/file` argument
|
|
|
86
86
|
For approved online installation, the supported CLI command is:
|
|
87
87
|
|
|
88
88
|
```sh
|
|
89
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
89
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.37/dsh-github-copilot-0.4.0-alpha.37.tgz
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
If registry access is blocked or unavailable, do not retry it through another network. Desktop-managed profiles may instead use the [controlled offline CLI procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance), with an approved, checksum-verified local Release and existing dependency cache (`--offline --ignore-scripts`). All preflight and approval requirements still apply.
|
|
@@ -151,7 +151,7 @@ Agents should treat the browser authorization as a human handoff, not as a token
|
|
|
151
151
|
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.
|
|
152
152
|
6. Use **Sign out** only when the user explicitly asks to disconnect the account. It deletes the Copilot credential record but preserves route settings.
|
|
153
153
|
|
|
154
|
-
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. The native Desktop package manager is preferred when permitted registry access is available; after npm publication is verified it accepts `dsh-github-copilot@0.4.0-alpha.
|
|
154
|
+
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. The native Desktop package manager is preferred when permitted registry access is available; after npm publication is verified it accepts `dsh-github-copilot@0.4.0-alpha.37`, not a URL or file. Desktop-managed profiles also support explicitly approved [controlled offline CLI maintenance](./docs/npm-distribution.md#controlled-offline-cli-maintenance) with a verified local Release and `--offline --ignore-scripts`. 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. Offline installation is not proof that npm networking/publication was repaired. See [distribution and publication requirements](./docs/npm-distribution.md).
|
|
155
155
|
|
|
156
156
|
No `copilot2api` process, external gateway, placeholder API key, pasted GitHub token, or separate `dsh-web-search-provider` installation is required.
|
|
157
157
|
|
|
@@ -345,7 +345,10 @@ Existing installations must follow the [single-route migration guide](./docs/sin
|
|
|
345
345
|
- **No sign-in control:** confirm the package is loaded in the active profile and use the baseline-specific UI above. Do not add a native provider just to reveal login.
|
|
346
346
|
- **Two Copilot groups after upgrade:** a legacy canonical profile is still configured; it is preserved deliberately. After explicit migration/removal, both composer and `/model` list only the managed group. There is no display-only alias masking a second route.
|
|
347
347
|
- **Signed in but a new model is missing:** opening Models ensures missing/stale metadata automatically; inspect accepted/rejected models for `github-copilot-preview`. Use **Retry** after errors or **Manage → Refresh models** to intentionally refresh before the TTL expires. Unsupported endpoints or incomplete metadata produce diagnostics, not static-catalog fallback. Do not repeat login or disable validation.
|
|
348
|
-
- **`AUTH` / “API key is invalid” after signing in again:** this label does not prove the conversation cached an old key. On the managed route, an observed model HTTP 401 retires only the exact current token proof. The failed request stays failed: no automatic message replay, logout or model switch. Your next request (or model discovery) can perform one native OAuth renewal even before stored expiry, then validate account metadata. Repeated rejection is bounded per account by `accountModelFailureCooldownMs` (five minutes by default, at least one second); even forced discovery cannot bypass this recovery cooldown. If the renewed token is still rejected, wait for the cooldown and inspect account/permission status rather than repeatedly signing out. A new sign-in is not overwritten by a late old response. HTTP 403, network errors and strings mentioning 401 do not trigger this recovery. It observes native HTTP transport only; WebSocket recovery and live endpoint acceptance are not claimed.
|
|
348
|
+
- **`AUTH` / “API key is invalid” after signing in again:** this label does not prove the conversation cached an old key. On the managed route, an observed model HTTP 401 retires only the exact current token proof, except the narrowly recognized Responses replay-scope rejection described below. The failed request stays failed: no automatic message replay, logout or model switch. Your next request (or model discovery) can perform one native OAuth renewal even before stored expiry, then validate account metadata. Repeated rejection is bounded per account by `accountModelFailureCooldownMs` (five minutes by default, at least one second); even forced discovery cannot bypass this recovery cooldown. If the renewed token is still rejected, wait for the cooldown and inspect account/permission status rather than repeatedly signing out. A new sign-in is not overwritten by a late old response. HTTP 403, network errors and strings mentioning 401 do not trigger this recovery. It observes native HTTP transport only; WebSocket recovery and live endpoint acceptance are not claimed.
|
|
349
|
+
- **`input item ID does not belong to this connection` / `input item does not belong to this connection`:** these are the two observed Responses history-reference rejection messages, not proof of an invalid API key. On `github-copilot-preview` only, a bounded clone of the actual HTTP 401 JSON identifies these exact uncoded errors, with matching outer/nested messages; the plugin reports `INVALID_REQUEST` with `COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH` without retiring shared account proof, aborting neighboring calls, renewing credentials or retrying the request. Unknown, malformed, oversized or ambiguous error bodies retain native authentication handling. Historical error records are not rewritten.
|
|
350
|
+
- **Managed Responses replay compatibility:** the public SDK `onPayload` hook normalizes only direct item IDs on complete assistant messages, function calls and reasoning items carrying encrypted content. It preserves `call_id` pairing, encrypted bytes, public summaries, `phase`, nested IDs and durable history. Reference-only, incomplete or unsupported ID-bearing items fail explicitly with `COPILOT_RESPONSES_REPLAY_UNSUPPORTED`; no hidden history trimming or model switch occurs. This is Copilot-specific, not a universal OpenAI schema change: public OpenAI types require IDs on some replay forms. Native SDK/pinned-Core synthetic tests verify transport shape and isolation, not real Copilot acceptance of an old conversation. Canonical `github-copilot`, other providers and non-Responses protocols are unchanged; install/activation and old-session endpoint acceptance require separate review.
|
|
351
|
+
- **Scope rejection persists after alpha.36:** its original exact-message classifier missed the observed wording without `ID`. Alpha.37 only closes that classification/isolation gap; it does not further rewrite payloads or prove that the rejected history can be replayed. The parallel-request failure is reproduced with the native adapter in a fixture that does not load cron. This establishes a companion error-handling defect, not the upstream reason for rejecting the original item. `Request aborted` alone does not identify its cause; `COPILOT_MODEL_SOURCE_AUTH_FAILED` is a generalized pre-catalog auth-resolution failure, whose cached result may recur without another auth attempt. Compare actual loaded version, request provenance and the same history/model before attributing another machine's success to a plugin downgrade or cron removal. Do not silently discard encrypted reasoning, retry old business work or reset credentials.
|
|
349
352
|
- **Canonical route says `not-configured`:** with configured login this is normal managed-only mode; inspect account discovery separately rather than creating a native profile.
|
|
350
353
|
- **Delete dialog stays on “Deleting…”:** this update does not prove that hang fixed. Do not repeatedly delete; after an authorized Host stop, inspect persisted settings and follow the migration guide before deciding whether any removal is still needed.
|
|
351
354
|
- **No Think text:** the provider may omit public summaries, but nonempty summaries must survive the Responses parser. Check selected effort and named errors. Empty disclosures are hidden only after completion; encrypted replay is never displayed. Reasoning/replay-bearing histories use native Core transport.
|
|
@@ -412,8 +415,8 @@ Report the published Release URL, version, tag/commit and verified asset SHA-256
|
|
|
412
415
|
`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.
|
|
413
416
|
|
|
414
417
|
```sh
|
|
415
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
416
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
418
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.37/dsh-github-copilot-0.4.0-alpha.37.tgz
|
|
419
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.37/SHA256SUMS
|
|
417
420
|
sha256sum --check SHA256SUMS
|
|
418
421
|
```
|
|
419
422
|
|
|
@@ -421,7 +424,7 @@ PowerShell can verify the same two downloaded files with:
|
|
|
421
424
|
|
|
422
425
|
```powershell
|
|
423
426
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
424
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
427
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.37.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
425
428
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
426
429
|
```
|
|
427
430
|
|
package/README.zh.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
一个聚焦 GitHub Copilot 登录、通用账号模型发现、Copilot 专用 Tool 兼容与供应方托管搜索的 DSH companion。插件根据供应方返回的端点和能力元数据组装模型,复用公开的 `@deepseek-ai/dsh-llm-pi-ai` adapter 与 pi-ai SDK,不另写一套通用传输/序列化器,也不维护需要逐个添加新模型 ID 的静态目录。
|
|
11
11
|
|
|
12
|
-
> 下文自动维护账号模型元数据与 provider 集成控件描述目标版本 `0.4.0-alpha.
|
|
12
|
+
> 下文自动维护账号模型元数据与 provider 集成控件描述目标版本 `0.4.0-alpha.37`;这不代表已有的两条真实路由被合并或移除。版本化 URL 不表示 Release 已发布或本机已加载;仅在该 Release 与校验和可用后使用安装命令。源码、发布制品、已安装版本和实际加载运行时需分别确认,本地升级和中断会话的重启仍需用户批准。
|
|
13
13
|
|
|
14
14
|
Alpha.24 修复 Web search 卡片缺少精确 Remote 依赖声明的问题。卡片仍位于 **Settings → Models**(`settings.models.footer`,list/root),旧 Core 回退到独立 Web search section,而非 General。搜索子 Fiber 独立等待 routing namespace,不影响账号控件和既有搜索安全检查;实际打包 Desktop 验收仍是独立关卡。
|
|
15
15
|
|
|
@@ -88,7 +88,7 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
|
|
|
88
88
|
获准且网络可用时,可通过受支持的 CLI 命令安装:
|
|
89
89
|
|
|
90
90
|
```sh
|
|
91
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
91
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.37/dsh-github-copilot-0.4.0-alpha.37.tgz
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
若 registry 被公司封禁或不可用,不要更换网络绕行。Desktop 管理的 profile 可以改用[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance):使用来源获准、校验通过的本地 Release 和已有依赖缓存(`--offline --ignore-scripts`)。预检、备份和授权要求仍然适用。
|
|
@@ -153,7 +153,7 @@ Agent 应把浏览器授权视为需要用户完成的 handoff,而不是自行
|
|
|
153
153
|
5. 确认 **Signed in** 并检查自动发现结果,再请用户选择模型。已登录时打开 Models 会自动确保缺失/过期元数据,新鲜 ready 缓存不发请求。错误可使用 **Retry**,有意强制更新时使用 **Manage → Refresh models**,不作为常规设置步骤。状态读取本身不发现;登录、元数据与真实调用成功是独立证据。
|
|
154
154
|
6. 只有用户明确要求断开账号时才使用 **Sign out**;它会删除 Copilot credential record,但保留 route settings。
|
|
155
155
|
|
|
156
|
-
每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。在获准且可用的 registry 网络环境中,优先使用原生 Desktop 包管理器;确认 npm 发布后,它接受 `dsh-github-copilot@0.4.0-alpha.
|
|
156
|
+
每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。在获准且可用的 registry 网络环境中,优先使用原生 Desktop 包管理器;确认 npm 发布后,它接受 `dsh-github-copilot@0.4.0-alpha.37`,不是 URL 或本地文件。Desktop 管理的 profile 也允许经明确授权的[受控离线 CLI 维护](./docs/npm-distribution.md#controlled-offline-cli-maintenance):使用已验证的本地 Release 和 `--offline --ignore-scripts`,执行必需的组合预检、私密元数据备份、单写入者控制及安装后差异核验。缓存不足或出现权限拒绝时停止,不绕过公司 registry 封禁,不关闭 TLS 校验;重启仍需单独授权。离线安装成功不表示 npm 联网或发布问题已修好。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
|
|
157
157
|
|
|
158
158
|
不需要运行 `copilot2api`,不需要外部 gateway、placeholder API key、原始 GitHub token 或单独安装 `dsh-web-search-provider`。
|
|
159
159
|
|
|
@@ -356,7 +356,10 @@ Copilot Session 如需更宽的文件或命令权限,必须在调用前选择
|
|
|
356
356
|
- **看不到登录控件:**确认新版 package 实际加载在活动 profile,并使用上表对应的 UI;不要为了显示登录卡片而添加原生 provider。
|
|
357
357
|
- **升级后仍有两个 Copilot 分组:**已有 canonical profile 被有意保留。显式迁移并真正移除后,composer 与 `/model` 才都会只列出托管分组;不是靠显示别名隐藏第二条路由。
|
|
358
358
|
- **已登录但新模型缺失:**打开 Models 会自动确保缺失/过期元数据,查看 `github-copilot-preview` 的接受/拒绝结果。错误可点 **Retry**;希望在 TTL 到期前有意强制更新时,使用 **Manage → Refresh models**。接口不支持或元数据不完整时显示诊断,不退回静态目录,也不要反复登录或关闭校验。
|
|
359
|
-
- **重新登录后出现 `AUTH`/“API key is invalid”:**这个标签并不证明旧会话缓存了旧 Key。托管路由实际收到模型 HTTP 401 后,只撤销与当前请求精确匹配的 Token
|
|
359
|
+
- **重新登录后出现 `AUTH`/“API key is invalid”:**这个标签并不证明旧会话缓存了旧 Key。托管路由实际收到模型 HTTP 401 后,只撤销与当前请求精确匹配的 Token 证明,但下述严格识别的 Responses 历史引用错误除外;该次请求仍然失败,不自动重发消息、退出登录或切换模型。下一次请求(或模型发现)可通过原生 OAuth 进行一次续期,即使记录的有效期尚未到期,随后重新校验账号模型元数据。连续拒绝受账号级 `accountModelFailureCooldownMs` 限制(默认五分钟,至少一秒),强制发现也不能绕过该恢复冷却。续期后仍被拒绝时,请等待冷却并检查账号/权限状态,不要反复退出登录。迟到的旧响应不能覆盖新登录;403、网络错误和仅含 401 字样的错误不触发恢复。这里只观察原生 HTTP 传输,不声称覆盖 WebSocket,也不代表真实端点验收通过。
|
|
360
|
+
- **`input item ID does not belong to this connection`/`input item does not belong to this connection`:**这是已观测到的两种 Responses 历史引用拒绝文案,不证明 API key 无效。仅在 `github-copilot-preview` 上,插件对实际 HTTP 401 JSON 的有界副本严格识别这两种无错误码的精确文案,并要求外层/内层消息一致,返回带 `COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH` 的 `INVALID_REQUEST`;不撤销共享账号证明、不连带中止其他请求、不续期凭据,也不自动重发。未知、格式错误、过大或存在歧义的错误体继续沿用原生鉴权处理;历史报错记录不会被改写。
|
|
361
|
+
- **托管 Responses 历史兼容处理:**通过 SDK 公开 `onPayload` 回调,只处理完整 assistant 消息、函数调用以及携带加密内容的 reasoning 条目的直接 item ID。保留 `call_id` 配对、加密字节、公开摘要、`phase`、嵌套 ID 和持久化历史。仅含引用、不完整或不支持的带 ID 条目明确报 `COPILOT_RESPONSES_REPLAY_UNSUPPORTED`,不暗中裁剪历史或切换模型。这是 Copilot 特定兼容策略,不是对通用 OpenAI 协议的改写:公开 OpenAI 类型要求部分回放条目具有 ID。原生 SDK/固定 Core 的合成测试只证明请求形态与隔离行为,不证明真实 Copilot 已接受旧会话。Core 自有 `github-copilot`、其他供应方和非 Responses 协议保持不变;安装、激活和旧会话端点验收需分别确认。
|
|
362
|
+
- **alpha.36 后仍有历史作用域拒绝:**原先的精确分类漏掉了不含 `ID` 的已观测文案。Alpha.37 只补齐分类与隔离,不进一步改写 payload,也不证明原被拒绝的历史已经可用。不加载 cron 的原生适配器测试已复现并行请求被连带中断,证明的是 Copilot 插件错误处理缺陷,而不是上游拒绝条目的原始原因。`Request aborted` 单独不能确定取消来源;`COPILOT_MODEL_SOURCE_AUTH_FAILED` 是目录发现前认证解析的泛化错误,缓存结果可重复返回而不代表再次认证。判断另一台机器为何正常,需对齐实际加载版本、请求来源和同一历史/模型,不能直接归因于降级插件或卸载 cron。不要暗中丢弃加密 reasoning、重发旧业务或重置凭据。
|
|
360
363
|
- **Canonical 状态为 `not-configured`:**已登录时属于正常单托管路由模式;账号发现就绪与否另行检查,不需要创建原生 profile。
|
|
361
364
|
- **删除对话框一直显示 “Deleting…”:**本次改动不证明该卡住问题已修复。不要重复删除;取得许可停止 Host 后检查持久化设置,按迁移指南判断是否仍需移除。
|
|
362
365
|
- **没有 Think 文字:**供应方可能不返回公开摘要,但非空摘要应被完整保留。检查思考强度与命名错误。UI 只在完成后隐藏空条目,不显示加密回放;包含 reasoning/replay 的历史走 Core 原生 transport。
|
|
@@ -423,8 +426,8 @@ node scripts/agent.mjs attribution "DeepSeek Harness (DSH)"
|
|
|
423
426
|
`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 要求包已存在,不能代替首次建包。不会批量补发历史版本。
|
|
424
427
|
|
|
425
428
|
```sh
|
|
426
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
427
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
429
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.37/dsh-github-copilot-0.4.0-alpha.37.tgz
|
|
430
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.37/SHA256SUMS
|
|
428
431
|
sha256sum --check SHA256SUMS
|
|
429
432
|
```
|
|
430
433
|
|
|
@@ -432,7 +435,7 @@ PowerShell 可以对已下载的同一组文件执行:
|
|
|
432
435
|
|
|
433
436
|
```powershell
|
|
434
437
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
435
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
438
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.37.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
436
439
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
437
440
|
```
|
|
438
441
|
|
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.37"
|
|
12
12
|
},
|
|
13
13
|
"evidence": {
|
|
14
14
|
"kind": "source-and-synthetic-test-inventory",
|
|
@@ -478,6 +478,30 @@
|
|
|
478
478
|
{"file": "tests/preview-route.spec.ts", "name": "withdraws only its own route and refuses an already-prepared call after disposal"}
|
|
479
479
|
]
|
|
480
480
|
},
|
|
481
|
+
{
|
|
482
|
+
"id": "managed-responses-replay-scope-isolation",
|
|
483
|
+
"required": true,
|
|
484
|
+
"scope": "managed-github-copilot-preview-responses-only",
|
|
485
|
+
"liveEndpointAcceptance": "not-verified",
|
|
486
|
+
"classificationOnlyFollowup": true,
|
|
487
|
+
"recognizedUncoded401Messages": [
|
|
488
|
+
"input item ID does not belong to this connection",
|
|
489
|
+
"input item does not belong to this connection"
|
|
490
|
+
],
|
|
491
|
+
"sourceMarkers": [
|
|
492
|
+
{"file": "src/responses-replay-compat.ts", "marker": "normalizeCopilotResponsesPayload"},
|
|
493
|
+
{"file": "src/responses-replay-compat.ts", "marker": "isCopilotInputItemScopeError"},
|
|
494
|
+
{"file": "src/responses-replay-compat.ts", "marker": "input item does not belong to this connection"},
|
|
495
|
+
{"file": "src/preview-provider.ts", "marker": "onPayload"},
|
|
496
|
+
{"file": "src/preview-route.ts", "marker": "onReplayFailure(error)"}
|
|
497
|
+
],
|
|
498
|
+
"tests": [
|
|
499
|
+
{"file": "tests/preview-provider.spec.ts", "name": "normalizes only wire item IDs after native serialization while preserving durable replay and tool pairing"},
|
|
500
|
+
{"file": "tests/preview-route.spec.ts", "name": "classifies \"$message\" in a $envelope Responses 401 locally and reuses the same credential without discovery or refresh"},
|
|
501
|
+
{"file": "tests/preview-route.spec.ts", "name": "does not abort a parallel native request when another dispatch receives a replay-scope 401: %s"},
|
|
502
|
+
{"file": "tests/preview-route.spec.ts", "name": "does not retain a replay-scope failure across independent dispatches of one native prepared lease: %s"}
|
|
503
|
+
]
|
|
504
|
+
},
|
|
481
505
|
{
|
|
482
506
|
"id": "managed-http-auth-rejection-recovery",
|
|
483
507
|
"required": true,
|
|
@@ -36,6 +36,14 @@ Official alpha.2 provides a public additive [`conversation.composer.dock`](https
|
|
|
36
36
|
|
|
37
37
|
**Retain** a bounded Host account-quota source and an optional additive control with a separate strict Remote namespace. Existing [`mapUsage`](https://github.com/deepseek-ai/deepseek-harness/blob/ddefc45fbc7f8e46dd73185e68295696d1297887/packages/llm/llm-pi-ai/src/stream.ts) exposes token counts, not complete Copilot per-request credit receipts; show session credits as unavailable rather than reading opaque replay state or creating a second wire. Retire the companion control when an official account-usage surface provides equivalent budget units, pooled/missing/stale semantics, account isolation and Client lifecycle. Per-session accounting additionally requires attributable, deduplicated native receipts and tested retry/background-work coverage. [Quota scope and evidence limits](./copilot-usage.md) remain distinct from live account permissions and installed Desktop acceptance.
|
|
38
38
|
|
|
39
|
+
## Managed Responses replay follow-up (#162)
|
|
40
|
+
|
|
41
|
+
The unchanged native adapter remains the owner of durable history reconstruction and model transport. The plugin's pinned pi-ai `0.85.1` public `ProviderRequestOptions.onPayload` callback is forwarded by `buildBaseOptions` and invoked after `buildParams` in `api/openai-responses.js`, before HTTP dispatch. This is **complete extension support**, not proof that native replay IDs are portable across Copilot connection scopes. Offline native serialization retains assistant/reasoning item IDs; the observed uncoded input-item-scope HTTP 401 is also misclassified by the plugin's previous all-401 token rejection observer.
|
|
42
|
+
|
|
43
|
+
**Retain** a narrow managed-route post-serialization normalization and bounded exact-error observer, using those existing public seams. Do not change Core, SDK artifacts, the canonical provider or stored replay. Preserve encrypted bytes, public summaries, phases, tool call/result linkage and nested IDs; reference-only or incomplete ID-bearing input fails explicitly. A verified scope rejection is a request-local `INVALID_REQUEST`, not shared credential invalidation, and adds no retry. Public OpenAI types require IDs for some replay shapes, so this policy is Copilot-specific and real endpoint/old-history acceptance remains **unverified** until separately tested. Synthetic request and concurrency regressions do not establish that acceptance.
|
|
44
|
+
|
|
45
|
+
Retire this compatibility layer only when an unchanged published native SDK/adapter provides equivalent Copilot replay-scope handling and error isolation, and the same old-session, cancellation, callback, genuine-auth and concurrent-request cases pass without plugin intervention. A dependency version increase alone is not evidence of parity.
|
|
46
|
+
|
|
39
47
|
## Descriptor correction is not a history conversion
|
|
40
48
|
|
|
41
49
|
Native `subagent/descriptor` was already **v3 in the retained rc.1 baseline**; the plugin's v1 expectation was a plugin/test bug. Alpha.25 admits the native continuable `spawn` descriptor with explicit `agentProvider`/`agentModel`, and validates its declared native fields. Native descriptor v3, plugin role-policy version, plugin projection cache version and whole-Session storage-format versions are separate concepts.
|
package/lib/index.js
CHANGED
|
@@ -1600,7 +1600,7 @@ let GitHubCopilotUsageController = (() => {
|
|
|
1600
1600
|
//#endregion
|
|
1601
1601
|
//#region package.json
|
|
1602
1602
|
var name$1 = "dsh-github-copilot";
|
|
1603
|
-
var version = "0.4.0-alpha.
|
|
1603
|
+
var version = "0.4.0-alpha.37";
|
|
1604
1604
|
//#endregion
|
|
1605
1605
|
//#region lib/types/probe.js
|
|
1606
1606
|
/**
|
|
@@ -4904,6 +4904,122 @@ function coreProviderView(provider) {
|
|
|
4904
4904
|
};
|
|
4905
4905
|
}
|
|
4906
4906
|
//#endregion
|
|
4907
|
+
//#region lib/types/responses-replay-compat.js
|
|
4908
|
+
const replayDiagnostics = {
|
|
4909
|
+
"scope-mismatch": "COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH: Copilot Responses input references belong to a different connection.",
|
|
4910
|
+
unsupported: "COPILOT_RESPONSES_REPLAY_UNSUPPORTED: Copilot Responses input cannot be replayed safely without connection-scoped references.",
|
|
4911
|
+
"invalid-payload": "COPILOT_RESPONSES_REPLAY_INVALID_PAYLOAD: Copilot Responses payload has an invalid replay structure."
|
|
4912
|
+
};
|
|
4913
|
+
/** Fixed diagnostics only: never include provider bodies, IDs, arguments or replay content. */
|
|
4914
|
+
var CopilotResponsesReplayError = class extends Error {
|
|
4915
|
+
constructor(reason = "unsupported") {
|
|
4916
|
+
super(replayDiagnostics[reason]);
|
|
4917
|
+
this.name = "CopilotResponsesReplayError";
|
|
4918
|
+
}
|
|
4919
|
+
};
|
|
4920
|
+
function isRecord(value) {
|
|
4921
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
|
|
4922
|
+
const prototype = Object.getPrototypeOf(value);
|
|
4923
|
+
return prototype === Object.prototype || prototype === null;
|
|
4924
|
+
}
|
|
4925
|
+
function nonemptyString(value) {
|
|
4926
|
+
return typeof value === "string" && value.trim().length > 0;
|
|
4927
|
+
}
|
|
4928
|
+
function normalizeItem(item) {
|
|
4929
|
+
if (!isRecord(item)) throw new CopilotResponsesReplayError("invalid-payload");
|
|
4930
|
+
if (item.type === "item_reference") throw new CopilotResponsesReplayError();
|
|
4931
|
+
if ((item.type === "message" || item.type === void 0) && (item.role === "user" || item.role === "system" || item.role === "developer")) return item;
|
|
4932
|
+
if (!Object.hasOwn(item, "id") || item.id === void 0) return item;
|
|
4933
|
+
if (!nonemptyString(item.id)) throw new CopilotResponsesReplayError("invalid-payload");
|
|
4934
|
+
if (!((item.status === void 0 || item.status === "completed") && (item.type === "message" && item.role === "assistant" && Array.isArray(item.content) || item.type === "function_call" && nonemptyString(item.call_id) && nonemptyString(item.name) && typeof item.arguments === "string" || item.type === "reasoning" && nonemptyString(item.encrypted_content)))) throw new CopilotResponsesReplayError();
|
|
4935
|
+
const normalized = { ...item };
|
|
4936
|
+
delete normalized.id;
|
|
4937
|
+
return normalized;
|
|
4938
|
+
}
|
|
4939
|
+
/** Normalize only the outgoing managed Responses payload, never stored history/context. */
|
|
4940
|
+
function normalizeCopilotResponsesPayload(payload) {
|
|
4941
|
+
try {
|
|
4942
|
+
if (!isRecord(payload) || typeof payload.input !== "string" && !Array.isArray(payload.input)) throw new CopilotResponsesReplayError("invalid-payload");
|
|
4943
|
+
if (payload.previous_response_id !== void 0 && payload.previous_response_id !== null && payload.previous_response_id !== "") throw new CopilotResponsesReplayError(typeof payload.previous_response_id === "string" ? "unsupported" : "invalid-payload");
|
|
4944
|
+
if (typeof payload.input === "string") return payload;
|
|
4945
|
+
let changed = false;
|
|
4946
|
+
const input = [];
|
|
4947
|
+
for (const item of payload.input) {
|
|
4948
|
+
const normalized = normalizeItem(item);
|
|
4949
|
+
changed ||= normalized !== item;
|
|
4950
|
+
input.push(normalized);
|
|
4951
|
+
}
|
|
4952
|
+
return changed ? {
|
|
4953
|
+
...payload,
|
|
4954
|
+
input
|
|
4955
|
+
} : payload;
|
|
4956
|
+
} catch (error) {
|
|
4957
|
+
if (error instanceof CopilotResponsesReplayError) throw error;
|
|
4958
|
+
throw new CopilotResponsesReplayError("invalid-payload");
|
|
4959
|
+
}
|
|
4960
|
+
}
|
|
4961
|
+
const scopeMessages = /* @__PURE__ */ new Set(["input item ID does not belong to this connection", "input item does not belong to this connection"]);
|
|
4962
|
+
const maxErrorBytes = 8192;
|
|
4963
|
+
const errorReadTimeoutMs = 250;
|
|
4964
|
+
async function readScopeError(reader) {
|
|
4965
|
+
const decoder = new TextDecoder("utf-8", { fatal: true });
|
|
4966
|
+
let bytes = 0;
|
|
4967
|
+
let chunks = 0;
|
|
4968
|
+
let text = "";
|
|
4969
|
+
while (true) {
|
|
4970
|
+
if (chunks++ > maxErrorBytes) return false;
|
|
4971
|
+
const chunk = await reader.read();
|
|
4972
|
+
if (chunk.done) break;
|
|
4973
|
+
bytes += chunk.value.byteLength;
|
|
4974
|
+
if (bytes > maxErrorBytes) return false;
|
|
4975
|
+
text += decoder.decode(chunk.value, { stream: true });
|
|
4976
|
+
}
|
|
4977
|
+
text += decoder.decode();
|
|
4978
|
+
const body = JSON.parse(text);
|
|
4979
|
+
if (!isRecord(body)) return false;
|
|
4980
|
+
const error = Object.hasOwn(body, "error") ? body.error : body;
|
|
4981
|
+
if (!isRecord(error) || typeof error.message !== "string" || !scopeMessages.has(error.message)) return false;
|
|
4982
|
+
return (!Object.hasOwn(body, "message") || body.message === error.message) && [
|
|
4983
|
+
body.code,
|
|
4984
|
+
body.type,
|
|
4985
|
+
error.code,
|
|
4986
|
+
error.type
|
|
4987
|
+
].every((value) => value === void 0 || value === null || value === "");
|
|
4988
|
+
}
|
|
4989
|
+
/** Observe a cloned, bounded 401 body; every unknown result retains native auth behavior. */
|
|
4990
|
+
async function isCopilotInputItemScopeError(response, signal) {
|
|
4991
|
+
if (response.status !== 401 || signal?.aborted) return false;
|
|
4992
|
+
let reader;
|
|
4993
|
+
let timeout;
|
|
4994
|
+
let onAbort;
|
|
4995
|
+
try {
|
|
4996
|
+
const clone = response.clone();
|
|
4997
|
+
if (!clone.body) return false;
|
|
4998
|
+
reader = clone.body.getReader();
|
|
4999
|
+
const interrupted = new Promise((resolve) => {
|
|
5000
|
+
onAbort = () => resolve(false);
|
|
5001
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
5002
|
+
timeout = setTimeout(() => resolve(false), errorReadTimeoutMs);
|
|
5003
|
+
if (signal?.aborted) resolve(false);
|
|
5004
|
+
});
|
|
5005
|
+
const result = await Promise.race([readScopeError(reader), interrupted]);
|
|
5006
|
+
return !signal?.aborted && result;
|
|
5007
|
+
} catch {
|
|
5008
|
+
return false;
|
|
5009
|
+
} finally {
|
|
5010
|
+
if (timeout !== void 0) clearTimeout(timeout);
|
|
5011
|
+
if (onAbort) signal?.removeEventListener("abort", onAbort);
|
|
5012
|
+
if (reader) {
|
|
5013
|
+
try {
|
|
5014
|
+
reader.cancel().catch(() => {});
|
|
5015
|
+
} catch {}
|
|
5016
|
+
try {
|
|
5017
|
+
reader.releaseLock();
|
|
5018
|
+
} catch {}
|
|
5019
|
+
}
|
|
5020
|
+
}
|
|
5021
|
+
}
|
|
5022
|
+
//#endregion
|
|
4907
5023
|
//#region lib/types/preview-provider.js
|
|
4908
5024
|
const enabledLevels = [
|
|
4909
5025
|
"minimal",
|
|
@@ -5083,10 +5199,30 @@ function createAccountProvider(descriptors, guard, baseURL) {
|
|
|
5083
5199
|
headers.authorization = `Bearer ${options.apiKey}`;
|
|
5084
5200
|
headers["x-api-key"] = null;
|
|
5085
5201
|
let unauthorized = false;
|
|
5202
|
+
const responses = model.api === "openai-responses";
|
|
5203
|
+
const reportReplayFailure = (error) => {
|
|
5204
|
+
if (lease.signal.aborted || options.signal?.aborted) return;
|
|
5205
|
+
try {
|
|
5206
|
+
guard.onReplayFailure?.(error);
|
|
5207
|
+
} catch {}
|
|
5208
|
+
};
|
|
5209
|
+
const onPayload = responses ? async (payload, selectedModel) => {
|
|
5210
|
+
const replacement = await options.onPayload?.(payload, selectedModel);
|
|
5211
|
+
if (lease.signal.aborted || options.signal?.aborted) throw new Error("COPILOT_MANAGED_ABORTED");
|
|
5212
|
+
try {
|
|
5213
|
+
return normalizeCopilotResponsesPayload(replacement === void 0 ? payload : replacement);
|
|
5214
|
+
} catch (error) {
|
|
5215
|
+
if (error instanceof CopilotResponsesReplayError) reportReplayFailure(error);
|
|
5216
|
+
throw error;
|
|
5217
|
+
}
|
|
5218
|
+
} : options.onPayload;
|
|
5086
5219
|
const fetch = options.fetch ?? globalThis.fetch;
|
|
5087
5220
|
const observeResponse = async (input, init) => {
|
|
5088
5221
|
const response = await fetch(input, init);
|
|
5089
|
-
if (response.status === 401)
|
|
5222
|
+
if (response.status === 401) {
|
|
5223
|
+
if (responses && await isCopilotInputItemScopeError(response, lease.signal)) reportReplayFailure(new CopilotResponsesReplayError("scope-mismatch"));
|
|
5224
|
+
else unauthorized = true;
|
|
5225
|
+
}
|
|
5090
5226
|
return response;
|
|
5091
5227
|
};
|
|
5092
5228
|
const wireOptions = model.api === "anthropic-messages" ? {
|
|
@@ -5099,7 +5235,8 @@ function createAccountProvider(descriptors, guard, baseURL) {
|
|
|
5099
5235
|
...options,
|
|
5100
5236
|
signal: lease.signal,
|
|
5101
5237
|
headers,
|
|
5102
|
-
fetch: observeResponse
|
|
5238
|
+
fetch: observeResponse,
|
|
5239
|
+
onPayload
|
|
5103
5240
|
};
|
|
5104
5241
|
if (!hasApi(model, "openai-responses") && !hasApi(model, "openai-completions") && !hasApi(model, "anthropic-messages")) {
|
|
5105
5242
|
lease.release();
|
|
@@ -6188,13 +6325,13 @@ var PreviewAdapter = class extends PiAiAdapter {
|
|
|
6188
6325
|
const mapping = Object.entries(model.thinkingLevelMap ?? {}).find(([level]) => level === options.reasoningEffort)?.[1];
|
|
6189
6326
|
if (typeof mapping !== "string" || mapping.length === 0) throw failure("COPILOT_PREVIEW_REASONING_UNSUPPORTED", "INVALID_REQUEST");
|
|
6190
6327
|
}
|
|
6191
|
-
let
|
|
6328
|
+
let requestFailure;
|
|
6192
6329
|
const inspectRequest = (_model, context, nativeOptions) => {
|
|
6193
6330
|
if (signal.aborted) throw failure("COPILOT_PREVIEW_ABORTED", "ABORTED");
|
|
6194
6331
|
const calculated = calculateRequestBudget(lease.descriptor, nativeOptions?.maxTokens, policy);
|
|
6195
6332
|
if (!calculated.ok) {
|
|
6196
|
-
|
|
6197
|
-
throw
|
|
6333
|
+
requestFailure = budgetFailure(calculated);
|
|
6334
|
+
throw requestFailure;
|
|
6198
6335
|
}
|
|
6199
6336
|
const prefix = estimateContextTokens({
|
|
6200
6337
|
messages: [],
|
|
@@ -6204,12 +6341,17 @@ var PreviewAdapter = class extends PiAiAdapter {
|
|
|
6204
6341
|
const fresh = context.messages.reduce((tokens, message) => tokens + estimateMessageTokens(message), prefix);
|
|
6205
6342
|
const admitted = assessRequestBudget(Math.max(estimateContextTokens(context).tokens, fresh), calculated.budget);
|
|
6206
6343
|
if (!admitted.ok) {
|
|
6207
|
-
|
|
6208
|
-
throw
|
|
6344
|
+
requestFailure = budgetFailure(admitted);
|
|
6345
|
+
throw requestFailure;
|
|
6209
6346
|
}
|
|
6210
6347
|
};
|
|
6211
6348
|
try {
|
|
6212
|
-
const native = new PiAiAdapter(owner.optionsFor(lease,
|
|
6349
|
+
const native = new PiAiAdapter(owner.optionsFor(lease, {
|
|
6350
|
+
inspectRequest,
|
|
6351
|
+
onReplayFailure(error) {
|
|
6352
|
+
if (!signal.aborted) requestFailure = new LlmError(error.message, "INVALID_REQUEST");
|
|
6353
|
+
}
|
|
6354
|
+
}));
|
|
6213
6355
|
const prepared = await native.prepareCall(options.provider, options.model, signal);
|
|
6214
6356
|
const suppliedEffort = options.reasoningEffort ?? prepared.model.reasoning?.defaultEffort;
|
|
6215
6357
|
const effort = options.purpose === "compaction" ? selectCompactionReasoning(getSupportedThinkingLevels(model), suppliedEffort, policy.compactionReasoning) : suppliedEffort;
|
|
@@ -6219,18 +6361,18 @@ var PreviewAdapter = class extends PiAiAdapter {
|
|
|
6219
6361
|
...effort === void 0 ? {} : { reasoningEffort: ReasoningEffortId(effort) }
|
|
6220
6362
|
};
|
|
6221
6363
|
for await (const chunk of native.stream(request)) {
|
|
6222
|
-
if (
|
|
6364
|
+
if (requestFailure !== void 0) {
|
|
6223
6365
|
if (signal.aborted) throw failure("COPILOT_PREVIEW_ABORTED", "ABORTED");
|
|
6224
|
-
throw
|
|
6366
|
+
throw requestFailure;
|
|
6225
6367
|
}
|
|
6226
6368
|
if (chunk.type === "finish" && chunk.reason.kind === "error" && chunk.reason.failure.code === "UNKNOWN_MODEL") await owner.refreshRejected(lease.snapshot, signal);
|
|
6227
6369
|
yield chunk;
|
|
6228
6370
|
}
|
|
6229
|
-
if (
|
|
6371
|
+
if (requestFailure !== void 0) throw requestFailure;
|
|
6230
6372
|
} catch (cause) {
|
|
6231
6373
|
if (signal.aborted) throw failure("COPILOT_PREVIEW_ABORTED", "ABORTED");
|
|
6232
6374
|
if (cause instanceof LlmError && cause.code === "UNKNOWN_MODEL") await owner.refreshRejected(lease.snapshot, signal);
|
|
6233
|
-
throw
|
|
6375
|
+
throw requestFailure ?? cause;
|
|
6234
6376
|
}
|
|
6235
6377
|
})();
|
|
6236
6378
|
}
|
|
@@ -6452,10 +6594,10 @@ function apply$1(ctx, config = {}) {
|
|
|
6452
6594
|
});
|
|
6453
6595
|
} catch {}
|
|
6454
6596
|
};
|
|
6455
|
-
const optionsFor = (lease,
|
|
6597
|
+
const optionsFor = (lease, hooks = {}) => {
|
|
6456
6598
|
const guard = {
|
|
6457
6599
|
...lifetime.guard(lease),
|
|
6458
|
-
...
|
|
6600
|
+
...hooks,
|
|
6459
6601
|
onUnauthorized() {
|
|
6460
6602
|
if (lease === void 0 || !lifetime.isCurrent(lease.revision) || source.readDisplaySnapshot() !== lease.snapshot || provenSnapshot !== lease.snapshot || snapshotProof !== lease.proof) return;
|
|
6461
6603
|
rejectedAuth = lease.proof;
|
|
@@ -2,6 +2,7 @@ import type { Api, Context as PiContext, Model, StreamOptions } from '@earendil-
|
|
|
2
2
|
import type { AccountModelApi, AccountModelDescriptor } from './account-model-catalog.ts';
|
|
3
3
|
import type { CoreCompatibleProvider } from './pi-provider-bridge.ts';
|
|
4
4
|
import type { GitHubCopilotOAuthCredential } from './copilot-grant.ts';
|
|
5
|
+
import { CopilotResponsesReplayError } from './responses-replay-compat.ts';
|
|
5
6
|
/** Per-call authorization/lifetime checks supplied by the owning route. */
|
|
6
7
|
export interface PreviewProviderGuard {
|
|
7
8
|
readonly signal: AbortSignal;
|
|
@@ -11,8 +12,10 @@ export interface PreviewProviderGuard {
|
|
|
11
12
|
signal: AbortSignal;
|
|
12
13
|
release(): void;
|
|
13
14
|
}>;
|
|
14
|
-
/** Actual model HTTP 401
|
|
15
|
+
/** Actual model HTTP 401, excluding proven Responses replay-scope failures; no request replay. */
|
|
15
16
|
onUnauthorized?(): void;
|
|
17
|
+
/** Dispatch-local, verified replay failure; never inferred from SDK error text. */
|
|
18
|
+
onReplayFailure?(error: CopilotResponsesReplayError): void;
|
|
16
19
|
}
|
|
17
20
|
/** Guard for one selected model in an account-bound descriptor snapshot. */
|
|
18
21
|
export interface AccountProviderGuard extends PreviewProviderGuard {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type ReplayFailure = 'scope-mismatch' | 'unsupported' | 'invalid-payload';
|
|
2
|
+
/** Fixed diagnostics only: never include provider bodies, IDs, arguments or replay content. */
|
|
3
|
+
export declare class CopilotResponsesReplayError extends Error {
|
|
4
|
+
constructor(reason?: ReplayFailure);
|
|
5
|
+
}
|
|
6
|
+
/** Normalize only the outgoing managed Responses payload, never stored history/context. */
|
|
7
|
+
export declare function normalizeCopilotResponsesPayload(payload: unknown): unknown;
|
|
8
|
+
/** Observe a cloned, bounded 401 body; every unknown result retains native auth behavior. */
|
|
9
|
+
export declare function isCopilotInputItemScopeError(response: Response, signal?: AbortSignal): Promise<boolean>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=responses-replay-compat.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.37",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|