chore(cleanup): remove assistant-exclusive skills

Removes the meeting transcription/recording feature end-to-end
(get_last_meeting_summary, meetingRecorder/meetingStore/summarize, the
useMeetingRecorder renderer hook, and the related IPC/preload wiring) and
the remember_info/forget_info long-term memory skills: all three were only
ever reachable from the now-removed Assistant mode. adjust_mood and its
mood store are unrelated (transversal) and are kept as-is.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
william
2026-10-31 19:27:11 +01:00
parent 2363dc8164
commit 83043b5819
23 changed files with 13 additions and 749 deletions
@@ -26,9 +26,6 @@ vi.mock('../../../src/renderer/src/voice/useVoiceAssistant', () => ({ useVoiceAs
vi.mock('../../../src/renderer/src/voice/useProactiveSpeech', () => ({
useProactiveSpeech: vi.fn()
}))
vi.mock('../../../src/renderer/src/voice/useMeetingRecorder', () => ({
useMeetingRecorder: vi.fn()
}))
let onUpdateAvailableCb: (() => void) | undefined
let onUpdateReadyCb: (() => void) | undefined
@@ -53,7 +50,6 @@ function setupWindowApi(): void {
return () => {}
}),
onToggleListening: vi.fn(() => () => {}),
onToggleMeetingTranscription: vi.fn(() => () => {}),
onProactiveSpeech: vi.fn(() => () => {}),
getPathForFile,
sendDroppedFiles,
@@ -126,7 +122,7 @@ describe('<App />', () => {
expect(sendDroppedFiles).not.toHaveBeenCalled()
})
it('should request the context menu with the current listening/transcribing state', () => {
it('should request the context menu with the current listening state', () => {
// Faux par defaut (ecoute non activee tant qu'aucun compte n'est connecte, voir
// getAuthStatus ci-dessus qui renvoie loggedIn: false).
render(<App />)
@@ -1,96 +0,0 @@
import { describe, it, expect, vi, beforeEach } from 'vitest'
import { renderHook } from '@testing-library/react'
let onToggleCallback: ((transcribing: boolean) => void) | undefined
const sendMeetingAudioChunk = vi.fn()
const sendMeetingRecordingStopped = vi.fn()
const onToggleMeetingTranscription = vi.fn((cb: (transcribing: boolean) => void) => {
onToggleCallback = cb
return () => {}
})
function fakeStream(): MediaStream {
const stop = vi.fn()
return { getTracks: () => [{ stop }] } as unknown as MediaStream
}
const getUserMedia = vi.fn(async () => fakeStream())
const enumerateDevices = vi.fn(async () => [])
class FakeMediaRecorder {
static instances: FakeMediaRecorder[] = []
state: 'recording' | 'inactive' = 'recording'
ondataavailable: ((event: { data: Blob }) => void) | null = null
onstop: (() => void) | null = null
constructor(
public stream: MediaStream,
public options: { mimeType: string }
) {
FakeMediaRecorder.instances.push(this)
}
start(): void {
this.state = 'recording'
}
stop(): void {
this.state = 'inactive'
this.ondataavailable?.({ data: new Blob(['chunk'], { type: 'audio/webm' }) })
this.onstop?.()
}
}
const { useMeetingRecorder } = await import('../../../src/renderer/src/voice/useMeetingRecorder')
describe('useMeetingRecorder()', () => {
beforeEach(() => {
vi.clearAllMocks()
FakeMediaRecorder.instances = []
;(window as unknown as { api: Record<string, unknown> }).api = {
onToggleMeetingTranscription,
sendMeetingAudioChunk,
sendMeetingRecordingStopped
}
Object.defineProperty(navigator, 'mediaDevices', {
value: { getUserMedia, enumerateDevices },
configurable: true
})
vi.stubGlobal('MediaRecorder', FakeMediaRecorder)
})
it('should start recording the microphone when transcription is toggled on', async () => {
renderHook(() => useMeetingRecorder())
onToggleCallback?.(true)
await vi.waitFor(() => expect(FakeMediaRecorder.instances.length).toBe(1))
expect(getUserMedia).toHaveBeenCalledWith({ audio: true })
})
it('should give up quietly when the microphone is unavailable, without ever starting a recorder', async () => {
getUserMedia.mockRejectedValueOnce(new Error('no mic'))
renderHook(() => useMeetingRecorder())
onToggleCallback?.(true)
await vi.waitFor(() => expect(getUserMedia).toHaveBeenCalled())
// Rien n'a jamais demarre : stopper ensuite ne doit ni planter ni envoyer de notification pour
// une session qui n'a jamais existe.
expect(() => onToggleCallback?.(false)).not.toThrow()
expect(FakeMediaRecorder.instances.length).toBe(0)
})
it('should send the recorded chunk and notify the main process when stopped', async () => {
renderHook(() => useMeetingRecorder())
onToggleCallback?.(true)
await vi.waitFor(() => expect(FakeMediaRecorder.instances.length).toBe(1))
onToggleCallback?.(false)
await vi.waitFor(() => expect(sendMeetingAudioChunk).toHaveBeenCalled())
expect(sendMeetingRecordingStopped).toHaveBeenCalled()
})
it('should start a new segment automatically instead of stopping when not asked to stop', async () => {
renderHook(() => useMeetingRecorder())
onToggleCallback?.(true)
await vi.waitFor(() => expect(FakeMediaRecorder.instances.length).toBe(1))
FakeMediaRecorder.instances[0]?.stop()
await vi.waitFor(() => expect(FakeMediaRecorder.instances.length).toBe(2))
expect(sendMeetingRecordingStopped).not.toHaveBeenCalled()
})
})