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
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
Updates error notices to display specific error messages instead of static text
Provides more informative feedback to users when cleanup process encounters issues
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
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
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
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
Refactors text validation to ensure that the cleanup process only proceeds with valid text selections.
Removes the insertion position logic as it is no longer needed.
Adds a plugin to clean up freewriting text using the Anthropic API.
This initial commit introduces core functionality, including:
- API client for interacting with Anthropic's Claude models.
- Service for orchestrating cleanup operations and managing API calls.
- Command for executing the cleanup process on selected text within Obsidian editor.
- Settings tab for configuring the API key, model, prompts, and commentary preferences.
- Type definitions for settings, API requests/responses, and cleanup results.
The plugin provides a command to clean up selected text, apply custom prompts, and optionally generate commentary on the freewriting session.