dsh-injection-manager 0.0.0-stage → 2.0.0

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +642 -0
  2. package/CONTRIBUTING.md +49 -0
  3. package/LICENSE +21 -0
  4. package/README.md +371 -2
  5. package/README.zh.md +330 -0
  6. package/SECURITY.md +35 -0
  7. package/client.js +4928 -0
  8. package/cordis.patch.yml +4 -0
  9. package/docs/ARCHITECTURE.md +195 -0
  10. package/docs/COMPATIBILITY.md +60 -0
  11. package/docs/DETAIL.de.md +1 -0
  12. package/docs/DETAIL.es.md +1 -0
  13. package/docs/DETAIL.fr.md +1 -0
  14. package/docs/DETAIL.ja.md +1 -0
  15. package/docs/DETAIL.md +149 -0
  16. package/docs/DETAIL.pt.md +1 -0
  17. package/docs/DETAIL.ru.md +1 -0
  18. package/docs/DETAIL.zh.md +105 -0
  19. package/docs/FAQ.md +96 -0
  20. package/docs/PERFORMANCE.md +73 -0
  21. package/docs/images/demo.gif +0 -0
  22. package/docs/images/dock.png +0 -0
  23. package/docs/images/panel-dark.png +0 -0
  24. package/docs/images/panel-drawer.png +0 -0
  25. package/docs/images/panel-insights.png +0 -0
  26. package/docs/images/panel-manage-expanded.png +0 -0
  27. package/docs/images/panel-manage.png +0 -0
  28. package/docs/images/panel-settings.png +0 -0
  29. package/docs/images/panel-sidebar.png +0 -0
  30. package/docs/preview.svg +178 -0
  31. package/icon.svg +20 -0
  32. package/index.js +304 -0
  33. package/lib/actions.js +33 -0
  34. package/lib/apply.js +230 -0
  35. package/lib/compaction.js +126 -0
  36. package/lib/content.js +360 -0
  37. package/lib/events.js +216 -0
  38. package/lib/group.js +141 -0
  39. package/lib/health.js +210 -0
  40. package/lib/history.js +47 -0
  41. package/lib/hostinfo.js +83 -0
  42. package/lib/instructions.js +142 -0
  43. package/lib/measure.js +51 -0
  44. package/lib/policy.js +189 -0
  45. package/lib/presets.js +45 -0
  46. package/lib/pressure.js +146 -0
  47. package/lib/routes.js +877 -0
  48. package/lib/settings.js +32 -0
  49. package/lib/snapshot.js +785 -0
  50. package/lib/stats.js +394 -0
  51. package/lib/text.js +292 -0
  52. package/lib/trend.js +168 -0
  53. package/locale/de.json +413 -0
  54. package/locale/en.json +413 -0
  55. package/locale/es.json +413 -0
  56. package/locale/fr.json +413 -0
  57. package/locale/ja.json +413 -0
  58. package/locale/pt.json +413 -0
  59. package/locale/ru.json +413 -0
  60. package/locale/zh.json +413 -0
  61. package/package.json +85 -4
  62. package/screenshots.json +11 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,642 @@
