dsh-context 0.31.1 → 0.33.1
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/README.md +21 -11
- package/lib/client.js +1042 -200
- package/lib/index.d.ts +0 -8
- package/lib/index.js +14 -17
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
**The best [DeepSeek Harness plugin](https://www.deepseek.com/harness/) for Agent's context insights and management.**
|
|
10
10
|
|
|
11
11
|
`dsh-context` provides full context lifecycle management features.
|
|
12
|
-
- **Context tab** — an UI context dashboard for DeepSeek Harness’s context stats, composition,
|
|
12
|
+
- **Context tab** — an UI context dashboard for DeepSeek Harness’s context stats, composition, trend, events, and messages.
|
|
13
13
|
- **`/context` command** — the slash command shows the context model for current context composition and recent context evolution.
|
|
14
14
|
|
|
15
15
|
## Install / Update
|
|
@@ -46,7 +46,7 @@ Type `/context` (or pick it from the `/` menu) and press Enter: a centered dialo
|
|
|
46
46
|
|
|
47
47
|
### ⚙️ Settings — per-user preferences
|
|
48
48
|
|
|
49
|
-
In **Settings → Plugins → Plugin configuration**, the **Context / 上下文** card holds this plugin's per-user preferences — the **default trend granularity** (Step/Turn)
|
|
49
|
+
In **Settings → Plugins → Plugin configuration**, the **Context / 上下文** card holds this plugin's per-user preferences — the **default trend granularity** (Step/Turn), the **default trend mode** (Total/Delta), and the **File Activity default sort** (Most active / Latest / By path) the Context tab opens with. In-chart and in-card toggling stays per-view and never overwrites the stored preference. The card appears only when the Host half is installed and the settings document is writable (a remote browser keeps settings process-local and shows no card).
|
|
50
50
|
|
|
51
51
|
## What you'll see
|
|
52
52
|
|
|
@@ -60,17 +60,23 @@ A six-color stacked bar scaled against the model's full context window (the gray
|
|
|
60
60
|
|
|
61
61
|
The headline occupancy and the composition counts read the **same official token-meter projections the chat composer's context ring reads** (`contextPressure` / `contextBreakdown`), so the legend's `≈` figures and proportions match the ring's click-open panel exactly; the message bucket is subdivided into the four surface categories by the fold's per-category ratios.
|
|
62
62
|
|
|
63
|
-
### 📈
|
|
63
|
+
### 📈 Context Trend — every request's size *and* its story
|
|
64
64
|
|
|
65
|
-
One stacked bar per model request
|
|
65
|
+
One stacked bar per model request — finer than per-message — so you watch the window grow turn by turn, and drop in one ✂ when compaction hits:
|
|
66
66
|
|
|
67
|
-

|
|
68
|
+
|
|
69
|
+
- **✨ Step brief — what a step *was*, not just how big.** Three plain-language rows under the chart: **User** recalls the message that opened the turn (on any of its steps), **In** lists what newly entered the context — usually the previous tool calls' results, failures flagged — and **Response** shows what the model returned: its reply text and/or the tools it called. Hover a row's tag to learn what the row means; click any row to open that exact message in the Context browser.
|
|
70
|
+
- **Read it your way** — **Step** or **Turn** granularity, **Total** (cumulative makeup) or **Delta** (each request's signed change), and sideways scroll through the whole session.
|
|
71
|
+
- **Hover & pin** — scrub for an instant tooltip (turn/step, time, tokens, a one-line reply preview); click to pin the full category breakdown, with provider-reported actual prompt/output/cache figures next to the estimates.
|
|
72
|
+
- **✂ marks the events** — compactions and prunes land exactly where they happened, so the bars' drops explain themselves.
|
|
73
|
+
- **Live linkage** — hovering a bar previews that step's assembled context in the Context browser beside the chart; leave the chart and it returns to your own pick.
|
|
68
74
|
|
|
69
|
-
Above: a real session
|
|
75
|
+
Above: Turn 1 · Step 15 of a real session — the brief recalls the turn's opening message, the files just read in, and the reply that called `read` next.
|
|
70
76
|
|
|
71
|
-
|
|
77
|
+
A longer session tells the dramatic version — ~563k tokens across 48 turns, then compaction (✂) recycled −535.5k in one step, and the conversation continued from a fresh, small window:
|
|
72
78
|
|
|
73
|
-

|
|
74
80
|
|
|
75
81
|
Switch the chart from **Total** to **Delta** and each bar becomes the *change* that request made to the window instead of its cumulative size: diverging stacks pile up from the solid zero baseline when the window grew and hang below it when it shrank, tooltips read `Δ ±Nk`, and the pinned detail card re-prices every category as a signed delta — so you can tell exactly which part of a request added (or reclaimed) tokens. Below, Turn 5's first step grew the window by **+1.6k**: injected context **+803**, the user message **+649**, the assistant reply **+178** — and nothing else moved:
|
|
76
82
|
|
|
@@ -82,9 +88,13 @@ Every compaction, tool-output prune, skill or plugin context injection, model sw
|
|
|
82
88
|
|
|
83
89
|

|
|
84
90
|
|
|
85
|
-
###
|
|
91
|
+
### 📁 File Activity — what the agent *did* to your files
|
|
92
|
+
|
|
93
|
+
Not what the context is made of, but what it was good for: one row per touched file — read, written, or searched — aggregated up to the step you pick on the trend chart (the card scrubs live as you hover the bars; the default is the whole session to date):
|
|
86
94
|
|
|
87
|
-
|
|
95
|
+
- **Per-purpose counts** — how many times each file was read, written, and searched, with the header chips doubling as purpose filters (**Read / Written / Searched**), an **Images** chip for the multimodal view (`read_image` calls and image extensions), and a path search box.
|
|
96
|
+
- **Line deltas** — every `edit`/`write` contributes its estimated footprint (`+added / −removed`, read off the call arguments), per file and summed in the header.
|
|
97
|
+
- **Click to inspect** — a row expands into the file's own operation log (tool, time, per-op delta, failures flagged); each operation jumps straight to the exact tool result in the Context browser. Operations whose paths aged out of the retained window are honestly counted in a footnote.
|
|
88
98
|
|
|
89
99
|
### 🧭 Context browser — open the box of any request
|
|
90
100
|
|
|
@@ -94,7 +104,7 @@ Pick **Live (next request)** or any retained step from the picker, and browse wh
|
|
|
94
104
|
|
|
95
105
|
Six collapsible category sections (system prompt, tool schemas, user messages, injected context, assistant replies, tool results) expand into one row per element — each with its token price — and every element expands again into its **actual content**: the full system prompt, each tool's description and JSON schema, message text, reasoning, tool-call arguments, and tool outputs.
|
|
96
106
|
|
|
97
|
-
- **Linked with the
|
|
107
|
+
- **Linked with the trend chart** — hover any bar in the Context trend card and the browser previews that step instantly; leave the chart and it returns to your own pick. Keep a category open while scrubbing to compare one category across steps. Clicking a step-brief row (**User** / **In** / **Response**) opens that exact message here, expanded and scrolled into view.
|
|
98
108
|
- **Honest about coverage** — steps before a compaction are reconstructed from the removed-message archive, and the card says so when a step's makeup is only approximate. Elements older than the loaded chat window page older history in automatically when you expand them, and live injections (AGENTS.md, session-start context, …) are always listed — never a token sum without its items.
|
|
99
109
|
- **Diff against the previous turn** — switch the picker to **vs previous turn** and every category gets signed delta badges (`+N` items, `+Nk` tokens), so one glance tells you what the conversation added since the end of the last turn.
|
|
100
110
|
|