feat: 优化历史记录输出,增加工具使用统计和过滤提示信息

This commit is contained in:
catlog22
2025-12-26 12:28:48 +08:00
parent 6bc8b7de95
commit ecd5085e51
3 changed files with 21 additions and 13 deletions

View File

@@ -87,13 +87,13 @@ Generate CPCC-compliant software design specification documents (软件设计说
## Directory Setup ## Directory Setup
```javascript ```javascript
// 跨平台目录创建 // 生成时间戳目录名
const timestamp = new Date().toISOString().replace(/[-:]/g, '').slice(0, 15); const timestamp = new Date().toISOString().slice(0,19).replace(/[-:T]/g, '');
const dir = `.workflow/.scratchpad/copyright-${timestamp}`; const dir = `.workflow/.scratchpad/copyright-${timestamp}`;
// Windows // Windows (cmd)
Bash(`if not exist "${dir}\\sections" mkdir "${dir}\\sections"`); Bash(`mkdir "${dir}\\sections"`);
Bash(`if not exist "${dir}\\iterations" mkdir "${dir}\\iterations"`); Bash(`mkdir "${dir}\\iterations"`);
// Unix/macOS // Unix/macOS
// Bash(`mkdir -p "${dir}/sections" "${dir}/iterations"`); // Bash(`mkdir -p "${dir}/sections" "${dir}/iterations"`);

View File

@@ -117,13 +117,13 @@ Generate comprehensive project analysis reports through multi-phase iterative wo
## Directory Setup ## Directory Setup
```javascript ```javascript
// 跨平台目录创建 // 生成时间戳目录名
const timestamp = new Date().toISOString().replace(/[-:]/g, '').slice(0, 15); const timestamp = new Date().toISOString().slice(0,19).replace(/[-:T]/g, '');
const dir = `.workflow/.scratchpad/analyze-${timestamp}`; const dir = `.workflow/.scratchpad/analyze-${timestamp}`;
// Windows // Windows (cmd)
Bash(`if not exist "${dir}\\sections" mkdir "${dir}\\sections"`); Bash(`mkdir "${dir}\\sections"`);
Bash(`if not exist "${dir}\\iterations" mkdir "${dir}\\iterations"`); Bash(`mkdir "${dir}\\iterations"`);
// Unix/macOS // Unix/macOS
// Bash(`mkdir -p "${dir}/sections" "${dir}/iterations"`); // Bash(`mkdir -p "${dir}/sections" "${dir}/iterations"`);

View File

@@ -788,8 +788,15 @@ async function historyAction(options: HistoryOptions): Promise<void> {
return; return;
} }
// Compact table header // Count by tool
console.log(chalk.gray(` Total: ${history.total} | Showing: ${history.executions.length}\n`)); const toolCounts: Record<string, number> = {};
for (const exec of history.executions) {
toolCounts[exec.tool] = (toolCounts[exec.tool] || 0) + 1;
}
const toolSummary = Object.entries(toolCounts).map(([t, c]) => `${t}:${c}`).join(' ');
// Compact table header with tool breakdown
console.log(chalk.gray(` Total: ${history.total} | Showing: ${history.executions.length} (${toolSummary})\n`));
console.log(chalk.gray(' Status Tool Time Duration ID')); console.log(chalk.gray(' Status Tool Time Duration ID'));
console.log(chalk.gray(' ' + '─'.repeat(70))); console.log(chalk.gray(' ' + '─'.repeat(70)));
@@ -813,7 +820,8 @@ async function historyAction(options: HistoryOptions): Promise<void> {
// Usage hint // Usage hint
console.log(); console.log();
console.log(chalk.gray(' ' + '─'.repeat(70))); console.log(chalk.gray(' ' + '─'.repeat(70)));
console.log(chalk.dim(' View output: ccw cli output <id> --final')); console.log(chalk.dim(' Filter: ccw cli history --tool <gemini|codex|qwen> --limit <n>'));
console.log(chalk.dim(' Output: ccw cli output <id> --final'));
console.log(); console.log();
} }