dsh-session-guard 4.2.10 → 4.2.12
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 +386 -362
- package/dsh.plugin.json +1 -1
- package/lib/client.js +3 -2
- package/lib/client.js.map +1 -1
- package/package.json +5 -5
- package/src/bridge.js +62 -8
- package/src/client/pause-button-text.ts +20 -4
- package/src/index.js +27 -3
- package/src/request-guard.js +17 -0
- package/src/wiring.js +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,367 +1,391 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.2.12 (2026-11-17)
|
|
4
|
+
|
|
5
|
+
- **修复 issue #4:4.2.11 的 `requestHeld` 投影是死的,按钮永远显示「暂停会话」**。4.2.11 给 `bridge.state()` 加了请求级 hold 投影,但判定入口是 `typeof deferrals.has === 'function'`;而 `index.js` 传给 `createBridge` 的 deferrals 只是个晚绑定壳,**只有 `settle` / `clearDeferred` 两个方法**。于是:
|
|
6
|
+
- `st.requestHeld` 恒为 `false`,`/state` 里派生自它的 `paused.request` / `paused.any` / `requestGate.held` 全是 `false`;
|
|
7
|
+
- 客户端 `readPauseState()` 恰好只认这三处、不读顶层 `held`,所以峰期被挂起时按钮仍是「暂停会话」;
|
|
8
|
+
- 用户点一下只是登记 `manualPause`(按钮翻成「继续会话」),再点才真正放行 —— **表现为「要点两下」**。
|
|
9
|
+
- **修法**:壳补齐 `has` / `list` 两个转发方法,未就绪时返回中性值(`false` / `[]`)而不是抛错 —— 构造期 `deferralsRef` 还是 `null`,而 `/state` 随时可能被读到。
|
|
10
|
+
- **不变量钉死**:新增 `tests/bridge-deferrals-shell.test.mjs`,从 `bridge.js` 源码里抽出**所有** `deferrals.<name>` 读取点,逐一断言 `index.js` 的壳里有同名键。以后 `bridge.js` 多读一个方法,测试立刻红 —— 不需要有人记得回来同步改壳。这正是 4.2.11 漏掉的那道防线。
|
|
11
|
+
- **全量**:289 tests / 289 pass / 0 fail(lint 干净)。
|
|
12
|
+
|
|
13
|
+
## 4.2.11 (2026-11-17)
|
|
14
|
+
|
|
15
|
+
- **修复 issue #3:峰期新会话的请求级 hold 没有手动放行入口**。峰期(如 09:00–12:00)新建会话发第一条消息,请求在 `agent/request` 被 `deferrals.hold()` 挂起;但 step 门只在 `step > 1` 才拉,首条请求停在 step 1,**step 门从未参与**。于是:
|
|
16
|
+
- 按钮显示「暂停会话」(`pausedStep=false`),点一下只是登记 `manualPause`、按钮翻成「继续会话」;
|
|
17
|
+
- 再点触发 `stepResume()`,而 `stepGate.release()` 因无门可放返回 `{released:false}`,**连 bypass 都不置**;
|
|
18
|
+
- 结果请求纹丝不动,只能等退峰 `releaseAll`、abort 或卸载插件才解除。
|
|
19
|
+
- **修法三处**:
|
|
20
|
+
1. `bridge.stepResume()` 现在同时结算**请求级 hold**(`deferrals.settle(id, reason, 'release')`,让挂住的 promise 以原 config 继续发出)并清掉延后记录;且**只要用户显式要继续就置 bypass**,不论门来自 step 级还是请求级——否则下一个请求立刻被同一峰期再挂一次,「继续」退化成「点一下放一条」的假放行。
|
|
21
|
+
2. `request-guard` 新增 `isBypassed` 依赖,判定顺序里在「峰期 + 官方源」之后认这个 bypass(fail-open:探测抛错则退回正常拦截,不得当作已放行)。`wiring` 把 step 门的 bypass 集合接进去——step 门与请求门共用同一个「本峰已被用户手动放行」的事实。
|
|
22
|
+
3. 状态投影新增 `requestHeld` / `requestHeldSince` / `pausedAny`,`/state` 的 `paused` 增补 `request` / `any` 并新增 `requestGate`;`readPauseState()` 认这三处,按钮在请求级 hold 时正确显示「继续会话」。
|
|
23
|
+
- **顺带修掉报告未提的一个细节**:旧代码点第二次会把 `manualPause` 一并删掉,按钮**又翻回「暂停会话」**,表现为「点两下、按钮闪回去、请求还在挂」。现在 bypass 与 manual 的取舍明确:显式继续 → 置 bypass;显式暂停 → 撤销 bypass(原语义保留)。
|
|
24
|
+
- **测试**:`bridge.test.mjs` 新增 5 例(请求级 hold 结算 / 无门也置 bypass / 自动释放不置 bypass / 状态投影认 requestHeld / 无 hold 时行为不变);`request-guard.test.mjs` 新增 3 例(bypass 会话放行 / 只对指定会话生效 / 探测抛错 fail-open 到正常拦截)。契约测试同步新增字段。
|
|
25
|
+
- **全量**:286 tests / 286 pass / 0 fail(lint 干净、build 通过)。
|
|
26
|
+
|
|
3
27
|
## 4.2.10
|
|
4
28
|
|
|
5
29
|
- 终端面(dsh-tui / Desktop 命令面板同源):/guard 终端面 + 拉门时向会话追加 plugin 源消息(TUI 一行反馈)。
|
|
6
|
-
|
|
7
|
-
4.2.3: host enumeration addendum for DSH 0.2.1-rc.3 (declaration-only bump; contract plane zero diff).
|
|
8
|
-
|
|
9
|
-
## 4.2.2 (2026-10-18)
|
|
10
|
-
|
|
11
|
-
- hosts: 追加 0.2.1-rc.2 声明面枚举(34/34 @deepseek-ai/* 宿主 peer 逐包 npm 实测 rc.2 在版;本插件不触 ctx.web provider 与 conversation.input.model.label 槽,代码零改动,纯元数据发版;农场 rc.2 格挂账待命)
|
|
12
|
-
|
|
13
|
-
All notable changes to `dsh-session-guard` are recorded here. Versions follow semver.
|
|
14
|
-
|
|
15
|
-
- [English changelog](./CHANGELOG.md)
|
|
16
|
-
- [日本語 changelog](./CHANGELOG.ja.md)
|
|
17
|
-
- [한국어 changelog](./CHANGELOG.ko.md)
|
|
18
|
-
- [Changelog en français](./CHANGELOG.fr.md)
|
|
19
|
-
- [Changelog auf Deutsch](./CHANGELOG.de.md)
|
|
20
|
-
- [Changelog in italiano](./CHANGELOG.it.md)
|
|
21
|
-
- [Changelog на русском](./CHANGELOG.ru.md)
|
|
22
|
-
- [Changelog en español](./CHANGELOG.es.md)
|
|
23
|
-
|
|
24
|
-
## 4.2.1 — 2026-10-17 (host enumeration: +0.2.1-rc.1)
|
|
25
|
-
|
|
26
|
-
### Fixed
|
|
27
|
-
- `engines.dsh` and the four `@deepseek-ai/dsh-client-*` peers append `|| 0.2.1-rc.1` (16-host exact enumeration),
|
|
28
|
-
so the host compatibility gate accepts DSH `0.2.1-rc.1`.
|
|
29
|
-
- `dsh.plugin.json` `engines.dsh` aligned to the same 16-host enumeration (was the range `>=0.2.0-rc.1 <0.2.1-0`);
|
|
30
|
-
the gate only reads `package.json`, but the two lists must not diverge.
|
|
31
|
-
- README compatibility statements (zh/de/es/fr/it/ru) synced to the enumeration. No behaviour change in this release.
|
|
32
|
-
|
|
33
|
-
## 4.2.0 — 2026-10-17
|
|
34
|
-
|
|
35
|
-
### Added
|
|
36
|
-
- Statutory-holiday awareness (src/holidays.js + src/holiday-store.js). Builtin 2026 finalized snapshot: 39 rows = 33 rest days + 6 make-up workdays (source: holiday-cn, State Council notices). Strict parse (zero-padded dates, boolean isOffDay, cross-year rows rejected); sha256 fingerprint over the decision fields only — upstream copy/reorder edits cause no false churn. The cache file $DSH_HOME/.dsh/session-guard/holidays/<year>.json self-verifies its fingerprint at load: mismatch discards the cache (builtin fallback) and triggers a re-fetch. Auto refresh: startup check + hourly ensureFresh; relevant years = Beijing current year, Nov/Dec also add next year (the State Council publishes next year in late December, so it lands without a release); jsDelivr primary, raw.githubusercontent fallback, 10 s timeout; refetch only on fingerprint change, then atomic tmp+rename write; 24 h no-refetch budget; consistent hits only bump the check timestamp; fail-open end to end. DSH_SESSION_GUARD_HOLIDAY_FETCH=0 pins offline/builtin mode (tests ride it).
|
|
37
|
-
- Declarative settings switches holidayMode and holidayAutoFetch (both default on; auto-form on 0.1.7+). /session-guard/status now exposes holidayMode + holidays[] per year (source / fingerprint / fetchedAt / entry count).
|
|
38
|
-
|
|
39
|
-
### Changed
|
|
40
|
-
- weekendMode upgraded to rest-day semantics: statutory holidays (including ones landing on workdays) are off-peak all day; make-up-workday weekends enter peak gating normally; nextOffPeakInstant lookahead widened 7 -> 14 days and is table-aware. holidayMap rides cfg via readCfg, so shouldPause consumers (scheduler tick / request-guard / step-gate / wiring release timers) pick it up with zero signature churn.
|
|
41
|
-
|
|
42
|
-
### Fixed
|
|
43
|
-
- Family claim rank 1 -> 2, aligned with the frozen weighted rank ladder (single source _tools/family-rank.mjs).
|
|
44
|
-
|
|
45
|
-
## 4.1.16 — 2026-10-14 (metadata alignment; backfill the missing 4.1.15 entry)
|
|
46
|
-
|
|
47
|
-
### Fixed
|
|
48
|
-
|
|
49
|
-
- `dsh.plugin.json` now carries the same version as `package.json`. The published 4.1.15 tarball
|
|
50
|
-
still said 4.1.14 (verified by downloading it from the registry), so the two manifests disagreed in a released artifact.
|
|
51
|
-
- No behaviour change in this release.
|
|
52
|
-
- Test suite repaired: the structural pin in `tests/settings-bridge.test.mjs` still demanded the
|
|
53
|
-
retired gear entry, so the suite had been red since 4.1.15; it now asserts the opposite (absence).
|
|
54
|
-
|
|
55
|
-
## 4.1.15 — 2026-10-08 (backfilled: this entry was never written at release time)
|
|
56
|
-
|
|
57
|
-
### Removed
|
|
58
|
-
|
|
59
|
-
- The shell-level `shell.overlay` slot injection: the fixed bottom-right gear button and its
|
|
60
|
-
positioned floating layer are gone (`src/client/shell-overlay.tsx` deleted). The settings entry
|
|
61
|
-
now relies on the host settings page alone.
|
|
62
|
-
|
|
63
|
-
## 4.1.14 — 2026-10-08
|
|
64
|
-
|
|
65
|
-
### Removed
|
|
66
|
-
|
|
67
|
-
## 4.1.13 — 2026-10-08
|
|
68
|
-
|
|
69
|
-
### Fixed — bridge descriptor skeleton on ≤0.1.5 (five-cell gate catch, 2026-10-08)
|
|
70
|
-
|
|
71
|
-
- **Host describe `value` is a field skeleton on ≤0.1.5** (0.1.0/0.1.5 empirical):
|
|
72
|
-
the old host generations serialize `descriptor.value` as `{enabled:{},…,officialProviders:{}}`
|
|
73
|
-
(one empty object per schema field) while the real merged config lives in
|
|
74
|
-
`descriptor.base` (combined defaults) + `descriptor.user` (user layer).
|
|
75
|
-
`BridgeDocHandle` consumed `value` verbatim, so `officialProviders` arrived as
|
|
76
|
-
`{}` — truthy non-array, invisible to `?? []` — and `ListRow`'s
|
|
77
|
-
`values.join` threw, crashing the whole `dsh-family.tab` slot (guard card +
|
|
78
|
-
IT card + TL nav all died together). `descriptorPlainValue()` now detects the
|
|
79
|
-
skeleton (object whose every own value is an empty plain object — impossible
|
|
80
|
-
for guard's scalar/array config) and rebuilds the effective value as
|
|
81
|
-
`{...base, ...user}` (shallow merge is exact for guard's flat config).
|
|
82
|
-
- **Card-field sanitization (defense in depth)**: any card render error kills
|
|
83
|
-
the entire family tab slot on these hosts, so `ListRow` inputs are now
|
|
84
|
-
sanitized at the call sites (`toList()` — non-arrays become `[]`) and the
|
|
85
|
-
`拦截方式` select falls back to `hold` for any non-`error` value. A malformed
|
|
86
|
-
descriptor may degrade one field, never the tab.
|
|
87
|
-
- Verified on the five-cell farm gate: describe replays on 0.1.0/0.1.5 now
|
|
88
|
-
yield plain merged values; the seeded `stepGateTimeoutMs: 321123` reads back
|
|
89
|
-
through the bridge on ≤0.1.5 and natively (configForms) on 0.1.7.
|
|
90
|
-
|
|
91
|
-
## 4.1.12 — 2026-10-08
|
|
92
|
-
|
|
93
|
-
### Added — settings webServer bridge (M4/T20-b): dual-track card data plane
|
|
94
|
-
|
|
95
|
-
- **Top-level card registration refactor (prerequisite)**: the three settings
|
|
96
|
-
faces (`dsh-family.tab`, `plugins.bundle.config`, `settings.plugin.item`,
|
|
97
|
-
`shell.overlay`) were registered inside the `onScope` callback of the dual
|
|
98
|
-
scoped-inject waist — on ≤0.1.5 that callback never fires (settingsScope fiber
|
|
99
|
-
never resolves; 0.1.0/0.1.1 lack both services), so the cards never registered
|
|
100
|
-
and a bridge would have had no consumer. All registrations now run at apply
|
|
101
|
-
top level with a `scopeRef` live reference; the callback degrades to a pure
|
|
102
|
-
data arm (perm-gate `client/index.ts` L166-257 shape).
|
|
103
|
-
- **Server bridge** (`src/settings-bridge.js`): `describe`/`mutate` endpoints at
|
|
104
|
-
`/api/session-guard/settings/*` (POST-only, `{ok,value|error}` envelope,
|
|
105
|
-
redacted describe filtered to the plugin ns, ops forwarded to the host
|
|
106
|
-
settings service with `expectedRevision` optimistic concurrency, 256 KB cap).
|
|
107
|
-
Registration is fail-open (error log, never blocks plugin load).
|
|
108
|
-
- **Client bridge handle** (`src/client/settings-bridge.ts`): `BridgeDocHandle`
|
|
109
|
-
implements the same `SettingsScope` face as the native handles
|
|
110
|
-
(getSnapshot/subscribe/set/unset); describe misses retry within a bounded
|
|
111
|
-
budget (settings service resolving later than card mount) before landing on
|
|
112
|
-
`unavailable`. Card faces read `scopeRef.scope ?? bridgeScope()` — native
|
|
113
|
-
first, bridge fallback (perm-gate T13b dual-track). **Generation split in the
|
|
114
|
-
data arm (five-cell empirical, 2026-10-08 night)**: on 0.1.2/0.1.5 the
|
|
115
|
-
`settingsScope` handle is write-alive but read-dead — `set()` persists to
|
|
116
|
-
settings.yaml while `getSnapshot().value` stays `undefined`, so that arm
|
|
117
|
-
deliberately leaves `scopeRef` empty and the card falls to the bridge (bridge
|
|
118
|
-
mutate lands in the same host service; describe heals the read path).
|
|
119
|
-
|
|
120
|
-
### Corrected — 4.1.11 publication note
|
|
121
|
-
|
|
122
|
-
- The 4.1.11 entry said "none of 4.1.5-4.1.10 was published to npm"; **4.1.5
|
|
123
|
-
was published** (npm registry confirms `4.1.5` in versions, and `latest`
|
|
124
|
-
pointed at it until this release line). 4.1.6-4.1.10 indeed never shipped.
|
|
125
|
-
The earlier claim came from reading the npmmirror mirror instead of the
|
|
126
|
-
authoritative registry (registry-pin discipline, B2+).
|
|
127
|
-
|
|
128
|
-
## 4.1.11 — 2026-10-08
|
|
129
|
-
|
|
130
|
-
### Fixed — family-section takeover rebuilt (4.1.5 → 4.1.11 arc; none of 4.1.5-4.1.10 was published to npm)
|
|
131
|
-
|
|
132
|
-
- **4.1.5 "half backfill" root cause**: the takeover body read `props.hooks.tabs`,
|
|
133
|
-
but the host's `bindInjectHooks` strips an inject face's `hooks` key into
|
|
134
|
-
`use<Tab>` props on every generation — the component threw, the slot abdicated,
|
|
135
|
-
and the takeover body never rendered anywhere. It now reads the `useTabs`
|
|
136
|
-
compartment first, with a raw-hooks `useState`/`useEffect` fallback.
|
|
137
|
-
- **Apply-time inject registration (4.1.10)**: the slots core fires inject
|
|
138
|
-
factories only on declaration events (= the settings panel opening), so the
|
|
139
|
-
grace-delayed registration of 4.1.7/4.1.8 waited for a declaration that never
|
|
140
|
-
came. The `settings.section` inject now registers at apply time.
|
|
141
|
-
- **Deferred yield-election (4.1.11)**: ≤0.1.7 shells give every same-id section
|
|
142
|
-
entry its own nav row — the old "priority-10 shadow stays invisible" assumption
|
|
143
|
-
produced a double 起子插件设置 row on all five farm cells. The factory now waits
|
|
144
|
-
500 ms after the declaration batch and stands down when a `dsh-family` entry is
|
|
145
|
-
already seated (thinking-levels head); it takes over only when TL is absent.
|
|
146
|
-
Verified single-row on all five farm cells (0.1.0 → 0.1.7), pairing with
|
|
147
|
-
dsh-thinking-levels 4.2.0-beta.26's symmetric stand-down.
|
|
148
|
-
|
|
149
|
-
## 4.0.0 — 2026-09-29
|
|
150
|
-
|
|
151
|
-
### Changed
|
|
152
|
-
- **DSH 0.2.0 line adaptation**: `engines.dsh` and the four `@deepseek-ai/dsh-client-*` peers move to `>=0.2.0-rc.1 <0.2.1-0` (replacing the 0.1.7 ranges); npm dist-tag `dsh-0.2.0`; manifest version aligned to `4.0.0`. The plugin-facing API surface (manifest / settings / HMR / slots / session v4) is unchanged from 0.1.7 — no runtime code changes.
|
|
153
|
-
- `@deepseek-ai/cordis` peer floor aligned to `^4.0.4` (the 0.2.0-rc.1 host UI packages declare `~4.0.4`; the previous `^4.0.1` accepted it but understated the floor).
|
|
154
|
-
|
|
155
|
-
### Fixed
|
|
156
|
-
- `src/client/family-section.tsx` landed in version control (it had existed only in the working tree since 3.2.x, so a clean checkout could not build).
|
|
157
|
-
- eslint flat config: dropped the core `no-unused-vars` rule — it mis-flags TS type-signature parameters; the typescript-eslint variant is kept, and the lint baseline is green again.
|
|
158
|
-
- v4 source-kind static gates (`tests/source-kind.test.mjs`) are now tracked and run in `npm test` (248 tests).
|
|
159
|
-
|
|
160
|
-
## 3.2.4 — 2026-09-27
|
|
161
|
-
|
|
162
|
-
### Fixed
|
|
163
|
-
- **Session format v4 adaptation (host >= 0.1.7-rc.1)**: the three session-writing paths no longer use the retired `source: { kind: 'plugin', plugin: 'session-guard' }` signature, which the v4 host rejects with `SessionFormatError` (whole round fails). All three now use the producer-owned kind:
|
|
164
|
-
- delayed-resume notice injection (`src/wiring.js`);
|
|
165
|
-
- auto-retry notice injection (`src/retry.js`);
|
|
166
|
-
- pause-resume followup (`src/pause-gate.js`, ```kind: `plugin:${pluginId}````).
|
|
167
|
-
- **tool-result v4 native adaptation (N1)**: `findToolOutcome` in `src/pause-gate.js` now reads the v4 first-class `role:'tool'` message (`toolCallId`/`isError` at message top level) first; the v3 `tool-result` block path is kept as historical fallback. Without this, a failed tool at pause time was reported as completed on resume ("do not re-run") — a silent wrong decision. `src/tool-call-id.js` reads the native top-level id first; stale 0.1.1/0.1.2-era header notes corrected to the three-shape generation table.
|
|
168
|
-
`form` and all other fields are unchanged; the host's own v3-to-v4 migration lifts existing legacy rows, so no historical data is rewritten. Evidence: `@deepseek-ai/dsh-session-format-v3-to-v4@0.1.7-rc.2` validates only that `source.kind` is non-empty and not `'plugin'`.
|
|
169
|
-
|
|
170
|
-
## 0.4.0 — 2026-09-18 (mis-versioned; superseded by 3.0.0)
|
|
171
|
-
|
|
172
|
-
### Fixed
|
|
173
|
-
|
|
174
|
-
- **Version identity.** This line was published as `0.4.0` while `dsh.plugin.json` and this
|
|
175
|
-
changelog already said `3.0.0` — one artifact with two version numbers. `package.json` is now
|
|
176
|
-
`3.0.0`, so the package version, the manifest version and the changelog agree. `0.4.0` is kept
|
|
177
|
-
here as a historical record because npm versions are immutable; `dist-tag dsh-0.1.5` should be
|
|
178
|
-
repointed to `3.0.0` once it is published.
|
|
179
|
-
- **Docs.** README/INSTALL (zh/en/ja/ko) no longer describe the sibling line as living on `main`.
|
|
180
|
-
The 0.1.2 line's release branch is **`legacy/0.1.2`** (npm dist-tag `dsh-0.1.2`, version `0.3.1`);
|
|
181
|
-
`main` is frozen at `0.2.0-beta.1`. The duplicated branch fragment in the INSTALL.zh/ja/ko install
|
|
182
|
-
command is fixed, explicit dist-tag install commands are documented, and "2.x / 3.x" is
|
|
183
|
-
now marked as a **line nickname** rather than a version number.
|
|
184
|
-
|
|
185
|
-
### Notes
|
|
186
|
-
|
|
187
|
-
- **No source changes** relative to `3.0.0`; `0.4.0` is a packaging-only publish of the same tree.
|
|
188
|
-
|
|
189
|
-
## 3.0.0 — 2026-09-14
|
|
190
|
-
|
|
191
|
-
### Changed
|
|
192
|
-
|
|
193
|
-
- **DSH v0.1.5-rc.2 dedicated line (`compat/0.1.5`).** `engines.dsh` and the `dsh-client-*`
|
|
194
|
-
peer ranges narrow to `>=0.1.5-rc.2 <0.2.0-0` (strict-semver prerelease matching means the
|
|
195
|
-
old `>=0.1.0-rc.7` range never matches `0.1.5-rc.2`); `dsh.plugin.json` gains `engines.dsh`.
|
|
196
|
-
The 2.x / 0.2.x line on `main` keeps serving DSH 0.1.0-rc.7 … 0.1.2-rc.1.
|
|
197
|
-
- **`session.events` → `snapshotEvents()`.** DSH 0.1.5 removed the `session.events` array
|
|
198
|
-
accessor (compatibility-guide §20.3). `pause-gate.js` now reads session events through a
|
|
199
|
-
dual-path helper: `snapshotEvents()` first, the legacy `events` array as a defensive
|
|
200
|
-
fallback, `null` (fail-open) when neither exists. Affects `findToolOutcome` and
|
|
201
|
-
`lastUserPrompt` only; event-type matching is unchanged.
|
|
202
|
-
|
|
203
|
-
### Unchanged
|
|
204
|
-
|
|
205
|
-
- Zero changes on every other integration seam: the self-held webServer prefix route
|
|
206
|
-
(`/session-guard/rpc`), `settings.register`, the `settings.plugin.item` card slot,
|
|
207
|
-
client injections, and `llm.listConfigurableProviders()` are all verified intact against
|
|
208
|
-
the published 0.1.5-rc.2 bundle (`tools/check-api-drift.ps1`, 12/12 required assertions).
|
|
209
|
-
|
|
210
|
-
### Pending
|
|
211
|
-
|
|
212
|
-
- Live smoke on a real DSH 0.1.5-rc.2 host (same status as the perm-gate 0.1.5 line).
|
|
213
|
-
|
|
214
|
-
## 0.2.0-beta.2 — 2026-09-13
|
|
215
|
-
|
|
216
|
-
### Fixed (DSH 0.1.5 compat — `compat/0.1.5` branch)
|
|
217
|
-
|
|
218
|
-
- **Dual-path resume enqueue.** DSH 0.1.5 turns the Inbox into an agent-loop read-only
|
|
219
|
-
projection, so `agent.followup` may no longer exist. The resume flow now tries
|
|
220
|
-
`agent.followup` first, falls back to `agent.send`, and degrades to a warn (never throws)
|
|
221
|
-
when neither is available — a failed enqueue can no longer break resume.
|
|
222
|
-
- **Resume messages carry `source.form: 'instructions'`** per the 0.1.5 `ContextFormed`
|
|
223
|
-
message-source contract (`kind: 'plugin'` is a built-in kind; older DSH versions ignore
|
|
224
|
-
the extra field).
|
|
225
|
-
- **`webServer.register` is wrapped in try/catch**: a failed route registration now logs an
|
|
226
|
-
error instead of throwing out of `apply` and breaking host plugin loading.
|
|
227
|
-
- Verified against the 0.1.5-rc.2 source: the `WebRoute` contract (exact/prefix + SSE) is
|
|
228
|
-
unchanged, so client `fetch('/session-guard/...')` paths need no `/api` prefix.
|
|
229
|
-
|
|
230
|
-
## 0.2.0-beta.1 — 2026-09-10
|
|
231
|
-
|
|
232
|
-
### Added
|
|
233
|
-
|
|
234
|
-
- **Step-level gate (`agent/pre-step`).** During peak hours the turn is now held **before** the
|
|
235
|
-
next step's model request instead of being interrupted at a turn boundary: the session keeps
|
|
236
|
-
running until the next `agent/pre-step`, where the gate holds it (setting `stepLevelPause`, on by
|
|
237
|
-
default). The turn resumes **in place** off-peak — no followup message needed. Hold conditions:
|
|
238
|
-
peak (Beijing time) + not weekend + `step > 1` + official target provider (`providerGuard`) +
|
|
239
|
-
not request-held + not bypassed in this peak window. New module `src/step-gate.js` (pure
|
|
240
|
-
`decideStepHold` + hold / release / abort / timeout engine).
|
|
241
|
-
- **`stepResume` port + RPC + `/resume`.** `sessionGuard.stepResume(sessionId, {bypass})`,
|
|
242
|
-
`POST /session-guard/rpc {action:'stepResume'}` and `/resume` all release the gate; a manual
|
|
243
|
-
resume also stops gating that session for the rest of the peak window.
|
|
244
|
-
- **Timeout escalation.** `stepGateTimeoutMs` (default 300000) releases the gate and escalates to a
|
|
245
|
-
turn-level **force** pause, so a long peak neither deadlocks nor drips one step every five minutes.
|
|
246
|
-
- **"⏸ Pause session" button** (client, slot `conversation.input.right`, id `session-guard-pause`,
|
|
247
|
-
order 20 — left of input-traffic's freeze button). It polls `/session-guard/state` once a second,
|
|
248
|
-
stays disabled while nothing is held, and calls `stepResume` when it is. The status badge moved to
|
|
249
|
-
order 40 and now reports the number of step-held sessions.
|
|
250
|
-
- **New settings**: `stepLevelPause`, `stepGateTimeoutMs`.
|
|
251
|
-
- **New state**: `GET /session-guard/state` now returns `paused: { step, turn }` and
|
|
252
|
-
`stepGate: { held, since, bypass }`; `/status` returns `stepHeld`; `/diag` returns `stepGate`.
|
|
253
|
-
The service port's `state().paused` stays boolean for compatibility (new field `pausedStep`).
|
|
254
|
-
|
|
255
|
-
### Fixed
|
|
256
|
-
|
|
257
|
-
- **Deadlock between a held step and a turn-level pause.** `pauseTask` / `resumeTask` /
|
|
258
|
-
`cancelTask` now release the step gate first: a step hold sits at `agent/pre-step`, where no
|
|
259
|
-
`assistant/message` or `tool/result` can ever arrive, so a `safe` pause used to wait forever and
|
|
260
|
-
never persisted `paused`.
|
|
261
|
-
|
|
262
|
-
### Changed
|
|
263
|
-
|
|
264
|
-
- **Peak entry no longer interrupts running turns** when `stepLevelPause` is on (`onEnterPeak` arms
|
|
265
|
-
the step gate instead of calling `stopNextTurn`); with it off the previous turn-level behaviour is
|
|
266
|
-
unchanged.
|
|
267
|
-
- input-traffic's freeze button label is now **"Freeze & append"** (`冻结追加` / `凍結して追加` /
|
|
268
|
-
`동결 후 추가`), and its resume label **"Resume & append"** (`恢复追加` / `再開して追加` /
|
|
269
|
-
`재개 후 추가`) — it freezes the turn and keeps queued messages, distinct from the pause button.
|
|
270
|
-
- **The pause button is a toggle now**: "Pause session" / "Resume session" (no disabled grey state).
|
|
271
|
-
Clicking "Pause session" calls the new `stepPause` action, which holds the session at the **next
|
|
272
|
-
step boundary** (step 1 included, regardless of peak or provider); "Resume session" calls
|
|
273
|
-
`stepResume`. New port method `sessionGuard.stepPause(sessionId)`.
|
|
274
|
-
- **SSE push**: new route `GET /session-guard/events?session=<id>` pushes step-gate state changes the
|
|
275
|
-
moment they happen, so peak auto-holds flip the button to "Resume session" without waiting for a
|
|
276
|
-
poll; the 10s `/session-guard/state` poll remains as a fallback. `/state` now reports
|
|
277
|
-
`paused.manual` and `stepGate.manual`.
|
|
278
|
-
- **Styling aligned** with input-traffic's composer button (24px height, 6px radius, 12px font, the
|
|
279
|
-
same border/hover/pressed tokens) for both the pause button and the status badge; styles are
|
|
280
|
-
injected once via `<style data-plugin-css="session-guard-client">`.
|
|
281
|
-
|
|
282
|
-
## Unreleased
|
|
283
|
-
|
|
284
|
-
### Added
|
|
285
|
-
|
|
286
|
-
- **Official-source two-dimensional guard (peak × target provider).** Peak hours now block only
|
|
287
|
-
requests whose target route is a DeepSeek official source; local/third-party providers keep
|
|
288
|
-
running. Verdict order: explicit `officialProviders` id list → live `baseURL` endpoint →
|
|
289
|
-
catalog builtin endpoint (pi-ai's `deepseek`) → builtin id (`deepseek-official`); each verdict
|
|
290
|
-
reports `matchedBy`. New modules: `src/provider.js` (pure), `src/provider-directory.js`,
|
|
291
|
-
`src/deferrals.js`, `src/request-guard.js`, `src/targets.js`, `src/wiring.js`.
|
|
292
|
-
- **Request-level backstop (`agent/request`).** Covers sessions started after peak entry and
|
|
293
|
-
sessions switched to an official source mid-run — the 30s tick only handled sessions that were
|
|
294
|
-
already `running` at the transition. Default `hold` mode suspends the request without an error
|
|
295
|
-
and releases it at the exact off-peak instant (`msUntilOffPeak`); `error` mode throws a
|
|
296
|
-
recognizable `PEAK_DEFERRED` failure and records a deferral for off-peak resume.
|
|
297
|
-
- **New settings**: `providerGuard`, `officialProviders`, `officialBaseURLs`, `deferredResume`,
|
|
298
|
-
`deferredResumeText`, `deferredMode`, `deferredMaxHoldMs` (default 6h), `guardSubagents`.
|
|
299
|
-
- **New routes**: `GET /session-guard/provider?provider=<id>` (verdict diagnostics);
|
|
300
|
-
`/session-guard/status` now reports `providerGuard` / `held` / `deferred`;
|
|
301
|
-
`/session-guard/state` reports the session's last target.
|
|
302
|
-
- **Drift guard** `tools/check-api-drift.ps1` asserting the required APIs exist on
|
|
303
|
-
`dsh-v0.1.1-rc.2` / `dsh-v0.1.2-rc.1` / `dsh-v0.1.3-alpha.2` / `dsh-v0.1.5-alpha.1`.
|
|
304
|
-
|
|
305
|
-
### Changed
|
|
306
|
-
|
|
307
|
-
- **DSH dual-version support (0.1.0-rc.7 … 0.1.2-rc.1).** One artifact now covers both
|
|
308
|
-
`dsh-v0.1.1-rc.2` and `dsh-v0.1.2-rc.1`. The `tool/result` call-id dual read
|
|
309
|
-
(`content[].toolCallId` first, `source.callId` fallback — both forms appear in replay logs of
|
|
310
|
-
both versions) is extracted to the dependency-free `src/tool-call-id.js` with unit tests.
|
|
311
|
-
`dsh.client.inject` no longer names `@deepseek-ai/dsh-client-runtime` (removed in 0.1.2) or
|
|
312
|
-
`@deepseek-ai/dsh-client-ui-slots` (not a dynamic client row); peer ranges widened to
|
|
313
|
-
`>=0.1.0-rc.7 <0.2.0-0` and the removed package dropped. Added `engines.dsh` and a
|
|
314
|
-
version-compatibility table to the README (ZH/EN).
|
|
315
|
-
- **Settings surface stays on the intersection API**: `settings.register` + `settings.get` only;
|
|
316
|
-
`installSection` (0.1.2+) and the removed `installSettingsSection` are never used. Optional
|
|
317
|
-
APIs (`model/selection`, `llm.listConfigurableProviders`, `settings.get`) are feature-probed and
|
|
318
|
-
degrade instead of throwing.
|
|
319
|
-
- **`src/retry.js` short-circuits only the exact `PEAK_DEFERRED` sentinel.** 429 / `RATE_LIMIT` /
|
|
320
|
-
`TRANSPORT` / timeout failures remain transient, so DSH's global retry (`dsh-llm-retry` on
|
|
321
|
-
`agent/request-error`) and this plugin's own retry semantics are unchanged. `dsh-llm-retry`
|
|
322
|
-
itself is never touched.
|
|
323
|
-
- Badge distinguishes "peak · official only" from "peak · all paused".
|
|
324
|
-
|
|
325
|
-
## 0.1.4 — 2026-09-09
|
|
326
|
-
|
|
327
|
-
### Changed
|
|
328
|
-
|
|
329
|
-
- **Public beta release** of the dual-version line (`0.1.4-beta.1`): version metadata, README
|
|
330
|
-
compatibility table and package metadata aligned for the beta channel.
|
|
331
|
-
|
|
332
|
-
## 0.1.3 — 2026-09-09
|
|
333
|
-
|
|
334
|
-
### Fixed
|
|
335
|
-
|
|
336
|
-
- **package.json encoding restored**: description was corrupted (GB2312 bytes misread as UTF-8); rewritten with correct Chinese text.
|
|
337
|
-
- **Missing metadata**: added `repository`, `homepage` fields.
|
|
338
|
-
- **peerDependencies corrected**: removed pinned `dsh-llm` exact version; added `cordis`, `dsh-client-runtime`, `dsh-client-locale`, `dsh-client-ui-settings`, `dsh-client-ui-slots` as optional peers matching `dsh.client.inject`.
|
|
339
|
-
- Added `dsh.plugin.json` manifest.
|
|
340
|
-
|
|
341
|
-
## 0.1.2 — 2026-08-28
|
|
342
|
-
|
|
343
|
-
### Fixed
|
|
344
|
-
|
|
345
|
-
- **Peak timezone fixed**: 峰谷判定固定北京时间 (`BILLING_TIMEZONE`),周末判定用配置时区。
|
|
346
|
-
|
|
347
|
-
## 0.1.1 — 2026-08-24
|
|
348
|
-
|
|
349
|
-
### Added
|
|
350
|
-
|
|
351
|
-
- **Backend auto-retry (D9)**: `turn/end` transient failures (error/429/max-tokens) trigger adaptive-backoff `followup(retryText)` resume; permanent failures (auth/balance/model/context limit) stop; user intervention or successful turn resets consecutive failure count.
|
|
352
|
-
- **Freeze/gate yield**: retry skips when `isFrozen(sessionId)` is true (queueLocked / paused / taskControl paused), never bypasses the session gate.
|
|
353
|
-
|
|
354
|
-
### Changed
|
|
355
|
-
|
|
356
|
-
- `sessionGuard` redundant port now exposes `state(sessionId)` returning `{ queueLocked, lockReason, paused, taskControlAvailable, taskControl }`.
|
|
357
|
-
- HTTP route `GET /session-guard/diag` returns runtime diagnostics including retry state.
|
|
358
|
-
|
|
359
|
-
### Fixed
|
|
360
|
-
|
|
361
|
-
- Weekend detection now uses `Intl.DateTimeFormat` with the configured timezone instead of bare `getUTCDay()`, fixing an 8-hour boundary bug for Beijing timezone.
|
|
362
|
-
|
|
363
|
-
## 0.1.0 — 2026-08-18
|
|
364
|
-
|
|
365
|
-
### Added
|
|
366
|
-
|
|
367
|
-
- Initial release: peak auto-pause (global), weekend mode, per-session freeze/resume via `sessionGuard` redundant port + RPC bridge, custom session gate (`agent.cancel keepInbox + goals.pause + session/event safe boundary + followup resume`), settings panel (Settings → Plugins → session-guard).
|
|
30
|
+
|
|
31
|
+
4.2.3: host enumeration addendum for DSH 0.2.1-rc.3 (declaration-only bump; contract plane zero diff).
|
|
32
|
+
|
|
33
|
+
## 4.2.2 (2026-10-18)
|
|
34
|
+
|
|
35
|
+
- hosts: 追加 0.2.1-rc.2 声明面枚举(34/34 @deepseek-ai/* 宿主 peer 逐包 npm 实测 rc.2 在版;本插件不触 ctx.web provider 与 conversation.input.model.label 槽,代码零改动,纯元数据发版;农场 rc.2 格挂账待命)
|
|
36
|
+
|
|
37
|
+
All notable changes to `dsh-session-guard` are recorded here. Versions follow semver.
|
|
38
|
+
|
|
39
|
+
- [English changelog](./CHANGELOG.md)
|
|
40
|
+
- [日本語 changelog](./CHANGELOG.ja.md)
|
|
41
|
+
- [한국어 changelog](./CHANGELOG.ko.md)
|
|
42
|
+
- [Changelog en français](./CHANGELOG.fr.md)
|
|
43
|
+
- [Changelog auf Deutsch](./CHANGELOG.de.md)
|
|
44
|
+
- [Changelog in italiano](./CHANGELOG.it.md)
|
|
45
|
+
- [Changelog на русском](./CHANGELOG.ru.md)
|
|
46
|
+
- [Changelog en español](./CHANGELOG.es.md)
|
|
47
|
+
|
|
48
|
+
## 4.2.1 — 2026-10-17 (host enumeration: +0.2.1-rc.1)
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
- `engines.dsh` and the four `@deepseek-ai/dsh-client-*` peers append `|| 0.2.1-rc.1` (16-host exact enumeration),
|
|
52
|
+
so the host compatibility gate accepts DSH `0.2.1-rc.1`.
|
|
53
|
+
- `dsh.plugin.json` `engines.dsh` aligned to the same 16-host enumeration (was the range `>=0.2.0-rc.1 <0.2.1-0`);
|
|
54
|
+
the gate only reads `package.json`, but the two lists must not diverge.
|
|
55
|
+
- README compatibility statements (zh/de/es/fr/it/ru) synced to the enumeration. No behaviour change in this release.
|
|
56
|
+
|
|
57
|
+
## 4.2.0 — 2026-10-17
|
|
58
|
+
|
|
59
|
+
### Added
|
|
60
|
+
- Statutory-holiday awareness (src/holidays.js + src/holiday-store.js). Builtin 2026 finalized snapshot: 39 rows = 33 rest days + 6 make-up workdays (source: holiday-cn, State Council notices). Strict parse (zero-padded dates, boolean isOffDay, cross-year rows rejected); sha256 fingerprint over the decision fields only — upstream copy/reorder edits cause no false churn. The cache file $DSH_HOME/.dsh/session-guard/holidays/<year>.json self-verifies its fingerprint at load: mismatch discards the cache (builtin fallback) and triggers a re-fetch. Auto refresh: startup check + hourly ensureFresh; relevant years = Beijing current year, Nov/Dec also add next year (the State Council publishes next year in late December, so it lands without a release); jsDelivr primary, raw.githubusercontent fallback, 10 s timeout; refetch only on fingerprint change, then atomic tmp+rename write; 24 h no-refetch budget; consistent hits only bump the check timestamp; fail-open end to end. DSH_SESSION_GUARD_HOLIDAY_FETCH=0 pins offline/builtin mode (tests ride it).
|
|
61
|
+
- Declarative settings switches holidayMode and holidayAutoFetch (both default on; auto-form on 0.1.7+). /session-guard/status now exposes holidayMode + holidays[] per year (source / fingerprint / fetchedAt / entry count).
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
- weekendMode upgraded to rest-day semantics: statutory holidays (including ones landing on workdays) are off-peak all day; make-up-workday weekends enter peak gating normally; nextOffPeakInstant lookahead widened 7 -> 14 days and is table-aware. holidayMap rides cfg via readCfg, so shouldPause consumers (scheduler tick / request-guard / step-gate / wiring release timers) pick it up with zero signature churn.
|
|
65
|
+
|
|
66
|
+
### Fixed
|
|
67
|
+
- Family claim rank 1 -> 2, aligned with the frozen weighted rank ladder (single source _tools/family-rank.mjs).
|
|
68
|
+
|
|
69
|
+
## 4.1.16 — 2026-10-14 (metadata alignment; backfill the missing 4.1.15 entry)
|
|
70
|
+
|
|
71
|
+
### Fixed
|
|
72
|
+
|
|
73
|
+
- `dsh.plugin.json` now carries the same version as `package.json`. The published 4.1.15 tarball
|
|
74
|
+
still said 4.1.14 (verified by downloading it from the registry), so the two manifests disagreed in a released artifact.
|
|
75
|
+
- No behaviour change in this release.
|
|
76
|
+
- Test suite repaired: the structural pin in `tests/settings-bridge.test.mjs` still demanded the
|
|
77
|
+
retired gear entry, so the suite had been red since 4.1.15; it now asserts the opposite (absence).
|
|
78
|
+
|
|
79
|
+
## 4.1.15 — 2026-10-08 (backfilled: this entry was never written at release time)
|
|
80
|
+
|
|
81
|
+
### Removed
|
|
82
|
+
|
|
83
|
+
- The shell-level `shell.overlay` slot injection: the fixed bottom-right gear button and its
|
|
84
|
+
positioned floating layer are gone (`src/client/shell-overlay.tsx` deleted). The settings entry
|
|
85
|
+
now relies on the host settings page alone.
|
|
86
|
+
|
|
87
|
+
## 4.1.14 — 2026-10-08
|
|
88
|
+
|
|
89
|
+
### Removed
|
|
90
|
+
|
|
91
|
+
## 4.1.13 — 2026-10-08
|
|
92
|
+
|
|
93
|
+
### Fixed — bridge descriptor skeleton on ≤0.1.5 (five-cell gate catch, 2026-10-08)
|
|
94
|
+
|
|
95
|
+
- **Host describe `value` is a field skeleton on ≤0.1.5** (0.1.0/0.1.5 empirical):
|
|
96
|
+
the old host generations serialize `descriptor.value` as `{enabled:{},…,officialProviders:{}}`
|
|
97
|
+
(one empty object per schema field) while the real merged config lives in
|
|
98
|
+
`descriptor.base` (combined defaults) + `descriptor.user` (user layer).
|
|
99
|
+
`BridgeDocHandle` consumed `value` verbatim, so `officialProviders` arrived as
|
|
100
|
+
`{}` — truthy non-array, invisible to `?? []` — and `ListRow`'s
|
|
101
|
+
`values.join` threw, crashing the whole `dsh-family.tab` slot (guard card +
|
|
102
|
+
IT card + TL nav all died together). `descriptorPlainValue()` now detects the
|
|
103
|
+
skeleton (object whose every own value is an empty plain object — impossible
|
|
104
|
+
for guard's scalar/array config) and rebuilds the effective value as
|
|
105
|
+
`{...base, ...user}` (shallow merge is exact for guard's flat config).
|
|
106
|
+
- **Card-field sanitization (defense in depth)**: any card render error kills
|
|
107
|
+
the entire family tab slot on these hosts, so `ListRow` inputs are now
|
|
108
|
+
sanitized at the call sites (`toList()` — non-arrays become `[]`) and the
|
|
109
|
+
`拦截方式` select falls back to `hold` for any non-`error` value. A malformed
|
|
110
|
+
descriptor may degrade one field, never the tab.
|
|
111
|
+
- Verified on the five-cell farm gate: describe replays on 0.1.0/0.1.5 now
|
|
112
|
+
yield plain merged values; the seeded `stepGateTimeoutMs: 321123` reads back
|
|
113
|
+
through the bridge on ≤0.1.5 and natively (configForms) on 0.1.7.
|
|
114
|
+
|
|
115
|
+
## 4.1.12 — 2026-10-08
|
|
116
|
+
|
|
117
|
+
### Added — settings webServer bridge (M4/T20-b): dual-track card data plane
|
|
118
|
+
|
|
119
|
+
- **Top-level card registration refactor (prerequisite)**: the three settings
|
|
120
|
+
faces (`dsh-family.tab`, `plugins.bundle.config`, `settings.plugin.item`,
|
|
121
|
+
`shell.overlay`) were registered inside the `onScope` callback of the dual
|
|
122
|
+
scoped-inject waist — on ≤0.1.5 that callback never fires (settingsScope fiber
|
|
123
|
+
never resolves; 0.1.0/0.1.1 lack both services), so the cards never registered
|
|
124
|
+
and a bridge would have had no consumer. All registrations now run at apply
|
|
125
|
+
top level with a `scopeRef` live reference; the callback degrades to a pure
|
|
126
|
+
data arm (perm-gate `client/index.ts` L166-257 shape).
|
|
127
|
+
- **Server bridge** (`src/settings-bridge.js`): `describe`/`mutate` endpoints at
|
|
128
|
+
`/api/session-guard/settings/*` (POST-only, `{ok,value|error}` envelope,
|
|
129
|
+
redacted describe filtered to the plugin ns, ops forwarded to the host
|
|
130
|
+
settings service with `expectedRevision` optimistic concurrency, 256 KB cap).
|
|
131
|
+
Registration is fail-open (error log, never blocks plugin load).
|
|
132
|
+
- **Client bridge handle** (`src/client/settings-bridge.ts`): `BridgeDocHandle`
|
|
133
|
+
implements the same `SettingsScope` face as the native handles
|
|
134
|
+
(getSnapshot/subscribe/set/unset); describe misses retry within a bounded
|
|
135
|
+
budget (settings service resolving later than card mount) before landing on
|
|
136
|
+
`unavailable`. Card faces read `scopeRef.scope ?? bridgeScope()` — native
|
|
137
|
+
first, bridge fallback (perm-gate T13b dual-track). **Generation split in the
|
|
138
|
+
data arm (five-cell empirical, 2026-10-08 night)**: on 0.1.2/0.1.5 the
|
|
139
|
+
`settingsScope` handle is write-alive but read-dead — `set()` persists to
|
|
140
|
+
settings.yaml while `getSnapshot().value` stays `undefined`, so that arm
|
|
141
|
+
deliberately leaves `scopeRef` empty and the card falls to the bridge (bridge
|
|
142
|
+
mutate lands in the same host service; describe heals the read path).
|
|
143
|
+
|
|
144
|
+
### Corrected — 4.1.11 publication note
|
|
145
|
+
|
|
146
|
+
- The 4.1.11 entry said "none of 4.1.5-4.1.10 was published to npm"; **4.1.5
|
|
147
|
+
was published** (npm registry confirms `4.1.5` in versions, and `latest`
|
|
148
|
+
pointed at it until this release line). 4.1.6-4.1.10 indeed never shipped.
|
|
149
|
+
The earlier claim came from reading the npmmirror mirror instead of the
|
|
150
|
+
authoritative registry (registry-pin discipline, B2+).
|
|
151
|
+
|
|
152
|
+
## 4.1.11 — 2026-10-08
|
|
153
|
+
|
|
154
|
+
### Fixed — family-section takeover rebuilt (4.1.5 → 4.1.11 arc; none of 4.1.5-4.1.10 was published to npm)
|
|
155
|
+
|
|
156
|
+
- **4.1.5 "half backfill" root cause**: the takeover body read `props.hooks.tabs`,
|
|
157
|
+
but the host's `bindInjectHooks` strips an inject face's `hooks` key into
|
|
158
|
+
`use<Tab>` props on every generation — the component threw, the slot abdicated,
|
|
159
|
+
and the takeover body never rendered anywhere. It now reads the `useTabs`
|
|
160
|
+
compartment first, with a raw-hooks `useState`/`useEffect` fallback.
|
|
161
|
+
- **Apply-time inject registration (4.1.10)**: the slots core fires inject
|
|
162
|
+
factories only on declaration events (= the settings panel opening), so the
|
|
163
|
+
grace-delayed registration of 4.1.7/4.1.8 waited for a declaration that never
|
|
164
|
+
came. The `settings.section` inject now registers at apply time.
|
|
165
|
+
- **Deferred yield-election (4.1.11)**: ≤0.1.7 shells give every same-id section
|
|
166
|
+
entry its own nav row — the old "priority-10 shadow stays invisible" assumption
|
|
167
|
+
produced a double 起子插件设置 row on all five farm cells. The factory now waits
|
|
168
|
+
500 ms after the declaration batch and stands down when a `dsh-family` entry is
|
|
169
|
+
already seated (thinking-levels head); it takes over only when TL is absent.
|
|
170
|
+
Verified single-row on all five farm cells (0.1.0 → 0.1.7), pairing with
|
|
171
|
+
dsh-thinking-levels 4.2.0-beta.26's symmetric stand-down.
|
|
172
|
+
|
|
173
|
+
## 4.0.0 — 2026-09-29
|
|
174
|
+
|
|
175
|
+
### Changed
|
|
176
|
+
- **DSH 0.2.0 line adaptation**: `engines.dsh` and the four `@deepseek-ai/dsh-client-*` peers move to `>=0.2.0-rc.1 <0.2.1-0` (replacing the 0.1.7 ranges); npm dist-tag `dsh-0.2.0`; manifest version aligned to `4.0.0`. The plugin-facing API surface (manifest / settings / HMR / slots / session v4) is unchanged from 0.1.7 — no runtime code changes.
|
|
177
|
+
- `@deepseek-ai/cordis` peer floor aligned to `^4.0.4` (the 0.2.0-rc.1 host UI packages declare `~4.0.4`; the previous `^4.0.1` accepted it but understated the floor).
|
|
178
|
+
|
|
179
|
+
### Fixed
|
|
180
|
+
- `src/client/family-section.tsx` landed in version control (it had existed only in the working tree since 3.2.x, so a clean checkout could not build).
|
|
181
|
+
- eslint flat config: dropped the core `no-unused-vars` rule — it mis-flags TS type-signature parameters; the typescript-eslint variant is kept, and the lint baseline is green again.
|
|
182
|
+
- v4 source-kind static gates (`tests/source-kind.test.mjs`) are now tracked and run in `npm test` (248 tests).
|
|
183
|
+
|
|
184
|
+
## 3.2.4 — 2026-09-27
|
|
185
|
+
|
|
186
|
+
### Fixed
|
|
187
|
+
- **Session format v4 adaptation (host >= 0.1.7-rc.1)**: the three session-writing paths no longer use the retired `source: { kind: 'plugin', plugin: 'session-guard' }` signature, which the v4 host rejects with `SessionFormatError` (whole round fails). All three now use the producer-owned kind:
|
|
188
|
+
- delayed-resume notice injection (`src/wiring.js`);
|
|
189
|
+
- auto-retry notice injection (`src/retry.js`);
|
|
190
|
+
- pause-resume followup (`src/pause-gate.js`, ```kind: `plugin:${pluginId}````).
|
|
191
|
+
- **tool-result v4 native adaptation (N1)**: `findToolOutcome` in `src/pause-gate.js` now reads the v4 first-class `role:'tool'` message (`toolCallId`/`isError` at message top level) first; the v3 `tool-result` block path is kept as historical fallback. Without this, a failed tool at pause time was reported as completed on resume ("do not re-run") — a silent wrong decision. `src/tool-call-id.js` reads the native top-level id first; stale 0.1.1/0.1.2-era header notes corrected to the three-shape generation table.
|
|
192
|
+
`form` and all other fields are unchanged; the host's own v3-to-v4 migration lifts existing legacy rows, so no historical data is rewritten. Evidence: `@deepseek-ai/dsh-session-format-v3-to-v4@0.1.7-rc.2` validates only that `source.kind` is non-empty and not `'plugin'`.
|
|
193
|
+
|
|
194
|
+
## 0.4.0 — 2026-09-18 (mis-versioned; superseded by 3.0.0)
|
|
195
|
+
|
|
196
|
+
### Fixed
|
|
197
|
+
|
|
198
|
+
- **Version identity.** This line was published as `0.4.0` while `dsh.plugin.json` and this
|
|
199
|
+
changelog already said `3.0.0` — one artifact with two version numbers. `package.json` is now
|
|
200
|
+
`3.0.0`, so the package version, the manifest version and the changelog agree. `0.4.0` is kept
|
|
201
|
+
here as a historical record because npm versions are immutable; `dist-tag dsh-0.1.5` should be
|
|
202
|
+
repointed to `3.0.0` once it is published.
|
|
203
|
+
- **Docs.** README/INSTALL (zh/en/ja/ko) no longer describe the sibling line as living on `main`.
|
|
204
|
+
The 0.1.2 line's release branch is **`legacy/0.1.2`** (npm dist-tag `dsh-0.1.2`, version `0.3.1`);
|
|
205
|
+
`main` is frozen at `0.2.0-beta.1`. The duplicated branch fragment in the INSTALL.zh/ja/ko install
|
|
206
|
+
command is fixed, explicit dist-tag install commands are documented, and "2.x / 3.x" is
|
|
207
|
+
now marked as a **line nickname** rather than a version number.
|
|
208
|
+
|
|
209
|
+
### Notes
|
|
210
|
+
|
|
211
|
+
- **No source changes** relative to `3.0.0`; `0.4.0` is a packaging-only publish of the same tree.
|
|
212
|
+
|
|
213
|
+
## 3.0.0 — 2026-09-14
|
|
214
|
+
|
|
215
|
+
### Changed
|
|
216
|
+
|
|
217
|
+
- **DSH v0.1.5-rc.2 dedicated line (`compat/0.1.5`).** `engines.dsh` and the `dsh-client-*`
|
|
218
|
+
peer ranges narrow to `>=0.1.5-rc.2 <0.2.0-0` (strict-semver prerelease matching means the
|
|
219
|
+
old `>=0.1.0-rc.7` range never matches `0.1.5-rc.2`); `dsh.plugin.json` gains `engines.dsh`.
|
|
220
|
+
The 2.x / 0.2.x line on `main` keeps serving DSH 0.1.0-rc.7 … 0.1.2-rc.1.
|
|
221
|
+
- **`session.events` → `snapshotEvents()`.** DSH 0.1.5 removed the `session.events` array
|
|
222
|
+
accessor (compatibility-guide §20.3). `pause-gate.js` now reads session events through a
|
|
223
|
+
dual-path helper: `snapshotEvents()` first, the legacy `events` array as a defensive
|
|
224
|
+
fallback, `null` (fail-open) when neither exists. Affects `findToolOutcome` and
|
|
225
|
+
`lastUserPrompt` only; event-type matching is unchanged.
|
|
226
|
+
|
|
227
|
+
### Unchanged
|
|
228
|
+
|
|
229
|
+
- Zero changes on every other integration seam: the self-held webServer prefix route
|
|
230
|
+
(`/session-guard/rpc`), `settings.register`, the `settings.plugin.item` card slot,
|
|
231
|
+
client injections, and `llm.listConfigurableProviders()` are all verified intact against
|
|
232
|
+
the published 0.1.5-rc.2 bundle (`tools/check-api-drift.ps1`, 12/12 required assertions).
|
|
233
|
+
|
|
234
|
+
### Pending
|
|
235
|
+
|
|
236
|
+
- Live smoke on a real DSH 0.1.5-rc.2 host (same status as the perm-gate 0.1.5 line).
|
|
237
|
+
|
|
238
|
+
## 0.2.0-beta.2 — 2026-09-13
|
|
239
|
+
|
|
240
|
+
### Fixed (DSH 0.1.5 compat — `compat/0.1.5` branch)
|
|
241
|
+
|
|
242
|
+
- **Dual-path resume enqueue.** DSH 0.1.5 turns the Inbox into an agent-loop read-only
|
|
243
|
+
projection, so `agent.followup` may no longer exist. The resume flow now tries
|
|
244
|
+
`agent.followup` first, falls back to `agent.send`, and degrades to a warn (never throws)
|
|
245
|
+
when neither is available — a failed enqueue can no longer break resume.
|
|
246
|
+
- **Resume messages carry `source.form: 'instructions'`** per the 0.1.5 `ContextFormed`
|
|
247
|
+
message-source contract (`kind: 'plugin'` is a built-in kind; older DSH versions ignore
|
|
248
|
+
the extra field).
|
|
249
|
+
- **`webServer.register` is wrapped in try/catch**: a failed route registration now logs an
|
|
250
|
+
error instead of throwing out of `apply` and breaking host plugin loading.
|
|
251
|
+
- Verified against the 0.1.5-rc.2 source: the `WebRoute` contract (exact/prefix + SSE) is
|
|
252
|
+
unchanged, so client `fetch('/session-guard/...')` paths need no `/api` prefix.
|
|
253
|
+
|
|
254
|
+
## 0.2.0-beta.1 — 2026-09-10
|
|
255
|
+
|
|
256
|
+
### Added
|
|
257
|
+
|
|
258
|
+
- **Step-level gate (`agent/pre-step`).** During peak hours the turn is now held **before** the
|
|
259
|
+
next step's model request instead of being interrupted at a turn boundary: the session keeps
|
|
260
|
+
running until the next `agent/pre-step`, where the gate holds it (setting `stepLevelPause`, on by
|
|
261
|
+
default). The turn resumes **in place** off-peak — no followup message needed. Hold conditions:
|
|
262
|
+
peak (Beijing time) + not weekend + `step > 1` + official target provider (`providerGuard`) +
|
|
263
|
+
not request-held + not bypassed in this peak window. New module `src/step-gate.js` (pure
|
|
264
|
+
`decideStepHold` + hold / release / abort / timeout engine).
|
|
265
|
+
- **`stepResume` port + RPC + `/resume`.** `sessionGuard.stepResume(sessionId, {bypass})`,
|
|
266
|
+
`POST /session-guard/rpc {action:'stepResume'}` and `/resume` all release the gate; a manual
|
|
267
|
+
resume also stops gating that session for the rest of the peak window.
|
|
268
|
+
- **Timeout escalation.** `stepGateTimeoutMs` (default 300000) releases the gate and escalates to a
|
|
269
|
+
turn-level **force** pause, so a long peak neither deadlocks nor drips one step every five minutes.
|
|
270
|
+
- **"⏸ Pause session" button** (client, slot `conversation.input.right`, id `session-guard-pause`,
|
|
271
|
+
order 20 — left of input-traffic's freeze button). It polls `/session-guard/state` once a second,
|
|
272
|
+
stays disabled while nothing is held, and calls `stepResume` when it is. The status badge moved to
|
|
273
|
+
order 40 and now reports the number of step-held sessions.
|
|
274
|
+
- **New settings**: `stepLevelPause`, `stepGateTimeoutMs`.
|
|
275
|
+
- **New state**: `GET /session-guard/state` now returns `paused: { step, turn }` and
|
|
276
|
+
`stepGate: { held, since, bypass }`; `/status` returns `stepHeld`; `/diag` returns `stepGate`.
|
|
277
|
+
The service port's `state().paused` stays boolean for compatibility (new field `pausedStep`).
|
|
278
|
+
|
|
279
|
+
### Fixed
|
|
280
|
+
|
|
281
|
+
- **Deadlock between a held step and a turn-level pause.** `pauseTask` / `resumeTask` /
|
|
282
|
+
`cancelTask` now release the step gate first: a step hold sits at `agent/pre-step`, where no
|
|
283
|
+
`assistant/message` or `tool/result` can ever arrive, so a `safe` pause used to wait forever and
|
|
284
|
+
never persisted `paused`.
|
|
285
|
+
|
|
286
|
+
### Changed
|
|
287
|
+
|
|
288
|
+
- **Peak entry no longer interrupts running turns** when `stepLevelPause` is on (`onEnterPeak` arms
|
|
289
|
+
the step gate instead of calling `stopNextTurn`); with it off the previous turn-level behaviour is
|
|
290
|
+
unchanged.
|
|
291
|
+
- input-traffic's freeze button label is now **"Freeze & append"** (`冻结追加` / `凍結して追加` /
|
|
292
|
+
`동결 후 추가`), and its resume label **"Resume & append"** (`恢复追加` / `再開して追加` /
|
|
293
|
+
`재개 후 추가`) — it freezes the turn and keeps queued messages, distinct from the pause button.
|
|
294
|
+
- **The pause button is a toggle now**: "Pause session" / "Resume session" (no disabled grey state).
|
|
295
|
+
Clicking "Pause session" calls the new `stepPause` action, which holds the session at the **next
|
|
296
|
+
step boundary** (step 1 included, regardless of peak or provider); "Resume session" calls
|
|
297
|
+
`stepResume`. New port method `sessionGuard.stepPause(sessionId)`.
|
|
298
|
+
- **SSE push**: new route `GET /session-guard/events?session=<id>` pushes step-gate state changes the
|
|
299
|
+
moment they happen, so peak auto-holds flip the button to "Resume session" without waiting for a
|
|
300
|
+
poll; the 10s `/session-guard/state` poll remains as a fallback. `/state` now reports
|
|
301
|
+
`paused.manual` and `stepGate.manual`.
|
|
302
|
+
- **Styling aligned** with input-traffic's composer button (24px height, 6px radius, 12px font, the
|
|
303
|
+
same border/hover/pressed tokens) for both the pause button and the status badge; styles are
|
|
304
|
+
injected once via `<style data-plugin-css="session-guard-client">`.
|
|
305
|
+
|
|
306
|
+
## Unreleased
|
|
307
|
+
|
|
308
|
+
### Added
|
|
309
|
+
|
|
310
|
+
- **Official-source two-dimensional guard (peak × target provider).** Peak hours now block only
|
|
311
|
+
requests whose target route is a DeepSeek official source; local/third-party providers keep
|
|
312
|
+
running. Verdict order: explicit `officialProviders` id list → live `baseURL` endpoint →
|
|
313
|
+
catalog builtin endpoint (pi-ai's `deepseek`) → builtin id (`deepseek-official`); each verdict
|
|
314
|
+
reports `matchedBy`. New modules: `src/provider.js` (pure), `src/provider-directory.js`,
|
|
315
|
+
`src/deferrals.js`, `src/request-guard.js`, `src/targets.js`, `src/wiring.js`.
|
|
316
|
+
- **Request-level backstop (`agent/request`).** Covers sessions started after peak entry and
|
|
317
|
+
sessions switched to an official source mid-run — the 30s tick only handled sessions that were
|
|
318
|
+
already `running` at the transition. Default `hold` mode suspends the request without an error
|
|
319
|
+
and releases it at the exact off-peak instant (`msUntilOffPeak`); `error` mode throws a
|
|
320
|
+
recognizable `PEAK_DEFERRED` failure and records a deferral for off-peak resume.
|
|
321
|
+
- **New settings**: `providerGuard`, `officialProviders`, `officialBaseURLs`, `deferredResume`,
|
|
322
|
+
`deferredResumeText`, `deferredMode`, `deferredMaxHoldMs` (default 6h), `guardSubagents`.
|
|
323
|
+
- **New routes**: `GET /session-guard/provider?provider=<id>` (verdict diagnostics);
|
|
324
|
+
`/session-guard/status` now reports `providerGuard` / `held` / `deferred`;
|
|
325
|
+
`/session-guard/state` reports the session's last target.
|
|
326
|
+
- **Drift guard** `tools/check-api-drift.ps1` asserting the required APIs exist on
|
|
327
|
+
`dsh-v0.1.1-rc.2` / `dsh-v0.1.2-rc.1` / `dsh-v0.1.3-alpha.2` / `dsh-v0.1.5-alpha.1`.
|
|
328
|
+
|
|
329
|
+
### Changed
|
|
330
|
+
|
|
331
|
+
- **DSH dual-version support (0.1.0-rc.7 … 0.1.2-rc.1).** One artifact now covers both
|
|
332
|
+
`dsh-v0.1.1-rc.2` and `dsh-v0.1.2-rc.1`. The `tool/result` call-id dual read
|
|
333
|
+
(`content[].toolCallId` first, `source.callId` fallback — both forms appear in replay logs of
|
|
334
|
+
both versions) is extracted to the dependency-free `src/tool-call-id.js` with unit tests.
|
|
335
|
+
`dsh.client.inject` no longer names `@deepseek-ai/dsh-client-runtime` (removed in 0.1.2) or
|
|
336
|
+
`@deepseek-ai/dsh-client-ui-slots` (not a dynamic client row); peer ranges widened to
|
|
337
|
+
`>=0.1.0-rc.7 <0.2.0-0` and the removed package dropped. Added `engines.dsh` and a
|
|
338
|
+
version-compatibility table to the README (ZH/EN).
|
|
339
|
+
- **Settings surface stays on the intersection API**: `settings.register` + `settings.get` only;
|
|
340
|
+
`installSection` (0.1.2+) and the removed `installSettingsSection` are never used. Optional
|
|
341
|
+
APIs (`model/selection`, `llm.listConfigurableProviders`, `settings.get`) are feature-probed and
|
|
342
|
+
degrade instead of throwing.
|
|
343
|
+
- **`src/retry.js` short-circuits only the exact `PEAK_DEFERRED` sentinel.** 429 / `RATE_LIMIT` /
|
|
344
|
+
`TRANSPORT` / timeout failures remain transient, so DSH's global retry (`dsh-llm-retry` on
|
|
345
|
+
`agent/request-error`) and this plugin's own retry semantics are unchanged. `dsh-llm-retry`
|
|
346
|
+
itself is never touched.
|
|
347
|
+
- Badge distinguishes "peak · official only" from "peak · all paused".
|
|
348
|
+
|
|
349
|
+
## 0.1.4 — 2026-09-09
|
|
350
|
+
|
|
351
|
+
### Changed
|
|
352
|
+
|
|
353
|
+
- **Public beta release** of the dual-version line (`0.1.4-beta.1`): version metadata, README
|
|
354
|
+
compatibility table and package metadata aligned for the beta channel.
|
|
355
|
+
|
|
356
|
+
## 0.1.3 — 2026-09-09
|
|
357
|
+
|
|
358
|
+
### Fixed
|
|
359
|
+
|
|
360
|
+
- **package.json encoding restored**: description was corrupted (GB2312 bytes misread as UTF-8); rewritten with correct Chinese text.
|
|
361
|
+
- **Missing metadata**: added `repository`, `homepage` fields.
|
|
362
|
+
- **peerDependencies corrected**: removed pinned `dsh-llm` exact version; added `cordis`, `dsh-client-runtime`, `dsh-client-locale`, `dsh-client-ui-settings`, `dsh-client-ui-slots` as optional peers matching `dsh.client.inject`.
|
|
363
|
+
- Added `dsh.plugin.json` manifest.
|
|
364
|
+
|
|
365
|
+
## 0.1.2 — 2026-08-28
|
|
366
|
+
|
|
367
|
+
### Fixed
|
|
368
|
+
|
|
369
|
+
- **Peak timezone fixed**: 峰谷判定固定北京时间 (`BILLING_TIMEZONE`),周末判定用配置时区。
|
|
370
|
+
|
|
371
|
+
## 0.1.1 — 2026-08-24
|
|
372
|
+
|
|
373
|
+
### Added
|
|
374
|
+
|
|
375
|
+
- **Backend auto-retry (D9)**: `turn/end` transient failures (error/429/max-tokens) trigger adaptive-backoff `followup(retryText)` resume; permanent failures (auth/balance/model/context limit) stop; user intervention or successful turn resets consecutive failure count.
|
|
376
|
+
- **Freeze/gate yield**: retry skips when `isFrozen(sessionId)` is true (queueLocked / paused / taskControl paused), never bypasses the session gate.
|
|
377
|
+
|
|
378
|
+
### Changed
|
|
379
|
+
|
|
380
|
+
- `sessionGuard` redundant port now exposes `state(sessionId)` returning `{ queueLocked, lockReason, paused, taskControlAvailable, taskControl }`.
|
|
381
|
+
- HTTP route `GET /session-guard/diag` returns runtime diagnostics including retry state.
|
|
382
|
+
|
|
383
|
+
### Fixed
|
|
384
|
+
|
|
385
|
+
- Weekend detection now uses `Intl.DateTimeFormat` with the configured timezone instead of bare `getUTCDay()`, fixing an 8-hour boundary bug for Beijing timezone.
|
|
386
|
+
|
|
387
|
+
## 0.1.0 — 2026-08-18
|
|
388
|
+
|
|
389
|
+
### Added
|
|
390
|
+
|
|
391
|
+
- Initial release: peak auto-pause (global), weekend mode, per-session freeze/resume via `sessionGuard` redundant port + RPC bridge, custom session gate (`agent.cancel keepInbox + goals.pause + session/event safe boundary + followup resume`), settings panel (Settings → Plugins → session-guard).
|