From b7f0a269e7b1790cc17412ef534c9edf6037a56b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 17:36:24 +0000 Subject: [PATCH 1/2] chore: release packages --- .changeset/every-rockets-tie.md | 5 ----- packages/cli/CHANGELOG.md | 6 ++++++ packages/cli/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/every-rockets-tie.md diff --git a/.changeset/every-rockets-tie.md b/.changeset/every-rockets-tie.md deleted file mode 100644 index ab7ea3e..0000000 --- a/.changeset/every-rockets-tie.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@mixedbread/cli": minor ---- - -Support multipart uploads and use it by default for larger files diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 275c9b6..5712673 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2.3.0 + +### Minor Changes + +- 8a49b7c: Support multipart uploads and use it by default for larger files + ## 2.2.3 ### Patch Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index 492ebc2..f75fbca 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@mixedbread/cli", - "version": "2.2.3", + "version": "2.3.0", "description": "CLI tool for managing the Mixedbread platform.", "author": "Mixedbread ", "license": "Apache-2.0", From da2bb81ff949a8fa0cd4b6168c3bfe6273766f54 Mon Sep 17 00:00:00 2001 From: aavash Date: Fri, 6 Mar 2026 18:40:41 +0100 Subject: [PATCH 2/2] chore: npx biome format --- packages/cli/src/commands/store/sync.ts | 8 +++---- packages/cli/src/commands/store/upload.ts | 6 ++--- packages/cli/src/utils/sync.ts | 4 +++- packages/cli/src/utils/upload.ts | 23 ++++++++++++++----- packages/cli/tests/utils/vector-store.test.ts | 5 +--- 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/packages/cli/src/commands/store/sync.ts b/packages/cli/src/commands/store/sync.ts index 7caa0a7..b443a69 100644 --- a/packages/cli/src/commands/store/sync.ts +++ b/packages/cli/src/commands/store/sync.ts @@ -5,7 +5,6 @@ import { z } from "zod"; import { createClient } from "../../utils/client"; import { warnContextualizationDeprecated } from "../../utils/deprecation"; import { getGitInfo } from "../../utils/git"; -import type { MultipartUploadOptions } from "../../utils/upload"; import { addGlobalOptions, extendGlobalOptions, @@ -22,6 +21,7 @@ import { formatChangeSummary, } from "../../utils/sync"; import { getSyncedFiles } from "../../utils/sync-state"; +import type { MultipartUploadOptions } from "../../utils/upload"; const SyncStoreSchema = extendGlobalOptions({ nameOrId: z.string().min(1, { error: '"name-or-id" is required' }), @@ -87,15 +87,15 @@ export function createSyncCommand(): Command { .option("--parallel ", "Number of concurrent operations (1-200)") .option( "--multipart-threshold ", - "File size threshold in MB to trigger multipart upload", + "File size threshold in MB to trigger multipart upload" ) .option( "--multipart-part-size ", - "Size of each part in MB for multipart upload", + "Size of each part in MB for multipart upload" ) .option( "--multipart-concurrency ", - "Number of concurrent part uploads for multipart upload", + "Number of concurrent part uploads for multipart upload" ) ); diff --git a/packages/cli/src/commands/store/upload.ts b/packages/cli/src/commands/store/upload.ts index 70af091..7224ee2 100644 --- a/packages/cli/src/commands/store/upload.ts +++ b/packages/cli/src/commands/store/upload.ts @@ -98,15 +98,15 @@ export function createUploadCommand(): Command { .option("--manifest ", "Upload using manifest file") .option( "--multipart-threshold ", - "File size threshold in MB to trigger multipart upload", + "File size threshold in MB to trigger multipart upload" ) .option( "--multipart-part-size ", - "Size of each part in MB for multipart upload", + "Size of each part in MB for multipart upload" ) .option( "--multipart-concurrency ", - "Number of concurrent part uploads for multipart upload", + "Number of concurrent part uploads for multipart upload" ) ); diff --git a/packages/cli/src/utils/sync.ts b/packages/cli/src/utils/sync.ts index 8916ed2..b27616f 100644 --- a/packages/cli/src/utils/sync.ts +++ b/packages/cli/src/utils/sync.ts @@ -434,7 +434,9 @@ export async function executeSyncChanges( const failedCount = results.uploads.failed.length - skippedCount; if (uploadedOk === uploadTotal) { - uploadSpinner.stop(`Uploaded ${formatCountWithSuffix(uploadTotal, "file")}`); + uploadSpinner.stop( + `Uploaded ${formatCountWithSuffix(uploadTotal, "file")}` + ); } else { const parts: string[] = []; if (failedCount > 0) parts.push(`${failedCount} failed`); diff --git a/packages/cli/src/utils/upload.ts b/packages/cli/src/utils/upload.ts index 01dbe5d..3940d4d 100644 --- a/packages/cli/src/utils/upload.ts +++ b/packages/cli/src/utils/upload.ts @@ -1,6 +1,6 @@ import { readFile, stat } from "node:fs/promises"; -import { basename, relative } from "node:path"; import { cpus, freemem } from "node:os"; +import { basename, relative } from "node:path"; import type Mixedbread from "@mixedbread/sdk"; import type { FileCreateParams } from "@mixedbread/sdk/resources/stores"; import chalk from "chalk"; @@ -140,8 +140,13 @@ export async function uploadFile( filePath: string, options: UploadFileOptions = {} ): Promise { - const { metadata = {}, strategy, externalId, multipartUpload, onProgress } = - options; + const { + metadata = {}, + strategy, + externalId, + multipartUpload, + onProgress, + } = options; // Read file content const fileContent = await readFile(filePath); @@ -284,7 +289,9 @@ export async function uploadFilesInBatch( const stats = await stat(file.path); if (stats.size === 0) { completed++; - uploadSpinner.message(`Uploading ${completed}/${formatCountWithSuffix(total, "file")}...`); + uploadSpinner.message( + `Uploading ${completed}/${formatCountWithSuffix(total, "file")}...` + ); results.skipped++; return; } @@ -341,11 +348,15 @@ export async function uploadFilesInBatch( results.successfulSize += stats.size; completed++; - uploadSpinner.message(`Uploading ${completed}/${formatCountWithSuffix(total, "file")}...`); + uploadSpinner.message( + `Uploading ${completed}/${formatCountWithSuffix(total, "file")}...` + ); } catch (error) { results.failed++; completed++; - uploadSpinner.message(`Uploading ${completed}/${formatCountWithSuffix(total, "file")}...`); + uploadSpinner.message( + `Uploading ${completed}/${formatCountWithSuffix(total, "file")}...` + ); const errorMsg = error instanceof Error ? error.message : "Unknown error"; log.error(`${relativePath} - ${errorMsg}`); diff --git a/packages/cli/tests/utils/vector-store.test.ts b/packages/cli/tests/utils/vector-store.test.ts index ce38ea2..f986d91 100644 --- a/packages/cli/tests/utils/vector-store.test.ts +++ b/packages/cli/tests/utils/vector-store.test.ts @@ -136,10 +136,7 @@ describe("Store Utils", () => { }); await expect( - resolveStore( - mockClient as unknown as Mixedbread, - "nonexistent-store" - ) + resolveStore(mockClient as unknown as Mixedbread, "nonexistent-store") ).rejects.toThrow('Store "nonexistent-store" not found'); });