@klarkxy/dsh-git-commit 0.2.2 → 0.2.4
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/README.md +16 -67
- package/docs/README.zh-CN.md +15 -44
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,86 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
# Git Commit
|
|
2
2
|
|
|
3
3
|
<!-- release-state-note -->
|
|
4
4
|
|
|
5
|
-
Commit workspace changes to git without leaving the chat. Every conversation
|
|
6
|
-
thread gets a **Commit** action in its header: click it, check the branch, the
|
|
7
|
-
file count and the model that will be used, then confirm to commit every
|
|
8
|
-
uncommitted path in the repository that contains the session's working
|
|
9
|
-
directory.
|
|
10
|
-
|
|
11
5
|
[简体中文](docs/README.zh-CN.md)
|
|
12
6
|
|
|
13
|
-
|
|
7
|
+
Commit workspace changes without leaving the chat. A model groups your changes into a few sensible commits and writes their messages.
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
with the DSH plugin manager; the install also enables the `git-commit` entry:
|
|
9
|
+
## Install
|
|
17
10
|
|
|
18
11
|
```sh
|
|
19
12
|
dsh plugin --profile web add @klarkxy/dsh-git-commit
|
|
20
13
|
```
|
|
21
14
|
|
|
22
|
-
Replace `web` with your profile name
|
|
23
|
-
restart when the host asks for one.
|
|
24
|
-
|
|
25
|
-
To uninstall:
|
|
26
|
-
|
|
27
|
-
```sh
|
|
28
|
-
dsh plugin --profile web remove @klarkxy/dsh-git-commit
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## How it works
|
|
32
|
-
|
|
33
|
-
A model splits the change set into a small number of coherent commits with
|
|
34
|
-
proper messages, then the groups are applied in order as path-scoped commits.
|
|
35
|
-
The model route comes from this plugin's own settings row: configure the
|
|
36
|
-
**Commit planning model** there in advance to pin a dedicated model; when
|
|
37
|
-
nothing is configured, the request follows the live session model and then the
|
|
38
|
-
host default chat model. If the model call fails or returns an invalid plan,
|
|
39
|
-
the run is **rejected** and nothing is staged or committed — a commit the model
|
|
40
|
-
never planned is not one you asked for. The plugin page can opt back into the
|
|
41
|
-
old behavior with **Commit even without a model plan**, which merges every
|
|
42
|
-
change into a single commit with a plugin-written message.
|
|
43
|
-
|
|
44
|
-
## Plugin page settings
|
|
45
|
-
|
|
46
|
-
`Settings → Plugins → Git Commit` holds the rows this plugin needs.
|
|
47
|
-
**Commit planning model** is optional: a saved route is used for the planning
|
|
48
|
-
call as an explicit model, an empty selection follows the live session model
|
|
49
|
-
and then the host default chat model, and the conversation header panel reports
|
|
50
|
-
which of the two is in effect. Only that call is affected; a saved route selects
|
|
51
|
-
a model, but it is not evidence of connectivity. **Commit even without a model
|
|
52
|
-
plan** is off by default and only changes what happens when planning produces
|
|
53
|
-
nothing.
|
|
54
|
-
|
|
55
|
-
## Usage
|
|
15
|
+
Replace `web` with your profile name and restart it if DSH asks.
|
|
56
16
|
|
|
57
|
-
|
|
58
|
-
2. Click **Commit** in the thread header (top right).
|
|
59
|
-
3. Confirm in the popover, then wait for the run to finish.
|
|
60
|
-
4. The panel lists every commit it created (hash + message).
|
|
17
|
+
## Use
|
|
61
18
|
|
|
62
|
-
|
|
63
|
-
|
|
19
|
+
1. Open a conversation whose workspace is inside a Git repository.
|
|
20
|
+
2. Click **Commit** in the top-right of the conversation.
|
|
21
|
+
3. Check the branch, file count, and model, then confirm.
|
|
22
|
+
4. The panel lists the commits it created.
|
|
64
23
|
|
|
65
|
-
|
|
66
|
-
The panel shows those commits, the remaining groups and the stopping reason,
|
|
67
|
-
then refreshes repository status. A commit whose hash could not be read is
|
|
68
|
-
marked explicitly. It never rolls back completed commits or retries them
|
|
69
|
-
automatically. Unloading the plugin cancels in-flight planning and rejects new
|
|
70
|
-
runs while existing cleanup finishes.
|
|
71
|
-
If a rejected Git command leaves HEAD changed or unreadable, its group's outcome
|
|
72
|
-
is marked uncertain without attributing a commit to the plugin. Check Git log
|
|
73
|
-
and status before acting on that group; it is separate from groups not executed.
|
|
24
|
+
Under **Plugins → Git Commit** you can choose the **Commit planning model** (empty follows the current session model) and turn on **Commit even without a model plan**, which makes one commit when the model is unavailable.
|
|
74
25
|
|
|
75
|
-
##
|
|
26
|
+
## Good to know
|
|
76
27
|
|
|
77
|
-
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
-
|
|
81
|
-
model, while binaries are listed by path only.
|
|
82
|
-
- Commits never push. Pushing stays a manual decision.
|
|
28
|
+
- All uncommitted changes in the repository are included, including new files.
|
|
29
|
+
- It only commits; it never pushes.
|
|
30
|
+
- If the run stops partway, finished commits stay and the panel shows what was left. Nothing is rolled back or retried automatically.
|
|
31
|
+
- The button is unavailable while the session is running.
|
|
83
32
|
|
|
84
33
|
## License
|
|
85
34
|
|
|
86
|
-
|
|
35
|
+
[SATA License 2.1](LICENSE)
|
package/docs/README.zh-CN.md
CHANGED
|
@@ -1,64 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
# Git 提交
|
|
2
2
|
|
|
3
3
|
<!-- release-state-note -->
|
|
4
4
|
|
|
5
|
-
在对话里直接把工作区修改提交到 git。每个对话线程的右上角都有一个 **提交** 按钮:
|
|
6
|
-
点一下打开弹层,确认分支、文件数量和将使用的模型,再点一下即可把会话工作目录
|
|
7
|
-
所在仓库的全部未提交改动分次提交。
|
|
8
|
-
|
|
9
5
|
[English](../README.md)
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
不离开对话就能提交工作区改动。模型会把改动分成几个合理的提交,并写好提交信息。
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
`git-commit` 入口:
|
|
9
|
+
## 安装
|
|
15
10
|
|
|
16
11
|
```sh
|
|
17
12
|
dsh plugin --profile web add @klarkxy/dsh-git-commit
|
|
18
13
|
```
|
|
19
14
|
|
|
20
|
-
把 `web` 换成你的 profile
|
|
21
|
-
|
|
22
|
-
卸载:
|
|
23
|
-
|
|
24
|
-
```sh
|
|
25
|
-
dsh plugin --profile web remove @klarkxy/dsh-git-commit
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## 工作方式
|
|
29
|
-
|
|
30
|
-
模型会把改动整理成若干个内聚的提交并生成提交信息,然后按顺序逐组创建限定路径的提交。模型路由由本插件自己的设置行提供:在「设置 → 插件 → Git 提交」提前配置**提交规划模型**即可固定专用模型;没有配置时依次使用当前会话模型和宿主默认对话模型。模型调用失败或返回非法分组时,本次提交会被**拒绝**,不会暂存也不会提交任何内容——模型没有规划过的提交不是你要求的提交。想要回到旧行为,可以在插件页打开**模型不可用时仍然提交**,此时全部改动会合并成一个提交,由插件代写提交信息。
|
|
31
|
-
|
|
32
|
-
## 插件页设置
|
|
33
|
-
|
|
34
|
-
「设置 → 插件 → Git 提交」下是本插件需要的设置项。**提交规划模型**用于提交规划调用,
|
|
35
|
-
可留空:保存某个路由后,对应该调用会使用这个显式模型;留空则使用当前会话模型,
|
|
36
|
-
再回落到宿主默认对话模型。对话头部面板会显示实际生效的是哪一种。只有这个调用受影响;
|
|
37
|
-
保存路由只表示选定模型,不代表已连通。**模型不可用时仍然提交**默认关闭,只在
|
|
38
|
-
规划完全没有产出时改变行为。
|
|
15
|
+
把 `web` 换成你的 profile 名,DSH 提示时重启。
|
|
39
16
|
|
|
40
17
|
## 使用
|
|
41
18
|
|
|
42
|
-
1. 打开一个工作目录位于
|
|
43
|
-
2.
|
|
44
|
-
3.
|
|
45
|
-
4.
|
|
46
|
-
|
|
47
|
-
会话运行期间按钮不可用。宿主在提交前还会再检查一次,规划期间工作区发生变化时会中止本次提交。
|
|
19
|
+
1. 打开一个工作目录位于 Git 仓库内的对话。
|
|
20
|
+
2. 点击对话右上角的「提交」。
|
|
21
|
+
3. 确认分支、文件数和模型后提交。
|
|
22
|
+
4. 面板会列出创建的提交。
|
|
48
23
|
|
|
49
|
-
|
|
50
|
-
分组和停止原因,再刷新仓库状态;已创建但未能读回哈希的提交会明确标注。
|
|
51
|
-
插件不会回滚已完成的提交,也不会自动重试。卸载插件会取消正在进行的规划,
|
|
52
|
-
拒绝新的执行,并等待已有操作完成清理。
|
|
53
|
-
如果 Git 命令报错后 HEAD 已变化或无法读回,对应分组会标为“结果不确定”,不擅自
|
|
54
|
-
归属某个提交。请先检查 Git 日志和状态;这一组与尚未执行的分组分开显示。
|
|
24
|
+
在「插件 → Git 提交」里可以选择**提交规划模型**(留空跟随当前会话模型),也可以打开**模型不可用时仍然提交**,这时所有改动合并为一个提交。
|
|
55
25
|
|
|
56
|
-
##
|
|
26
|
+
## 注意
|
|
57
27
|
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
28
|
+
- 会提交仓库里的全部未提交改动,包括新文件。
|
|
29
|
+
- 只提交,不推送。
|
|
30
|
+
- 中途停止时,已完成的提交会保留,面板显示剩余内容;不会自动回滚或重试。
|
|
31
|
+
- 会话运行期间按钮不可用。
|
|
61
32
|
|
|
62
33
|
## 许可证
|
|
63
34
|
|
|
64
|
-
|
|
35
|
+
[SATA License 2.1](../LICENSE)
|
package/locale/en.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "Git Commit",
|
|
4
|
-
"description": "Commit workspace changes from the conversation header, with
|
|
4
|
+
"description": "Commit workspace changes from the conversation header, with the model grouping the commits."
|
|
5
5
|
}
|
|
6
6
|
}
|
package/locale/zh.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@klarkxy/dsh-git-commit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Git Commit: commit workspace changes from the conversation header, with model-planned commit groups.",
|
|
5
5
|
"icon": "./icon.svg",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"test": "vitest run --root ../.. --config vitest.editor-plugins.config.ts --maxWorkers=2 plugins/dsh-git-commit/src"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@klarkxy/dsh-model-route": "0.2.
|
|
78
|
-
"@klarkxy/dsh-plugin-kit": "0.3.
|
|
77
|
+
"@klarkxy/dsh-model-route": "0.2.3",
|
|
78
|
+
"@klarkxy/dsh-plugin-kit": "0.3.3",
|
|
79
79
|
"zod": "^4.1.5"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
@@ -124,6 +124,6 @@
|
|
|
124
124
|
"registry": "https://registry.npmjs.org/"
|
|
125
125
|
},
|
|
126
126
|
"dshRelease": {
|
|
127
|
-
"contentHash": "
|
|
127
|
+
"contentHash": "5969e869f1ff7f8095f3a073b63e49aeac15b83c02c27e2c6fb1ca8560a8c18e"
|
|
128
128
|
}
|
|
129
129
|
}
|