DeepSeek Harness 的 CodeTime
CodeTime for DeepSeek Harness
安装
dsh plugin --profile web add github:codetime-dev/dsh-codetimeGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗
安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。
README
目录
Automatic coding-time tracking for codetime.dev, ported
to the DeepSeek Harness
(dsh). This is the native dsh telemetry backend — the dsh-side sibling of
codetime-cli's agent adapters for Claude Code / Codex / OpenCode / Pi.
It reports session, turn, tool, file, and model activity to the same agent
ingest endpoint the CLI uses (POST /v3/agent/ingest), so dsh activity lands
on the same dashboard as your other AI-agent tools.
How it works
dsh already ships a telemetry seam (@deepseek-ai/dsh-session-telemetry) that
captures session events live (or on demand), projects them, runs the
session-telemetry/record redaction waterfall, and hands
SessionTelemetryRecords to any backend that implements emit / flush /
shutdown. This package is such a backend:
SessionTelemetryCoordinatordrivesemit(record)for every projected session event.- Each record is translated into a codetime canonical event
(
session.started,turn.started,prompt.submitted,tool.started,tool.completed,file.changed,command.completed,model.usage, …). - Events accumulate per session and are rolled up (15-minute buckets, per-model
/ per-tool / per-file / per-turn aggregates) with the exact wire format
codetime-cliuses. - A periodic flush POSTs
{ rollups, replace: true }to/v3/agent/ingest, upserting each session's rollup by its stable key.
emit only queues in memory (no I/O), so it never blocks the session firehose.
Batching, the periodic timer, and the bounded shutdown drain own the network.
Mapping
dsh session/event type |
codetime canonical event |
|---|---|
turn/start / turn/end |
turn.started / turn.completed | turn.failed |
user/message (direct prompt) |
prompt.submitted |
assistant/message (with usage) |
model.usage |
tool/call |
tool.started |
tool/result |
tool.completed | tool.failed + file.read/changed/searched |
tool/result (bash/pwsh/…) |
command.completed | command.failed |
compaction/end |
context.compacted |
session created / disposed |
session.started / session.ended |
File activities are derived from the tool name and its parsed arguments
(read → read, write → write, edit/str_replace → edit with
linesAdded/linesRemoved, glob/grep → search). session.cwd becomes
the codetime project and workspaceId.
Install & wire
The package is a host-plane plugin (a process-global sessionTelemetry
Service). Install it into your profile and add one row to the composition.
dsh plugin --profile web add dsh-codetime
Then merge the row from cordis.patch.yml into your
profile's cordis.patch.yml (or $DSH_HOME/cordis.patch.yml).
⚠️
sessionTelemetryis a singleton — one backend per process. The base bundle always mountssession-telemetry-otel(even in its defaultDISABLEDmode it registers the Service), so disable it before mounting this backend — the shippedcordis.patch.ymlalready does both.
Configuration
| Key | Default | Meaning |
|---|---|---|
mode |
FULL (in the shipped patch) |
FULL (live capture), FEEDBACK_ONLY (capture on /feedback), or DISABLED. The backend itself defaults to DISABLED when the key is absent. |
apiUrl |
https://codetime.dev |
API base URL. |
flushIntervalMs |
60000 |
Rollup flush cadence. |
shutdownTimeoutMs |
5000 |
Upper bound on the final drain at teardown. |
Token resolution (first match wins): CODETIME_TOKEN env →
~/.codetime/config.json token. If you already signed in with the codetime CLI
or another editor extension, the shared ~/.codetime/config.json token is
picked up automatically. The machine-id in ~/.codetime/machine-id identifies
the machine on the dashboard (created on first use, shared with the CLI).
Limitations
- Event buffers are held per session in memory and re-sent whole each flush (idempotent upsert); very long-lived sessions grow their in-memory buffer.
- Historical sessions are not backfilled — this reports only activity the
live process observes. Pair it with a
codetime-clidshbackfill adapter to import~/.dsh/sessions/**/session.jsonl.zstdhistory. - No redaction rules are shipped: records leave the process exactly as captured
by the seam. Mount your own
session-telemetry/recordwaterfall rules if you export beyond a trusted boundary.
Publishing (npm)
Publishing runs through GitHub Actions using an npm Trusted Publisher
(OIDC): the workflow requests a short-lived token with id-token: write, so no
npm token is ever stored in the repository.
One-time npm setup
If
dsh-codetimedoes not exist on npm yet, publish the first version once from the command line to create it:npm publish --access publicOn npmjs.com, open the package → Settings → Publishing access → Add trusted publisher (GitHub Actions):
Field Value Owner codetime-devRepository dsh-codetimeWorkflow .github/workflows/publish.ymlLeave Environment empty.
Release a version
npm version patch # or: minor / major — bumps package.json, commits, tags vX.Y.Z
git push --follow-tags
Pushing the v* tag triggers publish.yml,
which runs npm publish --provenance --access public. You can also trigger it
manually from the repository's Actions tab.
原始 README: https://github.com/codetime-dev/dsh-codetime/blob/main/README.md ↗
同类插件
查看全部 →
dsh-anchored-standard
两阶段 DeepSeek Harness 预设:先 Minimal 对齐的 bootstrap,再切完整 Standard 工具(Project2 98/99)

PicGo-Core
极致的图片上传引擎,CLI 与 API 双支持

awesome-deepseek-harness
DeepSeek Harness(DSH)及其优秀社区插件的精选指南。

awesome-deepseek-harness
DeepSeek Harness (DSH)生态系统:来自dsh-external/hub和公共dsh-plugin主题的精选插件、工具和基础设施。

AI-Novel-Writer
本地优先 AI 小说创作工作台,提供 Windows/macOS 桌面版与 DeepSeek Harness 插件开发预览,支持角色、大纲、章节蓝图、审稿修稿和本地模型。

mcp-for-stata
MCP-for-Stata:把 Stata 集成进你的 agent