diff --git a/src/infrastructure/di/container.ts b/src/infrastructure/di/container.ts index ca97c947..fd1e6a42 100644 --- a/src/infrastructure/di/container.ts +++ b/src/infrastructure/di/container.ts @@ -21,6 +21,7 @@ import type { IGitClient } from '../../domain/interfaces/IGitClient'; import { NotesService } from '../services/NotesService'; import { GitClient } from '../git/GitClient'; import { MemoryRepository } from '../repositories/MemoryRepository'; +import { TrailerService } from '../services/TrailerService'; import { EventBus } from '../events/EventBus'; import { createLogger } from '../logging/factory'; import { createLLMClient } from '../llm/LLMClientFactory'; @@ -55,6 +56,7 @@ export function createContainer(options?: IContainerOptions): AwilixContainer { const bus = new EventBus(container.cradle.logger); diff --git a/src/infrastructure/di/types.ts b/src/infrastructure/di/types.ts index ea13a895..fd21c23b 100644 --- a/src/infrastructure/di/types.ts +++ b/src/infrastructure/di/types.ts @@ -23,6 +23,7 @@ import type { ILiberateService } from '../../application/interfaces/ILiberateSer import type { IMemoryContextLoader } from '../../domain/interfaces/IMemoryContextLoader'; import type { IContextFormatter } from '../../domain/interfaces/IContextFormatter'; import type { ISessionCaptureService } from '../../domain/interfaces/ISessionCaptureService'; +import type { ITrailerService } from '../../domain/interfaces/ITrailerService'; export interface ICradle { // Infrastructure @@ -30,6 +31,7 @@ export interface ICradle { notesService: INotesService; gitClient: IGitClient; memoryRepository: IMemoryRepository; + trailerService: ITrailerService; triageService: IGitTriageService; llmClient: ILLMClient | null; eventBus: IEventBus; diff --git a/tests/unit/infrastructure/di/container.test.ts b/tests/unit/infrastructure/di/container.test.ts index 65b10a60..09546803 100644 --- a/tests/unit/infrastructure/di/container.test.ts +++ b/tests/unit/infrastructure/di/container.test.ts @@ -41,6 +41,7 @@ describe('createContainer', () => { assert.ok(cradle.notesService); assert.ok(cradle.gitClient); assert.ok(cradle.memoryRepository); + assert.ok(cradle.trailerService); assert.ok(cradle.eventBus); assert.ok(cradle.triageService); assert.ok(cradle.memoryService); @@ -162,6 +163,22 @@ describe('createContainer', () => { }); }); + describe('trailerService', () => { + it('should resolve with expected interface', () => { + const container = createContainer(); + const { trailerService } = container.cradle; + + assert.equal(typeof trailerService.readTrailers, 'function'); + assert.equal(typeof trailerService.formatTrailers, 'function'); + assert.equal(typeof trailerService.queryTrailers, 'function'); + }); + + it('should return singleton within container scope', () => { + const container = createContainer(); + assert.equal(container.cradle.trailerService, container.cradle.trailerService); + }); + }); + describe('hook services', () => { it('should resolve hook services with expected interfaces', () => { const container = createContainer();