1
+ # Changelog
2
+
3
+ ## 2.0.0 — 2026-11-16
4
+
5
+ The control-plane release: the panel now shows what the next request carries, what can be
6
+ switched off, **and what each item actually says** — with a cross-session trend and a health
7
+ strip that turn the numbers into decisions. Everything new is read-only; switching stays a
8
+ human click.
9
+
10
+ ### Breaking / contract
11
+
12
+ - **HTTP contract is v2.** `GET /summary` now returns `apiVersion: 2`, `healthSummary`
13
+ (`{high, warn, info}`) and an optional `preview` (≤180 chars) on each item. New fields are
14
+ additive, but the panel feature-detects the version: a v2 panel against a v1 server shows a
15
+ dismissible gate card ("this surface needs a v2 host") instead of silently hiding tabs. A v1
16
+ panel against a v2 server keeps working.
17
+ - **Four new read-only GET routes:** `/content`, `/trend`, `/events`, `/health` (same prefix as
18
+ the existing routes). `/content` is the only route that opens a file, and only paths already
19
+ registered by the snapshot collection.
20
+ - **New durable file `events.json`** (`$DSH_HOME/injection-manager/`, version 1, cap 300,
21
+ atomic tmp+rename, dedupe): an append-only feed of policy changes, presets, budget edits,
22
+ imports, undos, compactions and prunes. `stats.json` rows recorded from 2.0.0 on also carry a
23
+ per-channel token split (`channels`); old rows keep `channels: null` on purpose.
24
+ - **Model tool grew a single-item mode.** `context_injection` accepts optional
25
+ `{channel, name}` and then returns just that item's original content (≤32 KB). Calling it
26
+ without arguments still returns the whole snapshot. `/inject health` was added, and the bare
27
+ `/inject` report now ends with one health line.
28
+
29
+ ### Added
30
+
31
+ - **Content drawer.** Press "content" on any row and read the original bytes behind it: prompt
32
+ section text, runtime-context snapshots, a tool's JSON declaration (description / parameter
33
+ table / raw JSON), a skill's `SKILL.md` body or its catalog line, an instruction file. The
34
+ drawer shows the source path, a byte/char/token meta line, line numbers (toggleable), in-content
35
+ search with match highlighting and a per-line match summary, full-text copy and path copy, a
36
+ truncation notice when the 256 KB cap hits, Esc-to-close and focus restoration. Everything is
37
+ rendered as plain text — no `dangerouslySetInnerHTML` anywhere.
38
+ - **Health strip on the manage page.** Deterministic, read-only checks over one snapshot:
39
+ `heavy-suite`, `budget-gap`, `catalog-truncated`, `locked-items`, `unknown-window`, `no-policy`,
40
+ `empty-catalog`. Severity rows with the saved-token delta, up to six visible plus a "more"
41
+ line, and one-click actions that reuse the existing `POST /action` (`switch-group`,
42
+ `set-budget`, `open-content`, `open-tab`). The strip only fetches while the tab is visible.
43
+ - **Insights tab.** Cross-session first-turn trend as stacked channel bars (7 days / 30 days /
44
+ all; hover for values, click to pin, Esc to unpin, ←/→ by keyboard; more than 40 points merge
45
+ into overview buckets; rows whose channel split is unknown are striped), an aggregate band
46
+ (sessions measured, average, peak, cumulative saved), per-session cards (search, sort by
47
+ recent / heaviest / most saved), a cross-session composition ring, the heaviest-suite ranking
48
+ for the current session, the current session's event timeline (12 event kinds, capacity note)
49
+ and a coverage footnote that states what the trend does and does not contain.
50
+ - **Inline previews.** Rows expand a `preview` paragraph without leaving the list; the drawer is
51
+ only for the full content.
52
+ - **Preferences** in the settings tab: content-drawer line numbers and the default insights
53
+ range. They live in this browser and are never written to `policy.json`.
54
+ - **Version card** in the settings tab: plugin version, host version with its tested baseline,
55
+ HTTP api version and the UI language; links to the full DETAIL page in the current language.
56
+ - **Eight-language coverage** for all new strings: +182 keys per locale (zh/en/ja/es/fr/de/ru/pt),
57
+ 372 client keys per language.
58
+
59
+ ### Changed
60
+
61
+ - The middle tab is now **洞察 (Insights)** instead of a plain history list. It still reads
62
+ `stats.json`, but the numbers are aggregated for comparisons and each point states its source
63
+ (measured vs priced from durable log) and coverage.
64
+ - The manage page leads with health → KPI → request strip; the table keeps suite clustering and
65
+ per-switch tri-state, and every row can now reveal its content.
66
+ - `stats.json` history is described the same way everywhere: measured rows plus a durable-log
67
+ backfill that runs in the background (one pass per 60 s, ≤8 sessions), never a replay of every
68
+ session and never a wait on a read.
69
+ - `screenshots.json` lists the v2 screens. README/README.zh are rewritten around the four
70
+ surfaces and the control-plane positioning.
71
+
72
+ ### Fixed
73
+
74
+ - Content reads cannot hang or flood: 2 s per request, 256 KB response cap (32 KB for the model
75
+ tool), UTF-8-safe truncation that never splits a code point, and a whitelist restricted to
76
+ paths the snapshot itself registered.
77
+ - The event feed is crash-safe and idempotent: a suppressed write can never turn a saved policy
78
+ into an error, duplicate keys keep replayed host events from becoming two rows, and params are
79
+ flattened and truncated so prompt text cannot leak into the file.
80
+ - Health checks are reproducible for one snapshot (the only clock value is
81
+ `snapshot.generatedAt`); the two codes this host build cannot observe (`duplicate-skill`,
82
+ `tool-name-collision`) are never emitted rather than invented.
83
+ - **Opening the insights tab no longer waits on the durable-log backfill.** The backfill became a
84
+ background single-flight pass (one per 60 s, ≤8 sessions, 6 s budget) and the read returns the
85
+ already-recorded rows immediately with `backfilling: true`; on a 671-session corpus the old
86
+ synchronous pass made `/trend` take 7.1 s per poll and `/stats` 2.1 s, both now in the
87
+ millisecond range.
88
+ - `trend.points[].scope` is a free string (commonly `startup|clear|route.session|backfill`,
89
+ unknown values pass through, capped at 64 chars) and `policy` accepts `unknown` — the contract
90
+ was revised to fit the honest v1 data instead of rewriting history.
91
+ - An older server now shows a dismissible gate card instead of a tab that silently disappears.
92
+
93
+ ### Migration
94
+
95
+ - Nothing to do for existing installs: `policy.json` keeps its v1 shape, `stats.json` stays
96
+ readable (older rows show an unknown channel split), and `events.json` is created on the first
97
+ event.
98
+ - If you script against `/summary`, accept the new fields — no legacy key was removed. Anything
99
+ that pinned the old tab labels should use the new `管理 / 洞察 / 设置` set.
100
+
101
+ ## 1.14.0 — 2026-11-17
102
+
103
+ - **The panel is three tabs, and the summary moved out of the working list.**
104
+ 管理 is now only what you act on (suite donut, bars, toolbar, table); the KPI
105
+ row, the request strip and the skills card live in 统计 under 当前会话, followed
106
+ by 历史记录. Four tabs (清单/策略/预算/说明) became 管理/统计/设置, with the old
107
+ ones folded into 设置 and stale stored tab ids mapped, so nothing opens blank.
108
+ - **统计 measures real history.** It lists every conversation the host knows about
109
+ (`sessionQuery.listSessions()`, a header-only read) and fills numbers in for the
110
+ ones it can: measured sessions come from this plugin's own snapshots, and older
111
+ ones are priced from their durable log — `request/header` tool declarations plus
112
+ the `system/message` prompt — a bounded 8 sessions per open, cached in
113
+ `$DSH_HOME/injection-manager/stats.json`. The footer states the coverage
114
+ honestly ("N of 664 conversations measured").
115
+ - Skill tokens are shown as "—" for log-derived rows: the skill catalog arrives as a
116
+ pre-step user message whose `source` is null in the durable record, so claiming a
117
+ number there would be a guess.
118
+ - Screenshots and the demo GIF regenerated for the new layout; `screenshots.json`
119
+ now lists panel-stats instead of the retired budget/policy images.
120
+ - 2 new sections and 20 new keys across 8 locales.
121
+
122
+ ## 1.13.1 — 2026-11-17
123
+
124
+ - **The list toolbar got un-crowded.** Nine controls in one row became: scope,
125
+ search, group/flat, a channel `<select>` and three small view toggles. The
126
+ channel chips only appear as a removable "筛选:技能目录 ×" row when a filter is
127
+ actually on, so the idle toolbar is quiet and the active state is still visible.
128
+ - The select and the view toggles collapse at narrow widths instead of wrapping
129
+ into a second line that shoves the table down.
130
+ - 2 new locale keys × 8 languages.
131
+
132
+ ## 1.13.0 — 2026-11-17
133
+
134
+ - **Skills vs MCP tools, side by side.** The skills card now shows all four kinds of
135
+ line item (skills / tool schemas / prompt text / workspace rules) with their
136
+ shares, and one sentence that answers the obvious follow-up: tool schemas are not
137
+ skills — each MCP tool is its own JSON declaration, and on the reference machine
138
+ they outweigh the whole skill catalog by 75.9k to 3.0k.
139
+ - **A closed suite no longer disappears.** The policy removes its rows from the
140
+ assembled prompt, so the list used to have nothing left to show — the suite
141
+ vanished and its switch with it. Closed suites now stay in the list with an
142
+ 已关闭 badge and their remembered size; their switch restores the exact names the
143
+ policy excludes, per channel. A closed row reads "—" instead of a share above
144
+ 100%.
145
+ - **Two explicit scopes.** 默认策略 = what a session created right now would receive
146
+ (the policy view, and the default); 本会话 = what the conversation on screen is
147
+ actually sending, measured by the host. A policy never rewrites a live session, so
148
+ both are true at once — the reader now picks which question they are asking
149
+ instead of guessing from a single mixed table.
150
+ - 7 new locale keys × 8 languages.
151
+
152
+ ## 1.12.0 — 2026-11-16
153
+
154
+ - **The plugin now leads with why people install it: collected skills.** A
155
+ dedicated card sits under the KPI row — how many skills are in the catalog, their
156
+ total tokens and share of the first request, the average per skill, the providers
157
+ they come from and the single heaviest entry. "去管理" filters the list straight
158
+ to that channel, so the answer to "why is my prompt so big" is one click away.
159
+ - The model-facing card gained the same line first ("技能目录:38 个技能共 3.0k
160
+ token,占首轮 3.6%…"), because a user who collected a hundred skills is exactly
161
+ the user whose agent should be able to say that out loud.
162
+ - README now opens with the collection problem before any feature list.
163
+ - New snapshot field `skillsState.{catalogTokens,catalogShare,averageTokens,providers,heaviest,topProviders}`.
164
+ - 7 locale keys × 8 languages; the narrow sidebar stacks the card's header.
165
+
166
+ ## 1.11.1 — 2026-11-16
167
+
168
+ - **The model-facing tool now says what to do with the numbers.** `context_injection`
169
+ gained a "能做什么" block: the biggest switchable suite and what it saves, whether
170
+ this session predates the policy, what compaction already removed (irreversible),
171
+ and the fact that the tool cannot flip switches itself. A model that reads only
172
+ that block can give its user the one action that matters.
173
+ - **README opens with the three facts an agent needs** (what it measures, why it is
174
+ safe, that one suite is usually the whole win) before any screenshot.
175
+ - `docs/DETAIL.md` and `docs/DETAIL.zh.md` are real pages instead of a stray image:
176
+ the two-numbers model, what each channel physically is, when a policy applies,
177
+ and what happens when a piece is missing.
178
+ - npm description rewritten without the mojibake and with `context-window`,
179
+ `compaction`, `occupancy` keywords; awesome-listing draft updated to match.
180
+ - 3 new tests for the advice block — 69 total.
181
+
182
+ ## 1.11.0 — 2026-11-16
183
+
184
+ - **The denominator exists.** Occupancy is now measured, not guessed: the panel
185
+ reads the host's own `contextPressure` projection (the next request's expected
186
+ prompt) and divides it by the model's window, so the strip can say "53% of the
187
+ window, 118k left" instead of leaving the user to compare two absolute numbers.
188
+ The window comes from `request/context`; before the first request it falls back
189
+ to `ctx.llm.resolveModelInfo().context.contextWindow` (cached per route). When
190
+ neither exists the card prints 窗口未知 — it never invents a capacity.
191
+ - **Where the window goes.** A new card stacks the next request as system / tools
192
+ / messages against the window (from the `contextBreakdown` projection), colours
193
+ the bar amber at 70% and red at 90%, and labels the estimate as an estimate.
194
+ - **Compaction receipts.** A `session/event` listener folds `compaction/summary`
195
+ and `compaction/prune` into "压缩 2 次 · 释放 78.4k" — the log already carries
196
+ `shadowedTokenCount`, so this is a fact rather than an inference. Receipts cover
197
+ events since the plugin loaded, and the tooltip says so.
198
+ - KPI cards are four equal columns at an 8px radius; the sparkline spans the card
199
+ and carries an `aria-label` with its min/max; every chart is `role="img"`.
200
+ - **Fixed: every share now uses one denominator.** Closing a suite left the
201
+ largest-suite bars and the table's 占比 column quoting shares of the all-on
202
+ total, so a closed REA row read "390.4%" next to a 17.1k first turn. The bars
203
+ keep their all-on width (a closed giant still looks like a giant) but fill only
204
+ what the policy left on and read 已关闭; rows share the effective total, and an
205
+ off row shows the tag instead of a meaningless percentage.
206
+ - The dock chip shows the window percentage (red past 90%) and falls back to the
207
+ savable share when no window is known.
208
+ - New icon: the same three bands narrowing into one dot, drawn as gradients at
209
+ 36×36 so it survives a 20px sidebar. `assets/icon-512.png` is regenerated from
210
+ the same geometry.
211
+ - **A name, once.** The sidebar entry is now 上下文注入 (was 注入) so it reads as
212
+ a sibling of 上下文洞察; the page heading and the marketplace name stay
213
+ 上下文注入管理, and every locale got the same split between the short entry and
214
+ the full product name.
215
+ - **Less air at the top.** The window card became one strip line — bar, room
216
+ left, system/tools/messages — under four tighter KPI cards; a tall card holding
217
+ a 24%-full bar is gone. In the narrow sidebar the strip reflows to
218
+ label + remaining, a full-width bar, then the legend.
219
+ - The four tabs are a segmented control (a pill track with the active tab
220
+ raised), matching the 分组/平铺 control instead of floating underlined text.
221
+ - 13 new tests (pressure, compaction, window rendering) — 66 total.
222
+
223
+ ## 1.10.9 — 2026-11-16
224
+
225
+ - The Items tab opens with a visual overview: an SVG donut of the per-channel
226
+ composition (center = effective total), the largest suites as proportion bars,
227
+ and a first-turn sparkline in the total KPI. Hand-rolled SVG/CSS, no chart
228
+ dependency — the same technique dsh-context uses for its dashboard.
229
+ - Eight locales gained `topSuites`; screenshots regenerated.
230
+
231
+ ## 1.10.8 — 2026-11-16
232
+
233
+ - Sorting moved into the table headers, like a normal data grid: 条目 / 通道 /
234
+ token / 占比 are clickable, show ▲▼ (or ↕ when inactive) and `aria-sort`.
235
+ The toolbar chips are gone; the choice persists as `key:dir`.
236
+ - Fixed the direction: descending token order was inverted (zero-token suites
237
+ came first). Suites and flat rows share the same comparator.
238
+ - Screenshot fixture now reads `/summary` and `/locale` live, so regenerated
239
+ images cannot ship untranslated keys.
240
+
241
+ ## 1.10.7 — 2026-11-16
242
+
243
+ - Suites are merged by label across channels: REA's 229 MCP tools and its prompt
244
+ section are now one row (`REA · 230 条目 · 多通道 · 66,715`) instead of two rows
245
+ sorted far apart. Toggling it dispatches a new bulk `groups` action, so one
246
+ switch turns the whole suite on or off.
247
+ - The footer now reports effective totals and merged group counts (`27/35 组`).
248
+ - Route test covers the bulk action; the fixture understands `groups`.
249
+
250
+ ## 1.10.6 — 2026-11-16
251
+
252
+ - The top strip now always shows the **policy view**, in real time: 首轮注入 and
253
+ 可关闭 are the composition after the current policy (17.1k / 14.6k when REA is
254
+ off), the bar + legend use the same per-channel numbers, and the third card
255
+ became 全开时 (the un-policied baseline) so the comparison is explicit.
256
+ Previously the strip showed the session's assembled prompt, so closing a suite
257
+ changed only "策略后" and looked like a stale refresh.
258
+ - Footer totals follow the same effective view; snapshots expose
259
+ `effective.channels` / `effective.totals`.
260
+
261
+ ## 1.10.5 — 2026-11-16
262
+
263
+ - First registry release: `npm i dsh-injection-manager` installs 1.10.4 (54 files,
264
+ 894,925 bytes). The npm badge is on both READMEs.
265
+ - Release workflow now publishes through npm **trusted publishing (OIDC)**:
266
+ `id-token: write`, npm upgraded in the job, no `NPM_TOKEN` secret. Configure the
267
+ trusted publisher in the package settings once (repo `IWHBIWHB/dsh-injection-manager`,
268
+ workflow `release.yml`), then a `v*` tag releases with provenance.
269
+
270
+ ## 1.10.4 — 2026-11-16
271
+
272
+ - When the current session was created before the saved policy, the panel now
273
+ says so under the KPI strip: "本会话在策略保存前创建,不受新策略影响;「策略后」是
274
+ 下一个新会话的预估。" Previously only the Notes tab mentioned it, so a switch
275
+ that changed "策略后" but not "首轮注入" looked like a refresh bug.
276
+ - Eight locales gained `sessionNotApplied`.
277
+
278
+ ## 1.10.3 — 2026-11-16
279
+
280
+ - Fixed "I switched it off but the panel still shows the old numbers": the panel's
281
+ snapshot fetch used a single in-flight flag, so a poll that started before your
282
+ click could swallow the fresh reload, leaving the old summary until the next
283
+ poll. Responses now carry a sequence ticket and only the newest one is applied,
284
+ so a post-write reload always wins.
285
+
286
+ ## 1.10.2 — 2026-11-16
287
+
288
+ - Fixed the plugin metadata error `ENOENT ... D:\DSH\dsh-context-injection\locale\de.json`:
289
+ the profile kept a junction `node_modules/dsh-context-injection` pointing at the
290
+ directory's pre-rename location. The junction is gone; the only link now points
291
+ at `D:\DSH\dsh-injection-manager`.
292
+ - Repaired the mojibake in `package.json`'s description (two `??` where the em
293
+ dashes were) that came from an early PowerShell edit.
294
+
295
+ ## 1.10.1 — 2026-11-16
296
+
297
+ - Fixed the "switched-off suite becomes unfindable" bug: items that leave the
298
+ assembled prompt because the policy excludes them are remembered (per agent
299
+ and by name across agents) and listed again under 「已关闭」 with their size and
300
+ a 「恢复整套」 button. Restoration goes through a new `names` action, because
301
+ item/group toggles cannot address names the assembly no longer contains.
302
+ - The item list also gained sorting: 按 token / 按名称, applied to both flat rows
303
+ and suite order, remembered per browser.
304
+ - The closed-index used the wrong policy shape (`policy.channels` instead of the
305
+ flat `policy.<channel>`), which is why it always came back empty; two new tests
306
+ cover a tool disappearing between builds and the cross-agent name memory.
307
+
308
+ ## 1.10.0 — 2026-11-16
309
+
310
+ - The composer chip is quieter: muted text with a dot, no border until hover,
311
+ `83.8k 97%` instead of `注入 83.8k · 可关闭 97%`, plus a hover × to hide it.
312
+ Hiding is per browser (localStorage) and the Notes tab can switch it back on.
313
+ The chip now carries its own stylesheet — it used to render as a native
314
+ button because the panel's `<style>` only mounted with the panel.
315
+ - The panel refreshes itself: a silent `/summary` poll every 5 s (chip: 15 s)
316
+ while the page is visible, paused when hidden, plus an immediate broadcast on
317
+ every write. A policy changed by `/inject`, another window or a plugin reload
318
+ now shows up without pressing 刷新.
319
+
320
+ ## 1.9.10 — 2026-11-15
321
+
322
+ - Corrected a stale limitation line: sections are filtered through the scoped
323
+ `system-prompt/assemble` waterfall, not "shadowed with an empty same-name
324
+ section" (that was the first approach and it threw).
325
+ - README version callouts updated to 1.9.9 with the current feature list.
326
+
327
+ ## 1.9.9 — 2026-11-15
328
+
329
+ - Both READMEs gained a "60-second tour" / 「60 秒演示」: five steps with the
330
+ expected numbers, including the part people misread (an existing session is
331
+ not affected by a policy saved later).
332
+
333
+ ## 1.9.8 — 2026-11-15
334
+
335
+ - "最近一次应用" now says what the policy actually did to each channel:
336
+ `段落 2/25 · 上下文 0/9 · 技能 0/38 · 工具 9/280`. Counts are recorded in the
337
+ apply report via a shared `countChannelState()`, with three unit tests.
338
+ - Real check: a new agent created under the minimal preset reported
339
+ `sections 2/25, contexts 0/9, skills 0/38, tools 9/280, saved 78,799`; the
340
+ policy was then restored to `all` with undo.
341
+
342
+ ## 1.9.7 — 2026-11-15
343
+
344
+ - Item list shows what the current budget plan would switch off: a small
345
+ "预算外" tag per row and "129 预算外" on the suite header, so the list and the
346
+ budget page tell the same story. Tags only appear when a budget target is set.
347
+ - Eight locales gained `outsideBudget` / `outsideBudgetHint`; a one-line
348
+ formatting glitch in `groupLabelOf` was tidied while nearby.
349
+
350
+ ## 1.9.6 — 2026-11-15
351
+
352
+ - The Policy tab now warns before a preset switch replaces manual choices:
353
+ "当前有 229 项手动关闭;切换预设会重算并覆盖这些选择。" The count comes from
354
+ a shared `excludedCountOf()` used by both the policy and budget pages.
355
+ - FAQ says presets behave the same way as applying a budget.
356
+
357
+ ## 1.9.5 — 2026-11-15
358
+
359
+ - Budget page warns before it overwrites manual choices: "当前有 N 项被手动关闭;
360
+ 应用建议会按预算重算,并覆盖这些选择。" with the real count (229 after one
361
+ REA switch in the fixture).
362
+ - FAQ explains that applying a budget recomputes instead of stacking, and what
363
+ to do if you want to keep manual exclusions.
364
+
365
+ ## 1.9.4 — 2026-11-15
366
+
367
+ - The render boundary now shows what failed, offers Reload and Copy error, and
368
+ says the error is recorded at `/diag` (and that `/inject` still works) instead
369
+ of printing a bare message. Its copy is bilingual on purpose: the boundary can
370
+ render before locale data loads.
371
+ - Empty list: "没有匹配的条目" plus a Clear filters button that resets search,
372
+ channel and the switchable-only filter in one click.
373
+ - Eight locales gained `noMatch` / `clearFilters`.
374
+
375
+ ## 1.9.3 — 2026-11-15
376
+
377
+ - Budget page: quick targets (24k / 48k / 80k), a sort switch for the suggestion
378
+ list (by tokens / by suite name, remembered), and a plain "还有 N 组未列出"
379
+ instead of a bare `+N`.
380
+ - Real host check: setting 24000 yields `plan.after = 23945`, 147 drops in 7
381
+ groups; clearing the budget returns to 0 drops.
382
+
383
+ ## 1.9.2 — 2026-11-15
384
+
385
+ - Keyboard: `/` focuses the search box from anywhere outside a text field.
386
+ - The item list exposes `role="group"` with a count label, so screen readers
387
+ announce "条目 · 352" instead of an unnamed region.
388
+ - Accessibility sweep over all four tabs (headless Chromium): 0 buttons without
389
+ an accessible name, 0 unlabeled inputs, 0 switches without a name, proper
390
+ `aria-pressed` / `aria-expanded`, H1 → H2 heading order.
391
+
392
+ ## 1.9.1 — 2026-11-15
393
+
394
+ - The tool/command text report ends with `宿主 DSH … · 撤销栈 N 步 · 策略文件 …`,
395
+ so a pasted report carries the host version, undo depth and policy path.
396
+ - Both READMEs gained "At a glance" / 「能力一览」: nine capabilities and where to
397
+ find each one.
398
+
399
+ ## 1.9.0 — 2026-11-15
400
+
401
+ - Host compatibility probe: the plugin reads the running DSH version
402
+ (`DSH_INSTALL_DIR`, then `@deepseek-ai/dsh` from the profile) and shows a
403
+ banner when it is older than the tested 0.2.2. Unknown versions stay unknown.
404
+ `/diag` exposes `host`, `/summary` carries it to the panel.
405
+ - Three `hostinfo` tests cover rc suffixes, a newer manifest and an unknown host.
406
+
407
+ ## 1.8.8 — 2026-11-15
408
+
409
+ - Restoring an earlier step now asks once ("确认回退?" / Cancel): it discards
410
+ newer history, so a stray click should not be enough.
411
+ - Eight locales gained `confirmRestore` / `cancel`; the demo GIF was re-recorded
412
+ with the corrected custom-preset label after a suite switch.
413
+
414
+ ## 1.8.7 — 2026-11-15
415
+
416
+ - Multi-step undo: the Policy tab lists the last 20 remembered steps with their
417
+ label and time, and a Restore button jumps back to any of them (discarding the
418
+ newer ones). `/summary` exposes `undo.entries`; a new `restore` action drives
419
+ it. Restoring does not push a new history entry — it is an undo.
420
+ - Route test covers two actions, the entry list, restore-to-first and an empty
421
+ history afterwards.
422
+
423
+ ## 1.8.6 — 2026-11-15
424
+
425
+ - Undo history entries carry the action label, so the footer button reads
426
+ "撤销上一步 · 已关闭 REA · 229 条目" instead of a bare button. The label comes
427
+ from the client (already localized) with a server-side fallback for API calls.
428
+ - `/summary` exposes `undo.last` / `undo.lastAt`; route tests cover the fallback.
429
+
430
+ ## 1.8.5 — 2026-11-15
431
+
432
+ - Toasts now say what happened: "已关闭 REA · 229 条目" with Undo, instead of a
433
+ generic "已写入". Item, group, channel and preset actions each carry their own
434
+ message; undo says "已撤销".
435
+ - Eight locales gained `turnedOn` / `turnedOff` / `undone`; the demo GIF was
436
+ re-recorded.
437
+
438
+ ## 1.8.4 — 2026-11-15
439
+
440
+ - "Switchable only" filter in the item toolbar: hides read-only entries
441
+ (workspace rules, required contexts), 34 groups become 31 on the reference
442
+ snapshot. The footer shows `31/34` while the filter is on, and the choice is
443
+ remembered like the view mode.
444
+ - Eight locales gained `onlySwitchable` / `onlySwitchableHint`.
445
+
446
+ ## 1.8.3 — 2026-11-15
447
+
448
+ - The Notes tab now carries the effective-assembly check: one button calls
449
+ `/verify`, shows whether this session was created with the policy, and prints
450
+ the effective section/context/tool counts next to the panel's own numbers.
451
+ - Eight locales gained the `verify*` keys; the about screenshot was refreshed.
452
+
453
+ ## 1.8.2 — 2026-11-15
454
+
455
+ - Search highlights the matched substring in group labels and item names.
456
+ The helper is named `HitMark` on purpose: `Highlight` is a DOM global (CSS
457
+ Custom Highlight API), and the first version crashed every row by shadowing
458
+ it — caught while verifying with real page errors, not by reading the code.
459
+
460
+ ## 1.8.1 — 2026-11-15
461
+
462
+ - The success toast now carries an inline Undo for six seconds, so a mistaken
463
+ suite switch can be reverted without scrolling to the footer.
464
+ - Policy tab: Copy report (clipboard), next to export/import; the settings
465
+ screenshot was regenerated with the new buttons.
466
+ - Eight locales gained `copyReport` / `copied` / `copyFailed`.
467
+
468
+ ## 1.8.0 — 2026-11-15
469
+
470
+ - Policy import: the Policy tab accepts a JSON file — either a bare policy or a
471
+ whole exported manifest — validates it, writes it atomically, and records it
472
+ on the undo stack, so an import can be reverted with one click.
473
+ - Action bodies may be up to 1 MiB so an exported manifest can be pasted back;
474
+ imports that are not objects are rejected with `invalid-policy`.
475
+ - Route tests cover bare policy, exported manifest, undo after import and the
476
+ invalid shape.
477
+
478
+ ## 1.7.0 — 2026-11-15
479
+
480
+ - `/inject apply [tokens]`: turn the current (or given) budget into a policy from
481
+ the terminal, with the per-suite summary in the reply.
482
+ - `/inject undo`: revert the last policy write from the command line.
483
+ - Command writes now share the panel's undo history. The new command tests
484
+ caught that they previously bypassed it, so `/inject undo` after
485
+ `/inject apply` used to fail with "nothing-to-undo".
486
+ - Six command tests cover budget, apply, undo, an already-fitting target and
487
+ unknown subcommands.
488
+
489
+ ## 1.6.1 — 2026-11-15
490
+
491
+ - The group/flat view and the selected tab persist across reloads (localStorage,
492
+ per browser). Private windows fall back to the defaults.
493
+ - The fourth KPI now answers "how big is the first request next to the whole
494
+ session": `697.6k` with `占本会话 12%` instead of a bare "not comparable" note.
495
+ - Screenshots and the demo GIF re-recorded with the new toolbar and KPI.
496
+
497
+ ## 1.6.0 — 2026-11-15
498
+
499
+ - The KPI shows the preset by name (全开 / 极简 / 自定义 / Everything / Minimal)
500
+ instead of the raw id, and carries the saved percentage when a policy is active.
501
+ - Group view gained 展开全部 / 折叠全部; the toolbar now reads search → view mode
502
+ → channel filter → expand controls.
503
+ - Tried a per-row size bar behind each row; it read as stray underlines, so it
504
+ was removed before release rather than shipped as decoration.
505
+
506
+ ## 1.5.1 — 2026-11-15
507
+
508
+ - Budget suggestions are summarised per suite: a 130-item "turn REA off"
509
+ suggestion is one row instead of a flat list of 147 items, and the same suite
510
+ is never listed twice across channels. The plan still applies item names, so
511
+ applying it remains a normal policy write.
512
+
513
+ ## 1.5.0 — 2026-11-15
514
+
515
+ - `npm run smoke`: runs the whole snapshot pipeline against a fake context and
516
+ prints the text report, so the plugin can be sanity-checked without DSH. CI
517
+ runs it too.
518
+ - SECURITY.md: reporting channel, verifiable boundaries (no eval, no network,
519
+ no workspace writes), accepted risks.
520
+ - GitHub issue templates (bug / feature) and a pull-request template ask for the
521
+ `/diag` fields and the locale-key check that actually matter.
522
+ - Locale parity is now tested: every language must match English's key paths,
523
+ have non-empty values, keep identical `{placeholders}`, and ship its detail
524
+ document.
525
+
526
+ ## 1.4.1 — 2026-11-15
527
+
528
+ - Market screenshots extended to six: suites, budget, policy, sidebar, settings
529
+ and the dark theme; `screenshots.json` updated.
530
+ - `docs/PERFORMANCE.md`: measured timings on the real 352-item snapshot
531
+ (panel ready 168–240 ms, 229-row expand 61–120 ms, search 37–54 ms) and the
532
+ conclusion that a virtual list is unnecessary.
533
+ - README shows the dark theme and links the performance page.
534
+
535
+ ## 1.4.0 — 2026-11-15
536
+
537
+ - Security: JSON responses carry `nosniff` / `DENY` / `no-store`; writes also
538
+ check that a present `Origin` matches the serving host (on top of the
539
+ `sec-fetch-site` and JSON content-type checks). Covered by tests.
540
+ - Release pipeline: `.github/workflows/release.yml` runs on `v*` tags, verifies
541
+ the tag matches `package.json`, runs the full suite, checks the pack contents
542
+ and publishes to npm with the `NPM_TOKEN` secret (provenance enabled).
543
+ - CONTRIBUTING.md: local loop, pre-commit checks, design constraints, release.
544
+ - Search input is deferred (`useDeferredValue`) so typing stays responsive on a
545
+ 350-row table.
546
+
547
+ ## 1.3.1 — 2026-11-15
548
+
549
+ - Integration tests: a fake context drives `applyPolicyForAgent` through all
550
+ four channels; route tests cover suite toggles, undo, export and the
551
+ cross-site guard (27 tests total).
552
+ - Docs: architecture (channels, snapshot pipeline, apply timing) and a FAQ.
553
+ - README demo GIF: switching the REA suite off and undoing it, recorded from
554
+ the fixture against real snapshot data.
555
+
556
+ ## 1.3.0 — 2026-11-15
557
+
558
+ - Eight UI languages: Simplified Chinese, English, Japanese, Spanish, French,
559
+ German, Russian and Portuguese. The panel follows the browser language, and
560
+ the host locale service receives every dictionary, so switching the
561
+ application language works too. Units (`chars`/`items`/`groups`, the AGENTS.md
562
+ chain line, the "required" badge) are localized instead of hard-coded.
563
+ - New screenshot of the Policy tab, now listed in `screenshots.json`.
564
+
565
+ ## 1.2.1 — 2026-11-15
566
+
567
+ - Accessibility: visible `:focus-visible` rings on every control, `role="alert"`
568
+ for failed actions and `role="status"` for confirmations, Escape closes the
569
+ sidebar panel, transitions respect `prefers-reduced-motion`, and the read-only
570
+ badge got a higher-contrast colour.
571
+ - Policy tab: fixed-height text areas instead of stretching to the card.
572
+
573
+ ## 1.2.0 — 2026-11-15
574
+
575
+ - Export the manifest: `GET /plugins/dsh-injection-manager/export?format=md|json`
576
+ and two buttons in the Policy tab. Markdown for a ticket, JSON for comparing
577
+ two machines; same snapshot as the panel.
578
+ - Text rendering tests (suite list, missing instruction files, session anchor).
579
+
580
+ ## 1.1.0 — 2026-11-15
581
+
582
+ - Undo: every policy write remembers the previous policy (20 deep), so a whole
583
+ 229-item suite switch is one click away from being reverted. The panel shows
584
+ an Undo button whenever history is available.
585
+
586
+ - Plugin configuration card (Plugins → Configuration): hide the composer chip,
587
+ refresh on window focus, show raw key names, and seed a first-run token budget.
588
+ The plugin keeps working when the schema library cannot be resolved (Config is
589
+ then omitted instead of failing activation).
590
+ - The panel now reports a failed switch instead of silently doing nothing, and
591
+ confirms a successful write briefly.
592
+ - Settings loader is covered by unit tests.
593
+
594
+ ## 1.0.1 — 2026-11-15
595
+
596
+ - Renamed to `dsh-injection-manager` (from the 1.0.0 development name
597
+ `dsh-context-injection`, itself from `dsh-context-preflight`). The name owns
598
+ the "injection" word — DSH's own tool is `context_injection` — instead of
599
+ competing with 83 `context-*` plugins. Old policy files are still imported.
600
+ - README: install command in the first screen, CI/license/dsh badges, three real
601
+ panel screenshots, `screenshots.json` for the plugin market, and a
602
+ compatibility document.
603
+ - CI workflow: syntax check + unit tests on Node 20/22 + bundle metadata check.
604
+ - Policy data directory is now `$DSH_HOME/injection-manager/`; both earlier
605
+ locations are read once on first upgrade.
606
+
607
+ ## 1.0.0 — 2026-11-15
608
+
609
+ First release under the new name and package id `dsh-injection-manager`
610
+ (previously developed as `dsh-context-preflight`).
611
+
612
+ - One snapshot of the first request: prompt sections, runtime contexts, skill
613
+ catalog, tool schemas and the workspace-rule chain, each with characters and
614
+ estimated tokens.
615
+ - Suites: entries cluster into switchable groups (one MCP server = one suite,
616
+ otherwise shared naming prefixes, skills by provider, sections/contexts by
617
+ namespace), so 229 REA tools become a single switch with a tri-state state.
618
+ - Per-item switches, per-channel master switches, `all` / `only` / `except`
619
+ modes, two presets, a greedy token budget and custom persona prefix/suffix.
620
+ - Effects are session-scoped registrations: prompt sections and runtime
621
+ contexts through a scoped `system-prompt/assemble` filter, skills by shadow
622
+ registration, tools through `tools.restrict`. No user file is read or
623
+ written.
624
+ - Read-only model tool `context_injection`, `/inject` command, sidebar icon,
625
+ composer chip, management page, and a `/verify` route that re-assembles a
626
+ live session to prove the policy landed.
627
+ - Policy is imported once from `dsh-context-preflight` when only the old file
628
+ exists.
629
+
630
+ ### Fixed compared with the pre-1.0 development line
631
+
632
+ - Never renames `AGENTS.md` or rewrites `SKILL.md`; disabling a rule no longer
633
+ mutates the workspace.
634
+ - Required runtime contexts (working directory, subagent identity) can no
635
+ longer be dropped by a policy.
636
+ - Section/context exclusion no longer fails with "already registered in this
637
+ scope" (agent presets own those names); it uses the scoped assemble filter.
638
+ - One implementation of the preview math, so the panel and the applied policy
639
+ cannot disagree.
640
+ - Policy writes are atomic and per-action; two open panels cannot overwrite
641
+ each other's switches.
642
+ - Cross-site POSTs are rejected; the action API requires same-origin JSON.