Commit Graph
141 Commits
Author SHA1 Message Date
bowenliang123 ece26c1ac6 chore: package build instruction after code changes 2026-08-19 14:12:08 +08:00
bowenliang123 90fc90b076 fix(i18n): align English History hint with the Chinese copy 2026-08-19 14:05:59 +08:00
bowenliang123 985dec61ba refactor: drop redundant tr alias and hand-rolled helpers
- ViewKit carried tr as an alias of t; call sites now use t directly
  and makeEventText takes a single Translate function
- fmtTime uses toLocaleTimeString instead of a manual zero-pad helper
- services.ts shares one asRecord narrow instead of duplicating the
  null/object guard in each projection parser
- FoldBounds collapses to Required<Config> instead of a hand-maintained
  interface mirroring the schema
2026-08-19 14:02:49 +08:00
bowenliang123 3d4267ffc6 feat: pin the Context browser to the History chart's locked bar
Clicking a bar in the History chart locks its step; the browser's step
picker now follows that pin, and unpinning returns the browser to the
live surface (with the same accordion reset as a manual pick). Hovering
another bar still previews transiently over the pin.
2026-08-19 13:55:09 +08:00
bowenliang123 69a62c12f7 feat: emphasize used percentage in overview headline, drop split-estimate note 2026-08-19 13:44:52 +08:00
bowenliang123 03fcc04260 feat: ease hover feedback in and out with 120ms transitions
Row hovers and the shared composition-bar hover (segment brighten, dim,
free-track outline, occupied frame, tooltip, legend chip) now glide
instead of snapping. The tooltip and occupied frame stay mounted with an
opacity toggle so they fade out on leave too, not just fade in.
2026-08-19 13:17:05 +08:00
bowenliang123 8f572ab818 feat: link context browser hover with current composition card
While the browser shows the live step, hovering its category rows or its
composition bar lights the matching segment + legend chip on the Current
Composition card, and hovering the overview lights the browser's category
row and bar segment back. The link is gated on the live step: a pinned or
previewed step has a different composition, so its hover never leaks into
the overview (and vice versa). The mirrored browser bar renders no tooltip
of its own, so a cross-card hover floats only one tooltip.
2026-08-19 13:06:50 +08:00
bowenliang123 5372a1727e fix: make context browser row hover/active states visible in light mode
bg-layer-1 and bg-layer-2 both resolve to white in light mode, so the
browser's hover (cat/elem rows) and open-element highlight were
invisible. Switch them to the harness interactive-bg-hover/active
tokens, which tint in both light and dark themes.
2026-08-19 11:45:23 +08:00
bowenliang123 85d7258c08 chore: define dsh function if not already available in register script 2026-08-19 10:29:13 +08:00
Bowen Liang 3cf7a94c90 chore: bump version to 0.13.0
Add the dsh-plugin-checker job to the release workflow, verifying the
plugin manifest, installability, and bundle layer before publishing.
2026-08-19 00:13:50 +08:00
Bowen Liang 02c2d3765b chore: move the register command into a scripts/register.sh script 2026-08-18 21:23:12 +08:00
Bowen Liang 8c24125153 chore: bump version to 0.12.2 2026-08-18 20:53:37 +08:00
Bowen Liang 2dab549f98 fix: remove the husky pre-commit check to comply with DeepSeek Harness Desktop's plugin install verification requirements 2026-08-18 20:52:24 +08:00
bowenliang123 1e4efc4e3e chore(release): bump version to 0.12.1 2026-08-18 15:28:53 +08:00
bowenliang123 d31b3ff5f5 Trim browser card hints and shorten trend hint
- Remove browser.hint subtitle and i18n entries (zh + en)
- Rename browser.title to '上下文浏览器'
- Shorten trend.hint to remove redundant interaction notes
2026-08-18 14:43:08 +08:00
bowenliang123 f7e1593975 docs: update release notes template 2026-08-18 11:32:06 +08:00
bowenliang123 fb3c79212c chore: add register npm script for dsh web plugin 2026-08-18 11:11:30 +08:00
Bowen Liang 462ac6333c feat(host): raise the default served surface window to 2000 nodes
The browser's category lists were capped at the newest 200 nodes, so a
long session showed token sums with no item rows for everything older.
Projection pushes ship the whole value but only fire on surface-moving
events (a few per step, ~150B per node), and auto-compaction keeps the
live surface far below 2000 in healthy sessions — so the new default
effectively lists every live node, with the bound kept (and the honest
'outside the served window' note) as a backstop for pathological cases.
2026-08-18 08:33:50 +08:00
Bowen Liang 01a8dfc3a6 fix(client): decouple the turn strip from the category palette
The turn strip's per-turn palette was positionally identical to the six
category colors (turn 1 indigo = system, turn 2 amber = tools, ...).
Sitting 4px under the bars, the strip read as a detached full-width
bottom segment that never aligned with the bars above — the bars looked
broken, especially in multi-turn sessions.

