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

@@ -138,6 +138,19 @@ export function getDyadExecuteSqlTags(fullResponse: string): SqlQuery[] {
return queries;
}
export function getDyadCommandTags(fullResponse: string): string[] {
const dyadCommandRegex =
/<dyad-command type="([^"]+)"[^>]*><\/dyad-command>/g;
let match;
const commands: string[] = [];
while ((match = dyadCommandRegex.exec(fullResponse)) !== null) {
commands.push(match[1]);
}
return commands;
}
interface Output {
message: string;
error: unknown;