gaunt-sloth-assistant 1.4.2 → 1.5.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.
Files changed (208) hide show
  1. package/package.json +9 -9
  2. package/dist/builtInToolsConfig.d.ts +0 -1
  3. package/dist/builtInToolsConfig.js +0 -2
  4. package/dist/builtInToolsConfig.js.map +0 -1
  5. package/dist/cli.d.ts +0 -1
  6. package/dist/cli.js +0 -60
  7. package/dist/cli.js.map +0 -1
  8. package/dist/commands/apiCommand.d.ts +0 -3
  9. package/dist/commands/apiCommand.js +0 -25
  10. package/dist/commands/apiCommand.js.map +0 -1
  11. package/dist/commands/askCommand.d.ts +0 -8
  12. package/dist/commands/askCommand.js +0 -39
  13. package/dist/commands/askCommand.js.map +0 -1
  14. package/dist/commands/chatCommand.d.ts +0 -3
  15. package/dist/commands/chatCommand.js +0 -24
  16. package/dist/commands/chatCommand.js.map +0 -1
  17. package/dist/commands/codeCommand.d.ts +0 -3
  18. package/dist/commands/codeCommand.js +0 -19
  19. package/dist/commands/codeCommand.js.map +0 -1
  20. package/dist/commands/commandIntrospection.d.ts +0 -11
  21. package/dist/commands/commandIntrospection.js +0 -57
  22. package/dist/commands/commandIntrospection.js.map +0 -1
  23. package/dist/commands/commandUtils.d.ts +0 -23
  24. package/dist/commands/commandUtils.js +0 -49
  25. package/dist/commands/commandUtils.js.map +0 -1
  26. package/dist/commands/configSetup.d.ts +0 -7
  27. package/dist/commands/configSetup.js +0 -63
  28. package/dist/commands/configSetup.js.map +0 -1
  29. package/dist/commands/getCommand.d.ts +0 -3
  30. package/dist/commands/getCommand.js +0 -45
  31. package/dist/commands/getCommand.js.map +0 -1
  32. package/dist/commands/initCommand.d.ts +0 -16
  33. package/dist/commands/initCommand.js +0 -90
  34. package/dist/commands/initCommand.js.map +0 -1
  35. package/dist/commands/prCommand.d.ts +0 -3
  36. package/dist/commands/prCommand.js +0 -61
  37. package/dist/commands/prCommand.js.map +0 -1
  38. package/dist/commands/reviewCommand.d.ts +0 -3
  39. package/dist/commands/reviewCommand.js +0 -51
  40. package/dist/commands/reviewCommand.js.map +0 -1
  41. package/dist/config.d.ts +0 -1
  42. package/dist/config.js +0 -2
  43. package/dist/config.js.map +0 -1
  44. package/dist/constants.d.ts +0 -1
  45. package/dist/constants.js +0 -2
  46. package/dist/constants.js.map +0 -1
  47. package/dist/core/GthAgentRunner.d.ts +0 -1
  48. package/dist/core/GthAgentRunner.js +0 -2
  49. package/dist/core/GthAgentRunner.js.map +0 -1
  50. package/dist/core/GthLangChainAgent.d.ts +0 -1
  51. package/dist/core/GthLangChainAgent.js +0 -2
  52. package/dist/core/GthLangChainAgent.js.map +0 -1
  53. package/dist/core/types.d.ts +0 -1
  54. package/dist/core/types.js +0 -2
  55. package/dist/core/types.js.map +0 -1
  56. package/dist/helpers/jira/jiraClient.d.ts +0 -1
  57. package/dist/helpers/jira/jiraClient.js +0 -2
  58. package/dist/helpers/jira/jiraClient.js.map +0 -1
  59. package/dist/helpers/jira/jiraLogWork.d.ts +0 -2
  60. package/dist/helpers/jira/jiraLogWork.js +0 -53
  61. package/dist/helpers/jira/jiraLogWork.js.map +0 -1
  62. package/dist/mcp/OAuthClientProviderImpl.d.ts +0 -1
  63. package/dist/mcp/OAuthClientProviderImpl.js +0 -2
  64. package/dist/mcp/OAuthClientProviderImpl.js.map +0 -1
  65. package/dist/middleware/binaryContentInjectionMiddleware.d.ts +0 -1
  66. package/dist/middleware/binaryContentInjectionMiddleware.js +0 -2
  67. package/dist/middleware/binaryContentInjectionMiddleware.js.map +0 -1
  68. package/dist/middleware/registry.d.ts +0 -1
  69. package/dist/middleware/registry.js +0 -2
  70. package/dist/middleware/registry.js.map +0 -1
  71. package/dist/middleware/reviewRateMiddleware.d.ts +0 -1
  72. package/dist/middleware/reviewRateMiddleware.js +0 -2
  73. package/dist/middleware/reviewRateMiddleware.js.map +0 -1
  74. package/dist/middleware/types.d.ts +0 -1
  75. package/dist/middleware/types.js +0 -2
  76. package/dist/middleware/types.js.map +0 -1
  77. package/dist/modules/a2a/A2AClientWrapper.d.ts +0 -1
  78. package/dist/modules/a2a/A2AClientWrapper.js +0 -2
  79. package/dist/modules/a2a/A2AClientWrapper.js.map +0 -1
  80. package/dist/modules/apiAgUiModule.d.ts +0 -1
  81. package/dist/modules/apiAgUiModule.js +0 -2
  82. package/dist/modules/apiAgUiModule.js.map +0 -1
  83. package/dist/modules/interactiveSessionModule.d.ts +0 -1
  84. package/dist/modules/interactiveSessionModule.js +0 -2
  85. package/dist/modules/interactiveSessionModule.js.map +0 -1
  86. package/dist/modules/questionAnsweringModule.d.ts +0 -1
  87. package/dist/modules/questionAnsweringModule.js +0 -2
  88. package/dist/modules/questionAnsweringModule.js.map +0 -1
  89. package/dist/modules/reviewModule.d.ts +0 -1
  90. package/dist/modules/reviewModule.js +0 -2
  91. package/dist/modules/reviewModule.js.map +0 -1
  92. package/dist/modules/types.d.ts +0 -1
  93. package/dist/modules/types.js +0 -2
  94. package/dist/modules/types.js.map +0 -1
  95. package/dist/presets/anthropic.d.ts +0 -1
  96. package/dist/presets/anthropic.js +0 -2
  97. package/dist/presets/anthropic.js.map +0 -1
  98. package/dist/presets/deepseek.d.ts +0 -1
  99. package/dist/presets/deepseek.js +0 -2
  100. package/dist/presets/deepseek.js.map +0 -1
  101. package/dist/presets/fake.d.ts +0 -1
  102. package/dist/presets/fake.js +0 -2
  103. package/dist/presets/fake.js.map +0 -1
  104. package/dist/presets/google-genai.d.ts +0 -1
  105. package/dist/presets/google-genai.js +0 -2
  106. package/dist/presets/google-genai.js.map +0 -1
  107. package/dist/presets/groq.d.ts +0 -1
  108. package/dist/presets/groq.js +0 -2
  109. package/dist/presets/groq.js.map +0 -1
  110. package/dist/presets/openai.d.ts +0 -1
  111. package/dist/presets/openai.js +0 -2
  112. package/dist/presets/openai.js.map +0 -1
  113. package/dist/presets/openrouter.d.ts +0 -1
  114. package/dist/presets/openrouter.js +0 -2
  115. package/dist/presets/openrouter.js.map +0 -1
  116. package/dist/presets/vertexai.d.ts +0 -1
  117. package/dist/presets/vertexai.js +0 -2
  118. package/dist/presets/vertexai.js.map +0 -1
  119. package/dist/presets/xai.d.ts +0 -1
  120. package/dist/presets/xai.js +0 -2
  121. package/dist/presets/xai.js.map +0 -1
  122. package/dist/providers/file.d.ts +0 -1
  123. package/dist/providers/file.js +0 -2
  124. package/dist/providers/file.js.map +0 -1
  125. package/dist/providers/ghIssueProvider.d.ts +0 -1
  126. package/dist/providers/ghIssueProvider.js +0 -2
  127. package/dist/providers/ghIssueProvider.js.map +0 -1
  128. package/dist/providers/ghPrDiffProvider.d.ts +0 -1
  129. package/dist/providers/ghPrDiffProvider.js +0 -2
  130. package/dist/providers/ghPrDiffProvider.js.map +0 -1
  131. package/dist/providers/jiraIssueLegacyProvider.d.ts +0 -1
  132. package/dist/providers/jiraIssueLegacyProvider.js +0 -2
  133. package/dist/providers/jiraIssueLegacyProvider.js.map +0 -1
  134. package/dist/providers/jiraIssueProvider.d.ts +0 -1
  135. package/dist/providers/jiraIssueProvider.js +0 -2
  136. package/dist/providers/jiraIssueProvider.js.map +0 -1
  137. package/dist/providers/text.d.ts +0 -1
  138. package/dist/providers/text.js +0 -2
  139. package/dist/providers/text.js.map +0 -1
  140. package/dist/providers/types.d.ts +0 -1
  141. package/dist/providers/types.js +0 -2
  142. package/dist/providers/types.js.map +0 -1
  143. package/dist/state/artifactStore.d.ts +0 -1
  144. package/dist/state/artifactStore.js +0 -2
  145. package/dist/state/artifactStore.js.map +0 -1
  146. package/dist/tools/A2AAgentTool.d.ts +0 -1
  147. package/dist/tools/A2AAgentTool.js +0 -2
  148. package/dist/tools/A2AAgentTool.js.map +0 -1
  149. package/dist/tools/GthCustomToolkit.d.ts +0 -1
  150. package/dist/tools/GthCustomToolkit.js +0 -2
  151. package/dist/tools/GthCustomToolkit.js.map +0 -1
  152. package/dist/tools/GthDevToolkit.d.ts +0 -1
  153. package/dist/tools/GthDevToolkit.js +0 -2
  154. package/dist/tools/GthDevToolkit.js.map +0 -1
  155. package/dist/tools/GthFileSystemToolkit.d.ts +0 -1
  156. package/dist/tools/GthFileSystemToolkit.js +0 -2
  157. package/dist/tools/GthFileSystemToolkit.js.map +0 -1
  158. package/dist/tools/binaryUtils.d.ts +0 -1
  159. package/dist/tools/binaryUtils.js +0 -2
  160. package/dist/tools/binaryUtils.js.map +0 -1
  161. package/dist/tools/gthJiraLogWorkTool.d.ts +0 -3
  162. package/dist/tools/gthJiraLogWorkTool.js +0 -37
  163. package/dist/tools/gthJiraLogWorkTool.js.map +0 -1
  164. package/dist/tools/gthStatusUpdateTool.d.ts +0 -1
  165. package/dist/tools/gthStatusUpdateTool.js +0 -2
  166. package/dist/tools/gthStatusUpdateTool.js.map +0 -1
  167. package/dist/tools/gthWebFetchTool.d.ts +0 -1
  168. package/dist/tools/gthWebFetchTool.js +0 -2
  169. package/dist/tools/gthWebFetchTool.js.map +0 -1
  170. package/dist/tools/showA2UISurfaceTool.d.ts +0 -1
  171. package/dist/tools/showA2UISurfaceTool.js +0 -2
  172. package/dist/tools/showA2UISurfaceTool.js.map +0 -1
  173. package/dist/utils/ProgressIndicator.d.ts +0 -1
  174. package/dist/utils/ProgressIndicator.js +0 -2
  175. package/dist/utils/ProgressIndicator.js.map +0 -1
  176. package/dist/utils/aiignoreUtils.d.ts +0 -1
  177. package/dist/utils/aiignoreUtils.js +0 -2
  178. package/dist/utils/aiignoreUtils.js.map +0 -1
  179. package/dist/utils/binaryOutputUtils.d.ts +0 -1
  180. package/dist/utils/binaryOutputUtils.js +0 -2
  181. package/dist/utils/binaryOutputUtils.js.map +0 -1
  182. package/dist/utils/consoleUtils.d.ts +0 -1
  183. package/dist/utils/consoleUtils.js +0 -2
  184. package/dist/utils/consoleUtils.js.map +0 -1
  185. package/dist/utils/debugUtils.d.ts +0 -1
  186. package/dist/utils/debugUtils.js +0 -2
  187. package/dist/utils/debugUtils.js.map +0 -1
  188. package/dist/utils/fileUtils.d.ts +0 -1
  189. package/dist/utils/fileUtils.js +0 -2
  190. package/dist/utils/fileUtils.js.map +0 -1
  191. package/dist/utils/globalConfigUtils.d.ts +0 -1
  192. package/dist/utils/globalConfigUtils.js +0 -2
  193. package/dist/utils/globalConfigUtils.js.map +0 -1
  194. package/dist/utils/llmUtils.d.ts +0 -1
  195. package/dist/utils/llmUtils.js +0 -2
  196. package/dist/utils/llmUtils.js.map +0 -1
  197. package/dist/utils/mcpUtils.d.ts +0 -1
  198. package/dist/utils/mcpUtils.js +0 -2
  199. package/dist/utils/mcpUtils.js.map +0 -1
  200. package/dist/utils/stringUtils.d.ts +0 -1
  201. package/dist/utils/stringUtils.js +0 -2
  202. package/dist/utils/stringUtils.js.map +0 -1
  203. package/dist/utils/systemUtils.d.ts +0 -1
  204. package/dist/utils/systemUtils.js +0 -2
  205. package/dist/utils/systemUtils.js.map +0 -1
  206. package/dist/utils/vertexaiUtils.d.ts +0 -1
  207. package/dist/utils/vertexaiUtils.js +0 -2
  208. package/dist/utils/vertexaiUtils.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaunt-sloth-assistant",
