Commit Graph
12 Commits
Author SHA1 Message Date
AlexKucera f2972a5b83 Standardizes settings labels and improves UI consistency
Updates capitalization in command names and settings labels to enhance
UI consistency. Replaces element creation with a standardized heading
approach for setting sections, ensuring a cohesive design throughout
the plugin settings interface. Fixes element reference inconsistency.

Improves user experience by providing clear and uniform interface
elements.
2025-11-09 17:11:12 +01:00
AlexKucera 2b9c8fbc5b Prevents cross-key model cache leakage
Clears model cache when API key changes to ensure accurate model list access

Prevents potential issues with stale model entitlements when switching API keys programmatically
2025-10-25 10:47:04 +02:00
AlexKucera 13645af300 Improves data loading with robust error handling
Adds comprehensive error handling for plugin data loading to prevent potential startup failures

Implements graceful fallback to default settings when data loading fails or is corrupted
Ensures plugin can initialize even with invalid or missing persistent data
Separates model cache extraction to prevent type drift and improve data integrity
2025-10-24 16:41:53 +02:00
AlexKucera 53e61abd3b Optimize settings and API key management
Improves settings loading and saving by preventing model cache merging and tracking API key changes

Prevents type drift in settings by destructuring saved data
Adds tracking of last API key to avoid unnecessary prompt generator updates
Ensures only meaningful settings are merged with defaults

Reduces redundant operations and improves plugin performance
2025-10-24 13:44:45 +02:00
AlexKucera e96ef65200 Added DocStrings 2025-10-24 13:09:10 +02:00
AlexKucera 8e19f6bc8f Simplifies data loading and initialization logic
Combines data loading for settings and model cache
Reduces redundant data loading steps and improves initialization efficiency

Supports dynamic model handling on the dynamic-models branch
2025-10-24 11:23:29 +02:00
Jarvis 20530142e4 feat: add dynamic model fetching from Anthropic API
Replace hardcoded model list with dynamic API-based model fetching
that queries the Anthropic models endpoint. Implements 24-hour caching
with automatic fallback to hardcoded models if API is unavailable.

Changes:
- Add ModelService to fetch and cache available models from API
- Implement 24-hour TTL cache persisted in plugin data
- Update AnthropicClient with fetchModels() method
- Modify settings UI to load models asynchronously with loading states
- Auto-refresh models when API key is entered or changed
- Display model names using display_name field from API
- Preserve user's selected model across updates and restarts
- Show notice when falling back to hardcoded model list
- Change model type from strict enum to string for dynamic support

Technical details:
- New ModelInfo and ModelsListResponse interfaces for API response
- ModelCache interface with timestamp for TTL validation
- FreewritingPromptsData extends settings to include cache
- Settings dropdown disabled during model fetch/refresh
- Fallback to ANTHROPIC_MODELS constant on API failure

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 10:17:30 +02:00
Jarvis 4786e7647d refactor: rename "Staggered Prompts" to "Timed Prompts" for clarity
Renames command terminology throughout codebase to better reflect
regular interval delivery rather than irregular/staggered timing.

Changes:
- Rename staggeredPrompts.ts → timedPrompts.ts
- Update class StaggeredPromptsCommand → TimedPromptsCommand
- Update command IDs: staggered-prompts → timed-prompts
- Update user-facing labels in settings and README
- Update property names: staggeredCount → timedCount
- Update method names: generateStaggeredPrompts → generateTimedPrompts
- Update API constants and type annotations

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-21 07:53:48 +02:00
Jarvis 49e3f5523c fix: address Obsidian review bot issues
- Move inline styles from TypeScript to CSS for better theme compatibility
- Remove "Freewriting" from command names to follow Obsidian conventions
- Fix TypeScript type casting by properly typing model as AnthropicModel
- Update to latest Claude models including Opus 4.1 and Sonnet 4

Changes:
• commands/staggeredPrompts.ts: Replace inline styles with CSS class
• main.ts: Rename commands to "Show Staggered Prompts" and "Add Note Prompts"
• settings.ts: Remove 'as any' cast and update default model
• styles.css: Add .freewriting-prompt-notice class with proper styling
• types.ts: Change model field type from string to AnthropicModel

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-20 10:32:35 +02:00
AlexKucera 4254ef3ae9 Sets up release workflow and licensing
Adds a GitHub Actions workflow to automate plugin releases upon tagging.

Includes a LICENSE file with the GNU General Public License v3.

Removes old LICENSE and manifest files.

Removes console logs from the main plugin file to reduce noise.
2025-09-19 19:04:26 +02:00
AlexKucera 44936775cd Implements freewriting prompts plugin
Initial implementation of the Freewriting Prompts plugin.

This commit introduces the core functionality for generating
AI-powered writing prompts using Anthropic's Claude API.

It includes:
- API client for interacting with the Anthropic API
- Services for generating and caching prompts
- Commands for displaying staggered prompts and appending prompts to notes
- Settings tab for configuring the plugin
2025-09-19 18:51:48 +02:00
AlexKucera 81dd4ae3f7 Initial commit 2025-09-19 18:29:50 +02:00