gaunt-sloth-assistant 0.0.3 → 0.0.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.
Files changed (2) hide show
  1. package/README.md +65 -13
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -2,42 +2,92 @@
2
2
  Simplistic assistant helping to do code reviews from command line based on [Langchain.js](https://github.com/langchain-ai/langchainjs)
3
3
 
4
4
  ## Review PR
5
- `gsloth pr 42` - review PR by PR number.
5
+ Review PR by PR number:
6
+ ```shell
7
+ gsloth pr 42
8
+ ```
6
9
  Official [GitHub cli (gh)](https://cli.github.com/) should be installed
7
10
  and authenticated to have access to your project.
8
11
 
9
- `gsloth pr 42 -f PROJ-1234.md` - Review providing MD file with requirements and notes.
12
+ Review providing markdown file with requirements and notes.
13
+ ```shell
14
+ gsloth pr 42 -f PROJ-1234.md
15
+ ```
10
16
  Jira integration is in [ROADMAP](ROADMAP.md).
11
17
  Currently, the easiest ***meaningful*** way to add jira description is to
12
18
  open Jira XML with "Export XML" in jira and to copy `<description></description>` block.
13
19
  This block contains HTML and AI understands it easily
14
20
  (most importantly it understand nested lists like ul>li).
15
21
 
16
- ## Review Diff
17
- `git --no-pager diff origin/master...ffd079c134eabf18d85975f155b76d62a895cdec | gsloth review`
18
- (May be helpful to review subset of PR)
22
+ ## Review any Diff
23
+ ```shell
24
+ git --no-pager diff origin/master...yourgitcommithash | gsloth review
25
+ ```
26
+ (helpful to review a subset of PR)
27
+
28
+ Review current local changes:
29
+ ```shell
30
+ git --no-pager diff | gsloth review
31
+ ```
19
32
 
20
33
  ## Question Answering
21
- `gsloth ask "which types of primitives are available in JavaScript?"`
34
+ ```shell
35
+ gsloth ask "which types of primitives are available in JavaScript?"
36
+ ```
22
37
 
23
- `gsloth ask "Please have a look at this file" -f index.js`
38
+ ```shell
39
+ gsloth ask "Please have a look at this file" -f index.js
40
+ ```
24
41
 
25
42
  ## Installation
26
- There's no npm module yet. Do `npm install -g ./` to install local build globally to your machine.
43
+
44
+ Tested with Node 22 LTS.
45
+
46
+ ## NPM
47
+ ```shell
48
+ npm install gaunt-sloth-assistant -g
27
49
  ```
50
+
51
+ ## GitHub (master)
52
+
53
+ ```shell
28
54
  git clone https://github.com/andruhon/gaunt-sloth.git
29
55
  npm install
30
56
  npm install -g ./
31
57
  ```
32
58
 
33
59
  ## Configuration
34
- There is no global configuration yet. The project you want to get reviewed needs gsloth configuration.
60
+ Go to your project directory and init sloth with vendor of your choice.
35
61
 
36
- Add `.gsloth.preamble.review.md` to your project.
37
- Add general description of what your project is and what do you expect from this code review.
62
+ ### Google Vertex AI
63
+ ```shell
64
+ cd ./your-project
65
+ gsloth init vertexai
66
+ gcloud auth login
67
+ gcloud auth application-default login
68
+ ```
69
+
70
+ ### Anthropic
71
+ ```shell
72
+ cd ./your-project
73
+ gsloth init anthropic
74
+ ```
75
+ Make sure you edit `.gsloth.config.js` and set up your key.
76
+
77
+ ### Further configuration
78
+
79
+ Currently only vertexai and anthropic can be configured with `gsloth init`.
80
+
81
+ Populate `.gsloth.preamble.review.md` with your project details and quality requirements.
82
+ Proper preamble is a paramount for good inference.
38
83
  Check [.gsloth.preamble.review.md](.gsloth.preamble.review.md) for example.
39
84
 
40
- Add `.gsloth.config.js,` to your project.
85
+ ### Manual configuration.
86
+ Your project should have the following files in order for gsloth to function:
87
+ - `.gsloth.config.js`
88
+ - `.gsloth.preamble.review.md`
89
+
90
+ Global configuration to invoke gsloth anywhere is in [ROADMAP](ROADMAP.md).
41
91
 
42
92
  **Example of .gsloth.config.js for Anthropic**
43
93
  ```javascript
@@ -53,7 +103,6 @@ export async function configure(importFunction, global) {
53
103
  })
54
104
  };
55
105
  }
56
-
57
106
  ```
58
107
 
59
108
  **Example of .gsloth.config.js for VertexAI**
@@ -78,6 +127,9 @@ export async function configure(importFunction, global) {
78
127
  }
79
128
  ```
80
129
 
130
+ The configure function should simply return instance of langchain [chat model](https://v03.api.js.langchain.com/classes/_langchain_core.language_models_chat_models.BaseChatModel.html).
131
+ See [Langchain documentation](https://js.langchain.com/docs/tutorials/llm_chain/) for more details.
132
+
81
133
  ## License
82
134
  License is [MIT](https://opensource.org/license/mit). See [LICENSE](LICENSE)
83
135
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaunt-sloth-assistant",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": "Andrew Kondratev",
@@ -18,7 +18,7 @@
18
18
  "@langchain/anthropic": "^0.3.17",
19
19
  "@langchain/core": "^0.3.43",
20
20
  "@langchain/google-vertexai": "^0.2.3",
21
- "@langchain/langgraph": "^0.2.62",
21
+ "@langchain/langgraph": "^0.2.64",
22
22
  "@types/node": "^22.14.1",
23
23
  "chalk": "^5.4.1",
24
24
  "commander": "^13.1.0",