mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Starting to modularize into separate cli / server packages. (#55)
* Starting to move a lot of code into packages/server * More of the massive refactor, builds and runs, some issues though. * Fixing outstanding issue with double messages. * Fixing a minor UI issue. * Fixing the build post-merge. * Running formatting. * Addressing comments.
This commit is contained in:
@@ -16,20 +16,19 @@ import { EditTool } from './tools/edit.tool.js';
|
||||
import { TerminalTool } from './tools/terminal.tool.js';
|
||||
import { WriteFileTool } from './tools/write-file.tool.js';
|
||||
import { WebFetchTool } from './tools/web-fetch.tool.js';
|
||||
import { globalConfig } from './config/config.js';
|
||||
|
||||
// TODO(b/411707095): remove. left here as an example of how to pull in inter-package deps
|
||||
import { helloServer } from '@gemini-code/server';
|
||||
helloServer();
|
||||
import { loadCliConfig } from './config/config.js';
|
||||
|
||||
async function main() {
|
||||
// Configure tools
|
||||
registerTools(globalConfig.getTargetDir());
|
||||
// Load configuration
|
||||
const config = loadCliConfig();
|
||||
|
||||
// Render UI
|
||||
// Configure tools using the loaded config
|
||||
registerTools(config.getTargetDir());
|
||||
|
||||
// Render UI, passing necessary config values
|
||||
render(
|
||||
React.createElement(App, {
|
||||
directory: globalConfig.getTargetDir(),
|
||||
config,
|
||||
}),
|
||||
);
|
||||
}
|
||||
@@ -81,12 +80,13 @@ main().catch((error) => {
|
||||
});
|
||||
|
||||
function registerTools(targetDir: string) {
|
||||
const config = loadCliConfig();
|
||||
const lsTool = new LSTool(targetDir);
|
||||
const readFileTool = new ReadFileTool(targetDir);
|
||||
const grepTool = new GrepTool(targetDir);
|
||||
const globTool = new GlobTool(targetDir);
|
||||
const editTool = new EditTool(targetDir);
|
||||
const terminalTool = new TerminalTool(targetDir);
|
||||
const terminalTool = new TerminalTool(targetDir, config);
|
||||
const writeFileTool = new WriteFileTool(targetDir);
|
||||
const webFetchTool = new WebFetchTool();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user