chore(cleanup): remove old SQLite coach pipeline

The entire local-SQLite Coach teaching pipeline (objective/level/plan/module
agents, course-build stepper, written-exercise and drawing windows, review
scheduler, screen/camera vision capture for blockage detection, and their
renderer views) is retired: it will be replaced by a brand new 7-agent
pipeline living server-side in Max API/Postgres, built in a later step.

Removes src/main/coach/, the coach and vision skill definitions, the coach
renderer views and CourseBuildStepper, drawRoughShapes, useCameraCapture,
the camera-frame IPC bridge, and the shared coach/courseBuild/drawing
types. Strips the corresponding pipeline guard-rails, system-prompt
instructions and IPC handlers from openrouter.ts/index.ts/preload. Drops
the now-unused mermaid/roughjs dependencies.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
william
2026-10-31 19:22:46 +01:00
parent 9aa5abc121
commit 2363dc8164
80 changed files with 24 additions and 8753 deletions
@@ -5,14 +5,10 @@ import { join } from 'node:path'
const tempDir = mkdtempSync(join(tmpdir(), 'forge-avatar-vision-meeting-test-'))
const getSources = vi.fn(async () => [{ thumbnail: { toPNG: () => Buffer.from([1, 2, 3]) } }])
const requestCameraFrame = vi.fn(async () => 'data:image/png;base64,abc')
vi.mock('electron', () => ({
app: { getPath: () => tempDir },
desktopCapturer: { getSources },
screen: { getPrimaryDisplay: () => ({ size: { width: 1920, height: 1080 } }) }
app: { getPath: () => tempDir }
}))
vi.mock('../../src/main/windowBridge', () => ({ requestCameraFrame, sendToRenderer: vi.fn() }))
vi.mock('../../src/main/windowBridge', () => ({ sendToRenderer: vi.fn() }))
// pdf-parse/index.js execute du code de demo au chargement quand `module.parent` est absent (cas du
// loader de Vitest), ce qui tente de lire un fichier de test inexistant : on le mocke entierement
@@ -23,11 +19,6 @@ vi.mock('mammoth', () => ({
default: { extractRawText: vi.fn(async () => ({ value: 'Texte extrait du docx' })) }
}))
const analyzeImage = vi.fn(async (_dataUrl: string, question: string) => `Reponse a: ${question}`)
vi.mock('../../src/main/ai/vision', () => ({ analyzeImage }))
const { analyzeScreen } = await import('../../src/main/skills/vision/analyzeScreen')
const { watchCamera } = await import('../../src/main/skills/vision/watchCamera')
const { searchWeb } = await import('../../src/main/skills/web/searchWeb')
const { getLastMeetingSummarySkill } =
await import('../../src/main/skills/meeting/getLastMeetingSummary')
@@ -36,36 +27,6 @@ const { extractText } = await import('../../src/main/skills/documents/extractTex
beforeEach(() => {
vi.clearAllMocks()
getSources.mockResolvedValue([{ thumbnail: { toPNG: () => Buffer.from([1, 2, 3]) } }])
requestCameraFrame.mockResolvedValue('data:image/png;base64,abc')
analyzeImage.mockImplementation(
async (_dataUrl: string, question: string) => `Reponse a: ${question}`
)
})
describe('analyze_screen', () => {
it('should capture the screen and ask the vision model with a default question', async () => {
const result = await analyzeScreen.execute({})
expect(result).toMatch(/Decris ce que tu vois a l'ecran/)
})
it('should throw when no screen source is detected', async () => {
getSources.mockResolvedValueOnce([])
await expect(analyzeScreen.execute({ question: 'test' })).rejects.toThrow(/Aucun ecran/)
})
})
describe('watch_camera', () => {
it('should request a camera frame and ask the vision model', async () => {
const result = await watchCamera.execute({ question: "Qu'est-ce que c'est ?" })
expect(result).toMatch(/Qu'est-ce que c'est/)
expect(requestCameraFrame).toHaveBeenCalled()
})
it('should use a default question when none is given', async () => {
const result = await watchCamera.execute({})
expect(result).toMatch(/Decris ce que tu vois/)
})
})
describe('search_web', () => {