Download packages/agent-core-v2/src/app/feature/featureServiceContribution.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 674 Bytes
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/app/feature/featureServiceContribution.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/agent-core-v2/src/app/feature/featureServiceContribution.ts
-
curl -L -o featureServiceContribution.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/app/feature/featureServiceContribution.ts
674 Bytes
| import { collection } from '#/_base/di/collection'; | |
| import type { ServiceIdentifier } from '#/_base/di/instantiation'; | |
| import type { LifecycleScope } from '#/app/scopes'; | |
| export interface ContributedFeatureService { | |
| readonly scope: LifecycleScope; | |
| readonly id: ServiceIdentifier<unknown>; | |
| } | |
| export const FeatureServiceContribution = collection<ContributedFeatureService>( | |
| 'feature-service', | |
| { | |
| validate(value, existing) { | |
| if (existing.some((entry) => entry.scope === value.scope && entry.id === value.id)) { | |
| throw new Error( | |
| `Service ${String(value.id)} is already contributed at scope ${value.scope}`, | |
| ); | |
| } | |
| }, | |
| }, | |
| ); | |