从 dsh 会话日志做基于 turn 的时间跟踪:总计、按天/项目/供应商/来源汇总、工具调用数、失败率与首 token 延迟——CLI + agent 可调用 timesheet 工具,dsh-timesheet/v1 报告,零运行时依赖。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:zoahdev/dsh-timesheet
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
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]
dirmust contain*.jsonlsession logs (e.g.~/.codex/sessions, a dsh session directory, or any exported session folder).- Prints a Markdown report;
--jsonprints the machine-readabledsh-timesheet/v1envelope. - Exit codes:
0report generated,1no turns found / warnings,2usage/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:timesheetwithdirset 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 beginevent_msg/task_complete→ turn end,duration_ms,time_to_first_token_ms,errorresponse_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、errorresponse_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
- dsh-dep-audit - dependency supply-chain hygiene
- dsh-quality-score - plugin quality scorecard + full-registry leaderboard
- dsh-ecosystem - health scan, impact, trend, live dashboard
- dsh-tutorials - bilingual plugin pipeline tutorials
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
链接
同类插件
yjh051108/dsh-routing-suite★ 7000
一个仓库三件套:DSH 插件包的运行时注入器(注入、热重载、卸载、开发侧挂区一键转正、路由自愈,外带设置页插件管理:列出、卸载、拖入文件夹内化)、任务感知的思维模式路由 agent 预设(router-standard / router-spec / router-react)、以及分级两级任务协议(commit_star / lock_stage / revise_do / edit_plan / mark_task / redteam_verdict 六个工具,任务状态落盘)。注入器实现直接在库内,安装的是它自己的行为而不是一份依赖清单。
strukto-ai/mirage#dsh★ 3678
把文件系统与 bash 提供者换成 mirage 虚拟工作区:文件工具与 shell 命令作用于挂载的资源(RAM、S3、Redis、Slack、Gmail、Notion、Postgres)而非宿主磁盘,支持按挂载点设置读/写/执行模式、按命令选择沙箱(进程内 monty、pyodide、quickjs;远程 docker、e2b、daytona),并可在虚拟终端中安装 CLI(git、gh、slack、linear、ntn、gws,或自行注册的程序树)作为命令头词。
hust-open-atom-club/oh-dsh★ 324
社区发行版:TUI、桌面端与 Web UI 统一体验,分层安装、一步到位。
weijiafu14/pi2dsh★ 212
Pi Host ABI 兼容引擎:装一次之后,npm 上的 Pi 扩展原包经 `dsh plugin add <pi-package>` 直接作为 DSH 原生插件挂载。已在官方 DSH 上端到端验证 pi-mcp-adapter(完整 MCP 管理面:OAuth、resources、prompts、MCP Apps、elicitation、sampling)、@tintinweb/pi-subagents、pi-code、pi-hermes-memory、pi-background-tasks;`pi2dsh inspect` 在安装前报告一个包的兼容情况。
Fishquito7/dsh-skill-mcp-panel★ 175
在 DSH Web 设置中管理技能与 MCP 服务器:技能卡片热启停、工作区作用域、分组、批量迁移与拖拽导入,以及 stdio/HTTP MCP 增删改查、连接测试、密钥脱敏,并附带统一 dsh-panel 命令行。
lire1131/dsh-undo-savepoint★ 172
DSH 撤销/回退系统:配置变更自动存档,一键撤销/恢复/回退到任意版本,支持 WebUI 与离线 CLI/GUI 工具(DSH 启动失败也能救)。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。