gaunt-sloth-assistant 0.8.6 → 0.8.7
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 +15 -5
- package/assets/release-notes/v0_8_7.md +5 -0
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/presets/anthropic.js +1 -4
- package/dist/presets/anthropic.js.map +1 -1
- package/dist/presets/deepseek.js +1 -4
- package/dist/presets/deepseek.js.map +1 -1
- package/dist/presets/google-genai.d.ts +4 -0
- package/dist/presets/google-genai.js +30 -0
- package/dist/presets/google-genai.js.map +1 -0
- package/dist/presets/groq.js +1 -4
- package/dist/presets/groq.js.map +1 -1
- package/dist/presets/openai.js +1 -4
- package/dist/presets/openai.js.map +1 -1
- package/dist/presets/vertexai.js +0 -4
- package/dist/presets/vertexai.js.map +1 -1
- package/docs/CONFIGURATION.md +87 -31
- package/package.json +2 -1
- package/src/config.ts +1 -0
- package/src/presets/anthropic.ts +1 -5
- package/src/presets/deepseek.ts +1 -5
- package/src/presets/google-genai.ts +42 -0
- package/src/presets/groq.ts +1 -5
- package/src/presets/openai.ts +1 -5
- package/src/presets/vertexai.ts +0 -5
package/README.md
CHANGED
|
@@ -47,11 +47,12 @@ The promise of Gaunt Sloth:
|
|
|
47
47
|
|
|
48
48
|
### To make GSloth work, you need an **API key** from some AI provider, such as:
|
|
49
49
|
|
|
50
|
-
- Google Vertex AI;
|
|
51
|
-
- Anthropic;
|
|
52
50
|
- Groq;
|
|
53
51
|
- DeepSeek;
|
|
54
|
-
-
|
|
52
|
+
- Google Vertex AI and Google AI Studio;
|
|
53
|
+
- Anthropic;
|
|
54
|
+
- OpenAI (and other providers using OpenAI format, such as Inception);
|
|
55
|
+
- Ollama with JS config (some of the models, see https://github.com/andruhon/gaunt-sloth-assistant/discussions/107)
|
|
55
56
|
|
|
56
57
|
`*` Any other provider supported by LangChain.JS should also work with [JS config](./docs/CONFIGURATION.md#JavaScript-Configuration).
|
|
57
58
|
|
|
@@ -129,7 +130,6 @@ npm install gaunt-sloth-assistant -g
|
|
|
129
130
|
## Configuration
|
|
130
131
|
|
|
131
132
|
> Gaunt Sloth currently only functions from the directory which has a configuration file (`.gsloth.config.js`, `.gsloth.config.json`, or `.gsloth.config.mjs`) and `.gsloth.guidelines.md`.
|
|
132
|
-
> Global configuration to invoke gsloth anywhere is in [ROADMAP](ROADMAP.md).
|
|
133
133
|
|
|
134
134
|
Configuration can be created with `gsloth init [vendor]` command.
|
|
135
135
|
Currently, vertexai, anthropic, groq, deepseek and openai can be configured with `gsloth init [vendor]`.
|
|
@@ -138,6 +138,7 @@ For OpenAI-compatible providers like Inception, use `gsloth init openai` and mod
|
|
|
138
138
|
More detailed information on configuration can be found in [CONFIGURATION.md](./docs/CONFIGURATION.md)
|
|
139
139
|
|
|
140
140
|
### Google Vertex AI
|
|
141
|
+
|
|
141
142
|
```shell
|
|
142
143
|
cd ./your-project
|
|
143
144
|
gsloth init vertexai
|
|
@@ -145,6 +146,15 @@ gcloud auth login
|
|
|
145
146
|
gcloud auth application-default login
|
|
146
147
|
```
|
|
147
148
|
|
|
149
|
+
### Google GenAI (AI Studio)
|
|
150
|
+
|
|
151
|
+
```shell
|
|
152
|
+
cd ./your-project
|
|
153
|
+
gsloth init google-genai
|
|
154
|
+
```
|
|
155
|
+
Make sure you either define `GOOGLE_API_KEY` environment variable or edit your configuration file and set up your key.
|
|
156
|
+
It is recommended to obtain API key from Google AI Studio official website rather than from a reseller.
|
|
157
|
+
|
|
148
158
|
### Anthropic
|
|
149
159
|
|
|
150
160
|
```shell
|
|
@@ -185,7 +195,7 @@ gsloth init openai
|
|
|
185
195
|
Then edit your configuration to add custom base URL and API key. See [CONFIGURATION.md](./docs/CONFIGURATION.md) for examples.
|
|
186
196
|
|
|
187
197
|
### Other AI providers
|
|
188
|
-
Any other AI provider supported by Langchain.js can be configured with js [Config](./docs/CONFIGURATION.md).
|
|
198
|
+
Any other AI provider supported by Langchain.js can be configured with js [Config](./docs/CONFIGURATION.md).
|
|
189
199
|
|
|
190
200
|
## MCP (Model Context Protocol) Servers
|
|
191
201
|
|
package/dist/config.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export interface LLMConfig extends Record<string, unknown> {
|
|
|
76
76
|
configuration: Record<string, unknown>;
|
|
77
77
|
apiKeyEnvironmentVariable?: string;
|
|
78
78
|
}
|
|
79
|
-
export declare const availableDefaultConfigs: readonly ["vertexai", "anthropic", "groq", "deepseek", "openai"];
|
|
79
|
+
export declare const availableDefaultConfigs: readonly ["vertexai", "anthropic", "groq", "deepseek", "openai", "google-genai"];
|
|
80
80
|
export type ConfigType = (typeof availableDefaultConfigs)[number];
|
|
81
81
|
export declare const DEFAULT_CONFIG: Partial<SlothConfig>;
|
|
82
82
|
/**
|
package/dist/config.js
CHANGED
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,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;IACX,MAAM;IACN,UAAU;IACV,QAAQ;
|
|
1
|
+
{"version":3,"file":"config.js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;AAC/D,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,aAAmC;IACtD,MAAM,MAAM,GAAG,aAA4B,CAAC;IAC5C,MAAM,YAAY,GAAG;QACnB,GAAG,cAAc;QACjB,GAAG,MAAM;QACT,QAAQ,EAAE,EAAE,GAAG,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,IAAI,EAAE,CAAC,EAAE;KACtE,CAAC;IAEF,yCAAyC;IACzC,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAErC,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,MAAsB,EAAE,GAAkB;IAChE,OAAO,WAAW,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
1
|
import { displayWarning } from '#src/consoleUtils.js';
|
|
3
|
-
import { env
|
|
2
|
+
import { env } from '#src/systemUtils.js';
|
|
4
3
|
import { writeFileIfNotExistsWithMessages } from '#src/utils.js';
|
|
5
4
|
// Function to process JSON config and create Anthropic LLM instance
|
|
6
5
|
export async function processJsonConfig(llmConfig) {
|
|
@@ -20,8 +19,6 @@ const jsonContent = `{
|
|
|
20
19
|
}
|
|
21
20
|
}`;
|
|
22
21
|
export function init(configFileName) {
|
|
23
|
-
const currentDir = getCurrentDir();
|
|
24
|
-
path.join(currentDir, configFileName);
|
|
25
22
|
// Determine which content to use based on file extension
|
|
26
23
|
if (!configFileName.endsWith('.json')) {
|
|
27
24
|
throw new Error('Only JSON config is supported.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic.js","sourceRoot":"","sources":["../../src/presets/anthropic.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"anthropic.js","sourceRoot":"","sources":["../../src/presets/anthropic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AAOjE,oEAAoE;AACpE,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,SAA+C;IAE/C,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,sBAAsB,CAAC,CAAC;IACvD,wEAAwE;IACxE,MAAM,eAAe,GAAG,SAAS,CAAC,MAAM,IAAI,GAAG,CAAC,iBAAiB,CAAC;IAClE,OAAO,IAAI,SAAS,CAAC,aAAa,CAAC;QACjC,GAAG,SAAS;QACZ,MAAM,EAAE,eAAe;QACvB,KAAK,EAAE,SAAS,CAAC,KAAK,IAAI,0BAA0B;KACrD,CAAC,CAAC;AACL,CAAC;AAED,MAAM,WAAW,GAAG;;;;;EAKlB,CAAC;AAEH,MAAM,UAAU,IAAI,CAAC,cAAsB;IACzC,yDAAyD;IACzD,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IAED,gCAAgC,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAC9D,cAAc,CACZ,2BAA2B,cAAc,kCAAkC;QACzE,mDAAmD,CACtD,CAAC;AACJ,CAAC"}
|
package/dist/presets/deepseek.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
1
|
import { displayWarning } from '#src/consoleUtils.js';
|
|
3
|
-
import { env
|
|
2
|
+
import { env } from '#src/systemUtils.js';
|
|
4
3
|
import { writeFileIfNotExistsWithMessages } from '#src/utils.js';
|
|
5
4
|
// Function to process JSON config and create DeepSeek LLM instance
|
|
6
5
|
export async function processJsonConfig(llmConfig) {
|
|
@@ -20,8 +19,6 @@ const jsonContent = `{
|
|
|
20
19
|
}
|
|
21
20
|
}`;
|
|
22
21
|
export function init(configFileName) {
|
|
23
|
-
const currentDir = getCurrentDir();
|
|
24
|
-
path.join(currentDir, configFileName);
|
|
25
22
|
// Determine which content to use based on file extension
|
|
26
23
|
if (!configFileName.endsWith('.json')) {
|
|
27
24
|
throw new Error('Only JSON config is supported.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepseek.js","sourceRoot":"","sources":["../../src/presets/deepseek.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"deepseek.js","sourceRoot":"","sources":["../../src/presets/deepseek.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AAOjE,mEAAmE;AACnE,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,SAAkD;IAElD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,CAAC;IACrD,yEAAyE;IACzE,MAAM,cAAc,GAAG,SAAS,CAAC,MAAM,IAAI,GAAG,CAAC,gBAAgB,CAAC;IAChE,OAAO,IAAI,QAAQ,CAAC,YAAY,CAAC;QAC/B,GAAG,SAAS;QACZ,MAAM,EAAE,cAAc;QACtB,KAAK,EAAE,SAAS,CAAC,KAAK,IAAI,mBAAmB;KAC9C,CAAC,CAAC;AACL,CAAC;AAED,MAAM,WAAW,GAAG;;;;;EAKlB,CAAC;AAEH,MAAM,UAAU,IAAI,CAAC,cAAsB;IACzC,yDAAyD;IACzD,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IAED,gCAAgC,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAC9D,cAAc,CACZ,2BAA2B,cAAc,iCAAiC;QACxE,kDAAkD,CACrD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
|
|
2
|
+
import type { BaseChatModel, BaseChatModelParams } from '@langchain/core/language_models/chat_models';
|
|
3
|
+
export declare function processJsonConfig(llmConfig: ChatGoogleGenerativeAI & BaseChatModelParams): Promise<BaseChatModel>;
|
|
4
|
+
export declare function init(configFileName: string): void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { displayWarning } from '#src/consoleUtils.js';
|
|
2
|
+
import { env } from '#src/systemUtils.js';
|
|
3
|
+
import { writeFileIfNotExistsWithMessages } from '#src/utils.js';
|
|
4
|
+
// Function to process JSON config and create Google GenAI LLM instance
|
|
5
|
+
export async function processJsonConfig(llmConfig) {
|
|
6
|
+
const gemini = await import('@langchain/google-genai');
|
|
7
|
+
// Use config value if available, otherwise use the environment variable
|
|
8
|
+
const googleApiKey = llmConfig.apiKey || env.GOOGLE_API_KEY;
|
|
9
|
+
return new gemini.ChatGoogleGenerativeAI({
|
|
10
|
+
...llmConfig,
|
|
11
|
+
apiKey: googleApiKey,
|
|
12
|
+
model: llmConfig.model || 'gemini-2.5-pro',
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
const jsonContent = `{
|
|
16
|
+
"llm": {
|
|
17
|
+
"type": "google-genai",
|
|
18
|
+
"model": "gemini-2.5-pro"
|
|
19
|
+
}
|
|
20
|
+
}`;
|
|
21
|
+
export function init(configFileName) {
|
|
22
|
+
// Determine which content to use based on file extension
|
|
23
|
+
if (!configFileName.endsWith('.json')) {
|
|
24
|
+
throw new Error('Only JSON config is supported.');
|
|
25
|
+
}
|
|
26
|
+
writeFileIfNotExistsWithMessages(configFileName, jsonContent);
|
|
27
|
+
displayWarning(`You need to update your ${configFileName} to add your Google GenAI API key, ` +
|
|
28
|
+
'or define GOOGLE_API_KEY environment variable.');
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=google-genai.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-genai.js","sourceRoot":"","sources":["../../src/presets/google-genai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AAOjE,uEAAuE;AACvE,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,SAAuD;IAEvD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;IACvD,wEAAwE;IACxE,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,IAAI,GAAG,CAAC,cAAc,CAAC;IAC5D,OAAO,IAAI,MAAM,CAAC,sBAAsB,CAAC;QACvC,GAAG,SAAS;QACZ,MAAM,EAAE,YAAY;QACpB,KAAK,EAAE,SAAS,CAAC,KAAK,IAAI,gBAAgB;KAC3C,CAAC,CAAC;AACL,CAAC;AAED,MAAM,WAAW,GAAG;;;;;EAKlB,CAAC;AAEH,MAAM,UAAU,IAAI,CAAC,cAAsB;IACzC,yDAAyD;IACzD,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IAED,gCAAgC,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAC9D,cAAc,CACZ,2BAA2B,cAAc,qCAAqC;QAC5E,gDAAgD,CACnD,CAAC;AACJ,CAAC"}
|
package/dist/presets/groq.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
1
|
import { displayWarning } from '#src/consoleUtils.js';
|
|
3
|
-
import { env
|
|
2
|
+
import { env } from '#src/systemUtils.js';
|
|
4
3
|
import { writeFileIfNotExistsWithMessages } from '#src/utils.js';
|
|
5
4
|
// Function to process JSON config and create Groq LLM instance
|
|
6
5
|
export async function processJsonConfig(llmConfig) {
|
|
@@ -20,8 +19,6 @@ const jsonContent = `{
|
|
|
20
19
|
}
|
|
21
20
|
}`;
|
|
22
21
|
export function init(configFileName) {
|
|
23
|
-
const currentDir = getCurrentDir();
|
|
24
|
-
path.join(currentDir, configFileName);
|
|
25
22
|
// Determine which content to use based on file extension
|
|
26
23
|
if (!configFileName.endsWith('.json')) {
|
|
27
24
|
throw new Error('Only JSON config is supported.');
|
package/dist/presets/groq.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groq.js","sourceRoot":"","sources":["../../src/presets/groq.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"groq.js","sourceRoot":"","sources":["../../src/presets/groq.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AAIjE,+DAA+D;AAC/D,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,SAAwB;IAC9D,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAC7C,wEAAwE;IACxE,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,IAAI,GAAG,CAAC,YAAY,CAAC;IACxD,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC;QACvB,GAAG,SAAS;QACZ,MAAM,EAAE,UAAU;QAClB,KAAK,EAAE,SAAS,CAAC,KAAK,IAAI,+BAA+B;KAC1D,CAAC,CAAC;AACL,CAAC;AAED,MAAM,WAAW,GAAG;;;;;EAKlB,CAAC;AAEH,MAAM,UAAU,IAAI,CAAC,cAAsB;IACzC,yDAAyD;IACzD,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IAED,gCAAgC,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAC9D,cAAc,CACZ,yBAAyB,cAAc,uBAAuB;QAC5D,8CAA8C,CACjD,CAAC;AACJ,CAAC"}
|
package/dist/presets/openai.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
1
|
import { displayWarning } from '#src/consoleUtils.js';
|
|
3
|
-
import { env
|
|
2
|
+
import { env } from '#src/systemUtils.js';
|
|
4
3
|
import { writeFileIfNotExistsWithMessages } from '#src/utils.js';
|
|
5
4
|
// Function to process JSON config and create OpenAI LLM instance
|
|
6
5
|
// noinspection JSUnusedGlobalSymbols
|
|
@@ -36,8 +35,6 @@ const jsonContent = `{
|
|
|
36
35
|
}
|
|
37
36
|
}`;
|
|
38
37
|
export function init(configFileName) {
|
|
39
|
-
const currentDir = getCurrentDir();
|
|
40
|
-
path.join(currentDir, configFileName);
|
|
41
38
|
// Determine which content to use based on file extension
|
|
42
39
|
if (!configFileName.endsWith('.json')) {
|
|
43
40
|
throw new Error('Only JSON config is supported.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.js","sourceRoot":"","sources":["../../src/presets/openai.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"openai.js","sourceRoot":"","sources":["../../src/presets/openai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AAQjE,iEAAiE;AACjE,qCAAqC;AACrC,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,SAAmE;IAEnE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;IACzD,wEAAwE;IACxE,MAAM,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG;QACnB,GAAG,SAAS;QACZ,MAAM,EAAE,YAAY;QACpB,KAAK,EAAE,SAAS,CAAC,KAAK,IAAI,QAAQ;KACnC,CAAC;IACF,8DAA8D;IAC9D,OAAQ,YAAoB,CAAC,IAAI,CAAC;IAClC,8DAA8D;IAC9D,OAAQ,YAAoB,CAAC,yBAAyB,CAAC;IACvD,OAAO,IAAI,UAAU,CAAC,YAAY,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,SAAS,CAAC,SAAmE;IACpF,8DAA8D;IAC9D,MAAM,IAAI,GAAG,SAA0C,CAAC;IACxD,IAAI,IAAI,CAAC,yBAAyB,IAAI,GAAG,CAAC,IAAI,CAAC,yBAAyB,CAAC,EAAE,CAAC;QAC1E,OAAO,GAAG,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;SAAM,CAAC;QACN,OAAO,SAAS,CAAC,MAAM,IAAI,GAAG,CAAC,cAAc,CAAC;IAChD,CAAC;AACH,CAAC;AAED,MAAM,WAAW,GAAG;;;;;EAKlB,CAAC;AAEH,MAAM,UAAU,IAAI,CAAC,cAAsB;IACzC,yDAAyD;IACzD,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IAED,gCAAgC,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAC9D,cAAc,CACZ,yBAAyB,cAAc,uBAAuB;QAC5D,gDAAgD,CACnD,CAAC;AACJ,CAAC"}
|
package/dist/presets/vertexai.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
1
|
import { displayWarning } from '#src/consoleUtils.js';
|
|
3
|
-
import { getCurrentDir } from '#src/systemUtils.js';
|
|
4
2
|
import { writeFileIfNotExistsWithMessages } from '#src/utils.js';
|
|
5
3
|
const jsonContent = `{
|
|
6
4
|
"llm": {
|
|
@@ -9,8 +7,6 @@ const jsonContent = `{
|
|
|
9
7
|
}
|
|
10
8
|
}`;
|
|
11
9
|
export function init(configFileName) {
|
|
12
|
-
const currentDir = getCurrentDir();
|
|
13
|
-
path.join(currentDir, configFileName);
|
|
14
10
|
// Determine which content to use based on file extension
|
|
15
11
|
if (!configFileName.endsWith('.json')) {
|
|
16
12
|
throw new Error('Only JSON config is supported.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vertexai.js","sourceRoot":"","sources":["../../src/presets/vertexai.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"vertexai.js","sourceRoot":"","sources":["../../src/presets/vertexai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AAIjE,MAAM,WAAW,GAAG;;;;;EAKlB,CAAC;AAEH,MAAM,UAAU,IAAI,CAAC,cAAsB;IACzC,yDAAyD;IACzD,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IAED,gCAAgC,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAC9D,cAAc,CACZ,+GAA+G,CAChH,CAAC;AACJ,CAAC;AAED,mEAAmE;AACnE,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,SAA4B;IAClE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC;IAC5D,OAAO,IAAI,QAAQ,CAAC,YAAY,CAAC;QAC/B,GAAG,SAAS;QACZ,KAAK,EAAE,SAAS,CAAC,KAAK,IAAI,gBAAgB;KAC3C,CAAC,CAAC;AACL,CAAC"}
|
package/docs/CONFIGURATION.md
CHANGED
|
@@ -12,7 +12,6 @@ Your project should have the following files in order for gsloth to function:
|
|
|
12
12
|
- `.gsloth.guidelines.md`
|
|
13
13
|
|
|
14
14
|
> Gaunt Sloth currently only functions from the directory which has one of the configuration files and `.gsloth.guidelines.md`.
|
|
15
|
-
> Global configuration to invoke gsloth anywhere is in [ROADMAP](../ROADMAP.md).
|
|
16
15
|
|
|
17
16
|
## Using .gsloth Directory
|
|
18
17
|
|
|
@@ -94,6 +93,12 @@ gcloud auth login
|
|
|
94
93
|
gcloud auth application-default login
|
|
95
94
|
```
|
|
96
95
|
|
|
96
|
+
### Google GenAI (AI Studio)
|
|
97
|
+
```shell
|
|
98
|
+
cd ./your-project
|
|
99
|
+
gsloth init google-genai
|
|
100
|
+
```
|
|
101
|
+
|
|
97
102
|
### Anthropic
|
|
98
103
|
```shell
|
|
99
104
|
cd ./your-project
|
|
@@ -129,6 +134,7 @@ For providers that use OpenAI-compatible APIs:
|
|
|
129
134
|
cd ./your-project
|
|
130
135
|
gsloth init openai
|
|
131
136
|
```
|
|
137
|
+
|
|
132
138
|
Then edit your configuration file to add the custom base URL and API key. For example, for Inception:
|
|
133
139
|
```json
|
|
134
140
|
{
|
|
@@ -144,7 +150,7 @@ Then edit your configuration file to add the custom base URL and API key. For ex
|
|
|
144
150
|
```
|
|
145
151
|
* apiKeyEnvironmentVariable property can be used to point to the correct API key environment variable.
|
|
146
152
|
|
|
147
|
-
## Examples of configuration for different providers
|
|
153
|
+
## Examples of configuration for different providers
|
|
148
154
|
|
|
149
155
|
### JSON Configuration (.gsloth.config.json)
|
|
150
156
|
|
|
@@ -166,8 +172,7 @@ JSON configuration is simpler but less flexible than JavaScript configuration. I
|
|
|
166
172
|
{
|
|
167
173
|
"llm": {
|
|
168
174
|
"type": "vertexai",
|
|
169
|
-
"model": "gemini-2.5-pro
|
|
170
|
-
"temperature": 0
|
|
175
|
+
"model": "gemini-2.5-pro"
|
|
171
176
|
}
|
|
172
177
|
}
|
|
173
178
|
```
|
|
@@ -219,6 +224,17 @@ JSON configuration is simpler but less flexible than JavaScript configuration. I
|
|
|
219
224
|
}
|
|
220
225
|
```
|
|
221
226
|
|
|
227
|
+
**Example of .gsloth.config.json for Google GenAI**
|
|
228
|
+
```json
|
|
229
|
+
{
|
|
230
|
+
"llm": {
|
|
231
|
+
"type": "google-genai",
|
|
232
|
+
"model": "gemini-2.5-pro",
|
|
233
|
+
"apiKey": "your-api-key-here"
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
222
238
|
### JavaScript Configuration
|
|
223
239
|
|
|
224
240
|
(.gsloth.config.js or .gsloth.config.mjs)
|
|
@@ -337,6 +353,19 @@ export async function configure() {
|
|
|
337
353
|
}
|
|
338
354
|
```
|
|
339
355
|
|
|
356
|
+
**Example of .gsloth.config.js for Google GenAI**
|
|
357
|
+
```javascript
|
|
358
|
+
export async function configure() {
|
|
359
|
+
const googleGenai = await import('@langchain/google-genai');
|
|
360
|
+
return {
|
|
361
|
+
llm: new googleGenai.ChatGoogleGenerativeAI({
|
|
362
|
+
model: 'gemini-2.5-pro',
|
|
363
|
+
apiKey: process.env.GOOGLE_API_KEY, // Default value, but you can provide the key in many different ways, even as literal
|
|
364
|
+
})
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
```
|
|
368
|
+
|
|
340
369
|
## Using other AI providers
|
|
341
370
|
|
|
342
371
|
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).
|
|
@@ -453,10 +482,35 @@ To set GitHub as your default requirements provider, add this to your configurat
|
|
|
453
482
|
|
|
454
483
|
### JIRA
|
|
455
484
|
|
|
456
|
-
Gaunt Sloth supports
|
|
485
|
+
Gaunt Sloth supports three methods to integrate with JIRA:
|
|
486
|
+
|
|
487
|
+
#### Atlassian MCP
|
|
488
|
+
|
|
489
|
+
MCP can be used in `chat` and `code` commands.
|
|
490
|
+
|
|
491
|
+
Gaunt Sloth has OAuth client for MCP and is confirmed to work with public Jira MCP.
|
|
492
|
+
|
|
493
|
+
```json
|
|
494
|
+
{
|
|
495
|
+
"llm": {
|
|
496
|
+
"type": "vertexai",
|
|
497
|
+
"model": "gemini-2.5-pro",
|
|
498
|
+
"temperature": 0
|
|
499
|
+
},
|
|
500
|
+
"mcpServers": {
|
|
501
|
+
"jira": {
|
|
502
|
+
"url": "https://mcp.atlassian.com/v1/sse",
|
|
503
|
+
"authProvider": "OAuth",
|
|
504
|
+
"transport": "sse"
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
```
|
|
457
509
|
|
|
458
510
|
#### 1. Modern Jira REST API (Scoped Token)
|
|
459
511
|
|
|
512
|
+
Jira API is used with `pr` and `review` commands.
|
|
513
|
+
|
|
460
514
|
This method uses the Atlassian REST API v3 with a Personal Access Token (PAT). It requires your Atlassian Cloud ID.
|
|
461
515
|
|
|
462
516
|
**Prerequisites:**
|
|
@@ -513,25 +567,27 @@ JavaScript:
|
|
|
513
567
|
|
|
514
568
|
```javascript
|
|
515
569
|
export async function configure() {
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
}
|
|
570
|
+
const vertexAi = await import('@langchain/google-vertexai');
|
|
571
|
+
return {
|
|
572
|
+
llm: new vertexAi.ChatVertexAI({
|
|
573
|
+
model: "gemini-2.5-pro-preview-05-06"
|
|
574
|
+
}),
|
|
575
|
+
requirementsProvider: 'jira',
|
|
576
|
+
requirementsProviderConfig: {
|
|
577
|
+
'jira': {
|
|
578
|
+
username: 'username@yourcompany.com', // Your Jira username/email
|
|
579
|
+
token: 'YOUR_JIRA_PAT_TOKEN', // Your Personal Access Token
|
|
580
|
+
cloudId: 'YOUR_ATLASSIAN_CLOUD_ID' // Your Atlassian Cloud ID
|
|
581
|
+
}
|
|
529
582
|
}
|
|
583
|
+
}
|
|
530
584
|
}
|
|
531
585
|
```
|
|
532
586
|
|
|
533
587
|
#### 2. Legacy Jira REST API (Unscoped Token)
|
|
534
588
|
|
|
589
|
+
Jira API is used with `pr` and `review` commands.
|
|
590
|
+
|
|
535
591
|
This uses the Unscoped API token (Aka Legacy API token) method with REST API v2.
|
|
536
592
|
|
|
537
593
|
A legacy token can be acquired from `Atlassian Account Settings -> Security -> Create and manage API tokens -> [Create API token without scopes]`.
|
|
@@ -568,19 +624,19 @@ JavaScript:
|
|
|
568
624
|
|
|
569
625
|
```javascript
|
|
570
626
|
export async function configure() {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
}
|
|
627
|
+
const vertexAi = await import('@langchain/google-vertexai');
|
|
628
|
+
return {
|
|
629
|
+
llm: new vertexAi.ChatVertexAI({
|
|
630
|
+
model: "gemini-2.5-pro-preview-05-06"
|
|
631
|
+
}),
|
|
632
|
+
requirementsProvider: 'jira-legacy',
|
|
633
|
+
requirementsProviderConfig: {
|
|
634
|
+
'jira-legacy': {
|
|
635
|
+
username: 'username@yourcompany.com', // Your Jira username/email
|
|
636
|
+
token: 'YOUR_JIRA_LEGACY_TOKEN', // Replace with your real Jira API token
|
|
637
|
+
baseUrl: 'https://yourcompany.atlassian.net/rest/api/2/issue/' // Your Jira instance base URL
|
|
638
|
+
}
|
|
584
639
|
}
|
|
640
|
+
}
|
|
585
641
|
}
|
|
586
642
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gaunt-sloth-assistant",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Andrew Kondratev",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"@langchain/anthropic": "^0.3.24",
|
|
30
30
|
"@langchain/core": "^0.3.62",
|
|
31
31
|
"@langchain/deepseek": "^0.0.2",
|
|
32
|
+
"@langchain/google-genai": "^0.2.14",
|
|
32
33
|
"@langchain/google-vertexai": "^0.2.14",
|
|
33
34
|
"@langchain/groq": "^0.2.3",
|
|
34
35
|
"@langchain/langgraph": "^0.3.6",
|
package/src/config.ts
CHANGED
package/src/presets/anthropic.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
1
|
import { displayWarning } from '#src/consoleUtils.js';
|
|
3
|
-
import { env
|
|
2
|
+
import { env } from '#src/systemUtils.js';
|
|
4
3
|
import { writeFileIfNotExistsWithMessages } from '#src/utils.js';
|
|
5
4
|
import type { AnthropicInput } from '@langchain/anthropic';
|
|
6
5
|
import type {
|
|
@@ -30,9 +29,6 @@ const jsonContent = `{
|
|
|
30
29
|
}`;
|
|
31
30
|
|
|
32
31
|
export function init(configFileName: string): void {
|
|
33
|
-
const currentDir = getCurrentDir();
|
|
34
|
-
path.join(currentDir, configFileName);
|
|
35
|
-
|
|
36
32
|
// Determine which content to use based on file extension
|
|
37
33
|
if (!configFileName.endsWith('.json')) {
|
|
38
34
|
throw new Error('Only JSON config is supported.');
|
package/src/presets/deepseek.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
1
|
import { displayWarning } from '#src/consoleUtils.js';
|
|
3
|
-
import { env
|
|
2
|
+
import { env } from '#src/systemUtils.js';
|
|
4
3
|
import { writeFileIfNotExistsWithMessages } from '#src/utils.js';
|
|
5
4
|
import type {
|
|
6
5
|
BaseChatModel,
|
|
@@ -30,9 +29,6 @@ const jsonContent = `{
|
|
|
30
29
|
}`;
|
|
31
30
|
|
|
32
31
|
export function init(configFileName: string): void {
|
|
33
|
-
const currentDir = getCurrentDir();
|
|
34
|
-
path.join(currentDir, configFileName);
|
|
35
|
-
|
|
36
32
|
// Determine which content to use based on file extension
|
|
37
33
|
if (!configFileName.endsWith('.json')) {
|
|
38
34
|
throw new Error('Only JSON config is supported.');
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { displayWarning } from '#src/consoleUtils.js';
|
|
2
|
+
import { env } from '#src/systemUtils.js';
|
|
3
|
+
import { writeFileIfNotExistsWithMessages } from '#src/utils.js';
|
|
4
|
+
import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
|
|
5
|
+
import type {
|
|
6
|
+
BaseChatModel,
|
|
7
|
+
BaseChatModelParams,
|
|
8
|
+
} from '@langchain/core/language_models/chat_models';
|
|
9
|
+
|
|
10
|
+
// Function to process JSON config and create Google GenAI LLM instance
|
|
11
|
+
export async function processJsonConfig(
|
|
12
|
+
llmConfig: ChatGoogleGenerativeAI & BaseChatModelParams
|
|
13
|
+
): Promise<BaseChatModel> {
|
|
14
|
+
const gemini = await import('@langchain/google-genai');
|
|
15
|
+
// Use config value if available, otherwise use the environment variable
|
|
16
|
+
const googleApiKey = llmConfig.apiKey || env.GOOGLE_API_KEY;
|
|
17
|
+
return new gemini.ChatGoogleGenerativeAI({
|
|
18
|
+
...llmConfig,
|
|
19
|
+
apiKey: googleApiKey,
|
|
20
|
+
model: llmConfig.model || 'gemini-2.5-pro',
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const jsonContent = `{
|
|
25
|
+
"llm": {
|
|
26
|
+
"type": "google-genai",
|
|
27
|
+
"model": "gemini-2.5-pro"
|
|
28
|
+
}
|
|
29
|
+
}`;
|
|
30
|
+
|
|
31
|
+
export function init(configFileName: string): void {
|
|
32
|
+
// Determine which content to use based on file extension
|
|
33
|
+
if (!configFileName.endsWith('.json')) {
|
|
34
|
+
throw new Error('Only JSON config is supported.');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
writeFileIfNotExistsWithMessages(configFileName, jsonContent);
|
|
38
|
+
displayWarning(
|
|
39
|
+
`You need to update your ${configFileName} to add your Google GenAI API key, ` +
|
|
40
|
+
'or define GOOGLE_API_KEY environment variable.'
|
|
41
|
+
);
|
|
42
|
+
}
|
package/src/presets/groq.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
1
|
import { displayWarning } from '#src/consoleUtils.js';
|
|
3
|
-
import { env
|
|
2
|
+
import { env } from '#src/systemUtils.js';
|
|
4
3
|
import { writeFileIfNotExistsWithMessages } from '#src/utils.js';
|
|
5
4
|
import { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
6
5
|
import { ChatGroqInput } from '@langchain/groq';
|
|
@@ -25,9 +24,6 @@ const jsonContent = `{
|
|
|
25
24
|
}`;
|
|
26
25
|
|
|
27
26
|
export function init(configFileName: string): void {
|
|
28
|
-
const currentDir = getCurrentDir();
|
|
29
|
-
path.join(currentDir, configFileName);
|
|
30
|
-
|
|
31
27
|
// Determine which content to use based on file extension
|
|
32
28
|
if (!configFileName.endsWith('.json')) {
|
|
33
29
|
throw new Error('Only JSON config is supported.');
|
package/src/presets/openai.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
1
|
import { displayWarning } from '#src/consoleUtils.js';
|
|
3
|
-
import { env
|
|
2
|
+
import { env } from '#src/systemUtils.js';
|
|
4
3
|
import { writeFileIfNotExistsWithMessages } from '#src/utils.js';
|
|
5
4
|
import {
|
|
6
5
|
BaseChatModel,
|
|
@@ -47,9 +46,6 @@ const jsonContent = `{
|
|
|
47
46
|
}`;
|
|
48
47
|
|
|
49
48
|
export function init(configFileName: string): void {
|
|
50
|
-
const currentDir = getCurrentDir();
|
|
51
|
-
path.join(currentDir, configFileName);
|
|
52
|
-
|
|
53
49
|
// Determine which content to use based on file extension
|
|
54
50
|
if (!configFileName.endsWith('.json')) {
|
|
55
51
|
throw new Error('Only JSON config is supported.');
|
package/src/presets/vertexai.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
1
|
import { displayWarning } from '#src/consoleUtils.js';
|
|
3
|
-
import { getCurrentDir } from '#src/systemUtils.js';
|
|
4
2
|
import { writeFileIfNotExistsWithMessages } from '#src/utils.js';
|
|
5
3
|
import { ChatVertexAIInput } from '@langchain/google-vertexai';
|
|
6
4
|
import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
@@ -13,9 +11,6 @@ const jsonContent = `{
|
|
|
13
11
|
}`;
|
|
14
12
|
|
|
15
13
|
export function init(configFileName: string): void {
|
|
16
|
-
const currentDir = getCurrentDir();
|
|
17
|
-
path.join(currentDir, configFileName);
|
|
18
|
-
|
|
19
14
|
// Determine which content to use based on file extension
|
|
20
15
|
if (!configFileName.endsWith('.json')) {
|
|
21
16
|
throw new Error('Only JSON config is supported.');
|