Download packages/agent-core-v2/test/app/plugin/stubs.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 1.6 kB
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/test/app/plugin/stubs.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/agent-core-v2/test/app/plugin/stubs.ts
-
curl -L -o stubs.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/test/app/plugin/stubs.ts
1.6 kB
| import { Event, type Emitter } from '#/_base/event'; | |
| import type { IPluginService } from '#/app/plugin/plugin'; | |
| import type { | |
| EnabledPluginSessionStart, | |
| PluginMutationSummary, | |
| PluginReloadEvent, | |
| ReloadSummary, | |
| } from '#/app/plugin/types'; | |
| interface StubPluginServiceOptions { | |
| readonly sessionStarts: readonly EnabledPluginSessionStart[]; | |
| readonly reloadEmitter?: Emitter<PluginReloadEvent>; | |
| readonly mutateEmitter?: Emitter<PluginMutationSummary>; | |
| } | |
| export function stubPluginService(options: StubPluginServiceOptions): IPluginService { | |
| return { | |
| _serviceBrand: undefined, | |
| onDidReload: options.reloadEmitter?.event ?? (Event.None as IPluginService['onDidReload']), | |
| onDidMutate: options.mutateEmitter?.event ?? (Event.None as IPluginService['onDidMutate']), | |
| listPlugins: async () => [], | |
| installPlugin: async () => ({ id: '' }) as never, | |
| setPluginEnabled: async () => {}, | |
| setPluginMcpServerEnabled: async () => {}, | |
| removePlugin: async () => {}, | |
| reloadPlugins: async (): Promise<ReloadSummary> => ({ added: [], removed: [], errors: [] }), | |
| getPluginInfo: async () => { | |
| throw new Error('getPluginInfo is not used by this stub'); | |
| }, | |
| listPluginCommands: async () => [], | |
| checkUpdates: async () => [], | |
| pluginSkillRoots: async () => [], | |
| pluginAgentRoots: async () => [], | |
| enabledSessionStarts: async () => options.sessionStarts, | |
| enabledSystemPrompts: async () => [], | |
| enabledMcpServers: async () => ({}), | |
| mcpServerEntries: async () => [], | |
| enabledHooks: async () => [], | |
| hasLoadedSnapshot: () => true, | |
| }; | |
| } | |