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.
Files changed (95) hide show
  1. package/dist/index.js +2 -0
  2. package/dist/managers/CommitManager.js +30 -16
  3. package/dist/package.json +1 -1
  4. package/package.json +1 -1
  5. package/.DS_Store +0 -0
  6. package/.aider.chat.history.md +0 -16978
  7. package/.aider.input.history +0 -15
  8. package/.aider.tags.cache.v3/cache.db +0 -0
  9. package/.aider.tags.cache.v3/cache.db-shm +0 -0
  10. package/.aider.tags.cache.v3/cache.db-wal +0 -0
  11. package/.cursorrules +0 -77
  12. package/.github/workflows/auto-release.yml +0 -83
  13. package/.github/workflows/ci.yml +0 -32
  14. package/.github/workflows/npm-publish.yml +0 -34
  15. package/.gitignore +0 -67
  16. package/.husky/_/.gitignore +0 -1
  17. package/.husky/_/applypatch-msg +0 -2
  18. package/.husky/_/commit-msg +0 -2
  19. package/.husky/_/h +0 -22
  20. package/.husky/_/husky.sh +0 -9
  21. package/.husky/_/post-applypatch +0 -2
  22. package/.husky/_/post-checkout +0 -2
  23. package/.husky/_/post-commit +0 -2
  24. package/.husky/_/post-merge +0 -2
  25. package/.husky/_/post-rewrite +0 -2
  26. package/.husky/_/pre-applypatch +0 -2
  27. package/.husky/_/pre-auto-gc +0 -2
  28. package/.husky/_/pre-commit +0 -2
  29. package/.husky/_/pre-merge-commit +0 -2
  30. package/.husky/_/pre-push +0 -2
  31. package/.husky/_/pre-rebase +0 -2
  32. package/.husky/_/prepare-commit-msg +0 -2
  33. package/.husky/pre-commit +0 -1
  34. package/.husky/pre-push +0 -1
  35. package/.prettierrc.json +0 -7
  36. package/.tool-versions +0 -2
  37. package/SECURITY.md +0 -15
  38. package/cloving.json +0 -67
  39. package/jest.config.js +0 -11
  40. package/src/cloving_gpt/adapters/azureopenai.ts +0 -83
  41. package/src/cloving_gpt/adapters/claude.ts +0 -140
  42. package/src/cloving_gpt/adapters/gemini.ts +0 -146
  43. package/src/cloving_gpt/adapters/index.ts +0 -43
  44. package/src/cloving_gpt/adapters/mistral.ts +0 -142
  45. package/src/cloving_gpt/adapters/ollama.ts +0 -136
  46. package/src/cloving_gpt/adapters/openai.ts +0 -113
  47. package/src/cloving_gpt/index.ts +0 -229
  48. package/src/commands/chat.ts +0 -12
  49. package/src/commands/config.ts +0 -192
  50. package/src/commands/generate/code.ts +0 -18
  51. package/src/commands/generate/commit.ts +0 -9
  52. package/src/commands/generate/context.ts +0 -93
  53. package/src/commands/generate/docs.ts +0 -9
  54. package/src/commands/generate/review.ts +0 -9
  55. package/src/commands/generate/shell.ts +0 -9
  56. package/src/commands/generate/unit_tests.ts +0 -9
  57. package/src/commands/init.ts +0 -9
  58. package/src/commands/models.ts +0 -21
  59. package/src/commands/proxy.ts +0 -9
  60. package/src/commands/tokens.ts +0 -82
  61. package/src/index.ts +0 -197
  62. package/src/managers/BlockManager.ts +0 -126
  63. package/src/managers/ChatManager.ts +0 -755
  64. package/src/managers/ChunkManager.ts +0 -31
  65. package/src/managers/CodeManager.ts +0 -226
  66. package/src/managers/CommitManager.ts +0 -71
  67. package/src/managers/DocsManager.ts +0 -101
  68. package/src/managers/InitManager.ts +0 -263
  69. package/src/managers/ProxyManager.ts +0 -240
  70. package/src/managers/ReviewManager.ts +0 -154
  71. package/src/managers/ShellManager.ts +0 -172
  72. package/src/managers/StreamManager.ts +0 -353
  73. package/src/managers/UnitTestManager.ts +0 -293
  74. package/src/utils/config_utils.ts +0 -271
  75. package/src/utils/git_utils.ts +0 -230
  76. package/src/utils/model_utils.ts +0 -3
  77. package/src/utils/prompt_utils.ts +0 -375
  78. package/src/utils/prompts/CODEGEN_COULDNT_APPLY.md +0 -5
  79. package/src/utils/prompts/CODEGEN_EXAMPLES.md +0 -82
  80. package/src/utils/prompts/CODEGEN_INSTRUCTIONS.md +0 -43
  81. package/src/utils/prompts/DOCS_INSTRUCTIONS.md +0 -9
  82. package/src/utils/prompts/INIT_INSTRUCTIONS.md +0 -132
  83. package/src/utils/prompts/REVIEW_INSTRUCTIONS.md +0 -49
  84. package/src/utils/prompts/SHELL_INSTRUCTIONS.md +0 -15
  85. package/src/utils/prompts/SPECIAL_FILES.md +0 -66
  86. package/src/utils/prompts/index.ts +0 -37
  87. package/src/utils/string_utils.ts +0 -552
  88. package/src/utils/types.ts +0 -127
  89. package/tests/commands/generate/unit_tests.test.ts +0 -27
  90. package/tests/utils/git_utils.test.ts +0 -116
  91. package/tests/utils/model_utils.test.ts +0 -27
  92. package/tests/utils/prompt_utils.test.ts +0 -33
  93. package/tests/utils/string_utils.test.ts +0 -560
  94. package/tsconfig.json +0 -14
  95. 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
- // Write the commit message to a temporary file
40
- const tempCommitFilePath = path_1.default.join('.git', 'SUGGESTED_COMMIT_EDITMSG');
41
- fs_1.default.writeFileSync(tempCommitFilePath, commitMessage);
42
- // Commit the changes using the generated commit message
43
- try {
44
- (0, child_process_1.execFileSync)('git', ['commit', '-a', '--edit', '--file', tempCommitFilePath], {
45
- stdio: 'inherit',
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
- catch (commitError) {
49
- // If commit is canceled (non-zero exit), handle it here
50
- console.log('Commit was canceled or failed.');
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloving",
3
- "version": "0.3.19",
3
+ "version": "0.3.20",
4
4
  "packageManager": "yarn@1.22.22",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloving",
3
- "version": "0.3.19",
3
+ "version": "0.3.20",
4
4
  "packageManager": "yarn@1.22.22",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/.DS_Store DELETED
Binary file