From 7932663d2a3064141d01085141be3637d16644a9 Mon Sep 17 00:00:00 2001 From: Alexander Kucera Date: Fri, 24 Oct 2025 11:25:36 +0200 Subject: [PATCH] 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 --- services/promptGenerator.ts | 2 +- types.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/services/promptGenerator.ts b/services/promptGenerator.ts index d39e502..58fa933 100644 --- a/services/promptGenerator.ts +++ b/services/promptGenerator.ts @@ -100,7 +100,7 @@ export class PromptGeneratorService { model: string, systemPrompt: string, examplePrompt: string, - type: string + type: 'timed' | 'note' ): string { const keyData = { count, diff --git a/types.ts b/types.ts index b83c723..a535450 100644 --- a/types.ts +++ b/types.ts @@ -1,9 +1,12 @@ // ABOUTME: Type definitions for the Freewriting Prompts plugin // ABOUTME: Defines interfaces for settings, API responses, and plugin configuration +// Type alias to document intent that this should be a Claude model ID +export type ModelId = string; + export interface FreewritingPromptsSettings { apiKey: string; - model: string; // Changed from AnthropicModel to string to support dynamic models + model: ModelId; // Changed from AnthropicModel to string to support dynamic models timedCount: number; delaySeconds: number; noteCount: number;