@soulcraft/brainy 0.15.0 → 0.16.0

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.
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Centralized logging utility for Brainy
3
+ *
4
+ * This utility provides controlled logging that can be enabled/disabled
5
+ * based on debug mode configuration. By default, all logging is disabled
6
+ * unless explicitly enabled via environment variables or configuration.
7
+ */
8
+ /**
9
+ * Logger configuration interface
10
+ */
11
+ export interface LoggerConfig {
12
+ /**
13
+ * Whether debug logging is enabled
14
+ * @default false
15
+ */
16
+ debug?: boolean;
17
+ /**
18
+ * Whether to show log prefixes
19
+ * @default true
20
+ */
21
+ showPrefix?: boolean;
22
+ /**
23
+ * Custom prefix for log messages
24
+ * @default 'Brainy'
25
+ */
26
+ prefix?: string;
27
+ }
28
+ /**
29
+ * Configure the global logger
30
+ */
31
+ export declare function configureLogger(config: LoggerConfig): void;
32
+ /**
33
+ * Get current logger configuration
34
+ */
35
+ export declare function getLoggerConfig(): Required<LoggerConfig>;
36
+ /**
37
+ * Check if debug mode is enabled
38
+ */
39
+ export declare function isDebugEnabled(): boolean;
40
+ /**
41
+ * Controlled logging methods
42
+ */
43
+ export declare const logger: {
44
+ /**
45
+ * Log debug information (only shown when debug mode is enabled)
46
+ */
47
+ debug: (message: string, ...args: any[]) => void;
48
+ /**
49
+ * Log informational messages (only shown when debug mode is enabled)
50
+ */
51
+ info: (message: string, ...args: any[]) => void;
52
+ /**
53
+ * Log warning messages (always shown, but can be controlled)
54
+ */
55
+ warn: (message: string, ...args: any[]) => void;
56
+ /**
57
+ * Log error messages (always shown)
58
+ */
59
+ error: (message: string, ...args: any[]) => void;
60
+ /**
61
+ * Log with custom prefix (only shown when debug mode is enabled)
62
+ */
63
+ debugWithPrefix: (prefix: string, message: string, ...args: any[]) => void;
64
+ /**
65
+ * Log info with custom prefix (only shown when debug mode is enabled)
66
+ */
67
+ infoWithPrefix: (prefix: string, message: string, ...args: any[]) => void;
68
+ /**
69
+ * Log warning with custom prefix (controlled by debug mode)
70
+ */
71
+ warnWithPrefix: (prefix: string, message: string, ...args: any[]) => void;
72
+ /**
73
+ * Log error with custom prefix (always shown)
74
+ */
75
+ errorWithPrefix: (prefix: string, message: string, ...args: any[]) => void;
76
+ };
77
+ /**
78
+ * Legacy console methods for backward compatibility
79
+ * These will respect the debug mode setting
80
+ */
81
+ export declare const debugConsole: {
82
+ log: (message: string, ...args: any[]) => void;
83
+ debug: (message: string, ...args: any[]) => void;
84
+ info: (message: string, ...args: any[]) => void;
85
+ warn: (message: string, ...args: any[]) => void;
86
+ error: (message: string, ...args: any[]) => void;
87
+ };
88
+ /**
89
+ * Enable debug mode programmatically
90
+ */
91
+ export declare function enableDebugMode(): void;
92
+ /**
93
+ * Disable debug mode programmatically
94
+ */
95
+ export declare function disableDebugMode(): void;
96
+ /**
97
+ * Create a scoped logger with a specific prefix
98
+ */
99
+ export declare function createScopedLogger(prefix: string): typeof logger;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAqDD;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAE1D;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,QAAQ,CAAC,YAAY,CAAC,CAExD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAeD;;GAEG;AACH,eAAO,MAAM,MAAM;IACjB;;OAEG;qBACc,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;IAM9C;;OAEG;oBACa,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;IAM7C;;OAEG;oBACa,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;IAM7C;;OAEG;qBACc,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;IAI9C;;OAEG;8BACuB,MAAM,WAAW,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;IAMxE;;OAEG;6BACsB,MAAM,WAAW,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;IAMvE;;OAEG;6BACsB,MAAM,WAAW,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;IAMvE;;OAEG;8BACuB,MAAM,WAAW,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;CAGzE,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY;mBA7DP,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;qBAT5B,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;oBAS9B,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;oBAS7B,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;qBAS5B,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;CAiD/C,CAAA;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,MAAM,CAWhE"}
@@ -2,4 +2,4 @@
2
2
  * This file is auto-generated during the build process.
3
3
  * Do not modify this file directly.
4
4
  */
5
- export declare const VERSION = "0.15.0";
5
+ export declare const VERSION = "0.12.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soulcraft/brainy",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "A vector graph database using HNSW indexing with Origin Private File System storage",
5
5
  "main": "dist/unified.js",
6
6
  "module": "dist/unified.js",
@@ -49,13 +49,13 @@
49
49
  "node": ">=24.4.0"
50
50
  },
51
51
  "scripts": {
52
- "prebuild": "node scripts/generate-version.js",
52
+ "prebuild": "echo 'Prebuild step - no version generation needed'",
53
53
  "build": "BUILD_TYPE=unified rollup -c rollup.config.js",
54
54
  "build:browser": "BUILD_TYPE=browser rollup -c rollup.config.js",
55
55
  "build:cli": "cd cli-package && npm run build",
56
56
  "start": "node dist/unified.js",
57
57
  "demo": "npm run build && npm run build:browser && npx http-server -o /demo/index.html",
58
- "version": "node scripts/generate-version.js",
58
+ "version": "echo 'Version updated in package.json'",
59
59
  "version:patch": "npm version patch",
60
60
  "version:minor": "npm version minor",
61
61
  "version:major": "npm version major",
@@ -66,7 +66,8 @@
66
66
  "check:style": "node scripts/check-code-style.js",
67
67
  "prepare": "npm run build",
68
68
  "deploy": "npm run build && npm publish && node scripts/create-github-release.js",
69
- "deploy:cli": "node scripts/generate-version.js && cd cli-package && npm run build && npm publish",
69
+ "deploy:cli": "cd cli-package && npm run build && npm publish",
70
+ "deploy:web-service": "cd web-service-package && npm run build && npm publish",
70
71
  "dry-run": "npm pack --dry-run",
71
72
  "test": "vitest run",
72
73
  "test:watch": "vitest",