Conversation
解决 '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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
📋 Changes Summary
🎯 Type of Change
🔍 Testing
Test Configuration:
📝 Checklist
📚 Documentation
🔗 Related Issues
Fixes #
Related to #
📸 Screenshots/Examples
🚨 Breaking Changes
📋 Additional Context