dsh-github-copilot 0.1.0-alpha.2.dsh.0.2.1.rc.3 → 0.1.0-alpha.4.dsh.0.2.1.rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -22,7 +22,7 @@ This repository follows a **plugin-only** policy: implement fixes in `dsh-github
22
22
  2. Read this file, then `node scripts/agent.mjs describe --json`. `agent-contract.json` maps each task to its owning files, focused tests, risks and approval boundaries; package scripts and release URLs are derived from current metadata.
23
23
  3. Run `node scripts/agent.mjs doctor --json` before install. It is a dependency-free, read-only repository preflight: exit 0 means preflight passed, 1 means prerequisites missing, 2 means invalid arguments/metadata. Build presence is not build freshness, and no live DSH or credential readiness is claimed.
24
24
  4. Choose a task with `node scripts/agent.mjs plan models --json` (or authorization/search/client/compatibility/tooling/release). Output is an unexecuted argv plan, never implicit permission to run destructive operations.
25
- 5. Use Node 24 LTS for development and the exact pnpm version in `package.json`; the runtime dependency floor is Node 22.19.0. Run frozen install in this checkout. Dependencies/build output are not carried into worktrees.
25
+ 5. Use Node 24 LTS for development and the exact pnpm version in `package.json`; the runtime dependency floor is Node 22.19.0. Select the execution environment and task explicitly with `node scripts/agent.mjs guard`. Local auxiliary checks are limited to the guarded dependency-free script tests; dependency installation and full verification belong to GitHub Actions. Do not retry local dependency restoration, change registries, or treat local reports/idle sessions as CI evidence. The guard applies only to operations routed through it; it cannot prevent direct shell bypass.
26
26
  6. Create/reuse a tracking issue and feature branch, implement a regression first, run the full gate, inspect the diff, and open a PR. For requested delivery, merge after required review/CI and branch protection without a separate approval prompt, unless the user limits scope. Important updates continue through the release-delivery rule below. Live-profile install and worktree checkout still require explicit user approval.
27
27
 
28
28
  Use native DSH tools for goals, background jobs and scoped subagents. Use local Git and the GitHub REST API for delivery; no external orchestration daemon, roster or `vcs_*` tool is required. Do not assume a model provider's identity is the assisting agent.
@@ -317,10 +317,84 @@ Desktop plugin upgrades do not necessarily reconcile profile-local copies of Hos
317
317
 
318
318
  ## Mechanical verification
319
319
 
320
- Run from the repository root:
320
+ When a task explicitly requires post-upgrade Desktop/UI acceptance, use acceptance
321
+ contract/report schema 2 described in `docs/agent-acceptance.md`. Exact-head CI
322
+ and installed-on-disk evidence cannot replace live behavior or the public loaded
323
+ plugin version. Attempt safe authorized checks on an already-running Desktop;
324
+ unreliable local npm is not a reason to skip them. Use existing computer-use
325
+ tools, never shell activation or a repository script as an App controller.
326
+ Begin with current app discovery, not a historical "already open" claim. If not
327
+ running, start only with explicit launch authorization via controlled `start_app`
328
+ using the exact approved target; then verify discovery and fresh UI, not merely
329
+ the launch receipt. Do not start an already-running app again. A welcome screen
330
+ is not automatically an auth blocker: inspect an official safe skip first. DSH's
331
+ Add API Key -> Set up later path does not submit/store a key or authenticate;
332
+ use it only when actually exposed, within tool permission rules. Never infer
333
+ Copilot account invalidity from welcome UI or bypass real authentication/warnings.
334
+ Welcome dismissal may replace the window: rediscover app/window and read its fresh
335
+ tree before acting, rather than retrying a stale window on an empty immediate diff.
336
+ Honor user-input interruption: reread UI before retrying the same permitted action.
337
+ Before handoff, freshly discover the current app and inspect the target panel or
338
+ workspace, reporting the observation time only; past success does not establish
339
+ current running state or guarantee the app remains running later.
340
+ An action receipt or empty immediate diff is not a navigation failure: obtain
341
+ a fresh post-action `get_window_state` observation first. Keep one attempt per
342
+ supported navigation method, at most two different methods, then report precise
343
+ `automation-blocked` and request the named panel once. User absence or an
344
+ unanswered request never grants permission or proves the panel opened.
345
+ App unavailable, restart/install, account/OAuth/paid actions outside explicit
346
+ permission stay blocked. Do not repeat exhausted methods on ordinary continuation.
347
+ Record only fixed action/outcome codes, numeric times and version/source facts;
348
+ never upload identities, credentials or conversation content. Unknown loaded
349
+ version permits qualified observations only, not a version-specific fix claim.
350
+ For formal upgrade acceptance, prefer the published exact-version GitHub Release
351
+ asset canonical URL, never a local source directory, build, link or worktree.
352
+ A downloaded official tgz is a verified GitHub cache, not a local build; use it
353
+ only as a documented fallback when native URL delivery is unavailable/rejected.
354
+ Record exact source URL/version, archive and Release SHA-256, numeric observation
355
+ time and fixed fallback reason separately. Matching hashes do not grant install
356
+ or restart permission or prove the resulting runtime loaded. The consistency
357
+ checker never downloads/installs or independently authenticates this provenance.
358
+ Missing/not-run/blocked/error/timeout mandatory evidence cannot pass acceptance; even a
359
+ consistent complete report is not trusted proof of execution or automatic closure.
360
+ Keep required-check completeness separate from issue disposition. Controlled
361
+ regressions can exercise timers, never-resolving requests, late results and
362
+ simulated disconnects; production Desktop fault injection is different. Do not
363
+ disconnect networking, alter proxies/accounts or trigger paid requests to fill
364
+ coverage without specific permission. After a specific defect is fixed, relevant
365
+ controlled regressions/exact CI pass, release/install/load premises are met and
366
+ normal live checks do not reproduce it, explicit user risk acceptance may close
367
+ with "fixed/not reproduced; untested faults listed; reopen on recurrence".
368
+ Do not claim the original root cause or production fault coverage was proven.
369
+ Lack of safe/non-destructive production injection alone is not an indefinite
370
+ closure blocker. Known failures/reproduction, critical safety gaps and mandatory
371
+ requirements remain blockers; residual-risk disposition cannot relabel them
372
+ passed or authorize automatic issue closure.
373
+
374
+ For the opt-in task acceptance pilot, define observable requirements before
375
+ implementation and validate the clean candidate with
376
+ `node scripts/agent.mjs accept --contract CONTRACT_FILE --report REPORT_FILE`.
377
+ See [acceptance evidence](https://github.com/cloga/dsh-github-copilot/blob/main/docs/agent-acceptance.md): exact commit/contract and
378
+ local file integrity are checked, not execution, environment truth, reviewer
379
+ independence or delivery permission. Keep reports outside Git and never upload
380
+ live diagnostics automatically. Failed, blocked and not-run requirements cannot
381
+ pass; new commits require new evidence. Existing review/CI/release gates remain
382
+ authoritative. This tooling does not activate agents or access live profiles.
383
+
384
+ Choose a bounded local auxiliary check or authoritative remote evidence explicitly
385
+ with `node scripts/agent.mjs guard --task TASK_ID --environment local-auxiliary
386
+ --operation scripts-test` or `--environment github-actions-evidence
387
+ --operation ci-evidence --head FULL_COMMIT_SHA`. The dependency-free scripts
388
+ tests are the only guarded local verification here. Do not run dependency
389
+ installation/recovery locally; full install, build, types, integration and
390
+ package verification use the existing GitHub Actions workflow. See
391
+ [environment and CI evidence guardrails](./docs/environment-evidence-guardrails.md).
392
+ The guard covers only operations invoked through this entry point and is not a
393
+ shell sandbox.
394
+
395
+ The full gate and package commands, run by the existing CI workflow, are:
321
396
 
322
397
  ```sh
