DeepSHPlugins
dsh-timesheet 專案預覽
GITHUB / COMMUNITY PROJECT

dsh-timesheet

生態與開發TypeScriptMIT

從 dsh 會話日誌做基於 turn 的時間跟蹤:總計、按天/專案/供應商/來源彙總、工具呼叫數、失敗率與首 token 延遲——CLI + agent 可呼叫 timesheet 工具,dsh-timesheet/v1 報告,零執行時依賴。

2 Starszoahdev 更新時間 2026-08-18
訪問 GitHub 倉庫
dsh-timesheet 專案預覽

專案介紹

中文

從 dsh 會話日誌做基於 turn 的時間跟蹤:總計、按天/專案/供應商/來源彙總、工具呼叫數、失敗率與首 token 延遲——CLI + agent 可呼叫 timesheet 工具,dsh-timesheet/v1 報告,零執行時依賴。

English

Turn-based time tracking from dsh session logs: totals, per-day/project/provider/source rollups, tool-call counts, failure rates, and time-to-first-token — CLI plus an agent-callable timesheet tool, dsh-timesheet/v1 reports, zero runtime deps.

專案資訊與收錄訊號

快照 2026-09-11
作者 / 組織
zoahdev
倉庫
zoahdev/dsh-timesheet
GitHub Stars
2
Forks
0
開發語言
TypeScript
許可證
MIT
最近推送
2026-08-18
Manifest
資料中檢測到宣告

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

資料評分

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

README 含完整安裝與使用說明;關注度尚低(2)。

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

安裝與使用

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

dsh plugin --profile web add github:zoahdev/dsh-timesheet

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

專案截圖

倉庫 README

GitHub 原文

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

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

dsh-timesheet

npm

CI License: MIT dsh-plugin

Timesheet for DeepSeek Harness (dsh): turn-based time tracking from session logs.

Token dashboards tell you what you spent; this one tells you how much wall-clock time you spent with your agents — totals, per-day, per-project, per-provider, per-source, plus tool-call counts, failure rates, and time-to-first-token. Zero runtime dependencies; reads *.jsonl session logs only.

Install

dsh plugin add dsh-timesheet

Or run standalone:

npx dsh-timesheet ~/.codex/sessions

CLI

dsh-timesheet <dir> [--json]
  • dir must contain *.jsonl session logs (e.g. ~/.codex/sessions, a dsh session directory, or any exported session folder).
  • Prints a Markdown report; --json prints the machine-readable dsh-timesheet/v1 envelope.
  • Exit codes: 0 report generated, 1 no turns found / warnings, 2 usage/IO error.
npx dsh-timesheet ~/.codex/sessions
npx dsh-timesheet ~/.codex/sessions --json

In-harness usage (agent-callable)

Ask your dsh agent:

给我出一份时间报表:timesheet,目录指向会话日志目录。
Give me a timesheet report: timesheet with dir set to your session-log directory.

The tool returns a dsh-timesheet/v1 report:

{
  "schema": "dsh-timesheet/v1",
  "target": "~/.codex/sessions",
  "ok": true,
  "scannedFiles": 42,
  "sessions": 42,
  "turns": 310,
  "totalDurationMs": 64800000,
  "failedTurns": 7,
  "toolCalls": 1284,
  "byDay": [ { "key": "2026-08-18", "turns": 22, "durationMs": 5400000, "ttftMs": 110000, "failed": 1, "avgMs": 245454 } ],
  "byProject": [ ... ],
  "byProvider": [ ... ],
  "bySource": [ ... ],
  "warnings": []
}

What it reads

Session logs use the standard dsh event envelope:

  • session_meta → session id, workspace (cwd), model provider, source (desktop / CLI / VS Code / ...)
  • event_msg / task_started → turn begin
  • event_msg / task_complete → turn end, duration_ms, time_to_first_token_ms, error
  • response_item / function_call → tool-call counts

Files ending in .jsonl are parsed; malformed lines are skipped with a warning. Compressed .jsonl.zstd logs are not read directly — export or decompress them first (the format is plain JSONL after decompression).

Why it exists

  • The ecosystem tracks tokens and cost, but no plugin tracked wall-clock time — the WakaTime-shaped hole in the dsh plugin registry.
  • Answering “where did my 6 hours go?” is the first step to spending agent time deliberately.
  • Zero runtime dependencies, read-only by construction: it never writes to your sessions.

Development

pnpm install
pnpm typecheck
pnpm build
pnpm test
pnpm test:integration

CI runs the dsh-plugin-doctor preflight, unit tests, packed-artifact integration (real timesheet invocation), and a fresh-profile dsh web boot smoke on Windows.

License

MIT © 2026 zoahdev


dsh-timesheet(中文)

DeepSeek Harness(dsh)的时间报表插件:从会话日志做基于 turn 的时间跟踪。

Token 仪表盘告诉你花了多少钱;这个插件告诉你真实花了多少墙钟时间——总计、按天、按项目、按模型供应商、按来源,外加工具调用次数、失败率和首 token 延迟。零运行时依赖,只读 *.jsonl 会话日志。

安装

dsh plugin add dsh-timesheet

独立使用:

npx dsh-timesheet ~/.codex/sessions

CLI

dsh-timesheet <dir> [--json]
  • dir 需要包含 *.jsonl 会话日志(如 ~/.codex/sessions、dsh 会话目录或导出的会话目录)。
  • 输出 Markdown 报告;--json 输出机器可读的 dsh-timesheet/v1 报告。
  • 退出码:0 生成成功,1 没有 turn / 有警告,2 用法/IO 错误。
npx dsh-timesheet ~/.codex/sessions
npx dsh-timesheet ~/.codex/sessions --json

在 harness 内使用(agent 可调用)

对 agent 说:

给我出一份时间报表:timesheet,目录指向会话日志目录。

工具返回 dsh-timesheet/v1 报告(结构见英文版 JSON 示例)。

读取什么

会话日志使用标准 dsh 事件结构:

  • session_meta → 会话 id、工作区(cwd)、模型供应商、来源(desktop / CLI / VS Code / ...)
  • event_msg / task_started → turn 开始
  • event_msg / task_complete → turn 结束、duration_ms、time_to_first_token_ms、error
  • response_item / function_call → 工具调用计数

只解析 .jsonl,畸形行跳过并告警。压缩的 .jsonl.zstd 不直接读取——先解压(解压后就是纯 JSONL)。

为什么需要它

  • 生态里到处是 token 和成本统计,但没有人统计墙钟时间——这是 dsh 插件注册表里 WakaTime 形状的空洞。
  • 回答“我 6 小时去哪了”是开始有意支配 agent 时间的第一步。
  • 零运行时依赖、天然只读:永远不会写你的会话。

开发

pnpm install
pnpm typecheck
pnpm build
pnpm test
pnpm test:integration

CI 跑 dsh-plugin-doctor 预检、单元测试、打包集成(真实 timesheet 调用)、Windows 全新 profile 的 dsh web 启动冒烟。

许可证

MIT © 2026 zoahdev

Related ecosystem tools

FAQ

  • How do I install? dsh plugin add dsh-timesheet or run the CLI directly (see README).
  • Does it need an API key? No.
  • Is it read-only? Yes by default; any write/apply is an explicit flag.

Examples

See the README for full CLI usage. Quick start:

npx dsh-timesheet --help

使用前核對

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

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

同類專案