JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
fix: tui /copy补充有效交互信息
jingjinduo48348b4b1b15
diff --git a/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/copy.ts b/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/copy.tsindex 9d209beb52..763b485315 100644--- a/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/copy.ts+++ b/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/copy.ts@@ -33,12 +33,21 @@ export function createCopyCommand(): SlashCommand {}const texts = getRecentAssistantMessages(ctx);- const text = texts[index - 1];- if (!text) {- ctx.addItem(addError(ctx.sessionId, `No assistant response found for /copy ${index}`));+ if (texts.length === 0) {+ ctx.addItem(addError(ctx.sessionId, "No assistant message to copy"));+ return;+ }++ if (index > texts.length) {+ const countText = texts.length === 1 ? "message" : "messages";+ ctx.addItem(+ addError(ctx.sessionId, `Only ${texts.length} assistant ${countText} available to copy`),+ );return;}+ const text = texts[index - 1];+if (!copyToClipboard(text)) {ctx.addItem(addError(ctx.sessionId, "Clipboard integration is unavailable on this system"));return;