How bowenliang123/dsh-context works
dsh-context is a DeepSeek Harness plugin for inspecting and managing an agent’s context across sessions. Its principal workflow folds session events into context projections, delivers them to the client, and presents composition, request history, and assembled content in the Context view or /context modal. A separate dashboard summarizes usage and session activity; preferences control presentation. The README documents additional event, file-activity, timing, and agent-network views. Connections reflect shown registrations, imports, and documented behavior; several UI internals are unsampled, so their wiring is only included where supported.
Main entry points: contextView.tsx Context tab · client/index.ts Plugin registration · timeline.ts Context timeline · host/index.ts Host registration
Components 22
Host projections
- Event fold
src/host/fold.ts - Context timeline
src/host/timeline.ts - Host registration
src/host/index.ts - Activity projection
src/host/activity.ts - Activity backfill
src/host/backfill.ts
Context views
- Plugin registration
src/client/index.ts - Harness services
src/client/services.ts - Context tab
src/client/components/contextView.tsx - Context browser
src/client/components/browser.tsx - Request trend
src/client/components/trendChart.tsx - Current composition
src/client/components/currentComposition.tsx - Agent network
src/client/components/agentGraph.tsx - File activity
src/client/fileActivity.ts - Context command modal
src/client/components/contextModal.tsx - Preferences
src/client/settings.ts
Dashboard
- Dashboard data
src/client/historyPage.ts - Context dashboard
src/client/components/overviewPanel.tsx
Shared data
- Wire contracts
src/shared/types.ts - Cost estimates
src/client/cost.ts - Provider mapping
src/shared/providers.ts
Other components
- Harness user
- Harness runtime
Connections 23
- Harness user → Harness runtime: opens sessions
README.md - Harness runtime → Host registration: loads plugin
src/host/index.ts - Host registration → Context timeline: registers projection
src/host/index.ts - Context timeline → Event fold: applies events
src/host/timeline.ts - Host registration → Activity projection: registers projection
src/host/index.ts - Host registration → Activity backfill: starts backfill
src/host/index.ts - Context timeline → Wire contracts: builds view
src/shared/types.ts - Harness runtime → Plugin registration: loads client
src/client/index.ts - Plugin registration → Context tab: registers view
src/client/index.ts - Plugin registration → Harness services: uses harness boundary
src/client/index.ts - Context timeline → Context tab: streams projection
- Context tab → Context browser: renders browser
src/client/components/contextView.tsx - Context tab → Request trend: shows request trend
README.md - Context tab → Current composition: shows composition
src/client/components/contextView.tsx - Context tab → Agent network: shows agent network
README.md - Context tab → File activity: derives activity
src/client/components/contextView.tsx - Plugin registration → Context command modal: registers command surface
src/client/index.ts - Plugin registration → Dashboard data: watches history
src/client/index.ts - Dashboard data → Context dashboard: feeds dashboard
README.md - Plugin registration → Context dashboard: registers dashboard
src/client/index.ts - Plugin registration → Preferences: creates preferences
src/client/index.ts - Context tab → Cost estimates: estimates spend
README.md - Cost estimates → Provider mapping: resolves providers
src/client/cost.ts