323
- pnpm install --frozen-lockfile
324
398
  pnpm verify
325
399
  pnpm pack --pack-destination artifacts
326
400
  ```
@@ -329,7 +403,7 @@ Then run `pnpm verify:tarball -- artifacts/dsh-github-copilot-<package-version>.
329
403
 
330
404
  `pnpm verify` checks the Agent contract, source and local test types, baseline markers, a clean build, Vitest tests, Node tooling tests, and real built Host import/Client-loader/Remote smoke. `tests/fixtures` are intentionally excluded from local test typecheck because they import source from a separate pinned Core checkout. The checked-in code must pass; never suppress compiler errors or weaken a test to get a green report.
331
405
 
332
- If the exact frozen install is blocked solely by an enterprise registry or network policy while the repository's GitHub Actions can obtain the unchanged pinned packages from an authorized official registry, record the attempted command and exact environmental failure as **local validation blocked**, not passed. A PR may proceed with that limitation disclosed; the complete required GitHub CI matrix, including its install, tests, build and package checks, is then the authoritative gate before merge. Never weaken or skip CI, substitute dependencies, bypass organizational restrictions, claim unrun local gates succeeded, or tag/release a revision whose required CI is not green. If CI has the same failure, resolve it through approved infrastructure rather than bypassing it.
406
+ If a historical/approved local installation attempt is blocked solely by an enterprise registry or network policy while GitHub Actions can obtain unchanged pinned packages from an authorized official registry, record it as **local validation blocked**, not passed. Do not repeat dependency recovery, switch sources, or expand permissions. A PR may proceed with that limitation disclosed; the complete required GitHub CI matrix, including install, tests, build and package checks, is authoritative before merge. Never weaken or skip CI, substitute dependencies, bypass organizational restrictions, claim unrun local gates succeeded, or tag/release a revision whose required CI is not green. If CI has the same failure, resolve it through approved infrastructure rather than bypassing it.
333
407
 
334
408
  The release CI matrix targets only exact official `0.2.1-rc.3` on Windows and Linux; earlier pins are not support gates. It runs the unchanged tagged-source runtime fixture, optional native Chat fixture, exact published-artifact adapter fixture and all 28 native reviewer regressions without skips. This is a required gate, not evidence that an unexecuted qualification passed. `verify:upstream` is static seam-marker evidence. `verify:controlled-core` exclusively installs a temporary config fixture, refuses an existing target, and removes only its own file; it is not full plugin activation. Published-artifact synthetic adapter fixtures do not prove live provider transport. The release job must wait for the complete reusable CI matrix on the tagged revision, then verify its own packed bytes before publishing.