3
- "version": "1.4.2",
3
+ "version": "1.5.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": "Andrew Kondratev",
@@ -35,17 +35,17 @@
35
35
  "gth": "cli.js"
36
36
  },
37
37
  "dependencies": {
38
- "@gaunt-sloth/api": "^0.0.2",
39
- "@gaunt-sloth/core": "^0.0.1",
40
- "@gaunt-sloth/review": "^0.0.1",
38
+ "@gaunt-sloth/api": "^0.0.3",
39
+ "@gaunt-sloth/core": "^0.0.4",
40
+ "@gaunt-sloth/review": "^0.0.4",
41
41
  "@gaunt-sloth/tools": "^0.0.1",
42
- "@langchain/anthropic": "^1.3.26",
43
- "@langchain/core": "^1.1.39",
44
- "@langchain/deepseek": "^1.0.24",
45
- "@langchain/google": "^0.1.10",
42
+ "@langchain/anthropic": "^1.3.28",
43
+ "@langchain/core": "^1.1.42",
44
+ "@langchain/deepseek": "^1.0.25",
45
+ "@langchain/google": "^0.1.11",
46
46
  "@langchain/groq": "^1.2.0",
47
47
  "@langchain/openai": "^1.2.0",
48
- "@langchain/xai": "^1.3.16",
48
+ "@langchain/xai": "^1.3.17",
49
49
  "commander": "^14.0.3"
50
50
  },
