@ibobbyts/dsh-git-commit 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +67 -2
- package/THIRD_PARTY.md +14 -0
- package/cordis.patch.yml +4 -0
- package/lib/client.js +544 -0
- package/lib/core/git.js +161 -0
- package/lib/core/message.js +193 -0
- package/lib/core/metrics.js +39 -0
- package/lib/core/service.js +155 -0
- package/lib/core/store.js +113 -0
- package/lib/core/watcher.js +57 -0
- package/lib/index.d.ts +78 -0
- package/lib/index.js +80 -0
- package/package.json +73 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 iBobbyTS
|
|
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,68 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-git-commit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A lightweight floating **Git status + AI Commit** plugin for [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness), published as **`@ibobbyts/dsh-git-commit`**.
|
|
4
|
+
|
|
5
|
+
- View the current Session's Git branch and changed-line counts in a draggable, collapsible panel.
|
|
6
|
+
- Generate a commit message through a model configured in DSH, then make **one real Git commit**.
|
|
7
|
+
- Choose global/repository instructions, a model, optional Token metrics, and countdown color in the native DSH right sidebar.
|
|
8
|
+
- Keep the floating panel within the visible window; **drag locations persist** across restarts. The settings panel includes **Reset floating window position**.
|
|
9
|
+
- Non-Git directories show a compact warning or remain hidden according to your preference.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
From the npm registry (recommended after the first publication):
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
dsh plugin --profile desktop add @ibobbyts/dsh-git-commit
|
|
17
|
+
# Or: dsh plugin --profile web add @ibobbyts/dsh-git-commit
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Alternatively, in **Plugins → Add plugin → Install third-party plugin**, use `https://github.com/iBobbyTS/dsh-git-commit.git`.
|
|
21
|
+
|
|
22
|
+
**Upgrading from v0.1.x:** The npm package is now scoped. Remove the previous `dsh-git-commit` package/bundle before installing `@ibobbyts/dsh-git-commit`; the Host service name remains `gitCommit`, and the settings file is reused. Fully quit and restart DSH Desktop after installation.
|
|
23
|
+
|
|
24
|
+
[Complete install, upgrade, and troubleshooting guide](docs/INSTALLATION.md)
|
|
25
|
+
|
|
26
|
+
## How commits work
|
|
27
|
+
|
|
28
|
+
If anything is staged, the plugin commits **only the staged Git index**. If nothing is staged, it snapshots all non-ignored worktree changes, generates a message, revalidates the snapshot, stages, and commits them. It never pushes or bypasses Git hooks. A changed snapshot fails safely instead of committing uninspected content.
|
|
29
|
+
|
|
30
|
+
Small Diff: one LLM call. When a file has over 2,000 changed lines: one low-reasoning classification call (all paths and large-file previews), then one final generation call (Off reasoning when supported). Total **at most two LLM calls**. Large-file previews are explicitly marked; inputs are best-effort credential-redacted before transmission. See [Architecture](docs/ARCHITECTURE.md).
|
|
31
|
+
|
|
32
|
+
## Call the Git commit service from another DSH Host plugin
|
|
33
|
+
|
|
34
|
+
`@ibobbyts/dsh-git-commit` exposes a **Cordis-native Host service**. Declare `gitCommit` in your plugin's injection list. No separate MCP server or browser RPC is required:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import type {} from '@ibobbyts/dsh-git-commit'; // optional: Context type augmentation
|
|
38
|
+
|
|
39
|
+
export const inject = ['gitCommit'];
|
|
40
|
+
|
|
41
|
+
export async function run(ctx: import('@deepseek-ai/cordis').Context, cwd: string) {
|
|
42
|
+
const result = await ctx.gitCommit.commit({ cwd });
|
|
43
|
+
if (!result.success) throw new Error(result.error ?? 'Git commit failed');
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
hash: result.hash, // first 7 hex characters
|
|
47
|
+
message: result.message, // actual committed message
|
|
48
|
+
additions: result.additions, // actual committed lines
|
|
49
|
+
deletions: result.deletions,
|
|
50
|
+
scope: result.scope, // 'staged' or 'all'
|
|
51
|
+
llm: result.llm, // optional Token/TTFT/speed statistics
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`cwd` may point anywhere inside a Git worktree. Pass `{message: 'type: subject'}` to commit with a **caller-supplied message** instead of invoking an LLM, while retaining all snapshot and hook checks. Other operations include `ctx.gitCommit.status({cwd})` and `ctx.gitCommit.settings({cwd})`. Importing the types is optional at runtime; the service requires this plugin to be installed and enabled in the same DSH profile.
|
|
57
|
+
|
|
58
|
+
[Full API contract](lib/index.d.ts) · [Settings reference](docs/CONFIGURATION.md)
|
|
59
|
+
|
|
60
|
+
## Development and releases
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
npm install
|
|
64
|
+
npm run check
|
|
65
|
+
npm pack --dry-run --ignore-scripts
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The source is MIT licensed. See [Development](docs/DEVELOPMENT.md), [npm release instructions](docs/RELEASING.md), and [third-party licenses](THIRD_PARTY.md). No npm token is committed to the repository.
|
package/THIRD_PARTY.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# References and third-party licenses
|
|
2
|
+
|
|
3
|
+
The plugin is originally authored under [LICENSE](LICENSE). The repositories below were used as references; no upstream source tree has been copied into this repository. License and copyright information is provided for attribution and future contributors who may choose to port code.
|
|
4
|
+
|
|
5
|
+
- **luigiinred/dsh-git-status-pill**, https://github.com/luigiinred/dsh-git-status-pill — MIT, Copyright (c) 2026 dsh-git-status-pill contributors. Reference for floating DSH `shell.overlay` UI.
|
|
6
|
+
- **dennisrongo/dsh-plugins** (`plugins/dsh-git`), https://github.com/dennisrongo/dsh-plugins — MIT, Copyright (c) 2026 Dennis Rongo. Reference for DSH Git status services and `ctx.llm`.
|
|
7
|
+
- **MantisWare/commit-ai**, https://github.com/MantisWare/commit-ai — MIT, Copyright (c) MantisWare, https://github.com/MantisWare. Historical reference for large-diff synthesis.
|
|
8
|
+
- **SunParis/GitCommitGenerator**, https://github.com/SunParis/GitCommitGenerator — MIT, Copyright (c) 2026 Yuchen Sun. Reference for deterministic diff input filtering.
|
|
9
|
+
- **@visulima/redact**, https://github.com/visulima/visulima/tree/main/packages/data-manipulation/redact — MIT, Copyright (c) Visulima contributors / Daniel Bannert. **Runtime dependency**; `stringAnonymize` and `credentialRules` are imported from the published package, not copied or reimplemented. The installed npm package includes its own MIT license.
|
|
10
|
+
- **deepseek-ai/deepseek-harness**, https://github.com/deepseek-ai/deepseek-harness — canonical host/client API documentation and implementation reference; the plugin uses those APIs via its peer dependencies.
|
|
11
|
+
|
|
12
|
+
This release removes the former **@mcarvin/smart-diff** runtime dependency. Prior versions used its public diff utilities; no smart-diff source is included in this release.
|
|
13
|
+
|
|
14
|
+
The MIT license permits copying/modification/distribution subject to preservation of the license and copyright notices. For references used as a basis for future source-level porting, preserve the complete upstream license notice in the relevant copied/derived files or a dedicated `licenses/` directory before redistribution.
|
package/cordis.patch.yml
ADDED