Commit Graph
44 Commits
Author SHA1 Message Date
AlexKucera 92e109e2e8 Fixes timed prompts generation race condition
Reorders initialization of in-progress flag to prevent potential race conditions during timed prompt generation

Ensures that the in-progress status is set before stopping existing sequences and generates prompts
2025-10-24 12:59:19 +02:00
AlexKucera 6ccfb9e023 Optimizes token usage for timed prompts
Reduces max tokens for timed prompts to improve latency and cost-efficiency

Introduces dynamic max_tokens configuration based on prompt type, using a smaller token limit for time-sensitive requests
2025-10-24 11:29:33 +02:00
AlexKucera e8443a878d Improves model selection fallback handling
Adds null check when selecting fallback model to prevent potential errors

Ensures graceful handling when the current model becomes unavailable by verifying a fallback model exists before setting it
2025-10-24 11:27:50 +02:00
AlexKucera e06b07eb26 Adds API key validation and model sorting
Improves model retrieval by adding API key validation check for both model fetching methods

Adds fallback to predefined models when no API key is present
Sorts model lists alphabetically by display name for consistent presentation

Enhances robustness of model service handling
2025-10-24 11:26:48 +02:00
AlexKucera 7932663d2a Adds type refinement for dynamic model selection
Introduces ModelId type alias to clarify model ID intent
Refines prompt generator type to support specific prompt types
Improves type safety for model and prompt configuration
2025-10-24 11:25:36 +02:00
AlexKucera 435af4ccab Adds required Claude model validation check
Enforces Claude model selection as a mandatory setting

Prevents configuration submission without specifying a valid Claude model to ensure proper API interaction and prevent potential errors
2025-10-24 11:24:09 +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
AlexKucera 766eb26df3 Improves model fetch error notification message
Updates error notification to provide clearer feedback when API model retrieval fails

Enhances user experience by making the fallback model list error message more descriptive and informative
2025-10-24 11:22:33 +02:00
AlexKucera 4164471ed0 Adds fallback for unavailable AI models
Handles scenario where previously selected AI model is no longer available

Automatically selects the first available model and notifies the user when their current model is removed, improving user experience and preventing potential configuration errors
2025-10-24 11:21:02 +02:00
AlexKucera 6875a7c06c Adds user notification for ongoing timed prompts
Prevents multiple simultaneous timed prompt generations by displaying a notice when an operation is already in progress

Improves user experience by providing clear feedback during concurrent prompt generation attempts
2025-10-24 11:18:29 +02:00
AlexKucera c06afe7a4a Updates project license badge to GPL v3
Replaces MIT license badge with GPL v3 license badge in README

Ensures accurate representation of project licensing information
2025-10-24 11:18:23 +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
AlexKucera a79dcec18f Updates CHANGELOG.md with correct release dates
Corrects release dates for versions 1.0.0, 1.1.0, and 1.1.1 in the changelog.
2025-09-26 08:44:55 +02:00
AlexKucera 8dc28ccd5e Updates release action and BRAT repo URL
Updates the release action to the latest major version.

Also corrects the repository URL in the BRAT installation instructions
to reflect the rename of the repository.
2025-09-26 08:25:03 +02:00
AlexKucera f589057912 Updates repository URLs in CHANGELOG
Updates the repository URLs in the CHANGELOG.md file to reflect the new repository name and location.
This ensures that the links to previous versions and comparisons are accurate and functional.
2025-09-26 08:23:51 +02:00
AlexKucera 8b0b4f6607 Updates repository links and license
Updates the repository links in the README to reflect the
rename of the repository.

Changes the license to GNU General Public License v3 (GPLv3).
2025-09-26 08:22:50 +02:00
AlexKucera b8b701d78b Simplifies cursor placement after prompt insertion
Removes conditional logic for setting the cursor position
after inserting a prompt. Now, the cursor is consistently
placed at the end of the inserted text, regardless of the
previous cursor location. This change ensures consistent behavior
and simplifies the code.
2025-09-26 08:20:00 +02:00
AlexKucera d7497c1259 Removes unnecessary error notification
The Notice was removed because the error is already being logged to the console and re-thrown.
2025-09-26 08:19:54 +02:00
AlexKucera 9249897d27 Prevents race conditions in timed prompts
Adds a flag to prevent the timed prompt execution from running concurrently, avoiding potential race conditions and unexpected behavior.

Also, addresses edge case in the status check where the displayed current prompt number could be inaccurate.
2025-09-26 08:18:13 +02:00
AlexKucera 847768417c Updates author and license info
Updates the author name to include the last name.
Also, changes the plugin license to GPL-3.0-only.
2025-09-26 08:13:03 +02:00
AlexKucera ac20fadef6 Guards against empty cache arrays
Prevents errors when attempting to process an empty cache.

Deletes the cache entry if it is empty to avoid repeatedly
attempting to process an invalid cache entry.
2025-09-26 08:11:44 +02:00
AlexKucera 520ac6e826 Fixes broken links in README
Corrects several broken links in the README file:

