feat: immutable entries + full task logging

Entries now immutable once journal is generated:
- Edit/delete returns ENTRY_IMMUTABLE error if journal exists
- Frontend shows lock message and hides delete button
- Delete Journal button to unlock entries

Task logging now stores full JSON:
- request: full JSON request sent to AI provider
- response: full JSON response from AI provider
- prompt: formatted human-readable prompt

Prompt structure:
1. System prompt
2. Previous diary entries (journals)
3. Today's entries
This commit is contained in:
lotherk
2026-03-26 22:05:52 +00:00
parent 5c217853de
commit 754fea73c6
10 changed files with 197 additions and 98 deletions

View File

@@ -1,6 +1,12 @@
export interface AIProviderResult {
content: string;
request: Record<string, unknown>;
response: Record<string, unknown>;
}
export interface AIProvider {
provider: 'openai' | 'anthropic' | 'ollama' | 'lmstudio' | 'groq';
generate(prompt: string, systemPrompt?: string): Promise<string>;
generate(prompt: string, systemPrompt?: string): Promise<AIProviderResult>;
validate?(): Promise<boolean>;
}