@klarkxy/dsh-git-commit 0.1.4 → 0.1.5
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 +44 -16
- package/docs/README.zh-CN.md +28 -11
- package/lib/client.inner.cjs +923 -152
- package/lib/client.inner.cjs.map +1 -1
- package/lib/client.js +923 -152
- package/lib/contracts.d.ts +77 -2
- package/lib/contracts.js +38 -1
- package/lib/contracts.js.map +1 -1
- package/lib/index.d.ts +21 -7
- package/lib/index.js +139 -42
- package/lib/index.js.map +1 -1
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +20 -6
- package/lib/contracts2.d.ts +0 -54
package/README.md
CHANGED
|
@@ -1,37 +1,65 @@
|
|
|
1
1
|
# @klarkxy/dsh-git-commit
|
|
2
2
|
|
|
3
|
-
Commit workspace changes to git without leaving the chat.
|
|
4
|
-
thread gets a **Commit** action in its header: click it,
|
|
3
|
+
Commit workspace changes to git without leaving the chat. Every conversation
|
|
4
|
+
thread gets a **Commit** action in its header: click it, check the branch, the
|
|
5
5
|
file count and the model that will be used, then confirm to commit every
|
|
6
6
|
uncommitted path in the repository that contains the session's working
|
|
7
7
|
directory.
|
|
8
8
|
|
|
9
|
+
[简体中文](docs/README.zh-CN.md)
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
Requires Node.js ≥22. If your DSH distribution does not bundle this plugin,
|
|
14
|
+
install it and enable its `git-commit` entry through the host plugin
|
|
15
|
+
configuration.
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
npm install @klarkxy/dsh-git-commit
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## How it works
|
|
22
|
+
|
|
9
23
|
A model splits the change set into a small number of coherent commits with
|
|
10
24
|
proper messages, then the groups are applied in order as path-scoped commits.
|
|
11
|
-
The model route comes from
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
25
|
+
The model route comes from this plugin's own settings row: configure the
|
|
26
|
+
**Commit planning model** there in advance to pin a dedicated model; when
|
|
27
|
+
nothing is configured, the request follows the live session model and then the
|
|
28
|
+
host default chat model. If the model call fails or returns an invalid plan,
|
|
29
|
+
the run is **rejected** and nothing is staged or committed — a commit the model
|
|
30
|
+
never planned is not one you asked for. The plugin page can opt back into the
|
|
31
|
+
old behavior with **Commit even without a model plan**, which merges every
|
|
32
|
+
change into a single commit with a plugin-written message.
|
|
33
|
+
|
|
34
|
+
## Plugin page settings
|
|
35
|
+
|
|
36
|
+
`Settings → Plugins → Git Commit` holds the rows this plugin needs.
|
|
37
|
+
**Commit planning model** is optional: a saved route is used for the planning
|
|
38
|
+
call as an explicit model, an empty selection follows the live session model
|
|
39
|
+
and then the host default chat model, and the conversation header panel reports
|
|
40
|
+
which of the two is in effect. Only that call is affected; a saved route selects
|
|
41
|
+
a model, but it is not evidence of connectivity. **Commit even without a model
|
|
42
|
+
plan** is off by default and only changes what happens when planning produces
|
|
43
|
+
nothing.
|
|
17
44
|
|
|
18
45
|
## Usage
|
|
19
46
|
|
|
20
|
-
1. Open a conversation whose workspace
|
|
47
|
+
1. Open a conversation whose workspace sits inside a git repository.
|
|
21
48
|
2. Click **Commit** in the thread header (top right).
|
|
22
|
-
3. Confirm in the popover
|
|
23
|
-
4. The panel lists every commit created (hash + message).
|
|
49
|
+
3. Confirm in the popover, then wait for the run to finish.
|
|
50
|
+
4. The panel lists every commit it created (hash + message).
|
|
24
51
|
|
|
25
52
|
The button is disabled while the session is running. The host checks again
|
|
26
|
-
before committing and stops if the workspace changes during planning.
|
|
53
|
+
before committing, and stops the run if the workspace changes during planning.
|
|
27
54
|
|
|
28
55
|
## Notes
|
|
29
56
|
|
|
30
57
|
- Each selected file is committed from its current worktree content. Pre-staged
|
|
31
|
-
changes
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
58
|
+
changes that belong to another group stay staged until that group is
|
|
59
|
+
committed.
|
|
60
|
+
- Untracked files are included: small text files get a content preview for the
|
|
61
|
+
model, while binaries are listed by path only.
|
|
62
|
+
- Commits never push. Pushing stays a manual decision.
|
|
35
63
|
|
|
36
64
|
## License
|
|
37
65
|
|
package/docs/README.zh-CN.md
CHANGED
|
@@ -1,29 +1,46 @@
|
|
|
1
1
|
# @klarkxy/dsh-git-commit
|
|
2
2
|
|
|
3
|
-
在对话里直接把工作区修改提交到 git
|
|
3
|
+
在对话里直接把工作区修改提交到 git。每个对话线程的右上角都有一个 **提交** 按钮:
|
|
4
4
|
点一下打开弹层,确认分支、文件数量和将使用的模型,再点一下即可把会话工作目录
|
|
5
5
|
所在仓库的全部未提交改动分次提交。
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
[English](../README.md)
|
|
8
|
+
|
|
9
|
+
## 安装
|
|
10
|
+
|
|
11
|
+
需要 Node.js ≥22。若所用 DSH 发行版未内置本插件,可先安装,再通过宿主插件配置启用
|
|
12
|
+
`git-commit` 入口:
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install @klarkxy/dsh-git-commit
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 工作方式
|
|
19
|
+
|
|
20
|
+
模型会把改动整理成若干个内聚的提交并生成提交信息,然后按顺序逐组创建限定路径的提交。模型路由由本插件自己的设置行提供:在「设置 → 插件 → Git 提交」提前配置**提交规划模型**即可固定专用模型;没有配置时依次使用当前会话模型和宿主默认对话模型。模型调用失败或返回非法分组时,本次提交会被**拒绝**,不会暂存也不会提交任何内容——模型没有规划过的提交不是你要求的提交。想要回到旧行为,可以在插件页打开**模型不可用时仍然提交**,此时全部改动会合并成一个提交,由插件代写提交信息。
|
|
21
|
+
|
|
22
|
+
## 插件页设置
|
|
23
|
+
|
|
24
|
+
「设置 → 插件 → Git 提交」下是本插件需要的设置项。**提交规划模型**用于提交规划调用,
|
|
25
|
+
可留空:保存某个路由后,对应该调用会使用这个显式模型;留空则使用当前会话模型,
|
|
26
|
+
再回落到宿主默认对话模型。对话头部面板会显示实际生效的是哪一种。只有这个调用受影响;
|
|
27
|
+
保存路由只表示选定模型,不代表已连通。**模型不可用时仍然提交**默认关闭,只在
|
|
28
|
+
规划完全没有产出时改变行为。
|
|
12
29
|
|
|
13
30
|
## 使用
|
|
14
31
|
|
|
15
32
|
1. 打开一个工作目录位于 git 仓库内的对话。
|
|
16
33
|
2. 点击线程右上角的 **提交** 按钮。
|
|
17
|
-
3.
|
|
34
|
+
3. 在弹层里确认,然后等待执行完成。
|
|
18
35
|
4. 面板会列出创建的每个提交(哈希 + 信息)。
|
|
19
36
|
|
|
20
|
-
|
|
37
|
+
会话运行期间按钮不可用。宿主在提交前还会再检查一次,规划期间工作区发生变化时会中止本次提交。
|
|
21
38
|
|
|
22
39
|
## 说明
|
|
23
40
|
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
- 插件只做 commit,不会 push
|
|
41
|
+
- 每个选中文件按当前工作区内容提交。属于其他分组的已暂存修改会保留到对应分组提交。
|
|
42
|
+
- 未跟踪文件也会提交:较小的文本文件会把内容预览发给模型,二进制文件只列路径。
|
|
43
|
+
- 插件只做 commit,不会 push;push 仍由你手动决定。
|
|
27
44
|
|
|
28
45
|
## 许可证
|
|
29
46
|
|