dsh-ws-recency 0.33.1 → 0.33.2
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/client.js +1 -66
- package/index.js +1 -1
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -413,7 +413,6 @@
|
|
|
413
413
|
".wsr-hit-time{flex:none;font-variant-numeric:tabular-nums}",
|
|
414
414
|
".wsr-hit-step{flex:none;color:var(--dsw-alias-label-secondary)}",
|
|
415
415
|
".wsr-jump-toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);z-index:9999;padding:6px 12px;border-radius:8px;font-size:12px;background:var(--dsw-alias-bg-layer-3,rgba(32,34,38,.96));color:var(--dsw-alias-label-primary);border:.5px solid var(--dsw-alias-border-l2,rgba(255,255,255,.14));box-shadow:0 8px 24px rgba(0,0,0,.4);pointer-events:none}",
|
|
416
|
-
".wsr-diagnose-toast{max-width:min(680px,90vw);white-space:normal;line-height:1.6;text-align:left;font-variant-numeric:tabular-nums}",
|
|
417
416
|
".wsr-jump-loading{color:var(--dsw-alias-label-secondary)}",
|
|
418
417
|
".wsr-jump-toast-warn{border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary,#d9534f) 45%,transparent);color:var(--dsw-alias-state-error-primary,#d9534f)}",
|
|
419
418
|
".wsr-hit-cwd{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;text-align:left}",
|
|
@@ -534,8 +533,6 @@
|
|
|
534
533
|
"search.assistant": "助手",
|
|
535
534
|
"search.turn": "第 {n} 轮",
|
|
536
535
|
"search.pluginCost": "插件 {ms}ms",
|
|
537
|
-
"menu.diagnose": "插件耗时诊断",
|
|
538
|
-
"diagnose.report": "近 60 秒:扫描 {passes} 次 / 共 {total}ms / 最慢 {worst}ms · 页面节点 {nodes} · 已挂载轮次 {turns}",
|
|
539
536
|
"search.contextShow": "看上下文",
|
|
540
537
|
"search.contextHide": "收起",
|
|
541
538
|
"search.coldExpanded": "第 {turn} 轮在最新一轮之前 {behind} 轮,已展开上下文;要跳转请点这一行的「打开会话」。",
|
|
@@ -753,8 +750,6 @@
|
|
|
753
750
|
"search.assistant": "Assistant",
|
|
754
751
|
"search.turn": "turn {n}",
|
|
755
752
|
"search.pluginCost": "plugin {ms}ms",
|
|
756
|
-
"menu.diagnose": "Plugin cost",
|
|
757
|
-
"diagnose.report": "Last 60s: {passes} passes / {total}ms total / {worst}ms worst · {nodes} nodes · {turns} turns mounted",
|
|
758
753
|
"search.contextShow": "Show context",
|
|
759
754
|
"search.contextHide": "Hide",
|
|
760
755
|
"search.coldExpanded": "Turn {turn} is {behind} turns behind the newest one, so its context is shown here; press Open session on this row to jump.",
|
|
@@ -1930,15 +1925,6 @@
|
|
|
1930
1925
|
* a feedback loop cannot turn into a busy main thread. */
|
|
1931
1926
|
var PASS_MIN_GAP = 400;
|
|
1932
1927
|
var lastPassAt = 0;
|
|
1933
|
-
var passCount = 0;
|
|
1934
|
-
/* Rolling record for the diagnostic row: how often the pass runs and how
|
|
1935
|
-
long it takes, so a claim about cost can be checked on screen. */
|
|
1936
|
-
var passSamples = [];
|
|
1937
|
-
|
|
1938
|
-
function recordPass(spent) {
|
|
1939
|
-
passSamples.push({ at: Date.now(), ms: spent });
|
|
1940
|
-
if (passSamples.length > 200) passSamples.shift();
|
|
1941
|
-
}
|
|
1942
1928
|
|
|
1943
1929
|
function schedule() {
|
|
1944
1930
|
if (disposed || timer !== null) return;
|
|
@@ -1956,15 +1942,12 @@
|
|
|
1956
1942
|
timer = window.setTimeout(function () {
|
|
1957
1943
|
timer = null;
|
|
1958
1944
|
lastPassAt = Date.now();
|
|
1959
|
-
passCount += 1;
|
|
1960
1945
|
var began = Date.now();
|
|
1961
1946
|
try {
|
|
1962
1947
|
apply();
|
|
1963
1948
|
} catch (error) {
|
|
1964
1949
|
console.warn("[dsh-ws-recency] pass failed:", error);
|
|
1965
1950
|
}
|
|
1966
|
-
recordPass(Date.now() - began);
|
|
1967
|
-
if (typeof window !== "undefined") window.__DSH_WSR_PASSES__ = passCount;
|
|
1968
1951
|
}, delay);
|
|
1969
1952
|
}
|
|
1970
1953
|
/** `shell.overlay` occupant; it renders no chrome of its own. */
|
|
@@ -2033,46 +2016,7 @@
|
|
|
2033
2016
|
* `<home>/.trash/ws-recency/`. The browser half only asks for confirmation
|
|
2034
2017
|
* and posts the id.
|
|
2035
2018
|
*/
|
|
2036
|
-
|
|
2037
|
-
* Session menu row that reports this plugin's own cost.
|
|
2038
|
-
*
|
|
2039
|
-
* Without devtools there was no way to tell a slow plugin from a slow host,
|
|
2040
|
-
* and several rounds went into guessing. This prints the numbers where the
|
|
2041
|
-
* lag is felt. */
|
|
2042
|
-
function DiagnoseMenuItem(props) {
|
|
2043
|
-
var Item = ui.MenuItemButton;
|
|
2044
|
-
if (typeof Item !== "function") return null;
|
|
2045
|
-
return h(Item, {
|
|
2046
|
-
icon: undefined,
|
|
2047
|
-
onSelect: function () {
|
|
2048
|
-
var now = Date.now();
|
|
2049
|
-
var recent = passSamples.filter(function (sample) {
|
|
2050
|
-
return now - sample.at <= 60000;
|
|
2051
|
-
});
|
|
2052
|
-
var total = 0;
|
|
2053
|
-
var worst = 0;
|
|
2054
|
-
for (var i = 0; i < recent.length; i += 1) {
|
|
2055
|
-
total += recent[i].ms;
|
|
2056
|
-
if (recent[i].ms > worst) worst = recent[i].ms;
|
|
2057
|
-
}
|
|
2058
|
-
var nodes = typeof document !== "undefined" ? document.querySelectorAll("*").length : 0;
|
|
2059
|
-
var turns = typeof document !== "undefined" ? document.querySelectorAll("[data-chat-turn]").length : 0;
|
|
2060
|
-
var note = statsDiv("wsr-jump-toast wsr-diagnose-toast");
|
|
2061
|
-
note.textContent = t("diagnose.report", {
|
|
2062
|
-
passes: String(recent.length),
|
|
2063
|
-
total: String(total),
|
|
2064
|
-
worst: String(worst),
|
|
2065
|
-
nodes: String(nodes),
|
|
2066
|
-
turns: String(turns),
|
|
2067
|
-
});
|
|
2068
|
-
document.body.appendChild(note);
|
|
2069
|
-
window.setTimeout(function () {
|
|
2070
|
-
if (note.parentElement !== null) note.remove();
|
|
2071
|
-
}, 8000);
|
|
2072
|
-
},
|
|
2073
|
-
}, t("menu.diagnose"));
|
|
2074
|
-
}
|
|
2075
|
-
|
|
2019
|
+
|
|
2076
2020
|
function TrashMenuItem(props) {
|
|
2077
2021
|
var Item = ui.MenuItemButton;
|
|
2078
2022
|
if (typeof Item !== "function") return null;
|
|
@@ -6002,15 +5946,6 @@
|
|
|
6002
5946
|
}, StatsMenuItem);
|
|
6003
5947
|
});
|
|
6004
5948
|
|
|
6005
|
-
ctx.slots.inject("sidebar.workspaces.session.menu.item", function () {
|
|
6006
|
-
return ctx.slots.register({
|
|
6007
|
-
name: "sidebar.workspaces.session.menu.item",
|
|
6008
|
-
id: "ws-recency-diagnose",
|
|
6009
|
-
order: 690,
|
|
6010
|
-
store: prefs,
|
|
6011
|
-
locale: NS,
|
|
6012
|
-
}, DiagnoseMenuItem);
|
|
6013
|
-
});
|
|
6014
5949
|
|
|
6015
5950
|
ctx.slots.inject("sidebar.workspaces.session.menu.item", function () {
|
|
6016
5951
|
return ctx.slots.register({
|
package/index.js
CHANGED
|
@@ -32,7 +32,7 @@ import { dirname, join } from "node:path";
|
|
|
32
32
|
export const name = "ws-recency";
|
|
33
33
|
|
|
34
34
|
/** Version marker reported by the health route. */
|
|
35
|
-
export const HOST_VERSION = "0.33.
|
|
35
|
+
export const HOST_VERSION = "0.33.2";
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Exact routes the client half calls. Registered on the bare web server, so they
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ws-recency",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.2",
|
|
4
4
|
"description": "Sidebar session management for DeepSeek Harness: workspace groups sorted by latest activity, stale history folded, a global pinned section, follow-up marks, session delete into a recoverable trash, archived sessions managed from that same trash panel, per-session token statistics with an argument/result split and an option to count tool arguments as the agent's writing, moving a session to another workspace, and a literal content search that jumps to the turn a word was said in.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "chyxhtc",
|