@mastra/astra 0.2.14-alpha.0 → 0.2.14
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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +26 -0
- package/package.json +3 -3
- package/src/vector/index.test.ts +57 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/astra@0.2.14-alpha.
|
|
2
|
+
> @mastra/astra@0.2.14-alpha.1 build /home/runner/work/mastra/mastra/stores/astra
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.4.0
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 6532ms
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
11
|
[34mCLI[39m Target: es2022
|
|
12
12
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
13
13
|
[36mWriting package typings: /home/runner/work/mastra/mastra/stores/astra/dist/_tsup-dts-rollup.d.ts[39m
|
|
14
14
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
15
15
|
[36mWriting package typings: /home/runner/work/mastra/mastra/stores/astra/dist/_tsup-dts-rollup.d.cts[39m
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 9627ms
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
20
|
[32mCJS[39m [1mdist/index.cjs [22m[32m10.60 KB[39m
|
|
21
|
-
[32mCJS[39m ⚡️ Build success in
|
|
21
|
+
[32mCJS[39m ⚡️ Build success in 620ms
|
|
22
22
|
[32mESM[39m [1mdist/index.js [22m[32m10.54 KB[39m
|
|
23
|
-
[32mESM[39m ⚡️ Build success in
|
|
23
|
+
[32mESM[39m ⚡️ Build success in 620ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @mastra/astra
|
|
2
2
|
|
|
3
|
+
## 0.2.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [e450778]
|
|
8
|
+
- Updated dependencies [8902157]
|
|
9
|
+
- Updated dependencies [ca0dc88]
|
|
10
|
+
- Updated dependencies [526c570]
|
|
11
|
+
- Updated dependencies [d7a6a33]
|
|
12
|
+
- Updated dependencies [9cd1a46]
|
|
13
|
+
- Updated dependencies [b5d2de0]
|
|
14
|
+
- Updated dependencies [644f8ad]
|
|
15
|
+
- Updated dependencies [70dbf51]
|
|
16
|
+
- @mastra/core@0.9.3
|
|
17
|
+
|
|
18
|
+
## 0.2.14-alpha.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [e450778]
|
|
23
|
+
- Updated dependencies [8902157]
|
|
24
|
+
- Updated dependencies [ca0dc88]
|
|
25
|
+
- Updated dependencies [9cd1a46]
|
|
26
|
+
- Updated dependencies [70dbf51]
|
|
27
|
+
- @mastra/core@0.9.3-alpha.1
|
|
28
|
+
|
|
3
29
|
## 0.2.14-alpha.0
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/astra",
|
|
3
|
-
"version": "0.2.14
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"description": "Astra DB provider for Mastra - includes vector store capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@datastax/astra-db-ts": "^1.5.0",
|
|
24
|
-
"@mastra/core": "^0.9.3
|
|
24
|
+
"@mastra/core": "^0.9.3"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@microsoft/api-extractor": "^7.52.5",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tsup": "^8.4.0",
|
|
31
31
|
"typescript": "^5.8.2",
|
|
32
32
|
"vitest": "^3.1.2",
|
|
33
|
-
"@internal/lint": "0.0.
|
|
33
|
+
"@internal/lint": "0.0.4"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
|
package/src/vector/index.test.ts
CHANGED
|
@@ -1323,4 +1323,61 @@ describe.skip('AstraVector Integration Tests', () => {
|
|
|
1323
1323
|
expect(results.map(res => res.id)).not.toContain(idToBeDeleted);
|
|
1324
1324
|
});
|
|
1325
1325
|
});
|
|
1326
|
+
|
|
1327
|
+
describe('Error Handling', () => {
|
|
1328
|
+
const testIndexName = 'test_index_error';
|
|
1329
|
+
beforeAll(async () => {
|
|
1330
|
+
await vectorDB.createIndex({ indexName: testIndexName, dimension: 3 });
|
|
1331
|
+
});
|
|
1332
|
+
|
|
1333
|
+
afterAll(async () => {
|
|
1334
|
+
await vectorDB.deleteIndex(testIndexName);
|
|
1335
|
+
});
|
|
1336
|
+
|
|
1337
|
+
it('should handle non-existent index queries', async () => {
|
|
1338
|
+
await expect(vectorDB.query({ indexName: 'non-existent-index', queryVector: [1, 2, 3] })).rejects.toThrow();
|
|
1339
|
+
});
|
|
1340
|
+
|
|
1341
|
+
it('should handle invalid dimension vectors', async () => {
|
|
1342
|
+
const invalidVector = [1, 2, 3, 4]; // 4D vector for 3D index
|
|
1343
|
+
await expect(vectorDB.upsert({ indexName: testIndexName, vectors: [invalidVector] })).rejects.toThrow();
|
|
1344
|
+
});
|
|
1345
|
+
|
|
1346
|
+
it('should handle duplicate index creation gracefully', async () => {
|
|
1347
|
+
const duplicateIndexName = `duplicate_test`;
|
|
1348
|
+
const dimension = 768;
|
|
1349
|
+
|
|
1350
|
+
try {
|
|
1351
|
+
// Create index first time
|
|
1352
|
+
await vectorDB.createIndex({
|
|
1353
|
+
indexName: duplicateIndexName,
|
|
1354
|
+
dimension,
|
|
1355
|
+
metric: 'cosine',
|
|
1356
|
+
});
|
|
1357
|
+
|
|
1358
|
+
// Try to create with same dimensions - should not throw
|
|
1359
|
+
await expect(
|
|
1360
|
+
vectorDB.createIndex({
|
|
1361
|
+
indexName: duplicateIndexName,
|
|
1362
|
+
dimension,
|
|
1363
|
+
metric: 'cosine',
|
|
1364
|
+
}),
|
|
1365
|
+
).resolves.not.toThrow();
|
|
1366
|
+
|
|
1367
|
+
// Try to create with different dimensions - should throw
|
|
1368
|
+
await expect(
|
|
1369
|
+
vectorDB.createIndex({
|
|
1370
|
+
indexName: duplicateIndexName,
|
|
1371
|
+
dimension: dimension + 1,
|
|
1372
|
+
metric: 'cosine',
|
|
1373
|
+
}),
|
|
1374
|
+
).rejects.toThrow(
|
|
1375
|
+
`Collection already exists: trying to create Collection ('${duplicateIndexName}') with different settings`,
|
|
1376
|
+
);
|
|
1377
|
+
} finally {
|
|
1378
|
+
// Cleanup
|
|
1379
|
+
await vectorDB.deleteIndex(duplicateIndexName);
|
|
1380
|
+
}
|
|
1381
|
+
});
|
|
1382
|
+
});
|
|
1326
1383
|
});
|