335
409
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-alpha.4.dsh.0.2.1.rc.3 (prepared)
4
+
5
+ - Carry forward bounded Responses replay refusal diagnostics from retired draft #218 under #446: fixed reasons, zero-based input positions, allowlisted type/status and field-presence booleans through the existing native `INVALID_REQUEST` surface. No IDs, summaries, tool data, unknown values or encrypted bytes enter diagnostics.
6
+ - Exercise current pinned pi-ai 1.1.0 synthetic two-turn summary-only rejection and terminal encryption backfill, preserving original history, exact opaque bytes and `call_id` pairing. Retain existing replay acceptance, account isolation, consent and cancellation ownership; no new retry, history deletion or model switch.
7
+ - Prepare the next same-Core candidate metadata for required PR validation only. No tag, merge, publication, profile installation, restart or live model call is authorized.
8
+
9
+ ## 0.1.0-alpha.3.dsh.0.2.1.rc.3 (prepared)
10
+
11
+ - Explain projected-image admission failures through the standard native error path with bounded model, projected/allowed MIME, projected role/position and current build details (#426). Retain the existing fail-closed gate, explicit account restrictions and native projection ownership.
12
+ - Explain why historical images can block text-only continuations and offer explicit future-turn recovery choices. No automatic model switch, retry, image conversion/removal, history mutation or new diagnostic collector.
13
+ - Auto still checks general vision capability before candidate-specific projection is available. This change does not establish the original incident's model, image format, trigger block or loaded version, and does not claim live recovery. PR-only preparation does not authorize merge, publication, installation or restart.
14
+
3
15
  ## 0.1.0-alpha.2.dsh.0.2.1.rc.3 (prepared)
4
16
 
5
17
  - Bound account-management metadata and identity reads to fifteen seconds, provide metadata-only Retry after initial failure, and discard late results (#346). Account mutations retain their original locks and settlement; no Host cancellation or automatic retry.
package/CONTRIBUTING.md CHANGED
@@ -33,6 +33,20 @@ Core inspection is read-only. Isolated tests may use unchanged pinned Core artif
33
33
 
34
34
  Generated `lib/` output, archives, `.env`, tokens, local credentials, machine state and production screenshots with real authorization codes must not be committed. Use synthetic fixtures for screenshots and report staged UI honestly.
35
35
 
36
+ ## Task acceptance pilot
37
+
38
+ Define requirement IDs, expected behavior, verification methods and non-goals
39
+ before implementation. On the clean committed candidate, use
40
+ `node scripts/agent.mjs accept --contract CONTRACT_FILE --report REPORT_FILE`.
41
+ The [acceptance evidence guide](https://github.com/cloga/dsh-github-copilot/blob/main/docs/agent-acceptance.md) defines the bounded
42
+ contract and report formats. Keep evidence outside Git, record exact commit and
43
+ contract/artifact hashes, and distinguish failed, blocked and not-run outcomes.
44
+ This verifies consistency only, not test execution, independent review or live
45
+ behavior; it never replaces required reviews or CI. Review artifacts before any
46
+ explicit sharing and do not upload raw live diagnostics. Subsequent commits need
47
+ fresh evidence. The current-Core PR-template target is mechanically checked
48
+ against package metadata without altering historical evidence.
49
+
36
50
  ## Release changes
37
51
 
38
52
  GitHub Releases and npm are the default distribution channels for every new version, superseding the Release-only decision in #43 at the user's request. The public package uses the exact same verified tarball in both channels. No automatic npm opt-out is allowed. See [npm distribution](./docs/npm-distribution.md) for initial maintainer bootstrap, OIDC, retry recovery and organizational access requirements.
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  GitHub Copilot account discovery, contextual Auto routing and hosted search for DSH. The plugin reuses DSH's published native adapter, retaining a profile-wide account default with independent Session next-turn choices; it does not patch Core or maintain a second model catalog.
10
10
 
11
- **Historical stable release: [`0.4.1`](https://github.com/cloga/dsh-github-copilot/releases/tag/v0.4.1); pending DSH rc.3 update: `0.1.0-alpha.2.dsh.0.2.1.rc.3`.** DSH `0.2.1-rc.3` is a prerelease. This plugin line is a compatibility candidate, not a production Core upgrade recommendation; Desktop artifacts/signatures are unverified. Each exact DSH Core version starts an independent plugin sequence at `0.1.0-alpha.1.dsh.<Core>`; same-Core fixes increment `alpha.N`. The suffix normalizes Core `0.2.1-rc.3` to `dsh.0.2.1.rc.3`, but compatibility is validated against explicit metadata, not guessed from the name. Existing published versions/tags remain unchanged. Published, installed and loaded states remain separate.
11
+ **Historical stable release: [`0.4.1`](https://github.com/cloga/dsh-github-copilot/releases/tag/v0.4.1); pending DSH rc.3 update: `0.1.0-alpha.4.dsh.0.2.1.rc.3`.** DSH `0.2.1-rc.3` is a prerelease. This plugin line is a compatibility candidate, not a production Core upgrade recommendation; Desktop artifacts/signatures are unverified. Each exact DSH Core version starts an independent plugin sequence at `0.1.0-alpha.1.dsh.<Core>`; same-Core fixes increment `alpha.N`. The suffix normalizes Core `0.2.1-rc.3` to `dsh.0.2.1.rc.3`, but compatibility is validated against explicit metadata, not guessed from the name. Existing published versions/tags remain unchanged. Published, installed and loaded states remain separate.
12
12
 
13
13
  Select by **exact Core**, never global SemVer maximum or npm `latest`/`alpha`.
14
14
  The read-only `node scripts/select-core-release.mjs 0.2.0-rc.2` command checks
@@ -25,6 +25,8 @@ maintenance is promised. See [release selection](./docs/npm-distribution.md#exac
25
25
 
26
26
  **Compaction planning:** alpha.15 fixes byte counts being compared with token budgets in the separately selected recovery engine. Planning now uses the public native token meter, preserving complete tool relations and final native admission. Truly oversized balanced units still fail explicitly; this is not history repair or guaranteed recovery. See [compaction recovery](./docs/manual-compaction-recovery.md).
27
27
 
28
+ **Responses replay refusal:** a locally rejected incomplete, reference-only, summary-only reasoning item, or previous-response reference now adds a bounded structural reason to the native `INVALID_REQUEST`: fixed reason code, zero-based input index when applicable, allowlisted type/status, and field-presence booleans only. The rejected request is not dispatched and history remains unchanged; IDs, summaries, tool data, unknown fields, and encrypted bytes are never included in diagnostics. Valid encrypted replay bytes and `call_id` pairing remain intact. This diagnosis does not recover or rewrite old history.
29
+
28
30
  **Historical DSH alpha.5 adaptation:** exact public APIs used pi-ai `1.1.0`, the official
29
31
  Cordis/schemastery peers and storage-domain's Zod `4.4.3`. The
30
32
  [fixed-target official-first review](https://github.com/cloga/dsh-github-copilot/blob/main/docs/official-first-021-alpha5.md)
@@ -157,10 +159,19 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
157
159
 
158
160
  Supply any launcher patches with repeated `--patch /absolute/file`. Require `supported: true`: the install command does not automatically run this preflight. Unsupported/custom Web composition and `NONEMPTY_DISPOSABLE_PROFILE_ROOT` are stop conditions. Preserve a nonempty root and review whether public composition reconstructs it before any separately approved normalization; never assume it can be cleared. Check effective shared-peer resolution so stale profile-local packages do not shadow Desktop's official peers.
159
161
 
162
+ Install the exact, checksum-verified release archive shown below; do not use a
163
+ checkout directory as a release package. `pnpm add <directory>` creates a
164
+ `link:` development dependency and does not install that directory's production
165
+ dependencies. For development, install the checkout's dependencies before
166
+ linking it and keep the checkout available at the linked path. A package manager
167
+ showing **Installed** confirms its profile record, not that runtime dependencies
168
+ resolved or that the plugin loaded; verify the exact DSH/profile startup result
169
+ separately.
170
+
160
171
  For a **standalone named profile**:
161
172
 
162
173
  ```sh
163
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.2.dsh.0.2.1.rc.3/dsh-github-copilot-0.1.0-alpha.2.dsh.0.2.1.rc.3.tgz
174
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.4.dsh.0.2.1.rc.3/dsh-github-copilot-0.1.0-alpha.4.dsh.0.2.1.rc.3.tgz
164
175
  ```
165
176
 
166
177
  The command above is a prepared-release example, usable only after publication and required CI qualification; it requires official DSH prerelease `0.2.1-rc.3`. **Do not install this candidate into production Desktop profiles.** Desktop artifacts/signatures and profile peer composition remain unverified; retain the existing compatible plugin on rc.2. The [historical rc.2 bundled-CLI qualification](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2) does not qualify rc.3, and a generic/global `dsh` shim is not equivalent. No installation or restart is authorized.
@@ -276,6 +287,8 @@ The same failure can include request-scoped native local body-write/header miles
276
287
 
277
288
  HTTP/SSE liveness separates five-minute byte idle from bounded ten-minute assistant-output silence by default. Consumer work is excluded; WebSocket/explicit `auto` stays native-only. This does not cure supplier HTTP 408s. Images are admitted against actual native-projected MIME evidence; the plugin does not own conversion or infer format support from filenames. [Image compatibility](./docs/image-input-compatibility.md).
278
289
 
290
+ Image admission errors explain historical-image failures even on text-only continuations. The native error includes bounded selected-model, projected/allowed MIME, projected role/position and current plugin-build details, without image content, URLs or paths. Auto checks general vision capability, not candidate-specific projected formats; the final gate remains fail-closed. Explicitly choose a compatible model for a subsequent turn or start a separate text-only Session; nothing is automatically switched, removed or retried. These diagnostics cannot reconstruct an earlier incident.
291
+
279
292
  Native rc.2 Auto authorization review requests `temperature: 0`. The plugin now automatically omits it **only for the authenticated official Auto reviewer root on account-discovered managed OpenAI Responses**; no switch is needed. Concurrent ordinary Chat, even on the same Session/model, retains its temperature. Public Loader callback identity and same-profile package ownership authenticate the caller; unknown identity, aliases, descendants, other protocols/providers and canonical Core-owned Copilot remain native, with bounded diagnostics for unqualified reviewer scope. No capability is inferred from `supports.thinking`. Frozen inputs, native account/cancellation guards, strict verdicts and fail-closed tool denial remain intact; no retries, permission changes or settings migration occur. The independent legacy `github-copilot.responsesOmitTemperature` override remains default `false`; explicit `true` still omits temperature from **all** managed Responses requests, not just review. See [public scope and qualification limits](./docs/auto-review-sampling.md).
280
293
 
281
294
  ## Settings and troubleshooting
@@ -359,6 +372,14 @@ pnpm verify:tarball -- artifacts/dsh-github-copilot-<package-version>.tgz
359
372
 
360
373
  Agents start with `node scripts/agent.mjs describe --json`, `doctor --json` and `plan <task> --json`; plans are unexecuted arguments, not action approval. Follow [AGENTS.md](./AGENTS.md) for the full change/release policy. Important updates require protected merge and verified dual-channel publication; documentation-only work does not release by default. Profile installation, sign-out and session-interrupting restart need separate authorization.
361
374
 
375
+ The source-checkout [task acceptance pilot](https://github.com/cloga/dsh-github-copilot/blob/main/docs/agent-acceptance.md) adds
376
+ `node scripts/agent.mjs accept --contract CONTRACT_FILE --report REPORT_FILE`.
377
+ It checks requirement coverage, the clean current commit, exact contract bytes
378
+ and local evidence hashes; failed, blocked and not-run outcomes remain distinct.
379
+ It does not attest execution, independent review, live behavior or delivery
380
+ permission. Keep evidence outside Git; no agents, uploads or profile changes are
381
+ started. Existing CI and release gates remain authoritative.
382
+
362
383
  Commit attribution uses `Assisted-by` with the actual tool, never the model provider or an unverified collaborator identity.
363
384
 
364
385
  ## Release and checksum verification
@@ -366,14 +387,14 @@ Commit attribution uses `Assisted-by` with the actual tool, never the model prov
366
387
  GitHub Releases and npm distribute the same original verified tarball. Pin a version; verify Release SHA-256 or npm `dist.integrity`. Never repack an immutable release or move/reuse its tag.
367
388
 
368
389
  ```sh
369
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.2.dsh.0.2.1.rc.3/dsh-github-copilot-0.1.0-alpha.2.dsh.0.2.1.rc.3.tgz
370
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.2.dsh.0.2.1.rc.3/SHA256SUMS
390
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.4.dsh.0.2.1.rc.3/dsh-github-copilot-0.1.0-alpha.4.dsh.0.2.1.rc.3.tgz
391
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.4.dsh.0.2.1.rc.3/SHA256SUMS
371
392
  sha256sum --check SHA256SUMS
372
393
  ```
373
394
 
374
395
  ```powershell
375
396
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
376
- $actual = (Get-FileHash .\dsh-github-copilot-0.1.0-alpha.2.dsh.0.2.1.rc.3.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
397
+ $actual = (Get-FileHash .\dsh-github-copilot-0.1.0-alpha.4.dsh.0.2.1.rc.3.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
377
398
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
378
399
  ```
379
400
 
package/README.zh.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  为 DSH 提供 GitHub Copilot 账号模型发现、上下文 Auto 选模和 hosted search。插件复用 DSH 公开的原生适配器,保留 profile 全局默认账号,并支持 Session 后续 turn 指定独立账号;不修改 Core,也不维护第二套模型目录。
10
10
 
11
- **历史稳定版:[`0.4.1`](https://github.com/cloga/dsh-github-copilot/releases/tag/v0.4.1);DSH rc.3 更新候选:`0.1.0-alpha.2.dsh.0.2.1.rc.3`。** DSH `0.2.1-rc.3` 是预发布版本。本插件线是兼容性候选,不是生产 Core 升级建议;Desktop 制品/签名尚未核验。每个精确 DSH Core 版本都从独立插件序列 `0.1.0-alpha.1.dsh.<Core>` 开始;同一 Core 内修复递增 `alpha.N`。后缀将 Core `0.2.1-rc.3` 规范化为 `dsh.0.2.1.rc.3`,但兼容性仍须核对明确元数据,不能只猜版本名。既有已发布版本和 tag 不变。已发布、已安装、已加载仍是不同状态。
11
+ **历史稳定版:[`0.4.1`](https://github.com/cloga/dsh-github-copilot/releases/tag/v0.4.1);DSH rc.3 更新候选:`0.1.0-alpha.4.dsh.0.2.1.rc.3`。** DSH `0.2.1-rc.3` 是预发布版本。本插件线是兼容性候选,不是生产 Core 升级建议;Desktop 制品/签名尚未核验。每个精确 DSH Core 版本都从独立插件序列 `0.1.0-alpha.1.dsh.<Core>` 开始;同一 Core 内修复递增 `alpha.N`。后缀将 Core `0.2.1-rc.3` 规范化为 `dsh.0.2.1.rc.3`,但兼容性仍须核对明确元数据,不能只猜版本名。既有已发布版本和 tag 不变。已发布、已安装、已加载仍是不同状态。
12
12
 
13
13
  按**精确 Core**选版本,不按全局 SemVer 最大值或 npm `latest`/`alpha`。
14
14
  只读命令 `node scripts/select-core-release.mjs 0.2.0-rc.2` 先读取
@@ -23,6 +23,8 @@ Core alpha.4 对应 alpha.16,alpha.5 保留其历史线,rc.3 对应当前待
23
23
 
24
24
  **压缩规划:**alpha.15 修复独立选择的恢复引擎将字节数与 token 预算直接比较的问题,改用公开的原生 token meter,保留完整工具关系和最终原生准入。真正超大的配对历史单元仍明确失败;这不是历史修复,也不保证恢复成功。参见[压缩恢复](./docs/manual-compaction-recovery.md)。
25
25
 
26
+ **Responses replay 拒绝诊断:**本地拒绝不完整、仅引用、只有摘要的 reasoning 条目或 previous-response 引用时,原生 `INVALID_REQUEST` 会附带有界结构原因:固定原因码、适用时从零开始的输入位置、白名单 type/status,以及字段存在性布尔值。被拒绝的请求不会发出,历史保持不变;诊断不会包含 ID、摘要、工具数据、未知字段或加密 bytes。有效加密 replay bytes 和 `call_id` 配对保持原样。此诊断不会恢复或改写旧历史。
27
+
26
28
  **历史 DSH alpha.5 适配:**公开 API 对齐 pi-ai `1.1.0`、官方 Cordis/schemastery peer,
27
29
  以及 storage-domain 的 Zod `4.4.3`。
28
30
  [固定目标的 official-first 调研](https://github.com/cloga/dsh-github-copilot/blob/main/docs/official-first-021-alpha5.md)
@@ -132,10 +134,16 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
132
134
 
133
135
  启动 patch 用重复的 `--patch /absolute/file` 提供。必须得到 `supported: true`;安装器不会自动执行此预检。不支持的/自定义 Web 组合及 `NONEMPTY_DISPOSABLE_PROFILE_ROOT` 均须停止。先保全非空 root,并核对公开组合能否完整重建,再另行批准规范化;不能默认清空。检查实际共享 peer 解析,避免旧 profile-local 包遮蔽官方 Desktop peer。
134
136
 
137
+ 请安装下方的精确版本、checksum 已核验的发布归档;不要把 checkout
138
+ 目录当作发布包。`pnpm add <directory>` 会创建 `link:` 开发依赖,不会替该
139
+ 目录安装生产依赖。开发时应先安装 checkout 的依赖再建立链接,并确保链接目标持续可用。
140
+ 包管理器显示 **Installed** 只表示 profile 记录已接受,不代表运行依赖已解析或插件已成功加载;
141
+ 还应单独核对目标 DSH/profile 的启动结果。
142
+
135
143
  **独立具名 profile**:
136
144
 
137
145
  ```sh
138
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.2.dsh.0.2.1.rc.3/dsh-github-copilot-0.1.0-alpha.2.dsh.0.2.1.rc.3.tgz
146
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.4.dsh.0.2.1.rc.3/dsh-github-copilot-0.1.0-alpha.4.dsh.0.2.1.rc.3.tgz
139
147
  ```
140
148
 
141
149
  上面的命令是准备发布的示例,仅在发布且所需 CI 通过后可用;目标是官方 DSH 预发布版 `0.2.1-rc.3`。**不要把此候选安装到生产 Desktop profile。** Desktop 制品/签名及 profile peer 组合仍未核验;rc.2 应保留现有兼容插件。[历史 rc.2 随附 CLI 核验](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2)不代表 rc.3 验收;全局/普通 `dsh` shim 不等价。本次不授权安装或重启。
@@ -248,6 +256,8 @@ Copilot 搜索要求当前账号/协议证据及能力 proof。固定/fallba
248
256
 
249
257
  HTTP/SSE liveness 默认区分 5 分钟字节 idle 和有界的 10 分钟助手输出静默,排除消费者工作;WebSocket/显式 `auto`仍仅使用原生路径。这不修复供应方 HTTP 408。图片按原生实际投影 MIME 证据准入;插件不负责转换,也不按文件名猜格式支持。[图片兼容](./docs/image-input-compatibility.md)。
250
258
 
259
+ 图片准入错误会解释为何纯文本续聊也可能被历史图片阻断。原生错误包含有界的所选模型、投影/允许 MIME、投影角色/位置及当前插件构建版本,不含图片内容、URL 或路径。Auto 只检查通用图片能力,不能预先保证候选模型接受最终投影格式;最终门禁仍保守拒绝不兼容请求。可为后续轮次明确选择兼容模型,或另开不含旧图的纯文本 Session;不会自动换模型、移除图片或重试。这些诊断不能追溯补齐旧故障的证据。
260
+
251
261
  原生 rc.2 Auto 授权审查以 `temperature: 0` 请求模型。插件现在**仅对身份已验证的官方 Auto reviewer 根上下文、账号发现的托管 OpenAI Responses 请求自动省略此参数**,无需开启开关。同一 Session/模型的并发普通 Chat 仍保留 temperature。身份由公开 Loader 回调与同 profile 包归属共同验证;未知身份、别名、子上下文、其它协议/供应方以及 Core 所有的 canonical Copilot 保持原生行为,未验证的 reviewer 范围只报告有界诊断。不会从 `supports.thinking` 推断兼容性。冻结输入、账号/取消约束、严格 verdict 和失败关闭的工具拒绝保持不变;没有重试、权限变更或设置迁移。独立的旧兼容覆盖项 `github-copilot.responsesOmitTemperature` 仍默认 `false`;显式 `true` 才影响**所有**托管 Responses 请求,不限于 review。参见[公开范围与验证限制](./docs/auto-review-sampling.md)。
252
262
 
253
263
  ## 设置与排障
@@ -331,6 +341,12 @@ pnpm verify:tarball -- artifacts/dsh-github-copilot-<package-version>.tgz
331
341
 
332
342
  Agent 从 `node scripts/agent.mjs describe --json`、`doctor --json`及`plan <task> --json`开始;计划仅返回未执行 argv,不授权副作用。完整变更/发布政策见[AGENTS.md](./AGENTS.md)。重要更新必须经受保护合并与双渠道发布;纯文档默认不发包。Profile 安装、退出和中断会话的重启另需许可。
333
343
 
344
+ 源码工作区的[任务验收试点](https://github.com/cloga/dsh-github-copilot/blob/main/docs/agent-acceptance.md)提供
345
+ `node scripts/agent.mjs accept --contract CONTRACT_FILE --report REPORT_FILE`。
346
+ 它检查需求覆盖、当前干净提交、契约原始字节和本地证据哈希,并区分失败、受阻和未执行。
347
+ 这不是测试执行、独立评审、真实运行或交付授权的证明。证据保留在 Git 之外;
348
+ 该命令不会启动 agent、上传数据或修改 profile,现有 CI 和发布门禁仍是交付依据。
349
+
334
350
  提交以 `Assisted-by` 标明实际使用的工具,不用模型供应商或未经核实的协作者身份。
335
351
 
336
352
  ## Release 与 checksum
@@ -338,14 +354,14 @@ Agent 从 `node scripts/agent.mjs describe --json`、`doctor --json`及`plan <ta
338
354
  GitHub Releases 和 npm 分发同一原始已校验 tarball。固定版本并核验 Release SHA-256 或 npm `dist.integrity`;不重打包不可变 Release、不移动/复用 tag。
339
355
 
340
356
  ```sh
341
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.2.dsh.0.2.1.rc.3/dsh-github-copilot-0.1.0-alpha.2.dsh.0.2.1.rc.3.tgz
342
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.2.dsh.0.2.1.rc.3/SHA256SUMS
357
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.4.dsh.0.2.1.rc.3/dsh-github-copilot-0.1.0-alpha.4.dsh.0.2.1.rc.3.tgz
358
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.4.dsh.0.2.1.rc.3/SHA256SUMS
343
359
  sha256sum --check SHA256SUMS
344
360
  ```
345
361
 
346
362
  ```powershell
347
363
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
348
- $actual = (Get-FileHash .\dsh-github-copilot-0.1.0-alpha.2.dsh.0.2.1.rc.3.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
364
+ $actual = (Get-FileHash .\dsh-github-copilot-0.1.0-alpha.4.dsh.0.2.1.rc.3.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
349
365
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
350
366
  ```
351
367
 
@@ -8,13 +8,13 @@
8
8
  },
9
9
  "package": {
10
10
  "name": "dsh-github-copilot",
11
- "version": "0.1.0-alpha.2.dsh.0.2.1.rc.3"
11
+ "version": "0.1.0-alpha.4.dsh.0.2.1.rc.3"
12
12
  },
13
13
  "releaseLines": [
14
14
  { "core": "0.2.0-rc.2", "version": "0.4.2-alpha.15", "status": "published" },
15
15
  { "core": "0.2.1-alpha.4", "version": "0.4.2-alpha.16", "status": "published" },
16
16
  { "core": "0.2.1-alpha.5", "version": "0.1.0-alpha.2.dsh.0.2.1.alpha.5", "status": "published" },
17
- { "core": "0.2.1-rc.3", "version": "0.1.0-alpha.2.dsh.0.2.1.rc.3", "status": "pending" }
17
+ { "core": "0.2.1-rc.3", "version": "0.1.0-alpha.4.dsh.0.2.1.rc.3", "status": "pending" }
18
18
  ],
19
19
  "evidence": {
20
20
  "kind": "source-and-synthetic-test-inventory",
@@ -1,6 +1,8 @@
1
1
  # Image input compatibility
2
2
 
3
- Target: official DSH / Windows Desktop `0.2.0-rc.2`. Plugin-only.
3
+ Current source target: official DSH `0.2.1-rc.3`. Plugin-only. Historical
4
+ rc.2 delivery evidence below does not qualify the current source or a loaded
5
+ Desktop.
4
6
 
5
7
  ## Current behavior
6
8
 
@@ -27,6 +29,33 @@ not prove universal format acceptance. The plugin neither invents a list nor
27
29
  converts images itself. Native error/finish behavior, historical attachments,
28
30
  turn freezing and existing cancellation/retry policy stay unchanged.
29
31
 
32
+ ### Admission error details
33
+
34
+ The standard native `INVALID_REQUEST` failure message retains the diagnostic
35
+ code and now explains why the request was blocked before selected-model wire
36
+ dispatch. It includes a bounded, content-free JSON diagnostic: selected real
37
+ model ID (safe identifiers only, otherwise `unavailable`), normalized projected
38
+ MIME (invalid/missing/overlong values become `unavailable`), up to eight explicit
39
+ allowed MIME types with total count and truncation flag, projected message/block
40
+ zero-based indices, allowlisted projected role, and this plugin build's version.
41
+ An absent allowed list is `null`, not an empty list or universal format proof.
42
+ These positions refer to the native projected transcript, not durable history
43
+ IDs or an attachment identity. Only the first rejected image is reported.
44
+
45
+ This uses the existing error/finish presentation, not a new Remote, collector,
46
+ diagnostic store, or history event. Image bytes, URLs, paths, prompt text and
47
+ credentials are never included. Native handling of failure messages is unchanged;
48
+ this is not a claim that native failures are never retained. The version describes
49
+ the build producing this error, not the plugin loaded during an earlier incident.
50
+ Earlier Auto assessment traffic, if any, is not a selected-model dispatch.
51
+
52
+ History images can cause this failure on a text-only continuation. The error
53
+ offers explicit next-turn choices: select a model whose current advertised formats
54
+ accept the projection, or start a separate text-only Session without those
55
+ historical images. Missing MIME needs investigation using the diagnostic, not
56
+ guessing from filenames. There is no automatic retry, model switch, image removal,
57
+ conversion, or history mutation.
58
+
30
59
  ## Evidence layers and recovery limits
31
60
 
32
61
  Source filename, durable attachment MIME and outgoing projected MIME are
@@ -40,6 +69,13 @@ Auto filtering from durable MIME can reject a model whose native projection
40
69
  would be accepted; candidate-specific projection would require another public
41
70
  contract and reviewed tests.
42
71
 
72
+ Auto currently filters general image capability, not the final candidate-specific
73
+ projected MIME. A vision-eligible selection may therefore still fail the final
74
+ format gate. This diagnostic improvement does not close that capability gap.
75
+ The current public seam used here receives projection only in `inspectRequest`,
76
+ after model selection. Do not pre-project candidates through private APIs or
77
+ replace this fail-closed gate with inferred durable-format filtering.
78
+
43
79
  The current fix diagnoses explicit incompatibility, not every provider 400.
44
80
  When advertised restrictions and outgoing projection agree but the endpoint
45
81
  rejects it, retain the native error. Do not invent capability corrections,
@@ -49,13 +85,24 @@ outgoing visibility through Core offload; it is not a supplier JSON threshold.
49
85
 
50
86
  ## Verification
51
87
 
88
+ `node --test tests/scripts/image-input-admission.test.mjs` exercises the real
89
+ TypeScript admission helper using Node's built-in runner: historical user/tool
90
+ projections, missing/invalid/unsupported formats, absent versus empty restrictions,
91
+ bounded redacted diagnostics, no private-content reads and no input mutation.
92
+ It does not exercise the native adapter or Client.
93
+ `tests/preview-route.spec.ts` covers the native failure/finish surface and no
94
+ selected-model wire on rejection; `tests/auto-model-routing.spec.ts` preserves the
95
+ explicit separation between Auto vision eligibility and final projected-format
96
+ admission. These require the unchanged pinned dependencies. Passing the
97
+ dependency-free helper tests is not a substitute for those integration gates.
98
+
52
99
  Historical tool-image continuation first reproduced the old missed-image
53
100
  requirement. Regressions now cover all Auto preferences, historical user/tool
54
101
  images, no vision candidate and native WebP-to-PNG projection against explicit
55
102
  PNG/JPEG restrictions. A mismatch emits native `finish(error)` with zero model
56
103
  requests.
57
104
 
58
- The [delivery CI](https://github.com/cloga/dsh-github-copilot/actions/runs/36966798814)
105
+ The historical [delivery CI](https://github.com/cloga/dsh-github-copilot/actions/runs/36966798814)
59
106
  passed exact unchanged rc.2 Windows/Linux source and published-adapter fixtures,
60
107
  full verification and archive gates. Local synthetic transport demonstrates
61
108
  admission/ownership, not live endpoint acceptance or a particular Desktop's
@@ -78,6 +78,22 @@ empty summary/content, no encrypted content and no unknown fields. Durable
78
78
  history, public summaries, opaque bytes, nested IDs, phase and `call_id` pairing
79
79
  stay unchanged.
80
80
 
81
+ The locked SDK/Core synthetic regressions require a summary-only reasoning
82
+ item from an SSE response to be rejected on the following turn before a second
83
+ Responses request is dispatched, while the prior assistant history remains
84
+ byte-for-byte unchanged. The accepted replay control requires opaque encrypted
85
+ bytes and paired `call_id` values to survive normalization unchanged. These
86
+ fixtures must pass against the current lockfile before acceptance; their presence
87
+ alone does not prove execution or live provider acceptance.
88
+
89
+ When this plugin rejects a replay shape locally, the existing native
90
+ `INVALID_REQUEST` message may include a bounded structure diagnosis: a fixed
91
+ reason code, zero-based input position, allowlisted item type/status and
92
+ booleans indicating whether selected fields exist. It never includes field
93
+ values, IDs, summaries, arguments, results, unknown discriminators or opaque
94
+ bytes. This identifies the structural refusal, not a specific supplier-rejected
95
+ item, and does not alter the history or authorize another replay shape.
96
+
81
97
  The source-checkout follow-up for #279 adds bounded structure evidence to an
82
98
  exact verified scope rejection: total items, direct ID fields, reference items,
83
99
  encrypted reasoning items, unrecognized items, `previous_response_id`/`store`
package/lib/client.js CHANGED
@@ -6338,7 +6338,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6338
6338
  };
6339
6339
  //#endregion
6340
6340
  //#region package.json
6341
- var version = "0.1.0-alpha.2.dsh.0.2.1.rc.3";
6341
+ var version = "0.1.0-alpha.4.dsh.0.2.1.rc.3";
6342
6342
  //#endregion
6343
6343
  //#region lib/types/diagnostics-client.js
6344
6344
  let owner;
package/lib/index.js CHANGED
@@ -582,7 +582,7 @@ const result$1 = strictRemoteCodec("dsh-github-copilot#DiagnosticsView", Diagnos
582
582
  var package_default = {
583
583
  name: "dsh-github-copilot",
584
584
  description: "DSH companion for GitHub Copilot sign-in, account-aware model profiles, tool compatibility, and provider-hosted search.",
585
- version: "0.1.0-alpha.2.dsh.0.2.1.rc.3",
585
+ version: "0.1.0-alpha.4.dsh.0.2.1.rc.3",
586
586
  releaseNotes: "CHANGELOG.md",
587
587
  publishConfig: {
588
588
  "access": "public",
@@ -4068,6 +4068,56 @@ function requestBodyEvidence(body, protocol) {
4068
4068
  }
4069
4069
  //#endregion
4070
4070
  //#region lib/types/responses-replay-compat.js
4071
+ const safeItemTypes = /* @__PURE__ */ new Set([
4072
+ "message",
4073
+ "reasoning",
4074
+ "function_call",
4075
+ "function_call_output",
4076
+ "item_reference"
4077
+ ]);
4078
+ const safeItemStatuses = /* @__PURE__ */ new Set([
4079
+ "completed",
4080
+ "in_progress",
4081
+ "incomplete",
4082
+ "failed",
4083
+ "cancelled"
4084
+ ]);
4085
+ function safeField(value, key) {
4086
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
4087
+ return descriptor === void 0 ? { present: false } : "value" in descriptor ? {
4088
+ present: true,
4089
+ value: descriptor.value
4090
+ } : { present: true };
4091
+ }
4092
+ function replayStructure(reason, inputIndex, item, hasPreviousResponseId = false) {
4093
+ const type = item === void 0 ? void 0 : safeField(item, "type");
4094
+ const status = item === void 0 ? void 0 : safeField(item, "status");
4095
+ const itemType = type?.present && typeof type.value === "string" && safeItemTypes.has(type.value) ? type.value : "unknown";
4096
+ const itemStatus = status?.present && typeof status.value === "string" && safeItemStatuses.has(status.value) ? status.value : status?.present ? "unknown" : "absent";
4097
+ return {
4098
+ reason,
4099
+ ...inputIndex === void 0 ? {} : { inputIndex },
4100
+ ...item === void 0 ? {} : {
4101
+ itemType,
4102
+ itemStatus
4103
+ },
4104
+ hasId: item === void 0 ? false : safeField(item, "id").present,
4105
+ hasType: item === void 0 ? false : safeField(item, "type").present,
4106
+ hasStatus: item === void 0 ? false : safeField(item, "status").present,
4107
+ hasRole: item === void 0 ? false : safeField(item, "role").present,
4108
+ hasEncryptedContent: item === void 0 ? false : safeField(item, "encrypted_content").present,
4109
+ hasSummary: item === void 0 ? false : safeField(item, "summary").present,
4110
+ hasContent: item === void 0 ? false : safeField(item, "content").present,
4111
+ hasCallId: item === void 0 ? false : safeField(item, "call_id").present,
4112
+ hasName: item === void 0 ? false : safeField(item, "name").present,
4113
+ hasArguments: item === void 0 ? false : safeField(item, "arguments").present,
4114
+ hasOutput: item === void 0 ? false : safeField(item, "output").present,
4115
+ hasPreviousResponseId
4116
+ };
4117
+ }
4118
+ function formatReplayStructure(structure) {
4119
+ return `Replay structure: reason=${structure.reason}; inputIndex=${structure.inputIndex ?? "unavailable"}; itemType=${structure.itemType ?? "unavailable"}; itemStatus=${structure.itemStatus ?? "unavailable"}; hasId=${structure.hasId}; hasType=${structure.hasType}; hasStatus=${structure.hasStatus}; hasRole=${structure.hasRole}; hasEncryptedContent=${structure.hasEncryptedContent}; hasSummary=${structure.hasSummary}; hasContent=${structure.hasContent}; hasCallId=${structure.hasCallId}; hasName=${structure.hasName}; hasArguments=${structure.hasArguments}; hasOutput=${structure.hasOutput}; hasPreviousResponseId=${structure.hasPreviousResponseId}.`;
4120
+ }
4071
4121
  const replayDiagnostics = {
4072
4122
  "scope-mismatch": "COPILOT_RESPONSES_REPLAY_SCOPE_MISMATCH: Copilot rejected history tied to another account or connection. Review Replay recovery options, or start a new conversation. Recovery requires consent; stored history is unchanged.",
4073
4123
  unsupported: "COPILOT_RESPONSES_REPLAY_UNSUPPORTED: Copilot Responses input cannot be replayed safely without connection-scoped references.",
@@ -4076,9 +4126,12 @@ const replayDiagnostics = {
4076
4126
  /** Fixed diagnostics and bounded counts only; never retain request or replay content. */
4077
4127
  var CopilotResponsesReplayError = class extends Error {
4078
4128
  dispatchEvidence;
4079
- constructor(reason = "unsupported", dispatch) {
4080
- super(replayDiagnostics[reason]);
4129
+ structureEvidence;
4130
+ constructor(reason = "unsupported", dispatch, structure) {
4131
+ const structureEvidence = structure === void 0 ? void 0 : formatReplayStructure(structure);
4132
+ super(`${replayDiagnostics[reason]}${structureEvidence === void 0 ? "" : ` ${structureEvidence}`}`);
4081
4133
  if (reason === "scope-mismatch" && dispatch !== void 0) this.dispatchEvidence = replayDispatchEvidence(dispatch);
4134
+ if (structureEvidence !== void 0) this.structureEvidence = structureEvidence;
4082
4135
  this.name = "CopilotResponsesReplayError";
4083
4136
  }
4084
4137
  };
@@ -4133,14 +4186,16 @@ function emptyReasoningShell(item) {
4133
4186
  "encrypted_content"
4134
4187
  ].includes(key));
4135
4188
  }
4136
- function normalizeItem(item) {
4189
+ function normalizeItem(item, inputIndex) {
4137
4190
  if (!isRecord$1(item)) throw new CopilotResponsesReplayError("invalid-payload");
4138
- if (item.type === "item_reference") throw new CopilotResponsesReplayError();
4191
+ const itemType = item.type;
4192
+ if (itemType === "item_reference") throw new CopilotResponsesReplayError("unsupported", void 0, replayStructure("ITEM_REFERENCE_ONLY", inputIndex, item));
4139
4193
  if (emptyReasoningShell(item)) return void 0;
4140
- if ((item.type === "message" || item.type === void 0) && (item.role === "user" || item.role === "system" || item.role === "developer")) return item;
4194
+ if ((itemType === "message" || itemType === void 0) && (item.role === "user" || item.role === "system" || item.role === "developer")) return item;
4141
4195
  if (!Object.hasOwn(item, "id") || item.id === void 0) return item;
4142
4196
  if (!nonemptyString(item.id)) throw new CopilotResponsesReplayError("invalid-payload");
4143
- 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();
4197
+ const itemStatus = item.status;
4198
+ if (!((itemStatus === void 0 || itemStatus === "completed") && (itemType === "message" && item.role === "assistant" && Array.isArray(item.content) || itemType === "function_call" && nonemptyString(item.call_id) && nonemptyString(item.name) && typeof item.arguments === "string" || itemType === "reasoning" && nonemptyString(item.encrypted_content)))) throw new CopilotResponsesReplayError("unsupported", void 0, replayStructure(itemStatus !== void 0 && itemStatus !== "completed" ? "INCOMPLETE_ITEM" : itemType === "reasoning" && !nonemptyString(item.encrypted_content) ? "REASONING_WITHOUT_ENCRYPTED_CONTENT" : "INCOMPLETE_ITEM", inputIndex, item));
4144
4199
  const normalized = { ...item };
4145
4200
  delete normalized.id;
4146
4201
  return normalized;
@@ -4149,12 +4204,17 @@ function normalizeItem(item) {
4149
4204
  function normalizeCopilotResponsesPayload(payload) {
4150
4205
  try {
4151
4206
  if (!isRecord$1(payload) || typeof payload.input !== "string" && !Array.isArray(payload.input)) throw new CopilotResponsesReplayError("invalid-payload");
4152
- 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");
4207
+ const previousResponseId = payload.previous_response_id;
4208
+ if (previousResponseId !== void 0 && previousResponseId !== null && previousResponseId !== "") {
4209
+ if (typeof previousResponseId === "string") throw new CopilotResponsesReplayError("unsupported", void 0, replayStructure("PREVIOUS_RESPONSE_REFERENCE", void 0, void 0, true));
4210
+ throw new CopilotResponsesReplayError("invalid-payload");
4211
+ }
4153
4212
  if (typeof payload.input === "string") return payload;
4154
4213
  let changed = false;
4155
4214
  const input = [];
4156
- for (const item of payload.input) {
4157
- const normalized = normalizeItem(item);
4215
+ for (let index = 0; index < payload.input.length; index++) {
4216
+ const item = payload.input[index];
4217
+ const normalized = normalizeItem(item, index);
4158
4218
  changed ||= normalized !== item;
4159
4219
  if (normalized !== void 0) input.push(normalized);
4160
4220
  }
@@ -4226,7 +4286,7 @@ var ResponsesRetryReplay = class {
4226
4286
  "reasoning",
4227
4287
  "message",
4228
4288
  "function_call"
4229
- ].includes(String(original.type)) || normalizeItem(original) === original) throw error;
4289
+ ].includes(String(original.type)) || normalizeItem(original, index) === original) throw error;
4230
4290
  if (item.type === "item_reference") {
4231
4291
  if (Object.keys(item).length !== 2) throw error;
4232
4292
  } else if (item.type !== original.type || Object.keys(item).length >= Object.keys(original).length || Object.entries(item).some(([key, value]) => !Object.hasOwn(original, key) || cacheBytes(value) !== cacheBytes(original[key]))) throw error;
@@ -13710,17 +13770,47 @@ function installAutoModelRouting(ctx, dependencies) {
13710
13770
  }
13711
13771
  //#endregion
13712
13772
  //#region lib/types/image-input-admission.js
13773
+ const imageMime = /^image\/[a-z0-9!#$%&'*+.^_`|~-]+$/iu;
13774
+ function diagnosticMime(value) {
13775
+ return typeof value === "string" && value.length <= 128 && imageMime.test(value) ? value.toLowerCase() : "unavailable";
13776
+ }
13713
13777
  /** Inspect native projected images, never infer wire formats from durable filenames. */
13714
13778
  function imageInputFailure(model, messages) {
13715
- for (const message of messages) {
13779
+ for (const [messageIndex, message] of messages.entries()) {
13716
13780
  if (typeof message !== "object" || message === null || !("content" in message) || !Array.isArray(message.content)) continue;
13717
13781
  const content = message.content;
13718
- for (const block of content) {
13782
+ for (const [blockIndex, block] of content.entries()) {
13719
13783
  if (typeof block !== "object" || block === null || !("type" in block) || block.type !== "image") continue;
13720
- if (!model.input.includes("image")) return "COPILOT_IMAGE_INPUT_UNSUPPORTED";
13721
- if (!("mimeType" in block) || typeof block.mimeType !== "string" || !/^image\/[a-z0-9!#$%&'*+.^_`|~-]+$/iu.test(block.mimeType)) return "COPILOT_IMAGE_MEDIA_TYPE_UNAVAILABLE";
13784
+ const mimeType = "mimeType" in block ? block.mimeType : void 0;
13722
13785
  const allowed = model.evidence.visionMediaTypes;
13723
- if (allowed !== void 0 && !allowed.includes(block.mimeType.toLowerCase())) return "COPILOT_IMAGE_MEDIA_TYPE_UNSUPPORTED";
13786
+ let code;
13787
+ if (!model.input.includes("image")) code = "COPILOT_IMAGE_INPUT_UNSUPPORTED";
13788
+ else if (typeof mimeType !== "string" || !imageMime.test(mimeType)) code = "COPILOT_IMAGE_MEDIA_TYPE_UNAVAILABLE";
13789
+ else if (allowed !== void 0 && !allowed.includes(mimeType.toLowerCase())) code = "COPILOT_IMAGE_MEDIA_TYPE_UNSUPPORTED";
13790
+ else continue;
13791
+ const role = "role" in message && typeof message.role === "string" && [
13792
+ "user",
13793
+ "assistant",
13794
+ "system",
13795
+ "tool",
13796
+ "toolResult"
13797
+ ].includes(message.role) ? message.role : "unknown";
13798
+ const diagnostic = {
13799
+ model: model.id.length <= 200 && /^[a-z0-9][a-z0-9._:-]*$/iu.test(model.id) ? model.id : "unavailable",
13800
+ projectedMime: diagnosticMime(mimeType),
13801
+ allowedMimeTypes: allowed === void 0 ? null : allowed.slice(0, 8).map(diagnosticMime),
13802
+ allowedMimeTypeCount: allowed?.length ?? null,
13803
+ allowedMimeTypesTruncated: allowed !== void 0 && allowed.length > 8,
13804
+ messageIndex,
13805
+ blockIndex,
13806
+ role,
13807
+ pluginVersion: package_default.version
13808
+ };
13809
+ return {
13810
+ code,
13811
+ diagnostic,
13812
+ message: `${code}: Request blocked before selected-model dispatch. ${code === "COPILOT_IMAGE_INPUT_UNSUPPORTED" ? "The selected model does not admit image input." : code === "COPILOT_IMAGE_MEDIA_TYPE_UNAVAILABLE" ? "The native projected image MIME is missing or invalid; format compatibility cannot be verified." : "The native projected image MIME is outside the selected model's explicit account-advertised formats."} History images also count, even on a text-only continuation. Auto checks general image capability, not candidate-specific projected formats. For a subsequent turn, explicitly choose a model whose advertised formats accept this projection, or start a separate text-only Session without the old images. If MIME is unavailable, report this diagnostic; filenames do not establish projected format. No automatic retry or model switch was performed. Projected transcript positions are zero-based, not durable history IDs. ${JSON.stringify(diagnostic)}`
13813
+ };
13724
13814
  }
13725
13815
  }
13726
13816
  }
@@ -14210,7 +14300,7 @@ var PreviewAdapter = class extends PiAiAdapter {
14210
14300
  if (signal.aborted) throw abortFailure(signal);
14211
14301
  const imageFailure = imageInputFailure(lease.descriptor, context.messages);
14212
14302
  if (imageFailure !== void 0) {
14213
- requestFailure = new LlmError(imageFailure, "INVALID_REQUEST");
14303
+ requestFailure = new LlmError(imageFailure.message, "INVALID_REQUEST");
14214
14304
  throw requestFailure;
14215
14305
  }
14216
14306
  const calculated = calculateRequestBudget(lease.descriptor, nativeOptions?.maxTokens, policy);
@@ -1,5 +1,20 @@
1
1
  import type { AccountModelDescriptor } from './account-model-catalog.ts';
2
- export type ImageInputFailure = 'COPILOT_IMAGE_INPUT_UNSUPPORTED' | 'COPILOT_IMAGE_MEDIA_TYPE_UNAVAILABLE' | 'COPILOT_IMAGE_MEDIA_TYPE_UNSUPPORTED';
2
+ export type ImageInputFailureCode = 'COPILOT_IMAGE_INPUT_UNSUPPORTED' | 'COPILOT_IMAGE_MEDIA_TYPE_UNAVAILABLE' | 'COPILOT_IMAGE_MEDIA_TYPE_UNSUPPORTED';
3
+ export interface ImageInputFailure {
4
+ readonly code: ImageInputFailureCode;
5
+ readonly message: string;
6
+ readonly diagnostic: {
7
+ readonly model: string;
8
+ readonly projectedMime: string;
9
+ readonly allowedMimeTypes: readonly string[] | null;
10
+ readonly allowedMimeTypeCount: number | null;
11
+ readonly allowedMimeTypesTruncated: boolean;
12
+ readonly messageIndex: number;
13
+ readonly blockIndex: number;
14
+ readonly role: string;
15
+ readonly pluginVersion: string;
16
+ };
17
+ }
3
18
  /** Inspect native projected images, never infer wire formats from durable filenames. */
4
19
  export declare function imageInputFailure(model: AccountModelDescriptor, messages: readonly unknown[]): ImageInputFailure | undefined;
5
20
  //# sourceMappingURL=image-input-admission.d.ts.map
@@ -1,4 +1,23 @@
1
1
  type ReplayFailure = 'scope-mismatch' | 'unsupported' | 'invalid-payload';
2
+ type ReplayStructureReason = 'REASONING_WITHOUT_ENCRYPTED_CONTENT' | 'INCOMPLETE_ITEM' | 'ITEM_REFERENCE_ONLY' | 'PREVIOUS_RESPONSE_REFERENCE';
3
+ interface ReplayStructure {
4
+ readonly reason: ReplayStructureReason;
5
+ readonly inputIndex?: number;
6
+ readonly itemType?: string;
7
+ readonly itemStatus?: string;
8
+ readonly hasId: boolean;
9
+ readonly hasType: boolean;
10
+ readonly hasStatus: boolean;
11
+ readonly hasRole: boolean;
12
+ readonly hasEncryptedContent: boolean;
13
+ readonly hasSummary: boolean;
14
+ readonly hasContent: boolean;
15
+ readonly hasCallId: boolean;
16
+ readonly hasName: boolean;
17
+ readonly hasArguments: boolean;
18
+ readonly hasOutput: boolean;
19
+ readonly hasPreviousResponseId: boolean;
20
+ }
2
21
  interface ReplayDispatch {
3
22
  readonly body?: string;
4
23
  readonly sessionHeader?: boolean;
@@ -7,7 +26,8 @@ interface ReplayDispatch {
7
26
  /** Fixed diagnostics and bounded counts only; never retain request or replay content. */
8
27
  export declare class CopilotResponsesReplayError extends Error {
9
28
  readonly dispatchEvidence?: string;
10
- constructor(reason?: ReplayFailure, dispatch?: ReplayDispatch);
29
+ readonly structureEvidence?: string;
30
+ constructor(reason?: ReplayFailure, dispatch?: ReplayDispatch, structure?: ReplayStructure);
11
31
  }
12
32
  /** Normalize only the outgoing managed Responses payload, never stored history/context. */
13
33
  export declare function normalizeCopilotResponsesPayload(payload: unknown): unknown;
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.1.0-alpha.2.dsh.0.2.1.rc.3",
4
+ "version": "0.1.0-alpha.4.dsh.0.2.1.rc.3",
5
5
  "releaseNotes": "CHANGELOG.md",
6
6
  "publishConfig": {
7
7
  "access": "public",