gaunt-sloth-assistant 0.5.0 → 0.5.1

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 (135) hide show
  1. package/.claude/settings.local.json +15 -0
  2. package/.gsloth.backstory.md +0 -0
  3. package/.gsloth.guidelines.md +0 -0
  4. package/.gsloth.review.md +0 -0
  5. package/.gsloth.system.md +10 -0
  6. package/.prettierrc.json +0 -0
  7. package/CLAUDE.md +1 -0
  8. package/LICENSE +0 -0
  9. package/README.md +9 -0
  10. package/ROADMAP.md +0 -0
  11. package/assets/gaunt-sloth-logo.png +0 -0
  12. package/assets/release-notes/v0_4_0.md +0 -0
  13. package/assets/release-notes/v0_5_0.md +0 -0
  14. package/assets/release-notes/v0_5_1.md +47 -0
  15. package/dist/commands/askCommand.d.ts +0 -0
  16. package/dist/commands/askCommand.js +9 -5
  17. package/dist/commands/askCommand.js.map +1 -1
  18. package/dist/commands/commandUtils.d.ts +25 -0
  19. package/dist/commands/commandUtils.js +48 -0
  20. package/dist/commands/commandUtils.js.map +1 -0
  21. package/dist/commands/initCommand.d.ts +0 -0
  22. package/dist/commands/initCommand.js +0 -0
  23. package/dist/commands/initCommand.js.map +0 -0
  24. package/dist/commands/prCommand.d.ts +2 -0
  25. package/dist/commands/prCommand.js +52 -0
  26. package/dist/commands/prCommand.js.map +1 -0
  27. package/dist/commands/reviewCommand.d.ts +1 -2
  28. package/dist/commands/reviewCommand.js +17 -98
  29. package/dist/commands/reviewCommand.js.map +1 -1
  30. package/dist/config.d.ts +18 -36
  31. package/dist/config.js +104 -84
  32. package/dist/config.js.map +1 -1
  33. package/dist/configs/anthropic.d.ts +0 -0
  34. package/dist/configs/anthropic.js +0 -0
  35. package/dist/configs/anthropic.js.map +0 -0
  36. package/dist/configs/fake.d.ts +0 -0
  37. package/dist/configs/fake.js +0 -0
  38. package/dist/configs/fake.js.map +0 -0
  39. package/dist/configs/groq.d.ts +0 -0
  40. package/dist/configs/groq.js +0 -0
  41. package/dist/configs/groq.js.map +0 -0
  42. package/dist/configs/vertexai.d.ts +0 -0
  43. package/dist/configs/vertexai.js +0 -0
  44. package/dist/configs/vertexai.js.map +0 -0
  45. package/dist/consoleUtils.d.ts +0 -0
  46. package/dist/consoleUtils.js +0 -0
  47. package/dist/consoleUtils.js.map +0 -0
  48. package/dist/constants.d.ts +7 -0
  49. package/dist/constants.js +8 -0
  50. package/dist/constants.js.map +1 -0
  51. package/dist/filePathUtils.d.ts +0 -0
  52. package/dist/filePathUtils.js +0 -0
  53. package/dist/filePathUtils.js.map +0 -0
  54. package/dist/index.d.ts +0 -0
  55. package/dist/index.js +4 -2
  56. package/dist/index.js.map +1 -1
  57. package/dist/llmUtils.d.ts +1 -1
  58. package/dist/llmUtils.js +85 -22
  59. package/dist/llmUtils.js.map +1 -1
  60. package/dist/modules/questionAnsweringModule.d.ts +2 -1
  61. package/dist/modules/questionAnsweringModule.js +4 -7
  62. package/dist/modules/questionAnsweringModule.js.map +1 -1
  63. package/dist/modules/reviewModule.d.ts +2 -1
  64. package/dist/modules/reviewModule.js +4 -7
  65. package/dist/modules/reviewModule.js.map +1 -1
  66. package/dist/modules/types.d.ts +0 -0
  67. package/dist/modules/types.js +0 -0
  68. package/dist/modules/types.js.map +0 -0
  69. package/dist/prompt.d.ts +1 -0
  70. package/dist/prompt.js +4 -1
  71. package/dist/prompt.js.map +1 -1
  72. package/dist/providers/file.d.ts +0 -0
  73. package/dist/providers/file.js +0 -0
  74. package/dist/providers/file.js.map +0 -0
  75. package/dist/providers/ghIssueProvider.d.ts +0 -0
  76. package/dist/providers/ghIssueProvider.js +3 -1
  77. package/dist/providers/ghIssueProvider.js.map +1 -1
  78. package/dist/providers/ghPrDiffProvider.d.ts +0 -0
  79. package/dist/providers/ghPrDiffProvider.js +3 -1
  80. package/dist/providers/ghPrDiffProvider.js.map +1 -1
  81. package/dist/providers/jiraIssueLegacyProvider.d.ts +0 -0
  82. package/dist/providers/jiraIssueLegacyProvider.js +0 -0
  83. package/dist/providers/jiraIssueLegacyProvider.js.map +0 -0
  84. package/dist/providers/jiraIssueProvider.d.ts +0 -0
  85. package/dist/providers/jiraIssueProvider.js +0 -0
  86. package/dist/providers/jiraIssueProvider.js.map +0 -0
  87. package/dist/providers/text.d.ts +0 -0
  88. package/dist/providers/text.js +0 -0
  89. package/dist/providers/text.js.map +0 -0
  90. package/dist/providers/types.d.ts +0 -0
  91. package/dist/providers/types.js +0 -0
  92. package/dist/providers/types.js.map +0 -0
  93. package/dist/systemUtils.d.ts +0 -0
  94. package/dist/systemUtils.js +0 -0
  95. package/dist/systemUtils.js.map +0 -0
  96. package/dist/utils.d.ts +0 -0
  97. package/dist/utils.js +0 -0
  98. package/dist/utils.js.map +0 -0
  99. package/docs/CONFIGURATION.md +0 -0
  100. package/docs/DEVELOPMENT.md +0 -0
  101. package/docs/RELEASE-HOWTO.md +0 -0
  102. package/eslint.config.js +0 -0
  103. package/maintenance/doc-maintenance.md +0 -0
  104. package/package.json +10 -8
  105. package/src/commands/askCommand.ts +9 -5
  106. package/src/commands/commandUtils.ts +77 -0
  107. package/src/commands/initCommand.ts +0 -0
  108. package/src/commands/prCommand.ts +93 -0
  109. package/src/commands/reviewCommand.ts +33 -155
  110. package/src/config.ts +121 -119
  111. package/src/configs/anthropic.ts +0 -0
  112. package/src/configs/fake.ts +0 -0
  113. package/src/configs/groq.ts +0 -0
  114. package/src/configs/vertexai.ts +0 -0
  115. package/src/consoleUtils.ts +0 -0
  116. package/src/constants.ts +7 -0
  117. package/src/filePathUtils.ts +0 -0
  118. package/src/index.ts +4 -2
  119. package/src/llmUtils.ts +100 -23
  120. package/src/modules/questionAnsweringModule.ts +6 -12
  121. package/src/modules/reviewModule.ts +11 -7
  122. package/src/modules/types.ts +0 -0
  123. package/src/prompt.ts +5 -1
  124. package/src/providers/file.ts +0 -0
  125. package/src/providers/ghIssueProvider.ts +3 -1
  126. package/src/providers/ghPrDiffProvider.ts +3 -1
  127. package/src/providers/jiraIssueLegacyProvider.ts +0 -0
  128. package/src/providers/jiraIssueProvider.ts +0 -0
  129. package/src/providers/text.ts +0 -0
  130. package/src/providers/types.ts +0 -0
  131. package/src/systemUtils.ts +0 -0
  132. package/src/utils.ts +0 -0
  133. package/tsconfig.json +0 -0
  134. package/vitest-it.config.ts +0 -0
  135. package/vitest.config.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"questionAnsweringModule.js","sourceRoot":"","sources":["../../src/modules/questionAnsweringModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAAc,EACd,QAAgB,EAChB,OAAe;IAEf,MAAM,iBAAiB,GAAG,YAAY,CAAC,MAAM,CAAC,YAAY;QACxD,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC;IACvC,MAAM,aAAa,GAAG,MAAM,MAAM,CAChC,YAAY,CAAC,MAAM,CAAC,GAAG,EACvB,QAAQ,EACR,OAAO,EACP,YAAY,CAAC,MAAM,CACpB,CAAC;IACF,iBAAiB,EAAE,IAAI,EAAE,CAAC;IAC1B,MAAM,QAAQ,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC7C,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE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MAAM,QAAQ,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,GAAG,aAAa,CAAC,CAAC;IAChC,CAAC;IACD,IAAI,CAAC;QACH,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QACvC,cAAc,CAAC,+BAA+B,QAAQ,EAAE,CAAC,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,YAAY,CAAC,mCAAmC,QAAQ,EAAE,CAAC,CAAC;QAC5D,YAAY,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACrE,yDAAyD;QACzD,WAAW;IACb,CAAC;AACH,CAAC"}
