Revises token and character limit constants with more precise descriptions
- Increases default max output tokens from 4000 to 8192
- Expands documentation explaining token-to-character estimation
- Provides context about current Claude model token limits
- Clarifies variability in character-to-token conversions
Enhances error reporting for different API error scenarios by:
- Adding a generic API error handler for unspecified status codes
- Preserving more detailed error information when possible
- Providing clearer user notifications for various error types
Enhances error handling for Anthropic API client:
- Adds specific handling for 429 (rate limit) errors
- Improves authentication error detection
- Modifies text extraction to capture multiple response blocks
Provides more robust and informative error responses during API interactions
Adds more granular error types and handling for API interactions
Improves token estimation with safety margin
Introduces duration tracking for cleanup operations
Provides clearer user feedback for various error scenarios including authentication, rate limiting, and network issues
Enhances request retry mechanism to avoid unnecessary retries on non-transient errors
Adds specific error handling to prevent retrying:
- API key configuration errors
- Client-side API errors (4xx status codes)
Ensures more efficient and targeted retry strategy that avoids wasting API quota
Updates error notices to display specific error messages instead of static text
Provides more informative feedback to users when cleanup process encounters issues
Simplifies error handling by allowing the command layer to manage user feedback
Prevents potential redundant error notices and improves separation of concerns
Introduces a comprehensive custom error hierarchy for more precise error management in API calls
Replaces generic error throwing with specific error types:
- Adds custom error classes for various API-related scenarios
- Improves error handling in cleanup and API client components
- Enables more informative and type-safe error tracking
Enhances error reporting and debugging capabilities for Anthropic API interactions
Extracts common fallback model caching logic into a new private method `cacheFallbackModels()`
Reduces code duplication in model retrieval methods by centralizing fallback model caching
Improves code readability and maintainability by consolidating repetitive logic
Adds descriptive docstring to explain the purpose of the new helper method
Enhances error messaging for custom commentary style to provide more specific guidance
Clarifies that a custom prompt is required when selecting custom commentary style, making the error message more informative and user-friendly
Eliminates redundant empty selection check in cleanup command
Allows processing of empty selections by removing the initial validation
preventing user action when no text is selected
Removes redundant text info formatting method and associated info reporting from selection validation
Streamlines validation process by focusing solely on checking text eligibility
Allows first_id and last_id to be null when no models are present
Improves type safety by explicitly handling edge cases in model list responses, preventing potential null reference issues
Expands stop_sequence type from null to allow string values
Improves type flexibility by making stop_sequence nullable with string support, enabling more precise type representation for Anthropic response handling
Prevents notification fatigue during API failures by throttling error messages
Introduces new method to limit error notices to once per minute when fetching models fails
Refactors model fetching error handling to use a consistent conversion method
Improves user experience by reducing repetitive error notifications
Introduces debounced settings save to reduce unnecessary disk I/O during rapid user interactions
Improvements include:
- Adds scheduleSave method to prevent excessive writes
- Updates settings change handlers to use debounced save
- Updates usage limits text with dynamic token/character references
Enhances plugin performance and user experience
Refactors settings loading to exclude model cache from persisted settings
Modifies command registration to use prefixed ID for better stability and collision prevention
Enhances type safety and plugin configuration management
Refactors error handling in cleanup command execution
- Moves loading notice hide to finally block for consistent dismissal
- Enhances error message formatting with locale-specific number formatting
- Imports character and token limit constants for more dynamic error messages
- Renames unused view parameter to indicate intentional non-use
Improves user experience by providing more readable error notifications
Enforces requirement of custom commentary prompt when custom style is selected
Prevents potential runtime errors by throwing an explicit error if custom commentary style is chosen without providing a custom prompt
Adds comprehensive documentation for all major classes and methods in the Freewriting Cleanup plugin
Improves code readability by:
- Adding detailed JSDoc comments explaining purpose and functionality
- Clarifying method behaviors and input/output expectations
- Providing inline context for complex operations
Standardizes error handling and adds more robust validation across services