dsh-context 0.30.2 → 0.30.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +22 -21
- package/lib/index.d.ts +2 -2
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -52,7 +52,7 @@ window.__ModuleLoader__.load({
|
|
|
52
52
|
"settings.collapse": "收起",
|
|
53
53
|
"settings.readOnly": "当前环境的设置为只读",
|
|
54
54
|
"gran.total": "全量",
|
|
55
|
-
"gran.
|
|
55
|
+
"gran.delta": "增量",
|
|
56
56
|
"gran.modeHint": "全量:累计构成;增量:相对上一条请求的变化量",
|
|
57
57
|
"trend.hint": "✂ 表示压缩/剪枝,步骤/轮次 切换粒度",
|
|
58
58
|
"trend.empty": "发起一轮对话后,这里会展示每次模型请求的上下文构成",
|
|
@@ -85,7 +85,7 @@ window.__ModuleLoader__.load({
|
|
|
85
85
|
"tip.turn": "第 {t} 轮 · 共 {n} 步",
|
|
86
86
|
"tip.total": "合计 ≈ {n}",
|
|
87
87
|
"tip.actual": "(实际 {n})",
|
|
88
|
-
"tip.
|
|
88
|
+
"tip.delta": "Δ {n}",
|
|
89
89
|
"ev.compaction": "压缩上下文(摘要替换 {n} 条消息)",
|
|
90
90
|
"ev.prune": "剪枝工具输出",
|
|
91
91
|
"ev.skill": "Skill 注入({name})",
|
|
@@ -199,8 +199,8 @@ window.__ModuleLoader__.load({
|
|
|
199
199
|
"settings.collapse": "Collapse",
|
|
200
200
|
"settings.readOnly": "Settings are read-only in this environment",
|
|
201
201
|
"gran.total": "Total",
|
|
202
|
-
"gran.
|
|
203
|
-
"gran.modeHint": "Total: cumulative makeup;
|
|
202
|
+
"gran.delta": "Delta",
|
|
203
|
+
"gran.modeHint": "Total: cumulative makeup; Delta: change vs the previous request",
|
|
204
204
|
"trend.hint": "✂ marks compaction/prune, Step/Turn switches granularity",
|
|
205
205
|
"trend.empty": "Send a message and each model request’s context makeup shows up here",
|
|
206
206
|
"detail.step": "Turn {t} · Step {s}",
|
|
@@ -232,7 +232,7 @@ window.__ModuleLoader__.load({
|
|
|
232
232
|
"tip.turn": "Turn {t} · {n} steps",
|
|
233
233
|
"tip.total": "Total ≈ {n}",
|
|
234
234
|
"tip.actual": " (actual {n})",
|
|
235
|
-
"tip.
|
|
235
|
+
"tip.delta": "Δ {n}",
|
|
236
236
|
"ev.compaction": "Context compacted (summary replaced {n} messages)",
|
|
237
237
|
"ev.prune": "Tool output pruned",
|
|
238
238
|
"ev.skill": "Skill injected ({name})",
|
|
@@ -1975,8 +1975,8 @@ window.__ModuleLoader__.load({
|
|
|
1975
1975
|
id: "total",
|
|
1976
1976
|
label: t("gran.total")
|
|
1977
1977
|
}, {
|
|
1978
|
-
id: "
|
|
1979
|
-
label: t("gran.
|
|
1978
|
+
id: "delta",
|
|
1979
|
+
label: t("gran.delta")
|
|
1980
1980
|
}],
|
|
1981
1981
|
onPick: (id) => {
|
|
1982
1982
|
props.set?.("defaultTrendMode", id);
|
|
@@ -1991,7 +1991,7 @@ window.__ModuleLoader__.load({
|
|
|
1991
1991
|
const v = value;
|
|
1992
1992
|
return {
|
|
1993
1993
|
...v.defaultGranularity === "step" || v.defaultGranularity === "turn" ? { granularity: v.defaultGranularity } : {},
|
|
1994
|
-
...v.defaultTrendMode === "total" || v.defaultTrendMode === "
|
|
1994
|
+
...v.defaultTrendMode === "total" || v.defaultTrendMode === "delta" ? { mode: v.defaultTrendMode } : {}
|
|
1995
1995
|
};
|
|
1996
1996
|
}
|
|
1997
1997
|
function createContextSettings() {
|
|
@@ -2181,7 +2181,7 @@ window.__ModuleLoader__.load({
|
|
|
2181
2181
|
return function PluginInfo() {
|
|
2182
2182
|
const [latest, setLatest] = React.useState(null);
|
|
2183
2183
|
React.useEffect(() => {
|
|
2184
|
-
if ("0.30.
|
|
2184
|
+
if ("0.30.3".includes("-dev")) return;
|
|
2185
2185
|
let on = true;
|
|
2186
2186
|
fetchLatestVersion().then((v) => {
|
|
2187
2187
|
if (on && v) setLatest(v);
|
|
@@ -2190,8 +2190,8 @@ window.__ModuleLoader__.load({
|
|
|
2190
2190
|
on = false;
|
|
2191
2191
|
};
|
|
2192
2192
|
}, []);
|
|
2193
|
-
const update = latest !== null && isNewerVersion(latest, "0.30.
|
|
2194
|
-
const nameValue = ["dsh-context (v0.30.
|
|
2193
|
+
const update = latest !== null && isNewerVersion(latest, "0.30.3") ? latest : null;
|
|
2194
|
+
const nameValue = ["dsh-context (v0.30.3)"];
|
|
2195
2195
|
if (update) nameValue.push(/* @__PURE__ */ React.createElement("span", {
|
|
2196
2196
|
key: "update",
|
|
2197
2197
|
className: "lc-pi-update"
|
|
@@ -2434,10 +2434,11 @@ window.__ModuleLoader__.load({
|
|
|
2434
2434
|
const anchorOf = (req) => typeof req.prompt === "number" && req.prompt > 0 && req.total > 0 ? req.prompt / req.total : 1;
|
|
2435
2435
|
const barTotalOf = (req) => typeof req.prompt === "number" && req.prompt > 0 ? req.prompt : req.total;
|
|
2436
2436
|
/**
|
|
2437
|
-
*
|
|
2438
|
-
* request
|
|
2437
|
+
* Delta mode: each category becomes |current − previous|, `total` the summed magnitude, `net` the signed change
|
|
2438
|
+
* for the tooltip; the first request starts from zero so the scale is change-driven, and per-request provider
|
|
2439
|
+
* prompt/output are dropped (they are not deltas).
|
|
2439
2440
|
*/
|
|
2440
|
-
const
|
|
2441
|
+
const deltaOf = (req, prev) => {
|
|
2441
2442
|
const out = { ...req };
|
|
2442
2443
|
let churn = 0;
|
|
2443
2444
|
let net = 0;
|
|
@@ -2482,8 +2483,8 @@ window.__ModuleLoader__.load({
|
|
|
2482
2483
|
})));
|
|
2483
2484
|
});
|
|
2484
2485
|
return function TrendChart(props) {
|
|
2485
|
-
const
|
|
2486
|
-
const requests = React.useMemo(() =>
|
|
2486
|
+
const delta = props.mode === "delta";
|
|
2487
|
+
const requests = React.useMemo(() => delta ? props.requests.map((req, i) => deltaOf(req, i > 0 ? props.requests[i - 1] : null)) : props.requests, [props.requests, delta]);
|
|
2487
2488
|
const markers = props.markers;
|
|
2488
2489
|
let maxTotal = 1;
|
|
2489
2490
|
for (const req of requests) {
|
|
@@ -2597,9 +2598,9 @@ window.__ModuleLoader__.load({
|
|
|
2597
2598
|
t: req.turn ?? 0,
|
|
2598
2599
|
s: req.step ?? 0
|
|
2599
2600
|
});
|
|
2600
|
-
if (
|
|
2601
|
+
if (delta) {
|
|
2601
2602
|
const n = req.net ?? 0;
|
|
2602
|
-
return head + " · " + fmtTime(req.time) + " · " + t("tip.
|
|
2603
|
+
return head + " · " + fmtTime(req.time) + " · " + t("tip.delta", { n: (n > 0 ? "+" : "") + fmt(n) });
|
|
2603
2604
|
}
|
|
2604
2605
|
return head + " · " + fmtTime(req.time) + " · " + t("tip.total", { n: fmt(req.total) }) + (req.prompt !== void 0 ? " · " + t("tip.actual", { n: fmt(req.prompt) }) : "");
|
|
2605
2606
|
};
|
|
@@ -2806,11 +2807,11 @@ window.__ModuleLoader__.load({
|
|
|
2806
2807
|
setTrendMode("total");
|
|
2807
2808
|
}
|
|
2808
2809
|
}, t("gran.total")), /* @__PURE__ */ React.createElement("button", {
|
|
2809
|
-
className: "lc-gran-btn" + (trendMode === "
|
|
2810
|
+
className: "lc-gran-btn" + (trendMode === "delta" ? " lc-gran-on" : ""),
|
|
2810
2811
|
onClick: () => {
|
|
2811
|
-
setTrendMode("
|
|
2812
|
+
setTrendMode("delta");
|
|
2812
2813
|
}
|
|
2813
|
-
}, t("gran.
|
|
2814
|
+
}, t("gran.delta"))))), displayRequests.length === 0 ? /* @__PURE__ */ React.createElement("div", { className: "lc-empty" }, t("trend.empty")) : /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(TrendChart, {
|
|
2814
2815
|
key: sessionId,
|
|
2815
2816
|
requests: displayRequests,
|
|
2816
2817
|
markers,
|
package/lib/index.d.ts
CHANGED
|
@@ -218,8 +218,8 @@ interface RequestRecord {
|
|
|
218
218
|
*/
|
|
219
219
|
stepCount?: number;
|
|
220
220
|
/**
|
|
221
|
-
*
|
|
222
|
-
* on the
|
|
221
|
+
* Delta-mode signed net change, set by the Client's deltaOf (only present
|
|
222
|
+
* on the delta-transformed records the TrendChart plots). The Host never
|
|
223
223
|
* sets it.
|
|
224
224
|
*/
|
|
225
225
|
net?: number;
|
package/lib/index.js
CHANGED
|
@@ -370,7 +370,7 @@ const SETTINGS_NAMESPACE = "dsh-context";
|
|
|
370
370
|
/** Section schema: also the wire envelope the browser scope validates against. */
|
|
371
371
|
const SettingsSchema = z$1.object({
|
|
372
372
|
defaultGranularity: z$1.union(["step", "turn"]).default("step"),
|
|
373
|
-
defaultTrendMode: z$1.union(["total", "
|
|
373
|
+
defaultTrendMode: z$1.union(["total", "delta"]).default("total").loose()
|
|
374
374
|
});
|
|
375
375
|
/** Serve the namespace while a settings provider is composed; inert otherwise. */
|
|
376
376
|
function installSettings(ctx) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-context",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.3",
|
|
4
4
|
"description": "A DeepSeek Harness plugin for context insight and management, with context dashboard and context command, for understanding how the context is made of, and how it evolves.",
|
|
5
5
|
"author": "bowenliang123",
|
|
6
6
|
"repository": {
|