mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 04:00:36 +00:00
feat: add MCP tool progress update support in TUI and SDK mode
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
36931e1eab
commit
5ebbceea65
14 changed files with 724 additions and 25 deletions
|
|
@ -20,6 +20,7 @@ import type {
|
|||
PlanResultDisplay,
|
||||
AnsiOutput,
|
||||
Config,
|
||||
McpToolProgressData,
|
||||
} from '@qwen-code/qwen-code-core';
|
||||
import { AgentExecutionDisplay } from '../subagents/index.js';
|
||||
import { PlanSummaryDisplay } from '../PlanSummaryDisplay.js';
|
||||
|
|
@ -113,6 +114,22 @@ const useResultDisplayRenderer = (
|
|||
};
|
||||
}
|
||||
|
||||
// Check for McpToolProgressData
|
||||
if (
|
||||
typeof resultDisplay === 'object' &&
|
||||
resultDisplay !== null &&
|
||||
'type' in resultDisplay &&
|
||||
resultDisplay.type === 'mcp_tool_progress'
|
||||
) {
|
||||
const progress = resultDisplay as McpToolProgressData;
|
||||
const msg = progress.message ?? `Progress: ${progress.progress}`;
|
||||
const totalStr = progress.total != null ? `/${progress.total}` : '';
|
||||
return {
|
||||
type: 'string',
|
||||
data: `⏳ [${progress.progress}${totalStr}] ${msg}`,
|
||||
};
|
||||
}
|
||||
|
||||
// Check for AnsiOutput
|
||||
if (
|
||||
typeof resultDisplay === 'object' &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue