dsh-commit-journal 0.0.0-stage → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +84 -0
- package/LICENSE +21 -0
- package/README.md +182 -3
- package/client.js +3432 -0
- package/cordis.patch.yml +4 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +3852 -0
- package/lib/index.js.map +1 -0
- package/package.json +95 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
- Sync: store per-commit diff stats (`additions` / `deletions` / optional `filesChanged`); no file path list; no bulk backfill of old rows
|
|
6
|
+
- Providers: local via `git log --numstat`; GitLab `with_stats`; Codeup/GitHub per-SHA GetCommit (concurrency 4, 429 backoff) when list omits stats; each sync backfills up to 100 older rows missing stats
|
|
7
|
+
- Codeup: no `/diff` fallback (GetCommit stats only); GitHub omits `filesChanged` when files list is truncated at 300
|
|
8
|
+
- Reports / daily exports / panel: show `+a −d` (and files when known); report header sums stats over included commits
|
|
9
|
+
- Activity: range totals `+/−` in stats cards; per-day tooltip includes line stats when present
|
|
10
|
+
|
|
11
|
+
## 0.5.0
|
|
12
|
+
|
|
13
|
+
- Reports (optional): `groupBy=ticket` merges commits by ticket id (`[ABC-123]` / `#123` / `ABC-123`); no-ticket commits stay repo-grouped
|
|
14
|
+
- Reports: conventional message parse (`type`/`scope`/`ticket`/bullets); failure degrades safely
|
|
15
|
+
- Settings: `reportGroupBy` default remains `repo`
|
|
16
|
+
|
|
17
|
+
## 0.4.0
|
|
18
|
+
|
|
19
|
+
- Reports: default exclude merge commits; optional type/author blacklists via settings
|
|
20
|
+
- Reports: `groupBy` = `repo` (default) | `day` | `flat`; header shows raw → included counts
|
|
21
|
+
- Reports: week/month attendance section vs statutory workdays (local cache; wording avoids “didn’t work”)
|
|
22
|
+
- Agent tools: `get_period_report` gains `groupBy` / `excludeMerge` / `includeAttendance`; settings update for report filters
|
|
23
|
+
|
|
24
|
+
## 0.3.0
|
|
25
|
+
|
|
26
|
+
- Providers: GitLab (incl. self-hosted) and GitHub / GitHub Enterprise adapters (GitLab pending live verification; GitHub tested)
|
|
27
|
+
- Accounts: remote provider picker (codeup | gitlab | github); optional org/group filter; apiBaseUrl defaults for gitlab.com / github.com
|
|
28
|
+
- TLS: clearer fetch/cert errors; auto-retry on cert failure; per-account `insecureSsl` (and env `DSH_COMMIT_JOURNAL_TLS_INSECURE`)
|
|
29
|
+
- Panel: wider account modal (2-col), compact icon actions, local mode default; branch API via `repoId` query
|
|
30
|
+
- Agent tools: provider-specific fields and copy; roadmap notes verification status
|
|
31
|
+
|
|
32
|
+
## 0.2.0
|
|
33
|
+
|
|
34
|
+
- Accounts: per-account `mode` — `remote` (Codeup PAT) or `local` (scan `localRoots` for `.git`)
|
|
35
|
+
- Local provider: list/branches/`git log` into the same sync → DB → commits/activity/report pipeline
|
|
36
|
+
- Panel & Agent tools show mode-specific fields and copy (rescan vs API refresh)
|
|
37
|
+
|
|
38
|
+
## 0.1.7
|
|
39
|
+
|
|
40
|
+
- Repos: All / Watched / Unwatched filter
|
|
41
|
+
- Notices use panel theme tokens (no always-dark Toast)
|
|
42
|
+
- Logs page: 10-per-page pagination
|
|
43
|
+
|
|
44
|
+
## 0.1.6
|
|
45
|
+
|
|
46
|
+
- Action feedback via Toast (success/error) for sync and other ops
|
|
47
|
+
- Activity: weekdays on the left, month labels, weekday distribution + streak/avg insights
|
|
48
|
+
|
|
49
|
+
## 0.1.5
|
|
50
|
+
|
|
51
|
+
- Repos page: keyword search, 10-per-page pager, and an “Open” button instead of a bare ↗
|
|
52
|
+
|
|
53
|
+
## 0.1.4
|
|
54
|
+
|
|
55
|
+
- Sync actions use download icon (refresh stays for list reload); connection test uses globe
|
|
56
|
+
- Commits/repos UI strips Codeup organization id from repo labels
|
|
57
|
+
- Commits pager defaults to 10 per page
|
|
58
|
+
- Settings: clarify exports folder purpose (sync daily Markdown + period reports)
|
|
59
|
+
|
|
60
|
+
## 0.1.3
|
|
61
|
+
|
|
62
|
+
- Use official `@deepseek-ai/dsh-client-ui-primitives` (Button / Modal / Input / icons); polish pager
|
|
63
|
+
- Modal mask respects `--dsh-frame-chrome-top` so DSH top-right window controls stay clickable
|
|
64
|
+
- Activity heatmap: fixed green contribution colors; weekday labels on the right, row-aligned with cells
|
|
65
|
+
|
|
66
|
+
## 0.1.2
|
|
67
|
+
|
|
68
|
+
- Native horizontal tabs: Accounts / Repos / Commits / Activity / Logs / Settings
|
|
69
|
+
- DSH dual-theme via `--dsw-alias-*` tokens; no top bar (activate account on Accounts tab)
|
|
70
|
+
- Expand local UI HTTP API for panel CRUD; remove standalone heatmap HTML page
|
|
71
|
+
|
|
72
|
+
## 0.1.1
|
|
73
|
+
|
|
74
|
+
- Fix Desktop web boot: ship `client.js` as `__ModuleLoader__` CJS factory (not ESM)
|
|
75
|
+
- Sidebar panel embeds local heatmap UI; align `dsh.client.inject` with locale/layout/sidebar
|
|
76
|
+
|
|
77
|
+
## 0.1.0
|
|
78
|
+
|
|
79
|
+
- Initial open-source release as a DeepSeek Harness (`dsh`) plugin
|
|
80
|
+
- Multi-VCS provider abstraction (`codeup` | `gitlab` | `github`)
|
|
81
|
+
- Codeup adapter: sync commits, list repos/branches, connection test
|
|
82
|
+
- Agent tools: accounts, sync, query, period report, activity heatmap
|
|
83
|
+
- Local GitHub-style activity heatmap Web UI (`http://127.0.0.1:39282/`)
|
|
84
|
+
- Roadmap stubs for enterprise GitLab / GitHub
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 yu-bobo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,182 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# dsh-commit-journal
|
|
2
|
+
|
|
3
|
+
DeepSeek Harness (`dsh`) 插件:按账号选择 **远程拉取**(Codeup / GitLab / GitHub)或 **本地扫描**(本机 git 根目录),浏览时间线与活跃热力图,并交给 Agent 写日/周/月报材料。
|
|
4
|
+
|
|
5
|
+
| 能力 | 说明 |
|
|
6
|
+
|------|------|
|
|
7
|
+
| 双模式账号 | **remote**:平台 PAT 拉仓;**local**:手填根目录扫 `.git`,无需令牌 |
|
|
8
|
+
| 多账号 | 本机加密存放 PAT(仅 remote);local 只存根路径 |
|
|
9
|
+
| 增量同步 | 按关注仓库 / 作者过滤;定时任务两种模式共用 |
|
|
10
|
+
| 面板 | 账号 · 仓库 · 提交 · 活跃 · 日志 · 设置 |
|
|
11
|
+
| Provider | **remote:Codeup / GitLab(含自建) / GitHub(含 GHE)**;**local:本机 git** |
|
|
12
|
+
|
|
13
|
+
侧栏打开「提交日志」即可使用。
|
|
14
|
+
|
|
15
|
+
**定位**:适合「未 clone / 不想逐仓告知路径」的跨仓提交材料,或「本机多根目录批量索引」。
|
|
16
|
+
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
## 安装
|
|
22
|
+
|
|
23
|
+
推荐(npm):
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
dsh plugin --profile web add dsh-commit-journal
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
或从 GitHub / Release tarball:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
dsh plugin --profile web add github:yu-bobo/dsh-commit-journal
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
本地开发:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
dsh plugin --profile web add link:<本仓库路径>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
重启 DSH 后生效。
|
|
42
|
+
|
|
43
|
+
## 使用
|
|
44
|
+
|
|
45
|
+
### 远程账号(Codeup)
|
|
46
|
+
|
|
47
|
+
1. 打开侧栏「提交日志」→ **账号** → 新建,模式选 **远程拉取**,平台选 **Codeup**
|
|
48
|
+
2. 中心版填 organizationId + PAT;Region 版填 API Base
|
|
49
|
+
3. 点 **使用** 切换当前账号 → **仓库** 刷新、关注、「同步关注」
|
|
50
|
+
|
|
51
|
+
### 远程账号(GitLab / 自建)
|
|
52
|
+
|
|
53
|
+
1. 模式选 **远程拉取**,平台选 **GitLab**
|
|
54
|
+
2. `gitlab.com` 可留空 API Base;自建填主机(如 `https://gitlab.example.com`,缺 `/api/v4` 会自动补)
|
|
55
|
+
3. 可选填 Group(路径或 ID)缩小项目范围;留空则列 membership 项目
|
|
56
|
+
4. PAT 至少:`read_api`、`read_repository`
|
|
57
|
+
|
|
58
|
+
### 远程账号(GitHub / GitHub Enterprise)
|
|
59
|
+
|
|
60
|
+
1. 模式选 **远程拉取**,平台选 **GitHub / 企业版**
|
|
61
|
+
2. `github.com` 可留空 API Base;GHE 填主机(如 `https://github.example.com`,缺 `/api/v3` 会自动补)
|
|
62
|
+
3. 「组织 / 用户」可填 org 或个人 login(如 `yu-bobo`,也支持主页 URL);留空则列令牌可见全部仓库
|
|
63
|
+
4. 创建 PAT:头像 → **Settings** → **Developer settings** → **Personal access tokens** → Fine-grained / Classic。私有仓 classic 需 `repo`;fine-grained 至少 **Contents: Read**
|
|
64
|
+
5. 若测连/刷新报 `fetch failed` / 证书错误(常见于公司代理),勾选 **跳过 TLS 证书校验**,或设 `DSH_COMMIT_JOURNAL_TLS_INSECURE=1` 后重启 DSH
|
|
65
|
+
|
|
66
|
+
### 本地账号(扫描)
|
|
67
|
+
|
|
68
|
+
1. 新建账号,模式选 **本地扫描**
|
|
69
|
+
2. 「扫描根目录」每行一个绝对路径(如 `F:\Personal\projects`)
|
|
70
|
+
3. **仓库** → **重新扫描** → 勾选关注 → **同步关注(本地)**(对关注仓跑 `git log` 入库)
|
|
71
|
+
|
|
72
|
+
### 共用
|
|
73
|
+
|
|
74
|
+
- **提交 / 活跃 / 日志** 读本地缓存;**设置** 调整同步间隔与回溯天数(对 remote API 与 local 重扫均生效)
|
|
75
|
+
|
|
76
|
+
### 云效 PAT 权限(仅 Codeup)
|
|
77
|
+
|
|
78
|
+
个人访问令牌至少:代码仓库、提交 → 只读。建议同时:代码组、分支 → 只读。改权限后请新建令牌。
|
|
79
|
+
|
|
80
|
+
## 提交信息格式
|
|
81
|
+
|
|
82
|
+
写代码时建议按 [git-commit](https://github.com/yu-bobo/awesome-skills/tree/master/git-commit) 规范提交,正文写清「做了什么 / 影响范围」,便于后续从提交材料改写日/周/月报:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
type(scope): [TICKET-ID] 简述
|
|
86
|
+
|
|
87
|
+
- 详细说明 1
|
|
88
|
+
- 详细说明 2
|
|
89
|
+
- 影响范围:...
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
示例:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
feat(smart-patrol): H5 今日任务对接分页并触底无限加载
|
|
96
|
+
|
|
97
|
+
- 列表接口改为分页请求,首次加载 + 触底加载更多
|
|
98
|
+
- 加载完毕展示无更多数据提示
|
|
99
|
+
- 影响智能巡检 H5 今日任务列表页
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Agent 能做什么
|
|
103
|
+
|
|
104
|
+
插件把同步到的提交交给 Agent 工具调用。适合:
|
|
105
|
+
|
|
106
|
+
- 写日报 / 周报 / 月报(按提交材料改写,保留具体功能点与影响范围)
|
|
107
|
+
- 查某段时间、某个仓库、某个关键词的提交
|
|
108
|
+
- 看活跃热力、某天具体改了什么
|
|
109
|
+
- 先同步再汇总(数据以本地缓存为准)
|
|
110
|
+
|
|
111
|
+
面板负责配账号、关注仓库、看 UI;报告类能力主要走对话里的 tools(无「报告」页签)。
|
|
112
|
+
|
|
113
|
+
## Agent 工具
|
|
114
|
+
|
|
115
|
+
| Tool | 说明 |
|
|
116
|
+
|------|------|
|
|
117
|
+
| `list_accounts` | 列本地账号(含 `mode` / `provider` / `localRoots`)与当前活跃账号 |
|
|
118
|
+
| `upsert_account` / `remove_account` | 创建、更新、删除;`mode=local` 时填 `localRoots`,无需 token |
|
|
119
|
+
| `sync_commits` | 增量同步(remote API 或 local `git log`) |
|
|
120
|
+
| `list_repos` | 仓库列表;`refresh` 时 remote 拉 API / local 重扫 |
|
|
121
|
+
| `query_commits` | 按日期 / 仓库 / 关键词查本地提交(含增删行汇总字段,旧数据可缺) |
|
|
122
|
+
| `get_period_report` | 日 / 周 / 月 / 自定义区间 Markdown(默认排除 merge、按仓库分组;可选 `groupBy=ticket`;周/月含出勤对照;页头/条目含 `+/−` 汇总;可落盘) |
|
|
123
|
+
| `get_activity_heatmap` | 热力统计;传 `date` 可取单日明细 |
|
|
124
|
+
| `update_journal_settings` | 同步间隔、回溯、导出目录、报告过滤与默认 `reportGroupBy` 等 |
|
|
125
|
+
|
|
126
|
+
## 可直接对 Agent 说的提示词
|
|
127
|
+
|
|
128
|
+
```text
|
|
129
|
+
先 list_accounts,用当前账号 sync_commits,再给我昨天的工作日报(get_period_report kind=day)。按提交正文里的功能点与影响范围改写,不要只列 commit 标题。
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
新建一个本地扫描账号,localRoots 为 F:\Personal\projects,作者过滤我的邮箱,然后 refresh 仓库并 sync。
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```text
|
|
137
|
+
新建 GitLab 账号,provider=gitlab,apiBaseUrl 为我的自建地址,填 token 后 test 并 sync。
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
```text
|
|
141
|
+
查本周我在各仓库的提交,按仓库分组总结做了什么(query_commits + 必要时 get_period_report kind=week)。输出保留具体改动点与影响范围。
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
建议流程:`list_accounts` →(缺数据则)`sync_commits` → `query_commits` / `get_period_report` / `get_activity_heatmap`。
|
|
145
|
+
|
|
146
|
+
### 报告选项
|
|
147
|
+
|
|
148
|
+
**通用底座(默认)**
|
|
149
|
+
|
|
150
|
+
- **过滤**:默认排除 merge;可用设置 `reportExcludeTypes` / `reportExcludeAuthors`(默认空),或单次传 `excludeMerge`
|
|
151
|
+
- **分组**:`groupBy=repo`(默认)| `day` | `flat`
|
|
152
|
+
- **出勤对照**:仅周/月;按法定工作日对照本地缓存是否有提交(文案为「本地缓存无提交」);`includeAttendance=false` 可关
|
|
153
|
+
|
|
154
|
+
**可选增强**
|
|
155
|
+
|
|
156
|
+
- **`groupBy=ticket`**:按提交说明中的工单号归并(`[ABC-123]` / `#123` / `ABC-123`);无工单仍按仓库列出。也可用设置 `reportGroupBy=ticket` 作为默认。
|
|
157
|
+
|
|
158
|
+
## 数据目录
|
|
159
|
+
|
|
160
|
+
```text
|
|
161
|
+
~/.dsh-commit-journal/ # 可用环境变量 DSH_COMMIT_JOURNAL_HOME 覆盖
|
|
162
|
+
accounts.json
|
|
163
|
+
settings.json
|
|
164
|
+
secrets/*.bin # 仅 remote 账号
|
|
165
|
+
data.json
|
|
166
|
+
holiday-cache/
|
|
167
|
+
exports/
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## 路线图
|
|
171
|
+
|
|
172
|
+
- [x] Codeup(阿里云云效)远程拉取
|
|
173
|
+
- [x] 本机 git 根目录扫描(按账号)
|
|
174
|
+
- [x] GitLab(含自建)— 已接入,**待实测**
|
|
175
|
+
- [x] GitHub / GitHub Enterprise — 已接入并实测(含公司代理 TLS)
|
|
176
|
+
- [x] 报告通用底座(merge 过滤、按仓库/按日、法定工作日出勤对照)
|
|
177
|
+
- [x] 报告可选增强(conventional 解析 / `groupBy=ticket`)
|
|
178
|
+
- [x] 变更汇总(增删行 / 可得时的文件数;不存路径;同步写入,并每轮最多回填 100 条缺 stats 历史)
|
|
179
|
+
|
|
180
|
+
## License
|
|
181
|
+
|
|
182
|
+
MIT
|