feat(commands): multi-select ordered command pipeline with step reordering and single-pass composition (AI-05, AI-07)

This commit is contained in:
Yun Chan 2026-10-31 02:54:54 +09:00
parent f49acf0105
commit 10af20a0ad
157 changed files with 29455 additions and 913 deletions

View file

@ -32,8 +32,11 @@ import { resetCloudSyncServiceForTests } from '../../src/main/services/CloudSync
import { resetTTSPlaybackServiceForTests } from '../../src/main/services/TTSPlaybackService'
import { resetMeetingSummaryServiceForTests } from '../../src/main/services/MeetingSummaryService'
import { resetLocalLLMServiceForTests } from '../../src/main/services/LocalLLMService'
import { resetLocalSTTServiceForTests } from '../../src/main/services/LocalSTTService'
import type { IPCResult } from '@d3ro/core/errors'
import {
LocalSTTService,
resetLocalSTTServiceForTests,
} from '../../src/main/services/LocalSTTService'
import { D3ROError, ErrorCode, type IPCResult } from '@d3ro/core/errors'
import type { NewHistory } from '../../src/main/db/schema'
const ipcHandlers = new Map<string, (...args: unknown[]) => unknown>()
@ -103,6 +106,8 @@ export function resetAllSingletons(): void {
export function useRedHarness(): void {
let testdb: ReturnType<typeof createTestDb> | null = null
let initSpy: ReturnType<typeof vi.spyOn> | null = null
let ensureSidecarSpy: ReturnType<typeof vi.spyOn> | null = null
beforeEach(() => {
testdb = createTestDb()
@ -110,9 +115,28 @@ export function useRedHarness(): void {
initInMemoryConfig()
resetAllSingletons()
resetIpcHandlers()
vi.stubGlobal(
'fetch',
vi.fn(async () => {
throw new TypeError('fetch failed (red harness offline default)')
}),
)
const sidecarDisabledError = (): Promise<never> =>
Promise.reject(
new D3ROError(
ErrorCode.STTSidecarSpawnFailed,
'red harness: real Python sidecar spawn is disabled in usecase tests',
),
)
initSpy = vi.spyOn(LocalSTTService.prototype, 'initialize').mockImplementation(sidecarDisabledError)
ensureSidecarSpy = vi.spyOn(LocalSTTService.prototype, 'ensureSidecar').mockImplementation(sidecarDisabledError)
})
afterEach(() => {
initSpy?.mockRestore()
ensureSidecarSpy?.mockRestore()
initSpy = null
ensureSidecarSpy = null
resetAllSingletons()
unbindTestDatabase()
testdb?.close()