gaunt-sloth-assistant 0.6.2 → 0.6.4

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/README.md CHANGED
@@ -1,15 +1,37 @@
1
1
  # Gaunt Sloth Assistant
2
2
  [![Tests and Lint](https://github.com/andruhon/gaunt-sloth-assistant/actions/workflows/ci.yml/badge.svg?event=push)](https://github.com/andruhon/gaunt-sloth-assistant/actions/workflows/ci.yml)
3
3
 
4
- Gaunt GSloth Assistant is a lightweight **command line AI assistant** for software developers
5
- designed to enhance code review quality while reducing cognitive load and time investment on **code reviews**
6
- and pull request diff analysis.
4
+ Gaunt GSloth Assistant is a lightweight **command line AI assistant**
5
+ built with TypeScript (JavaScript) and distributed via NPM with minimum dependencies.
7
6
 
8
7
  ![GSloth Banner](assets/gaunt-sloth-logo.png)
9
8
 
10
- Based on [Langchain.js](https://github.com/langchain-ai/langchainjs)
9
+ Based on [LangChain.js](https://github.com/langchain-ai/langchainjs)
10
+
11
+ ## Why?
12
+
13
+ There are many Open Source command line AI assistants available, such as Aider and Goose;
14
+ there are great non-open source options such as Claude Code.
15
+
16
+ Gaunt Sloth does not intend to be your "Daily Driver" and is not aiming to replace your Cursor.
17
+ What it promises is that it is small, extendable, cross-platform and can itself be a dependency in your project.
18
+
19
+ The GSloth was initially built as a code review tool, fetching PR contents and Jira contents before feeding them to
20
+ the LLM, but we ourselves found many more use cases which we initially did not anticipate; for example,
21
+ we may have it as a dependency in an MCP project, allowing us to quickly spin it up to simulate or test some use cases.
22
+
23
+ The promise of Gaunt Sloth:
24
+
25
+ - **Minimum dependencies**. Ideally, we aim to only have CommanderJS and some packages from LangChainJS and LangGraphJS.
26
+ - **Extensibility**. Feel free to write some JS and create your Tool, Provider or connect to the MCP server of your choice.
27
+ - **No vendor lock-in**. Just BYO API keys.
28
+ - **Easy installation via NPM**.
29
+ - **All prompts are editable** via markdown files.
30
+ - **No UI**. Command Line only, with intent to be used as a dependency, potentially in your build pipeline.
31
+ Of course, you can use Gaunt Sloth as a dependency and hook your own UI.
11
32
 
12
33
  ## What GSloth does:
34
+
13
35
  - Reviews code;
14
36
  - Suggests bug fixes;
15
37
  - Explains provided code
@@ -19,28 +41,18 @@ Based on [Langchain.js](https://github.com/langchain-ai/langchainjs)
19
41
  - Fetches descriptions (requirements) from Github issue or Jira (`gsloth pr 42 12`);;
20
42
  - Answers questions about provided code;
21
43
  - Writes code;
44
+ - Connects to MCP server;
22
45
  - Saves all responses in .md file in the project directory;
23
46
  - Anything else you need, when combined with other command line tools.
24
47
 
25
- ## Why?
26
-
27
- While there are many powerful AI assistants available, Gaunt Sloth Assistant stands out by providing developers with:
28
-
29
- 1. **Provider flexibility** - Freedom to choose and switch between different AI providers (Google Vertex AI, Anthropic, Groq) based on your specific requirements, performance needs, or compliance policies
30
- 2. **Open-source transparency** - Complete visibility into how your code and data are processed, with no vendor lock-in
31
- 3. **Command-line integration** - Seamless workflow integration with existing developer tools and processes
32
- 4. **Specialized focus** - Purpose-built for code review and PR analysis rather than general-purpose assistance
33
- 5. **Extensibility** - GSloth is based on LangChain JS and can be easily extended, configured or augmented in different ways.
34
- 6. **Model Context Protocol (MCP)** - Support for MCP allows for enhanced context management.
35
- 7. **Cost Effectiveness** - When agentic tools will send a number of requests to figure out a user's intent burning thousands of tokens, gsloth simply sends your diff prefixed with guidelines for review.
36
-
37
- Unlike proprietary solutions that restrict you to a single AI provider, Gaunt Sloth empowers developers with choice and control while maintaining the specialized capabilities needed for effective code review.
38
-
39
48
  ### To make GSloth work, you need an **API key** from some AI provider, such as:
49
+
40
50
  - Google Vertex AI;
41
51
  - Anthropic;
42
52
  - Groq.
43
53
 
54
+ `*` Any other provider supported by LangChain.JS should also work with [JS config](./docs/CONFIGURATION.md#JavaScript-Configuration).
55
+
44
56
  ## Commands Overview
45
57
 
46
58
  `gth` and `gsloth` commands are used interchangeably, both `gsloth pr 42` and `gth pr 42` do the same thing.
@@ -0,0 +1,4 @@
1
+ # v0.6.4
2
+
3
+ - Remove unnecessary `uuid` package dependency in favour of core Node.js functionality.
4
+ - Updated project proposition and identity to make it clear what Gaunt Sloth is and what it is not.
@@ -1,6 +1,6 @@
1
1
  import { initConfig } from '#src/config.js';
2
2
  import { defaultStatusCallbacks, display } from '#src/consoleUtils.js';
3
- import { v4 as uuidv4 } from 'uuid';
3
+ import * as crypto from 'crypto';
4
4
  import chalk from 'chalk';
5
5
  import { MemorySaver } from '@langchain/langgraph';
6
6
  import { HumanMessage, SystemMessage } from '@langchain/core/messages';
@@ -19,7 +19,7 @@ export async function createInteractiveSession(sessionConfig, message) {
19
19
  const rl = createInterface({ input, output });
20
20
  let isFirstMessage = true;
21
21
  let shouldExit = false;
22
- const thread_id = uuidv4();
22
+ const thread_id = crypto.randomUUID();
23
23
  const logFileName = getGslothFilePath(generateStandardFileName(sessionConfig.mode.toUpperCase()));
24
24
  display(chalk.gray(`${sessionConfig.mode} session will be logged to ${logFileName}\n`));
25
25
  const processMessage = async (userInput) => {
@@ -1 +1 @@
1
- {"version":3,"file":"interactiveSessionModule.js","sourceRoot":"","sources":["../../src/modules/interactiveSessionModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAoB,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EACL,eAAe,EACf,KAAK,EACL,IAAI,EACJ,KAAK,IAAI,KAAK,EACd,MAAM,IAAI,MAAM,GACjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO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AAC;oBAC3B,OAAO;gBACT,CAAC;gBACD,MAAM,cAAc,CAAC,SAAS,CAAC,CAAC;gBAChC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;gBAC/C,IAAI,CAAC,UAAU;oBAAE,WAAW,EAAE,CAAC;YACjC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;YACpC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;QACjD,CAAC;QACD,IAAI,CAAC,UAAU;YAAE,WAAW,EAAE,CAAC;IACjC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC;QAC3B,KAAK,CAAC,YAAY,aAAa,CAAC,IAAI,aAAa,GAAG,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,CAAC,CAAC,CAAC;IACV,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"interactiveSessionModule.js","sourceRoot":"","sources":["../../src/modules/interactiveSessionModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAoB,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EACL,eAAe,EACf,KAAK,EACL,IAAI,EACJ,KAAK,IAAI,KAAK,EACd,MAAM,IAAI,MAAM,G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vC,EAAE,CAAC,KAAK,EAAE,CAAC;oBACX,UAAU,GAAG,IAAI,CAAC;oBAClB,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC;oBAC3B,OAAO;gBACT,CAAC;gBACD,MAAM,cAAc,CAAC,SAAS,CAAC,CAAC;gBAChC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;gBAC/C,IAAI,CAAC,UAAU;oBAAE,WAAW,EAAE,CAAC;YACjC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;YACpC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;QACjD,CAAC;QACD,IAAI,CAAC,UAAU;YAAE,WAAW,EAAE,CAAC;IACjC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC;QAC3B,KAAK,CAAC,YAAY,aAAa,CAAC,IAAI,aAAa,GAAG,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,CAAC,CAAC,CAAC;IACV,CAAC;AACH,CAAC"}
@@ -139,7 +139,9 @@ JSON configuration is simpler but less flexible than JavaScript configuration. I
139
139
  }
140
140
  ```
141
141
 
142
- ### JavaScript Configuration (.gsloth.config.js or .gsloth.config.mjs)
142
+ ### JavaScript Configuration
143
+
144
+ (.gsloth.config.js or .gsloth.config.mjs)
143
145
 
144
146
  **Example of .gsloth.config.js for Anthropic**
145
147
  ```javascript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaunt-sloth-assistant",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": "Andrew Kondratev",
@@ -34,8 +34,7 @@
34
34
  "@langchain/mcp-adapters": "^0.5.2",
35
35
  "@modelcontextprotocol/server-filesystem": "^2025.3.28",
36
36
  "chalk": "^5.4.1",
37
- "commander": "^14.0.0",
38
- "uuid": "^11.1.0"
37
+ "commander": "^14.0.0"
39
38
  },
40
39
  "devDependencies": {
41
40
  "@eslint/js": "^9.26.0",
@@ -47,7 +46,7 @@
47
46
  "eslint-config-prettier": "^10.1.5",
48
47
  "eslint-plugin-prettier": "^5.4.1",
49
48
  "globals": "^16.2.0",
50
- "prettier": "3.5.3",
49
+ "prettier": "3.6.0",
51
50
  "typescript": "^5.8.3",
52
51
  "vitest": "^3.2.3"
53
52
  },
@@ -1,6 +1,6 @@
1
1
  import { initConfig } from '#src/config.js';
2
2
  import { defaultStatusCallbacks, display } from '#src/consoleUtils.js';
3
- import { v4 as uuidv4 } from 'uuid';
3
+ import * as crypto from 'crypto';
4
4
  import chalk from 'chalk';
5
5
  import { MemorySaver } from '@langchain/langgraph';
6
6
  import { type BaseMessage, HumanMessage, SystemMessage } from '@langchain/core/messages';
@@ -36,7 +36,7 @@ export async function createInteractiveSession(sessionConfig: SessionConfig, mes
36
36
  const rl = createInterface({ input, output });
37
37
  let isFirstMessage = true;
38
38
  let shouldExit = false;
39
- const thread_id = uuidv4();
39
+ const thread_id = crypto.randomUUID();
40
40
  const logFileName = getGslothFilePath(
41
41
  generateStandardFileName(sessionConfig.mode.toUpperCase())
42
42
  );
@@ -1,46 +0,0 @@
1
- # Refactor to facilitate imports
2
-
3
- We need to conduct refactoring, so we can use parts of Gaunt Sloth from other projects.
4
-
5
- The gaunt sloth project is pretty small, so there's probably no reason to split it into packages with workspaces, so we just want to make the code structure more meaningful and easier to reuse.
6
-
7
- ## Commands
8
-
9
- in `commands` (dir already exists)
10
-
11
- These are commander commands, their behaviour should remain unchanged
12
-
13
- - askCommand.ts - questionAnsweringModule
14
- - chatCommand.ts - chatModule
15
- - codeCommand.ts - chatModule
16
- - initCommand.ts - (keep this unchanged)
17
- - prCommand.ts - reviewModule
18
- - reviewCommand.ts - reviewModule
19
-
20
- ## Modules
21
-
22
- in `modules` (dir already exists)
23
-
24
- These are modules which can do I/O operations such as reading configurations, prompts from filesystem.
25
-
26
- - questionAnsweringModule
27
- - reviewModule
28
- - chatModule
29
-
30
- ## Core functions
31
-
32
- Core functions should not deal with I/O and configurations themselves, but should rather accept values via arguments, consume values from provided supplier functions, set values to consumers and return values, with favour of plain arguments and returns.
33
-
34
- in `core` (new dir)
35
-
36
- - answer
37
- - review
38
- - chat
39
-
40
- ## Plan
41
- - Read .gsloth.guidelines.md
42
- - Implement changes
43
- - Read "Testing" section of .gsloth.guidelines.md
44
- - Update tests
45
- - lint
46
- - Iterate with tests and lint
@@ -1,26 +0,0 @@
1
- # Invocation class
2
-
3
- We need to refactor invocation, but let's keep `invoke` of `src/llmUtils.ts` unchanged.
4
-
5
- ## Invocation class
6
- We need to create the `Invocation` class in src/core, all the llmUtils code should end up there.
7
-
8
- ### No direct I/O in Invocation class4
9
- Class constructor should take callback `statusUpdate` with two parameters, level and message,
10
- this callback will call all these `display`, `displayWarning`, etc.
11
- The callback should have special level to replace `stdout.write(chunk.content as string, 'utf-8');`
12
-
13
- ### invoke method
14
- The class should have the `invoke` method, which should do core invocation but should not
15
- create agent or close mcpClient.
16
-
17
- ## Plan
18
- - Read .gsloth.guidelines.md
19
- - Implement change
20
- - Read the "Testing" section of .gsloth.guidelines.md
21
- - run tests and update them if necessary
22
- - run and fix lint
23
-
24
-
25
-
26
-