()
| 18 | * Supports authentication via MXBAI_API_KEY env var or OAuth token |
| 19 | */ |
| 20 | export async function createStore(): Promise<Store> { |
| 21 | if (isTest) { |
| 22 | return new TestStore(); |
| 23 | } |
| 24 | |
| 25 | await ensureAuthenticated(); |
| 26 | |
| 27 | async function createClient() { |
| 28 | const jwtToken = await getJWTToken(); |
| 29 | return new Mixedbread({ |
| 30 | baseURL: BASE_URL, |
| 31 | apiKey: jwtToken, |
| 32 | }); |
| 33 | } |
| 34 | |
| 35 | const client = await createClient(); |
| 36 | return new MixedbreadStore(client, createClient); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Creates a Git instance |
no test coverage detected