Merge pull request #19 from KeygraphHQ/additional-flags

chore: added flag additions for minimizing logs
This commit is contained in:
Arjun Malleswaran
2025-12-09 10:33:36 -08:00
committed by GitHub
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
const statusManager = null;
// Setup progress indicator for clean output agents
// Setup progress indicator for clean output agents (unless disabled via flag)
let progressIndicator = null;
if (useCleanOutput) {
if (useCleanOutput && !global.SHANNON_DISABLE_LOADER) {
const agentType = description.includes('Pre-recon') ? 'pre-reconnaissance' :
description.includes('Recon') ? 'reconnaissance' :
description.includes('Report') ? 'report generation' : 'analysis';
@@ -216,10 +216,20 @@ async function runClaudePrompt(prompt, sourceDir, allowedTools = 'Read', context
let messageCount = 0;
let lastHeartbeat = Date.now();
const HEARTBEAT_INTERVAL = 30000; // 30 seconds
try {
for await (const message of query({ prompt: fullPrompt, options })) {
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") {
turnCount++;

View File

@@ -27,7 +27,8 @@ export function showHelp() {
console.log(chalk.yellow.bold('OPTIONS:'));
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(' --run-phase Run all agents in a phase (parallel execution for 5x speedup)');