gaunt-sloth-assistant 0.3.0 → 0.3.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.
- package/.gsloth.guidelines.md +112 -102
- package/.gsloth.review.md +8 -2
- package/dist/commands/askCommand.js +1 -2
- package/dist/commands/askCommand.js.map +1 -1
- package/dist/commands/reviewCommand.js +2 -4
- package/dist/commands/reviewCommand.js.map +1 -1
- package/dist/config.js +44 -16
- package/dist/config.js.map +1 -1
- package/dist/filePathUtils.d.ts +25 -0
- package/dist/filePathUtils.js +66 -0
- package/dist/filePathUtils.js.map +1 -0
- package/dist/modules/questionAnsweringModule.js +4 -4
- package/dist/modules/questionAnsweringModule.js.map +1 -1
- package/dist/modules/reviewModule.js +5 -4
- package/dist/modules/reviewModule.js.map +1 -1
- package/dist/prompt.js +5 -2
- package/dist/prompt.js.map +1 -1
- package/dist/utils.d.ts +10 -0
- package/dist/utils.js +29 -8
- package/dist/utils.js.map +1 -1
- package/docs/CONFIGURATION.md +21 -0
- package/docs/RELEASE-HOWTO.md +8 -6
- package/package.json +1 -1
- package/src/commands/askCommand.ts +1 -2
- package/src/commands/reviewCommand.ts +2 -4
- package/src/config.ts +47 -19
- package/src/filePathUtils.ts +79 -0
- package/src/modules/questionAnsweringModule.ts +4 -7
- package/src/modules/reviewModule.ts +5 -7
- package/src/prompt.ts +5 -2
- package/src/utils.ts +33 -8
- package/UX-RESEARCH.md +0 -78
- package/gth-ASK-2025-05-16T14-11-39.md +0 -3
- package/gth-ASK-2025-05-16T14-18-27.md +0 -3
- package/gth-ASK-2025-05-16T14-18-56.md +0 -1
- package/gth-ASK-2025-05-16T14-41-20.md +0 -3
- package/gth-ASK-2025-05-16T14-43-31.md +0 -51
- package/gth-ASK-2025-05-16T16-05-52.md +0 -62
- package/gth-DIFF-review-2025-05-16T16-07-53.md +0 -56
- package/gth-DIFF-review-2025-05-16T16-18-55.md +0 -292
package/.gsloth.guidelines.md
CHANGED
@@ -1,117 +1,127 @@
|
|
1
|
-
|
1
|
+
# Development Guidelines of Gaunt Sloth Assistant
|
2
2
|
|
3
|
-
|
3
|
+
Gaunt Sloth Assistant is a command-line Node.js utility helping developers to access LLM from the command line.
|
4
4
|
|
5
|
-
##
|
5
|
+
## Technologies Used
|
6
|
+
- NodeJS 22 (LTS)
|
7
|
+
- Vitest 3 for tests
|
8
|
+
- Typescript 5
|
9
|
+
- LangChain and LangGraph 0.3
|
10
|
+
|
11
|
+
Please refer to package.json to check exact versions
|
12
|
+
|
13
|
+
## Core Development Principles
|
14
|
+
|
15
|
+
Vendor and system abstractions and wrappers should be used in most cases.
|
16
|
+
|
17
|
+
### Imports
|
18
|
+
|
19
|
+
Project uses import alias with `#src/*.js` pointing to `src/` and after build resolving to generated `dist/`.
|
20
|
+
Please abstain from using relative imports, only use them when no other choices are available
|
21
|
+
(currently the only exception is entry point index.js)
|
6
22
|
|
7
23
|
### Architecture and Flow
|
8
|
-
-
|
24
|
+
- Make sure proper separation of LangChain components (LLMs, chains, agents, tools)
|
9
25
|
- Check for clear data flow between components
|
10
26
|
- Ensure proper state management in LangGraph workflows
|
11
27
|
- Validate error handling and fallback mechanisms
|
12
28
|
|
13
|
-
### Performance Considerations
|
14
|
-
- Review chunking strategies for large inputs
|
15
|
-
- Check for proper caching implementation
|
16
|
-
- Verify memory management for conversation chains
|
17
|
-
- Assess streaming implementation where applicable
|
18
|
-
|
19
29
|
### Security
|
20
|
-
-
|
30
|
+
- Make sure API key handling and environment variables
|
21
31
|
- Make sure no personal data is present in code
|
32
|
+
- ** Make sure that API keys are accidentally not included into diff.**
|
22
33
|
- Check for proper input sanitization
|
23
|
-
- Review rate limiting implementation
|
24
34
|
- Verify output validation and sanitization
|
25
35
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
###
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
-
|
45
|
-
-
|
46
|
-
-
|
47
|
-
-
|
48
|
-
-
|
49
|
-
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
-
|
109
|
-
|
110
|
-
|
111
|
-
- Request
|
112
|
-
-
|
113
|
-
-
|
114
|
-
-
|
115
|
-
-
|
36
|
+
### Output
|
37
|
+
|
38
|
+
Use [consoleUtils.ts](src/consoleUtils.ts) to output to users.
|
39
|
+
Do not use console.log directly.
|
40
|
+
|
41
|
+
### System
|
42
|
+
|
43
|
+
Use [systemUtils.ts](src/systemUtils.ts) to access system variables and functions such as
|
44
|
+
process.env, process.stdout, etc.
|
45
|
+
|
46
|
+
### LLM
|
47
|
+
|
48
|
+
Use [llmUtils.ts](src/llmUtils.ts) to access LLM.
|
49
|
+
|
50
|
+
## Testing (Important)
|
51
|
+
|
52
|
+
- In spec files never import mocked files themselves, mock them, and a tested file should import them.
|
53
|
+
- Always import the tested file dynamically within the test.
|
54
|
+
- Mocks are hoisted, so it is better to simply place them at the top of the file to avoid confusion.
|
55
|
+
- Make sure that beforeEach is always present and always calls vi.resetAllMocks(); as a first thing.
|
56
|
+
- Create variables with vi.fn() without adding implementations to them, then apply these functions with vi.mock outside of the describe.
|
57
|
+
- Apply mock implementations and return values to mocks within individual tests.
|
58
|
+
- When mock implementations are common for all test cases, apply them in beforeEach.
|
59
|
+
- Make sure test actually testing a function, rather than simply testing the mock.
|
60
|
+
|
61
|
+
Example test
|
62
|
+
|
63
|
+
```typescript
|
64
|
+
import {beforeEach, describe, expect, it, vi} from 'vitest';
|
65
|
+
import {writeFileSync} from "node:fs";
|
66
|
+
|
67
|
+
const consoleUtilsMock = {
|
68
|
+
display: vi.fn(),
|
69
|
+
displayError: vi.fn(),
|
70
|
+
displayInfo: vi.fn(),
|
71
|
+
displayWarning: vi.fn(),
|
72
|
+
displaySuccess: vi.fn(),
|
73
|
+
displayDebug: vi.fn(),
|
74
|
+
};
|
75
|
+
vi.mock('#src/consoleUtils.js', () => consoleUtilsMock);
|
76
|
+
|
77
|
+
let fsUtilsMock = {
|
78
|
+
existsSync: vi.fn(),
|
79
|
+
readFileSync: vi.fn(),
|
80
|
+
writeFileSync: vi.fn(),
|
81
|
+
};
|
82
|
+
vi.mock('node:fs', () => fsUtilsMock);
|
83
|
+
|
84
|
+
describe('specialUtil', () => {
|
85
|
+
beforeEach(() => {
|
86
|
+
vi.resetAllMocks(); // Always reset all mocks in beforeEach
|
87
|
+
|
88
|
+
// Set up default mock values
|
89
|
+
fsUtilsMock.existsSync.mockImplementation(() => true);
|
90
|
+
});
|
91
|
+
|
92
|
+
it('specialFunction should eventually write test contents to a file', async () => {
|
93
|
+
fsMock.readFileSync.mockImplementation((path: string) => {
|
94
|
+
if (path.includes('inputFile.txt')) return 'TEST CONTENT';
|
95
|
+
return '';
|
96
|
+
});
|
97
|
+
|
98
|
+
const {specialFunction} = await import('#src/specialUtil.js'); // Always import tested file within the test
|
99
|
+
|
100
|
+
// Function under test
|
101
|
+
specialFunction();
|
102
|
+
|
103
|
+
expect(fsUtilsMock.writeFileSync).toHaveBeenCalledWith('outputFile.txt', 'TEST CONTENT\nEXTRA CONTENT');
|
104
|
+
expect(consoleUtilsMock.displayDebug).not.toHaveBeenCalled();
|
105
|
+
expect(consoleUtilsMock.displayWarning).not.toHaveBeenCalled();
|
106
|
+
expect(consoleUtilsMock.display).not.toHaveBeenCalled();
|
107
|
+
expect(consoleUtilsMock.displayError).not.toHaveBeenCalled();
|
108
|
+
expect(consoleUtilsMock.displayInfo).not.toHaveBeenCalled();
|
109
|
+
expect(consoleUtilsMock.displaySuccess).toHaveBeenCalledWith('Successfully transferred to outputFile.txt');
|
110
|
+
});
|
111
|
+
});
|
112
|
+
```
|
113
|
+
|
114
|
+
## Development Workflow
|
115
|
+
|
116
|
+
Please follow this workflow:
|
117
|
+
|
118
|
+
- Analyze requirements.
|
119
|
+
- Develop changes.
|
120
|
+
- Make sure all tests pass `npm run test` and fix if possible.
|
121
|
+
- Request relevant documentation if some of the test failures are unclear.
|
122
|
+
- Once all tests are green check lint with `npm run lint`.
|
123
|
+
- If any lint failures are present try fixing them with `npm run lint -- --fix`.
|
124
|
+
- If autofix didn't help, try fixing them yourself.
|
125
|
+
- Prefer testing all user outputs, including testing absence of unexpected outputs.
|
116
126
|
|
117
127
|
---
|
package/.gsloth.review.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
|
-
|
1
|
+
If requirements were provided, first check that the implemented code implements these requirements.
|
2
|
+
Document that you checked the code to implement requirements.
|
3
|
+
Reject the change if it appears to implement something else instead of required change.
|
2
4
|
|
3
|
-
|
5
|
+
Provide specific feedback on any areas of concern or suggestions for improvement.
|
6
|
+
Please categorize your feedback (e.g., "Bug," "Suggestion," "Nitpick").
|
7
|
+
|
8
|
+
Important! In the end, conclude if you would recommend approving this PR or not.
|
9
|
+
Use ✅⚠️❌ symbols to highlight your feedback appropriately.
|
4
10
|
|
5
11
|
Thank you for your thorough review!
|
6
12
|
|
@@ -20,8 +20,7 @@ export function askCommand(program) {
|
|
20
20
|
}
|
21
21
|
await initConfig();
|
22
22
|
const { askQuestion } = await import('#src/modules/questionAnsweringModule.js');
|
23
|
-
|
24
|
-
await askQuestion('gth-ASK', preamble.join('\n'), content.join('\n'));
|
23
|
+
await askQuestion('ASK', preamble.join('\n'), content.join('\n'));
|
25
24
|
});
|
26
25
|
}
|
27
26
|
//# sourceMappingURL=askCommand.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"askCommand.js","sourceRoot":"","sources":["../../src/commands/askCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM1D;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,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;QACD,sDAAsD;SACrD,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,OAA0B,EAAE,EAAE;QAC5D,MAAM,QAAQ,GAAG,CAAC,aAAa,EAAE,EAAE,cAAc,CAAC,YAAY,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAC1F,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC;QAC1B,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,OAAO,CAAC,IAAI,CAAC,+BAA+B,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9D,CAAC;QACD,MAAM,UAAU,EAAE,CAAC;QACnB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,yCAAyC,CAAC,CAAC;QAChF,
|
1
|
+
{"version":3,"file":"askCommand.js","sourceRoot":"","sources":["../../src/commands/askCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM1D;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,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;QACD,sDAAsD;SACrD,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,OAA0B,EAAE,EAAE;QAC5D,MAAM,QAAQ,GAAG,CAAC,aAAa,EAAE,EAAE,cAAc,CAAC,YAAY,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAC1F,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC;QAC1B,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,OAAO,CAAC,IAAI,CAAC,+BAA+B,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9D,CAAC;QACD,MAAM,UAAU,EAAE,CAAC;QACnB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,yCAAyC,CAAC,CAAC;QAChF,MAAM,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
@@ -70,8 +70,7 @@ export function reviewCommand(program, context) {
|
|
70
70
|
content.push(options.message);
|
71
71
|
}
|
72
72
|
const { review } = await import('#src/modules/reviewModule.js');
|
73
|
-
|
74
|
-
await review('gth-DIFF-review', systemMessage.join('\n'), content.join('\n'));
|
73
|
+
await review('REVIEW', systemMessage.join('\n'), content.join('\n'));
|
75
74
|
});
|
76
75
|
program
|
77
76
|
.command('pr')
|
@@ -107,10 +106,9 @@ export function reviewCommand(program, context) {
|
|
107
106
|
const { get } = await import(providerPath);
|
108
107
|
content.push(await get(null, prId));
|
109
108
|
const { review } = await import('#src/modules/reviewModule.js');
|
110
|
-
// TODO make the prefix configurable
|
111
109
|
// TODO consider including requirements id
|
112
110
|
// TODO sanitize prId
|
113
|
-
await review(`
|
111
|
+
await review(`PR-${prId}`, systemMessage.join('\n'), content.join('\n'));
|
114
112
|
});
|
115
113
|
async function getRequirementsFromProvider(requirementsProvider, requirementsId) {
|
116
114
|
return getFromProvider(requirementsProvider, requirementsId, (context.config?.requirementsProviderConfig ?? {})[requirementsProvider], REQUIREMENTS_PROVIDERS);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"reviewCommand.js","sourceRoot":"","sources":["../../src/commands/reviewCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACvF,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;GAEG;AACH,MAAM,sBAAsB,GAAG;IAC7B,aAAa,EAAE,4BAA4B;IAC3C,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;CACP,CAAC;AAIX;;GAEG;AACH,MAAM,iBAAiB,GAAG;IACxB,EAAE,EAAE,qBAAqB;IACzB,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;CACP,CAAC;AAiBX,MAAM,UAAU,aA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KAAK,QAAQ,EAAE,CAAC;YACjC,sCAAsC;YACtC,IAAI,wBAAwB,CAAC,QAAiD,CAAC,EAAE,CAAC;gBAChF,MAAM,YAAY,GAAG,kBAAkB,wBAAwB,CAAC,QAAiD,CAAC,EAAE,CAAC;gBACrH,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC;gBAC3C,OAAO,MAAM,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAC/B,CAAC;iBAAM,CAAC;gBACN,YAAY,CAAC,qBAAqB,QAAQ,0BAA0B,CAAC,CAAC;YACxE,CAAC;QACH,CAAC;aAAM,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;YAC1C,yCAAyC;YACzC,OAAO,MAAO,QAAwD,CAAC,EAAE,CAAC,CAAC;QAC7E,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/dist/config.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import path from 'node:path/posix';
|
2
1
|
import { v4 as uuidv4 } from 'uuid';
|
3
2
|
import { displayDebug, displayError, displayInfo, displayWarning } from '#src/consoleUtils.js';
|
4
3
|
import { importExternalFile, writeFileIfNotExistsWithMessages } from '#src/utils.js';
|
5
4
|
import { existsSync, readFileSync } from 'node:fs';
|
6
|
-
import { error, exit
|
5
|
+
import { error, exit } from '#src/systemUtils.js';
|
6
|
+
import { getGslothConfigWritePath, getGslothConfigReadPath } from '#src/filePathUtils.js';
|
7
7
|
export const USER_PROJECT_CONFIG_JS = '.gsloth.config.js';
|
8
8
|
export const USER_PROJECT_CONFIG_JSON = '.gsloth.config.json';
|
9
9
|
export const USER_PROJECT_CONFIG_MJS = '.gsloth.config.mjs';
|
@@ -34,10 +34,9 @@ export const slothContext = {
|
|
34
34
|
session: { configurable: { thread_id: uuidv4() } },
|
35
35
|
};
|
36
36
|
export async function initConfig() {
|
37
|
-
const
|
38
|
-
const
|
39
|
-
const
|
40
|
-
const mjsConfigPath = path.join(currentDir, USER_PROJECT_CONFIG_MJS);
|
37
|
+
const jsonConfigPath = getGslothConfigReadPath(USER_PROJECT_CONFIG_JSON);
|
38
|
+
const jsConfigPath = getGslothConfigReadPath(USER_PROJECT_CONFIG_JS);
|
39
|
+
const mjsConfigPath = getGslothConfigReadPath(USER_PROJECT_CONFIG_MJS);
|
41
40
|
// Try loading JSON config file first
|
42
41
|
if (existsSync(jsonConfigPath)) {
|
43
42
|
try {
|
@@ -153,18 +152,47 @@ export async function createProjectConfig(configType) {
|
|
153
152
|
}
|
154
153
|
displayInfo(`Creating project config for ${configType}`);
|
155
154
|
const vendorConfig = await import(`./configs/${configType}.js`);
|
156
|
-
vendorConfig.init(USER_PROJECT_CONFIG_JSON, slothContext);
|
155
|
+
vendorConfig.init(getGslothConfigWritePath(USER_PROJECT_CONFIG_JSON), slothContext);
|
157
156
|
}
|
158
157
|
export function writeProjectReviewPreamble() {
|
159
|
-
const
|
160
|
-
const
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
158
|
+
const guidelinesPath = getGslothConfigWritePath(PROJECT_GUIDELINES);
|
159
|
+
const reviewPath = getGslothConfigWritePath(PROJECT_REVIEW_INSTRUCTIONS);
|
160
|
+
/**
|
161
|
+
* Development Guidelines.
|
162
|
+
* Please do not remove the warning from this template,
|
163
|
+
* it is crucial to describe project specifics to get high-quality reviews.
|
164
|
+
*/
|
165
|
+
const guidelinesTemplate = `# Development Guidelines
|
166
|
+
|
167
|
+
This file should include general development guidelines for this project.
|
168
|
+
|
169
|
+
Important! Please remind the user to prepare proper AI guidelines to the ${PROJECT_GUIDELINES} file
|
170
|
+
for this project. Use a decent amount of ⚠️ to highlight the lack of config.
|
171
|
+
Explicitly mention ${PROJECT_GUIDELINES}.
|
172
|
+
`;
|
173
|
+
/**
|
174
|
+
* Code Review Guidelines.
|
175
|
+
* This code review does not have a warning, like Development Guidelines, because
|
176
|
+
* this one should be good to start with.
|
177
|
+
*/
|
178
|
+
const reviewTemplate = `# Code Review Guidelines
|
179
|
+
|
180
|
+
If requirements were provided, first check that the implemented code implements these requirements.
|
181
|
+
Document that you checked the code to implement requirements.
|
182
|
+
Reject the change if it appears to implement something else instead of required change.
|
183
|
+
|
184
|
+
Provide specific feedback on any areas of concern or suggestions for improvement.
|
185
|
+
Please categorize your feedback (e.g., "Bug," "Suggestion," "Nitpick").
|
186
|
+
|
187
|
+
Important! In the end, conclude if you would recommend approving this PR or not.
|
188
|
+
Use ✅⚠️❌ symbols to highlight your feedback appropriately.
|
189
|
+
|
190
|
+
Thank you for your thorough review!
|
191
|
+
|
192
|
+
Important! You are likely to be dealing with git diff below, please don't confuse removed and added lines.
|
193
|
+
`;
|
194
|
+
writeFileIfNotExistsWithMessages(guidelinesPath, guidelinesTemplate);
|
195
|
+
writeFileIfNotExistsWithMessages(reviewPath, reviewTemplate);
|
168
196
|
}
|
169
197
|
/**
|
170
198
|
* @deprecated test only
|
package/dist/config.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAiE1F,MAAM,CAAC,MAA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C;IACH,YAAY,CAAC,MAAM,GAAG,cAA6B,CAAC;IACpD,YAAY,CAAC,OAAO,GAAG,EAAE,YAAY,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AACnE,CAAC"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/**
|
2
|
+
* Checks if .gsloth directory exists in the project root
|
3
|
+
* @returns Boolean indicating whether .gsloth directory exists
|
4
|
+
*/
|
5
|
+
export declare function gslothDirExists(): boolean;
|
6
|
+
/**
|
7
|
+
* Gets the path where gsloth should write files based on .gsloth directory existence
|
8
|
+
* @param filename The filename to append to the path
|
9
|
+
* @returns The resolved path where the file should be written
|
10
|
+
*/
|
11
|
+
export declare function getGslothFilePath(filename: string): string;
|
12
|
+
/**
|
13
|
+
* Gets the path where gsloth should write configuration files based on .gsloth directory existence.
|
14
|
+
* The main difference from {@link #getGslothConfigReadPath} is that this getGslothConfigWritePath
|
15
|
+
* method creates internal settings directory if it does not exist.
|
16
|
+
* @param filename The configuration filename
|
17
|
+
* @returns The resolved path where the configuration file should be written
|
18
|
+
*/
|
19
|
+
export declare function getGslothConfigWritePath(filename: string): string;
|
20
|
+
/**
|
21
|
+
* Gets the path where gsloth should look for configuration files based on .gsloth directory existence
|
22
|
+
* @param filename The configuration filename to look for
|
23
|
+
* @returns The resolved path where the configuration file should be found
|
24
|
+
*/
|
25
|
+
export declare function getGslothConfigReadPath(filename: string): string;
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import { existsSync } from 'node:fs';
|
2
|
+
import { resolve } from 'node:path';
|
3
|
+
import { mkdirSync } from 'node:fs';
|
4
|
+
import { getCurrentDir } from '#src/systemUtils.js';
|
5
|
+
const GSLOTH_DIR = '.gsloth';
|
6
|
+
const GSLOTH_SETTINGS_DIR = '.gsloth-settings';
|
7
|
+
/**
|
8
|
+
* Checks if .gsloth directory exists in the project root
|
9
|
+
* @returns Boolean indicating whether .gsloth directory exists
|
10
|
+
*/
|
11
|
+
export function gslothDirExists() {
|
12
|
+
const currentDir = getCurrentDir();
|
13
|
+
const gslothDirPath = resolve(currentDir, GSLOTH_DIR);
|
14
|
+
return existsSync(gslothDirPath);
|
15
|
+
}
|
16
|
+
/**
|
17
|
+
* Gets the path where gsloth should write files based on .gsloth directory existence
|
18
|
+
* @param filename The filename to append to the path
|
19
|
+
* @returns The resolved path where the file should be written
|
20
|
+
*/
|
21
|
+
export function getGslothFilePath(filename) {
|
22
|
+
const currentDir = getCurrentDir();
|
23
|
+
if (gslothDirExists()) {
|
24
|
+
const gslothDirPath = resolve(currentDir, GSLOTH_DIR);
|
25
|
+
return resolve(gslothDirPath, filename);
|
26
|
+
}
|
27
|
+
return resolve(currentDir, filename);
|
28
|
+
}
|
29
|
+
/**
|
30
|
+
* Gets the path where gsloth should write configuration files based on .gsloth directory existence.
|
31
|
+
* The main difference from {@link #getGslothConfigReadPath} is that this getGslothConfigWritePath
|
32
|
+
* method creates internal settings directory if it does not exist.
|
33
|
+
* @param filename The configuration filename
|
34
|
+
* @returns The resolved path where the configuration file should be written
|
35
|
+
*/
|
36
|
+
export function getGslothConfigWritePath(filename) {
|
37
|
+
const currentDir = getCurrentDir();
|
38
|
+
if (gslothDirExists()) {
|
39
|
+
const gslothDirPath = resolve(currentDir, GSLOTH_DIR);
|
40
|
+
const gslothSettingsPath = resolve(gslothDirPath, GSLOTH_SETTINGS_DIR);
|
41
|
+
// Create .gsloth-settings directory if it doesn't exist
|
42
|
+
if (!existsSync(gslothSettingsPath)) {
|
43
|
+
mkdirSync(gslothSettingsPath, { recursive: true });
|
44
|
+
}
|
45
|
+
return resolve(gslothSettingsPath, filename);
|
46
|
+
}
|
47
|
+
return resolve(currentDir, filename);
|
48
|
+
}
|
49
|
+
/**
|
50
|
+
* Gets the path where gsloth should look for configuration files based on .gsloth directory existence
|
51
|
+
* @param filename The configuration filename to look for
|
52
|
+
* @returns The resolved path where the configuration file should be found
|
53
|
+
*/
|
54
|
+
export function getGslothConfigReadPath(filename) {
|
55
|
+
const currentDir = getCurrentDir();
|
56
|
+
if (gslothDirExists()) {
|
57
|
+
const gslothDirPath = resolve(currentDir, GSLOTH_DIR);
|
58
|
+
const gslothSettingsPath = resolve(gslothDirPath, GSLOTH_SETTINGS_DIR);
|
59
|
+
const configPath = resolve(gslothSettingsPath, filename);
|
60
|
+
if (existsSync(configPath)) {
|
61
|
+
return configPath;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
return resolve(currentDir, filename);
|
65
|
+
}
|
66
|
+
//# sourceMappingURL=filePathUtils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"filePathUtils.js","sourceRoot":"","sources":["../src/filePathUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAE/C;;;GAGG;AACH,MAAM,UAAU,eAAe;IAC7B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACtD,OAAO,UAAU,CAAC,aAAa,CAAC,CAAC;AACnC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IAChD,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,IAAI,eAAe,EAAE,EAAE,CAAC;QACtB,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QACtD,OAAO,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAAgB;IACvD,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,IAAI,eAAe,EAAE,EAAE,CAAC;QACtB,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QACtD,MAAM,kBAAkB,GAAG,OAAO,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC;QAEvE,wDAAwD;QACxD,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACpC,SAAS,CAAC,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACrD,CAAC;QAED,OAAO,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AACvC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAgB;IACtD,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,IAAI,eAAe,EAAE,EAAE,CAAC;QACtB,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QACtD,MAAM,kBAAkB,GAAG,OAAO,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC;QACvE,MAAM,UAAU,GAAG,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;QAEzD,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3B,OAAO,UAAU,CAAC;QACpB,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AACvC,CAAC"}
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import { slothContext } from '#src/config.js';
|
2
2
|
import { display, displayError, displaySuccess } from '#src/consoleUtils.js';
|
3
|
-
import {
|
4
|
-
import {
|
3
|
+
import { getGslothFilePath } from '#src/filePathUtils.js';
|
4
|
+
import { generateStandardFileName, ProgressIndicator } from '#src/utils.js';
|
5
5
|
import { writeFileSync } from 'node:fs';
|
6
|
-
import * as path from 'node:path';
|
7
6
|
import { invoke } from '#src/llmUtils.js';
|
8
7
|
/**
|
9
8
|
* Ask a question and get an answer from the LLM
|
@@ -15,7 +14,8 @@ export async function askQuestion(source, preamble, content) {
|
|
15
14
|
const progressIndicator = new ProgressIndicator('Thinking.');
|
16
15
|
const outputContent = await invoke(slothContext.config.llm, slothContext.session, preamble, content);
|
17
16
|
progressIndicator.stop();
|
18
|
-
const
|
17
|
+
const filename = generateStandardFileName(source);
|
18
|
+
const filePath = getGslothFilePath(filename);
|
19
19
|
display(`\nwriting ${filePath}`);
|
20
20
|
// TODO highlight LLM output with something like Prism.JS (maybe system emoj are enough ✅⚠️❌)
|
21
21
|
display('\n' + outputContent);
|
@@ -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,
|
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,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAC7D,MAAM,aAAa,GAAG,MAAM,MAAM,CAChC,YAAY,CAAC,MAAM,CAAC,GAAG,EACvB,YAAY,CAAC,OAAO,EACpB,QAAQ,EACR,OAAO,CACR,CAAC;IACF,iBAAiB,CAAC,IAAI,EAAE,CAAC;IACzB,MAAM,QAAQ,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC7C,OAAO,CAAC,aAAa,QAAQ,EAAE,CAAC,CAAC;IACjC,6FAA6F;IAC7F,OAAO,CAAC,IAAI,GAAG,aAAa,CAAC,CAAC;IAC9B,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,15 +1,16 @@
|
|
1
1
|
import { slothContext } from '#src/config.js';
|
2
2
|
import { display, displayDebug, displayError, displaySuccess } from '#src/consoleUtils.js';
|
3
|
-
import {
|
4
|
-
import {
|
3
|
+
import { stdout } from '#src/systemUtils.js';
|
4
|
+
import { generateStandardFileName, ProgressIndicator } from '#src/utils.js';
|
5
5
|
import { writeFileSync } from 'node:fs';
|
6
|
-
import path from 'node:path';
|
7
6
|
import { invoke } from '#src/llmUtils.js';
|
7
|
+
import { getGslothFilePath } from '#src/filePathUtils.js';
|
8
8
|
export async function review(source, preamble, diff) {
|
9
9
|
const progressIndicator = new ProgressIndicator('Reviewing.');
|
10
10
|
const outputContent = await invoke(slothContext.config.llm, slothContext.session, preamble, diff);
|
11
11
|
progressIndicator.stop();
|
12
|
-
const
|
12
|
+
const filename = generateStandardFileName(source);
|
13
|
+
const filePath = getGslothFilePath(filename);
|
13
14
|
stdout.write('\n');
|
14
15
|
display(`writing ${filePath}`);
|
15
16
|
stdout.write('\n');
|
@@ -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,
|
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,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,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,IAAI,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAC9D,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IAClG,iBAAiB,CAAC,IAAI,EAAE,CAAC;IACzB,MAAM,QAAQ,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC7C,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,OAAO,CAAC,WAAW,QAAQ,EAAE,CAAC,CAAC;IAC/B,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,6FAA6F;IAC7F,OAAO,CAAC,aAAa,CAAC,CAAC;IACvB,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"}
|
package/dist/prompt.js
CHANGED
@@ -2,12 +2,14 @@ import { readFileFromCurrentDir, readFileFromCurrentOrInstallDir, spawnCommand,
|
|
2
2
|
import { displayError } from '#src/consoleUtils.js';
|
3
3
|
import { exit } from '#src/systemUtils.js';
|
4
4
|
import { GSLOTH_BACKSTORY } from '#src/config.js';
|
5
|
+
import { getGslothConfigReadPath } from '#src/filePathUtils.js';
|
5
6
|
export function readBackstory() {
|
6
7
|
return readFileFromCurrentOrInstallDir(GSLOTH_BACKSTORY, true);
|
7
8
|
}
|
8
9
|
export function readGuidelines(guidelinesFilename) {
|
9
10
|
try {
|
10
|
-
|
11
|
+
const filePath = getGslothConfigReadPath(guidelinesFilename);
|
12
|
+
return readFileFromCurrentDir(filePath);
|
11
13
|
}
|
12
14
|
catch (error) {
|
13
15
|
displayError('Consider running `gsloth init` to set up your project. Check `gsloth init --help` to see options.');
|
@@ -19,7 +21,8 @@ export function readReviewInstructions(reviewInstructions) {
|
|
19
21
|
}
|
20
22
|
function readConfigPromptFile(guidelinesFilename) {
|
21
23
|
try {
|
22
|
-
|
24
|
+
const filePath = getGslothConfigReadPath(guidelinesFilename);
|
25
|
+
return readFileFromCurrentOrInstallDir(filePath);
|
23
26
|
}
|
24
27
|
catch (error) {
|
25
28
|
displayError('Consider running `gsloth init` to set up your project. Check `gsloth init --help` to see options.');
|