The strip now uses a neutral two-tone zebra (adjacent turns still read
as separate ranges) with secondary-label text; the in-turn bar tint goes
neutral too. Verified against the live GUI: every composition bar's
segments measure pixel-aligned; the strip now clearly reads as an axis.
2026-08-18 08:33:33 +08:00
Bowen Liang cf286766bc chore: bump version to 0.12.0 2026-08-18 04:27:36 +08:00
Bowen Liang 46195d58bd docs: illustrate the Context browser with a screenshot and its new capabilities
Add docs/context-browser.png to the browser section, plus the two
behaviors that shipped with it: trend-chart hover linkage and honest
coverage (archive reconstruction notes, auto-loading older history,
always-listed live injections). The History section mentions the hover
linkage too.
2026-08-18 04:25:51 +08:00
Bowen Liang 3c858dafc7 feat(client): link trend-chart hover to the context browser
Hovering a history bar now transiently previews that step in the Context
browser — picker, meta line, composition bar and category lists all
follow the pointer, with a 'preview' marker in the meta row. Leaving
the chart returns the browser to its own picker selection; a seq trimmed
out of retention is ignored. Accordion state survives the hover, so one
open category can be scrubbed across steps for comparison.
2026-08-18 04:24:50 +08:00
Bowen Liang beaa746409 feat(host): pin live inject nodes into the served surface slice
Injections land on the surface first, so in a long session the plain
maxNodes tail window dropped their identity while their tokens kept
counting (sums cover the full surface) — the browser's inject section
showed a gray '0 items' row with a real token sum and no way to see
what was inside.

The served slice is now the newest maxNodes tail PLUS every live inject
node older than the tail (they are few; the concatenation stays
seq-ordered). droppedNodes and surfaceFloor count only the unserved
non-inject overflow, so the 'N earlier messages' note no longer
double-counts pinned injects, and per-step reconstruction sees them too.
2026-08-18 04:12:45 +08:00
Bowen Liang 10ba739403 refactor(client): two-column main split, row-owned 14px section rhythm
Overview + trend stack in the left column and the context browser takes
the right column, reusing the shared lc-cols flex (wraps to one column
on narrow widths).

Section spacing moves from per-card margins to the row container:
.lc-cols owns the 14px gap to the next section, cards that ARE columns
drop their own bottom margin, and the last card inside a wrapper column
drops its own — fixing the head row sitting flush against the overview
card and making every section boundary exactly 14px however the flex
wraps.
2026-08-18 03:58:02 +08:00
Bowen Liang 7de0cdab0f feat(client): auto-load older history for out-of-window browser elements
Expanding a Context browser element whose seq is outside the loaded
conversation window now pages older history in automatically (one page
in flight, up to 20 pages) until the join hits, instead of leaving the
reader with the 80-char preview plus a static note.

