Download packages/agent-core-v2/test/persistence/interface/stubs.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/test/persistence/interface/stubs.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/agent-core-v2/test/persistence/interface/stubs.ts
-
curl -L -o stubs.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/test/persistence/interface/stubs.ts
1.26 kB
| import { | |
| IQueryStore, | |
| type Checkpoint, | |
| type ColumnPageQuery, | |
| type IQuery, | |
| type Page, | |
| } from '#/persistence/interface/queryStore'; | |
| export function stubQueryStore(): IQueryStore { | |
| return { | |
| _serviceBrand: undefined, | |
| put: async (_c: string, _k: string, _v: unknown) => {}, | |
| batch: async (_ops) => {}, | |
| delete: async (_c: string, _k: string) => {}, | |
| get: async <T>(_c: string, _k: string) => undefined as T | undefined, | |
| getMany: async <T>(_c: string, _keys: readonly string[]) => new Map<string, T>(), | |
| query: <T>(_c: string) => emptyQuery<T>(), | |
| pageByColumn: async <T>(_c: string, _q: ColumnPageQuery) => ({ items: [] as T[] }), | |
| ensureIndex: async (_c, _d) => {}, | |
| listKeys: async (_c: string) => [], | |
| dropCollection: async (_c: string) => {}, | |
| getCheckpoint: async (_s: string) => undefined as Checkpoint | undefined, | |
| setCheckpoint: async (_s: string, _c: Checkpoint) => {}, | |
| storeEpoch: () => 0, | |
| close: async () => {}, | |
| }; | |
| } | |
| function emptyQuery<T>(): IQuery<T> { | |
| const page: Page<T> = { items: [] }; | |
| const q: IQuery<T> = { | |
| where: () => q, | |
| whereColumn: () => q, | |
| orderBy: () => q, | |
| limit: () => q, | |
| cursor: () => q, | |
| execute: () => Promise.resolve(page), | |
| }; | |
| return q; | |
| } | |