Skip to content

Conversation

@kdush
Copy link
Owner

@kdush kdush commented Feb 1, 2026

Pull Request

📋 Changes Summary

🎯 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Maintenance/refactoring
  • 🧪 Tests
  • 🚀 Performance improvement

🔍 Testing

  • Unit tests pass locally
  • Integration tests pass locally
  • Manual testing completed
  • Code quality checks pass (lint, type check)

Test Configuration:

  • Python version:
  • OS:
  • Dependencies:

📝 Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

📚 Documentation

  • README updated (if applicable)
  • CHANGELOG.md updated
  • API documentation updated (if applicable)
  • Configuration examples updated (if applicable)

🔗 Related Issues

Fixes #
Related to #

📸 Screenshots/Examples

🚨 Breaking Changes

📋 Additional Context

kdush and others added 7 commits August 23, 2025 21:29
解决 'attempted relative import with no known parent package' 问题:
- 将src/claude_notifier/cli/main.py中所有相对导入改为绝对导入
- 重新组织包结构,将events、templates、managers移入claude_notifier包
- 移除孤立的src/managers目录,避免导入冲突
- 升级版本至0.0.7,添加修复说明

测试验证:
- 开发模式安装测试通过 (pip install -e .)
- 生产模式安装测试通过 (pip install .)
- cn setup命令现在正常工作
- 所有CLI命令功能正常

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

Co-Authored-By: Claude <noreply@anthropic.com>
将版本从0.0.7调整为0.0.7b1,标记为Beta预发行版本:
- 更新__version__.py中版本信息和历史记录
- 在CHANGELOG.md中添加0.0.7b1详细发布说明
- 包含PyPI兼容性修复、测试验证和包结构优化内容
- 版本显示现在正确显示Beta标识和预发行提示

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

Co-Authored-By: Claude <noreply@anthropic.com>
- 使用具体异常类型替代裸except (builtin.py, custom.py)
- 删除废弃的ConfirmationRequiredEvent类
- 添加logging导入以支持日志功能
**claude_hook.py 变更**:
- 实现新版API钩子: PreToolUse、PostToolUse、Stop、Notification
- 支持通过环境变量CLAUDE_HOOK_EVENT和stdin读取JSON数据
- 增强类型安全: 添加message和tool_input的类型检查
- 修复session_start状态初始化逻辑
- 保留旧版API向后兼容性

**installer.py 变更**:
- 更新hooks配置格式为新版API列表格式
- 简化命令生成逻辑(数据通过stdin传递)
- 更新验证逻辑以适配PreToolUse、Stop等新钩子
- 添加api_version元数据标记
- 更新14个测试用例以适配当前事件系统
- 修复测试断言以匹配实际的事件触发逻辑
- 确保测试覆盖率与代码实现保持一致
**模块化重构**:
- 将CLI命令按功能拆分到独立模块(core、config、hooks、debug)
- 提升代码可维护性和可测试性

**代码质量修复**:
- config.py: 使用深拷贝避免配置缓存污染
- core.py: 修复权限比较逻辑(数值比较替代字符串比较)
- core.py: 使用click.clear()替代os.system清屏
- hooks.py: 添加--yes/-y选项支持非交互式卸载(CI/CD友好)
- debug.py: 使用click.pause()替代input()

**用户体验提升**:
- 更好的命令组织结构
- 增强的错误处理
- CI/CD环境友好的非交互式选项
**版本更新**:
- 升级版本号从 0.0.7b1 到 0.0.8 (稳定版)
- 更新 CHANGELOG.md 添加详细的变更记录

**主要变更**:
- 代码质量与兼容性修复
- Hooks API 适配新版本
- 类型安全增强
- CLI 模块重构与优化
- 测试用例更新

**发布日期**: 2026-02-02
@kdush kdush merged commit 6213b0c into main Feb 1, 2026
0 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant