gaunt-sloth-assistant 0.8.12 → 0.9.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.code.md +32 -19
- package/.gsloth.guidelines.md +4 -2
- package/README.md +11 -1
- package/dist/builtInToolsConfig.d.ts +2 -1
- package/dist/builtInToolsConfig.js +16 -4
- package/dist/builtInToolsConfig.js.map +1 -1
- package/dist/cli.js +17 -12
- package/dist/cli.js.map +1 -1
- package/dist/commands/askCommand.d.ts +3 -1
- package/dist/commands/askCommand.js +3 -2
- package/dist/commands/askCommand.js.map +1 -1
- package/dist/commands/chatCommand.d.ts +2 -1
- package/dist/commands/chatCommand.js +3 -3
- package/dist/commands/chatCommand.js.map +1 -1
- package/dist/commands/codeCommand.d.ts +2 -1
- package/dist/commands/codeCommand.js +2 -2
- package/dist/commands/codeCommand.js.map +1 -1
- package/dist/commands/prCommand.d.ts +2 -1
- package/dist/commands/prCommand.js +2 -2
- package/dist/commands/prCommand.js.map +1 -1
- package/dist/commands/reviewCommand.d.ts +2 -1
- package/dist/commands/reviewCommand.js +2 -2
- package/dist/commands/reviewCommand.js.map +1 -1
- package/dist/config.d.ts +48 -6
- package/dist/config.js +33 -34
- package/dist/config.js.map +1 -1
- package/dist/core/GthAgentRunner.d.ts +0 -2
- package/dist/core/GthAgentRunner.js +22 -9
- package/dist/core/GthAgentRunner.js.map +1 -1
- package/dist/core/GthLangChainAgent.d.ts +0 -2
- package/dist/core/GthLangChainAgent.js +50 -12
- package/dist/core/GthLangChainAgent.js.map +1 -1
- package/dist/core/types.d.ts +0 -1
- package/dist/debugUtils.d.ts +20 -0
- package/dist/debugUtils.js +89 -0
- package/dist/debugUtils.js.map +1 -0
- package/dist/llmUtils.d.ts +0 -1
- package/dist/llmUtils.js +0 -8
- package/dist/llmUtils.js.map +1 -1
- package/dist/modules/interactiveSessionModule.d.ts +2 -1
- package/dist/modules/interactiveSessionModule.js +24 -6
- package/dist/modules/interactiveSessionModule.js.map +1 -1
- package/dist/presets/openrouter.d.ts +5 -0
- package/dist/presets/openrouter.js +54 -0
- package/dist/presets/openrouter.js.map +1 -0
- package/dist/tools/GthDevToolkit.d.ts +21 -0
- package/dist/tools/GthDevToolkit.js +182 -0
- package/dist/tools/GthDevToolkit.js.map +1 -0
- package/dist/tools/GthFileSystemToolkit.js +25 -16
- package/dist/tools/GthFileSystemToolkit.js.map +1 -1
- package/dist/tools/gthSequentialThinkingTool.d.ts +53 -0
- package/dist/tools/gthSequentialThinkingTool.js +130 -0
- package/dist/tools/gthSequentialThinkingTool.js.map +1 -0
- package/package.json +9 -8
package/.gsloth.code.md
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
|
-
# Code Mode Instructions
|
|
2
|
-
|
|
3
|
-
You are an AI coding assistant with full file system access within the user's project. Your role is to:
|
|
4
|
-
|
|
5
|
-
- Help write, modify, and debug code
|
|
6
|
-
- Understand and work with the existing codebase
|
|
7
|
-
- Follow project conventions and best practices
|
|
8
|
-
- Create, read, update, and delete files as needed to complete coding tasks
|
|
9
|
-
- Run commands and scripts to test and validate changes
|
|
10
|
-
- Provide clear explanations of the changes you make
|
|
11
|
-
|
|
12
|
-
You have access to the entire project directory and can:
|
|
13
|
-
- Navigate the file system
|
|
14
|
-
- Read and analyze existing code
|
|
15
|
-
- Make modifications to implement features or fix bugs
|
|
16
|
-
- Create new files and directories as needed
|
|
17
|
-
- Execute commands to
|
|
18
|
-
|
|
19
|
-
Focus on writing clean, maintainable code that follows the project's established patterns and conventions. Always test your changes when possible and explain what you're doing and why.
|
|
1
|
+
# Code Mode Instructions
|
|
2
|
+
|
|
3
|
+
You are an AI coding assistant with full file system access within the user's project. Your role is to:
|
|
4
|
+
|
|
5
|
+
- Help write, modify, and debug code
|
|
6
|
+
- Understand and work with the existing codebase
|
|
7
|
+
- Follow project conventions and best practices
|
|
8
|
+
- Create, read, update, and delete files as needed to complete coding tasks
|
|
9
|
+
- Run commands and scripts to test and validate changes
|
|
10
|
+
- Provide clear explanations of the changes you make
|
|
11
|
+
|
|
12
|
+
You have access to the entire project directory and can:
|
|
13
|
+
- Navigate the file system
|
|
14
|
+
- Read and analyze existing code
|
|
15
|
+
- Make modifications to implement features or fix bugs
|
|
16
|
+
- Create new files and directories as needed
|
|
17
|
+
- Execute commands to run tests, build the project or run static analysis (lint)
|
|
18
|
+
|
|
19
|
+
Focus on writing clean, maintainable code that follows the project's established patterns and conventions. Always test your changes when possible and explain what you're doing and why.
|
|
20
|
+
|
|
21
|
+
## Running tests
|
|
22
|
+
|
|
23
|
+
- When working on functionality always prefer running a single test, over the entire suite;
|
|
24
|
+
- Abstain from running tests in circles, run the test once, if it fails — inspect the output carefully and try to fix it;
|
|
25
|
+
- Run full tests suite as a penultimate step, when everything is fixed, but before running the lint;
|
|
26
|
+
- Run lint only as a final step when everything else is fixed;
|
|
27
|
+
- If nothing seems to work, ask for user's assistance;
|
|
28
|
+
|
|
29
|
+
## Sequential thinking
|
|
30
|
+
|
|
31
|
+
Use gth_sequential_thinking tool if the problem has multiple steps, or it turns to be complicated,
|
|
32
|
+
but make sure to continue with your task after finishing with the sequential thinking tool.
|
package/.gsloth.guidelines.md
CHANGED
|
@@ -52,6 +52,8 @@ Use [llmUtils.ts](src/llmUtils.ts) to access LLM.
|
|
|
52
52
|
|
|
53
53
|
## Testing (Important)
|
|
54
54
|
|
|
55
|
+
Tests are located in `spec/`; Integration tests are located in `integration-tests/`;
|
|
56
|
+
|
|
55
57
|
- In spec files never import mocked files themselves, mock them, and a tested file should import them.
|
|
56
58
|
- Always import the tested file dynamically within the test.
|
|
57
59
|
- Mocks are hoisted, so it is better to simply place them at the top of the file to avoid confusion.
|
|
@@ -148,8 +150,8 @@ Please follow this workflow:
|
|
|
148
150
|
- Make sure all tests pass `npm run test` and fix if possible.
|
|
149
151
|
- Request relevant documentation if some of the test failures are unclear.
|
|
150
152
|
- Once all tests are green check lint with `npm run lint`.
|
|
151
|
-
- If any lint failures are present try fixing them with `npm run lint
|
|
153
|
+
- If any lint failures are present try fixing them with `npm run lint-n-fix`.
|
|
152
154
|
- If autofix didn't help, try fixing them yourself.
|
|
153
|
-
- Prefer testing all user outputs, including testing absence of unexpected outputs.
|
|
155
|
+
- Prefer testing all user outputs, including testing the absence of unexpected outputs.
|
|
154
156
|
|
|
155
157
|
---
|
package/README.md
CHANGED
|
@@ -47,6 +47,7 @@ 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
|
+
- OpenRouter
|
|
50
51
|
- Groq;
|
|
51
52
|
- DeepSeek;
|
|
52
53
|
- Google AI Studio and Google Vertex AI;
|
|
@@ -141,7 +142,7 @@ npm install gaunt-sloth-assistant -g
|
|
|
141
142
|
> Note, however, is that project guidelines are going to be used from current directory if they exist and simple install dir prompt is going to be used if nothing found.
|
|
142
143
|
|
|
143
144
|
Configuration can be created with `gsloth init [vendor]` command.
|
|
144
|
-
Currently, anthropic, groq, deepseek, openai, google-genai, vertexai and xai can be configured with `gsloth init [vendor]`.
|
|
145
|
+
Currently, openrouter, anthropic, groq, deepseek, openai, google-genai, vertexai and xai can be configured with `gsloth init [vendor]`.
|
|
145
146
|
For OpenAI-compatible providers like Inception, use `gsloth init openai` and modify the configuration.
|
|
146
147
|
|
|
147
148
|
More detailed information on configuration can be found in [CONFIGURATION.md](./docs/CONFIGURATION.md)
|
|
@@ -164,6 +165,15 @@ gcloud auth login
|
|
|
164
165
|
gcloud auth application-default login
|
|
165
166
|
```
|
|
166
167
|
|
|
168
|
+
### Open Router
|
|
169
|
+
|
|
170
|
+
```shell
|
|
171
|
+
cd ./your-project
|
|
172
|
+
gsloth init openrouter
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Make sure you either define `OPEN_ROUTER_API_KEY` environment variable or edit your configuration file and set up your key.
|
|
176
|
+
|
|
167
177
|
### Anthropic
|
|
168
178
|
|
|
169
179
|
```shell
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StructuredToolInterface } from '@langchain/core/tools';
|
|
2
2
|
import { GthConfig } from '#src/config.js';
|
|
3
|
+
import { GthCommand } from '#src/core/types.js';
|
|
3
4
|
/**
|
|
4
5
|
* Get default tools based on filesystem and built-in tools configuration
|
|
5
6
|
*/
|
|
6
|
-
export declare function getDefaultTools(config: GthConfig): Promise<StructuredToolInterface[]>;
|
|
7
|
+
export declare function getDefaultTools(config: GthConfig, command?: GthCommand): Promise<StructuredToolInterface[]>;
|
|
@@ -1,22 +1,34 @@
|
|
|
1
1
|
import GthFileSystemToolkit from '#src/tools/GthFileSystemToolkit.js';
|
|
2
2
|
import { displayWarning } from '#src/consoleUtils.js';
|
|
3
3
|
import { getCurrentDir } from '#src/systemUtils.js';
|
|
4
|
+
import GthDevToolkit from '#src/tools/GthDevToolkit.js';
|
|
4
5
|
const AVAILABLE_BUILT_IN_TOOLS = {
|
|
5
6
|
gth_status_update: '#src/tools/gthStatusUpdateTool.js',
|
|
6
7
|
gth_jira_log_work: '#src/tools/gthJiraLogWorkTool.js',
|
|
8
|
+
gth_sequential_thinking: '#src/tools/gthSequentialThinkingTool.js',
|
|
7
9
|
};
|
|
8
10
|
/**
|
|
9
11
|
* Get default tools based on filesystem and built-in tools configuration
|
|
10
12
|
*/
|
|
11
|
-
export async function getDefaultTools(config) {
|
|
12
|
-
const filesystemTools = filterFilesystemTools(
|
|
13
|
+
export async function getDefaultTools(config, command) {
|
|
14
|
+
const filesystemTools = filterFilesystemTools(config.filesystem);
|
|
13
15
|
const builtInTools = await getBuiltInTools(config);
|
|
14
|
-
|
|
16
|
+
const devTools = await filterDevTools(command, config.commands?.code?.devTools);
|
|
17
|
+
return [...filesystemTools, ...devTools, ...builtInTools];
|
|
18
|
+
}
|
|
19
|
+
async function filterDevTools(command, devToolConfig) {
|
|
20
|
+
if (command != 'code' || !devToolConfig) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
const thinking = await import(AVAILABLE_BUILT_IN_TOOLS.gth_sequential_thinking);
|
|
24
|
+
const toolkit = new GthDevToolkit(devToolConfig);
|
|
25
|
+
return [thinking.get(), ...toolkit.getTools()];
|
|
15
26
|
}
|
|
16
27
|
/**
|
|
17
28
|
* Filter filesystem tools based on configuration
|
|
18
29
|
*/
|
|
19
|
-
function filterFilesystemTools(
|
|
30
|
+
function filterFilesystemTools(filesystemConfig) {
|
|
31
|
+
const toolkit = new GthFileSystemToolkit([getCurrentDir()]);
|
|
20
32
|
if (filesystemConfig === 'all') {
|
|
21
33
|
return toolkit.getTools();
|
|
22
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtInToolsConfig.js","sourceRoot":"","sources":["../src/builtInToolsConfig.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,oCAAoC,CAAC;AAGtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,wBAAwB,GAAG;IAC/B,iBAAiB,EAAE,mCAAmC;IACtD,iBAAiB,EAAE,kCAAkC;
|
|
1
|
+
{"version":3,"file":"builtInToolsConfig.js","sourceRoot":"","sources":["../src/builtInToolsConfig.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,oCAAoC,CAAC;AAGtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,aAAa,MAAM,6BAA6B,CAAC;AAExD,MAAM,wBAAwB,GAAG;IAC/B,iBAAiB,EAAE,mCAAmC;IACtD,iBAAiB,EAAE,kCAAkC;IACrD,uBAAuB,EAAE,yCAAyC;CACnE,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,MAAiB,EACjB,OAAoB;IAEpB,MAAM,eAAe,GAAG,qBAAqB,CAAC,MAAM,CAA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,CAAC,YAAY,EAAE,CAAC;QAC3C,IAAI,QAAQ,IAAI,wBAAwB,EAAE,CAAC;YACzC,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,MAAM,MAAM,CACvB,wBAAwB,CAAC,QAAiD,CAAC,CAC5E,CAAC;gBACF,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;YAC/B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,cAAc,CAAC,iCAAiC,QAAQ,MAAM,KAAK,EAAE,CAAC,CAAC;YACzE,CAAC;QACH,CAAC;aAAM,CAAC;YACN,cAAc,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -7,32 +7,37 @@ import { chatCommand } from '#src/commands/chatCommand.js';
|
|
|
7
7
|
import { codeCommand } from '#src/commands/codeCommand.js';
|
|
8
8
|
import { getSlothVersion } from '#src/utils.js';
|
|
9
9
|
import { argv, readStdin } from '#src/systemUtils.js';
|
|
10
|
-
import { setVerbose } from '#src/llmUtils.js';
|
|
11
|
-
import { setCustomConfigPath } from '#src/config.js';
|
|
12
10
|
const program = new Command();
|
|
13
11
|
program
|
|
14
12
|
.name('gsloth')
|
|
15
13
|
.description('Gaunt Sloth Assistant reviewing your PRs')
|
|
16
14
|
.version(getSlothVersion())
|
|
17
|
-
.option('--verbose', '
|
|
15
|
+
.option('--verbose', 'Set LangChain/LangGraph to verbose mode, ' +
|
|
16
|
+
'causing LangChain/LangGraph to log many details to the console. ' +
|
|
17
|
+
'Consider using debugLog from config.ts for less intrusive debug logging.')
|
|
18
18
|
.option('-c, --config <path>', 'Path to custom configuration file')
|
|
19
19
|
.addOption(new Option('--nopipe').hideHelp(true));
|
|
20
|
+
const cliConfigOverrides = {};
|
|
20
21
|
// Parse global options before binding any commands
|
|
21
22
|
program.parseOptions(argv);
|
|
22
23
|
if (program.getOptionValue('verbose')) {
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Set LangChain/LangGraph to verbose mode,
|
|
26
|
+
* causing LangChain/LangGraph to log many details to the console.
|
|
27
|
+
* debugLog from config.ts may be a less intrusive option.
|
|
28
|
+
*/
|
|
29
|
+
cliConfigOverrides.verbose = true;
|
|
25
30
|
}
|
|
26
31
|
if (program.getOptionValue('config')) {
|
|
27
|
-
// Set custom config path
|
|
28
|
-
|
|
32
|
+
// Set a custom config path
|
|
33
|
+
cliConfigOverrides.customConfigPath = program.getOptionValue('config');
|
|
29
34
|
}
|
|
30
35
|
// Initialize all commands - they will handle their own config loading
|
|
31
36
|
initCommand(program);
|
|
32
|
-
reviewCommand(program);
|
|
33
|
-
prCommand(program);
|
|
34
|
-
askCommand(program);
|
|
35
|
-
chatCommand(program);
|
|
36
|
-
codeCommand(program);
|
|
37
|
+
reviewCommand(program, cliConfigOverrides);
|
|
38
|
+
prCommand(program, cliConfigOverrides);
|
|
39
|
+
askCommand(program, cliConfigOverrides);
|
|
40
|
+
chatCommand(program, cliConfigOverrides);
|
|
41
|
+
codeCommand(program, cliConfigOverrides);
|
|
37
42
|
await readStdin(program);
|
|
38
43
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AA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,CAAC,EAAE,CAAC;IACtC;;;;OAIG;IACH,kBAAkB,CAAC,OAAO,GAAG,IAAI,CAAC;AACpC,CAAC;AACD,IAAI,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;IACrC,2BAA2B;IAC3B,kBAAkB,CAAC,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;AACzE,CAAC;AAED,sEAAsE;AACtE,WAAW,CAAC,OAAO,CAAC,CAAC;AACrB,aAAa,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AAC3C,SAAS,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AACvC,UAAU,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AACxC,WAAW,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AACzC,WAAW,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AAEzC,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
+
import { CommandLineConfigOverrides } from '#src/config.js';
|
|
2
3
|
/**
|
|
3
4
|
* Adds the ask command to the program
|
|
4
5
|
* @param program - The commander program
|
|
6
|
+
* @param commandLineConfigOverrides - command line config overrides
|
|
5
7
|
*/
|
|
6
|
-
export declare function askCommand(program: Command): void;
|
|
8
|
+
export declare function askCommand(program: Command, commandLineConfigOverrides: CommandLineConfigOverrides): void;
|
|
@@ -5,15 +5,16 @@ import { getStringFromStdin } from '#src/systemUtils.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* Adds the ask command to the program
|
|
7
7
|
* @param program - The commander program
|
|
8
|
+
* @param commandLineConfigOverrides - command line config overrides
|
|
8
9
|
*/
|
|
9
|
-
export function askCommand(program) {
|
|
10
|
+
export function askCommand(program, commandLineConfigOverrides) {
|
|
10
11
|
program
|
|
11
12
|
.command('ask')
|
|
12
13
|
.description('Ask a question')
|
|
13
14
|
.argument('[message]', 'A message')
|
|
14
15
|
.option('-f, --file [files...]', 'Input files. Content of these files will be added BEFORE the message')
|
|
15
16
|
.action(async (message, options) => {
|
|
16
|
-
const config = await initConfig();
|
|
17
|
+
const config = await initConfig(commandLineConfigOverrides);
|
|
17
18
|
const systemPrompt = readSystemPrompt();
|
|
18
19
|
const preamble = [readBackstory(), readGuidelines(config.projectGuidelines)];
|
|
19
20
|
if (systemPrompt) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"askCommand.js","sourceRoot":"","sources":["../../src/commands/askCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,
|
|
1
|
+
{"version":3,"file":"askCommand.js","sourceRoot":"","sources":["../../src/commands/askCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAA8B,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAMzD;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACxB,OAAgB,EAChB,0BAAsD;IAEtD,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;SACA,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,OAA0B,EAAE,EAAE;QAC5D,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,0BAA0B,CAAC,CAAC;QAC5D,MAAM,YAAY,GAAG,gBAAgB,EAAE,CAAC;QACxC,MAAM,QAAQ,GAAG,CAAC,aAAa,EAAE,EAAE,cAAc,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAC7E,IAAI,YAAY,EAAE,CAAC;YACjB,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC9B,CAAC;QACD,MAAM,OAAO,GAAG,EAAE,CAAC;QACnB,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,OAAO,CAAC,IAAI,CAAC,+BAA+B,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9D,CAAC;QACD,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;QAC7C,IAAI,eAAe,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAChC,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;QAED,sDAAsD;QACtD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;QACxF,CAAC;QAED,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,EAAE,MAAM,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
|
|
2
|
+
import { CommandLineConfigOverrides } from '#src/config.js';
|
|
3
|
+
export declare function chatCommand(program: Command, commandLineConfigOverrides: CommandLineConfigOverrides): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createInteractiveSession } from '#src/modules/interactiveSessionModule.js';
|
|
2
2
|
import { readChatPrompt } from '#src/prompt.js';
|
|
3
|
-
export function chatCommand(program) {
|
|
3
|
+
export function chatCommand(program, commandLineConfigOverrides) {
|
|
4
4
|
const sessionConfig = {
|
|
5
5
|
mode: 'chat',
|
|
6
6
|
readModePrompt: readChatPrompt,
|
|
@@ -10,7 +10,7 @@ export function chatCommand(program) {
|
|
|
10
10
|
};
|
|
11
11
|
// Start chat when no command typed
|
|
12
12
|
program.action(async () => {
|
|
13
|
-
await createInteractiveSession(sessionConfig);
|
|
13
|
+
await createInteractiveSession(sessionConfig, commandLineConfigOverrides);
|
|
14
14
|
});
|
|
15
15
|
// Chat command
|
|
16
16
|
program
|
|
@@ -18,7 +18,7 @@ export function chatCommand(program) {
|
|
|
18
18
|
.description('Start an interactive chat session with Gaunt Sloth')
|
|
19
19
|
.argument('[message]', 'Initial message to start the chat')
|
|
20
20
|
.action(async (message) => {
|
|
21
|
-
await createInteractiveSession(sessionConfig, message);
|
|
21
|
+
await createInteractiveSession(sessionConfig, commandLineConfigOverrides, message);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
//# sourceMappingURL=chatCommand.js.map
|
|
@@ -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;
|
|
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;AAGhD,MAAM,UAAU,WAAW,CACzB,OAAgB,EAChB,0BAAsD;IAEtD,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,EAAE,0BAA0B,CAAC,CAAC;IAC5E,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,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
|
|
2
|
+
import { CommandLineConfigOverrides } from '#src/config.js';
|
|
3
|
+
export declare function codeCommand(program: Command, commandLineConfigOverrides: CommandLineConfigOverrides): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createInteractiveSession } from '#src/modules/interactiveSessionModule.js';
|
|
2
2
|
import { readCodePrompt } from '#src/prompt.js';
|
|
3
|
-
export function codeCommand(program) {
|
|
3
|
+
export function codeCommand(program, commandLineConfigOverrides) {
|
|
4
4
|
program
|
|
5
5
|
.command('code')
|
|
6
6
|
.description('Interactively write code with sloth (has full file system access within your project)')
|
|
@@ -13,7 +13,7 @@ export function codeCommand(program) {
|
|
|
13
13
|
readyMessage: '\nGaunt Sloth is ready to code. Type your prompt.',
|
|
14
14
|
exitMessage: "Type 'exit' or hit Ctrl+C to exit code session\n",
|
|
15
15
|
};
|
|
16
|
-
await createInteractiveSession(sessionConfig, message);
|
|
16
|
+
await createInteractiveSession(sessionConfig, commandLineConfigOverrides, message);
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=codeCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeCommand.js","sourceRoot":"","sources":["../../src/commands/codeCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAiB,MAAM,0CAA0C,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"codeCommand.js","sourceRoot":"","sources":["../../src/commands/codeCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAiB,MAAM,0CAA0C,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,MAAM,UAAU,WAAW,CACzB,OAAgB,EAChB,0BAAsD;IAEtD,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CACV,uFAAuF,CACxF;SACA,QAAQ,CAAC,WAAW,EAAE,2CAA2C,CAAC;SAClE,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,EAAE;QAChC,MAAM,aAAa,GAAkB;YACnC,IAAI,EAAE,MAAM;YACZ,cAAc,EAAE,cAAc;YAC9B,WAAW,EACT,uFAAuF;YACzF,YAAY,EAAE,mDAAmD;YACjE,WAAW,EAAE,kDAAkD;SAChE,CAAC;QAEF,MAAM,wBAAwB,CAAC,aAAa,EAAE,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
|
|
2
|
+
import { CommandLineConfigOverrides } from '#src/config.js';
|
|
3
|
+
export declare function prCommand(program: Command, commandLineConfigOverrides: CommandLineConfigOverrides): void;
|
|
@@ -3,7 +3,7 @@ import { readBackstory, readGuidelines, readReviewInstructions, readSystemPrompt
|
|
|
3
3
|
import { readMultipleFilesFromCurrentDir } from '#src/utils.js';
|
|
4
4
|
import { CONTENT_PROVIDERS, getRequirementsFromProvider, REQUIREMENTS_PROVIDERS, } from './commandUtils.js';
|
|
5
5
|
import jiraLogWork from '#src/helpers/jira/jiraLogWork.js';
|
|
6
|
-
export function prCommand(program) {
|
|
6
|
+
export function prCommand(program, commandLineConfigOverrides) {
|
|
7
7
|
program
|
|
8
8
|
.command('pr')
|
|
9
9
|
.description('Review provided Pull Request in current directory. ' +
|
|
@@ -16,7 +16,7 @@ export function prCommand(program) {
|
|
|
16
16
|
.option('-m, --message <message>', 'Extra message to provide just before the content')
|
|
17
17
|
.action(async (prId, requirementsId, options) => {
|
|
18
18
|
const { initConfig } = await import('#src/config.js');
|
|
19
|
-
const config = await initConfig(); // Initialize and get config
|
|
19
|
+
const config = await initConfig(commandLineConfigOverrides); // Initialize and get config
|
|
20
20
|
const systemPrompt = readSystemPrompt();
|
|
21
21
|
const systemMessage = [
|
|
22
22
|
readBackstory(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prCommand.js","sourceRoot":"","sources":["../../src/commands/prCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EACL,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EACL,iBAAiB,EAEjB,2BAA2B,EAC3B,sBAAsB,GAEvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,WAAW,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"prCommand.js","sourceRoot":"","sources":["../../src/commands/prCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EACL,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,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AQ,EAAE,EAAE,EAAE,yBAAyB,EAC9C,CAAC;YACD,0DAA0D;YAC1D,IAAI,UAAU,GACZ,MAAM,CAAC,kBAAkB,EAAE,IAAI;gBAC9B,MAAM,CAAC,0BAA0B,EAAE,IAAmB,CAAC;YAC1D,MAAM,WAAW,CACf,UAAU,EACV,cAAc,EACd,MAAM,CAAC,QAAQ,EAAE,EAAE,EAAE,yBAAyB,EAC9C,aAAa,CACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
|
|
2
|
+
import { CommandLineConfigOverrides } from '#src/config.js';
|
|
3
|
+
export declare function reviewCommand(program: Command, cliConfigOverrides: CommandLineConfigOverrides): void;
|
|
@@ -3,7 +3,7 @@ import { readBackstory, readGuidelines, readReviewInstructions, readSystemPrompt
|
|
|
3
3
|
import { readMultipleFilesFromCurrentDir } from '#src/utils.js';
|
|
4
4
|
import { getStringFromStdin } from '#src/systemUtils.js';
|
|
5
5
|
import { REQUIREMENTS_PROVIDERS, CONTENT_PROVIDERS, getRequirementsFromProvider, getContentFromProvider, } from './commandUtils.js';
|
|
6
|
-
export function reviewCommand(program) {
|
|
6
|
+
export function reviewCommand(program, cliConfigOverrides) {
|
|
7
7
|
program
|
|
8
8
|
.command('review')
|
|
9
9
|
.description('Review provided diff or other content')
|
|
@@ -18,7 +18,7 @@ export function reviewCommand(program) {
|
|
|
18
18
|
.option('-m, --message <message>', 'Extra message to provide just before the content')
|
|
19
19
|
.action(async (contentId, options) => {
|
|
20
20
|
const { initConfig } = await import('#src/config.js');
|
|
21
|
-
const config = await initConfig(); // Initialize and get config
|
|
21
|
+
const config = await initConfig(cliConfigOverrides); // Initialize and get config
|
|
22
22
|
const systemPrompt = readSystemPrompt();
|
|
23
23
|
const systemMessage = [
|
|
24
24
|
readBackstory(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reviewCommand.js","sourceRoot":"","sources":["../../src/commands/reviewCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EACL,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EAGjB,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"reviewCommand.js","sourceRoot":"","sources":["../../src/commands/reviewCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EACL,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EAGjB,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAW3B,MAAM,UAAU,aAAa,CAC3B,OAAgB,EAChB,kBAA8C;IAE9C,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,uCAAuC,CAAC;SACpD,QAAQ,CACP,aAAa,EACb,wEAAwE,CACzE;SACA,KAAK,CAAC,GAAG,CAAC;QACX,0DAA0D;SACzD,MAAM,CACL,uBAAuB,EACvB,2FAA2F,CAC5F;QACD,2FAA2F;SAC1F,MAAM,CAAC,mCAAmC,EAAE,+BAA+B,CAAC;SAC5E,SAAS,CACR,IAAI,MAAM,CACR,oDAAoD,EACpD,wCAAwC,CACzC,CAAC,OAAO,CAAC,MA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CAAC,CAAC;QAC7B,CAAC;QAED,MAAM,eAAe,GAAG,MAAM,sBAAsB,CAAC,eAAe,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QACzF,IAAI,eAAe,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAChC,CAAC;QAED,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,OAAO,CAAC,IAAI,CAAC,+BAA+B,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9D,CAAC;QACD,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;QAC7C,IAAI,eAAe,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAChC,CAAC;QACD,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;QACD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,8BAA8B,CAAC,CAAC;QAChE,MAAM,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export interface RawGthConfig extends BaseGthConfig {
|
|
|
47
47
|
* This is a basic interface for Gaunt Sloth config.
|
|
48
48
|
*/
|
|
49
49
|
interface BaseGthConfig {
|
|
50
|
+
debugLog?: boolean;
|
|
50
51
|
llm: unknown;
|
|
51
52
|
contentProvider?: string;
|
|
52
53
|
requirementsProvider?: string;
|
|
@@ -86,6 +87,7 @@ interface BaseGthConfig {
|
|
|
86
87
|
code?: {
|
|
87
88
|
filesystem?: string[] | 'all' | 'read' | 'none';
|
|
88
89
|
builtInTools?: string[];
|
|
90
|
+
devTools?: GthDevToolsConfig;
|
|
89
91
|
};
|
|
90
92
|
};
|
|
91
93
|
}
|
|
@@ -93,29 +95,69 @@ export type CustomToolsConfig = Record<string, object>;
|
|
|
93
95
|
export type BuiltInToolsConfig = {
|
|
94
96
|
jira: JiraConfig;
|
|
95
97
|
};
|
|
98
|
+
/**
|
|
99
|
+
* Config for {@link GthDevToolkit}.
|
|
100
|
+
* Tools are not applied when config is not provided.
|
|
101
|
+
* Only available in `code` mode.
|
|
102
|
+
*/
|
|
103
|
+
export interface GthDevToolsConfig {
|
|
104
|
+
/**
|
|
105
|
+
* Optional shell command to run tests.
|
|
106
|
+
* Not applied when config is not provided.
|
|
107
|
+
*/
|
|
108
|
+
run_tests?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Optional shell command to run static analysis (lint).
|
|
111
|
+
* Not applied when config is not provided.
|
|
112
|
+
*/
|
|
113
|
+
run_lint?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Optional shell command to run the build.
|
|
116
|
+
* Not applied when config is not provided.
|
|
117
|
+
*/
|
|
118
|
+
run_build?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Optional shell command to run a single test file.
|
|
121
|
+
* Supports command interpolation with the `${testPath}` placeholder.
|
|
122
|
+
* Example: "npm test -- ${testPath}" or "jest ${testPath}"
|
|
123
|
+
* Example: "npm test" - the test will simply be appended
|
|
124
|
+
* Not applied when config is not provided.
|
|
125
|
+
*/
|
|
126
|
+
run_single_test?: string;
|
|
127
|
+
}
|
|
96
128
|
export interface LLMConfig extends Record<string, unknown> {
|
|
97
129
|
type: string;
|
|
98
130
|
model: string;
|
|
99
131
|
configuration: Record<string, unknown>;
|
|
100
132
|
apiKeyEnvironmentVariable?: string;
|
|
101
133
|
}
|
|
102
|
-
export declare const availableDefaultConfigs: readonly ["vertexai", "anthropic", "groq", "deepseek", "openai", "google-genai", "xai"];
|
|
134
|
+
export declare const availableDefaultConfigs: readonly ["vertexai", "anthropic", "groq", "deepseek", "openai", "google-genai", "xai", "openrouter"];
|
|
103
135
|
export type ConfigType = (typeof availableDefaultConfigs)[number];
|
|
104
|
-
export
|
|
105
|
-
|
|
106
|
-
|
|
136
|
+
export interface CommandLineConfigOverrides {
|
|
137
|
+
/**
|
|
138
|
+
* Custom config path
|
|
139
|
+
*/
|
|
140
|
+
customConfigPath?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Set LangChain/LangGraph to verbose mode,
|
|
143
|
+
* causing LangChain/LangGraph to log many details to the console.
|
|
144
|
+
* debugLog from config.ts may be a less intrusive option.
|
|
145
|
+
*/
|
|
146
|
+
verbose?: boolean;
|
|
147
|
+
}
|
|
107
148
|
export declare const DEFAULT_CONFIG: Partial<GthConfig>;
|
|
108
149
|
/**
|
|
109
150
|
* Initialize configuration by loading from available config files
|
|
110
151
|
* @returns The loaded GthConfig
|
|
111
152
|
*/
|
|
112
|
-
export declare function initConfig(): Promise<GthConfig>;
|
|
153
|
+
export declare function initConfig(commandLineConfigOverrides: CommandLineConfigOverrides): Promise<GthConfig>;
|
|
113
154
|
/**
|
|
114
155
|
* Process JSON LLM config by creating the appropriate LLM instance
|
|
115
156
|
* @param jsonConfig - The parsed JSON config
|
|
157
|
+
* @param commandLineConfigOverrides - command line config overrides
|
|
116
158
|
* @returns Promise<GthConfig>
|
|
117
159
|
*/
|
|
118
|
-
export declare function tryJsonConfig(jsonConfig: RawGthConfig): Promise<GthConfig>;
|
|
160
|
+
export declare function tryJsonConfig(jsonConfig: RawGthConfig, commandLineConfigOverrides: CommandLineConfigOverrides): Promise<GthConfig>;
|
|
119
161
|
export declare function createProjectConfig(configType: string): Promise<void>;
|
|
120
162
|
export declare function writeProjectReviewPreamble(): void;
|
|
121
163
|
export {};
|