@soulcraft/brainy 0.40.0 → 0.41.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.
@@ -1,99 +1,52 @@
1
1
  /**
2
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
- */
3
+ * Provides configurable log levels and consistent logging across the codebase
4
+ */
5
+ export declare enum LogLevel {
6
+ ERROR = 0,
7
+ WARN = 1,
8
+ INFO = 2,
9
+ DEBUG = 3,
10
+ TRACE = 4
11
+ }
11
12
  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;
13
+ level: LogLevel;
14
+ modules?: {
15
+ [moduleName: string]: LogLevel;
16
+ };
17
+ timestamps?: boolean;
18
+ includeModule?: boolean;
19
+ handler?: (level: LogLevel, module: string, message: string, ...args: any[]) => void;
27
20
  }
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
- */
21
+ declare class Logger {
22
+ private static instance;
23
+ private config;
24
+ private constructor();
25
+ static getInstance(): Logger;
26
+ configure(config: Partial<LoggerConfig>): void;
27
+ private shouldLog;
28
+ private formatMessage;
29
+ private log;
30
+ error(module: string, message: string, ...args: any[]): void;
31
+ warn(module: string, message: string, ...args: any[]): void;
32
+ info(module: string, message: string, ...args: any[]): void;
33
+ debug(module: string, message: string, ...args: any[]): void;
34
+ trace(module: string, message: string, ...args: any[]): void;
35
+ createModuleLogger(module: string): {
36
+ error: (message: string, ...args: any[]) => void;
37
+ warn: (message: string, ...args: any[]) => void;
38
+ info: (message: string, ...args: any[]) => void;
39
+ debug: (message: string, ...args: any[]) => void;
40
+ trace: (message: string, ...args: any[]) => void;
41
+ };
42
+ }
43
+ export declare const logger: Logger;
44
+ export declare function createModuleLogger(module: string): {
59
45
  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
46
  warn: (message: string, ...args: any[]) => void;
86
- error: (message: string, ...args: any[]) => void;
47
+ info: (message: string, ...args: any[]) => void;
48
+ debug: (message: string, ...args: any[]) => void;
49
+ trace: (message: string, ...args: any[]) => void;
87
50
  };
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;
51
+ export declare function configureLogger(config: Partial<LoggerConfig>): void;
52
+ export {};
@@ -1 +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,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craft/brainy",
3
- "version": "0.40.0",
3
+ "version": "0.41.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",
@@ -48,6 +48,9 @@
48
48
  "engines": {
49
49
  "node": ">=24.4.0"
50
50
  },
51
+ "overrides": {
52
+ "form-data": "^4.0.4"
53
+ },
51
54
  "scripts": {
52
55
  "prebuild": "echo 'Prebuild step - no version generation needed'",
53
56
  "build": "BUILD_TYPE=unified rollup -c rollup.config.js",