@sparkleideas/ruv-swarm 1.0.18-patch.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/README.md +1565 -0
- package/bin/ruv-swarm-clean.js +1872 -0
- package/bin/ruv-swarm-memory.js +119 -0
- package/bin/ruv-swarm-secure-heartbeat.js +1549 -0
- package/bin/ruv-swarm-secure.js +1689 -0
- package/package.json +221 -0
- package/src/agent.ts +342 -0
- package/src/benchmark.js +267 -0
- package/src/claude-flow-enhanced.js +839 -0
- package/src/claude-integration/advanced-commands.js +561 -0
- package/src/claude-integration/core.js +112 -0
- package/src/claude-integration/docs.js +1548 -0
- package/src/claude-integration/env-template.js +39 -0
- package/src/claude-integration/index.js +209 -0
- package/src/claude-integration/remote.js +408 -0
- package/src/cli-diagnostics.js +364 -0
- package/src/cognitive-pattern-evolution.js +1317 -0
- package/src/daa-cognition.js +977 -0
- package/src/daa-service.d.ts +298 -0
- package/src/daa-service.js +1116 -0
- package/src/diagnostics.js +533 -0
- package/src/errors.js +528 -0
- package/src/github-coordinator/README.md +193 -0
- package/src/github-coordinator/claude-hooks.js +162 -0
- package/src/github-coordinator/gh-cli-coordinator.js +260 -0
- package/src/hooks/cli.js +82 -0
- package/src/hooks/index.js +1900 -0
- package/src/index-enhanced.d.ts +371 -0
- package/src/index-enhanced.js +734 -0
- package/src/index.d.ts +287 -0
- package/src/index.js +405 -0
- package/src/index.ts +457 -0
- package/src/logger.js +182 -0
- package/src/logging-config.js +179 -0
- package/src/mcp-daa-tools.js +735 -0
- package/src/mcp-tools-benchmarks.js +328 -0
- package/src/mcp-tools-enhanced.js +2863 -0
- package/src/memory-config.js +42 -0
- package/src/meta-learning-framework.js +1359 -0
- package/src/neural-agent.js +830 -0
- package/src/neural-coordination-protocol.js +1363 -0
- package/src/neural-models/README.md +118 -0
- package/src/neural-models/autoencoder.js +543 -0
- package/src/neural-models/base.js +269 -0
- package/src/neural-models/cnn.js +497 -0
- package/src/neural-models/gnn.js +447 -0
- package/src/neural-models/gru.js +536 -0
- package/src/neural-models/index.js +273 -0
- package/src/neural-models/lstm.js +551 -0
- package/src/neural-models/neural-presets-complete.js +1306 -0
- package/src/neural-models/presets/graph.js +392 -0
- package/src/neural-models/presets/index.js +279 -0
- package/src/neural-models/presets/nlp.js +328 -0
- package/src/neural-models/presets/timeseries.js +368 -0
- package/src/neural-models/presets/vision.js +387 -0
- package/src/neural-models/resnet.js +534 -0
- package/src/neural-models/transformer.js +515 -0
- package/src/neural-models/vae.js +489 -0
- package/src/neural-network-manager.js +1938 -0
- package/src/neural-network.ts +296 -0
- package/src/neural.js +574 -0
- package/src/performance-benchmarks.js +898 -0
- package/src/performance.js +458 -0
- package/src/persistence-pooled.js +695 -0
- package/src/persistence.js +480 -0
- package/src/schemas.js +864 -0
- package/src/security.js +218 -0
- package/src/singleton-container.js +183 -0
- package/src/sqlite-pool.js +587 -0
- package/src/sqlite-worker.js +141 -0
- package/src/types.ts +164 -0
- package/src/utils.ts +286 -0
- package/src/wasm-loader.js +601 -0
- package/src/wasm-loader2.js +404 -0
- package/src/wasm-memory-optimizer.js +783 -0
- package/src/wasm-types.d.ts +63 -0
- package/wasm/README.md +347 -0
- package/wasm/neuro-divergent.wasm +0 -0
- package/wasm/package.json +18 -0
- package/wasm/ruv-fann.wasm +0 -0
- package/wasm/ruv_swarm_simd.wasm +0 -0
- package/wasm/ruv_swarm_wasm.d.ts +391 -0
- package/wasm/ruv_swarm_wasm.js +2164 -0
- package/wasm/ruv_swarm_wasm_bg.wasm +0 -0
- package/wasm/ruv_swarm_wasm_bg.wasm.d.ts +123 -0
- package/wasm/wasm-bindings-loader.mjs +435 -0
- package/wasm/wasm-updates.md +684 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logging Configuration for @sparkleideas/ruv-swarm
|
|
3
|
+
* Provides centralized logging configuration and utilities
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { Logger } from './logger.js';
|
|
7
|
+
|
|
8
|
+
// Default log levels for different components
|
|
9
|
+
const DEFAULT_LOG_LEVELS = {
|
|
10
|
+
'mcp-server': 'INFO',
|
|
11
|
+
'mcp-tools': 'INFO',
|
|
12
|
+
'swarm-core': 'INFO',
|
|
13
|
+
'agent': 'DEBUG',
|
|
14
|
+
'neural': 'INFO',
|
|
15
|
+
'wasm-loader': 'WARN',
|
|
16
|
+
'persistence': 'INFO',
|
|
17
|
+
'hooks': 'DEBUG',
|
|
18
|
+
'performance': 'INFO',
|
|
19
|
+
'memory': 'WARN',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// Log level mapping from environment variables
|
|
23
|
+
const ENV_LOG_MAPPING = {
|
|
24
|
+
'LOG_LEVEL': null, // Global log level
|
|
25
|
+
'MCP_LOG_LEVEL': 'mcp-server',
|
|
26
|
+
'TOOLS_LOG_LEVEL': 'mcp-tools',
|
|
27
|
+
'SWARM_LOG_LEVEL': 'swarm-core',
|
|
28
|
+
'AGENT_LOG_LEVEL': 'agent',
|
|
29
|
+
'NEURAL_LOG_LEVEL': 'neural',
|
|
30
|
+
'WASM_LOG_LEVEL': 'wasm-loader',
|
|
31
|
+
'DB_LOG_LEVEL': 'persistence',
|
|
32
|
+
'HOOKS_LOG_LEVEL': 'hooks',
|
|
33
|
+
'PERF_LOG_LEVEL': 'performance',
|
|
34
|
+
'MEMORY_LOG_LEVEL': 'memory',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Logging configuration manager
|
|
39
|
+
*/
|
|
40
|
+
export class LoggingConfig {
|
|
41
|
+
constructor() {
|
|
42
|
+
this.loggers = new Map();
|
|
43
|
+
this.globalLevel = null;
|
|
44
|
+
this.componentLevels = { ...DEFAULT_LOG_LEVELS };
|
|
45
|
+
this.loadFromEnvironment();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Load log levels from environment variables
|
|
50
|
+
*/
|
|
51
|
+
loadFromEnvironment() {
|
|
52
|
+
for (const [envVar, component] of Object.entries(ENV_LOG_MAPPING)) {
|
|
53
|
+
const value = process.env[envVar];
|
|
54
|
+
if (value) {
|
|
55
|
+
if (component === null) {
|
|
56
|
+
// Global log level
|
|
57
|
+
this.globalLevel = value.toUpperCase();
|
|
58
|
+
} else {
|
|
59
|
+
// Component-specific log level
|
|
60
|
+
this.componentLevels[component] = value.toUpperCase();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Get or create a logger for a component
|
|
68
|
+
*/
|
|
69
|
+
getLogger(component, options = {}) {
|
|
70
|
+
if (this.loggers.has(component)) {
|
|
71
|
+
return this.loggers.get(component);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const level = this.globalLevel || this.componentLevels[component] || 'INFO';
|
|
75
|
+
|
|
76
|
+
const logger = new Logger({
|
|
77
|
+
name: component,
|
|
78
|
+
level,
|
|
79
|
+
enableStderr: process.env.MCP_MODE === 'stdio' || options.enableStderr,
|
|
80
|
+
enableFile: process.env.LOG_TO_FILE === 'true' || options.enableFile,
|
|
81
|
+
formatJson: process.env.LOG_FORMAT === 'json' || options.formatJson,
|
|
82
|
+
logDir: process.env.LOG_DIR || options.logDir || './logs',
|
|
83
|
+
...options,
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
this.loggers.set(component, logger);
|
|
87
|
+
return logger;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Set log level for a component
|
|
92
|
+
*/
|
|
93
|
+
setLogLevel(component, level) {
|
|
94
|
+
this.componentLevels[component] = level.toUpperCase();
|
|
95
|
+
|
|
96
|
+
// Update existing logger if present
|
|
97
|
+
if (this.loggers.has(component)) {
|
|
98
|
+
const logger = this.loggers.get(component);
|
|
99
|
+
logger.level = logger.constructor.LOG_LEVELS[level.toUpperCase()];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Set global log level
|
|
105
|
+
*/
|
|
106
|
+
setGlobalLogLevel(level) {
|
|
107
|
+
this.globalLevel = level.toUpperCase();
|
|
108
|
+
|
|
109
|
+
// Update all existing loggers
|
|
110
|
+
for (const logger of this.loggers.values()) {
|
|
111
|
+
logger.level = logger.constructor.LOG_LEVELS[level.toUpperCase()];
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Get current log levels
|
|
117
|
+
*/
|
|
118
|
+
getLogLevels() {
|
|
119
|
+
return {
|
|
120
|
+
global: this.globalLevel,
|
|
121
|
+
components: { ...this.componentLevels },
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Create child logger with correlation ID
|
|
127
|
+
*/
|
|
128
|
+
createChildLogger(parentLogger, module, correlationId = null) {
|
|
129
|
+
return parentLogger.child({
|
|
130
|
+
module,
|
|
131
|
+
correlationId: correlationId || parentLogger.correlationId,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Log system configuration
|
|
137
|
+
*/
|
|
138
|
+
logConfiguration() {
|
|
139
|
+
const config = {
|
|
140
|
+
globalLevel: this.globalLevel || 'Not set (using component defaults)',
|
|
141
|
+
componentLevels: this.componentLevels,
|
|
142
|
+
enabledFeatures: {
|
|
143
|
+
fileLogging: process.env.LOG_TO_FILE === 'true',
|
|
144
|
+
jsonFormat: process.env.LOG_FORMAT === 'json',
|
|
145
|
+
stderrOutput: process.env.MCP_MODE === 'stdio',
|
|
146
|
+
logDirectory: process.env.LOG_DIR || './logs',
|
|
147
|
+
},
|
|
148
|
+
environment: {
|
|
149
|
+
MCP_MODE: process.env.MCP_MODE,
|
|
150
|
+
NODE_ENV: process.env.NODE_ENV,
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
console.error('📊 Logging Configuration:', JSON.stringify(config, null, 2));
|
|
155
|
+
return config;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Singleton instance
|
|
160
|
+
export const loggingConfig = new LoggingConfig();
|
|
161
|
+
|
|
162
|
+
// Convenience functions
|
|
163
|
+
export const getLogger = (component, options) => loggingConfig.getLogger(component, options);
|
|
164
|
+
export const setLogLevel = (component, level) => loggingConfig.setLogLevel(component, level);
|
|
165
|
+
export const setGlobalLogLevel = (level) => loggingConfig.setGlobalLogLevel(level);
|
|
166
|
+
|
|
167
|
+
// Pre-configured loggers for common components
|
|
168
|
+
export const mcpLogger = loggingConfig.getLogger('mcp-server');
|
|
169
|
+
export const toolsLogger = loggingConfig.getLogger('mcp-tools');
|
|
170
|
+
export const swarmLogger = loggingConfig.getLogger('swarm-core');
|
|
171
|
+
export const agentLogger = loggingConfig.getLogger('agent');
|
|
172
|
+
export const neuralLogger = loggingConfig.getLogger('neural');
|
|
173
|
+
export const wasmLogger = loggingConfig.getLogger('wasm-loader');
|
|
174
|
+
export const dbLogger = loggingConfig.getLogger('persistence');
|
|
175
|
+
export const hooksLogger = loggingConfig.getLogger('hooks');
|
|
176
|
+
export const perfLogger = loggingConfig.getLogger('performance');
|
|
177
|
+
export const memoryLogger = loggingConfig.getLogger('memory');
|
|
178
|
+
|
|
179
|
+
export default loggingConfig;
|