@@ -1 +1,2 @@
1
- export declare function review(source: string, preamble: string, diff: string): Promise<void>;
1
+ import type { SlothConfig } from '#src/config.js';
2
+ export declare function review(source: string, preamble: string, diff: string, config: SlothConfig, command?: 'pr' | 'review'): Promise<void>;
@@ -1,18 +1,15 @@
1
- import { slothContext } from '#src/config.js';
2
1
  import { display, displayDebug, displayError, displaySuccess } from '#src/consoleUtils.js';
3
2
  import { generateStandardFileName, ProgressIndicator } from '#src/utils.js';
4
3
  import { writeFileSync } from 'node:fs';
5
4
  import { invoke } from '#src/llmUtils.js';
6
5
  import { getGslothFilePath } from '#src/filePathUtils.js';
7
- export async function review(source, preamble, diff) {
8
- const progressIndicator = slothContext.config.streamOutput
9
- ? undefined
10
- : new ProgressIndicator('Reviewing.');
11
- const outputContent = await invoke(slothContext.config.llm, preamble, diff, slothContext.config);
6
+ export async function review(source, preamble, diff, config, command = 'review') {
7
+ const progressIndicator = config.streamOutput ? undefined : new ProgressIndicator('Reviewing.');
8
+ const outputContent = await invoke(config.llm, preamble, diff, config, command);
12
9
  progressIndicator?.stop();
13
10
  const filename = generateStandardFileName(source);
14
11
  const filePath = getGslothFilePath(filename);
15
- if (!slothContext.config.streamOutput) {
12
+ if (!config.streamOutput) {
16
13
  display('\n' + outputContent);
17
14
  }
18
15
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"reviewModule.js","sourceRoot":"","sources":["../../src/modules/reviewModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,MAAc,EAAE,QAAgB,EAAE,IAAY;IACzE,MAAM,iBAAiB,GAAG,YAAY,CAAC,MAAM,CAAC,YAAY;QACxD,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,IAAI,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACxC,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACjG,iBAAiB,EAAE,IAAI,EAAE,CAAC;IAC1B,MAAM,QAAQ,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC7C,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QACtC,OAAO,CAAC,IAAI,GAAG,aAAa,CAAC,CAA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,MAAM,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,GAAG,aAAa,CAAC,CAAC;IAChC,CAAC;IACD,IAAI,CAAC;QACH,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QACvC,cAAc,CAAC,+BAA+B,QAAQ,EAAE,CAAC,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,YAAY,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7D,YAAY,CAAC,mCAAmC,QAAQ,EAAE,CAAC,CAAC;QAC5D,qDAAqD;QACrD,WAAW;IACb,CAAC;AACH,CAAC"}
File without changes
File without changes
File without changes
package/dist/prompt.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export declare function readBackstory(): string;
2
2
  export declare function readGuidelines(guidelinesFilename: string): string;
3
3
  export declare function readReviewInstructions(reviewInstructions: string): string;
4
+ export declare function readSystemPrompt(): string;
4
5
  /**
5
6
  * This function expects https://cli.github.com/ to be installed and authenticated.
6
7
  * It does something like `gh pr diff 42`
package/dist/prompt.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { readFileFromCurrentDir, readFileFromCurrentOrInstallDir, spawnCommand, } from '#src/utils.js';
2
2
  import { displayError } from '#src/consoleUtils.js';
3
3
  import { exit } from '#src/systemUtils.js';
4
- import { GSLOTH_BACKSTORY } from '#src/config.js';
4
+ import { GSLOTH_BACKSTORY, GSLOTH_SYSTEM_PROMPT } from '#src/constants.js';
5
5
  import { getGslothConfigReadPath } from '#src/filePathUtils.js';
6
6
  export function readBackstory() {
7
7
  return readFileFromCurrentOrInstallDir(GSLOTH_BACKSTORY, true);
@@ -19,6 +19,9 @@ export function readGuidelines(guidelinesFilename) {
19
19
  export function readReviewInstructions(reviewInstructions) {
20
20
  return readConfigPromptFile(reviewInstructions);
21
21
  }
22
+ export function readSystemPrompt() {
23
+ return readFileFromCurrentOrInstallDir(GSLOTH_SYSTEM_PROMPT, true);
24
+ }
22
25
  function readConfigPromptFile(guidelinesFilename) {
23
26
  try {
24
27
  const filePath = getGslothConfigReadPath(guidelinesFilename);
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,+BAA+B,EAC/B,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,MAAM,UAAU,aAAa;IAC3B,OAAO,+BAA+B,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,kBAA0B;IACvD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;QAC7D,OAAO,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,YAAY,CACV,mGAAmG,CACpG,CAAC;QACF,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,kBAA0B;IAC/D,OAAO,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,oBAAoB,CAAC,kBAA0B;IACtD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;QAC7D,OAAO,+BAA+B,CAAC,QAAQ,CAAC,CAAC;IACnD,CAAC;IAAC,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AAsB,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,YAAY,CACV,mGAAmG,CACpG,CAAC;QACF,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,kBAA0B;IAC/D,OAAO,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,+BAA+B,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,oBAAoB,CAAC,kBAA0B;IACtD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;QAC7D,OAAO,+BAA+B,CAAC,QAAQ,CAAC,CAAC;IACnD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,YAAY,CACV,mGAAmG,CACpG,CAAC;QACF,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,EAAU;IACxC,iEAAiE;IACjE,IAAI,CAAC;QACH,OAAO,MAAM,YAAY,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,oBAAoB,EAAE,iBAAiB,CAAC,CAAC;IAC/F,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,YAAY,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,YAAY,CAAC,8BAA8B,EAAE,mCAAmC,CAAC,CAAC;QAClF,IAAI,EAAE,CAAC;QACP,OAAO,EAAE,CAAC,CAAC,gDAAgD;IAC7D,CAAC;AACH,CAAC"}
File without changes
File without changes
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  import { displayWarning } from '#src/consoleUtils.js';
2
- import { execAsync } from '#src/utils.js';
2
+ import { execAsync, ProgressIndicator } from '#src/utils.js';
3
3
  /**
4
4
  * Gets GitHub issue using GitHub CLI
5
5
  * @param _ config (unused in this provider)
@@ -13,7 +13,9 @@ export async function get(_, issueId) {
13
13
  }
14
14
  try {
15
15
  // Use the GitHub CLI to fetch issue details
16
+ const progress = new ProgressIndicator(`Fetching GitHub issue #${issueId}`);
16
17
  const issueContent = await execAsync(`gh issue view ${issueId}`);
18
+ progress.stop();
17
19
  if (!issueContent) {
18
20
  displayWarning(`No content found for GitHub issue #${issueId}`);
19
21
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"ghIssueProvider.js","sourceRoot":"","sources":["../../src/providers/ghIssueProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,GAAG,CACvB,CAAwB,EACxB,OAA2B;IAE3B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,cAAc,CAAC,iCAAiC,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,4CAA4C;QAC5C,MAAM,YAAY,GAAG,MAAM,SAAS,CAAC,iBAAiB,OAAO,EAAE,CAAC,CAAC;QAEjE,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,cAAc,CAAC,sCAAsC,OAAO,EAAE,CAAC,CAAC;YAChE,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,kBAAkB,OAAO,OAAO,YAAY,EAAE,CAAC;IACxD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,cAAc,CAAC;8BACW,OAAO,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;;KAE3F,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"ghIssueProvider.js","sourceRoot":"","sources":["../../src/providers/ghIssueProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAG7D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,GAAG,CACvB,CAAwB,EACxB,OAA2B;IAE3B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,cAAc,CAAC,iCAAiC,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,4CAA4C;QAC5C,MAAM,QAAQ,GAAG,IAAI,iBAAiB,CAAC,0BAA0B,OAAO,EAAE,CAAC,CAAC;QAC5E,MAAM,YAAY,GAAG,MAAM,SAAS,CAAC,iBAAiB,OAAO,EAAE,CAAC,CAAC;QACjE,QAAQ,CAAC,IAAI,EAAE,CAAC;QAEhB,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,cAAc,CAAC,sCAAsC,OAAO,EAAE,CAAC,CAAC;YAChE,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,kBAAkB,OAAO,OAAO,YAAY,EAAE,CAAC;IACxD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,cAAc,CAAC;8BACW,OAAO,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;;KAE3F,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
File without changes
@@ -1,5 +1,5 @@
1
1
  import { displayWarning } from '#src/consoleUtils.js';
2
- import { execAsync } from '#src/utils.js';
2
+ import { execAsync, ProgressIndicator } from '#src/utils.js';
3
3
  /**
4
4
  * Gets PR diff using GitHub CLI
5
5
  * @param _ config (unused in this provider)
@@ -13,7 +13,9 @@ export async function get(_, prId) {
13
13
  }
14
14
  try {
15
15
  // Use the GitHub CLI to fetch PR diff
16
+ const progress = new ProgressIndicator(`Fetching GitHub PR #${prId} diff`);
16
17
  const prDiffContent = await execAsync(`gh pr diff ${prId}`);
18
+ progress.stop();
17
19
  if (!prDiffContent) {
18
20
  displayWarning(`No diff content found for GitHub PR #${prId}`);
19
21
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"ghPrDiffProvider.js","sourceRoot":"","sources":["../../src/providers/ghPrDiffProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,GAAG,CACvB,CAAwB,EACxB,IAAwB;IAExB,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,cAAc,CAAC,8BAA8B,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,sCAAsC;QACtC,MAAM,aAAa,GAAG,MAAM,SAAS,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC;QAE5D,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,cAAc,CAAC,wCAAwC,IAAI,EAAE,CAAC,CAAC;YAC/D,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,oBAAoB,IAAI,OAAO,aAAa,EAAE,CAAC;IACxD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,cAAc,CAAC;gCACa,IAAI,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;;KAE1F,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"ghPrDiffProvider.js","sourceRoot":"","sources":["../../src/providers/ghPrDiffProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAG7D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,GAAG,CACvB,CAAwB,EACxB,IAAwB;IAExB,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,cAAc,CAAC,8BAA8B,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,sCAAsC;QACtC,MAAM,QAAQ,GAAG,IAAI,iBAAiB,CAAC,uBAAuB,IAAI,OAAO,CAAC,CAAC;QAC3E,MAAM,aAAa,GAAG,MAAM,SAAS,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC;QAC5D,QAAQ,CAAC,IAAI,EAAE,CAAC;QAEhB,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,cAAc,CAAC,wCAAwC,IAAI,EAAE,CAAC,CAAC;YAC/D,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,oBAAoB,IAAI,OAAO,aAAa,EAAE,CAAC;IACxD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,cAAc,CAAC;gCACa,IAAI,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;;KAE1F,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/utils.d.ts CHANGED
File without changes
package/dist/utils.js CHANGED
File without changes
package/dist/utils.js.map CHANGED
File without changes
File without changes
File without changes
File without changes
package/eslint.config.js CHANGED
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaunt-sloth-assistant",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": "Andrew Kondratev",
@@ -14,7 +14,9 @@
14
14
  "scripts": {
15
15
  "build": "tsc",
16
16
  "test": "npm run build && vitest run",
17
- "it": "npm run build && vitest run --config vitest-it.config.ts",
17
+ "it-groq": "node integration-tests/setup-config.js groq && npm run build && vitest run --config vitest-it.config.ts",
18
+ "it-anthropic": "node integration-tests/setup-config.js anthropic && npm run build && vitest run --config vitest-it.config.ts",
19
+ "it-vertexai": "node integration-tests/setup-config.js vertexai && npm run build && vitest run --config vitest-it.config.ts",
18
20
  "lint": "eslint . --ext .js,.ts",
19
21
  "format": "prettier --write 'src/**/*.{js,ts}'",
20
22
  "prepare": "npm run build"
@@ -28,8 +30,8 @@
28
30
  "@langchain/core": "^0.3.55",
29
31
  "@langchain/google-vertexai": "^0.2.8",
30
32
  "@langchain/groq": "^0.2.2",
31
- "@langchain/langgraph": "^0.2.71",
32
- "@langchain/mcp-adapters": "^0.4.5",
33
+ "@langchain/langgraph": "^0.3.1",
34
+ "@langchain/mcp-adapters": "^0.5.2",
33
35
  "@modelcontextprotocol/server-filesystem": "^2025.3.28",
34
36
  "chalk": "^5.4.1",
35
37
  "commander": "^14.0.0",
@@ -37,17 +39,17 @@
37
39
  },
38
40
  "devDependencies": {
39
41
  "@eslint/js": "^9.26.0",
40
- "@types/node": "^22.15.17",
42
+ "@types/node": "^22.15.30",
41
43
  "@types/uuid": "^10.0.0",
42
- "@typescript-eslint/eslint-plugin": "^8.32.0",
43
- "@typescript-eslint/parser": "^8.32.0",
44
+ "@typescript-eslint/eslint-plugin": "^8.33.1",
45
+ "@typescript-eslint/parser": "^8.33.1",
44
46
  "eslint": "^9.26.0",
45
47
  "eslint-config-prettier": "^10.1.5",
46
48
  "eslint-plugin-prettier": "^5.1.3",
47
49
  "globals": "^16.1.0",
48
50
  "prettier": "3.5.3",
49
51
  "typescript": "^5.4.2",
50
- "vitest": "^3.1.3"
52
+ "vitest": "^3.2.2"
51
53
  },
52
54
  "imports": {
53
55
  "#src/*.js": "./dist/*.js"
@@ -1,7 +1,7 @@
1
1
  import { Command } from 'commander';
2
- import { readBackstory, readGuidelines } from '#src/prompt.js';
2
+ import { readBackstory, readGuidelines, readSystemPrompt } from '#src/prompt.js';
3
3
  import { readMultipleFilesFromCurrentDir } from '#src/utils.js';
4
- import { initConfig, slothContext } from '#src/config.js';
4
+ import { initConfig } from '#src/config.js';
5
5
  import { getStringFromStdin } from '#src/systemUtils.js';
6
6
 
7
7
  interface AskCommandOptions {
@@ -22,8 +22,12 @@ export function askCommand(program: Command): void {
22
22
  'Input files. Content of these files will be added BEFORE the message'
23
23
  )
24
24
  .action(async (message: string, options: AskCommandOptions) => {
25
- await initConfig();
26
- const preamble = [readBackstory(), readGuidelines(slothContext.config.projectGuidelines)];
25
+ const config = await initConfig();
26
+ const systemPrompt = readSystemPrompt();
27
+ const preamble = [readBackstory(), readGuidelines(config.projectGuidelines)];
28
+ if (systemPrompt) {
29
+ preamble.push(systemPrompt);
30
+ }
27
31
  const content = [];
28
32
  if (options.file) {
29
33
  content.push(readMultipleFilesFromCurrentDir(options.file));
@@ -42,6 +46,6 @@ export function askCommand(program: Command): void {
42
46
  }
43
47
 
44
48
  const { askQuestion } = await import('#src/modules/questionAnsweringModule.js');
45
- await askQuestion('ASK', preamble.join('\n'), content.join('\n'));
49
+ await askQuestion('ASK', preamble.join('\n'), content.join('\n'), config);
46
50
  });
47
51
  }
@@ -0,0 +1,77 @@
1
+ import type { SlothConfig } from '#src/config.js';
2
+ import { displayError } from '#src/consoleUtils.js';
3
+
4
+ /**
5
+ * Requirements providers. Expected to be in `.providers/` dir.
6
+ * Aliases are mapped to actual providers in this file
7
+ */
8
+ export const REQUIREMENTS_PROVIDERS = {
9
+ 'jira-legacy': 'jiraIssueLegacyProvider.js',
10
+ jira: 'jiraIssueProvider.js',
11
+ github: 'ghIssueProvider.js',
12
+ text: 'text.js',
13
+ file: 'file.js',
14
+ } as const;
15
+
16
+ export type RequirementsProviderType = keyof typeof REQUIREMENTS_PROVIDERS;
17
+
18
+ /**
19
+ * Content providers. Expected to be in `.providers/` dir.
20
+ * Aliases are mapped to actual providers in this file
21
+ */
22
+ export const CONTENT_PROVIDERS = {
23
+ github: 'ghPrDiffProvider.js',
24
+ text: 'text.js',
25
+ file: 'file.js',
26
+ } as const;
27
+
28
+ export type ContentProviderType = keyof typeof CONTENT_PROVIDERS;
29
+
30
+ export async function getRequirementsFromProvider(
31
+ requirementsProvider: RequirementsProviderType | undefined,
32
+ requirementsId: string | undefined,
33
+ config: SlothConfig
34
+ ): Promise<string> {
35
+ return getFromProvider(
36
+ requirementsProvider,
37
+ requirementsId,
38
+ (config?.requirementsProviderConfig ?? {})[requirementsProvider as string],
39
+ REQUIREMENTS_PROVIDERS
40
+ );
41
+ }
42
+
43
+ export async function getContentFromProvider(
44
+ contentProvider: ContentProviderType | undefined,
45
+ contentId: string | undefined,
46
+ config: SlothConfig
47
+ ): Promise<string> {
48
+ return getFromProvider(
49
+ contentProvider,
50
+ contentId,
51
+ (config?.contentProviderConfig ?? {})[contentProvider as string],
52
+ CONTENT_PROVIDERS
53
+ );
54
+ }
55
+
56
+ async function getFromProvider(
57
+ provider: RequirementsProviderType | ContentProviderType | undefined,
58
+ id: string | undefined,
59
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
60
+ config: any,
61
+ legitPredefinedProviders: typeof REQUIREMENTS_PROVIDERS | typeof CONTENT_PROVIDERS
62
+ ): Promise<string> {
63
+ if (typeof provider === 'string') {
64
+ // Use one of the predefined providers
65
+ if (legitPredefinedProviders[provider as keyof typeof legitPredefinedProviders]) {
66
+ const providerPath = `#src/providers/${legitPredefinedProviders[provider as keyof typeof legitPredefinedProviders]}`;
67
+ const { get } = await import(providerPath);
68
+ return await get(config, id);
69
+ } else {
70
+ displayError(`Unknown provider: ${provider}. Continuing without it.`);
71
+ }
72
+ } else if (typeof provider === 'function') {
73
+ // Type assertion to handle function call
74
+ return await (provider as (id: string | undefined) => Promise<string>)(id);
75
+ }
76
+ return '';
77
+ }
File without changes
@@ -0,0 +1,93 @@
1
+ import { Command, Option } from 'commander';
2
+ import {
3
+ readBackstory,
4
+ readGuidelines,
5
+ readReviewInstructions,
6
+ readSystemPrompt,
7
+ } from '#src/prompt.js';
8
+ import { readMultipleFilesFromCurrentDir } from '#src/utils.js';
9
+ import {
10
+ REQUIREMENTS_PROVIDERS,
11
+ CONTENT_PROVIDERS,
12
+ type RequirementsProviderType,
13
+ getRequirementsFromProvider,
14
+ type ContentProviderType,
15
+ } from './commandUtils.js';
16
+
17
+ interface PrCommandOptions {
18
+ file?: string[];
19
+ requirementsProvider?: RequirementsProviderType;
20
+ }
21
+
22
+ export function prCommand(program: Command): void {
23
+ program
24
+ .command('pr')
25
+ .description(
26
+ 'Review provided Pull Request in current directory. ' +
27
+ 'This command is similar to `review`, but default content provider is `github`. ' +
28
+ '(assuming that GitHub CLI is installed and authenticated for current project'
29
+ )
30
+ .argument('<prId>', 'Pull request ID to review.')
31
+ .argument(
32
+ '[requirementsId]',
33
+ 'Optional requirements ID argument to retrieve requirements with requirements provider'
34
+ )
35
+ .addOption(
36
+ new Option(
37
+ '-p, --requirements-provider <requirementsProvider>',
38
+ 'Requirements provider for this review.'
39
+ ).choices(Object.keys(REQUIREMENTS_PROVIDERS))
40
+ )
41
+ .option(
42
+ '-f, --file [files...]',
43
+ 'Input files. Content of these files will be added BEFORE the diff, but after requirements'
44
+ )
45
+ .action(async (prId: string, requirementsId: string | undefined, options: PrCommandOptions) => {
46
+ const { initConfig } = await import('#src/config.js');
47
+ const config = await initConfig(); // Initialize and get config
48
+
49
+ const systemPrompt = readSystemPrompt();
50
+ const systemMessage = [
51
+ readBackstory(),
52
+ readGuidelines(config.projectGuidelines),
53
+ readReviewInstructions(config.projectReviewInstructions),
54
+ ];
55
+ if (systemPrompt) {
56
+ systemMessage.push(systemPrompt);
57
+ }
58
+ const content: string[] = [];
59
+ const requirementsProvider =
60
+ options.requirementsProvider ??
61
+ (config?.commands?.pr?.requirementsProvider as RequirementsProviderType | undefined) ??
62
+ (config?.requirementsProvider as RequirementsProviderType | undefined);
63
+
64
+ const contentProvider =
65
+ (config?.commands?.pr?.contentProvider as ContentProviderType | undefined) ??
66
+ (config?.contentProvider as ContentProviderType | undefined) ??
67
+ 'github';
68
+
69
+ // Handle requirements
70
+ const requirements = await getRequirementsFromProvider(
71
+ requirementsProvider,
72
+ requirementsId,
73
+ config
74
+ );
75
+ if (requirements) {
76
+ content.push(requirements);
77
+ }
78
+
79
+ if (options.file) {
80
+ content.push(readMultipleFilesFromCurrentDir(options.file));
81
+ }
82
+
83
+ // Get PR diff using the provider
84
+ const providerPath = `#src/providers/${CONTENT_PROVIDERS[contentProvider]}`;
85
+ const { get } = await import(providerPath);
86
+ content.push(await get(null, prId));
87
+
88
+ const { review } = await import('#src/modules/reviewModule.js');
89
+ // TODO consider including requirements id
90
+ // TODO sanitize prId
91
+ await review(`PR-${prId}`, systemMessage.join('\n'), content.join('\n'), config, 'pr');
92
+ });
93
+ }