The pagination verb reaches the card through the harness's
sessions.provide channel: the plugin contributes a loadOlderHistory
standard prop resolved to session.loadOlder(), so every session-scope
slot component receives it. Hosts without the channel (or a duplicate
refusal) fail soft to the previous preview-plus-hint degradation.
2026-08-18 03:34:44 +08:00
Bowen Liang 81b9ecd7f0 context browser 1 2026-08-18 02:34:58 +08:00
Bowen Liang 36ae27765a build: silence commonjs-variable-in-esm warning for the harness-loader export
The client entry's `module.exports = { name, inject, apply }` is the
closure-factory contract every dsh.client package's `./client` export
must use — the harness's __ModuleLoader__ wraps the bundled CJS in a
factory that provides `var module = { exports: {} }` as a closure local
(see scripts/build.mjs:73-86), so the reference is legitimate. esbuild's
parser nonetheless flags it because the .ts source lives in a
"type": "module" package.

`logOverride: { 'commonjs-variable-in-esm': 'silent' }` suppresses that
one specific warning without touching any other esbuild signal — a future
maintainer adding a real CJS leak (e.g. require() inside the entry) would
still see a different warning. No source, test, or runtime behavior
changes; the bundled client.js still ends with the documented factory
shape that the harness's loader consumes.
2026-08-17 23:07:29 +08:00
Bowen Liang a283e96f02 refactor(host): use deriveEventMessage for surface-fold message extraction
dsh-session exports deriveEventMessage(event) as the canonical per-event
message projection:
  user/message      -> event.data
  assistant/message -> event.data.message (or null when content is empty)
  tool/result       -> event.data.message
  other             -> null

The fold's three surface-event cases now call this one function instead of
hand-rolling  casts and  picks.
Behavior is identical: empty assistant/message projects to no message
(usage-only), so applySurface receives null in that case and the existing
emptyIsZero short-circuit prices 0 tokens (without the +ROLE_OVERHEAD that
a non-empty message would pay).

MessageLike is kept as the plugin's narrow structural type; deriveEventMessage's
return type (Message from dsh-llm) is structurally compatible with MessageLike
(modulo the optional error field, which is harmless).

