Provide suggestions for running commands (restart/refresh/rebuild) (#62)

This commit is contained in:
Will Chen
2025-05-01 21:44:51 -07:00
committed by GitHub
parent a8fd91a410
commit 1bbfedc668
5 changed files with 149 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ import {
getDyadExecuteSqlTags,
getDyadRenameTags,
getDyadWriteTags,
getDyadCommandTags,
processFullResponseActions,
} from "../processors/response_processor";
import log from "electron-log";
@@ -247,6 +248,24 @@ const getProposalHandler = async (
id: "write-code-properly",
});
}
// Check for command tags and add corresponding actions
const commandTags = getDyadCommandTags(latestAssistantMessage.content);
if (commandTags.includes("rebuild")) {
actions.push({
id: "rebuild",
});
}
if (commandTags.includes("restart")) {
actions.push({
id: "restart",
});
}
if (commandTags.includes("refresh")) {
actions.push({
id: "refresh",
});
}
}
// Get all chat messages to calculate token usage