@mastra/couchbase 0.0.0-redis-cloud-transporter-20250508203756 → 0.0.0-trigger-playground-ui-package-20250506151043

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/CHANGELOG.md CHANGED
@@ -1,30 +1,6 @@
1
1
  # @mastra/couchbase
2
2
 
3
- ## 0.0.0-redis-cloud-transporter-20250508203756
4
-
5
- ### Patch Changes
6
-
7
- - 9cd1a46: [MASTRA-3338] update naming scheme for embedding index based on vector store rules and added duplicate index checks
8
- - Updated dependencies [e450778]
9
- - Updated dependencies [8902157]
10
- - Updated dependencies [ca0dc88]
11
- - Updated dependencies [526c570]
12
- - Updated dependencies [9cd1a46]
13
- - Updated dependencies [b5d2de0]
14
- - Updated dependencies [644f8ad]
15
- - Updated dependencies [70dbf51]
16
- - @mastra/core@0.0.0-redis-cloud-transporter-20250508203756
17
-
18
- ## 0.0.3-alpha.0
19
-
20
- ### Patch Changes
21
-
22
- - Updated dependencies [526c570]
23
- - Updated dependencies [b5d2de0]
24
- - Updated dependencies [644f8ad]
25
- - @mastra/core@0.9.3-alpha.0
26
-
27
- ## 0.0.2
3
+ ## 0.0.0-trigger-playground-ui-package-20250506151043
28
4
 
29
5
  ### Patch Changes
30
6
 
@@ -43,20 +19,8 @@
43
19
  - Updated dependencies [17826a9]
44
20
  - Updated dependencies [7d8b7c7]
45
21
  - Updated dependencies [fba031f]
46
- - Updated dependencies [3a5f1e1]
47
22
  - Updated dependencies [51e6923]
48
- - Updated dependencies [8398d89]
49
- - @mastra/core@0.9.2
50
-
51
- ## 0.0.2-alpha.1
52
-
53
- ### Patch Changes
54
-
55
- - Updated dependencies [6052aa6]
56
- - Updated dependencies [7d8b7c7]
57
- - Updated dependencies [3a5f1e1]
58
- - Updated dependencies [8398d89]
59
- - @mastra/core@0.9.2-alpha.6
23
+ - @mastra/core@0.0.0-trigger-playground-ui-package-20250506151043
60
24
 
61
25
  ## 0.0.2-alpha.0
62
26
 
