DeepSHPlugins
dsh-session-report 專案預覽
GITHUB / COMMUNITY PROJECT

dsh-session-report

安全與運維TypeScript

會話成本與耗時報表:tokens / 快取命中 / 耗時。

2 Starsyangyongzhen 更新時間 2026-08-14
訪問 GitHub 倉庫
dsh-session-report 專案預覽

專案介紹

中文

會話成本與耗時報表:tokens / 快取命中 / 耗時。

English

Per-session cost & usage report cards: tokens, cache hits, duration.

專案資訊與收錄訊號

快照 2026-09-11
作者 / 組織
yangyongzhen
倉庫
yangyongzhen/dsh-session-report
GitHub Stars
2
Forks
0
開發語言
TypeScript
許可證
未記錄
最近推送
2026-08-14
Manifest
資料中檢測到宣告

公開倉庫不自動等於可商用;許可證與當前相容性以原專案文件為準。Manifest 和資料評分不構成安裝安全認證。

資料評分

54/ 100
維護活躍
81
文件與實用資訊
78
生態關注度
14
安裝便捷訊號
100
專案宣告訊號
80

關注度尚低(2);標準命令一鍵安裝。

評分來自已有資料快照的五維模型,僅作瀏覽參考,不是實際使用評測或安全檢測結論。

安裝與使用

所有專案資料與許可均以對應 GitHub 倉庫為準。

dsh plugin --profile web add github:yangyongzhen/dsh-session-report

複製命令不會自動執行。請先閱讀倉庫文件,確認環境要求與許可證。

專案截圖

倉庫 README

GitHub 原文

已儲存的倉庫文件快照;文件抓取時間未記錄,可能與上方目錄介紹處於不同版本。安裝前請核對當前倉庫說明。

儲存庫檔案保留原文,指令與授權文字不作自動改寫。

dsh-session-report

DeepSeek Harness 会话成本与耗时复盘报表插件:turn 结束后生成 Markdown 报表卡——token 消耗(含缓存命中率)、按 turn 拆分、工具调用频率、错误记录、可选成本估算。

与 dsh-session-export(对话导出)互补:导出看内容,报表看数字。

  • 监听 session/event 事件流,turn/end 后防抖 debounceMs 生成报表
  • 输出 $DSH_HOME/reports/report-<id>.md(默认 ~/.dsh/reports/)
  • 缓存命中率按 DeepSeek 口径:cacheRead / (未缓存输入 + 缓存读 + 缓存写)
  • 配置单价后自动估算成本(计费输入 = 三项之和)
  • 进程退出时同步 flush(headless 一次性任务不丢报表)

安装

# 本地 checkout 安装
dsh plugin --profile <web|tui|headless> add file:/path/to/dsh-session-report

# 或从 Git 仓库安装
dsh plugin --profile <web|tui|headless> add https://gitcode.com/qq8864/dsh-session-report.git

配置

- id: report
  config:
    enabled: true
    outDir: ~/reports        # 报表目录,默认 $DSH_HOME/reports
    debounceMs: 1000         # turn/end 后的静默等待
    costPerMInput: 1.2       # 可选:每百万输入 token 价格(元),配置后估算成本
    costPerMOutput: 4.0      # 可选:每百万输出 token 价格(元)

价格单位任意(元/美元/分),按"每百万 token"填写;不配置则不显示成本。

报表样例

# 会话成本与耗时报表

- **会话 ID**:`session-29487994-...`  ·  **模型**:`deepseek-official/deepseek-v4-flash`
- **总耗时**:2s  ·  **估算成本**:0.0105

## Token 消耗
| 输入 tokens(未缓存) | 6322 |
| 缓存命中(读) | 1920 |
| 计费输入合计 | 8242 |
| 缓存命中率 | 23.3% |

## 按 Turn 拆分
| Turn | Step | 工具调用 | 输入 | 输出 | 缓存读 | 耗时 | 结果 |
| 1 | 1 | 0 | 6322 | 156 | 1920 | 2s | 完成 |

## 工具调用频率
| `pwsh` | 2 |
| `glob` | 1 |

口径说明

dsh 的 TokenUsage 计数是不相交的:inputTokens 只含未缓存输入,缓存命中/写入分开报。因此:

  • 计费输入 = inputTokens + cacheReadTokens + cacheWriteTokens
  • 缓存命中率 = cacheReadTokens / 计费输入(DeepSeek 口径,clamp 到 0–100%)
  • 成本估算按计费输入计算

开发

pnpm install
pnpm run build        # tsc -> lib/

端到端验证:

dsh plugin --profile headless add file:./
dsh --profile headless --patch ./test/report-patch.yml "一句话介绍你自己"
cat ~/.dsh/reports/*.md

使用前核對

安裝步驟、相容版本與授權範圍以原專案當前文件為準。Stars 和評分是快照中的導航訊號。

安裝與排錯 · 專案問題反饋

同類專案