code-agent-auto-commit 1.3.2 → 1.4.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/.code-agent-auto-commit.example.json +4 -4
- package/README.md +4 -2
- package/dist/core/config.js +8 -18
- package/dist/core/git.js +3 -3
- package/{docs → doc}/zh-CN.md +3 -1
- package/package.json +3 -3
- /package/{docs → doc}/CONFIG.md +0 -0
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"ai": {
|
|
11
11
|
"enabled": true,
|
|
12
12
|
"timeoutMs": 15000,
|
|
13
|
-
"model": "
|
|
14
|
-
"defaultProvider": "
|
|
13
|
+
"model": "minimax/MiniMax-M2.5-highspeed",
|
|
14
|
+
"defaultProvider": "minimax",
|
|
15
15
|
"providers": {
|
|
16
16
|
"openai": {
|
|
17
17
|
"api": "openai-completions",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"minimax": {
|
|
32
32
|
"api": "openai-completions",
|
|
33
|
-
"baseUrl": "https://api.
|
|
33
|
+
"baseUrl": "https://api.minimaxi.chat/v1",
|
|
34
34
|
"apiKeyEnv": "MINIMAX_API_KEY"
|
|
35
35
|
},
|
|
36
36
|
"ollama": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"push": {
|
|
44
|
-
"enabled":
|
|
44
|
+
"enabled": true,
|
|
45
45
|
"provider": "github",
|
|
46
46
|
"remote": "origin",
|
|
47
47
|
"branch": "main"
|
package/README.md
CHANGED
|
@@ -48,6 +48,8 @@ cac init
|
|
|
48
48
|
# Edit .cac/.code-agent-auto-commit.json — set your model and defaultProvider.
|
|
49
49
|
# Fill keys in .cac/.env and load them:
|
|
50
50
|
source .cac/.env
|
|
51
|
+
# OR:
|
|
52
|
+
cac ai set-key <provider|ENV_VAR> <api-key> [--config <path>]
|
|
51
53
|
|
|
52
54
|
# 3. Install hooks
|
|
53
55
|
cac install --tool all --scope project
|
|
@@ -111,8 +113,8 @@ You can copy from:
|
|
|
111
113
|
|
|
112
114
|
Full schema and options:
|
|
113
115
|
|
|
114
|
-
- `
|
|
115
|
-
- `
|
|
116
|
+
- `doc/CONFIG.md`
|
|
117
|
+
- `doc/zh-CN.md`
|
|
116
118
|
|
|
117
119
|
### AI Key Fields
|
|
118
120
|
|
package/dist/core/config.js
CHANGED
|
@@ -20,10 +20,10 @@ const DEFAULT_CONFIG = (worktree) => ({
|
|
|
20
20
|
maxMessageLength: 72,
|
|
21
21
|
},
|
|
22
22
|
ai: {
|
|
23
|
-
enabled:
|
|
23
|
+
enabled: true,
|
|
24
24
|
timeoutMs: 15000,
|
|
25
|
-
model: "
|
|
26
|
-
defaultProvider: "
|
|
25
|
+
model: "minimax/MiniMax-M2.5-highspeed",
|
|
26
|
+
defaultProvider: "minimax",
|
|
27
27
|
providers: {
|
|
28
28
|
openai: {
|
|
29
29
|
api: "openai-completions",
|
|
@@ -35,11 +35,6 @@ const DEFAULT_CONFIG = (worktree) => ({
|
|
|
35
35
|
baseUrl: "https://api.anthropic.com/v1",
|
|
36
36
|
apiKeyEnv: "ANTHROPIC_API_KEY",
|
|
37
37
|
},
|
|
38
|
-
openrouter: {
|
|
39
|
-
api: "openai-completions",
|
|
40
|
-
baseUrl: "https://openrouter.ai/api/v1",
|
|
41
|
-
apiKeyEnv: "OPENROUTER_API_KEY",
|
|
42
|
-
},
|
|
43
38
|
moonshot: {
|
|
44
39
|
api: "openai-completions",
|
|
45
40
|
baseUrl: "https://api.moonshot.ai/v1",
|
|
@@ -47,14 +42,9 @@ const DEFAULT_CONFIG = (worktree) => ({
|
|
|
47
42
|
},
|
|
48
43
|
minimax: {
|
|
49
44
|
api: "openai-completions",
|
|
50
|
-
baseUrl: "https://api.
|
|
45
|
+
baseUrl: "https://api.minimaxi.chat/v1",
|
|
51
46
|
apiKeyEnv: "MINIMAX_API_KEY",
|
|
52
47
|
},
|
|
53
|
-
"kimi-coding": {
|
|
54
|
-
api: "anthropic-messages",
|
|
55
|
-
baseUrl: "https://api.moonshot.ai/anthropic",
|
|
56
|
-
apiKeyEnv: "KIMI_API_KEY",
|
|
57
|
-
},
|
|
58
48
|
ollama: {
|
|
59
49
|
api: "openai-completions",
|
|
60
50
|
baseUrl: "http://127.0.0.1:11434/v1",
|
|
@@ -63,10 +53,10 @@ const DEFAULT_CONFIG = (worktree) => ({
|
|
|
63
53
|
},
|
|
64
54
|
},
|
|
65
55
|
push: {
|
|
66
|
-
enabled:
|
|
56
|
+
enabled: true,
|
|
67
57
|
provider: "github",
|
|
68
58
|
remote: "origin",
|
|
69
|
-
branch: "",
|
|
59
|
+
branch: "main",
|
|
70
60
|
},
|
|
71
61
|
filters: {
|
|
72
62
|
include: [],
|
|
@@ -122,10 +112,10 @@ function normalizeConfig(config) {
|
|
|
122
112
|
config.ai.timeoutMs = 1000;
|
|
123
113
|
}
|
|
124
114
|
if (!config.ai.model.trim()) {
|
|
125
|
-
config.ai.model = "
|
|
115
|
+
config.ai.model = "minimax/MiniMax-M2.5-highspeed";
|
|
126
116
|
}
|
|
127
117
|
if (!config.ai.defaultProvider.trim()) {
|
|
128
|
-
config.ai.defaultProvider = "
|
|
118
|
+
config.ai.defaultProvider = "minimax";
|
|
129
119
|
}
|
|
130
120
|
const allowedApis = new Set(["openai-completions", "anthropic-messages"]);
|
|
131
121
|
for (const [provider, providerConfig] of Object.entries(config.ai.providers)) {
|
package/dist/core/git.js
CHANGED
|
@@ -44,11 +44,11 @@ function listChangedFiles(worktree) {
|
|
|
44
44
|
if (secondNull === -1) {
|
|
45
45
|
break;
|
|
46
46
|
}
|
|
47
|
-
const
|
|
47
|
+
const renamedFrom = output.slice(offset, secondNull);
|
|
48
48
|
offset = secondNull + 1;
|
|
49
49
|
files.push({
|
|
50
|
-
path:
|
|
51
|
-
originalPath:
|
|
50
|
+
path: firstPath,
|
|
51
|
+
originalPath: renamedFrom,
|
|
52
52
|
indexStatus,
|
|
53
53
|
worktreeStatus,
|
|
54
54
|
});
|
package/{docs → doc}/zh-CN.md
RENAMED
|
@@ -18,6 +18,8 @@ cac init
|
|
|
18
18
|
# 编辑 .cac/.code-agent-auto-commit.json,设置 model 和 defaultProvider。
|
|
19
19
|
# 在 .cac/.env 中填入 API Key 后加载:
|
|
20
20
|
source .cac/.env
|
|
21
|
+
# 或者:
|
|
22
|
+
cac ai set-key <provider|ENV_VAR> <api-key> [--config <path>]
|
|
21
23
|
|
|
22
24
|
# 3. 安装钩子
|
|
23
25
|
cac install --tool all --scope project
|
|
@@ -81,7 +83,7 @@ cac status --scope project
|
|
|
81
83
|
|
|
82
84
|
Default location in repository root: `.cac/.code-agent-auto-commit.json`
|
|
83
85
|
|
|
84
|
-
For full field details, see `
|
|
86
|
+
For full field details, see `doc/CONFIG.md`.
|
|
85
87
|
|
|
86
88
|
## Important Notes
|
|
87
89
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "code-agent-auto-commit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "CAC provides configurable AI auto-commit(using your git account) for OpenCode, Claude Code, Codex, and other AI code agents",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"CONTRIBUTING.md",
|
|
18
18
|
"CODE_OF_CONDUCT.md",
|
|
19
19
|
"SECURITY.md",
|
|
20
|
-
"
|
|
20
|
+
"doc",
|
|
21
21
|
".code-agent-auto-commit.example.json"
|
|
22
22
|
],
|
|
23
23
|
"publishConfig": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"clean": "rm -rf dist",
|
|
28
28
|
"build": "tsc -p tsconfig.json",
|
|
29
29
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
30
|
-
"test": "node --test dist/
|
|
30
|
+
"test": "tsc -p tsconfig.test.json && node --test dist-test/tests/*.test.js",
|
|
31
31
|
"prepare": "pnpm run build"
|
|
32
32
|
},
|
|
33
33
|
"keywords": [
|
/package/{docs → doc}/CONFIG.md
RENAMED
|
File without changes
|