package/dist/index.cjs CHANGED
@@ -59,95 +59,86 @@ var CouchbaseVector = class extends vector.MastraVector {
59
59
  if (!Number.isInteger(dimension) || dimension <= 0) {
60
60
  throw new Error("Dimension must be a positive integer");
61
61
  }
62
- try {
63
- await this.scope.searchIndexes().upsertIndex({
64
- name: indexName,
65
- sourceName: this.bucketName,
66
- type: "fulltext-index",
67
- params: {
68
- doc_config: {
69
- docid_prefix_delim: "",
70
- docid_regexp: "",
71
- mode: "scope.collection.type_field",
72
- type_field: "type"
62
+ await this.scope.searchIndexes().upsertIndex({
63
+ name: indexName,
64
+ sourceName: this.bucketName,
65
+ type: "fulltext-index",
66
+ params: {
67
+ doc_config: {
68
+ docid_prefix_delim: "",
69
+ docid_regexp: "",
70
+ mode: "scope.collection.type_field",
71
+ type_field: "type"
72
+ },
73
+ mapping: {
74
+ default_analyzer: "standard",
75
+ default_datetime_parser: "dateTimeOptional",
76
+ default_field: "_all",
77
+ default_mapping: {
78
+ dynamic: true,
79
+ enabled: false
73
80
  },
74
- mapping: {
75
- default_analyzer: "standard",
76
- default_datetime_parser: "dateTimeOptional",
77
- default_field: "_all",
78
- default_mapping: {
81
+ default_type: "_default",
82
+ docvalues_dynamic: true,
83
+ // [Doc](https://docs.couchbase.com/server/current/search/search-index-params.html#params) mentions this attribute is required for vector search to return the indexed field
84
+ index_dynamic: true,
85
+ store_dynamic: true,
86
+ // [Doc](https://docs.couchbase.com/server/current/search/search-index-params.html#params) mentions this attribute is required for vector search to return the indexed field
87
+ type_field: "_type",
88
+ types: {
89
+ [`${this.scopeName}.${this.collectionName}`]: {
79
90
  dynamic: true,
80
- enabled: false
81
- },
82
- default_type: "_default",
83
- docvalues_dynamic: true,
84
- // [Doc](https://docs.couchbase.com/server/current/search/search-index-params.html#params) mentions this attribute is required for vector search to return the indexed field
85
- index_dynamic: true,
86
- store_dynamic: true,
87
- // [Doc](https://docs.couchbase.com/server/current/search/search-index-params.html#params) mentions this attribute is required for vector search to return the indexed field
88
- type_field: "_type",
89
- types: {
90
- [`${this.scopeName}.${this.collectionName}`]: {
91
- dynamic: true,
92
- enabled: true,
93
- properties: {
94
- embedding: {
95
- enabled: true,
96
- fields: [
97
- {
98
- dims: dimension,
99
- index: true,
100
- name: "embedding",
101
- similarity: DISTANCE_MAPPING[metric],
102
- type: "vector",
103
- vector_index_optimized_for: "recall",
104
- store: true,
105
- // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
106
- docvalues: true,
107
- // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
108
- include_term_vectors: true
109
- // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
110
- }
111
- ]
112
- },
113
- content: {
114
- enabled: true,
115
- fields: [
116
- {
117
- index: true,
118
- name: "content",
119
- store: true,
120
- type: "text"
121
- }
122
- ]
123
- }
91
+ enabled: true,
92
+ properties: {
93
+ embedding: {
94
+ enabled: true,
95
+ fields: [
96
+ {
97
+ dims: dimension,
98
+ index: true,
99
+ name: "embedding",
100
+ similarity: DISTANCE_MAPPING[metric],
101
+ type: "vector",
102
+ vector_index_optimized_for: "recall",
103
+ store: true,
104
+ // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
105
+ docvalues: true,
106
+ // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
107
+ include_term_vectors: true
108
+ // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
109
+ }
110
+ ]
111
+ },
112
+ content: {
113
+ enabled: true,
114
+ fields: [
115
+ {
116
+ index: true,
117
+ name: "content",
118
+ store: true,
119
+ type: "text"
120
+ }
121
+ ]
124
122
  }
125
123
  }
126
124
  }
127
- },
128
- store: {
129
- indexType: "scorch",
130
- segmentVersion: 16
131
125
  }
132
126
  },
133
- sourceUuid: "",
134
- sourceParams: {},
135
- sourceType: "gocbcore",
136
- planParams: {
137
- maxPartitionsPerPIndex: 64,
138
- indexPartitions: 16,
139
- numReplicas: 0
127
+ store: {
128
+ indexType: "scorch",
129
+ segmentVersion: 16
140
130
  }
141
- });
142
- this.vector_dimension = dimension;
143
- } catch (error) {
144
- const message = error?.message || error?.toString();
145
- if (message && message.toLowerCase().includes("index exists")) {
146
- await this.validateExistingIndex(indexName, dimension, metric);
147
- return;
131
+ },
132
+ sourceUuid: "",
133
+ sourceParams: {},
134
+ sourceType: "gocbcore",
135
+ planParams: {
136
+ maxPartitionsPerPIndex: 64,
137
+ indexPartitions: 16,
138
+ numReplicas: 0
148
139
  }
149
- throw error;
150
- }
140
+ });
141
+ this.vector_dimension = dimension;
151
142
  }
152
143
  async upsert(params) {
153
144
  const { vectors, metadata, ids } = params;
package/dist/index.js CHANGED
@@ -57,95 +57,86 @@ var CouchbaseVector = class extends MastraVector {
57
57
  if (!Number.isInteger(dimension) || dimension <= 0) {
58
58
  throw new Error("Dimension must be a positive integer");
59
59
  }
60
- try {
61
- await this.scope.searchIndexes().upsertIndex({
62
- name: indexName,
63
- sourceName: this.bucketName,
64
- type: "fulltext-index",
65
- params: {
66
- doc_config: {
67
- docid_prefix_delim: "",
68
- docid_regexp: "",
69
- mode: "scope.collection.type_field",
70
- type_field: "type"
60
+ await this.scope.searchIndexes().upsertIndex({
61
+ name: indexName,
62
+ sourceName: this.bucketName,
63
+ type: "fulltext-index",
64
+ params: {
65
+ doc_config: {
66
+ docid_prefix_delim: "",
67
+ docid_regexp: "",
68
+ mode: "scope.collection.type_field",
69
+ type_field: "type"
70
+ },
71
+ mapping: {
72
+ default_analyzer: "standard",
73
+ default_datetime_parser: "dateTimeOptional",
74
+ default_field: "_all",
75
+ default_mapping: {
76
+ dynamic: true,
77
+ enabled: false
71
78
  },
72
- mapping: {
73
- default_analyzer: "standard",
74
- default_datetime_parser: "dateTimeOptional",
75
- default_field: "_all",
76
- default_mapping: {
79
+ default_type: "_default",
80
+ docvalues_dynamic: true,
81
+ // [Doc](https://docs.couchbase.com/server/current/search/search-index-params.html#params) mentions this attribute is required for vector search to return the indexed field
82
+ index_dynamic: true,
83
+ store_dynamic: true,
84
+ // [Doc](https://docs.couchbase.com/server/current/search/search-index-params.html#params) mentions this attribute is required for vector search to return the indexed field
85
+ type_field: "_type",
86
+ types: {
87
+ [`${this.scopeName}.${this.collectionName}`]: {
77
88
  dynamic: true,
78
- enabled: false
79
- },
80
- default_type: "_default",
81
- docvalues_dynamic: true,
82
- // [Doc](https://docs.couchbase.com/server/current/search/search-index-params.html#params) mentions this attribute is required for vector search to return the indexed field
83
- index_dynamic: true,
84
- store_dynamic: true,
85
- // [Doc](https://docs.couchbase.com/server/current/search/search-index-params.html#params) mentions this attribute is required for vector search to return the indexed field
86
- type_field: "_type",
87
- types: {
88
- [`${this.scopeName}.${this.collectionName}`]: {
89
- dynamic: true,
90
- enabled: true,
91
- properties: {
92
- embedding: {
93
- enabled: true,
94
- fields: [
95
- {
96
- dims: dimension,
97
- index: true,
98
- name: "embedding",
99
- similarity: DISTANCE_MAPPING[metric],
100
- type: "vector",
101
- vector_index_optimized_for: "recall",
102
- store: true,
103
- // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
104
- docvalues: true,
105
- // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
106
- include_term_vectors: true
107
- // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
108
- }
109
- ]
110
- },
111
- content: {
112
- enabled: true,
113
- fields: [
114
- {
115
- index: true,
116
- name: "content",
117
- store: true,
118
- type: "text"
119
- }
120
- ]
121
- }
89
+ enabled: true,
90
+ properties: {
91
+ embedding: {
92
+ enabled: true,
93
+ fields: [
94
+ {
95
+ dims: dimension,
96
+ index: true,
97
+ name: "embedding",
98
+ similarity: DISTANCE_MAPPING[metric],
99
+ type: "vector",
100
+ vector_index_optimized_for: "recall",
101
+ store: true,
102
+ // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
103
+ docvalues: true,
104
+ // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
105
+ include_term_vectors: true
106
+ // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
107
+ }
108
+ ]
109
+ },
110
+ content: {
111
+ enabled: true,
112
+ fields: [
113
+ {
114
+ index: true,
115
+ name: "content",
116
+ store: true,
117
+ type: "text"
118
+ }
119
+ ]
122
120
  }
123
121
  }
124
122
  }
125
- },
126
- store: {
127
- indexType: "scorch",
128
- segmentVersion: 16
129
123
  }
130
124
  },
131
- sourceUuid: "",
132
- sourceParams: {},
133
- sourceType: "gocbcore",
134
- planParams: {
135
- maxPartitionsPerPIndex: 64,
136
- indexPartitions: 16,
137
- numReplicas: 0
125
+ store: {
126
+ indexType: "scorch",
127
+ segmentVersion: 16
138
128
  }
139
- });
140
- this.vector_dimension = dimension;
141
- } catch (error) {
142
- const message = error?.message || error?.toString();
143
- if (message && message.toLowerCase().includes("index exists")) {
144
- await this.validateExistingIndex(indexName, dimension, metric);
145
- return;
129
+ },
130
+ sourceUuid: "",
131
+ sourceParams: {},
132
+ sourceType: "gocbcore",
133
+ planParams: {
134
+ maxPartitionsPerPIndex: 64,
135
+ indexPartitions: 16,
136
+ numReplicas: 0
146
137
  }
147
- throw error;
148
- }
138
+ });
139
+ this.vector_dimension = dimension;
149
140
  }
150
141
  async upsert(params) {
151
142
  const { vectors, metadata, ids } = params;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/couchbase",
3
- "version": "0.0.0-redis-cloud-transporter-20250508203756",
3
+ "version": "0.0.0-trigger-playground-ui-package-20250506151043",
4
4
  "description": "Couchbase vector store provider for Mastra",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "couchbase": "^4.4.5",
23
- "@mastra/core": "0.0.0-redis-cloud-transporter-20250508203756"
23
+ "@mastra/core": "0.0.0-trigger-playground-ui-package-20250506151043"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@microsoft/api-extractor": "^7.52.1",
@@ -32,7 +32,7 @@
32
32
  "tsup": "^8.4.0",
33
33
  "typescript": "^5.8.2",
34
34
  "vitest": "^3.0.9",
35
- "@internal/lint": "0.0.0-redis-cloud-transporter-20250508203756"
35
+ "@internal/lint": "0.0.0-trigger-playground-ui-package-20250506151043"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
@@ -3,11 +3,10 @@
3
3
  // The tests will automatically start and configure the required Couchbase container.
4
4
 
5
5
  import { execSync } from 'child_process';
6
- import { randomUUID } from 'crypto';
7
6
  import axios from 'axios';
8
7
  import type { Cluster, Bucket, Scope, Collection } from 'couchbase';
9
8
  import { connect } from 'couchbase';
10
- import { describe, it, expect, beforeAll, afterAll, vi } from 'vitest';
9
+ import { describe, it, expect, beforeAll, afterAll } from 'vitest';
11
10
  import { CouchbaseVector, DISTANCE_MAPPING } from './index';
12
11
 
13
12
  const containerName = 'mastra_couchbase_testing';
@@ -432,66 +431,6 @@ describe('Integration Testing CouchbaseVector', async () => {
432
431
  }),
433
432
  ).rejects.toThrow('No vectors provided');
434
433
  }, 50000);
435
-
436
- it('should handle non-existent index queries', async () => {
437
- await expect(
438
- couchbase_client.query({ indexName: 'non-existent-index', queryVector: [1, 2, 3] }),
439
- ).rejects.toThrow();
440
- }, 50000);
441
-
442
- it('should handle duplicate index creation gracefully', async () => {
443
- const duplicateIndexName = `duplicate-test-${randomUUID()}`;
444
- const dimension = 768;
445
- const infoSpy = vi.spyOn(couchbase_client['logger'], 'info');
446
- const warnSpy = vi.spyOn(couchbase_client['logger'], 'warn');
447
-
448
- try {
449
- // Create index first time
450
- await couchbase_client.createIndex({
451
- indexName: duplicateIndexName,
452
- dimension,
453
- metric: 'cosine',
454
- });
455
-
456
- // Try to create with same dimensions - should not throw
457
- await expect(
458
- couchbase_client.createIndex({
459
- indexName: duplicateIndexName,
460
- dimension,
461
- metric: 'cosine',
462
- }),
463
- ).resolves.not.toThrow();
464
-
465
- expect(infoSpy).toHaveBeenCalledWith(expect.stringContaining('already exists with'));
466
-
467
- // Try to create with same dimensions and different metric - should not throw
468
- await expect(
469
- couchbase_client.createIndex({
470
- indexName: duplicateIndexName,
471
- dimension,
472
- metric: 'euclidean',
473
- }),
474
- ).resolves.not.toThrow();
475
-
476
- expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('Attempted to create index with metric'));
477
-
478
- // Try to create with different dimensions - should throw
479
- await expect(
480
- couchbase_client.createIndex({
481
- indexName: duplicateIndexName,
482
- dimension: dimension + 1,
483
- metric: 'cosine',
484
- }),
485
- ).rejects.toThrow(
486
- `Index "${duplicateIndexName}" already exists with ${dimension} dimensions, but ${dimension + 1} dimensions were requested`,
487
- );
488
- } finally {
489
- infoSpy.mockRestore();
490
- warnSpy.mockRestore();
491
- // Cleanup
492
- await couchbase_client.deleteIndex(duplicateIndexName);
493
- }
494
- }, 50000);
495
434
  });
496
435
 
497
436
  describe('Vector Dimension Tracking', () => {
@@ -84,92 +84,81 @@ export class CouchbaseVector extends MastraVector {
84
84
  throw new Error('Dimension must be a positive integer');
85
85
  }
86
86
 
87
- try {
88
- await this.scope.searchIndexes().upsertIndex({
89
- name: indexName,
90
- sourceName: this.bucketName,
91
- type: 'fulltext-index',
92
- params: {
93
- doc_config: {
94
- docid_prefix_delim: '',
95
- docid_regexp: '',
96
- mode: 'scope.collection.type_field',
97
- type_field: 'type',
87
+ await this.scope.searchIndexes().upsertIndex({
88
+ name: indexName,
89
+ sourceName: this.bucketName,
90
+ type: 'fulltext-index',
91
+ params: {
92
+ doc_config: {
93
+ docid_prefix_delim: '',
94
+ docid_regexp: '',
95
+ mode: 'scope.collection.type_field',
96
+ type_field: 'type',
97
+ },
98
+ mapping: {
99
+ default_analyzer: 'standard',
100
+ default_datetime_parser: 'dateTimeOptional',
101
+ default_field: '_all',
102
+ default_mapping: {
103
+ dynamic: true,
104
+ enabled: false,
98
105
  },
99
- mapping: {
100
- default_analyzer: 'standard',
101
- default_datetime_parser: 'dateTimeOptional',
102
- default_field: '_all',
103
- default_mapping: {
106
+ default_type: '_default',
107
+ docvalues_dynamic: true, // [Doc](https://docs.couchbase.com/server/current/search/search-index-params.html#params) mentions this attribute is required for vector search to return the indexed field
108
+ index_dynamic: true,
109
+ store_dynamic: true, // [Doc](https://docs.couchbase.com/server/current/search/search-index-params.html#params) mentions this attribute is required for vector search to return the indexed field
110
+ type_field: '_type',
111
+ types: {
112
+ [`${this.scopeName}.${this.collectionName}`]: {
104
113
  dynamic: true,
105
- enabled: false,
106
- },
107
- default_type: '_default',
108
- docvalues_dynamic: true, // [Doc](https://docs.couchbase.com/server/current/search/search-index-params.html#params) mentions this attribute is required for vector search to return the indexed field
109
- index_dynamic: true,
110
- store_dynamic: true, // [Doc](https://docs.couchbase.com/server/current/search/search-index-params.html#params) mentions this attribute is required for vector search to return the indexed field
111
- type_field: '_type',
112
- types: {
113
- [`${this.scopeName}.${this.collectionName}`]: {
114
- dynamic: true,
115
- enabled: true,
116
- properties: {
117
- embedding: {
118
- enabled: true,
119
- fields: [
120
- {
121
- dims: dimension,
122
- index: true,
123
- name: 'embedding',
124
- similarity: DISTANCE_MAPPING[metric],
125
- type: 'vector',
126
- vector_index_optimized_for: 'recall',
127
- store: true, // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
128
- docvalues: true, // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
129
- include_term_vectors: true, // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
130
- },
131
- ],
132
- },
133
- content: {
134
- enabled: true,
135
- fields: [
136
- {
137
- index: true,
138
- name: 'content',
139
- store: true,
140
- type: 'text',
141
- },
142
- ],
143
- },
114
+ enabled: true,
115
+ properties: {
116
+ embedding: {
117
+ enabled: true,
118
+ fields: [
119
+ {
120
+ dims: dimension,
121
+ index: true,
122
+ name: 'embedding',
123
+ similarity: DISTANCE_MAPPING[metric],
124
+ type: 'vector',
125
+ vector_index_optimized_for: 'recall',
126
+ store: true, // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
127
+ docvalues: true, // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
128
+ include_term_vectors: true, // CHANGED due to https://docs.couchbase.com/server/current/search/search-index-params.html#fields
129
+ },
130
+ ],
131
+ },
132
+ content: {
133
+ enabled: true,
134
+ fields: [
135
+ {
136
+ index: true,
137
+ name: 'content',
138
+ store: true,
139
+ type: 'text',
140
+ },
141
+ ],
144
142
  },
145
143
  },
146
144
  },
147
145
  },
148
- store: {
149
- indexType: 'scorch',
150
- segmentVersion: 16,
151
- },
152
146
  },
153
- sourceUuid: '',
154
- sourceParams: {},
155
- sourceType: 'gocbcore',
156
- planParams: {
157
- maxPartitionsPerPIndex: 64,
158
- indexPartitions: 16,
159
- numReplicas: 0,
147
+ store: {
148
+ indexType: 'scorch',
149
+ segmentVersion: 16,
160
150
  },
161
- });
162
- this.vector_dimension = dimension;
163
- } catch (error: any) {
164
- // Check for 'already exists' error (Couchbase may throw a 400 or 409, or have a message)
165
- const message = error?.message || error?.toString();
166
- if (message && message.toLowerCase().includes('index exists')) {
167
- // Fetch index info and check dimension
168
- await this.validateExistingIndex(indexName, dimension, metric);
169
- return;
170
- }
171
- throw error;
172
- }
151
+ },
152
+ sourceUuid: '',
153
+ sourceParams: {},
154
+ sourceType: 'gocbcore',
155
+ planParams: {
156
+ maxPartitionsPerPIndex: 64,
157
+ indexPartitions: 16,
158
+ numReplicas: 0,
159
+ },
160
+ });
161
+ this.vector_dimension = dimension;
173
162
  }
174
163
 
175
164
  async upsert(params: UpsertVectorParams): Promise<string[]> {