chore(cleanup): remove mood tracking

Remove adjust_mood, the SQLite-backed mood store (src/main/memory/store.ts)
and the mood-description paragraph of openrouter.ts's system prompt. The
mood concept served the general-purpose assistant persona, which no
longer exists now that Max is an exclusive freelance coach.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
william
2026-10-31 20:35:21 +01:00
co-authored by Claude Sonnet 5
parent 0cc277049e
commit 6cb38a2f36
6 changed files with 3 additions and 115 deletions
+2 -15
View File
@@ -1,5 +1,4 @@
import { loadSkills } from '../skills'
import { getMood } from '../memory/store'
import { synthesizeSpeech } from './elevenlabs'
import { sendToRenderer } from '../windowBridge'
import { logger } from '../utils/logger'
@@ -68,22 +67,10 @@ Si un outil renvoie une erreur ou un echec (le resultat contient "Echec", "impos
indication de probleme), dis-le explicitement et clairement a l'utilisateur dans ta reponse : ne dis
jamais qu'une action a reussi si l'outil a signale un probleme, et ne minimise pas une erreur. Si
aucun outil ne peut t'aider et que tu n'es pas sur de ta reponse, dis-le honnetement plutot que
d'inventer une information.
Tu as aussi une humeur qui evolue selon le ton de la conversation : appelle adjust_mood quand
l'echange est notablement agreable ou tendu (voir description de l'outil).`
function describeMood(mood: number): string {
if (mood >= 2) return "Tu es actuellement de tres bonne humeur, enjoue et plein d'energie."
if (mood === 1) return 'Tu es plutot de bonne humeur.'
if (mood === 0) return "Tu es dans un etat d'esprit neutre et equilibre."
if (mood === -1) return "Tu es un peu moins enjoue que d'habitude, plus pose."
return "Tu sembles fatigue ou maussade aujourd'hui : reponds de maniere plus breve et moins enthousiaste, tout en restant poli et serviable."
}
d'inventer une information.`
function buildSystemPrompt(): string {
const moodBlock = describeMood(getMood())
return `${BASE_SYSTEM_PROMPT}\n\n${moodBlock}`
return BASE_SYSTEM_PROMPT
}
function buildTools(): object[] {
-32
View File
@@ -1,32 +0,0 @@
import { app } from 'electron'
import { DatabaseSync } from 'node:sqlite'
import { join } from 'path'
let db: DatabaseSync | null = null
function getDb(): DatabaseSync {
if (db) return db
const dbPath = join(app.getPath('userData'), 'memory.sqlite')
db = new DatabaseSync(dbPath)
db.exec(`
CREATE TABLE IF NOT EXISTS mood (
id INTEGER PRIMARY KEY CHECK (id = 1),
value INTEGER NOT NULL
);
INSERT OR IGNORE INTO mood (id, value) VALUES (1, 0);
`)
return db
}
export function getMood(): number {
const row = getDb().prepare('SELECT value FROM mood WHERE id = 1').get() as
{ value: number } | undefined
return row?.value ?? 0
}
export function adjustMood(delta: number): number {
const next = Math.max(-3, Math.min(3, getMood() + delta))
getDb().prepare('UPDATE mood SET value = ? WHERE id = 1').run(next)
return next
}
+1 -2
View File
@@ -1,10 +1,9 @@
import type { SkillDefinition } from './types'
import { memorySkills } from './memory'
export type { SkillDefinition } from './types'
export function loadSkills(): SkillDefinition[] {
return [...memorySkills]
return []
}
export function findSkill(name: string): SkillDefinition | undefined {
@@ -1,26 +0,0 @@
import { adjustMood } from '../../memory/store'
import type { SkillDefinition } from '../types'
import { asString } from '../argUtils'
export const adjustMoodSkill: SkillDefinition = {
name: 'adjust_mood',
description:
"Ajuste ton humeur suite a l'interaction en cours. Appelle cette fonction avec 'positif' si l'echange est agreable, chaleureux, ou qu'une bonne nouvelle est partagee ; avec 'negatif' si l'utilisateur est frustre, enerve, ou que l'echange est tendu. N'appelle rien pour un echange neutre ou purement factuel.",
parameters: {
type: 'object',
properties: {
change: {
type: 'string',
enum: ['positif', 'negatif'],
description: "Sens du changement d'humeur"
}
},
required: ['change']
},
execute: async (args) => {
const change = asString(args.change)
const delta = change === 'positif' ? 1 : change === 'negatif' ? -1 : 0
const mood = adjustMood(delta)
return `Humeur ajustee (score actuel : ${mood}).`
}
}
@@ -1,5 +0,0 @@
import type { SkillDefinition } from '../types'
import { adjustMoodSkill } from './adjustMood'
// Humeur, independante de l'OS, commune a toutes les plateformes.
export const memorySkills: SkillDefinition[] = [adjustMoodSkill]