@mastra/turbopuffer 0.0.16-alpha.0 → 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_tsup-dts-rollup.d.cts +5 -7
- package/dist/_tsup-dts-rollup.d.ts +5 -7
- package/dist/index.cjs +5 -14
- package/dist/index.js +5 -14
- package/package.json +7 -4
|
@@ -7,7 +7,6 @@ import type { Filters } from '@turbopuffer/turbopuffer';
|
|
|
7
7
|
import type { IndexStats } from '@mastra/core/vector';
|
|
8
8
|
import { MastraVector } from '@mastra/core/vector';
|
|
9
9
|
import type { OperatorSupport } from '@mastra/core/vector/filter';
|
|
10
|
-
import type { ParamsToArgs } from '@mastra/core/vector';
|
|
11
10
|
import type { QueryResult } from '@mastra/core/vector';
|
|
12
11
|
import type { QueryVectorParams } from '@mastra/core/vector';
|
|
13
12
|
import type { Schema } from '@turbopuffer/turbopuffer';
|
|
@@ -70,12 +69,11 @@ declare class TurbopufferVector extends MastraVector {
|
|
|
70
69
|
/**
|
|
71
70
|
* Retrieves statistics about a vector index.
|
|
72
71
|
*
|
|
73
|
-
* @param
|
|
74
|
-
* @param params.indexName - The name of the index to describe
|
|
72
|
+
* @param {string} indexName - The name of the index to describe
|
|
75
73
|
* @returns A promise that resolves to the index statistics including dimension, count and metric
|
|
76
74
|
*/
|
|
77
|
-
describeIndex(
|
|
78
|
-
deleteIndex(
|
|
75
|
+
describeIndex({ indexName }: DescribeIndexParams): Promise<IndexStats>;
|
|
76
|
+
deleteIndex({ indexName }: DeleteIndexParams): Promise<void>;
|
|
79
77
|
/**
|
|
80
78
|
* Updates a vector by its ID with the provided vector and/or metadata.
|
|
81
79
|
* @param indexName - The name of the index containing the vector.
|
|
@@ -86,7 +84,7 @@ declare class TurbopufferVector extends MastraVector {
|
|
|
86
84
|
* @returns A promise that resolves when the update is complete.
|
|
87
85
|
* @throws Will throw an error if no updates are provided or if the update operation fails.
|
|
88
86
|
*/
|
|
89
|
-
updateVector(
|
|
87
|
+
updateVector({ indexName, id, update }: UpdateVectorParams): Promise<void>;
|
|
90
88
|
/**
|
|
91
89
|
* Deletes a vector by its ID.
|
|
92
90
|
* @param indexName - The name of the index containing the vector.
|
|
@@ -94,7 +92,7 @@ declare class TurbopufferVector extends MastraVector {
|
|
|
94
92
|
* @returns A promise that resolves when the deletion is complete.
|
|
95
93
|
* @throws Will throw an error if the deletion operation fails.
|
|
96
94
|
*/
|
|
97
|
-
deleteVector(
|
|
95
|
+
deleteVector({ indexName, id }: DeleteVectorParams): Promise<void>;
|
|
98
96
|
}
|
|
99
97
|
export { TurbopufferVector }
|
|
100
98
|
export { TurbopufferVector as TurbopufferVector_alias_1 }
|
|
@@ -7,7 +7,6 @@ import type { Filters } from '@turbopuffer/turbopuffer';
|
|
|
7
7
|
import type { IndexStats } from '@mastra/core/vector';
|
|
8
8
|
import { MastraVector } from '@mastra/core/vector';
|
|
9
9
|
import type { OperatorSupport } from '@mastra/core/vector/filter';
|
|
10
|
-
import type { ParamsToArgs } from '@mastra/core/vector';
|
|
11
10
|
import type { QueryResult } from '@mastra/core/vector';
|
|
12
11
|
import type { QueryVectorParams } from '@mastra/core/vector';
|
|
13
12
|
import type { Schema } from '@turbopuffer/turbopuffer';
|
|
@@ -70,12 +69,11 @@ declare class TurbopufferVector extends MastraVector {
|
|
|
70
69
|
/**
|
|
71
70
|
* Retrieves statistics about a vector index.
|
|
72
71
|
*
|
|
73
|
-
* @param
|
|
74
|
-
* @param params.indexName - The name of the index to describe
|
|
72
|
+
* @param {string} indexName - The name of the index to describe
|
|
75
73
|
* @returns A promise that resolves to the index statistics including dimension, count and metric
|
|
76
74
|
*/
|
|
77
|
-
describeIndex(
|
|
78
|
-
deleteIndex(
|
|
75
|
+
describeIndex({ indexName }: DescribeIndexParams): Promise<IndexStats>;
|
|
76
|
+
deleteIndex({ indexName }: DeleteIndexParams): Promise<void>;
|
|
79
77
|
/**
|
|
80
78
|
* Updates a vector by its ID with the provided vector and/or metadata.
|
|
81
79
|
* @param indexName - The name of the index containing the vector.
|
|
@@ -86,7 +84,7 @@ declare class TurbopufferVector extends MastraVector {
|
|
|
86
84
|
* @returns A promise that resolves when the update is complete.
|
|
87
85
|
* @throws Will throw an error if no updates are provided or if the update operation fails.
|
|
88
86
|
*/
|
|
89
|
-
updateVector(
|
|
87
|
+
updateVector({ indexName, id, update }: UpdateVectorParams): Promise<void>;
|
|
90
88
|
/**
|
|
91
89
|
* Deletes a vector by its ID.
|
|
92
90
|
* @param indexName - The name of the index containing the vector.
|
|
@@ -94,7 +92,7 @@ declare class TurbopufferVector extends MastraVector {
|
|
|
94
92
|
* @returns A promise that resolves when the deletion is complete.
|
|
95
93
|
* @throws Will throw an error if the deletion operation fails.
|
|
96
94
|
*/
|
|
97
|
-
deleteVector(
|
|
95
|
+
deleteVector({ indexName, id }: DeleteVectorParams): Promise<void>;
|
|
98
96
|
}
|
|
99
97
|
export { TurbopufferVector }
|
|
100
98
|
export { TurbopufferVector as TurbopufferVector_alias_1 }
|
package/dist/index.cjs
CHANGED
|
@@ -306,13 +306,10 @@ var TurbopufferVector = class extends vector.MastraVector {
|
|
|
306
306
|
/**
|
|
307
307
|
* Retrieves statistics about a vector index.
|
|
308
308
|
*
|
|
309
|
-
* @param
|
|
310
|
-
* @param params.indexName - The name of the index to describe
|
|
309
|
+
* @param {string} indexName - The name of the index to describe
|
|
311
310
|
* @returns A promise that resolves to the index statistics including dimension, count and metric
|
|
312
311
|
*/
|
|
313
|
-
async describeIndex(
|
|
314
|
-
const params = this.normalizeArgs("describeIndex", args);
|
|
315
|
-
const { indexName } = params;
|
|
312
|
+
async describeIndex({ indexName }) {
|
|
316
313
|
try {
|
|
317
314
|
const namespace = this.client.namespace(indexName);
|
|
318
315
|
const metadata = await namespace.metadata();
|
|
@@ -331,9 +328,7 @@ var TurbopufferVector = class extends vector.MastraVector {
|
|
|
331
328
|
throw new Error(`Failed to describe Turbopuffer namespace ${indexName}: ${error}`);
|
|
332
329
|
}
|
|
333
330
|
}
|
|
334
|
-
async deleteIndex(
|
|
335
|
-
const params = this.normalizeArgs("deleteIndex", args);
|
|
336
|
-
const { indexName } = params;
|
|
331
|
+
async deleteIndex({ indexName }) {
|
|
337
332
|
try {
|
|
338
333
|
const namespace = this.client.namespace(indexName);
|
|
339
334
|
await namespace.deleteAll();
|
|
@@ -352,9 +347,7 @@ var TurbopufferVector = class extends vector.MastraVector {
|
|
|
352
347
|
* @returns A promise that resolves when the update is complete.
|
|
353
348
|
* @throws Will throw an error if no updates are provided or if the update operation fails.
|
|
354
349
|
*/
|
|
355
|
-
async updateVector(
|
|
356
|
-
const params = this.normalizeArgs("updateVector", args);
|
|
357
|
-
const { indexName, id, update } = params;
|
|
350
|
+
async updateVector({ indexName, id, update }) {
|
|
358
351
|
try {
|
|
359
352
|
const namespace = this.client.namespace(indexName);
|
|
360
353
|
const createIndex = this.createIndexCache.get(indexName);
|
|
@@ -380,9 +373,7 @@ var TurbopufferVector = class extends vector.MastraVector {
|
|
|
380
373
|
* @returns A promise that resolves when the deletion is complete.
|
|
381
374
|
* @throws Will throw an error if the deletion operation fails.
|
|
382
375
|
*/
|
|
383
|
-
async deleteVector(
|
|
384
|
-
const params = this.normalizeArgs("deleteVector", args);
|
|
385
|
-
const { indexName, id } = params;
|
|
376
|
+
async deleteVector({ indexName, id }) {
|
|
386
377
|
try {
|
|
387
378
|
const namespace = this.client.namespace(indexName);
|
|
388
379
|
await namespace.delete({ ids: [id] });
|
package/dist/index.js
CHANGED
|
@@ -304,13 +304,10 @@ var TurbopufferVector = class extends MastraVector {
|
|
|
304
304
|
/**
|
|
305
305
|
* Retrieves statistics about a vector index.
|
|
306
306
|
*
|
|
307
|
-
* @param
|
|
308
|
-
* @param params.indexName - The name of the index to describe
|
|
307
|
+
* @param {string} indexName - The name of the index to describe
|
|
309
308
|
* @returns A promise that resolves to the index statistics including dimension, count and metric
|
|
310
309
|
*/
|
|
311
|
-
async describeIndex(
|
|
312
|
-
const params = this.normalizeArgs("describeIndex", args);
|
|
313
|
-
const { indexName } = params;
|
|
310
|
+
async describeIndex({ indexName }) {
|
|
314
311
|
try {
|
|
315
312
|
const namespace = this.client.namespace(indexName);
|
|
316
313
|
const metadata = await namespace.metadata();
|
|
@@ -329,9 +326,7 @@ var TurbopufferVector = class extends MastraVector {
|
|
|
329
326
|
throw new Error(`Failed to describe Turbopuffer namespace ${indexName}: ${error}`);
|
|
330
327
|
}
|
|
331
328
|
}
|
|
332
|
-
async deleteIndex(
|
|
333
|
-
const params = this.normalizeArgs("deleteIndex", args);
|
|
334
|
-
const { indexName } = params;
|
|
329
|
+
async deleteIndex({ indexName }) {
|
|
335
330
|
try {
|
|
336
331
|
const namespace = this.client.namespace(indexName);
|
|
337
332
|
await namespace.deleteAll();
|
|
@@ -350,9 +345,7 @@ var TurbopufferVector = class extends MastraVector {
|
|
|
350
345
|
* @returns A promise that resolves when the update is complete.
|
|
351
346
|
* @throws Will throw an error if no updates are provided or if the update operation fails.
|
|
352
347
|
*/
|
|
353
|
-
async updateVector(
|
|
354
|
-
const params = this.normalizeArgs("updateVector", args);
|
|
355
|
-
const { indexName, id, update } = params;
|
|
348
|
+
async updateVector({ indexName, id, update }) {
|
|
356
349
|
try {
|
|
357
350
|
const namespace = this.client.namespace(indexName);
|
|
358
351
|
const createIndex = this.createIndexCache.get(indexName);
|
|
@@ -378,9 +371,7 @@ var TurbopufferVector = class extends MastraVector {
|
|
|
378
371
|
* @returns A promise that resolves when the deletion is complete.
|
|
379
372
|
* @throws Will throw an error if the deletion operation fails.
|
|
380
373
|
*/
|
|
381
|
-
async deleteVector(
|
|
382
|
-
const params = this.normalizeArgs("deleteVector", args);
|
|
383
|
-
const { indexName, id } = params;
|
|
374
|
+
async deleteVector({ indexName, id }) {
|
|
384
375
|
try {
|
|
385
376
|
const namespace = this.client.namespace(indexName);
|
|
386
377
|
await namespace.delete({ ids: [id] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/turbopuffer",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
4
|
"description": "Turbopuffer vector store provider for Mastra",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -23,8 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@turbopuffer/turbopuffer": "^0.6.4"
|
|
27
|
-
"@mastra/core": "^0.9.5-alpha.0"
|
|
26
|
+
"@turbopuffer/turbopuffer": "^0.6.4"
|
|
28
27
|
},
|
|
29
28
|
"devDependencies": {
|
|
30
29
|
"@microsoft/api-extractor": "^7.52.5",
|
|
@@ -34,7 +33,11 @@
|
|
|
34
33
|
"tsup": "^8.4.0",
|
|
35
34
|
"typescript": "^5.8.2",
|
|
36
35
|
"vitest": "^3.1.2",
|
|
37
|
-
"@internal/lint": "0.0.5"
|
|
36
|
+
"@internal/lint": "0.0.5",
|
|
37
|
+
"@mastra/core": "0.10.0-alpha.1"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@mastra/core": "^0.9.4"
|
|
38
41
|
},
|
|
39
42
|
"scripts": {
|
|
40
43
|
"build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
|