- Updates the download badge link
- Corrects the manual installation link to GitHub releases
- Updates the BRAT repository link

These changes ensure users can access the correct resources.
2025-09-26 07:48:44 +02:00
AlexKucera 5a97bd50a6 Fixes broken CodeRabbit badge link
Corrects the URL for the CodeRabbit Reviews badge in the README.

The previous URL was malformed, preventing the badge from displaying correctly. This change ensures the badge accurately reflects the status of CodeRabbit reviews.
2025-09-25 16:19:08 +02:00
AlexKucera ac1468c72e Adds CodeRabbit badge to README
Includes a CodeRabbit badge in the README to showcase code review status.
2025-09-25 15:37:44 +02:00
AlexKucera 16901f9ec6 Updates downloads badge URL
Corrects a typo in the downloads badge URL in the README, ensuring it links to the releases page instead of an invalid location.
2025-09-21 22:09:23 +02:00
AlexKucera 383f355e45 Updates project badges in README
Updates the project badges in the README file to reflect the correct repository name and adds a downloads badge.
2025-09-21 16:08:50 +02:00
Jarvis 39c9578ebc chore: release 1.1.1
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
1.1.1
2025-09-21 08:03:50 +02:00
Jarvis 143097a973 fix: improve TypeScript type safety
- Replace any types with proper Obsidian API types
- Add App type import for better type safety
- Add ButtonComponent type for settings button parameter
- Add null safety for button text content
- Remove redundant "Settings" from settings tab heading

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-21 08:02:16 +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
AlexKucera 8147662d61 Adds plugin combination recommendations
Recommends complementary plugins to enhance the freewriting workflow, suggesting specific usage patterns and benefits.
2025-09-20 14:21:11 +02:00
Jarvis 6729851cb4 chore: release 1.1.0
- Enhanced staggered prompts with ultra-short, direct prompts
- Improved notification timing to prevent overlap
- Fixed Obsidian compliance issues
- Better TypeScript type safety

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

Co-Authored-By: Claude <noreply@anthropic.com>
1.1.0
2025-09-20 11:09:31 +02:00
AlexKucera c34ee2edd6 Enhances prompt generation with type-specific instructions
Refines prompt generation by incorporating modifiers based on the prompt type.

This ensures that staggered prompts are short and direct, while also enforcing a consistent output format across all prompt types by appending specific instructions to the system prompt.

The user message is also updated to ensure the model returns only the numbered prompts, nothing else.
2025-09-20 10:55:06 +02:00
AlexKucera 2fbe582c4d Simplifies prompt generation model usage
Updates prompt generation to use the model type directly, removing the need for casting.

This change streamlines the prompt generation process and enhances type safety.
2025-09-20 10:53:36 +02:00
AlexKucera eaab2012db Improves staggered prompt display timing
Ensures prompt notifications display correctly
by adjusting the notification duration based
on the configured delay. Prevents potential overlap
between successive prompts.
2025-09-20 10:52:41 +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 cc63d92b6c Automates plugin release process with GitHub Actions
Sets up a GitHub Actions workflow to automatically build, package, and release the Obsidian plugin when a new tag is pushed.

This workflow:
- Checks out the code, sets up Node.js, and installs dependencies.
- Builds the plugin using `npm run build`.
- Creates a zip package containing the necessary files (main.js, manifest.json, and styles.css).
- Extracts the version from `manifest.json` and changelog from `CHANGELOG.md`.
- Creates a GitHub release with the extracted version and changelog, including installation instructions and file information.
1.0.0
2025-09-19 22:24:36 +02:00
AlexKucera e045dcf5ad Adds initial changelog file
Creates a new CHANGELOG.md file to document notable
changes to the project, adhering to Keep a Changelog format
and Semantic Versioning.

This file details the features, technical aspects, and security
considerations introduced in version 1.0.0, as well as a link
to the unreleased changes.
2025-09-19 22:24:26 +02:00
AlexKucera 9c8e5b022e Updates example prompt
Updates the default staggered example prompt to provide a more open-ended starting point. This aims to encourage more creative and diverse initial responses from users.
2025-09-19 22:24:19 +02:00
AlexKucera c209b5a6bf Excludes project-specific files from Git tracking.
Ignores Sublime Text project and workspace files to prevent them from being tracked in the repository. This ensures a cleaner repository state and avoids accidental inclusion of user-specific settings.
2025-09-19 22:24:11 +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 e204a9998c Adds package-lock.json file
Adds the package-lock.json file to the repository to ensure consistent dependency versions across different environments.
This file helps to maintain the integrity and reproducibility of the project's dependencies.
2025-09-19 18:51:20 +02:00
AlexKucera dd73fcb592 Adds Claude guidance and ignores log file
Adds a CLAUDE.md file to provide guidance for Claude Code (claude.ai/code) when working with this repository.

Also, adds `logs/stack-exchange-mcp-server.log` to the .gitignore file to prevent it from being tracked.
2025-09-19 18:50:21 +02:00
AlexKucera 81dd4ae3f7 Initial commit 2025-09-19 18:29:50 +02:00