Merge pull request #589 from devchat-ai/auto_custom_workflow

Auto custom workflow
This commit is contained in:
boob.yang 2024-09-02 16:28:56 +08:00 committed by GitHub
commit 46e17b99c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 33 additions and 4 deletions

2
gui

@ -1 +1 @@
Subproject commit d3ae07dc82798ba0679629ddf4feb79339458e6d
Subproject commit 87fb8b5d9d6cd937c449e00218b1777c38ee1ba2

View File

@ -208,6 +208,7 @@ export function registerInstallCommandsCommand(
if (!fs.existsSync(sysDirPath)) {
// Directory does not exist, wait for updateWorkflows to finish
await dcClient.updateWorkflows();
await dcClient.updateCustomWorkflows();
sendCommandListByDevChatRun();
} else {
// Directory exists, execute sendCommandListByDevChatRun immediately
@ -215,6 +216,8 @@ export function registerInstallCommandsCommand(
// Then asynchronously execute updateWorkflows
await dcClient.updateWorkflows();
await dcClient.updateCustomWorkflows();
await sendCommandListByDevChatRun();
}
}

View File

@ -82,3 +82,5 @@ messageHandler.registerHandler('getIDEServicePort', getIDEServicePort);
messageHandler.registerHandler('readServerConfigBase', readServerConfigBase);
messageHandler.registerHandler('writeServerConfigBase', writeServerConfigBase);

View File

@ -57,4 +57,4 @@ export async function sendCommandListByDevChatRun() {
if (existPannel) {
await getWorkflowCommandList({}, existPannel!);
}
}
}

View File

@ -7,3 +7,10 @@ export async function getServicePort() {
// return await UiUtilWrapper.getLSPBrigePort();
return process.env.DEVCHAT_IDE_SERVICE_PORT;
}
export async function getLocalServicePort() {
logger
.channel()
?.info(`get local service port: ${process.env.DC_LOCALSERVICE_PORT}`);
return process.env.DC_LOCALSERVICE_PORT;
}

View File

@ -3,7 +3,7 @@ import * as http from "http";
import * as querystring from "querystring";
import { logger } from "../util/logger";
import { getServicePort } from "./endpoints/getServicePort";
import { getServicePort, getLocalServicePort } from "./endpoints/getServicePort";
import { installPythonEnv } from "./endpoints/installPythonEnv";
import { ideLogging} from "./endpoints/ideLogging";
import { updateSlashCommands } from "./endpoints/updateSlashCommands";
@ -26,6 +26,10 @@ const functionRegistry: any = {
keys: [],
handler: getServicePort,
},
"/get_local_service_port": {
keys: [],
handler: getLocalServicePort,
},
"/install_python_env": {
keys: ["command_name", "requirements_file"],
handler: installPythonEnv,

View File

@ -229,6 +229,19 @@ export class DevChatClient {
);
}
@timeThis
@catchAndReturn(undefined)
async updateCustomWorkflows(): Promise<void> {
const response = await this._post("/workflows/custom_update");
logger
.channel()
?.trace(
`updateCustomWorkflows response data: \n${JSON.stringify(
response.data
)}`
);
}
@timeThis
async message(
message: ChatRequest,

2
tools

@ -1 +1 @@
Subproject commit 0acb8467457b463118465cb067b1216860fd9e6d
Subproject commit aac7c2116641f3086583661ffcba066c6bf02cf8