| commit | a9ecbaf47981d9849970079fe100b52db8cf7f3c | [log] [download] |
|---|---|---|
| author | Claude Agent Developer <claude-agent@example.com> | Sun Sep 28 16:07:05 2025 +0800 |
| committer | Rivoreo Autopilot <autopilot@rivoreo.one> | Sun Sep 28 22:41:17 2025 +0800 |
| tree | 79fdae17b1e3c3bd6b4181759d70bf8674ce38e3 | |
| parent | cecdd5107d760772e0f760b268982ddb1e7dd658 [diff] |
fix(sshout): preserve indentation and inline spacing in responses Remove inline space compression and leading space trimming to preserve code formatting, lists, and intentional spacing in SSHOUT responses. Changes: - Remove `re.sub(r'[ \t]+', ' ', response)` (inline space compression) - Remove `re.sub(r'\n[ \t]+', '\n', response)` (leading space trimming) - Keep only trailing space removal: `re.sub(r'[ \t]+\n', '\n', response)` - Update tests to reflect preserved formatting This preserves: - Code indentation (e.g., Python code blocks) - List formatting (e.g., " - item") - Intentional multiple spaces - Leading spaces after newlines Only removes: - Trailing spaces at end of lines - Leading/trailing spaces of entire response (via .strip()) - Excessive consecutive newlines (3+ => 2) Test results: All 195 SSHOUT unit tests passing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
基于ClaudeCodeSDK的功能丰富智能命令行Agent,支持增强CLI交互、SSHOUT聊天室集成和YOLO自主思考模式。
claude-agent/ ├── src/claude_agent/ # 源代码 │ ├── core/ # 核心功能 │ │ └── agent.py # Agent核心逻辑 │ ├── cli/ # 命令行界面 │ │ ├── interface.py # 基础CLI │ │ └── enhanced_interface.py # 增强CLI │ ├── sshout/ # SSHOUT集成 │ │ └── integration.py # 聊天室集成 │ ├── mcp/ # MCP工具支持 │ │ ├── integration.py # MCP集成 │ │ └── tool_manager.py # 工具管理 │ └── utils/ # 工具函数 │ └── helpers.py # 辅助工具 ├── tests/ # 测试套件 (55个单元测试 + 12个黑盒测试) │ ├── unit/test_*/ # 单元测试 (按模块组织) │ ├── integration/ # 集成测试 │ ├── blackbox/ # 端到端测试 │ └── fixtures/ # 测试数据 ├── docs/ # 项目文档 │ ├── ENHANCED_FEATURES_REPORT.md │ ├── COMPREHENSIVE_TEST_REPORT.md │ └── MCP_SUPPORT.md ├── scripts/ # 启动脚本 │ ├── main.py # 基础版本 │ └── main_enhanced.py # 增强版本 ├── configs/ # 配置文件 ├── assets/ssh-keys/ # SSH密钥文件 └── pyproject.toml # 项目配置
# Python 3.9+ 环境 source venv/bin/activate pip install -r requirements.txt
# 设置环境变量 export ANTHROPIC_API_KEY="your_api_key_here"
# 增强版CLI (推荐) python scripts/main_enhanced.py # YOLO自主模式 + 可视化思考过程 python scripts/main_enhanced.py --mode yolo # 自动连接SSHOUT聊天室 python scripts/main_enhanced.py --sshout # 组合使用 python scripts/main_enhanced.py --mode yolo --sshout
# 完整测试套件 python tests/run_tests.py # 单元测试 (100%通过率) pytest tests/unit/ -v # 黑盒测试 pytest tests/blackbox/ -v
# CLI中的SSHOUT命令 > sshout connect # 连接聊天室 > sshout status # 查看连接状态 > sshout send 消息 # 发送消息 > sshout disconnect # 断开连接
# 在CLI中使用 > help # 显示帮助 > status # 显示系统状态 > history # 查看历史记录 > mode # 切换思考模式 > tools # 显示可用工具
sshout_config = { 'hostname': 'tianjin1.rivoreo.one', 'port': 22333, 'username': 'sshout', 'key_path': 'assets/ssh-keys/id_ecdsa_sshout_test' }
@Claude、@claude、@CLAUDEClaude:、claude:# 格式化代码 black src/ tests/ isort src/ tests/ # 类型检查 mypy src/
# 添加新的单元测试 # tests/unit/test_[module]/test_[feature].py # 运行特定测试 pytest tests/unit/test_sshout/ -v
MIT License - 详见 LICENSE 文件
当前版本: v2.0.0 (增强版) 测试状态: ✅ 55/55 单元测试通过 功能状态: 🚀 生产就绪