@soulcraft/brainy 3.28.0 → 3.29.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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [3.29.1](https://github.com/soulcraftlabs/brainy/compare/v3.29.0...v3.29.1) (2025-10-09)
6
+
7
+
8
+ ### 🐛 Bug Fixes
9
+
10
+ * pass entire storage config to createStorage (gcsNativeStorage now detected) ([7a58dd7](https://github.com/soulcraftlabs/brainy/commit/7a58dd774d956cb3b548064724f9f86c0754f82e))
11
+
12
+ ## [3.29.0](https://github.com/soulcraftlabs/brainy/compare/v3.28.0...v3.29.0) (2025-10-09)
13
+
14
+
15
+ ### 🐛 Bug Fixes
16
+
17
+ * enable GCS native storage with Application Default Credentials ([1e77ecd](https://github.com/soulcraftlabs/brainy/commit/1e77ecd145d3dea46e04ca5ecc6692b41e569c1e))
18
+
5
19
  ### [3.28.0](https://github.com/soulcraftlabs/brainy/compare/v3.27.1...v3.28.0) (2025-10-08)
6
20
 
7
21
  - feat: add unified import system with auto-detection and dual storage (a06e877)
package/dist/brainy.js CHANGED
@@ -2227,10 +2227,9 @@ export class Brainy {
2227
2227
  * Setup storage
2228
2228
  */
2229
2229
  async setupStorage() {
2230
- const storage = await createStorage({
2231
- type: this.config.storage?.type || 'auto',
2232
- ...this.config.storage?.options
2233
- });
2230
+ // Pass the entire storage config object to createStorage
2231
+ // This ensures all storage-specific configs (gcsNativeStorage, s3Storage, etc.) are passed through
2232
+ const storage = await createStorage(this.config.storage);
2234
2233
  return storage;
2235
2234
  }
2236
2235
  /**
@@ -2274,8 +2273,24 @@ export class Brainy {
2274
2273
  */
2275
2274
  normalizeConfig(config) {
2276
2275
  // Validate storage configuration
2277
- if (config?.storage?.type && !['auto', 'memory', 'filesystem', 'opfs', 'remote', 's3', 'r2', 'gcs'].includes(config.storage.type)) {
2278
- throw new Error(`Invalid storage type: ${config.storage.type}. Must be one of: auto, memory, filesystem, opfs, remote, s3, r2, gcs`);
2276
+ if (config?.storage?.type && !['auto', 'memory', 'filesystem', 'opfs', 'remote', 's3', 'r2', 'gcs', 'gcs-native'].includes(config.storage.type)) {
2277
+ throw new Error(`Invalid storage type: ${config.storage.type}. Must be one of: auto, memory, filesystem, opfs, remote, s3, r2, gcs, gcs-native`);
2278
+ }
2279
+ // Validate storage type/config pairing (catch common mismatches)
2280
+ if (config?.storage) {
2281
+ const storage = config.storage;
2282
+ // Check for gcs/gcsNativeStorage mismatch
2283
+ if (storage.type === 'gcs' && storage.gcsNativeStorage) {
2284
+ throw new Error(`Storage type/config mismatch: type 'gcs' requires 'gcsStorage' config object (S3-compatible). ` +
2285
+ `You provided 'gcsNativeStorage' which requires type 'gcs-native'. ` +
2286
+ `Either change type to 'gcs-native' or use 'gcsStorage' instead of 'gcsNativeStorage'.`);
2287
+ }
2288
+ // Check for gcs-native/gcsStorage mismatch
2289
+ if (storage.type === 'gcs-native' && storage.gcsStorage) {
2290
+ throw new Error(`Storage type/config mismatch: type 'gcs-native' requires 'gcsNativeStorage' config object. ` +
2291
+ `You provided 'gcsStorage' which requires type 'gcs' (S3-compatible). ` +
2292
+ `Either change type to 'gcs' or use 'gcsNativeStorage' instead of 'gcsStorage'.`);
2293
+ }
2279
2294
  }
2280
2295
  // Validate model configuration
2281
2296
  if (config?.model?.type && !['fast', 'accurate', 'custom'].includes(config.model.type)) {
@@ -11,6 +11,7 @@ export declare enum StorageType {
11
11
  OPFS = "opfs",
12
12
  S3 = "s3",
13
13
  GCS = "gcs",
14
+ GCS_NATIVE = "gcs-native",
14
15
  R2 = "r2"
15
16
  }
16
17
  /**
@@ -22,7 +23,7 @@ export declare enum StoragePreset {
22
23
  DISK = "disk",
23
24
  CLOUD = "cloud"
24
25
  }
25
- export type StorageTypeString = 'memory' | 'filesystem' | 'opfs' | 's3' | 'gcs' | 'r2';
26
+ export type StorageTypeString = 'memory' | 'filesystem' | 'opfs' | 's3' | 'gcs' | 'r2' | 'gcs-native';
26
27
  export type StoragePresetString = 'auto' | 'memory' | 'disk' | 'cloud';
27
28
  export interface StorageConfigResult {
28
29
  type: StorageType | StorageTypeString;
@@ -13,6 +13,7 @@ export var StorageType;
13
13
  StorageType["OPFS"] = "opfs";
14
14
  StorageType["S3"] = "s3";
15
15
  StorageType["GCS"] = "gcs";
16
+ StorageType["GCS_NATIVE"] = "gcs-native";
16
17
  StorageType["R2"] = "r2";
17
18
  })(StorageType || (StorageType = {}));
18
19
  /**
@@ -170,14 +171,14 @@ async function detectCloudStorage() {
170
171
  }
171
172
  };
172
173
  }
173
- // Google Cloud Storage Detection
174
+ // Google Cloud Storage Detection (Native SDK with ADC)
174
175
  if (hasGCPConfig()) {
175
176
  return {
176
- type: StorageType.GCS,
177
+ type: StorageType.GCS_NATIVE,
177
178
  config: {
178
- gcsStorage: {
179
+ gcsNativeStorage: {
179
180
  bucketName: process.env.GCS_BUCKET || process.env.GOOGLE_STORAGE_BUCKET || 'brainy-data',
180
- // Credentials will be picked up by GCP SDK automatically
181
+ // Application Default Credentials will be picked up automatically
181
182
  }
182
183
  }
183
184
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soulcraft/brainy",
3
- "version": "3.28.0",
3
+ "version": "3.29.1",
4
4
  "description": "Universal Knowledge Protocol™ - World's first Triple Intelligence database unifying vector, graph, and document search in one API. 31 nouns × 40 verbs for infinite expressiveness.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",