| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
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.
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:
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.
| 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.
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-codetimeThen merge the row from cordis.patch.yml into your profile's cordis.patch.yml (or $DSH_HOME/cordis.patch.yml).
⚠️ sessionTelemetry is a singleton — one backend per process. The base bundle always mounts session-telemetry-otel (even in its default DISABLED mode it registers the Service), so disable it before mounting this backend — the shipped cordis.patch.yml already does both.
| 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).
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.
If dsh-codetime does 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-dev |
| Repository | dsh-codetime |
| Workflow | .github/workflows/publish.yml |
Leave Environment empty.
npm version patch # or: minor / major — bumps package.json, commits, tags vX.Y.Z
git push --follow-tagsPushing 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.
| Back | FazBrowse Home | New Git URL |