@khorsheed/dsh-context-guard 0.2.5 → 0.2.7
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 +8 -0
- package/README.en.md +5 -3
- package/README.i18n.yaml +2 -2
- package/README.md +5 -2
- package/lib/client.js +18 -18
- package/lib/types/client/icons.d.ts +1 -2
- package/lib/types/client/icons.js +0 -1
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/index.js +1 -1
- package/package.json +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# 变更记录
|
|
2
2
|
|
|
3
|
+
## 0.2.7(2026-10-26)
|
|
4
|
+
|
|
5
|
+
- **README 更新**:设置截图换成新版「插件 → 内置插件配置 → 压缩提醒时机」两张,文字改为大白话。无功能变更。
|
|
6
|
+
|
|
7
|
+
## 0.2.6(2026-10-24)
|
|
8
|
+
|
|
9
|
+
- `dsh.references` 去掉已退役的 `@khorsheed/dsh-bundle-conversation-toolbox`(其成员全部并入 basic)。
|
|
10
|
+
|
|
3
11
|
## 0.2.5(2026-10-22)
|
|
4
12
|
|
|
5
13
|
- **设置卡回归插件页**:家族/模式 bundle 折叠后阈值设置卡整体失声——`plugins.row.config` 的键钉死了旧载体 bundle(成员行现由模式包承载,键永不命中),0.1.5 座位 `settings.plugin.item` 已被宿主改名删除(现名 `plugins.item`),鸭式老臂静默失效。现在改为注册一个 `plugins.item` 列表条目并以 `configForms.whileServed` 门在服役中的 `context-guard` 命名空间上:独立安装、家族 bundle、模式包三种形态同一张卡,组合摘掉该行时卡也干净消失。代价:宿主 <0.1.7-alpha.1 不再渲染设置卡(输入框压缩按钮等其余面不变,已记入 README 兼容节与 `dsh.compat.notes`)。见 [Agent Note](../../.agents/notes/implemented/bug-fix/2026-10-18-bundle-member-config-card-via-plugins-item.md)
|
package/README.en.md
CHANGED
|
@@ -6,7 +6,7 @@ A "compact now" button that shows up in the composer before your context runs ou
|
|
|
6
6
|
|
|
7
7
|
The longer a conversation runs, the fuller the context gets — and at the far end the provider starts rejecting requests outright. That wall arrives earlier than the 100% the context ring suggests, because every request also reserves room for the output. This plugin's job is simple: once occupancy crosses the ratio you set, an amber button appears in the composer's toolbar, and clicking it is the same as typing `/compact` yourself. It never compacts for you — it just reminds you while you still can.
|
|
8
8
|
|
|
9
|
-
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/context-guard-button.png" width="
|
|
9
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/context-guard-button.png" width="560" alt="the compact button appears in the composer toolbar once context occupancy crosses the configured ratio">
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
@@ -15,8 +15,6 @@ The longer a conversation runs, the fuller the context gets — and at the far e
|
|
|
15
15
|
- **Runs the official `/compact`** — idle-gating, the compaction lock, and presentation stay host-owned; a click behaves exactly like the typed command.
|
|
16
16
|
- **One live tunable** — the reminder threshold, editable in settings with no restart.
|
|
17
17
|
|
|
18
|
-
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/context-guard-settings.png" width="640" alt="the trigger ratio is configurable in settings (0.01–1)">
|
|
19
|
-
|
|
20
18
|
## Install
|
|
21
19
|
|
|
22
20
|
```sh
|
|
@@ -33,6 +31,10 @@ dsh plugin --profile web remove @khorsheed/dsh-context-guard
|
|
|
33
31
|
|
|
34
32
|
One tunable, editable in the GUI and live with no restart — on 0.1.5 under Settings → Plugins ("压缩提醒时机 / Compaction reminder timing"); on 0.1.6-alpha.2+ in the bundle's own configuration section on its Plugins-page detail view.
|
|
35
33
|
|
|
34
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/context-guard-config-1.png" width="560" alt="The Plugins page's built-in plugin settings: the last card is Compaction reminder timing">
|
|
35
|
+
|
|
36
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/context-guard-config-2.png" width="560" alt="The Compaction reminder timing detail page: the reminder ratio set to 0.3 (customized), range 0.01–1, with Reset">
|
|
37
|
+
|
|
36
38
|
| Key | Default | Meaning |
|
|
37
39
|
|---|---|---|
|
|
38
40
|
| `thresholdRatio` | `0.8` | Context occupancy fraction at which the button appears (clamped to (0, 1]). Lower it to be reminded earlier — the provider rejection wall sits below 100% occupancy (see *How it works*). |
|
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# last confirmed-consistent state. Both languages carry equal authority; after
|
|
3
3
|
# editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/context-guard/README.en.md
|
|
5
|
-
packages/context-guard/README.en.md:
|
|
6
|
-
packages/context-guard/README.md:
|
|
5
|
+
packages/context-guard/README.en.md: 22b915c36929319553c65fac2892efeaaa8ec4af
|
|
6
|
+
packages/context-guard/README.md: 915c4eb527d89be0c4bc6f6d48878e1ec37592f1
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
聊得越久,上下文占用越高,涨到头 provider 会直接拒收请求——这堵墙比进度环的 100% 来得更早(请求还要给输出留位置)。这个插件就是干这个的:占用一过你设的比例,输入框工具栏里就出现一枚琥珀色按钮,点一下等于亲手输入 `/compact`。它不替你自动压缩,只在你还来得及的时候提醒你。
|
|
8
8
|
|
|
9
|
-
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/context-guard-button.png" width="
|
|
9
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/context-guard-button.png" width="560" alt="上下文占用越过配置比例后,输入框工具栏里出现琥珀色的压缩按钮">
|
|
10
10
|
|
|
11
11
|
## 功能
|
|
12
12
|
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
- **执行官方 `/compact`**——空闲门控、压缩锁和流程展示都由宿主负责,点击的效果和手打命令一模一样。
|
|
16
16
|
- **一个实时可调项**——提醒阈值在设置里改,保存即生效,不用重启。
|
|
17
17
|
|
|
18
|
-
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/context-guard-settings.png" width="640" alt="提醒比例可在设置中按偏好调整(0.01–1)">
|
|
19
18
|
|
|
20
19
|
## 安装
|
|
21
20
|
|
|
@@ -33,6 +32,10 @@ dsh plugin --profile web remove @khorsheed/dsh-context-guard
|
|
|
33
32
|
|
|
34
33
|
一个可调项,在 GUI 里改且实时生效,无需重启——0.1.5:设置 → 插件配置 →「压缩提醒时机 / Compaction reminder timing」;0.1.6-alpha.2 起:插件管理页 → 本包详情页的配置区。
|
|
35
34
|
|
|
35
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/context-guard-config-1.png" width="560" alt="「插件」页的「内置插件配置」:最后一张是「压缩提醒时机」卡片">
|
|
36
|
+
|
|
37
|
+
<img src="https://raw.githubusercontent.com/Khorsheed/dsh-basic/main/docs/screenshots/context-guard-config-2.png" width="560" alt="「压缩提醒时机」详情页:提醒比例改成 0.3(已自定义),可配置范围 0.01–1,旁边是重置">
|
|
38
|
+
|
|
36
39
|
| 键 | 默认值 | 含义 |
|
|
37
40
|
|---|---|---|
|
|
38
41
|
| `thresholdRatio` | `0.8` | 压缩按钮出现时的上下文占用比例(限制在 (0, 1])。想更早收到提醒就调低——provider 拒绝墙在 100% 占用之下(见「实现原理」)。 |
|
package/lib/client.js
CHANGED
|
@@ -207,11 +207,11 @@ window.__ModuleLoader__.load({
|
|
|
207
207
|
document.head.appendChild(tag);
|
|
208
208
|
}
|
|
209
209
|
var CompactGuardButton_module_css_default = {
|
|
210
|
-
"icon": "BFFw2a_icon",
|
|
211
210
|
"warning": "BFFw2a_warning",
|
|
212
|
-
"wrap": "BFFw2a_wrap",
|
|
213
211
|
"button": "BFFw2a_button",
|
|
214
|
-
"error": "BFFw2a_error"
|
|
212
|
+
"error": "BFFw2a_error",
|
|
213
|
+
"wrap": "BFFw2a_wrap",
|
|
214
|
+
"icon": "BFFw2a_icon"
|
|
215
215
|
};
|
|
216
216
|
//#endregion
|
|
217
217
|
//#region src/client/CompactGuardButton.tsx
|
|
@@ -290,28 +290,28 @@ window.__ModuleLoader__.load({
|
|
|
290
290
|
}
|
|
291
291
|
var SettingsCard_module_css_default = {
|
|
292
292
|
"badge": "DKjZXq_badge",
|
|
293
|
-
"
|
|
294
|
-
"fieldHead": "DKjZXq_fieldHead",
|
|
295
|
-
"footer": "DKjZXq_footer",
|
|
296
|
-
"saved": "DKjZXq_saved",
|
|
297
|
-
"secondary": "DKjZXq_secondary",
|
|
298
|
-
"chevron": "DKjZXq_chevron",
|
|
299
|
-
"description": "DKjZXq_description",
|
|
293
|
+
"inputRow": "DKjZXq_inputRow",
|
|
300
294
|
"headText": "DKjZXq_headText",
|
|
301
|
-
"save": "DKjZXq_save",
|
|
302
|
-
"field": "DKjZXq_field",
|
|
303
|
-
"reset": "DKjZXq_reset",
|
|
304
295
|
"inputInvalid": "DKjZXq_inputInvalid",
|
|
296
|
+
"reset": "DKjZXq_reset",
|
|
297
|
+
"header": "DKjZXq_header",
|
|
298
|
+
"chevronOpen": "DKjZXq_chevronOpen",
|
|
299
|
+
"fieldName": "DKjZXq_fieldName",
|
|
300
|
+
"fieldHead": "DKjZXq_fieldHead",
|
|
301
|
+
"chevron": "DKjZXq_chevron",
|
|
305
302
|
"name": "DKjZXq_name",
|
|
303
|
+
"description": "DKjZXq_description",
|
|
306
304
|
"input": "DKjZXq_input",
|
|
307
|
-
"
|
|
305
|
+
"hint": "DKjZXq_hint",
|
|
308
306
|
"status": "DKjZXq_status",
|
|
309
|
-
"header": "DKjZXq_header",
|
|
310
|
-
"cardOpen": "DKjZXq_cardOpen",
|
|
311
307
|
"errorText": "DKjZXq_errorText",
|
|
312
|
-
"
|
|
308
|
+
"field": "DKjZXq_field",
|
|
309
|
+
"footer": "DKjZXq_footer",
|
|
310
|
+
"secondary": "DKjZXq_secondary",
|
|
311
|
+
"save": "DKjZXq_save",
|
|
312
|
+
"saved": "DKjZXq_saved",
|
|
313
|
+
"cardOpen": "DKjZXq_cardOpen",
|
|
313
314
|
"body": "DKjZXq_body",
|
|
314
|
-
"fieldName": "DKjZXq_fieldName",
|
|
315
315
|
"card": "DKjZXq_card"
|
|
316
316
|
};
|
|
317
317
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Generated by scripts/sync-icon-artwork.mts from @deepseek-ai/dsh-client-ui-primitives
|
|
3
|
-
* (v0.1
|
|
3
|
+
* (v0.2.1-rc.1, harness 1600d8a1e1) — do not edit by hand. The 0.1.5 and rc.1 host lines
|
|
4
4
|
* share no icon export name, so the rc.1 artwork is inlined here: pure SVG,
|
|
5
5
|
* no host runtime identity, identical on every line. Re-run the generator
|
|
6
6
|
* after adding an icon import or bumping the harness checkout.
|
|
@@ -14,6 +14,5 @@ export interface IconProps {
|
|
|
14
14
|
/** Extra class for layout placement; color rides currentColor. */
|
|
15
15
|
className?: string | undefined;
|
|
16
16
|
}
|
|
17
|
-
export declare const IconChevronDownOutlineMedium: ({ size, className }: IconProps) => import("react").JSX.Element;
|
|
18
17
|
export declare const IconWarningOutlineMedium: ({ size, className }: IconProps) => import("react").JSX.Element;
|
|
19
18
|
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export const IconChevronDownOutlineMedium = ({ size = 14, className }) => (_jsx("svg", { width: size, height: size, className: className, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", strokeWidth: 1.3, children: _jsx("path", { d: "M4 6L7.29289 9.29289C7.68342 9.68342 8.31658 9.68342 8.70711 9.29289L12 6", stroke: "currentColor" }) }));
|
|
3
2
|
export const IconWarningOutlineMedium = ({ size = 16, className }) => (_jsxs("svg", { width: size, height: size, className: className, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", strokeWidth: 1.3, children: [_jsx("path", { d: "M8 14.5C11.5899 14.5 14.5 11.5899 14.5 8C14.5 4.41015 11.5899 1.5 8 1.5C4.41015 1.5 1.5 4.41015 1.5 8C1.5 11.5899 4.41015 14.5 8 14.5Z", stroke: "currentColor" }), _jsx("path", { d: "M8 4.29199V9.79199", stroke: "currentColor" }), _jsx("path", { d: "M8 10.708V11.708", stroke: "currentColor" })] }));
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* card editing the same number live: a `plugins.item` entry on the Plugins
|
|
8
8
|
* page gated by `configForms.whileServed` on the `context-guard` namespace
|
|
9
9
|
* (the official companion convention), so every install shape — standalone,
|
|
10
|
-
* the
|
|
10
|
+
* the basic bundle, a mode pack — surfaces the same card, and
|
|
11
11
|
* a composition without the row shows no trace of it. The action
|
|
12
12
|
* rides the official `/compact` command
|
|
13
13
|
* channel (`remote.commands.execute` → host `ctx.commands` →
|
|
@@ -56,7 +56,7 @@ export function apply(ctx, config) {
|
|
|
56
56
|
}, CompactGuardButton));
|
|
57
57
|
// One Plugins-page card gated on the SERVED NAMESPACE, never on the install
|
|
58
58
|
// shape: whichever composition carries the `context-guard` row — standalone,
|
|
59
|
-
// the
|
|
59
|
+
// the basic bundle, or a mode pack — serves the row's
|
|
60
60
|
// volatile Config under the row id, and `whileServed` keeps the
|
|
61
61
|
// `plugins.item` entry alive for exactly that span (the official companion
|
|
62
62
|
// convention), so a composition without the row shows no trace of the card.
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"context",
|
|
9
9
|
"compaction"
|
|
10
10
|
],
|
|
11
|
-
"version": "0.2.
|
|
11
|
+
"version": "0.2.7",
|
|
12
12
|
"type": "module",
|
|
13
13
|
"main": "lib/index.js",
|
|
14
14
|
"types": "lib/types/index.d.ts",
|
|
@@ -26,9 +26,6 @@
|
|
|
26
26
|
"./locale/*.json": "./locale/*.json"
|
|
27
27
|
},
|
|
28
28
|
"dsh": {
|
|
29
|
-
"references": [
|
|
30
|
-
"@khorsheed/dsh-bundle-conversation-toolbox"
|
|
31
|
-
],
|
|
32
29
|
"bundle": {
|
|
33
30
|
"patch": "./cordis.patch.yml"
|
|
34
31
|
},
|