applySurface's message parameter widens to MessageLike | null | undefined
to accept deriveEventMessage's null return directly.
2026-08-17 23:03:13 +08:00
Bowen Liang 8185bd2ca1 refactor(client): drop local webkit-scrollbar rules on .lc-chart-scroll
The harness's global scrollbar skin (ui-theme/src/styles/scrollbar.css)
supplies the styled scrollbar via scrollbar-width: thin; declaring both
scrollbar-width and ::-webkit-scrollbar on the same element is mutually
exclusive across engines (see harness's own note at scrollbar.css:26-43),
so the local webkit rules were silently ignored on Chromium/Safari
anyway. Drop them; the chart scroll uses the harness's skin.
2026-08-17 22:38:18 +08:00
Bowen Liang c229fd1d9b chore(deps): bump @deepseek-ai/dsh-* dev deps from 0.1.0-rc.6 to 0.1.0-rc.7 2026-08-17 21:31:57 +08:00
bowenliang123 29dfcc46c0 docs: add guidelines for using existing APIs and managing temp files 2026-08-17 17:07:15 +08:00
bowenliang123 8b990ed08e chore: bump version to 0.11.2 2026-08-17 16:51:48 +08:00
bowenliang123 ada2a4f1ef docs: update screenshots and github social preview image 2026-08-17 16:47:57 +08:00
bowenliang123 4ae0e2f560 chore: bump version to 0.11.1 2026-08-17 16:12:45 +08:00
bowenliang123 9692e34f13 docs: describe context events category filters in README 2026-08-17 16:12:44 +08:00
bowenliang123 e34e03d1bd chore: bump version to 0.11.0 2026-08-17 15:58:09 +08:00
bowenliang123 7a57ab2dae feat(client): replace events dropdown with an inline kind picker
The events card header now carries four pill buttons (注入/压缩/剪枝/切换)
instead of a select: all picked by default, clicking an unpicked kind adds
it (A -> A+B -> ...), clicking a picked one removes it, and removing the
last one resets to all. Each kind gets a distinct hue shared between the
pills and the row chips (绿/红/紫/蓝); the hint subtitle and the filter
dropdown are gone.
2026-08-17 15:50:55 +08:00
bowenliang123 68b2252e8b feat(client): add kind chips and conditional tooltips to context events
Each event row now carries a kind chip (注入/压缩/剪枝/切换) colored by
impact direction (+ adds, - frees, ⇄ neutral), the events card header
gains a one-line hint about the block's meaning, and the native title
tooltip attaches only while the label actually truncates (measured after
every render and on resize) instead of always.
2026-08-17 15:14:59 +08:00
bowenliang123 a45fd2e2d8 docs: update project description 2026-08-17 14:52:42 +08:00
bowenliang123 bc165742d1 docs: update project description 2026-08-17 14:49:30 +08:00
bowenliang123 66edd1dee9 docs: update project description 2026-08-17 14:49:18 +08:00
bowenliang123 d22bba8d49 feat(client): cache npm version check with a 1-hour TTL 2026-08-17 14:35:19 +08:00
bowenliang123 39b32211a1 refactor(client): rebuild Plugin info card as two whole-row links with upgrade chip 2026-08-17 14:32:57 +08:00
bowenliang123 64c16cd22c docs: update release notes template 2026-08-17 14:32:05 +08:00
bowenliang123 ec108bb7a7 chore: bump version to 0.10.3 2026-08-17 11:39:06 +08:00
bowenliang123 d6e89b415c feat(client): add Plugin info card beside Context stats
Side-by-side head row (3:2 flex, wraps when tight): plugin name, version,
and GitHub repo as whole-cell links (name/version -> GitHub/npm), with the
version/repo baked in from package.json via esbuild define. A once-per-page
npm registry check adds an 'Update!' badge + update-command tooltip on the
version cell whenever the registry release differs; failures stay silent.
Bilingual strings, cell-hover underline + brand border affordance.
2026-08-17 11:36:32 +08:00
bowenliang123 c38cae25e8 refactor(client): trim Context stats to turns, steps, injections, compactions, prunes
Drop recycled/switches/est/actual-prompt/output cells and split the
single recycled counter into two — compactions and prunes — so the
counts are distinguishable in the board. Bold the cell labels and
center the values for a cleaner scan.
2026-08-17 11:08:09 +08:00
bowenliang123 19733b9a4d chore: bump version to 0.10.2 2026-08-17 07:01:55 +08:00
bowenliang123 8758dd857d fix(host): tolerate undefined Config in preprocess; keep .strict() key validation 2026-08-17 07:01:21 +08:00
bowenliang123 d29dcf89fa refactor: drop the mirrored occupancy fold, read the official contextPressure projection
token-meter is a core service that owns estimation and replay (its docs:
'the singleton ctx.tokenMeter directly owns estimation and replay'), and the
published package registers three projections on the shared
SessionProjectionMap — tokenUsage / contextPressure / contextBreakdown.
The host was duplicating the contextPressure fold (pressureTokens +
sampledSurfaceTokens + occupancyWindow, sampleUsage on assistant/message and
usage chunks) and the client was rendering from that mirror.

Host: the occupancy mirror leaves the fold entirely (assistant/chunk is now
structurally ignored — same reference, no change feed). stateVersion 1 -> 2
so cached rows from the old fold are discarded. The strict wire schema no
longer accepts occupancy; the shared type keeps it optional as legacy for
downstream consumers.

Client: the headline reads the official token-meter contextPressure
projection via the useProjection seat (the same key the chat's context ring
reads); absent key/value degrades to the existing derived fallback (last
request prompt + surface movement), so the UI renders identically in every
deployment. UI functionality is unchanged — same headline, same percentages,
same composition anchoring.

diff-fold.mjs is repurposed: the plugin no longer has an occupancy fold to
compare, but its heuristic composition (current.system/tools + surface total)
must stay equal to the official contextBreakdown projection — verified
MATCH on three real session logs.

Tests: host asserts occupancy is absent + chunk reference stability; client
feeds the official projection through the stub and asserts the same UI text.
2026-08-17 01:21:31 +08:00