mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 15:31:27 +00:00
feat(cli): make /btw command non-blocking with parallel execution
- Add btwItem state management independent from pendingItem - Add cancelBtw functionality to abort in-flight BTW API calls - Allow /btw commands to execute concurrently with main responses - Add isBtwCommand utility function - Update BtwMessage UI with cleaner styling (remove spinner) - Add tests for concurrent /btw execution scenarios - Update layouts to render BTW messages in fixed bottom area Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
d885ef710a
commit
0a1ffd98eb
17 changed files with 497 additions and 156 deletions
|
|
@ -62,6 +62,21 @@ export const isSlashCommand = (query: string): boolean => {
|
|||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if a query is a /btw side-question invocation.
|
||||
* Accepts both "/btw" and "?btw" prefixes.
|
||||
*/
|
||||
export const isBtwCommand = (query: string): boolean => {
|
||||
const trimmed = query.trim();
|
||||
if (!trimmed) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const normalized = trimmed.startsWith('?') ? `/${trimmed.slice(1)}` : trimmed;
|
||||
|
||||
return /^\/btw(?:\s|$)/.test(normalized);
|
||||
};
|
||||
|
||||
const debugLogger = createDebugLogger('COMMAND_UTILS');
|
||||
|
||||
// Copies a string snippet to the clipboard for different platforms
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue