Skip to content

Conversation

@fugui
Copy link

@fugui fugui commented Nov 27, 2025

在 ccr 的 log 中,由于服务器采用 event-stream 的模式返回数据, 未能记录 HTTP 响应的日志。 为了分析响应日志, 进行如下代码修改。 同时, 也进行了大函数的整理等。

fugui and others added 6 commits November 27, 2025 11:34
- Extract server hook logic from src/index.ts to dedicated utils/hooks.ts module
- Separate concerns with individual hook setup functions for better maintainability
- Add comprehensive JSDoc documentation for all functions
- Improve error handling and stream processing organization
- Enhance code readability with modular structure

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

Co-Authored-By: Claude <noreply@anthropic.com>
… modules

- Split complex stream processing logic from hooks.ts into dedicated modules
- Add streamUtils.ts for SSE parsing and stream handling utilities
- Add agentProcessor.ts for agent-specific stream processing logic
- Add types.ts for shared type definitions
- Improve code organization and maintainability of hooks system

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

Co-Authored-By: Claude <noreply@anthropic.com>
…s module

- Move agent processing logic from agentProcessor.ts into hooks.ts
- Consolidate stream utilities from streamUtils.ts into hooks.ts
- Remove duplicate type definitions by integrating into hooks.ts
- Add new SSEParserUtils.ts for SSE parsing utilities
- Update Claude settings to allow del command for file operations

This refactoring improves code organization by centralizing related functionality
and reducing module fragmentation while maintaining all existing capabilities.

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix text content extraction to handle empty content properly
- Format tool call output with readable JSON indentation
- Add proper error messages for failed SSE parsing
- Add test file for SSE parser utilities
- Update local settings with required command permissions

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

Co-Authored-By: Claude <noreply@anthropic.com>
…or handling

- Consolidate helper functions and extract reusable padNumber utility
- Add comprehensive constants for SSE event and content block types
- Enhance SSE parser with better JSON truncation fixes and error handling
- Improve tool call processing with partial JSON accumulation
- Refactor AgentProcessingState into class with better state management
- Remove deprecated hooks and consolidate functionality
- Add comprehensive JSDoc documentation throughout modules

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

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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