Files
ruflo/v2/scripts/fix-ts-final.sh
T
rUvandClaude Opus 4.5 1b6a1971f7 feat(v3): add comprehensive v3 implementation plans and swarm architecture
- Reorganize v3/ into implementation/ subfolders:
  - planning/, architecture/, migration/, integration/
  - security/, adrs/, research/, swarm-plans/

- Add 15-agent concurrent swarm implementation plans:
  - SWARM-OVERVIEW.md: Hierarchical mesh topology, 4 phases
  - AGENT-SPECIFICATIONS.md: 15 agent configs with capabilities
  - TDD-LONDON-SCHOOL-PLAN.md: Mock-first TDD methodology
  - BENCHMARK-OPTIMIZATION.md: Performance targets (2.49x-7.47x)
  - DEPLOYMENT-PLAN.md: Release strategy, CI/CD, rollback
  - GITHUB-ISSUE-TRACKING.md: Issue workflow with agent replies

- Update .claude/settings.json with proper hooks format
- Add bash aliases for claude --dangerously-skip-permissions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 15:40:51 +00:00

50 lines
2.3 KiB
Bash
Executable File

#!/bin/bash
echo "🔧 Final TypeScript fixes..."
# Fix 1: Move shebang to first line
echo "📝 Fixing shebang placement..."
for file in src/cli/cli-core.ts src/cli/index-remote.ts src/cli/index.ts src/cli/main.ts src/cli/simple-cli.ts src/swarm/prompt-cli.ts; do
if [ -f "$file" ]; then
# Extract shebang if it exists anywhere
shebang=$(grep -m1 '^#!/usr/bin/env' "$file" || echo "")
if [ -n "$shebang" ]; then
# Remove shebang from current location
sed -i '/^#!/d' "$file"
# Add shebang as first line
echo "$shebang" | cat - "$file" > temp && mv temp "$file"
fi
fi
done
# Fix 2: Remove duplicate imports that may have been added
echo "📝 Removing duplicate process imports..."
for file in $(find src -name "*.ts" -type f); do
# Count process imports
count=$(grep -c "import process from" "$file" 2>/dev/null || echo 0)
if [ "$count" -gt 1 ]; then
# Keep only the first import
awk '/import process from/ && !f{f=1; print; next} !/import process from/' "$file" > temp && mv temp "$file"
fi
done
# Fix 3: Fix incorrect waitForConnection recursion
echo "📝 Fixing waitForConnection recursion..."
sed -i 's/resolve();$/checkConnection();/g' src/swarm/strategies/research.ts
# Fix 4: Fix double method declarations
echo "📝 Fixing duplicate method declarations..."
sed -i 's/override async start(): Promise<void> {$/override async stop(): Promise<void> {/2' src/mcp/transports/http.ts
sed -i 's/override async start(): Promise<void> {$/override async connect(): Promise<void> {/3' src/mcp/transports/http.ts
sed -i 's/override async start(): Promise<void> {$/override async disconnect(): Promise<void> {/4' src/mcp/transports/http.ts
# Fix 5: Fix duplicate onSwarmEvent declarations
echo "📝 Fixing duplicate interface method declarations..."
sed -i '/onSwarmEvent(type: EventType, handler: (event: SwarmEvent) => void): this;/{N;/onSwarmEvent(type: EventType, handler: (event: SwarmEvent) => void): this;/d;}' src/swarm/types.ts
# Fix 6: Fix import type back to correct format where needed
echo "📝 Fixing import statements..."
sed -i 's/import { WebSocketServer, WebSocket }/import type { WebSocketServer, WebSocket }/g' src/mcp/transports/http.ts
sed -i 's/import { MCPTransportError }/import type { MCPTransportError }/g' src/mcp/transports/http.ts
echo "✅ Final fixes applied!"