chore: added flag additions for minimizing logs

This commit is contained in:
Khaushik-keygraph
2025-12-09 23:59:12 +05:30
parent c664000458
commit 38e49eb1eb
2 changed files with 14 additions and 3 deletions

View File

@@ -115,9 +115,9 @@ async function runClaudePrompt(prompt, sourceDir, allowedTools = 'Read', context
// Disable status manager - using simple JSON filtering for all agents now // Disable status manager - using simple JSON filtering for all agents now
const statusManager = null; const statusManager = null;
// Setup progress indicator for clean output agents // Setup progress indicator for clean output agents (unless disabled via flag)
let progressIndicator = null; let progressIndicator = null;
if (useCleanOutput) { if (useCleanOutput && !global.SHANNON_DISABLE_LOADER) {
const agentType = description.includes('Pre-recon') ? 'pre-reconnaissance' : const agentType = description.includes('Pre-recon') ? 'pre-reconnaissance' :
description.includes('Recon') ? 'reconnaissance' : description.includes('Recon') ? 'reconnaissance' :
description.includes('Report') ? 'report generation' : 'analysis'; description.includes('Report') ? 'report generation' : 'analysis';
@@ -216,10 +216,20 @@ async function runClaudePrompt(prompt, sourceDir, allowedTools = 'Read', context
let messageCount = 0; let messageCount = 0;
let lastHeartbeat = Date.now();
const HEARTBEAT_INTERVAL = 30000; // 30 seconds
try { try {
for await (const message of query({ prompt: fullPrompt, options })) { for await (const message of query({ prompt: fullPrompt, options })) {
messageCount++; messageCount++;
// Periodic heartbeat for long-running agents (only when loader is disabled)
const now = Date.now();
if (global.SHANNON_DISABLE_LOADER && now - lastHeartbeat > HEARTBEAT_INTERVAL) {
console.log(chalk.blue(` ⏱️ [${Math.floor((now - timer.startTime) / 1000)}s] ${description} running... (Turn ${turnCount})`));
lastHeartbeat = now;
}
if (message.type === "assistant") { if (message.type === "assistant") {
turnCount++; turnCount++;

View File

@@ -27,7 +27,8 @@ export function showHelp() {
console.log(chalk.yellow.bold('OPTIONS:')); console.log(chalk.yellow.bold('OPTIONS:'));
console.log(' --config <file> YAML configuration file for authentication and testing parameters'); console.log(' --config <file> YAML configuration file for authentication and testing parameters');
console.log(' --pipeline-testing Use minimal prompts for fast pipeline testing (creates minimal deliverables)\n'); console.log(' --pipeline-testing Use minimal prompts for fast pipeline testing (creates minimal deliverables)');
console.log(' --disable-loader Disable the animated progress loader (useful when logs interfere with spinner)\n');
console.log(chalk.yellow.bold('DEVELOPER COMMANDS:')); console.log(chalk.yellow.bold('DEVELOPER COMMANDS:'));
console.log(' --run-phase Run all agents in a phase (parallel execution for 5x speedup)'); console.log(' --run-phase Run all agents in a phase (parallel execution for 5x speedup)');