refactor: Phase 10 — Ollama service, image cache, config, frontend orphans
Final cleanup phase of the MCP-first pivot.
docker-compose:
- docker-compose.yml: drop ollama service + OLLAMA_URL/MODEL env vars +
IMAGE_CACHE / VAPID env comments
- docker-compose.prod.yml: drop ollama service + Ollama env + GPU
reservation
- docker-compose.quickstart.yml: drop ollama service + Ollama env +
GPU-reservation comment; quickstart instructions now point at the
MCP Access tab instead of model-pull
Config:
- Drop OLLAMA_URL, OLLAMA_MODEL, OLLAMA_BACKGROUND_MODEL,
OLLAMA_KEEP_ALIVE_*, OLLAMA_NUM_CTX, EMBEDDING_MODEL (fastembed
is hard-coded inside services/embeddings.py)
- Drop IMAGE_CACHE_DIR, IMAGE_MAX_BYTES (image cache subsystem
deleted)
- Drop VAPID_PRIVATE_KEY, VAPID_PUBLIC_KEY, VAPID_CLAIMS_SUB (push
deleted in phase 8)
- Drop VOICE_ENABLED, STT_BACKEND, STT_MODEL, TTS_BACKEND (voice
deleted in phase 8)
- Drop Config.validate() rules for those keys
Image cache deletion:
- services/images.py, routes/images.py, models/image_cache.py
- models/__init__.py: drop ImageCache import
- app.py: drop images_bp registration
- alembic/versions/0054_drop_image_cache.py: DROP TABLE image_cache
Frontend client.ts orphan exports stripped:
- getVoiceStatus, getVoiceList, getVoiceLibrary, installVoice,
uninstallVoice, transcribeAudio, synthesiseSpeech,
VoiceStatusResult / VoiceEntry / VoiceLibraryEntry types
- getJournalConfig, saveJournalConfig, getJournalToday/Day/Days,
triggerJournalPrep, runJournalCurator, listPendingActions,
approvePendingAction, rejectPendingAction, listJournalMoments,
updateJournalMoment, deleteJournalMoment, geocodeAddress
- JournalConfig / JournalLocation / JournalConversation /
JournalMessage / JournalDayPayload / JournalMoment /
CuratorRunResult / PendingCuratorAction types
- consolidateProfile, clearProfileObservations, listProfileObservations
- ProfileObservationEntry, learned_summary/observations_* fields on
UserProfile
- consolidateTask (cascading update to TaskEditorView)
- getFableMcpInfo, getNewsItems, GetNewsItemsParams, NewsItem import
TaskEditorView:
- Drop the auto-summary banner + Re-consolidate button
- Drop isBodyAutoMaintained gate (editor is always user-controlled now)
- Drop reconsolidate function + reconsolidating ref
SettingsView:
- profile ref no longer initialises learned_summary /
observations_count / observations_updated_at (those fields are
gone from UserProfile type)
Surviving frontend composables/components flagged for likely future
cleanup but not deleted in this commit (no compile errors, just
unreferenced after Phase 7-8):
- useAssist, useFloatingAssist, useTagSuggestions, useVad,
useListenMode, useOnnxPreloader (composables)
- WorkspaceNoteEditor, WorkspaceTaskPanel, WeatherCard, InlineAssistPanel
(components)
- api/client.ts still references /api/notes/assist/* and
/api/notes/suggest-tags via useAssist + useTagSuggestions — those
endpoints 404 now but no caller hits them; dead at runtime, harmless.
Compose stack collapses to two services: `app` + `db`. No Ollama, no
voice models, no fable-mcp wheel build. First-boot install reduces to:
docker compose up -d
→ visit web UI → register → Settings → MCP Access → copy snippet
→ claude mcp add … → done.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -299,188 +299,6 @@ export function apiSSEStream(
|
||||
return { close: () => controller.abort(), done };
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Journal
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export interface JournalLocation {
|
||||
label: string;
|
||||
address: string;
|
||||
lat?: number;
|
||||
lon?: number;
|
||||
}
|
||||
|
||||
export interface JournalConfig {
|
||||
prep_enabled: boolean;
|
||||
prep_hour: number;
|
||||
prep_minute: number;
|
||||
day_rollover_hour: number;
|
||||
morning_end_hour?: number;
|
||||
midday_end_hour?: number;
|
||||
closeout_enabled?: boolean;
|
||||
// Ambient-context fields (carried forward from the briefing config schema)
|
||||
locations?: { home?: JournalLocation; work?: JournalLocation };
|
||||
temp_unit?: 'C' | 'F';
|
||||
use_caldav_event_locations?: boolean;
|
||||
enabled?: boolean;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
|
||||
export interface JournalConversation {
|
||||
id: number;
|
||||
title: string;
|
||||
model: string;
|
||||
conversation_type: string;
|
||||
day_date: string | null;
|
||||
rag_project_id: number | null;
|
||||
message_count: number;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface JournalMessage {
|
||||
id: number;
|
||||
conversation_id: number;
|
||||
role: 'user' | 'assistant' | 'system';
|
||||
content: string;
|
||||
status: string;
|
||||
context_note_id: number | null;
|
||||
tool_calls: unknown[] | null;
|
||||
metadata: Record<string, unknown> | null;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export interface JournalDayPayload {
|
||||
day_date: string;
|
||||
conversation: JournalConversation | null;
|
||||
messages: JournalMessage[];
|
||||
}
|
||||
|
||||
export interface JournalMoment {
|
||||
id: number;
|
||||
user_id: number;
|
||||
conversation_id: number | null;
|
||||
source_message_id: number | null;
|
||||
day_date: string;
|
||||
occurred_at: string;
|
||||
recorded_at: string;
|
||||
content: string;
|
||||
raw_excerpt: string | null;
|
||||
tags: string[];
|
||||
pinned: boolean;
|
||||
people: { id: number; title: string }[];
|
||||
places: { id: number; title: string }[];
|
||||
task_ids: number[];
|
||||
note_ids: number[];
|
||||
score?: number;
|
||||
}
|
||||
|
||||
export async function getJournalConfig(): Promise<JournalConfig> {
|
||||
return apiGet<JournalConfig>('/api/journal/config');
|
||||
}
|
||||
|
||||
export async function saveJournalConfig(config: JournalConfig): Promise<void> {
|
||||
await apiPut('/api/journal/config', config);
|
||||
}
|
||||
|
||||
export async function getJournalToday(): Promise<JournalDayPayload> {
|
||||
return apiGet<JournalDayPayload>('/api/journal/today');
|
||||
}
|
||||
|
||||
export async function getJournalDay(isoDate: string): Promise<JournalDayPayload> {
|
||||
return apiGet<JournalDayPayload>(`/api/journal/day/${isoDate}`);
|
||||
}
|
||||
|
||||
export async function getJournalDays(): Promise<string[]> {
|
||||
const data = await apiGet<{ days: string[] }>('/api/journal/days');
|
||||
return data.days;
|
||||
}
|
||||
|
||||
export async function triggerJournalPrep(date?: string): Promise<{ ok: boolean; message_id: number }> {
|
||||
return apiPost('/api/journal/trigger-prep', date ? { date } : {});
|
||||
}
|
||||
|
||||
export interface CuratorRunResult {
|
||||
conv_id: number;
|
||||
user_id: number;
|
||||
model: string;
|
||||
messages_examined: number;
|
||||
tool_calls: Array<{
|
||||
name: string;
|
||||
arguments: Record<string, unknown>;
|
||||
status: 'success' | 'error' | 'pending';
|
||||
error: string | null;
|
||||
}>;
|
||||
tools_attempted: number;
|
||||
tools_succeeded: number;
|
||||
summary: string;
|
||||
duration_ms: number;
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
export async function runJournalCurator(convId: number): Promise<CuratorRunResult> {
|
||||
return apiPost<CuratorRunResult>(`/api/journal/curator/run/${convId}`, {});
|
||||
}
|
||||
|
||||
// Curator-proposed mutations awaiting user review (Needs Review panel).
|
||||
// See routes/journal.py pending_actions endpoints.
|
||||
|
||||
export interface PendingCuratorAction {
|
||||
id: number;
|
||||
user_id: number;
|
||||
conv_id: number | null;
|
||||
action_type: string; // e.g. "update_note", "delete_note", "update_milestone"
|
||||
target_type: string | null; // "task" | "note" | "milestone" | "project" | "profile"
|
||||
target_id: number | null;
|
||||
target_label: string | null; // human-readable title for the card header
|
||||
payload: Record<string, unknown>; // the curator's proposed args
|
||||
current_snapshot: Record<string, unknown>; // target state at proposal time
|
||||
status: 'pending' | 'approved' | 'rejected';
|
||||
created_at: string;
|
||||
reviewed_at: string | null;
|
||||
}
|
||||
|
||||
export async function listPendingActions(): Promise<{ pending: PendingCuratorAction[]; count: number }> {
|
||||
return apiGet<{ pending: PendingCuratorAction[]; count: number }>('/api/journal/pending');
|
||||
}
|
||||
|
||||
export async function approvePendingAction(actionId: number): Promise<Record<string, unknown>> {
|
||||
return apiPost<Record<string, unknown>>(`/api/journal/pending/${actionId}/approve`, {});
|
||||
}
|
||||
|
||||
export async function rejectPendingAction(actionId: number): Promise<Record<string, unknown>> {
|
||||
return apiPost<Record<string, unknown>>(`/api/journal/pending/${actionId}/reject`, {});
|
||||
}
|
||||
|
||||
export async function listJournalMoments(params: Record<string, string | number | boolean> = {}): Promise<JournalMoment[]> {
|
||||
const qs = new URLSearchParams();
|
||||
for (const [k, v] of Object.entries(params)) qs.set(k, String(v));
|
||||
const data = await apiGet<{ moments: JournalMoment[] }>(`/api/journal/moments?${qs}`);
|
||||
return data.moments;
|
||||
}
|
||||
|
||||
export async function updateJournalMoment(id: number, patch: Partial<JournalMoment>): Promise<JournalMoment> {
|
||||
return apiPatch<JournalMoment>(`/api/journal/moments/${id}`, patch);
|
||||
}
|
||||
|
||||
export async function deleteJournalMoment(id: number): Promise<void> {
|
||||
await apiDelete(`/api/journal/moments/${id}`);
|
||||
}
|
||||
|
||||
export async function geocodeAddress(address: string): Promise<{ lat: number; lon: number; display_name: string } | null> {
|
||||
try {
|
||||
const r = await apiPost<{ lat: number; lon: number; label: string }>('/api/journal/weather/geocode', { query: address });
|
||||
return { lat: r.lat, lon: r.lon, display_name: r.label };
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export async function getFableMcpInfo(): Promise<{ available: boolean; filename: string | null }> {
|
||||
return apiGet('/api/fable-mcp/info');
|
||||
}
|
||||
|
||||
export async function apiStreamPost(
|
||||
path: string,
|
||||
body: unknown,
|
||||
@@ -640,117 +458,6 @@ export const createApiKey = (name: string, scope: 'read' | 'write') =>
|
||||
|
||||
export const revokeApiKey = (id: number) => apiDelete(`/api/api-keys/${id}`)
|
||||
|
||||
// ─── News ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
import type { NewsItem } from '@/types/news'
|
||||
|
||||
export interface GetNewsItemsParams {
|
||||
days?: number
|
||||
limit?: number
|
||||
offset?: number
|
||||
feed_id?: number | null
|
||||
}
|
||||
|
||||
export function getNewsItems(params: GetNewsItemsParams = {}) {
|
||||
const p = new URLSearchParams()
|
||||
if (params.days != null) p.set('days', String(params.days))
|
||||
if (params.limit != null) p.set('limit', String(params.limit))
|
||||
if (params.offset != null) p.set('offset', String(params.offset))
|
||||
if (params.feed_id != null) p.set('feed_id', String(params.feed_id))
|
||||
return apiGet<{ items: NewsItem[]; offset: number; limit: number }>(
|
||||
`/api/briefing/news?${p}`
|
||||
)
|
||||
}
|
||||
|
||||
// ─── Voice ────────────────────────────────────────────────────────────────────
|
||||
|
||||
export interface VoiceStatusResult {
|
||||
enabled: boolean
|
||||
stt: boolean
|
||||
tts: boolean
|
||||
stt_model?: string
|
||||
tts_backend?: string
|
||||
}
|
||||
|
||||
export interface VoiceEntry {
|
||||
id: string
|
||||
label: string
|
||||
language?: string
|
||||
quality?: string
|
||||
sample_rate?: number
|
||||
}
|
||||
|
||||
export interface VoiceLibraryEntry {
|
||||
id: string
|
||||
name: string
|
||||
language_code: string
|
||||
language_name: string
|
||||
country: string
|
||||
quality: string
|
||||
num_speakers: number
|
||||
size_bytes: number
|
||||
installed: boolean
|
||||
installed_source: 'user' | 'bundled' | null
|
||||
}
|
||||
|
||||
export const getVoiceStatus = () => apiGet<VoiceStatusResult>('/api/voice/status')
|
||||
|
||||
export const getVoiceList = () =>
|
||||
apiGet<{ voices: VoiceEntry[] }>('/api/voice/voices').then(r => r.voices)
|
||||
|
||||
export const getVoiceLibrary = (refresh = false) =>
|
||||
apiGet<{ voices: VoiceLibraryEntry[]; count: number }>(
|
||||
refresh ? '/api/voice/voices/library?refresh=1' : '/api/voice/voices/library'
|
||||
)
|
||||
|
||||
export const installVoice = (voiceId: string) =>
|
||||
apiPost<{ id: string; size_bytes: number; skipped: boolean }>(
|
||||
'/api/voice/voices/install',
|
||||
{ voice_id: voiceId }
|
||||
)
|
||||
|
||||
export const uninstallVoice = (voiceId: string) =>
|
||||
apiDelete(`/api/voice/voices/${encodeURIComponent(voiceId)}`)
|
||||
|
||||
export async function transcribeAudio(blob: Blob, context?: string): Promise<{ transcript: string; duration_ms: number }> {
|
||||
const form = new FormData()
|
||||
form.append('audio', blob, 'audio.webm')
|
||||
if (context) form.append('context', context)
|
||||
const res = await fetch('/api/voice/transcribe', { method: 'POST', body: form })
|
||||
if (!res.ok) {
|
||||
const err = await res.json().catch(() => ({ error: `HTTP ${res.status}` }))
|
||||
throw new ApiError(res.status, err)
|
||||
}
|
||||
return res.json()
|
||||
}
|
||||
|
||||
export async function synthesiseSpeech(
|
||||
text: string,
|
||||
voice?: string,
|
||||
speed?: number,
|
||||
): Promise<Blob> {
|
||||
// Only send voice/speed when explicitly provided — omitting them lets the
|
||||
// server auto-load the user's saved voice settings.
|
||||
// Voice blending was removed with the kokoro → piper migration (piper has
|
||||
// no blend equivalent); callers that previously passed `voiceBlend` should
|
||||
// pass the first voice's id as `voice` instead.
|
||||
const body: Record<string, unknown> = { text }
|
||||
if (voice !== undefined || speed !== undefined) {
|
||||
body.voice = voice ?? 'en_US-amy-medium'
|
||||
body.speed = speed ?? 1.0
|
||||
}
|
||||
const res = await fetch('/api/voice/synthesise', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(body),
|
||||
})
|
||||
if (!res.ok) {
|
||||
const err = await res.json().catch(() => ({ error: `HTTP ${res.status}` }))
|
||||
throw new ApiError(res.status, err)
|
||||
}
|
||||
return res.blob()
|
||||
}
|
||||
|
||||
// ── User Profile ─────────────────────────────────────────────────────────────
|
||||
|
||||
export interface UserProfile {
|
||||
@@ -762,36 +469,11 @@ export interface UserProfile {
|
||||
tone: 'casual' | 'professional' | 'technical'
|
||||
interests: string[]
|
||||
work_schedule: { days?: string[]; start?: string; end?: string }
|
||||
learned_summary: string
|
||||
observations_count: number
|
||||
observations_updated_at: string | null
|
||||
}
|
||||
|
||||
export const getProfile = () => apiGet<UserProfile>('/api/profile')
|
||||
export const updateProfile = (data: Partial<UserProfile>) =>
|
||||
apiPut<UserProfile>('/api/profile', data)
|
||||
export const consolidateProfile = () =>
|
||||
apiPost<{ status: string; learned_summary: string }>('/api/profile/consolidate', {})
|
||||
export const clearProfileObservations = () => apiDelete('/api/profile/observations')
|
||||
|
||||
export interface ProfileObservationEntry {
|
||||
date: string
|
||||
bullets: string
|
||||
}
|
||||
|
||||
export const listProfileObservations = () =>
|
||||
apiGet<{ observations: ProfileObservationEntry[] }>('/api/profile/observations')
|
||||
|
||||
|
||||
// ── Tasks ────────────────────────────────────────────────────────────────────
|
||||
|
||||
import type { Note as Task } from '../types/note'
|
||||
|
||||
/** Manually trigger a consolidation pass for a task. Returns the freshly-
|
||||
* updated task with new body + consolidated_at. Bypasses the user's
|
||||
* auto_consolidate_tasks setting. */
|
||||
export const consolidateTask = (id: number) =>
|
||||
apiPost<Task>(`/api/tasks/${id}/consolidate`, {})
|
||||
|
||||
|
||||
// ── Note Versions (pinning) ──────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user