Major refactoring: HTTP client unification and project restructuring
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 13m53s

## HTTP Client Refactoring
- Create unified HttpClient module (src/http_client.rs)
- Refactor 24 files to use shared HTTP client
- Replace .unwrap() with proper error handling
- Eliminate code duplication in HTTP requests

## Project Restructuring
- Rename package: ai → aibot
- Add dual binary support: aibot (main) + ai (compatibility alias)
- Migrate config directory: ~/.config/ai/ → ~/.config/syui/ai/bot/
- Implement backward compatibility with automatic migration

## Testing Infrastructure
- Add unit tests for HttpClient
- Create test infrastructure with cargo-make
- Add test commands: test, test-quick, test-verbose

## Documentation
- Complete migration guide with step-by-step instructions
- Updated development guide with new structure
- HTTP client API reference documentation
- Comprehensive refactoring summary

## Files Changed
- Modified: 24 source files (HTTP client integration)
- Added: src/http_client.rs, src/alias.rs, src/tests/
- Added: 5 documentation files in docs/
- Added: migration setup script

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-06-06 23:47:12 +09:00
parent 998777d46a
commit a17d2c9d66
45 changed files with 1871 additions and 593 deletions

37
scripts/setup-migration.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
# ai.bot 移行セットアップスクリプト
echo "=== ai.bot Migration Setup ==="
# 1. 新しい設定ディレクトリの作成
echo "Creating new config directory..."
mkdir -p ~/.config/syui/ai/bot/
# 2. スクリプトディレクトリの移動gitサブモジュール
if [ -d ~/.config/ai/scpt ]; then
echo "Copying script directory..."
cp -r ~/.config/ai/scpt ~/.config/syui/ai/bot/
echo "Scripts copied to ~/.config/syui/ai/bot/scpt/"
fi
# 3. 設定ファイルの移行自動的にdata.rsで行われる
echo "Configuration files will be migrated automatically when used."
# 4. エイリアス設定の提案
echo ""
echo "=== Manual Steps Required ==="
echo ""
echo "1. Add this alias to your shell profile (~/.zshrc, ~/.bashrc, etc.):"
echo " alias ai='aibot'"
echo ""
echo "2. Install the new binaries:"
echo " cargo install --path ."
echo ""
echo "3. Or add to PATH:"
echo " export PATH=\"$(pwd)/target/debug:\$PATH\""
echo ""
echo "4. Update git submodule path if needed:"
echo " cd ~/.config/syui/ai/bot/scpt"
echo " git remote -v # Check current remote"
echo ""
echo "Migration setup complete!"