kimi-code / packages /agent-core-v2 /src /features /featureAssemblyService.ts
SaylorTwift's picture
SaylorTwift HF Staff
Add files using upload-large-folder tool
4e23b01 verified
Raw History Blame Contribute Delete
816 Bytes
import { IFeatureManager } from '#/app/feature/featureManager';
import { LifecycleScope } from '#/app/scopes';
import { ScopeActivation, registerScopedService } from '#/_base/di/scope';
import { Service } from '#/_base/di/service';
import { IFeatureAssemblyService } from './featureAssembly';
import { getFeatureRecipes } from './featureRegistry';
export class FeatureAssemblyService extends Service implements IFeatureAssemblyService {
declare readonly _serviceBrand: undefined;
constructor(@IFeatureManager featureManager: IFeatureManager) {
super();
for (const recipe of getFeatureRecipes()) {
featureManager.provideUnit(recipe);
}
}
}
registerScopedService(
LifecycleScope.App,
IFeatureAssemblyService,
FeatureAssemblyService,
ScopeActivation.OnScopeCreated,
'features',
);