Chuyển đến nội dung chính

dsh-insights

Đã xác minh

dsh-insights · v0.2.0 · MIT

DSH plugin: replica of Claude Code's /insights command — cross-workspace session usage analysis powered by the global session-query corpus, with per-session LLM facet extraction (cached), 8 analysis prompts, and a self-contained interactive HTML report. R

Cài đặt

dsh plugin add dsh-insights

Xác nhận layer đã áp bằng dsh --profile default --dump-config — xem hướng dẫn cài plugin.

Mã nguồn

Phát hành lên npm mà không có repository công khai. Hãy kiểm tra nội dung package trước khi cài.

Thẻ

Tác giả

Readme

dsh-insights

Replica of Claude Code's /insights for DeepSeek Harness: cross-workspace session usage analysis that writes a self-contained interactive HTML report.

Published on npm as [email protected] with a dsh.bundle.patch — one command installs and auto-mounts (takes effect on the next dsh start):

dsh plugin --profile web add dsh-insights

Local checkout (development): dsh plugin --profile web add ./plugins/dsh-insights, or ./scripts/install.sh web plugins/dsh-insights.

Usage

In any session:

/insights                       # analyze new sessions and generate the report
/insights --refresh             # ignore facet cache; re-analyze everything
/insights --window 30           # last 30 days only (0 = all)
/insights --max 20              # analyze at most 20 new sessions this run

Loader config is optional — without it, outputs default under the harness home ($DSH_HOME/storages/insights/, else ~/.dsh/storages/insights/). To customize, add an id-targeted config patch in the profile's cordis.patch.yml (last write wins per row):

- insert:
    - id: insights
      name: 'dsh-insights'
      config:
        reportPath: !!js dshHomePath('storages/insights/report.html')
        facetDir: !!js dshHomePath('storages/insights/facets')
        # optional: cheaper model for facet/analysis (must be a pair)
        # provider: deepseek
        # model: deepseek-chat
key default notes
reportPath $DSH_HOME/storages/insights/report.html HTML report output path
facetDir $DSH_HOME/storages/insights/facets per-session facet cache directory
maxNewSessionsPerRun 50 cap on new sessions analyzed per run
transcriptCharLimit 30000 longer sessions are chunk-summarized first
chunkChars 25000 summary chunk size
facetMaxOutputTokens 4096 facet extraction max output tokens
analysisMaxOutputTokens 8192 analysis prompt max output tokens
timeoutMs 120000 per LLM call timeout
openReport true open the report in a browser when done
provider / model (unset) facet/analysis route override; both or neither
locale zh report and prompt language (zh / en)

The assistant orchestrates these tools (or you can ask it to call insights_run once):

tool role
insights_collect scan the global corpus, extract metadata, return new session ids
insights_facet LLM facet extraction for a batch (cached per session, failures isolated); safe to fan out across subagents
insights_aggregate aggregate cached facets + 8 analysis LLM calls (7 prompts + overview); writes insights-latest.json
insights_render render the HTML report and try to open it
insights_run one-shot serial pipeline (fallback; no subagent fan-out)

Uninstall

dsh plugin --profile web remove dsh-insights

Limits and privacy

  • Analysis runs on this machine; LLM requests leave the machine. The report is a local file — sharing it is your choice.
  • The plugin writes three locations: reportPath, facetDir (one JSON file per analyzed session), and insights-latest.json next to facetDir (aggregate handoff). It does not append events to session logs.
  • Token totals only cover sessions whose adapter reported usage (the report shows coverage). Input tokens use the billing formula inputTokens + cacheReadTokens + cacheWriteTokens.
  • Git activity, languages, and touched files are heuristics.
  • Facet cache is one-shot per session id; later turns in the same session are not re-analyzed unless you pass --refresh.

How it works

Execution model: foreground in-session command.

The host registers /insights and the insights_* tools. The command handler calls agent.steer; the current assistant then drives the pipeline as an ordinary, interruptible turn:

/insights (host) → agent.steerinsights_* tools → HTML render

Default orchestration: collect → fan out insights_facet on subagents → aggregate → render. insights_run is the serial fallback.

Tests

cd plugins/dsh-insights
node --test tests/

Part of the dsh-plugins collection.