Refactors how Claude thinking blocks are handled to improve reliability and address signature validation issues.
- Removes the deprecated `KEEP_THINKING_BLOCKS` constant and associated environment variable.
- Introduces runtime configuration for `keep_thinking` to control whether thinking blocks are preserved.
- Implements logic to inject a sentinel value (`SKIP_THOUGHT_SIGNATURE`) when a thinking block's signature is invalid or missing, allowing the API to bypass validation. This addresses scenarios like cache misses, session mismatches, and plugin restarts.
This change enhances the robustness of Claude integrations by providing a mechanism to handle signature issues gracefully.
- Added recovery functionality for tool_result_missing, thinking_block_order, and thinking_disabled_violation errors.
- Introduced constants and types for session recovery.
- Created storage utilities for reading and writing session data.
- Enhanced debug logging capabilities in debug.ts.
- Refactored debug state management for better initialization and access.