feat(zcode-wakatime): add WakaTime plugin for AI coding time tracking - #8
Open
RoiexLee wants to merge 2 commits into
Open
feat(zcode-wakatime): add WakaTime plugin for AI coding time tracking#8RoiexLee wants to merge 2 commits into
RoiexLee wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds zcode-wakatime, a WakaTime plugin for ZCode (Z.ai's agentic coding tool). It registers ZCode lifecycle hooks to trigger wakatime-cli's official AI-activity sync:
SessionStart— installs/updates wakatime-cli into~/.wakatime/UserPromptSubmit/PostToolUse(edit tools) — runswakatime-cli --sync-ai-heartbeats, which parses ZCode's own session store (~/.zcode/cli/db/db.sqlite) via the official ZCode parser (pkg/ai/zcode.go, shipped in wakatime-cli v2.26.0) and uploads AI Coding heartbeats (session entities, AI line changes, token counts)Why
wakatime-cli already parses ZCode sessions, but the AI sync only runs when some wakatime plugin sends a heartbeat. This plugin triggers that sync exactly when ZCode activity happens, so ZCode sessions are tracked even when no other editor is open.
Structure
.zcode-plugin/plugin.json+hooks/hooks.json+bin/zcode-wakatime.js— single zero-dependency Node script, two-stage detached execution so hooks never block the sessionTesting
ZCode sess_*session entities)python scripts/validate.py→OK: 17 plugin(s) validatedVersion
plugin.json0.2.0 matches the marketplace entry 0.2.0 (version-sync rule).License
BSD-3-Clause
Self-check / 自查清单
plugins/<name>// 插件名唯一且 kebab-case,目录为plugins/<name>/versionbumped in BOTHplugin.jsonandmarketplace.json(artifacts are immutable) /plugin.json与marketplace.json两处版本号已同步升级(制品不可变)README.md(EN) andREADME_CN.md(中文) both updated and equivalent / 中英文 README 均已更新且语义一致description_i18nhas bothenandzh-CN/description_i18n包含en与zh-CNpython3 scripts/validate.pyandpython3 scripts/build_dist.pypass locally / 本地校验与构建均通过