51
51
  "imports": {
@@ -1 +0,0 @@
1
- export * from '@gaunt-sloth/tools/builtInToolsConfig.js';
@@ -1,2 +0,0 @@
1
- export * from '@gaunt-sloth/tools/builtInToolsConfig.js';
2
- //# sourceMappingURL=builtInToolsConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"builtInToolsConfig.js","sourceRoot":"","sources":["../src/builtInToolsConfig.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC"}
package/dist/cli.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/dist/cli.js DELETED
@@ -1,60 +0,0 @@
1
- import { Command, Option } from 'commander';
2
- import { askCommand } from '#src/commands/askCommand.js';
3
- import { initCommand } from '#src/commands/initCommand.js';
4
- import { reviewCommand } from '#src/commands/reviewCommand.js';
5
- import { prCommand } from '#src/commands/prCommand.js';
6
- import { chatCommand } from '#src/commands/chatCommand.js';
7
- import { codeCommand } from '#src/commands/codeCommand.js';
8
- import { apiCommand } from '#src/commands/apiCommand.js';
9
- import { getCommand } from '#src/commands/getCommand.js';
10
- import { argv, getSlothVersion, readStdin } from '@gaunt-sloth/core/utils/systemUtils.js';
11
- import { coerceBooleanOrString } from '@gaunt-sloth/core/utils/consoleUtils.js';
12
- const program = new Command();
13
- program
14
- .name('gsloth')
15
- .description('Gaunt Sloth Assistant reviewing your PRs')
16
- .version(getSlothVersion())
17
- .option('--verbose', 'Set LangChain/LangGraph to verbose mode, ' +
18
- 'causing LangChain/LangGraph to log many details to the console. ' +
19
- 'Consider using debugLog from config.ts for less intrusive debug logging.')
20
- .option('-c, --config <path>', 'Path to custom configuration file')
21
- .option('-i, --identity-profile <identity>', 'Identity profile (separate config and prompts)')
22
- .option('-w, --write-output-to-file <value>', 'Write output to file. Accepts true/false or a filename. Shortcuts: -wn or -w0 for false.')
23
- .addOption(new Option('--nopipe').hideHelp(true));
24
- const cliConfigOverrides = {};
25
- // Parse global options before binding any commands
26
- program.parseOptions(argv);
27
- if (program.getOptionValue('verbose')) {
28
- /**
29
- * Set LangChain/LangGraph to verbose mode,
30
- * causing LangChain/LangGraph to log many details to the console.
31
- * debugLog from config.ts may be a less intrusive option.
32
- */
33
- cliConfigOverrides.verbose = true;
34
- }
35
- if (program.getOptionValue('config')) {
36
- // Set a custom config path
37
- cliConfigOverrides.customConfigPath = program.getOptionValue('config');
38
- }
39
- if (program.getOptionValue('identityProfile')) {
40
- cliConfigOverrides.identityProfile = program.getOptionValue('identityProfile');
41
- }
42
- const writeToFile = program.getOptionValue('writeOutputToFile');
43
- // Commander does an interesting thing: if a shortcut like -w exists,
44
- // everything after this shortcut without a space becomes the value.
45
- // Examples: -wn comes with value 'n', -w0 => '0', -wreview.md => 'review.md'
46
- const coerced = coerceBooleanOrString(writeToFile);
47
- if (coerced !== undefined) {
48
- cliConfigOverrides.writeOutputToFile = coerced;
49
- }
50
- // Initialize all commands - they will handle their own config loading
51
- initCommand(program);
52
- reviewCommand(program, cliConfigOverrides);
53
- prCommand(program, cliConfigOverrides);
54
- askCommand(program, cliConfigOverrides);
55
- chatCommand(program, cliConfigOverrides);
56
- codeCommand(program, cliConfigOverrides);
57
- apiCommand(program, cliConfigOverrides);
58
- getCommand(program, cliConfigOverrides);
59
- await readStdin(program);
60
- //# sourceMappingURL=cli.js.map
package/dist/cli.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,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kB,CAAC,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;AACzE,CAAC;AACD,IAAI,OAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAC9C,kBAAkB,CAAC,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;AACjF,CAAC;AAED,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;AAEhE,qEAAqE;AACrE,oEAAoE;AACpE,6EAA6E;AAC7E,MAAM,OAAO,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;AACnD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;IAC1B,kBAAkB,CAAC,iBAAiB,GAAG,OAAO,CAAC;AACjD,CAAC;AAED,sEAAsE;AACtE,WAAW,CAAC,OAAO,CAAC,CAAC;AACrB,aAAa,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AAC3C,SAAS,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AACvC,UAAU,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AACxC,WAAW,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AACzC,WAAW,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AACzC,UAAU,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AACxC,UAAU,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AAExC,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- import { CommandLineConfigOverrides } from '@gaunt-sloth/core/config.js';
3
- export declare function apiCommand(program: Command, commandLineConfigOverrides: CommandLineConfigOverrides): void;
@@ -1,25 +0,0 @@
1
- import { initConfig } from '@gaunt-sloth/core/config.js';
2
- import { displayError } from '@gaunt-sloth/core/utils/consoleUtils.js';
3
- import { setExitCode } from '@gaunt-sloth/core/utils/systemUtils.js';
4
- export function apiCommand(program, commandLineConfigOverrides) {
5
- const api = program.command('api').description('Start an API server for Gaunt Sloth');
6
- api
7
- .command('ag-ui')
8
- .description('Start an AG-UI protocol HTTP server')
9
- .option('--port <port>', 'Port to listen on')
10
- .action(async (options) => {
11
- try {
12
- const config = await initConfig(commandLineConfigOverrides);
13
- const port = options.port
14
- ? parseInt(options.port, 10)
15
- : (config.commands?.api?.port ?? 3000);
16
- const { startAgUiServer } = await import('@gaunt-sloth/api/modules/apiAgUiModule.js');
17
- await startAgUiServer(config, port);
18
- }
19
- catch (error) {
20
- displayError(error instanceof Error ? error.message : String(error));
21
- setExitCode(1);
22
- }
23
- });
24
- }
25
- //# sourceMappingURL=apiCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiCommand.js","sourceRoot":"","sources":["../../src/commands/apiCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAErE,MAAM,UAAU,UAAU,CACxB,OAAgB,EAChB,0BAAsD;IAEtD,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,qCAAqC,CAAC,CAAC;IAEtF,GAAG;SACA,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,qCAAqC,CAAC;SAClD,MAAM,CAAC,eAAe,EAAE,mBAAmB,CAAC;SAC5C,MAAM,CAAC,KAAK,EAAE,OAA0B,EAAE,EAAE;QAC3C,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,0BAA0B,CAAC,CAAC;YAC5D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI;gBACvB,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;gBAC5B,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC;YAEzC,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,2CAA2C,CAAC,CAAC;YACtF,MAAM,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACtC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,YAAY,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACrE,WAAW,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,8 +0,0 @@
1
- import { Command } from 'commander';
2
- import { CommandLineConfigOverrides } from '@gaunt-sloth/core/config.js';
3
- /**
4
- * Adds the ask command to the program
5
- * @param program - The commander program
6
- * @param commandLineConfigOverrides - command line config overrides
7
- */
8
- export declare function askCommand(program: Command, commandLineConfigOverrides: CommandLineConfigOverrides): void;
@@ -1,39 +0,0 @@
1
- import { initConfig } from '@gaunt-sloth/core/config.js';
2
- import { getAskSystemPrompt } from '#src/commands/commandIntrospection.js';
3
- import { getStringFromStdin } from '@gaunt-sloth/core/utils/systemUtils.js';
4
- import { wrapContent } from '@gaunt-sloth/core/utils/llmUtils.js';
5
- import { readMultipleFilesFromProjectDir } from '@gaunt-sloth/review/utils/fileUtils.js';
6
- /**
7
- * Adds the ask command to the program
8
- * @param program - The commander program
9
- * @param commandLineConfigOverrides - command line config overrides
10
- */
11
- export function askCommand(program, commandLineConfigOverrides) {
12
- program
13
- .command('ask')
14
- .description('Ask a question')
15
- .argument('[message]', 'A message')
16
- .option('-f, --file [files...]', 'Input files. Content of these files will be added BEFORE the message')
17
- .action(async (message, options) => {
18
- const config = await initConfig(commandLineConfigOverrides);
19
- const content = [];
20
- if (options.file) {
21
- content.push(readMultipleFilesFromProjectDir(options.file));
22
- }
23
- const stringFromStdin = getStringFromStdin();
24
- if (stringFromStdin) {
25
- content.push(wrapContent(stringFromStdin, 'stdin-content'));
26
- }
27
- if (message) {
28
- content.push(wrapContent(message, 'message', 'user message'));
29
- }
30
- // Validate that at least one input source is provided
31
- if (content.length === 0) {
32
- throw new Error('At least one of the following is required: file, stdin, or message');
33
- }
34
- const { askQuestion } = await import('@gaunt-sloth/review/modules/questionAnsweringModule.js');
35
- const { createResolvers } = await import('@gaunt-sloth/api/resolvers.js');
36
- await askQuestion('ASK', getAskSystemPrompt(config), content.join('\n'), config, createResolvers());
37
- });
38
- }
39
- //# sourceMappingURL=askCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"askCommand.js","sourceRoot":"","sources":["../../src/commands/askCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AAMzF;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACxB,OAAgB,EAChB,0BAAsD;IAEtD,OAAO;SACJ,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,gBAAgB,CAAC;SAC7B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;SAClC,MAAM,CACL,uBAAuB,EACvB,sEAAsE,CACvE;SACA,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,OAA0B,EAAE,EAAE;QAC5D,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,0BAA0B,CAAC,CAAC;QAC5D,MAAM,OAAO,GAAG,EAAE,CAAC;QACnB,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,OAAO,CAAC,IAAI,CAAC,+BAA+B,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9D,CAAC;QACD,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;QAC7C,IAAI,eAAe,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC;QAC9D,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;QAChE,CAAC;QAED,sDAAsD;QACtD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;QACxF,CAAC;QAED,MAAM,EAAE,WAAW,EAAE,GACnB,MAAM,MAAM,CAAC,wDAAwD,CAAC,CAAC;QACzE,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC,CAAC;QAC1E,MAAM,WAAW,CACf,KAAK,EACL,kBAAkB,CAAC,MAAM,CAAC,EAC1B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAClB,MAAM,EACN,eAAe,EAAE,CAClB,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- import { CommandLineConfigOverrides } from '@gaunt-sloth/core/config.js';
3
- export declare function chatCommand(program: Command, commandLineConfigOverrides: CommandLineConfigOverrides): void;
@@ -1,24 +0,0 @@
1
- import { createInteractiveSession, } from '@gaunt-sloth/api/modules/interactiveSessionModule.js';
2
- import { readChatPrompt } from '@gaunt-sloth/core/utils/llmUtils.js';
3
- export function chatCommand(program, commandLineConfigOverrides) {
4
- const sessionConfig = {
5
- mode: 'chat',
6
- readModePrompt: readChatPrompt,
7
- description: 'Start an interactive chat session with Gaunt Sloth',
8
- readyMessage: '\nGaunt Sloth is ready to chat. Type your prompt.',
9
- exitMessage: "Type 'exit' or hit Ctrl+C to exit chat\n",
10
- };
11
- // Start chat when no command typed
12
- program.action(async () => {
13
- await createInteractiveSession(sessionConfig, commandLineConfigOverrides);
14
- });
15
- // Chat command
16
- program
17
- .command('chat')
18
- .description('Start an interactive chat session with Gaunt Sloth')
19
- .argument('[message]', 'Initial message to start the chat')
20
- .action(async (message) => {
21
- await createInteractiveSession(sessionConfig, commandLineConfigOverrides, message);
22
- });
23
- }
24
- //# sourceMappingURL=chatCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chatCommand.js","sourceRoot":"","sources":["../../src/commands/chatCommand.ts"],"names":[],"mappings":"AACA,OAAO,EACL,wBAAwB,GAEzB,MAAM,sDAAsD,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAErE,MAAM,UAAU,WAAW,CACzB,OAAgB,EAChB,0BAAsD;IAEtD,MAAM,aAAa,GAAkB;QACnC,IAAI,EAAE,MAAM;QACZ,cAAc,EAAE,cAAc;QAC9B,WAAW,EAAE,oDAAoD;QACjE,YAAY,EAAE,mDAAmD;QACjE,WAAW,EAAE,0CAA0C;KACxD,CAAC;IACF,mCAAmC;IACnC,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE;QACxB,MAAM,wBAAwB,CAAC,aAAa,EAAE,0BAA0B,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IACH,eAAe;IACf,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,oDAAoD,CAAC;SACjE,QAAQ,CAAC,WAAW,EAAE,mCAAmC,CAAC;SAC1D,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,EAAE;QAChC,MAAM,wBAAwB,CAAC,aAAa,EAAE,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- import { CommandLineConfigOverrides } from '@gaunt-sloth/core/config.js';
3
- export declare function codeCommand(program: Command, commandLineConfigOverrides: CommandLineConfigOverrides): void;
@@ -1,19 +0,0 @@
1
- import { createInteractiveSession, } from '@gaunt-sloth/api/modules/interactiveSessionModule.js';
2
- import { readCodePrompt } from '@gaunt-sloth/core/utils/llmUtils.js';
3
- export function codeCommand(program, commandLineConfigOverrides) {
4
- program
5
- .command('code')
6
- .description('Interactively write code with sloth (has full file system access within your project)')
7
- .argument('[message]', 'Initial message to start the code session')
8
- .action(async (message) => {
9
- const sessionConfig = {
10
- mode: 'code',
11
- readModePrompt: readCodePrompt,
12
- description: 'Interactively write code with sloth (has full file system access within your project)',
13
- readyMessage: '\nGaunt Sloth is ready to code. Type your prompt.',
14
- exitMessage: "Type 'exit' or hit Ctrl+C to exit code session\n",
15
- };
16
- await createInteractiveSession(sessionConfig, commandLineConfigOverrides, message);
17
- });
18
- }
19
- //# sourceMappingURL=codeCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"codeCommand.js","sourceRoot":"","sources":["../../src/commands/codeCommand.ts"],"names":[],"mappings":"AACA,OAAO,EACL,wBAAwB,GAEzB,MAAM,sDAAsD,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAErE,MAAM,UAAU,WAAW,CACzB,OAAgB,EAChB,0BAAsD;IAEtD,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CACV,uFAAuF,CACxF;SACA,QAAQ,CAAC,WAAW,EAAE,2CAA2C,CAAC;SAClE,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,EAAE;QAChC,MAAM,aAAa,GAAkB;YACnC,IAAI,EAAE,MAAM;YACZ,cAAc,EAAE,cAAc;YAC9B,WAAW,EACT,uFAAuF;YACzF,YAAY,EAAE,mDAAmD;YACjE,WAAW,EAAE,kDAAkD;SAChE,CAAC;QAEF,MAAM,wBAAwB,CAAC,aAAa,EAAE,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { GthConfig } from '@gaunt-sloth/core/config.js';
2
- import { type ContentProviderType, type RequirementsProviderType } from '#src/commands/commandUtils.js';
3
- export type PromptCommandType = 'ask' | 'review' | 'pr' | 'chat' | 'code';
4
- export type ProviderCommandType = 'review' | 'pr';
5
- export type ProviderInputType = 'content' | 'requirements';
6
- export declare function getAskSystemPrompt(config: GthConfig): string;
7
- export declare function getReviewSystemPrompt(config: GthConfig): string;
8
- export declare function getCommandSystemPrompt(command: PromptCommandType, config: GthConfig): string;
9
- export declare function getEffectiveRequirementsProvider(command: ProviderCommandType, config: GthConfig, cliProvider?: RequirementsProviderType): RequirementsProviderType | undefined;
10
- export declare function getEffectiveContentProvider(command: ProviderCommandType, config: GthConfig, cliProvider?: ContentProviderType): ContentProviderType | undefined;
11
- export declare function getCommandProviderInput(command: ProviderCommandType, inputType: ProviderInputType, id: string | undefined, config: GthConfig, cliProvider?: RequirementsProviderType | ContentProviderType): Promise<string>;
@@ -1,57 +0,0 @@
1
- import { getContentFromProvider, getRequirementsFromProvider, } from '#src/commands/commandUtils.js';
2
- import { buildSystemMessages, readBackstory, readChatPrompt, readCodePrompt, readGuidelines, readReviewInstructions, readSystemPrompt, } from '@gaunt-sloth/core/utils/llmUtils.js';
3
- export function getAskSystemPrompt(config) {
4
- const parts = [readBackstory(config), readGuidelines(config)];
5
- const systemPrompt = readSystemPrompt(config);
6
- if (systemPrompt) {
7
- parts.push(systemPrompt);
8
- }
9
- return parts.join('\n');
10
- }
11
- export function getReviewSystemPrompt(config) {
12
- const parts = [readBackstory(config), readGuidelines(config), readReviewInstructions(config)];
13
- const systemPrompt = readSystemPrompt(config);
14
- if (systemPrompt) {
15
- parts.push(systemPrompt);
16
- }
17
- return parts.join('\n');
18
- }
19
- export function getCommandSystemPrompt(command, config) {
20
- if (command === 'ask') {
21
- return getAskSystemPrompt(config);
22
- }
23
- if (command === 'review' || command === 'pr') {
24
- return getReviewSystemPrompt(config);
25
- }
26
- const modePrompt = command === 'chat' ? readChatPrompt(config) : readCodePrompt(config);
27
- const messages = buildSystemMessages(config, modePrompt);
28
- const [systemMessage] = messages;
29
- const content = systemMessage?.content;
30
- if (typeof content === 'string') {
31
- return content;
32
- }
33
- if (Array.isArray(content)) {
34
- return content
35
- .map((item) => (typeof item === 'string' ? item : 'text' in item ? item.text : ''))
36
- .join('\n');
37
- }
38
- return '';
39
- }
40
- export function getEffectiveRequirementsProvider(command, config, cliProvider) {
41
- return (cliProvider ??
42
- config?.commands?.[command]?.requirementsProvider ??
43
- config?.requirementsProvider);
44
- }
45
- export function getEffectiveContentProvider(command, config, cliProvider) {
46
- return (cliProvider ??
47
- config?.commands?.[command]?.contentProvider ??
48
- config?.contentProvider ??
49
- (command === 'pr' ? 'github' : undefined));
50
- }
51
- export async function getCommandProviderInput(command, inputType, id, config, cliProvider) {
52
- if (inputType === 'requirements') {
53
- return getRequirementsFromProvider(getEffectiveRequirementsProvider(command, config, cliProvider), id, config);
54
- }
55
- return getContentFromProvider(getEffectiveContentProvider(command, config, cliProvider), id, config);
56
- }
57
- //# sourceMappingURL=commandIntrospection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commandIntrospection.js","sourceRoot":"","sources":["../../src/commands/commandIntrospection.ts"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EACtB,2BAA2B,GAG5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,qCAAqC,CAAC;AAM7C,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,MAAM,KAAK,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9D,MAAM,YAAY,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC9C,IAAI,YAAY,EAAE,CAAC;QACjB,KAA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'@gaunt-sloth/core/config.js';
2
- /**
3
- * Requirements providers. Aliases are mapped to actual package paths.
4
- */
5
- export declare const REQUIREMENTS_PROVIDERS: {
6
- readonly 'jira-legacy': "@gaunt-sloth/review/sources/jiraIssueLegacySource.js";
7
- readonly jira: "@gaunt-sloth/review/sources/jiraIssueSource.js";
8
- readonly github: "@gaunt-sloth/review/sources/ghIssueSource.js";
9
- readonly text: "@gaunt-sloth/review/sources/textSource.js";
10
- readonly file: "@gaunt-sloth/review/sources/fileSource.js";
11
- };
12
- export type RequirementsProviderType = keyof typeof REQUIREMENTS_PROVIDERS;
13
- /**
14
- * Content providers. Aliases are mapped to actual package paths.
15
- */
16
- export declare const CONTENT_PROVIDERS: {
17
- readonly github: "@gaunt-sloth/review/sources/ghPrDiffSource.js";
18
- readonly text: "@gaunt-sloth/review/sources/textSource.js";
19
- readonly file: "@gaunt-sloth/review/sources/fileSource.js";
20
- };
21
- export type ContentProviderType = keyof typeof CONTENT_PROVIDERS;
22
- export declare function getRequirementsFromProvider(requirementsProvider: RequirementsProviderType | undefined, requirementsId: string | undefined, config: GthConfig): Promise<string>;
23
- export declare function getContentFromProvider(contentProvider: ContentProviderType | undefined, contentId: string | undefined, config: GthConfig): Promise<string>;
@@ -1,49 +0,0 @@
1
- import { displayError } from '@gaunt-sloth/core/utils/consoleUtils.js';
2
- import { wrapContent } from '@gaunt-sloth/core/utils/llmUtils.js';
3
- /**
4
- * Requirements providers. Aliases are mapped to actual package paths.
5
- */
6
- export const REQUIREMENTS_PROVIDERS = {
7
- 'jira-legacy': '@gaunt-sloth/review/sources/jiraIssueLegacySource.js',
8
- jira: '@gaunt-sloth/review/sources/jiraIssueSource.js',
9
- github: '@gaunt-sloth/review/sources/ghIssueSource.js',
10
- text: '@gaunt-sloth/review/sources/textSource.js',
11
- file: '@gaunt-sloth/review/sources/fileSource.js',
12
- };
13
- /**
14
- * Content providers. Aliases are mapped to actual package paths.
15
- */
16
- export const CONTENT_PROVIDERS = {
17
- github: '@gaunt-sloth/review/sources/ghPrDiffSource.js',
18
- text: '@gaunt-sloth/review/sources/textSource.js',
19
- file: '@gaunt-sloth/review/sources/fileSource.js',
20
- };
21
- export async function getRequirementsFromProvider(requirementsProvider, requirementsId, config) {
22
- const requirements = await getFromProvider(requirementsProvider, requirementsId, (config?.requirementsProviderConfig ?? {})[requirementsProvider], REQUIREMENTS_PROVIDERS);
23
- return wrapContent(requirements, requirementsProvider, 'requirements');
24
- }
25
- export async function getContentFromProvider(contentProvider, contentId, config) {
26
- const content = await getFromProvider(contentProvider, contentId, (config?.contentProviderConfig ?? {})[contentProvider], CONTENT_PROVIDERS);
27
- return wrapContent(content, contentProvider, contentProvider === 'github' ? 'GitHub diff' : 'content');
28
- }
29
- async function getFromProvider(provider, id,
30
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
- config, legitPredefinedProviders) {
32
- if (typeof provider === 'string') {
33
- // Use one of the predefined providers
34
- if (legitPredefinedProviders[provider]) {
35
- const providerPath = legitPredefinedProviders[provider];
36
- const { get } = await import(providerPath);
37
- return await get(config, id);
38
- }
39
- else {
40
- displayError(`Unknown provider: ${provider}. Continuing without it.`);
41
- }
42
- }
43
- else if (typeof provider === 'function') {
44
- // Type assertion to handle function call
45
- return await provider(id);
46
- }
47
- return '';
48
- }
49
- //# sourceMappingURL=commandUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commandUtils.js","sourceRoot":"","sources":["../../src/commands/commandUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAEvE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,aAAa,EAAE,sDAAsD;IACrE,IAAI,EAAE,gDAAgD;IACtD,MAAM,EAAE,8CAA8C;IACtD,IAAI,EAAE,2CAA2C;IACjD,IAAI,EAAE,2CAA2C;CACzC,CAAC;AAIX;;GAEG;AACH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;aAAM,CAAC;YACN,YAAY,CAAC,qBAAqB,QAAQ,0BAA0B,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;SAAM,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC1C,yCAAyC;QACzC,OAAO,MAAO,QAAwD,CAAC,EAAE,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -1,7 +0,0 @@
1
- export declare function createProjectConfig(configType: string): Promise<void>;
2
- /**
3
- * Ensures that the .gsloth directory exists in the project root.
4
- * Creates it if it does not exist.
5
- */
6
- export declare function ensureGslothDir(): void;
7
- export declare function writeProjectReviewPreamble(): void;
@@ -1,63 +0,0 @@
1
- import { GSLOTH_DIR, PROJECT_GUIDELINES, PROJECT_REVIEW_INSTRUCTIONS, USER_PROJECT_CONFIG_JSON, } from '@gaunt-sloth/core/constants.js';
2
- import { availableDefaultConfigs } from '@gaunt-sloth/core/config.js';
3
- import { displayError, displayInfo, displayWarning } from '@gaunt-sloth/core/utils/consoleUtils.js';
4
- import { getGslothConfigWritePath, writeFileIfNotExistsWithMessages, } from '@gaunt-sloth/review/utils/fileUtils.js';
5
- import { exit, getCurrentWorkDir } from '@gaunt-sloth/core/utils/systemUtils.js';
6
- import { existsSync, mkdirSync } from 'node:fs';
7
- import { resolve } from 'node:path';
8
- export async function createProjectConfig(configType) {
9
- if (!availableDefaultConfigs.includes(configType)) {
10
- displayError(`Unknown config type: ${configType}. Available options: ${availableDefaultConfigs.join(', ')}`);
11
- exit(1);
12
- }
13
- ensureGslothDir();
14
- displayInfo(`Setting up your project\n`);
15
- writeProjectReviewPreamble();
16
- displayWarning(`Make sure you add as much detail as possible to your ${PROJECT_GUIDELINES}.\n`);
17
- displayInfo(`Creating project config for ${configType}`);
18
- const vendorConfig = await import(`@gaunt-sloth/core/providers/${configType}.js`);
19
- vendorConfig.init(getGslothConfigWritePath(USER_PROJECT_CONFIG_JSON));
20
- }
21
- /**
22
- * Ensures that the .gsloth directory exists in the project root.
23
- * Creates it if it does not exist.
24
- */
25
- export function ensureGslothDir() {
26
- const projectDir = getCurrentWorkDir();
27
- const gslothDirPath = resolve(projectDir, GSLOTH_DIR);
28
- if (!existsSync(gslothDirPath)) {
29
- mkdirSync(gslothDirPath, { recursive: true });
30
- displayInfo(`Created ${GSLOTH_DIR} directory`);
31
- }
32
- }
33
- export function writeProjectReviewPreamble() {
34
- const guidelinesPath = getGslothConfigWritePath(PROJECT_GUIDELINES);
35
- const reviewPath = getGslothConfigWritePath(PROJECT_REVIEW_INSTRUCTIONS);
36
- const guidelinesTemplate = `# Development Guidelines
37
-
38
- This file should include general development guidelines for this project.
39
-
40
- Important! Please remind the user to prepare proper AI guidelines to the ${PROJECT_GUIDELINES} file
41
- for this project. Use a decent amount of ⚠️ to highlight the lack of config.
42
- Explicitly mention ${PROJECT_GUIDELINES}.
43
- `;
44
- const reviewTemplate = `# Code Review Guidelines
45
-
46
- If requirements were provided, first check that the implemented code implements these requirements.
47
- Document that you checked the code to implement requirements.
48
- Reject the change if it appears to implement something else instead of required change.
49
-
50
- Provide specific feedback on any areas of concern or suggestions for improvement.
51
- Please categorize your feedback (e.g., "Bug," "Suggestion," "Nitpick").
52
-
53
- Important! In the end, conclude if you would recommend approving this PR or not.
54
- Use ✅⚠️❌ symbols to highlight your feedback appropriately.
55
-
56
- Thank you for your thorough review!
57
-
58
- Important! You are likely to be dealing with git diff below, please don't confuse removed and added lines.
59
- `;
60
- writeFileIfNotExistsWithMessages(guidelinesPath, guidelinesTemplate);
61
- writeFileIfNotExistsWithMessages(reviewPath, reviewTemplate);
62
- }
63
- //# sourceMappingURL=configSetup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"configSetup.js","sourceRoot":"","sources":["../../src/commands/configSetup.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,GACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,u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CAAC,CAAC;QAC9C,WAAW,CAAC,WAAW,UAAU,YAAY,CAAC,CAAC;IACjD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,MAAM,cAAc,GAAG,wBAAwB,CAAC,kBAAkB,CAAC,CAAC;IACpE,MAAM,UAAU,GAAG,wBAAwB,CAAC,2BAA2B,CAAC,CAAC;IAEzE,MAAM,kBAAkB,GAAG;;;;2EAI8C,kBAAkB;;qBAExE,kBAAkB;CACtC,CAAC;IAEA,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;CAexB,CAAC;IAEA,gCAAgC,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;IACrE,gCAAgC,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;AAC/D,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- import { CommandLineConfigOverrides } from '@gaunt-sloth/core/config.js';
3
- export declare function getCommand(program: Command, commandLineConfigOverrides: CommandLineConfigOverrides): void;
@@ -1,45 +0,0 @@
1
- import { initConfig } from '@gaunt-sloth/core/config.js';
2
- import { getCommandProviderInput, getCommandSystemPrompt, } from '#src/commands/commandIntrospection.js';
3
- import { display, displayError } from '@gaunt-sloth/core/utils/consoleUtils.js';
4
- import { setExitCode } from '@gaunt-sloth/core/utils/systemUtils.js';
5
- const PROMPT_COMMANDS = ['ask', 'review', 'pr', 'chat', 'code'];
6
- const PROVIDER_COMMANDS = ['review', 'pr'];
7
- const INPUT_TYPES = ['content', 'requirements'];
8
- export function getCommand(program, commandLineConfigOverrides) {
9
- program
10
- .command('get')
11
- .description('Print the effective prompt or provider-backed command input')
12
- .argument('<command>', 'Command to introspect')
13
- .argument('<subject>', 'Either prompt, content, or requirements')
14
- .argument('[id]', 'Provider-backed content identifier')
15
- .action(async (command, subject, id) => {
16
- try {
17
- const config = await initConfig(commandLineConfigOverrides);
18
- if (subject === 'prompt') {
19
- if (id) {
20
- throw new Error('Prompt subject does not accept an ID.');
21
- }
22
- if (!PROMPT_COMMANDS.includes(command)) {
23
- throw new Error(`Unsupported prompt command: ${command}.`);
24
- }
25
- display(getCommandSystemPrompt(command, config));
26
- return;
27
- }
28
- if (!INPUT_TYPES.includes(subject)) {
29
- throw new Error(`Unsupported subject: ${subject}.`);
30
- }
31
- if (!PROVIDER_COMMANDS.includes(command)) {
32
- throw new Error(`Unsupported provider-backed command: ${command}.`);
33
- }
34
- if (!id) {
35
- throw new Error(`Subject "${subject}" requires an ID.`);
36
- }
37
- display(await getCommandProviderInput(command, subject, id, config));
38
- }
39
- catch (error) {
40
- displayError(error instanceof Error ? error.message : String(error));
41
- setExitCode(1);
42
- }
43
- });
44
- }
45
- //# sourceMappingURL=getCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getCommand.js","sourceRoot":"","sources":["../../src/commands/getCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GAIvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAErE,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AACzE,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAU,CAAC;AACpD,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,cAAc,CAAU,CAAC;AAEzD,MAAM,UAAU,UAAU,CACxB,OAAgB,EAChB,0BAAsD;IAEtD,OAAO;SACJ,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,6DAA6D,CAAC;SAC1E,QAAQ,CAAC,WAAW,EAAE,uBAAuB,CAAC;SAC9C,QAAQ,CAAC,WAAW,EAAE,yCAAyC,CAAC;SAChE,QAAQ,CAAC,MAAM,EAAE,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,CAAC,CAAC,CAAC;QACjB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,16 +0,0 @@
1
- import { Command } from 'commander';
2
- /**
3
- * Map of provider names to their expected API key environment variable names.
4
- * vertexai uses gcloud auth and does not require an API key env var.
5
- */
6
- export declare const providerApiKeyMap: Record<string, string | null>;
7
- /**
8
- * Detects which providers have API keys set in the environment.
9
- * Returns list of provider names with available keys.
10
- */
11
- export declare function detectAvailableProviders(): string[];
12
- /**
13
- * Adds the init command to the program
14
- * @param program - The commander program
15
- */
16
- export declare function initCommand(program: Command): void;