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:
@@ -1,13 +1,6 @@
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import { describe, it, expect, vi } from 'vitest'
|
||||
|
||||
const ipcMainOn = vi.fn()
|
||||
const ipcMainRemoveListener = vi.fn()
|
||||
vi.mock('electron', () => ({
|
||||
ipcMain: { on: ipcMainOn, removeListener: ipcMainRemoveListener }
|
||||
}))
|
||||
|
||||
const { setMainWindow, sendToRenderer, requestCameraFrame } =
|
||||
await import('../../src/main/windowBridge')
|
||||
const { setMainWindow, sendToRenderer } = await import('../../src/main/windowBridge')
|
||||
|
||||
describe('sendToRenderer()', () => {
|
||||
it('should do nothing when no main window has been set', () => {
|
||||
@@ -21,68 +14,3 @@ describe('sendToRenderer()', () => {
|
||||
expect(send).toHaveBeenCalledWith('some-channel', 'a', 'b')
|
||||
})
|
||||
})
|
||||
|
||||
describe('requestCameraFrame()', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
})
|
||||
|
||||
it('should reject immediately when no main window is available', async () => {
|
||||
setMainWindow(null as never)
|
||||
await expect(requestCameraFrame()).rejects.toThrow(/Fenetre indisponible/)
|
||||
})
|
||||
|
||||
it('should resolve with the data URL once the renderer responds for the matching request', async () => {
|
||||
const send = vi.fn()
|
||||
setMainWindow({ webContents: { send } } as never)
|
||||
|
||||
const promise = requestCameraFrame(1000)
|
||||
const requestId = send.mock.calls[0]?.[1] as string
|
||||
const handler = ipcMainOn.mock.calls.find((c) => c[0] === 'camera-frame-result')?.[1] as (
|
||||
event: unknown,
|
||||
id: string,
|
||||
dataUrl: string | null
|
||||
) => void
|
||||
|
||||
handler({}, requestId, 'data:image/png;base64,abc')
|
||||
await expect(promise).resolves.toBe('data:image/png;base64,abc')
|
||||
})
|
||||
|
||||
it('should reject when the renderer responds with null (camera unavailable)', async () => {
|
||||
const send = vi.fn()
|
||||
setMainWindow({ webContents: { send } } as never)
|
||||
|
||||
const promise = requestCameraFrame(1000)
|
||||
const requestId = send.mock.calls[0]?.[1] as string
|
||||
const handler = ipcMainOn.mock.calls.find((c) => c[0] === 'camera-frame-result')?.[1] as (
|
||||
event: unknown,
|
||||
id: string,
|
||||
dataUrl: string | null
|
||||
) => void
|
||||
|
||||
handler({}, requestId, null)
|
||||
await expect(promise).rejects.toThrow(/Impossible d'acceder a la camera/)
|
||||
})
|
||||
|
||||
it('should ignore a response for a different request id', async () => {
|
||||
const send = vi.fn()
|
||||
setMainWindow({ webContents: { send } } as never)
|
||||
|
||||
const promise = requestCameraFrame(1000)
|
||||
const handler = ipcMainOn.mock.calls.find((c) => c[0] === 'camera-frame-result')?.[1] as (
|
||||
event: unknown,
|
||||
id: string,
|
||||
dataUrl: string | null
|
||||
) => void
|
||||
|
||||
handler({}, 'un-autre-id', 'data:image/png;base64,ignore')
|
||||
const handlerAgain = ipcMainOn.mock.calls.find((c) => c[0] === 'camera-frame-result')?.[1] as (
|
||||
event: unknown,
|
||||
id: string,
|
||||
dataUrl: string | null
|
||||
) => void
|
||||
const requestId = send.mock.calls[0]?.[1] as string
|
||||
handlerAgain({}, requestId, 'data:image/png;base64,bon')
|
||||
await expect(promise).resolves.toBe('data:image/png;base64,bon')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user