cloving 0.3.19 → 0.3.20
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/dist/index.js +2 -0
- package/dist/managers/CommitManager.js +30 -16
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/.DS_Store +0 -0
- package/.aider.chat.history.md +0 -16978
- package/.aider.input.history +0 -15
- package/.aider.tags.cache.v3/cache.db +0 -0
- package/.aider.tags.cache.v3/cache.db-shm +0 -0
- package/.aider.tags.cache.v3/cache.db-wal +0 -0
- package/.cursorrules +0 -77
- package/.github/workflows/auto-release.yml +0 -83
- package/.github/workflows/ci.yml +0 -32
- package/.github/workflows/npm-publish.yml +0 -34
- package/.gitignore +0 -67
- package/.husky/_/.gitignore +0 -1
- package/.husky/_/applypatch-msg +0 -2
- package/.husky/_/commit-msg +0 -2
- package/.husky/_/h +0 -22
- package/.husky/_/husky.sh +0 -9
- package/.husky/_/post-applypatch +0 -2
- package/.husky/_/post-checkout +0 -2
- package/.husky/_/post-commit +0 -2
- package/.husky/_/post-merge +0 -2
- package/.husky/_/post-rewrite +0 -2
- package/.husky/_/pre-applypatch +0 -2
- package/.husky/_/pre-auto-gc +0 -2
- package/.husky/_/pre-commit +0 -2
- package/.husky/_/pre-merge-commit +0 -2
- package/.husky/_/pre-push +0 -2
- package/.husky/_/pre-rebase +0 -2
- package/.husky/_/prepare-commit-msg +0 -2
- package/.husky/pre-commit +0 -1
- package/.husky/pre-push +0 -1
- package/.prettierrc.json +0 -7
- package/.tool-versions +0 -2
- package/SECURITY.md +0 -15
- package/cloving.json +0 -67
- package/jest.config.js +0 -11
- package/src/cloving_gpt/adapters/azureopenai.ts +0 -83
- package/src/cloving_gpt/adapters/claude.ts +0 -140
- package/src/cloving_gpt/adapters/gemini.ts +0 -146
- package/src/cloving_gpt/adapters/index.ts +0 -43
- package/src/cloving_gpt/adapters/mistral.ts +0 -142
- package/src/cloving_gpt/adapters/ollama.ts +0 -136
- package/src/cloving_gpt/adapters/openai.ts +0 -113
- package/src/cloving_gpt/index.ts +0 -229
- package/src/commands/chat.ts +0 -12
- package/src/commands/config.ts +0 -192
- package/src/commands/generate/code.ts +0 -18
- package/src/commands/generate/commit.ts +0 -9
- package/src/commands/generate/context.ts +0 -93
- package/src/commands/generate/docs.ts +0 -9
- package/src/commands/generate/review.ts +0 -9
- package/src/commands/generate/shell.ts +0 -9
- package/src/commands/generate/unit_tests.ts +0 -9
- package/src/commands/init.ts +0 -9
- package/src/commands/models.ts +0 -21
- package/src/commands/proxy.ts +0 -9
- package/src/commands/tokens.ts +0 -82
- package/src/index.ts +0 -197
- package/src/managers/BlockManager.ts +0 -126
- package/src/managers/ChatManager.ts +0 -755
- package/src/managers/ChunkManager.ts +0 -31
- package/src/managers/CodeManager.ts +0 -226
- package/src/managers/CommitManager.ts +0 -71
- package/src/managers/DocsManager.ts +0 -101
- package/src/managers/InitManager.ts +0 -263
- package/src/managers/ProxyManager.ts +0 -240
- package/src/managers/ReviewManager.ts +0 -154
- package/src/managers/ShellManager.ts +0 -172
- package/src/managers/StreamManager.ts +0 -353
- package/src/managers/UnitTestManager.ts +0 -293
- package/src/utils/config_utils.ts +0 -271
- package/src/utils/git_utils.ts +0 -230
- package/src/utils/model_utils.ts +0 -3
- package/src/utils/prompt_utils.ts +0 -375
- package/src/utils/prompts/CODEGEN_COULDNT_APPLY.md +0 -5
- package/src/utils/prompts/CODEGEN_EXAMPLES.md +0 -82
- package/src/utils/prompts/CODEGEN_INSTRUCTIONS.md +0 -43
- package/src/utils/prompts/DOCS_INSTRUCTIONS.md +0 -9
- package/src/utils/prompts/INIT_INSTRUCTIONS.md +0 -132
- package/src/utils/prompts/REVIEW_INSTRUCTIONS.md +0 -49
- package/src/utils/prompts/SHELL_INSTRUCTIONS.md +0 -15
- package/src/utils/prompts/SPECIAL_FILES.md +0 -66
- package/src/utils/prompts/index.ts +0 -37
- package/src/utils/string_utils.ts +0 -552
- package/src/utils/types.ts +0 -127
- package/tests/commands/generate/unit_tests.test.ts +0 -27
- package/tests/utils/git_utils.test.ts +0 -116
- package/tests/utils/model_utils.test.ts +0 -27
- package/tests/utils/prompt_utils.test.ts +0 -33
- package/tests/utils/string_utils.test.ts +0 -560
- package/tsconfig.json +0 -14
- package/yarn.lock +0 -5823
package/dist/index.js
CHANGED
|
@@ -62,6 +62,7 @@ program
|
|
|
62
62
|
.description('Alias for cloving generate commit')
|
|
63
63
|
.option('-s, --silent', 'Run the command without asking for confirmation of submitting prompts')
|
|
64
64
|
.option('-m, --model <model>', 'Select the model to use (e.g., openai, claude, ollama, ollama:llama3, claude:claude-3-5-sonnet-20240620)')
|
|
65
|
+
.option('-a, --autoAccept', 'Automatically accept the generated commit message without editing')
|
|
65
66
|
.action(commit_1.default);
|
|
66
67
|
// Generate commands
|
|
67
68
|
const generate = program
|
|
@@ -96,6 +97,7 @@ generate
|
|
|
96
97
|
.option('-t, --temperature <temperature>', 'Temperature for the model (default 0.2)')
|
|
97
98
|
.option('-s, --silent', 'Run the command without asking for confirmation of submitting prompts')
|
|
98
99
|
.option('-m, --model <model>', 'Select the model to use (e.g., openai, claude, ollama, ollama:llama3, claude:claude-3-5-sonnet-20240620)')
|
|
100
|
+
.option('-a, --autoAccept', 'Automatically accept the generated commit message without editing')
|
|
99
101
|
.action(commit_1.default);
|
|
100
102
|
generate
|
|
101
103
|
.command('context')
|
|
@@ -13,6 +13,7 @@ const cloving_gpt_1 = __importDefault(require("../cloving_gpt"));
|
|
|
13
13
|
class CommitManager {
|
|
14
14
|
constructor(options) {
|
|
15
15
|
options.silent = (0, config_utils_1.getConfig)(options).globalSilent || false;
|
|
16
|
+
this.autoAccept = options.autoAccept || false;
|
|
16
17
|
this.gpt = new cloving_gpt_1.default(options);
|
|
17
18
|
}
|
|
18
19
|
cleanCommitMessage(message) {
|
|
@@ -36,24 +37,37 @@ class CommitManager {
|
|
|
36
37
|
const rawCommitMessage = await this.gpt.generateText({ prompt });
|
|
37
38
|
// Clean the commit message using extractMarkdown and remove code blocks
|
|
38
39
|
const commitMessage = this.cleanCommitMessage((0, string_utils_1.extractMarkdown)(rawCommitMessage));
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
if (this.autoAccept) {
|
|
41
|
+
// Directly commit with the generated message without opening an editor
|
|
42
|
+
try {
|
|
43
|
+
(0, child_process_1.execFileSync)('git', ['commit', '-a', '-m', commitMessage], {
|
|
44
|
+
stdio: 'inherit',
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
catch (commitError) {
|
|
48
|
+
console.log('Commit failed:', commitError.message);
|
|
49
|
+
}
|
|
47
50
|
}
|
|
48
|
-
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
+
else {
|
|
52
|
+
// Write the commit message to a temporary file
|
|
53
|
+
const tempCommitFilePath = path_1.default.join('.git', 'SUGGESTED_COMMIT_EDITMSG');
|
|
54
|
+
fs_1.default.writeFileSync(tempCommitFilePath, commitMessage);
|
|
55
|
+
// Commit the changes using the generated commit message
|
|
56
|
+
try {
|
|
57
|
+
(0, child_process_1.execFileSync)('git', ['commit', '-a', '--edit', '--file', tempCommitFilePath], {
|
|
58
|
+
stdio: 'inherit',
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
catch (commitError) {
|
|
62
|
+
// If commit is canceled (non-zero exit), handle it here
|
|
63
|
+
console.log('Commit was canceled or failed.');
|
|
64
|
+
}
|
|
65
|
+
// Remove the temporary file using fs
|
|
66
|
+
fs_1.default.unlink(tempCommitFilePath, (err) => {
|
|
67
|
+
if (err)
|
|
68
|
+
throw err;
|
|
69
|
+
});
|
|
51
70
|
}
|
|
52
|
-
// Remove the temporary file using fs
|
|
53
|
-
fs_1.default.unlink(tempCommitFilePath, (err) => {
|
|
54
|
-
if (err)
|
|
55
|
-
throw err;
|
|
56
|
-
});
|
|
57
71
|
}
|
|
58
72
|
catch (err) {
|
|
59
73
|
const error = err;
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
package/.DS_Store
DELETED
|
Binary file
|