10 Commits
Author SHA1 Message Date
AlexKucera c5ebfceea6 Improves API error handling in cleanup command
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
2025-10-24 16:58:32 +02:00
AlexKucera bb6cc929f5 Enhances error handling and performance tracking
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
2025-10-24 16:27:37 +02:00
AlexKucera d50f11269b Improves error handling with detailed error messages
Updates error notices to display specific error messages instead of static text

Provides more informative feedback to users when cleanup process encounters issues
2025-10-24 16:06:49 +02:00
AlexKucera e29539c8eb Adds robust error handling for API interactions
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
2025-10-24 15:52:34 +02:00
AlexKucera 58575c1880 Removes unnecessary text selection validation check
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
2025-10-24 15:38:38 +02:00
AlexKucera e6b357f3f2 Simplifies text selection validation method
Removes redundant text info formatting method and associated info reporting from selection validation

Streamlines validation process by focusing solely on checking text eligibility
2025-10-24 15:35:47 +02:00
AlexKucera e43d4a0631 Improves cleanup command error handling and formatting
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
2025-10-24 15:17:44 +02:00
AlexKucera 0f3d6ec7a3 Enhances code documentation and structure for plugin
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
2025-10-24 13:16:42 +02:00
AlexKucera 69a92e02d2 Validates text selection before processing
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.
2025-09-26 08:56:33 +02:00
AlexKucera a63d184448 Implements freewriting cleanup plugin
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.
2025-09-20 12:14:55 +02:00