dsh-github-copilot 0.4.0-alpha.112 → 0.4.0-alpha.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +7 -0
- package/CHANGELOG.md +7 -0
- package/README.md +8 -6
- package/README.zh.md +8 -6
- package/deployment-baseline.json +6 -1
- package/docs/copilot-compaction.md +7 -0
- package/docs/session-continuation.md +20 -5
- package/lib/index.js +71 -72
- package/lib/types/session-continuation-host.d.ts +1 -1
- package/lib/types/session-continuation.d.ts +5 -4
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -258,6 +258,13 @@ Never say GPT-6/search works merely because settings, typecheck or a package imp
|
|
|
258
258
|
|
|
259
259
|
## Changing capabilities
|
|
260
260
|
|
|
261
|
+
Continuation processing is reasoning-only: never recursively traverse or serialize
|
|
262
|
+
ordinary payload content to impose a whole-request limit. Preserve bounded
|
|
263
|
+
top-level item/ciphertext work, yielding cancellation and turn-revocation checks,
|
|
264
|
+
atomic baseline initialization and awaited final-byte retry evidence. Native token
|
|
265
|
+
admission and automatic-compaction transactions/rebuild stay independent; never
|
|
266
|
+
classify a continuation processing bound as context overflow.
|
|
267
|
+
|
|
261
268
|
Context evidence and replay recovery use the public full-width `conversation.input.dock`
|
|
262
269
|
above the composer, with shared native secondary typography. Do not restore long
|
|
263
270
|
notices to the nonwrapping statistics row or mutate its parent DOM. Scope errors
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0-alpha.113 (prepared)
|
|
4
|
+
|
|
5
|
+
- Remove the continuation filter's whole-request 16 MiB refusal and recursive payload traversal. Large ordinary tool/image content is preserved; old encrypted reasoning is processed independently (#326).
|
|
6
|
+
- Bound reasoning count and ciphertext work, yield during hashing, and recheck request/turn cancellation before atomically establishing the baseline. Await filtering before exact native 408 retry-byte bookkeeping.
|
|
7
|
+
- Verify first-step and continuing-step native automatic compaction with Auto, durable in-memory summary replacement, fresh request rebuild and large historical reasoning. Preserve native token admission, disabled-auto/missing-engine behavior, summary failures and retry bounds; do not misclassify processing bytes as token pressure.
|
|
8
|
+
- No Core changes, automatic sends, live-history replay, installation or restart.
|
|
9
|
+
|
|
3
10
|
## 0.4.0-alpha.112 (prepared)
|
|
4
11
|
|
|
5
12
|
- Back the shared Models/Chat account dropdown's translucent native menu token with opaque Canvas. Underlying settings and quota text no longer bleed through in dark mode (#324).
|
package/README.md
CHANGED
|
@@ -17,11 +17,13 @@ Identity display accepts GitHub Enterprise Managed User names, including their u
|
|
|
17
17
|
|
|
18
18
|
Models and Chat share an opaque, theme-aware account dropdown; translucent native menu tokens cannot reveal underlying controls or quota text. Both use restrained dark elevation in light and dark mode.
|
|
19
19
|
|
|
20
|
+
Visible-history continuation no longer rejects entire requests at 16 MiB. It processes only bounded encrypted reasoning, yields to cancellation, and preserves ordinary tool/image content. Real token pressure still uses the enabled native automatic-compaction engine and request rebuild; processing limits are not context overflow. See [continuation boundaries](./docs/session-continuation.md).
|
|
21
|
+
|
|
20
22
|
Visible Models and Credits resolve missing names for saved accounts without activating them. Verified names remain cached for the Host lifetime, including inactive accounts; the ten-minute freshness interval governs revalidation, not name display. Credential changes, removal and failed identity verification invalidate names. Shared per-account requests and a thirty-second failure cooldown remain; explicit refresh retries immediately. Names do not prove authorization or model access. See [account lifecycle](./docs/copilot-accounts.md).
|
|
21
23
|
|
|
22
24
|
Adding an account now keeps the device-authorization link, selectable URL, one-time code, Copy code action and Cancel together while authorization is pending. After GitHub authorizes, identity and model verification are shown as a separate phase. Adding never changes the global default; use the existing explicit **Switch** action when ready. Technical diagnostics are secondary, and account/turn identity fallbacks never expose opaque account IDs or infer historical identity from today's settings.
|
|
23
25
|
|
|
24
|
-
**Source candidate: `0.4.0-alpha.
|
|
26
|
+
**Source candidate: `0.4.0-alpha.113` (unreleased). Supported host: official DSH / Windows Desktop `0.2.0-rc.2`.** Earlier DSH pins are historical evidence, not supported installation targets. Publication, profile installation and the version loaded by a running Host are separate states. The versioned commands below are for this candidate after publication, not evidence that its assets exist.
|
|
25
27
|
|
|
26
28
|
## What you can do
|
|
27
29
|
|
|
@@ -61,10 +63,10 @@ Supply any launcher patches with repeated `--patch /absolute/file`. Require `sup
|
|
|
61
63
|
For a **standalone named profile**:
|
|
62
64
|
|
|
63
65
|
```sh
|
|
64
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
66
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.113/dsh-github-copilot-0.4.0-alpha.113.tgz
|
|
65
67
|
```
|
|
66
68
|
|
|
67
|
-
For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.
|
|
69
|
+
For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.113` after publication. Official rc.2's **Desktop-bundled CLI** also supports reserved-profile plugin management; a global/generic `dsh` shim is not equivalent. Qualify the installed entry before use. See [Desktop CLI qualification](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2) and the distinct [standalone offline procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles). Neither path authorizes registry-policy bypass, peer patches or configuration deletion.
|
|
68
70
|
|
|
69
71
|
After an approved reload/restart:
|
|
70
72
|
|
|
@@ -218,14 +220,14 @@ Commit attribution uses `Assisted-by` with the actual tool, never the model prov
|
|
|
218
220
|
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.
|
|
219
221
|
|
|
220
222
|
```sh
|
|
221
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
222
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
223
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.113/dsh-github-copilot-0.4.0-alpha.113.tgz
|
|
224
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.113/SHA256SUMS
|
|
223
225
|
sha256sum --check SHA256SUMS
|
|
224
226
|
```
|
|
225
227
|
|
|
226
228
|
```powershell
|
|
227
229
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
228
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
230
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.113.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
229
231
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
230
232
|
```
|
|
231
233
|
|
package/README.zh.md
CHANGED
|
@@ -15,11 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
Models 和 Chat 共用不透明、随主题适配的账号下拉层;原生菜单 token 即使半透明,也不会透出底下的按钮或额度文字。明暗主题均使用克制的深色投影,不产生白色光晕。
|
|
17
17
|
|
|
18
|
+
可见历史续聊不再按整包 16 MiB 拒绝请求。过滤只对加密推理做有界、可取消的处理,普通工具输出和图片内容保持不变。真实 token 压力仍交给已启用的原生自动 compact 引擎,完成摘要后重建请求;处理工作量上限不会被误报为上下文溢出。参见[续聊边界](./docs/session-continuation.md)。
|
|
19
|
+
|
|
18
20
|
可见的 Models 和 Credits 会补齐已保存账号缺失的名称,不需要先激活账号。已验证名称在 Host 生命周期内缓存,未激活账号也会保留;十分钟是重新验证的间隔,不是名字的显示期限。凭据变更、账号移除及身份验证失败会使名称失效。同账号共享请求、失败冷却三十秒,显式刷新可立即重试。名称不能证明授权有效或模型可用。参见[账号生命周期](./docs/copilot-accounts.md)。
|
|
19
21
|
|
|
20
22
|
添加账号时,设备授权链接、可选择的网址、一次性授权码、复制授权码和取消操作会同时显示。GitHub 授权完成后,会单独显示身份与可用模型验证阶段。添加账号不会更改全局默认;准备好后仍需显式执行现有的**切换**操作。技术诊断收在次级折叠区;账号/历史 turn 缺少身份时不会暴露不透明账号 ID,也不会根据当前设置推断历史身份。
|
|
21
23
|
|
|
22
|
-
**源码候选版本:`0.4.0-alpha.
|
|
24
|
+
**源码候选版本:`0.4.0-alpha.113`(尚未发布)。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。** 较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。下方带版本的命令适用于候选版本发布后,不代表对应资产已经存在。
|
|
23
25
|
|
|
24
26
|
## 你可以做什么
|
|
25
27
|
|
|
@@ -59,10 +61,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
|
|
|
59
61
|
**独立具名 profile**:
|
|
60
62
|
|
|
61
63
|
```sh
|
|
62
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
64
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.113/dsh-github-copilot-0.4.0-alpha.113.tgz
|
|
63
65
|
```
|
|
64
66
|
|
|
65
|
-
**Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.
|
|
67
|
+
**Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.113`。官方 rc.2 **Desktop 随附的专属 CLI**也支持管理保留 profile;全局/普通 `dsh` shim 不等价。使用前核验实际安装入口,参见[Desktop CLI 核验](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2)及独立的[具名 profile 离线流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)。两种路径都不授权绕过包源政策、修改 peer 或删除配置。
|
|
66
68
|
|
|
67
69
|
经批准 reload/restart 后:
|
|
68
70
|
|
|
@@ -216,14 +218,14 @@ Agent 从 `node scripts/agent.mjs describe --json`、`doctor --json`及`plan <ta
|
|
|
216
218
|
GitHub Releases 和 npm 分发同一原始已校验 tarball。固定版本并核验 Release SHA-256 或 npm `dist.integrity`;不重打包不可变 Release、不移动/复用 tag。
|
|
217
219
|
|
|
218
220
|
```sh
|
|
219
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
220
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
221
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.113/dsh-github-copilot-0.4.0-alpha.113.tgz
|
|
222
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.113/SHA256SUMS
|
|
221
223
|
sha256sum --check SHA256SUMS
|
|
222
224
|
```
|
|
223
225
|
|
|
224
226
|
```powershell
|
|
225
227
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
226
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
228
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.113.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
227
229
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
228
230
|
```
|
|
229
231
|
|
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.113"
|
|
12
12
|
},
|
|
13
13
|
"evidence": {
|
|
14
14
|
"kind": "source-and-synthetic-test-inventory",
|
|
@@ -756,6 +756,7 @@
|
|
|
756
756
|
"liveEndpointAcceptance": "not-claimed",
|
|
757
757
|
"sourceMarkers": [
|
|
758
758
|
{"file": "src/session-continuation.ts", "marker": "class SessionContinuationTurn"},
|
|
759
|
+
{"file": "src/session-continuation.ts", "marker": "COPILOT_CONTINUATION_REASONING_WORK_LIMIT"},
|
|
759
760
|
{"file": "src/session-continuation-host.ts", "marker": "path: ['continuationDefaultHistory']"},
|
|
760
761
|
{"file": "src/session-continuation-host.ts", "marker": "COPILOT_CONTINUATION_TURN_BOUNDARY_UNAVAILABLE"},
|
|
761
762
|
{"file": "src/session-continuation-remote.ts", "marker": "authorizeNext"},
|
|
@@ -767,6 +768,10 @@
|
|
|
767
768
|
"tests": [
|
|
768
769
|
{"file": "tests/account-dropdown.spec.ts", "name": "supports arrows, Home, End and Escape without closing the containing Chat panel"},
|
|
769
770
|
{"file": "tests/session-continuation.spec.ts", "name": "continues A-B-B-A by omitting pre-turn reasoning while retaining new tool-loop reasoning"},
|
|
771
|
+
{"file": "tests/session-continuation.spec.ts", "name": "does not traverse or serialize ordinary contents when a request exceeds 16 MiB"},
|
|
772
|
+
{"file": "tests/session-continuation.spec.ts", "name": "omits large historical ciphertext without a whole-request byte cap"},
|
|
773
|
+
{"file": "tests/session-continuation.spec.ts", "name": "yields during ciphertext hashing and rejects revocation without establishing a baseline"},
|
|
774
|
+
{"file": "tests/fixtures/compaction-pressure-core.fixture.ts", "name": "compacts and rebuilds an Auto request with large historical continuation reasoning, continuing=%s"},
|
|
770
775
|
{"file": "tests/replay-recovery-ui.spec.ts", "name": "enables only persistent Session continuation after loss disclosure, without legacy authorization or sending"},
|
|
771
776
|
{"file": "tests/replay-recovery-ui.spec.ts", "name": "does not reauthorize an already enabled policy or change it when failure evidence expires"},
|
|
772
777
|
{"file": "tests/session-continuation.spec.ts", "name": "does not replay baseline ciphertext after its ID or embedded summary changes"},
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Managed Copilot compaction budgets
|
|
2
2
|
|
|
3
|
+
Visible-history continuation does not impose a whole-request byte cap. Its
|
|
4
|
+
reasoning-only cancellable work bounds are separate from native token admission;
|
|
5
|
+
neither ciphertext length nor `COPILOT_CONTINUATION_REASONING_WORK_LIMIT` is
|
|
6
|
+
classified as context overflow. Enabled native automatic compaction still owns
|
|
7
|
+
summary commit and request rebuild before continuation filters the new payload.
|
|
8
|
+
See [continuation safety and evidence](./session-continuation.md#public-integration-and-safety).
|
|
9
|
+
|
|
3
10
|
Tracking: [#146](https://github.com/cloga/dsh-github-copilot/issues/146). This is a plugin-only implementation; publication, loaded-runtime state and live-provider acceptance remain separate evidence.
|
|
4
11
|
|
|
5
12
|
## Why two protections are needed
|
|
@@ -67,21 +67,36 @@ published adapter/SDK's payload hook filters the normalized payload. Only
|
|
|
67
67
|
unbound requests and other protocols remain native. Cold mid-turn recovery
|
|
68
68
|
without a first-step boundary fails explicitly.
|
|
69
69
|
|
|
70
|
-
The
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
The filter scans at most 65536 top-level input items and 4096 reasoning items
|
|
71
|
+
(including duplicates). Only encrypted reasoning is hashed, with an aggregate
|
|
72
|
+
64 Mi UTF-16-code-unit processing bound per invocation and 64 Ki-code-unit chunks
|
|
73
|
+
that yield to cancellation and turn revocation. These are plugin work bounds,
|
|
74
|
+
not supplier byte/token limits. Ordinary tool output, images, nested content,
|
|
75
|
+
system and tool definitions are neither traversed nor serialized by this filter;
|
|
76
|
+
there is no whole-request 16 MiB continuation cap. Failed, cancelled, overlapping
|
|
77
|
+
or revoked processing cannot partially initialize the baseline. Unsupported
|
|
78
|
+
reasoning, malformed settings, missing boundaries and exhausted work bounds
|
|
79
|
+
produce named diagnostics, not partial filtering or guessed success.
|
|
80
|
+
Credentials, account entitlement and model capabilities remain independently guarded.
|
|
75
81
|
|
|
76
82
|
Native retry normalization retains raw reference-restoration evidence but records
|
|
77
83
|
the final filtered bytes for exact 408 matching. No new retry loop is introduced.
|
|
78
84
|
Input admission still precedes payload filtering: this is not an oversized-context,
|
|
79
85
|
quota, upload-timeout, compaction or native context-meter repair.
|
|
86
|
+
Actual token pressure still uses the initiating Agent's enabled native compaction
|
|
87
|
+
engine and bounded recovery: commit the native summary, rebuild the request, then
|
|
88
|
+
apply continuation. A continuation work-bound error is not relabeled as context
|
|
89
|
+
overflow. Disabled automatic compaction, missing engines, cancellation, failed or
|
|
90
|
+
insufficient summaries remain explicit limitations, not permission to trim history.
|
|
80
91
|
|
|
81
92
|
## Evidence limits
|
|
82
93
|
|
|
83
94
|
Synthetic account transitions, source/Host/UI tests and exact-source native
|
|
84
95
|
gateway/persistence fixtures are distinct from real supplier acceptance.
|
|
96
|
+
The native compaction fixture covers first-step overflow and continuing-step
|
|
97
|
+
prevention with Auto, a durable in-memory replacement, rebuilt visible history
|
|
98
|
+
and synthetic historical reasoning larger than 16 MiB. It uses an external-model
|
|
99
|
+
double; it does not prove real supplier acceptance or recovery of a live Session.
|
|
85
100
|
Publication, installation, loaded runtime and controlled live A-B-B-A success
|
|
86
101
|
must be reported separately. Enabling this product mode is not authorized by
|
|
87
102
|
implementing it; live existing Sessions still require explicit loss consent.
|
package/lib/index.js
CHANGED
|
@@ -19,6 +19,7 @@ import { AsyncLocalStorage } from "node:async_hooks";
|
|
|
19
19
|
import { channel } from "node:diagnostics_channel";
|
|
20
20
|
import * as dshLlm from "@deepseek-ai/dsh-llm";
|
|
21
21
|
import { CONTEXT_WINDOW_EXCEEDED_CODE, LlmError, ReasoningEffortId, attributionHeaders, boundContextSummary, callConfigEquals, contentHasImage, createUserMessage, isAgentLoopRequest, resolveImageAttachmentAccess, resolveRetryPolicy } from "@deepseek-ai/dsh-llm";
|
|
22
|
+
import { setImmediate } from "node:timers/promises";
|
|
22
23
|
import { Config as Config$1, PiAiAdapter } from "@deepseek-ai/dsh-llm-pi-ai";
|
|
23
24
|
import { estimateContextTokens, estimateMessageTokens } from "@earendil-works/pi-ai/utils/estimate";
|
|
24
25
|
//#region lib/types/dual-model-host.js
|
|
@@ -2395,22 +2396,26 @@ var ResponsesRetryReplay = class {
|
|
|
2395
2396
|
normalized = JSON.parse(eligible.normalized);
|
|
2396
2397
|
reused = true;
|
|
2397
2398
|
}
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2399
|
+
const complete = (finalPayload) => {
|
|
2400
|
+
if (this.disposed || signal?.aborted || finished) throw new CopilotResponsesReplayError();
|
|
2401
|
+
payloadBytes = cacheBytes(finalPayload);
|
|
2402
|
+
candidate = signal === void 0 || !sessionId || !modelId || contextBytes === void 0 || rawBytes === void 0 || payloadBytes === void 0 ? void 0 : {
|
|
2403
|
+
raw: JSON.parse(rawBytes),
|
|
2404
|
+
normalized: payloadBytes,
|
|
2405
|
+
context: contextBytes,
|
|
2406
|
+
signal,
|
|
2407
|
+
sessionId,
|
|
2408
|
+
modelId,
|
|
2409
|
+
at: Date.now()
|
|
2410
|
+
};
|
|
2411
|
+
if (reused && eligible) candidate = {
|
|
2412
|
+
...eligible,
|
|
2413
|
+
at: Date.now()
|
|
2414
|
+
};
|
|
2415
|
+
return finalPayload;
|
|
2412
2416
|
};
|
|
2413
|
-
|
|
2417
|
+
const transformed = transform === void 0 ? normalized : transform(normalized);
|
|
2418
|
+
return transformed instanceof Promise ? transformed.then(complete) : complete(transformed);
|
|
2414
2419
|
},
|
|
2415
2420
|
observe: (body, status) => {
|
|
2416
2421
|
observed = true;
|
|
@@ -2896,9 +2901,9 @@ function createAccountProvider(descriptors, guard, baseURL) {
|
|
|
2896
2901
|
if (lease.signal.aborted || options.signal?.aborted) throw new Error("COPILOT_MANAGED_ABORTED");
|
|
2897
2902
|
try {
|
|
2898
2903
|
const effective = replacement === void 0 ? payload : replacement;
|
|
2899
|
-
if (retry !== void 0) return retry.normalize(effective, guard.recoverReplay);
|
|
2904
|
+
if (retry !== void 0) return await retry.normalize(effective, guard.recoverReplay);
|
|
2900
2905
|
const normalized = normalizeCopilotResponsesPayload(effective);
|
|
2901
|
-
return guard.recoverReplay === void 0 ? normalized : guard.recoverReplay(normalized);
|
|
2906
|
+
return guard.recoverReplay === void 0 ? normalized : await guard.recoverReplay(normalized);
|
|
2902
2907
|
} catch (error) {
|
|
2903
2908
|
if (error instanceof CopilotResponsesReplayError) reportReplayFailure(error);
|
|
2904
2909
|
throw error;
|
|
@@ -2993,7 +2998,7 @@ function createAccountProvider(descriptors, guard, baseURL) {
|
|
|
2993
2998
|
var package_default = {
|
|
2994
2999
|
name: "dsh-github-copilot",
|
|
2995
3000
|
description: "DSH companion for GitHub Copilot sign-in, account-aware model profiles, tool compatibility, and provider-hosted search.",
|
|
2996
|
-
version: "0.4.0-alpha.
|
|
3001
|
+
version: "0.4.0-alpha.113",
|
|
2997
3002
|
publishConfig: {
|
|
2998
3003
|
"access": "public",
|
|
2999
3004
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -9120,71 +9125,65 @@ function installReplayRecovery(ctx, proof) {
|
|
|
9120
9125
|
//#region lib/types/session-continuation.js
|
|
9121
9126
|
const SESSION_CONTINUATION_LIMITS = Object.freeze({
|
|
9122
9127
|
items: 4096,
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9128
|
+
inputItems: 65536,
|
|
9129
|
+
ciphertextCodeUnits: 67108864,
|
|
9130
|
+
chunkCodeUnits: 65536
|
|
9126
9131
|
});
|
|
9127
9132
|
function record$8(value) {
|
|
9128
9133
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9129
9134
|
}
|
|
9130
|
-
function fingerprint(item) {
|
|
9131
|
-
if (!record$8(item)) throw new Error("COPILOT_CONTINUATION_INVALID_PAYLOAD");
|
|
9132
|
-
if (item.type !== "reasoning") return void 0;
|
|
9133
|
-
if (typeof item.encrypted_content !== "string" || !item.encrypted_content || item.status !== void 0 && item.status !== "completed") throw new Error("COPILOT_CONTINUATION_UNSUPPORTED_REASONING");
|
|
9134
|
-
return createHash("sha256").update(item.encrypted_content).digest("hex");
|
|
9135
|
-
}
|
|
9136
9135
|
/** One admitted turn; fingerprints never become durable history or account provenance. */
|
|
9137
9136
|
var SessionContinuationTurn = class {
|
|
9138
9137
|
baseline;
|
|
9138
|
+
processing = false;
|
|
9139
9139
|
get initialized() {
|
|
9140
9140
|
return this.baseline !== void 0;
|
|
9141
9141
|
}
|
|
9142
|
-
transform(payload) {
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
if (pending.length + value.length > SESSION_CONTINUATION_LIMITS.values) throw new Error("COPILOT_CONTINUATION_WORK_LIMIT");
|
|
9155
|
-
for (const child of value) pending.push({
|
|
9156
|
-
value: child,
|
|
9157
|
-
depth: depth + 1
|
|
9158
|
-
});
|
|
9159
|
-
} else if (record$8(value)) {
|
|
9160
|
-
const entries = Object.entries(value);
|
|
9161
|
-
if (pending.length + entries.length > SESSION_CONTINUATION_LIMITS.values) throw new Error("COPILOT_CONTINUATION_WORK_LIMIT");
|
|
9162
|
-
for (const [key, child] of entries) {
|
|
9163
|
-
stringBytes += Buffer.byteLength(key);
|
|
9164
|
-
pending.push({
|
|
9165
|
-
value: child,
|
|
9166
|
-
depth: depth + 1
|
|
9167
|
-
});
|
|
9142
|
+
async transform(payload, assertCurrent = () => {}) {
|
|
9143
|
+
assertCurrent();
|
|
9144
|
+
if (this.processing) throw new Error("COPILOT_CONTINUATION_PROCESSING_OVERLAP");
|
|
9145
|
+
if (!record$8(payload) || !Array.isArray(payload.input) || payload.input.length > SESSION_CONTINUATION_LIMITS.inputItems) throw new Error("COPILOT_CONTINUATION_INVALID_PAYLOAD");
|
|
9146
|
+
this.processing = true;
|
|
9147
|
+
try {
|
|
9148
|
+
const hashes = /* @__PURE__ */ new Map();
|
|
9149
|
+
let codeUnits = 0;
|
|
9150
|
+
for (let index = 0; index < payload.input.length; index++) {
|
|
9151
|
+
if (index % 256 === 0) {
|
|
9152
|
+
await setImmediate();
|
|
9153
|
+
assertCurrent();
|
|
9168
9154
|
}
|
|
9155
|
+
const item = payload.input[index];
|
|
9156
|
+
if (!record$8(item)) throw new Error("COPILOT_CONTINUATION_INVALID_PAYLOAD");
|
|
9157
|
+
if (item.type !== "reasoning") continue;
|
|
9158
|
+
const ciphertext = item.encrypted_content;
|
|
9159
|
+
if (typeof ciphertext !== "string" || !ciphertext || item.status !== void 0 && item.status !== "completed") throw new Error("COPILOT_CONTINUATION_UNSUPPORTED_REASONING");
|
|
9160
|
+
if (hashes.size >= SESSION_CONTINUATION_LIMITS.items) throw new Error("COPILOT_CONTINUATION_ITEM_LIMIT");
|
|
9161
|
+
codeUnits += ciphertext.length;
|
|
9162
|
+
if (codeUnits > SESSION_CONTINUATION_LIMITS.ciphertextCodeUnits) throw new Error("COPILOT_CONTINUATION_REASONING_WORK_LIMIT");
|
|
9163
|
+
const hash = createHash("sha256");
|
|
9164
|
+
for (let start = 0; start < ciphertext.length;) {
|
|
9165
|
+
let end = Math.min(start + SESSION_CONTINUATION_LIMITS.chunkCodeUnits, ciphertext.length);
|
|
9166
|
+
const last = ciphertext.charCodeAt(end - 1);
|
|
9167
|
+
if (end < ciphertext.length && last >= 55296 && last <= 56319) end--;
|
|
9168
|
+
hash.update(ciphertext.slice(start, end));
|
|
9169
|
+
start = end;
|
|
9170
|
+
await setImmediate();
|
|
9171
|
+
assertCurrent();
|
|
9172
|
+
}
|
|
9173
|
+
hashes.set(index, hash.digest("hex"));
|
|
9169
9174
|
}
|
|
9170
|
-
|
|
9175
|
+
const baseline = this.baseline ?? new Set(hashes.values());
|
|
9176
|
+
const input = payload.input.filter((_, index) => !hashes.has(index) || !baseline.has(hashes.get(index)));
|
|
9177
|
+
const result = input.length === payload.input.length ? payload : {
|
|
9178
|
+
...payload,
|
|
9179
|
+
input
|
|
9180
|
+
};
|
|
9181
|
+
assertCurrent();
|
|
9182
|
+
this.baseline ??= baseline;
|
|
9183
|
+
return result;
|
|
9184
|
+
} finally {
|
|
9185
|
+
this.processing = false;
|
|
9171
9186
|
}
|
|
9172
|
-
let bytes;
|
|
9173
|
-
try {
|
|
9174
|
-
bytes = JSON.stringify(payload);
|
|
9175
|
-
} catch {
|
|
9176
|
-
throw new Error("COPILOT_CONTINUATION_INVALID_PAYLOAD");
|
|
9177
|
-
}
|
|
9178
|
-
if (Buffer.byteLength(bytes) > SESSION_CONTINUATION_LIMITS.bytes) throw new Error("COPILOT_CONTINUATION_PAYLOAD_LIMIT");
|
|
9179
|
-
const hashes = payload.input.map(fingerprint);
|
|
9180
|
-
const present = new Set(hashes.filter((value) => value !== void 0));
|
|
9181
|
-
if (present.size > SESSION_CONTINUATION_LIMITS.items) throw new Error("COPILOT_CONTINUATION_ITEM_LIMIT");
|
|
9182
|
-
this.baseline ??= present;
|
|
9183
|
-
const input = payload.input.filter((_, index) => hashes[index] === void 0 || !this.baseline.has(hashes[index]));
|
|
9184
|
-
return input.length === payload.input.length ? payload : {
|
|
9185
|
-
...payload,
|
|
9186
|
-
input
|
|
9187
|
-
};
|
|
9188
9187
|
}
|
|
9189
9188
|
};
|
|
9190
9189
|
//#endregion
|
|
@@ -9514,10 +9513,10 @@ function installSessionContinuation(ctx) {
|
|
|
9514
9513
|
if (!admission.filter.initialized && admission.step !== 1) throw new Error("COPILOT_CONTINUATION_TURN_BOUNDARY_UNAVAILABLE");
|
|
9515
9514
|
const current = () => !disposed && !request.signal.aborted && active.get(session) === admission && admission.signal === request.signal;
|
|
9516
9515
|
if (!current()) throw new Error("COPILOT_CONTINUATION_REVOKED");
|
|
9517
|
-
|
|
9516
|
+
const assertCurrent = () => {
|
|
9518
9517
|
if (!current()) throw new Error("COPILOT_CONTINUATION_REVOKED");
|
|
9519
|
-
return admission.filter.transform(payload);
|
|
9520
9518
|
};
|
|
9519
|
+
return (payload) => admission.filter.transform(payload, assertCurrent);
|
|
9521
9520
|
},
|
|
9522
9521
|
dispose() {
|
|
9523
9522
|
disposed = true;
|
|
@@ -35,7 +35,7 @@ export declare class SessionContinuationController extends TypertRemoteService {
|
|
|
35
35
|
}
|
|
36
36
|
export declare function installSessionContinuation(ctx: Context): {
|
|
37
37
|
ready: Promise<void>;
|
|
38
|
-
prepare(request: GenerateOptions): ((payload: unknown) => unknown) | undefined;
|
|
38
|
+
prepare(request: GenerateOptions): ((payload: unknown) => Promise<unknown>) | undefined;
|
|
39
39
|
dispose(): void;
|
|
40
40
|
};
|
|
41
41
|
export {};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
export declare const SESSION_CONTINUATION_LIMITS: Readonly<{
|
|
2
2
|
items: 4096;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
inputItems: 65536;
|
|
4
|
+
ciphertextCodeUnits: number;
|
|
5
|
+
chunkCodeUnits: number;
|
|
6
6
|
}>;
|
|
7
7
|
/** One admitted turn; fingerprints never become durable history or account provenance. */
|
|
8
8
|
export declare class SessionContinuationTurn {
|
|
9
9
|
private baseline;
|
|
10
|
+
private processing;
|
|
10
11
|
get initialized(): boolean;
|
|
11
|
-
transform(payload: unknown): unknown
|
|
12
|
+
transform(payload: unknown, assertCurrent?: () => void): Promise<unknown>;
|
|
12
13
|
}
|
|
13
14
|
//# sourceMappingURL=session-continuation.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.113",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|