From cdfbb95d7b197640a2cc936ea3fc036fdc6d05d7 Mon Sep 17 00:00:00 2001 From: rUv Date: Mon, 5 Jan 2026 21:15:09 +0000 Subject: [PATCH] checkpoint: File edit: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🚀 Generated with [Claude Code](https://claude.com/claude-code) 📊 V3 Development Progress Checkpoint Co-Authored-By: Claude Sonnet 4 --- .claude/helpers/swarm-hooks.sh | 25 ++++++++++++++++--------- v3/@claude-flow/cli/README.md | 26 ++++++++++++++++++-------- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/.claude/helpers/swarm-hooks.sh b/.claude/helpers/swarm-hooks.sh index 96ef1e98a5..9601120909 100755 --- a/.claude/helpers/swarm-hooks.sh +++ b/.claude/helpers/swarm-hooks.sh @@ -429,14 +429,21 @@ initiate_handoff() { local ho_id="ho_$(date +%s)_$(head -c 4 /dev/urandom | xxd -p)" local timestamp=$(date +%s) - # Parse context or use defaults - local context=$(echo "$context_json" | jq -c '. + { - filesModified: (.filesModified // []), - patternsUsed: (.patternsUsed // []), - decisions: (.decisions // []), - blockers: (.blockers // []), - nextSteps: (.nextSteps // []) - }' 2>/dev/null || echo '{"filesModified":[],"patternsUsed":[],"decisions":[],"blockers":[],"nextSteps":[]}') + # Parse context or use defaults - ensure valid JSON + local context + if command -v jq &>/dev/null && echo "$context_json" | jq -e . >/dev/null 2>&1; then + context=$(echo "$context_json" | jq -c '{ + filesModified: (.filesModified // []), + patternsUsed: (.patternsUsed // []), + decisions: (.decisions // []), + blockers: (.blockers // []), + nextSteps: (.nextSteps // []) + }') + else + context='{"filesModified":[],"patternsUsed":[],"decisions":[],"blockers":[],"nextSteps":[]}' + fi + + local desc_escaped=$(echo -n "$description" | jq -Rs .) local ho_file="$HANDOFFS_DIR/$ho_id.json" cat > "$ho_file" << EOF @@ -445,7 +452,7 @@ initiate_handoff() { "fromAgent": "$AGENT_ID", "fromAgentName": "$AGENT_NAME", "toAgent": "$to_agent", - "description": $(echo "$description" | jq -Rs .), + "description": $desc_escaped, "context": $context, "status": "pending", "timestamp": $timestamp diff --git a/v3/@claude-flow/cli/README.md b/v3/@claude-flow/cli/README.md index 24d858b34f..9dbae62396 100644 --- a/v3/@claude-flow/cli/README.md +++ b/v3/@claude-flow/cli/README.md @@ -119,22 +119,32 @@ const progress = new Progress({ total: 100 }); ### Interactive Prompts ```typescript -import { prompt } from '@claude-flow/cli'; +import { text, select, confirm, input, multiSelect } from '@claude-flow/cli'; // Text input -const name = await prompt.text('Enter your name:'); +const name = await text('Enter your name:'); -// Selection -const choice = await prompt.select('Choose option:', ['A', 'B', 'C']); +// Selection (with options array) +const choice = await select({ + message: 'Choose option:', + options: [ + { label: 'Option A', value: 'A' }, + { label: 'Option B', value: 'B' }, + { label: 'Option C', value: 'C' }, + ] +}); // Confirmation -const confirmed = await prompt.confirm('Continue?'); +const confirmed = await confirm({ message: 'Continue?' }); -// Password (hidden input) -const password = await prompt.password('Enter password:'); +// General input +const response = await input({ message: 'Enter value:', default: 'default' }); // Multi-select -const selections = await prompt.multiSelect('Select features:', features); +const selections = await multiSelect({ + message: 'Select features:', + options: features.map(f => ({ label: f.name, value: f.id })) +}); ``` ## Global Options