gaunt-sloth-assistant 0.8.0 → 0.8.2
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.backstory.md +16 -3
- package/.gsloth.chat.md +0 -0
- package/.gsloth.code.md +0 -0
- package/.gsloth.config_.json +0 -0
- package/.gsloth.config_.mjs +0 -0
- package/.gsloth.config_claude.mjs +0 -0
- package/.gsloth.config_vertex.json +0 -0
- package/.gsloth.guidelines.md +64 -36
- package/.gsloth.review.md +0 -0
- package/.gsloth.system.md +0 -0
- package/.prettierrc.json +0 -0
- package/LICENSE +0 -0
- package/README.md +19 -2
- package/assets/gaunt-sloth-logo.png +0 -0
- package/assets/release-notes/v0_4_0.md +0 -0
- package/assets/release-notes/v0_5_0.md +0 -0
- package/assets/release-notes/v0_5_1.md +0 -0
- package/assets/release-notes/v0_5_2.md +0 -0
- package/assets/release-notes/v0_5_3.md +0 -0
- package/assets/release-notes/v0_6_0.md +0 -0
- package/assets/release-notes/v0_6_2.md +0 -0
- package/assets/release-notes/v0_6_4.md +0 -0
- package/assets/release-notes/v0_6_5.md +0 -0
- package/assets/release-notes/v0_7_0.md +0 -0
- package/assets/release-notes/v0_7_2.md +0 -0
- package/assets/release-notes/v0_7_3.md +0 -0
- package/assets/release-notes/v0_8_0.md +0 -0
- package/assets/release-notes/v0_8_2.md +9 -0
- package/dist/builtInToolsConfig.d.ts +0 -0
- package/dist/builtInToolsConfig.js +0 -0
- package/dist/builtInToolsConfig.js.map +0 -0
- package/dist/commands/askCommand.d.ts +0 -0
- package/dist/commands/askCommand.js +0 -0
- package/dist/commands/askCommand.js.map +0 -0
- package/dist/commands/chatCommand.d.ts +0 -0
- package/dist/commands/chatCommand.js +12 -7
- package/dist/commands/chatCommand.js.map +1 -1
- package/dist/commands/codeCommand.d.ts +0 -0
- package/dist/commands/codeCommand.js +0 -0
- package/dist/commands/codeCommand.js.map +0 -0
- package/dist/commands/commandUtils.d.ts +0 -0
- package/dist/commands/commandUtils.js +0 -0
- package/dist/commands/commandUtils.js.map +0 -0
- package/dist/commands/initCommand.d.ts +0 -0
- package/dist/commands/initCommand.js +0 -0
- package/dist/commands/initCommand.js.map +0 -0
- package/dist/commands/prCommand.d.ts +0 -0
- package/dist/commands/prCommand.js +0 -0
- package/dist/commands/prCommand.js.map +0 -0
- package/dist/commands/reviewCommand.d.ts +0 -0
- package/dist/commands/reviewCommand.js +0 -0
- package/dist/commands/reviewCommand.js.map +0 -0
- package/dist/config.d.ts +5 -1
- package/dist/config.js +13 -3
- package/dist/config.js.map +1 -1
- package/dist/consoleUtils.d.ts +1 -0
- package/dist/consoleUtils.js +27 -10
- package/dist/consoleUtils.js.map +1 -1
- package/dist/constants.d.ts +0 -0
- package/dist/constants.js +0 -0
- package/dist/constants.js.map +0 -0
- package/dist/core/Invocation.d.ts +1 -1
- package/dist/core/Invocation.js +4 -4
- package/dist/core/Invocation.js.map +1 -1
- package/dist/core/types.d.ts +0 -0
- package/dist/core/types.js +0 -0
- package/dist/core/types.js.map +0 -0
- package/dist/filePathUtils.d.ts +0 -0
- package/dist/filePathUtils.js +0 -0
- package/dist/filePathUtils.js.map +0 -0
- package/dist/globalConfigUtils.d.ts +0 -0
- package/dist/globalConfigUtils.js +0 -0
- package/dist/globalConfigUtils.js.map +0 -0
- package/dist/helpers/jira/jiraClient.d.ts +0 -0
- package/dist/helpers/jira/jiraClient.js +0 -0
- package/dist/helpers/jira/jiraClient.js.map +0 -0
- package/dist/helpers/jira/jiraLogWork.d.ts +0 -0
- package/dist/helpers/jira/jiraLogWork.js +0 -0
- package/dist/helpers/jira/jiraLogWork.js.map +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/llmUtils.d.ts +0 -0
- package/dist/llmUtils.js +0 -0
- package/dist/llmUtils.js.map +0 -0
- package/dist/mcp/OAuthClientProviderImpl.d.ts +0 -0
- package/dist/mcp/OAuthClientProviderImpl.js +0 -0
- package/dist/mcp/OAuthClientProviderImpl.js.map +0 -0
- package/dist/modules/interactiveSessionModule.d.ts +0 -0
- package/dist/modules/interactiveSessionModule.js +5 -6
- package/dist/modules/interactiveSessionModule.js.map +1 -1
- package/dist/modules/questionAnsweringModule.d.ts +0 -0
- package/dist/modules/questionAnsweringModule.js +0 -0
- package/dist/modules/questionAnsweringModule.js.map +0 -0
- package/dist/modules/reviewModule.d.ts +0 -0
- package/dist/modules/reviewModule.js +0 -0
- package/dist/modules/reviewModule.js.map +0 -0
- package/dist/modules/types.d.ts +0 -0
- package/dist/modules/types.js +0 -0
- package/dist/modules/types.js.map +0 -0
- package/dist/presets/anthropic.d.ts +0 -0
- package/dist/presets/anthropic.js +0 -0
- package/dist/presets/anthropic.js.map +0 -0
- package/dist/presets/deepseek.d.ts +0 -0
- package/dist/presets/deepseek.js +0 -0
- package/dist/presets/deepseek.js.map +0 -0
- package/dist/presets/fake.d.ts +0 -0
- package/dist/presets/fake.js +0 -0
- package/dist/presets/fake.js.map +0 -0
- package/dist/presets/groq.d.ts +0 -0
- package/dist/presets/groq.js +0 -0
- package/dist/presets/groq.js.map +0 -0
- package/dist/presets/openai.d.ts +5 -0
- package/dist/presets/openai.js +48 -0
- package/dist/presets/openai.js.map +1 -0
- package/dist/presets/vertexai.d.ts +0 -0
- package/dist/presets/vertexai.js +0 -0
- package/dist/presets/vertexai.js.map +0 -0
- package/dist/prompt.d.ts +0 -0
- package/dist/prompt.js +0 -0
- package/dist/prompt.js.map +0 -0
- package/dist/providers/file.d.ts +0 -0
- package/dist/providers/file.js +0 -0
- package/dist/providers/file.js.map +0 -0
- package/dist/providers/ghIssueProvider.d.ts +0 -0
- package/dist/providers/ghIssueProvider.js +0 -0
- package/dist/providers/ghIssueProvider.js.map +0 -0
- package/dist/providers/ghPrDiffProvider.d.ts +0 -0
- package/dist/providers/ghPrDiffProvider.js +0 -0
- package/dist/providers/ghPrDiffProvider.js.map +0 -0
- package/dist/providers/jiraIssueLegacyProvider.d.ts +0 -0
- package/dist/providers/jiraIssueLegacyProvider.js +0 -0
- package/dist/providers/jiraIssueLegacyProvider.js.map +0 -0
- package/dist/providers/jiraIssueProvider.d.ts +0 -0
- package/dist/providers/jiraIssueProvider.js +0 -0
- package/dist/providers/jiraIssueProvider.js.map +0 -0
- package/dist/providers/text.d.ts +0 -0
- package/dist/providers/text.js +0 -0
- package/dist/providers/text.js.map +0 -0
- package/dist/providers/types.d.ts +0 -0
- package/dist/providers/types.js +0 -0
- package/dist/providers/types.js.map +0 -0
- package/dist/systemUtils.d.ts +8 -0
- package/dist/systemUtils.js +14 -1
- package/dist/systemUtils.js.map +1 -1
- package/dist/tools/GthFileSystemToolkit.d.ts +0 -0
- package/dist/tools/GthFileSystemToolkit.js +0 -0
- package/dist/tools/GthFileSystemToolkit.js.map +0 -0
- package/dist/tools/gthJiraLogWorkTool.d.ts +0 -0
- package/dist/tools/gthJiraLogWorkTool.js +0 -0
- package/dist/tools/gthJiraLogWorkTool.js.map +0 -0
- package/dist/tools/gthStatusUpdateTool.d.ts +0 -0
- package/dist/tools/gthStatusUpdateTool.js +2 -3
- package/dist/tools/gthStatusUpdateTool.js.map +1 -1
- package/dist/utils.d.ts +0 -0
- package/dist/utils.js +0 -0
- package/dist/utils.js.map +0 -0
- package/docs/COMMANDS.md +0 -0
- package/docs/CONFIGURATION.md +85 -2
- package/docs/DEVELOPMENT.md +0 -0
- package/docs/RELEASE-HOWTO.md +0 -0
- package/eslint.config.js +0 -0
- package/it.js +0 -0
- package/maintenance/doc-maintenance.md +0 -0
- package/package.json +9 -9
- package/src/builtInToolsConfig.ts +0 -0
- package/src/commands/askCommand.ts +0 -0
- package/src/commands/chatCommand.ts +12 -8
- package/src/commands/codeCommand.ts +0 -0
- package/src/commands/commandUtils.ts +0 -0
- package/src/commands/initCommand.ts +0 -0
- package/src/commands/prCommand.ts +0 -0
- package/src/commands/reviewCommand.ts +0 -0
- package/src/config.ts +19 -3
- package/src/consoleUtils.ts +29 -10
- package/src/constants.ts +0 -0
- package/src/core/Invocation.ts +4 -4
- package/src/core/types.ts +0 -0
- package/src/filePathUtils.ts +0 -0
- package/src/globalConfigUtils.ts +0 -0
- package/src/helpers/jira/jiraClient.ts +0 -0
- package/src/helpers/jira/jiraLogWork.ts +0 -0
- package/src/index.ts +3 -2
- package/src/llmUtils.ts +0 -0
- package/src/mcp/OAuthClientProviderImpl.ts +0 -0
- package/src/modules/interactiveSessionModule.ts +10 -6
- package/src/modules/questionAnsweringModule.ts +0 -0
- package/src/modules/reviewModule.ts +0 -0
- package/src/modules/types.ts +0 -0
- package/src/presets/anthropic.ts +0 -0
- package/src/presets/deepseek.ts +0 -0
- package/src/presets/fake.ts +0 -0
- package/src/presets/groq.ts +0 -0
- package/src/presets/openai.ts +62 -0
- package/src/presets/vertexai.ts +0 -0
- package/src/prompt.ts +0 -0
- package/src/providers/file.ts +0 -0
- package/src/providers/ghIssueProvider.ts +0 -0
- package/src/providers/ghPrDiffProvider.ts +0 -0
- package/src/providers/jiraIssueLegacyProvider.ts +0 -0
- package/src/providers/jiraIssueProvider.ts +0 -0
- package/src/providers/text.ts +0 -0
- package/src/providers/types.ts +0 -0
- package/src/systemUtils.ts +15 -1
- package/src/tools/GthFileSystemToolkit.ts +0 -0
- package/src/tools/gthJiraLogWorkTool.ts +0 -0
- package/src/tools/gthStatusUpdateTool.ts +2 -3
- package/src/utils.ts +0 -0
- package/tsconfig.json +0 -0
- package/vitest-it.config.ts +0 -0
- package/vitest.config.ts +0 -0
package/.gsloth.backstory.md
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
Your name is Gaunt Sloth,
|
|
2
|
-
|
|
1
|
+
Your name is Gaunt Sloth, a programmer with comprehensive expertise across programming languages. Maintain a
|
|
2
|
+
professional, direct communication style. Begin responses with substance, not pleasantries or self-promotion.
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
Your priority is code correctness and bug prevention over social niceties, though you remain courteous in all
|
|
5
|
+
interactions. Focus on technical accuracy and practical solutions.
|
|
6
|
+
|
|
7
|
+
Use visual indicators when providing feedback:
|
|
8
|
+
|
|
9
|
+
- ✅ for correct implementations (and approvals)
|
|
10
|
+
- ⚠️ for potential issues or areas needing attention
|
|
11
|
+
- ❌ for errors or problematic approaches (and rejections)
|
|
12
|
+
|
|
13
|
+
You may enhance communication with relevant emojis throughout your responses to improve clarity and readability,
|
|
14
|
+
but do not include foolish smiley faces.
|
|
15
|
+
|
|
16
|
+
Never include decorative emojis within code snippets — only use them in code when they're part of the actual
|
|
17
|
+
logic, string literals, or were present in the original code being discussed.
|
package/.gsloth.chat.md
CHANGED
|
File without changes
|
package/.gsloth.code.md
CHANGED
|
File without changes
|
package/.gsloth.config_.json
CHANGED
|
File without changes
|
package/.gsloth.config_.mjs
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/.gsloth.guidelines.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
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
|
+
|
|
6
7
|
- NodeJS 22 (LTS)
|
|
7
8
|
- Vitest 3 for tests
|
|
8
9
|
- Typescript 5
|
|
@@ -21,12 +22,14 @@ Please abstain from using relative imports, only use them when no other choices
|
|
|
21
22
|
(currently the only exception is entry point index.js)
|
|
22
23
|
|
|
23
24
|
### Architecture and Flow
|
|
25
|
+
|
|
24
26
|
- Make sure proper separation of LangChain components (LLMs, chains, agents, tools)
|
|
25
27
|
- Check for clear data flow between components
|
|
26
28
|
- Ensure proper state management in LangGraph workflows
|
|
27
29
|
- Validate error handling and fallback mechanisms
|
|
28
30
|
|
|
29
31
|
### Security
|
|
32
|
+
|
|
30
33
|
- Make sure API key handling and environment variables
|
|
31
34
|
- Make sure no personal data is present in code
|
|
32
35
|
- ** Make sure that API keys are accidentally not included into diff.**
|
|
@@ -53,7 +56,8 @@ Use [llmUtils.ts](src/llmUtils.ts) to access LLM.
|
|
|
53
56
|
- Always import the tested file dynamically within the test.
|
|
54
57
|
- Mocks are hoisted, so it is better to simply place them at the top of the file to avoid confusion.
|
|
55
58
|
- 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
|
|
59
|
+
- Create variables with vi.fn() without adding implementations to them, then apply these functions with vi.mock outside
|
|
60
|
+
of the describe.
|
|
57
61
|
- Apply mock implementations and return values to mocks within individual tests.
|
|
58
62
|
- When mock implementations are common for all test cases, apply them in beforeEach.
|
|
59
63
|
- Make sure test actually testing a function, rather than simply testing the mock.
|
|
@@ -65,49 +69,73 @@ import {beforeEach, describe, expect, it, vi} from 'vitest';
|
|
|
65
69
|
import {writeFileSync} from "node:fs";
|
|
66
70
|
|
|
67
71
|
const consoleUtilsMock = {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
display: vi.fn(),
|
|
73
|
+
displayError: vi.fn(),
|
|
74
|
+
displayInfo: vi.fn(),
|
|
75
|
+
displayWarning: vi.fn(),
|
|
76
|
+
displaySuccess: vi.fn(),
|
|
77
|
+
displayDebug: vi.fn(),
|
|
74
78
|
};
|
|
75
79
|
vi.mock('#src/consoleUtils.js', () => consoleUtilsMock);
|
|
76
80
|
|
|
77
81
|
let fsUtilsMock = {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
existsSync: vi.fn(),
|
|
83
|
+
readFileSync: vi.fn(),
|
|
84
|
+
writeFileSync: vi.fn(),
|
|
81
85
|
};
|
|
82
86
|
vi.mock('node:fs', () => fsUtilsMock);
|
|
83
87
|
|
|
84
88
|
describe('specialUtil', () => {
|
|
85
|
-
|
|
86
|
-
|
|
89
|
+
beforeEach(() => {
|
|
90
|
+
vi.resetAllMocks(); // Always reset all mocks in beforeEach
|
|
91
|
+
|
|
92
|
+
// Set up default mock values
|
|
93
|
+
fsUtilsMock.existsSync.mockImplementation(() => true);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('specialFunction should eventually write test contents to a file', async () => {
|
|
97
|
+
fsMock.readFileSync.mockImplementation((path: string) => {
|
|
98
|
+
if (path.includes('inputFile.txt')) return 'TEST CONTENT';
|
|
99
|
+
return '';
|
|
100
|
+
});
|
|
87
101
|
|
|
88
|
-
|
|
89
|
-
fsUtilsMock.existsSync.mockImplementation(() => true);
|
|
90
|
-
});
|
|
102
|
+
const {specialFunction} = await import('#src/specialUtil.js'); // Always import tested file within the test
|
|
91
103
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
104
|
+
// Function under test
|
|
105
|
+
specialFunction();
|
|
106
|
+
|
|
107
|
+
expect(fsUtilsMock.writeFileSync).toHaveBeenCalledWith('outputFile.txt', 'TEST CONTENT\nEXTRA CONTENT');
|
|
108
|
+
expect(consoleUtilsMock.displayDebug).not.toHaveBeenCalled();
|
|
109
|
+
expect(consoleUtilsMock.displayWarning).not.toHaveBeenCalled();
|
|
110
|
+
expect(consoleUtilsMock.display).not.toHaveBeenCalled();
|
|
111
|
+
expect(consoleUtilsMock.displayError).not.toHaveBeenCalled();
|
|
112
|
+
expect(consoleUtilsMock.displayInfo).not.toHaveBeenCalled();
|
|
113
|
+
expect(consoleUtilsMock.displaySuccess).toHaveBeenCalledWith('Successfully transferred to outputFile.txt');
|
|
96
114
|
});
|
|
115
|
+
});
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
When mocking class constructors follow this pattern:
|
|
119
|
+
|
|
120
|
+
```javascript
|
|
121
|
+
// With export default
|
|
122
|
+
const gthFileSystemToolkitGetToolsMock = vi.fn();
|
|
123
|
+
vi.mock('#src/tools/GthFileSystemToolkit.js', () => {
|
|
124
|
+
const GthFileSystemToolkit = vi.fn();
|
|
125
|
+
GthFileSystemToolkit.prototype.getTools = gthFileSystemToolkitGetToolsMock;
|
|
126
|
+
return {
|
|
127
|
+
default: GthFileSystemToolkit,
|
|
128
|
+
};
|
|
129
|
+
});
|
|
97
130
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
-
});
|
|
131
|
+
// With named exports
|
|
132
|
+
const otherToolkitMock = vi.fn();
|
|
133
|
+
vi.mock('#src/tools/OtherToolkit.js', () => {
|
|
134
|
+
const OtherToolkit = vi.fn();
|
|
135
|
+
OtherToolkit.prototype.getTools = otherToolkitMock;
|
|
136
|
+
return {
|
|
137
|
+
OtherToolkit,
|
|
138
|
+
};
|
|
111
139
|
});
|
|
112
140
|
```
|
|
113
141
|
|
|
@@ -118,10 +146,10 @@ Please follow this workflow:
|
|
|
118
146
|
- Analyze requirements.
|
|
119
147
|
- Develop changes.
|
|
120
148
|
- Make sure all tests pass `npm run test` and fix if possible.
|
|
121
|
-
|
|
149
|
+
- Request relevant documentation if some of the test failures are unclear.
|
|
122
150
|
- Once all tests are green check lint with `npm run lint`.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
151
|
+
- If any lint failures are present try fixing them with `npm run lint -- --fix`.
|
|
152
|
+
- If autofix didn't help, try fixing them yourself.
|
|
153
|
+
- Prefer testing all user outputs, including testing absence of unexpected outputs.
|
|
126
154
|
|
|
127
155
|
---
|
package/.gsloth.review.md
CHANGED
|
File without changes
|
package/.gsloth.system.md
CHANGED
|
File without changes
|
package/.prettierrc.json
CHANGED
|
File without changes
|
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
@@ -50,7 +50,8 @@ The promise of Gaunt Sloth:
|
|
|
50
50
|
- Google Vertex AI;
|
|
51
51
|
- Anthropic;
|
|
52
52
|
- Groq;
|
|
53
|
-
- DeepSeek
|
|
53
|
+
- DeepSeek;
|
|
54
|
+
- OpenAI (and other providers using OpenAI format, such as Inception).
|
|
54
55
|
|
|
55
56
|
`*` Any other provider supported by LangChain.JS should also work with [JS config](./docs/CONFIGURATION.md#JavaScript-Configuration).
|
|
56
57
|
|
|
@@ -112,7 +113,8 @@ npm install gaunt-sloth-assistant -g
|
|
|
112
113
|
> Global configuration to invoke gsloth anywhere is in [ROADMAP](ROADMAP.md).
|
|
113
114
|
|
|
114
115
|
Configuration can be created with `gsloth init [vendor]` command.
|
|
115
|
-
Currently, vertexai, anthropic, groq and
|
|
116
|
+
Currently, vertexai, anthropic, groq, deepseek and openai can be configured with `gsloth init [vendor]`.
|
|
117
|
+
For OpenAI-compatible providers like Inception, use `gsloth init openai` and modify the configuration.
|
|
116
118
|
|
|
117
119
|
More detailed information on configuration can be found in [CONFIGURATION.md](./docs/CONFIGURATION.md)
|
|
118
120
|
|
|
@@ -148,6 +150,21 @@ gsloth init deepseek
|
|
|
148
150
|
Make sure you either define `DEEPSEEK_API_KEY` environment variable or edit your configuration file and set up your key.
|
|
149
151
|
It is recommended to obtain API key from DeepSeek official website rather than from a reseller.
|
|
150
152
|
|
|
153
|
+
### OpenAI
|
|
154
|
+
```shell
|
|
155
|
+
cd ./your-project
|
|
156
|
+
gsloth init openai
|
|
157
|
+
```
|
|
158
|
+
Make sure you either define `OPENAI_API_KEY` environment variable or edit your configuration file and set up your key.
|
|
159
|
+
|
|
160
|
+
### OpenAI-compatible providers (Inception, etc.)
|
|
161
|
+
For providers using OpenAI-compatible APIs:
|
|
162
|
+
```shell
|
|
163
|
+
cd ./your-project
|
|
164
|
+
gsloth init openai
|
|
165
|
+
```
|
|
166
|
+
Then edit your configuration to add custom base URL and API key. See [CONFIGURATION.md](./docs/CONFIGURATION.md) for examples.
|
|
167
|
+
|
|
151
168
|
### Other AI providers
|
|
152
169
|
Any other AI provider supported by Langchain.js can be configured with js [Config](./docs/CONFIGURATION.md).
|
|
153
170
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# v0.8.2 OpenAI Support and Improved CLI
|
|
2
|
+
|
|
3
|
+
## New Features
|
|
4
|
+
|
|
5
|
+
### OpenAI and Compatible Services Support
|
|
6
|
+
Gaunt Sloth Assistant now supports OpenAI and other services that use the OpenAI API format, such as Inception AI. This allows you to use a wider range of models with the assistant.
|
|
7
|
+
|
|
8
|
+
### Default to Chat Command
|
|
9
|
+
Running `gth` or `gsloth` without any arguments now defaults to starting the chat command, making it quicker to start a conversation.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { createInteractiveSession } from '#src/modules/interactiveSessionModule.js';
|
|
2
2
|
import { readChatPrompt } from '#src/prompt.js';
|
|
3
3
|
export function chatCommand(program) {
|
|
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);
|
|
14
|
+
});
|
|
15
|
+
// Chat command
|
|
4
16
|
program
|
|
5
17
|
.command('chat')
|
|
6
18
|
.description('Start an interactive chat session with Gaunt Sloth')
|
|
7
19
|
.argument('[message]', 'Initial message to start the chat')
|
|
8
20
|
.action(async (message) => {
|
|
9
|
-
const sessionConfig = {
|
|
10
|
-
mode: 'chat',
|
|
11
|
-
readModePrompt: readChatPrompt,
|
|
12
|
-
description: 'Start an interactive chat session with Gaunt Sloth',
|
|
13
|
-
readyMessage: '\nGaunt Sloth is ready to chat. Type your prompt.',
|
|
14
|
-
exitMessage: "Type 'exit' or hit Ctrl+C to exit chat\n",
|
|
15
|
-
};
|
|
16
21
|
await createInteractiveSession(sessionConfig, message);
|
|
17
22
|
});
|
|
18
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatCommand.js","sourceRoot":"","sources":["../../src/commands/chatCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAiB,MAAM,0CAA0C,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,
|
|
1
|
+
{"version":3,"file":"chatCommand.js","sourceRoot":"","sources":["../../src/commands/chatCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAiB,MAAM,0CAA0C,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,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,CAAC,CAAC;IAChD,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,OAAO,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/config.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface SlothConfig extends BaseSlothConfig {
|
|
|
9
9
|
projectGuidelines: string;
|
|
10
10
|
projectReviewInstructions: string;
|
|
11
11
|
streamOutput: boolean;
|
|
12
|
+
useColour: boolean;
|
|
12
13
|
filesystem: string[] | 'all' | 'read' | 'none';
|
|
13
14
|
builtInTools?: string[];
|
|
14
15
|
tools?: StructuredToolInterface[] | BaseToolkit[];
|
|
@@ -29,6 +30,7 @@ interface BaseSlothConfig {
|
|
|
29
30
|
projectGuidelines?: string;
|
|
30
31
|
projectReviewInstructions?: string;
|
|
31
32
|
streamOutput?: boolean;
|
|
33
|
+
useColour?: boolean;
|
|
32
34
|
filesystem?: string[] | 'all' | 'read' | 'none';
|
|
33
35
|
prebuiltToolsConfig?: PreBuiltToolsConfig;
|
|
34
36
|
customToolsConfig?: CustomToolsConfig;
|
|
@@ -71,8 +73,10 @@ export type PreBuiltToolsConfig = {
|
|
|
71
73
|
export interface LLMConfig extends Record<string, unknown> {
|
|
72
74
|
type: string;
|
|
73
75
|
model: string;
|
|
76
|
+
configuration: Record<string, unknown>;
|
|
77
|
+
apiKeyEnvironmentVariable?: string;
|
|
74
78
|
}
|
|
75
|
-
export declare const availableDefaultConfigs: readonly ["vertexai", "anthropic", "groq", "deepseek"];
|
|
79
|
+
export declare const availableDefaultConfigs: readonly ["vertexai", "anthropic", "groq", "deepseek", "openai"];
|
|
76
80
|
export type ConfigType = (typeof availableDefaultConfigs)[number];
|
|
77
81
|
export declare const DEFAULT_CONFIG: Partial<SlothConfig>;
|
|
78
82
|
/**
|
package/dist/config.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { displayDebug, displayError, displayInfo, displayWarning } from '#src/consoleUtils.js';
|
|
2
2
|
import { importExternalFile, writeFileIfNotExistsWithMessages } from '#src/utils.js';
|
|
3
3
|
import { existsSync, readFileSync } from 'node:fs';
|
|
4
|
-
import { error, exit } from '#src/systemUtils.js';
|
|
4
|
+
import { error, exit, setUseColour } from '#src/systemUtils.js';
|
|
5
5
|
import { getGslothConfigReadPath, getGslothConfigWritePath } from '#src/filePathUtils.js';
|
|
6
6
|
import { PROJECT_GUIDELINES, PROJECT_REVIEW_INSTRUCTIONS, USER_PROJECT_CONFIG_JS, USER_PROJECT_CONFIG_JSON, USER_PROJECT_CONFIG_MJS, } from '#src/constants.js';
|
|
7
|
-
export const availableDefaultConfigs = [
|
|
7
|
+
export const availableDefaultConfigs = [
|
|
8
|
+
'vertexai',
|
|
9
|
+
'anthropic',
|
|
10
|
+
'groq',
|
|
11
|
+
'deepseek',
|
|
12
|
+
'openai',
|
|
13
|
+
];
|
|
8
14
|
export const DEFAULT_CONFIG = {
|
|
9
15
|
llm: undefined,
|
|
10
16
|
contentProvider: 'file',
|
|
@@ -12,6 +18,7 @@ export const DEFAULT_CONFIG = {
|
|
|
12
18
|
projectGuidelines: PROJECT_GUIDELINES,
|
|
13
19
|
projectReviewInstructions: PROJECT_REVIEW_INSTRUCTIONS,
|
|
14
20
|
streamOutput: true,
|
|
21
|
+
useColour: true,
|
|
15
22
|
filesystem: 'read',
|
|
16
23
|
commands: {
|
|
17
24
|
pr: {
|
|
@@ -208,11 +215,14 @@ Important! You are likely to be dealing with git diff below, please don't confus
|
|
|
208
215
|
*/
|
|
209
216
|
function mergeConfig(partialConfig) {
|
|
210
217
|
const config = partialConfig;
|
|
211
|
-
|
|
218
|
+
const mergedConfig = {
|
|
212
219
|
...DEFAULT_CONFIG,
|
|
213
220
|
...config,
|
|
214
221
|
commands: { ...DEFAULT_CONFIG.commands, ...(config?.commands ?? {}) },
|
|
215
222
|
};
|
|
223
|
+
// Set the useColour value in systemUtils
|
|
224
|
+
setUseColour(mergedConfig.useColour);
|
|
225
|
+
return mergedConfig;
|
|
216
226
|
}
|
|
217
227
|
/**
|
|
218
228
|
* Merge raw with default config
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,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;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,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,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAG1F,OAAO,EACL,kBAAkB,EAClB,2BAA2B,EAC3B,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAkF3B,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,UAAU;IACV,WAAW;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: string): void;
|
|
|
4
4
|
export declare function displaySuccess(message: string): void;
|
|
5
5
|
export declare function displayInfo(message: string): void;
|
|
6
6
|
export declare function display(message: string): void;
|
|
7
|
+
export declare function formatInputPrompt(message: string): string;
|
|
7
8
|
export declare function displayDebug(message: string | Error | undefined): void;
|
|
8
9
|
export declare const defaultStatusCallbacks: StatusUpdateCallback;
|
package/dist/consoleUtils.js
CHANGED
|
@@ -1,28 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import * as su from '#src/systemUtils.js';
|
|
2
|
+
// ANSI color codes
|
|
3
|
+
const ANSI_COLORS = {
|
|
4
|
+
red: '\x1b[31m',
|
|
5
|
+
yellow: '\x1b[33m',
|
|
6
|
+
green: '\x1b[32m',
|
|
7
|
+
magenta: '\x1b[35m',
|
|
8
|
+
dim: '\x1b[2m',
|
|
9
|
+
reset: '\x1b[0m',
|
|
10
|
+
};
|
|
11
|
+
// Helper functions for ANSI coloring
|
|
12
|
+
function colorText(text, color) {
|
|
13
|
+
if (!su.getUseColour()) {
|
|
14
|
+
return text;
|
|
15
|
+
}
|
|
16
|
+
return `${ANSI_COLORS[color]}${text}${ANSI_COLORS.reset}`;
|
|
17
|
+
}
|
|
4
18
|
export function displayError(message) {
|
|
5
|
-
|
|
19
|
+
su.log(colorText(message, 'red'));
|
|
6
20
|
}
|
|
7
21
|
export function displayWarning(message) {
|
|
8
|
-
|
|
22
|
+
su.warn(colorText(message, 'yellow'));
|
|
9
23
|
}
|
|
10
24
|
export function displaySuccess(message) {
|
|
11
|
-
|
|
25
|
+
su.log(colorText(message, 'green'));
|
|
12
26
|
}
|
|
13
27
|
export function displayInfo(message) {
|
|
14
|
-
|
|
28
|
+
su.info(colorText(message, 'dim'));
|
|
15
29
|
}
|
|
16
30
|
export function display(message) {
|
|
17
|
-
log(message);
|
|
31
|
+
su.log(message);
|
|
32
|
+
}
|
|
33
|
+
export function formatInputPrompt(message) {
|
|
34
|
+
return colorText(message, 'magenta');
|
|
18
35
|
}
|
|
19
36
|
export function displayDebug(message) {
|
|
20
37
|
// TODO make it controlled by config
|
|
21
38
|
if (message instanceof Error) {
|
|
22
|
-
|
|
39
|
+
su.debug(message.stack || '');
|
|
23
40
|
}
|
|
24
41
|
else if (message !== undefined) {
|
|
25
|
-
|
|
42
|
+
su.debug(message);
|
|
26
43
|
}
|
|
27
44
|
}
|
|
28
45
|
// Create status update callback
|
package/dist/consoleUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consoleUtils.js","sourceRoot":"","sources":["../src/consoleUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"consoleUtils.js","sourceRoot":"","sources":["../src/consoleUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI1C,mBAAmB;AACnB,MAAM,WAAW,GAAG;IAClB,GAAG,EAAE,UAAU;IACf,MAAM,EAAE,UAAU;IAClB,KAAK,EAAE,UAAU;IACjB,OAAO,EAAE,UAAU;IACnB,GAAG,EAAE,SAAS;IACd,KAAK,EAAE,SAAS;CACjB,CAAC;AAEF,qCAAqC;AACrC,SAAS,SAAS,CAAC,IAAY,EAAE,KAA+B;IAC9D,IAAI,CAAC,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,WAAW,CAAC,KAAK,EAAE,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;A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AAO,CAAC,CAAC;YACjB,MAAM;QACR,KAAK,QAAQ;YACX,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC9B,MAAM;IACV,CAAC;AACH,CAAC,CAAC"}
|
package/dist/constants.d.ts
CHANGED
|
File without changes
|
package/dist/constants.js
CHANGED
|
File without changes
|
package/dist/constants.js.map
CHANGED
|
File without changes
|
|
@@ -14,7 +14,7 @@ export declare class Invocation {
|
|
|
14
14
|
private config;
|
|
15
15
|
constructor(statusUpdate: StatusUpdateCallback);
|
|
16
16
|
setVerbose(verbose: boolean): void;
|
|
17
|
-
init(command: GthCommand | undefined,
|
|
17
|
+
init(command: GthCommand | undefined, configIn: SlothConfig, checkpointSaver?: BaseCheckpointSaver | undefined): Promise<void>;
|
|
18
18
|
getEffectiveConfig(config: SlothConfig, command: GthCommand | undefined): SlothConfig;
|
|
19
19
|
invoke(messages: Message[], runConfig?: RunnableConfig): Promise<string>;
|
|
20
20
|
cleanup(): Promise<void>;
|
package/dist/core/Invocation.js
CHANGED
|
@@ -18,15 +18,15 @@ export class Invocation {
|
|
|
18
18
|
setVerbose(verbose) {
|
|
19
19
|
this.verbose = verbose;
|
|
20
20
|
}
|
|
21
|
-
async init(command,
|
|
21
|
+
async init(command, configIn, checkpointSaver) {
|
|
22
22
|
if (this.verbose) {
|
|
23
|
-
|
|
23
|
+
configIn.llm.verbose = true;
|
|
24
24
|
}
|
|
25
25
|
// Merge command-specific filesystem config if provided
|
|
26
|
-
this.config = this.getEffectiveConfig(
|
|
26
|
+
this.config = this.getEffectiveConfig(configIn, command);
|
|
27
27
|
this.mcpClient = await this.getMcpClient(this.config);
|
|
28
28
|
// Get default filesystem tools (filtered based on config)
|
|
29
|
-
const defaultTools = await getDefaultTools(config);
|
|
29
|
+
const defaultTools = await getDefaultTools(this.config);
|
|
30
30
|
// Get user config tools
|
|
31
31
|
const flattenedConfigTools = this.extractAndFlattenTools(this.config.tools || []);
|
|
32
32
|
// Get MCP tools
|