@mastra/turbopuffer 0.0.0-share-agent-metadata-with-cloud-20250718123411 → 0.0.0-sidebar-window-undefined-fix-20251029233656

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.
@@ -1,158 +0,0 @@
1
- import { BaseFilterTranslator } from '@mastra/core/vector/filter';
2
- import type { BlacklistedRootOperators } from '@mastra/core/vector/filter';
3
- import type { CreateIndexParams } from '@mastra/core/vector';
4
- import type { DeleteIndexParams } from '@mastra/core/vector';
5
- import type { DeleteVectorParams } from '@mastra/core/vector';
6
- import type { DescribeIndexParams } from '@mastra/core/vector';
7
- import type { Filters } from '@turbopuffer/turbopuffer';
8
- import type { IndexStats } from '@mastra/core/vector';
9
- import type { LogicalOperatorValueMap } from '@mastra/core/vector/filter';
10
- import { MastraVector } from '@mastra/core/vector';
11
- import type { OperatorSupport } from '@mastra/core/vector/filter';
12
- import type { OperatorValueMap } from '@mastra/core/vector/filter';
13
- import type { QueryResult } from '@mastra/core/vector';
14
- import type { QueryVectorParams } from '@mastra/core/vector';
15
- import type { Schema } from '@turbopuffer/turbopuffer';
16
- import type { UpdateVectorParams } from '@mastra/core/vector';
17
- import type { UpsertVectorParams } from '@mastra/core/vector';
18
- import type { VectorFilter } from '@mastra/core/vector/filter';
19
-
20
- declare type TurbopufferBlacklistedRootOperators = BlacklistedRootOperators | '$nor' | '$not';
21
-
22
- /**
23
- * Translator for converting Mastra filters to Turbopuffer format
24
- *
25
- * Mastra filters: { field: { $gt: 10 } }
26
- * Turbopuffer filters: ["And", [["field", "Gt", 10]]]
27
- */
28
- export declare class TurbopufferFilterTranslator extends BaseFilterTranslator<TurbopufferVectorFilter, Filters | undefined> {
29
- protected getSupportedOperators(): OperatorSupport;
30
- /**
31
- * Map Mastra operators to Turbopuffer operators
32
- */
33
- private operatorMap;
34
- /**
35
- * Convert the Mastra filter to Turbopuffer format
36
- */
37
- translate(filter?: TurbopufferVectorFilter): Filters | undefined;
38
- /**
39
- * Recursively translate a filter node
40
- */
41
- private translateNode;
42
- /**
43
- * Translate a field condition
44
- */
45
- private translateFieldCondition;
46
- /**
47
- * Translate a logical operator
48
- */
49
- private translateLogical;
50
- /**
51
- * Translate a specific operator
52
- */
53
- private translateOperator;
54
- /**
55
- * Normalize a value for comparison operations
56
- */
57
- protected normalizeValue(value: any): any;
58
- /**
59
- * Normalize array values
60
- */
61
- protected normalizeArrayValues(values: any[]): any[];
62
- }
63
-
64
- declare type TurbopufferLogicalOperatorValueMap = Omit<LogicalOperatorValueMap, '$nor' | '$not'>;
65
-
66
- declare type TurbopufferOperatorValueMap = Omit<OperatorValueMap, '$regex' | '$options' | '$elemMatch'>;
67
-
68
- declare type TurbopufferQueryVectorParams = QueryVectorParams<TurbopufferVectorFilter>;
69
-
70
- declare class TurbopufferVector extends MastraVector<TurbopufferVectorFilter> {
71
- private client;
72
- private filterTranslator;
73
- private createIndexCache;
74
- private opts;
75
- constructor(opts: TurbopufferVectorOptions);
76
- createIndex({ indexName, dimension, metric }: CreateIndexParams): Promise<void>;
77
- upsert({ indexName, vectors, metadata, ids }: UpsertVectorParams): Promise<string[]>;
78
- query({ indexName, queryVector, topK, filter, includeVector, }: TurbopufferQueryVectorParams): Promise<QueryResult[]>;
79
- listIndexes(): Promise<string[]>;
80
- /**
81
- * Retrieves statistics about a vector index.
82
- *
83
- * @param {string} indexName - The name of the index to describe
84
- * @returns A promise that resolves to the index statistics including dimension, count and metric
85
- */
86
- describeIndex({ indexName }: DescribeIndexParams): Promise<IndexStats>;
87
- deleteIndex({ indexName }: DeleteIndexParams): Promise<void>;
88
- /**
89
- * Updates a vector by its ID with the provided vector and/or metadata.
90
- * @param indexName - The name of the index containing the vector.
91
- * @param id - The ID of the vector to update.
92
- * @param update - An object containing the vector and/or metadata to update.
93
- * @param update.vector - An optional array of numbers representing the new vector.
94
- * @param update.metadata - An optional record containing the new metadata.
95
- * @returns A promise that resolves when the update is complete.
96
- * @throws Will throw an error if no updates are provided or if the update operation fails.
97
- */
98
- updateVector({ indexName, id, update }: UpdateVectorParams): Promise<void>;
99
- /**
100
- * Deletes a vector by its ID.
101
- * @param indexName - The name of the index containing the vector.
102
- * @param id - The ID of the vector to delete.
103
- * @returns A promise that resolves when the deletion is complete.
104
- * @throws Will throw an error if the deletion operation fails.
105
- */
106
- deleteVector({ indexName, id }: DeleteVectorParams): Promise<void>;
107
- }
108
- export { TurbopufferVector }
109
- export { TurbopufferVector as TurbopufferVector_alias_1 }
110
-
111
- export declare type TurbopufferVectorFilter = VectorFilter<keyof TurbopufferOperatorValueMap, TurbopufferOperatorValueMap, TurbopufferLogicalOperatorValueMap, TurbopufferBlacklistedRootOperators>;
112
-
113
- declare interface TurbopufferVectorOptions {
114
- /** The API key to authenticate with. */
115
- apiKey: string;
116
- /** The base URL. Default is https://api.turbopuffer.com. */
117
- baseUrl?: string;
118
- /** The timeout to establish a connection, in ms. Default is 10_000. Only applicable in Node and Deno.*/
119
- connectTimeout?: number;
120
- /** The socket idle timeout, in ms. Default is 60_000. Only applicable in Node and Deno.*/
121
- connectionIdleTimeout?: number;
122
- /** The number of connections to open initially when creating a new client. Default is 0. */
123
- warmConnections?: number;
124
- /** Whether to compress requests and accept compressed responses. Default is true. */
125
- compression?: boolean;
126
- /**
127
- * A callback function that takes an index name and returns a config object for that index.
128
- * This allows you to define explicit schemas per index.
129
- *
130
- * Example:
131
- * ```typescript
132
- * schemaConfigForIndex: (indexName: string) => {
133
- * // Mastra's default embedding model and index for memory messages:
134
- * if (indexName === "memory_messages_384") {
135
- * return {
136
- * dimensions: 384,
137
- * schema: {
138
- * thread_id: {
139
- * type: "string",
140
- * filterable: true,
141
- * },
142
- * },
143
- * };
144
- * } else {
145
- * throw new Error(`TODO: add schema for index: ${indexName}`);
146
- * }
147
- * },
148
- * ```
149
- */
150
- schemaConfigForIndex?: (indexName: string) => {
151
- dimensions: number;
152
- schema: Schema;
153
- };
154
- }
155
- export { TurbopufferVectorOptions }
156
- export { TurbopufferVectorOptions as TurbopufferVectorOptions_alias_1 }
157
-
158
- export { }
package/dist/index.d.cts DELETED
@@ -1,2 +0,0 @@
1
- export { TurbopufferVectorOptions } from './_tsup-dts-rollup.cjs';
2
- export { TurbopufferVector } from './_tsup-dts-rollup.cjs';