peerpigeon 0.0.8 → 0.1.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.
@@ -0,0 +1,171 @@
1
+ /**
2
+ * PeerPigeon Debug Configuration Example
3
+ *
4
+ * This example shows how to configure the debug logging system
5
+ * to control console output from PeerPigeon modules.
6
+ */
7
+
8
+ import { PeerPigeonMesh, DebugLogger } from './index.js';
9
+
10
+ // ============================================================================
11
+ // Debug Configuration Examples
12
+ // ============================================================================
13
+
14
+ // 1. Enable all debugging (shows all console output)
15
+ // DebugLogger.enableAll();
16
+
17
+ // 2. Enable specific modules only
18
+ DebugLogger.enableModules([
19
+ 'GossipManager', // Message propagation debugging
20
+ 'ConnectionManager', // Connection management debugging
21
+ 'PeerConnection' // WebRTC connection debugging
22
+ ]);
23
+
24
+ // 3. Enable individual modules
25
+ // DebugLogger.enable('PeerPigeonMesh');
26
+ // DebugLogger.enable('SignalingHandler');
27
+ // DebugLogger.enable('WebDHT');
28
+
29
+ // 4. Disable all debugging (default state - no console output)
30
+ // DebugLogger.disableAll();
31
+
32
+ // 5. Disable specific modules
33
+ // DebugLogger.disable('DistributedStorageManager');
34
+ // DebugLogger.disable('CryptoManager');
35
+
36
+ // 6. Configure using options object
37
+ DebugLogger.configure({
38
+ // First disable all, then enable specific ones
39
+ disableAll: true,
40
+ enable: [
41
+ 'PeerPigeonMesh',
42
+ 'GossipManager',
43
+ 'ConnectionManager'
44
+ ]
45
+ });
46
+
47
+ // ============================================================================
48
+ // Create and Use PeerPigeon with Debug Configuration
49
+ // ============================================================================
50
+
51
+ const mesh = new PeerPigeonMesh({
52
+ signalingUrl: 'ws://localhost:3000',
53
+ minPeers: 2,
54
+ maxPeers: 10,
55
+ autoConnect: true
56
+ });
57
+
58
+ // ============================================================================
59
+ // Runtime Debug Control Examples
60
+ // ============================================================================
61
+
62
+ // You can change debug settings at runtime
63
+ setTimeout(() => {
64
+ console.log('Current debug state:', DebugLogger.getState());
65
+
66
+ // Enable more debugging after 5 seconds
67
+ DebugLogger.enable('WebDHT');
68
+ DebugLogger.enable('DistributedStorageManager');
69
+
70
+ console.log('Available modules:', DebugLogger.getModules());
71
+ }, 5000);
72
+
73
+ // ============================================================================
74
+ // Event Handlers (these will show debug output based on configuration)
75
+ // ============================================================================
76
+
77
+ mesh.on('ready', (peerId) => {
78
+ console.log(`🚀 Mesh ready! Peer ID: ${peerId}`);
79
+
80
+ // Test different functionality that will show debug output
81
+ mesh.broadcastMessage('Hello from debug example!');
82
+ });
83
+
84
+ mesh.on('peerConnected', (peerId) => {
85
+ console.log(`👋 Peer connected: ${peerId}`);
86
+ });
87
+
88
+ mesh.on('messageReceived', (message) => {
89
+ console.log('📨 Message received:', message);
90
+ });
91
+
92
+ // Start the mesh
93
+ mesh.connect();
94
+
95
+ // ============================================================================
96
+ // Example Debug Output Control in Production
97
+ // ============================================================================
98
+
99
+ // For production, you might want to conditionally enable debugging
100
+ const isDevelopment = process.env.NODE_ENV === 'development';
101
+ const debugFromQuery = new URLSearchParams(window?.location?.search || '').get('debug');
102
+
103
+ if (isDevelopment || debugFromQuery) {
104
+ // Enable debugging in development or when ?debug=true
105
+ if (debugFromQuery) {
106
+ // Parse debug modules from query: ?debug=GossipManager,ConnectionManager
107
+ const modules = debugFromQuery.split(',').filter(m => m && m !== 'true');
108
+ if (modules.length > 0) {
109
+ DebugLogger.enableModules(modules);
110
+ } else {
111
+ DebugLogger.enableAll();
112
+ }
113
+ } else {
114
+ DebugLogger.enableAll();
115
+ }
116
+
117
+ console.log('🐛 Debug mode enabled:', DebugLogger.getState());
118
+ }
119
+
120
+ // ============================================================================
121
+ // Available Modules for Debugging
122
+ // ============================================================================
123
+
124
+ /*
125
+ Available debug modules:
126
+
127
+ Core Components:
128
+ - PeerPigeonMesh - Main mesh instance and lifecycle
129
+ - ConnectionManager - Peer connection management
130
+ - PeerConnection - Individual WebRTC connections
131
+ - SignalingHandler - Signaling message processing
132
+ - SignalingClient - WebSocket signaling client
133
+
134
+ Networking & Discovery:
135
+ - GossipManager - Message propagation and gossip protocol
136
+ - PeerDiscovery - Peer discovery and announcement
137
+ - MeshOptimizer - Network topology optimization
138
+ - EvictionManager - Peer eviction strategies
139
+
140
+ Data & Storage:
141
+ - WebDHT - Distributed hash table operations
142
+ - DistributedStorageManager - P2P storage layer
143
+ - StorageManager - Local storage management
144
+
145
+ Security & Media:
146
+ - CryptoManager - End-to-end encryption
147
+ - MediaManager - Audio/video stream management
148
+
149
+ Utilities:
150
+ - CleanupManager - Resource cleanup and garbage collection
151
+ - EnvironmentDetector - Runtime environment detection
152
+ - EventEmitter - Event system
153
+ - TimerUtils - Timer utilities
154
+
155
+ Usage patterns:
156
+
157
+ // Debug everything
158
+ DebugLogger.enableAll();
159
+
160
+ // Debug networking only
161
+ DebugLogger.enableModules(['GossipManager', 'ConnectionManager', 'PeerConnection']);
162
+
163
+ // Debug storage only
164
+ DebugLogger.enableModules(['WebDHT', 'DistributedStorageManager', 'StorageManager']);
165
+
166
+ // Debug security only
167
+ DebugLogger.enableModules(['CryptoManager']);
168
+
169
+ // Production - no debugging (default)
170
+ DebugLogger.disableAll();
171
+ */
@@ -0,0 +1,329 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * PeerPigeon Storage Spaces Test
5
+ *
6
+ * This example demonstrates the new storage space separation feature:
7
+ * - Private space: Only owner can read/write, encrypted
8
+ * - Public space: Anyone can read, only owner can write
9
+ * - Frozen space: Immutable once set, anyone can read
10
+ *
11
+ * Key protection: prevents overwrites across different spaces
12
+ */
13
+
14
+ import { PeerPigeonMesh } from '../../src/PeerPigeonMesh.js';
15
+
16
+ class StorageSpacesTest {
17
+ constructor() {
18
+ this.mesh = null;
19
+ this.storage = null;
20
+ this.testResults = [];
21
+ }
22
+
23
+ async init() {
24
+ console.log('🚀 Initializing PeerPigeon Mesh with Storage Spaces...');
25
+
26
+ // Initialize mesh with all features enabled
27
+ this.mesh = new PeerPigeonMesh({
28
+ enableWebDHT: true,
29
+ enableCrypto: true,
30
+ enableDistributedStorage: true
31
+ });
32
+
33
+ await this.mesh.init();
34
+ this.storage = this.mesh.distributedStorage;
35
+
36
+ console.log(`✅ Mesh initialized with peer ID: ${this.mesh.peerId.substring(0, 16)}...`);
37
+ console.log(`📦 Storage enabled: ${this.storage.isEnabled()}`);
38
+ console.log(`🔧 Space enforcement: ${this.storage.config.spaceEnforcement}`);
39
+ console.log('');
40
+ }
41
+
42
+ async runTest(testName, testFn) {
43
+ console.log(`🧪 Running test: ${testName}`);
44
+ try {
45
+ await testFn();
46
+ console.log(`✅ Test passed: ${testName}`);
47
+ this.testResults.push({ name: testName, status: 'PASS' });
48
+ } catch (error) {
49
+ console.error(`❌ Test failed: ${testName} - ${error.message}`);
50
+ this.testResults.push({ name: testName, status: 'FAIL', error: error.message });
51
+ }
52
+ console.log('');
53
+ }
54
+
55
+ async testPrivateSpace() {
56
+ await this.runTest('Private Space Storage', async () => {
57
+ const key = 'user-profile';
58
+ const value = { name: 'Alice', secret: 'my-password' };
59
+
60
+ // Store in private space (default)
61
+ await this.storage.store(key, value);
62
+
63
+ // Should be accessible to owner
64
+ const retrieved = await this.storage.retrieve(key);
65
+ if (JSON.stringify(retrieved) !== JSON.stringify(value)) {
66
+ throw new Error('Private data not properly stored/retrieved');
67
+ }
68
+
69
+ console.log(' ✓ Private space data stored and retrieved by owner');
70
+ });
71
+
72
+ await this.runTest('Private Space Explicit', async () => {
73
+ const key = 'explicit-private';
74
+ const value = { confidential: 'data' };
75
+
76
+ // Store explicitly in private space
77
+ await this.storage.store(key, value, { space: 'private' });
78
+
79
+ const retrieved = await this.storage.retrieve('private:explicit-private');
80
+ if (JSON.stringify(retrieved) !== JSON.stringify(value)) {
81
+ throw new Error('Explicit private space data not working');
82
+ }
83
+
84
+ console.log(' ✓ Explicit private space storage working');
85
+ });
86
+ }
87
+
88
+ async testPublicSpace() {
89
+ await this.runTest('Public Space Storage', async () => {
90
+ const key = 'app-config';
91
+ const value = { version: '1.0.0', features: ['chat', 'files'] };
92
+
93
+ // Store in public space
94
+ await this.storage.store(key, value, { space: 'public' });
95
+
96
+ // Retrieve with space prefix
97
+ const retrieved = await this.storage.retrieve('public:app-config');
98
+ if (JSON.stringify(retrieved) !== JSON.stringify(value)) {
99
+ throw new Error('Public space data not properly stored/retrieved');
100
+ }
101
+
102
+ console.log(' ✓ Public space data stored and retrieved');
103
+ });
104
+
105
+ await this.runTest('Public Space Legacy', async () => {
106
+ const key = 'legacy-public';
107
+ const value = { public: true };
108
+
109
+ // Store using legacy isPublic option
110
+ await this.storage.store(key, value, { isPublic: true });
111
+
112
+ const retrieved = await this.storage.retrieve(key);
113
+ if (JSON.stringify(retrieved) !== JSON.stringify(value)) {
114
+ throw new Error('Legacy public storage not working');
115
+ }
116
+
117
+ console.log(' ✓ Legacy public storage compatibility working');
118
+ });
119
+ }
120
+
121
+ async testFrozenSpace() {
122
+ await this.runTest('Frozen Space Storage', async () => {
123
+ const key = 'immutable-data';
124
+ const value = { constant: 'never-changes', timestamp: Date.now() };
125
+
126
+ // Store in frozen space
127
+ await this.storage.store(key, value, { space: 'frozen' });
128
+
129
+ const retrieved = await this.storage.retrieve('frozen:immutable-data');
130
+ if (JSON.stringify(retrieved) !== JSON.stringify(value)) {
131
+ throw new Error('Frozen space data not properly stored/retrieved');
132
+ }
133
+
134
+ console.log(' ✓ Frozen space data stored and retrieved');
135
+ });
136
+
137
+ await this.runTest('Frozen Space Write Protection', async () => {
138
+ const key = 'immutable-data';
139
+
140
+ try {
141
+ // Try to overwrite frozen data in a different space - should fail
142
+ await this.storage.store(key, { modified: 'data' }, { space: 'private' });
143
+ throw new Error('Frozen space allowed overwrite - this should not happen');
144
+ } catch (error) {
145
+ if (error.message.includes('already exists in space') || error.message.includes('Write access denied')) {
146
+ console.log(' ✓ Frozen space properly protected from overwrites');
147
+ } else {
148
+ throw error;
149
+ }
150
+ }
151
+ });
152
+ }
153
+
154
+ async testSpaceSeparation() {
155
+ await this.runTest('Space Separation Protection', async () => {
156
+ const baseKey = 'protected-key';
157
+
158
+ // Store in private space first
159
+ await this.storage.store(baseKey, { space: 'private', data: 'secret' });
160
+
161
+ try {
162
+ // Try to store same base key in public space - should fail
163
+ await this.storage.store(baseKey, { space: 'public', data: 'public' }, { space: 'public' });
164
+ throw new Error('Space separation failed - allowed cross-space overwrite');
165
+ } catch (error) {
166
+ if (error.message.includes('already exists in space')) {
167
+ console.log(' ✓ Space separation properly prevents cross-space overwrites');
168
+ } else {
169
+ throw error;
170
+ }
171
+ }
172
+ });
173
+
174
+ await this.runTest('Different Base Keys Work', async () => {
175
+ // These should all work as they have different base keys
176
+ await this.storage.store('key1', { data: 'private' }); // private:key1
177
+ await this.storage.store('key2', { data: 'public' }, { space: 'public' }); // public:key2
178
+ await this.storage.store('key3', { data: 'frozen' }, { space: 'frozen' }); // frozen:key3
179
+
180
+ const private1 = await this.storage.retrieve('key1');
181
+ const public2 = await this.storage.retrieve('public:key2');
182
+ const frozen3 = await this.storage.retrieve('frozen:key3');
183
+
184
+ if (!private1 || !public2 || !frozen3) {
185
+ throw new Error('Different base keys not working properly');
186
+ }
187
+
188
+ console.log(' ✓ Different base keys work in all spaces');
189
+ });
190
+ }
191
+
192
+ async testSpaceAwareRetrieval() {
193
+ await this.runTest('Space-Aware Retrieval', async () => {
194
+ // Store data in specific spaces
195
+ await this.storage.store('test-key', { space: 'private' }); // private:test-key
196
+ await this.storage.store('other-key', { space: 'public' }, { space: 'public' }); // public:other-key
197
+
198
+ // Test retrieval with and without space prefixes
199
+ const privateData = await this.storage.retrieve('private:test-key');
200
+ const publicData = await this.storage.retrieve('public:other-key');
201
+
202
+ if (!privateData || !publicData) {
203
+ throw new Error('Space-aware retrieval not working');
204
+ }
205
+
206
+ // Test automatic space detection
207
+ const autoPrivate = await this.storage.retrieve('test-key'); // Should find private:test-key
208
+ if (!autoPrivate) {
209
+ throw new Error('Automatic space detection not working');
210
+ }
211
+
212
+ console.log(' ✓ Space-aware retrieval working correctly');
213
+ });
214
+ }
215
+
216
+ async testDisableSpaceEnforcement() {
217
+ await this.runTest('Disable Space Enforcement', async () => {
218
+ // Disable space enforcement
219
+ this.storage.config.spaceEnforcement = false;
220
+
221
+ try {
222
+ // This should work now
223
+ await this.storage.store('enforcement-test', { data: 'private' });
224
+ await this.storage.store('enforcement-test', { data: 'public' }, { space: 'public' });
225
+
226
+ console.log(' ✓ Space enforcement can be disabled');
227
+ } finally {
228
+ // Re-enable for other tests
229
+ this.storage.config.spaceEnforcement = true;
230
+ }
231
+ });
232
+ }
233
+
234
+ async runAllTests() {
235
+ console.log('🧪 Starting Storage Spaces Test Suite');
236
+ console.log('='.repeat(60));
237
+ console.log('');
238
+
239
+ await this.testPrivateSpace();
240
+ await this.testPublicSpace();
241
+ await this.testFrozenSpace();
242
+ await this.testSpaceSeparation();
243
+ await this.testSpaceAwareRetrieval();
244
+ await this.testDisableSpaceEnforcement();
245
+
246
+ this.printSummary();
247
+ }
248
+
249
+ printSummary() {
250
+ console.log('='.repeat(60));
251
+ console.log('🏁 STORAGE SPACES TEST SUMMARY');
252
+ console.log('='.repeat(60));
253
+
254
+ const passed = this.testResults.filter(r => r.status === 'PASS').length;
255
+ const failed = this.testResults.filter(r => r.status === 'FAIL').length;
256
+ const total = this.testResults.length;
257
+
258
+ console.log(`Total Tests: ${total}`);
259
+ console.log(`✅ Passed: ${passed}`);
260
+ console.log(`❌ Failed: ${failed}`);
261
+ console.log(`Success Rate: ${((passed / total) * 100).toFixed(1)}%`);
262
+ console.log('');
263
+
264
+ if (failed > 0) {
265
+ console.log('Failed Tests:');
266
+ this.testResults.filter(r => r.status === 'FAIL').forEach(result => {
267
+ console.log(` ❌ ${result.name}: ${result.error}`);
268
+ });
269
+ console.log('');
270
+ }
271
+
272
+ if (passed === total) {
273
+ console.log('🎉 All tests passed! Storage spaces are working perfectly.');
274
+ } else {
275
+ console.log('⚠️ Some tests failed. Please review the errors above.');
276
+ }
277
+
278
+ console.log('');
279
+ console.log('📊 Storage Spaces Features Tested:');
280
+ console.log(' • Private space (encrypted, owner-only access)');
281
+ console.log(' • Public space (readable by all, owner-writable)');
282
+ console.log(' • Frozen space (immutable, readable by all)');
283
+ console.log(' • Cross-space overwrite protection');
284
+ console.log(' • Space-aware key retrieval');
285
+ console.log(' • Legacy compatibility');
286
+ console.log(' • Space enforcement toggle');
287
+ }
288
+
289
+ async cleanup() {
290
+ if (this.mesh) {
291
+ console.log('🧹 Cleaning up test environment...');
292
+ try {
293
+ await this.storage.clear();
294
+ console.log('✅ Test data cleared');
295
+ } catch (error) {
296
+ console.warn('⚠️ Failed to clear test data:', error.message);
297
+ }
298
+ }
299
+ }
300
+ }
301
+
302
+ // Main execution
303
+ async function main() {
304
+ const test = new StorageSpacesTest();
305
+
306
+ try {
307
+ await test.init();
308
+ await test.runAllTests();
309
+ } catch (error) {
310
+ console.error('💥 Test suite failed to run:', error);
311
+ } finally {
312
+ await test.cleanup();
313
+ process.exit(0);
314
+ }
315
+ }
316
+
317
+ // Handle graceful shutdown
318
+ process.on('SIGINT', async () => {
319
+ console.log('\n🛑 Received SIGINT, shutting down gracefully...');
320
+ process.exit(0);
321
+ });
322
+
323
+ process.on('SIGTERM', async () => {
324
+ console.log('\n🛑 Received SIGTERM, shutting down gracefully...');
325
+ process.exit(0);
326
+ });
327
+
328
+ // Run the test suite
329
+ main().catch(console.error);
@@ -387,20 +387,154 @@ class StorageTest {
387
387
  }
388
388
 
389
389
  async testStorageToggle() {
390
- await this.runTest('Storage Enable/Disable', async () => {
391
- // Test disable
392
- await this.storage.disable();
390
+ await this.runTest('Storage Toggle', async () => {
391
+ const key = 'test-toggle';
392
+ const value = { test: true };
393
+
394
+ // Store when enabled
395
+ await this.storage.store(key, value);
396
+ let retrieved = await this.storage.retrieve(key);
397
+ if (JSON.stringify(retrieved) !== JSON.stringify(value)) {
398
+ throw new Error('Failed to store when enabled');
399
+ }
400
+
401
+ // Disable storage
402
+ this.storage.disable();
393
403
  if (this.storage.isEnabled()) {
394
404
  throw new Error('Storage should be disabled');
395
405
  }
396
406
 
397
- // Test enable
398
- await this.storage.enable();
407
+ // Operations should fail or return null when disabled
408
+ const disabledResult = await this.storage.store('disabled-key', { test: true });
409
+ if (disabledResult !== false) {
410
+ throw new Error('Store should fail when disabled');
411
+ }
412
+
413
+ // Re-enable storage
414
+ this.storage.enable();
399
415
  if (!this.storage.isEnabled()) {
400
416
  throw new Error('Storage should be enabled');
401
417
  }
402
418
 
403
- console.log(' Storage successfully toggled enabled/disabled');
419
+ // Should work again
420
+ retrieved = await this.storage.retrieve(key);
421
+ if (JSON.stringify(retrieved) !== JSON.stringify(value)) {
422
+ throw new Error('Failed to retrieve after re-enabling');
423
+ }
424
+
425
+ console.log(' Storage toggle functionality verified');
426
+ });
427
+ }
428
+
429
+ async testLexicalInterface() {
430
+ await this.runTest('Lexical Interface - Basic Operations', async () => {
431
+ const lex = this.storage.lexical();
432
+
433
+ // Test basic put/get
434
+ const user = lex.get('users').get('alice');
435
+ await user.put({ name: 'Alice', age: 30, city: 'New York' });
436
+
437
+ const name = await user.get('name').val();
438
+ if (name !== 'Alice') {
439
+ throw new Error(`Expected 'Alice', got '${name}'`);
440
+ }
441
+
442
+ const age = await user.get('age').val();
443
+ if (age !== 30) {
444
+ throw new Error(`Expected 30, got ${age}`);
445
+ }
446
+
447
+ // Test object reconstruction
448
+ const fullUser = await user.val();
449
+ if (!fullUser || fullUser.name !== 'Alice' || fullUser.age !== 30 || fullUser.city !== 'New York') {
450
+ throw new Error('Object reconstruction failed');
451
+ }
452
+
453
+ console.log(' Basic lexical operations verified');
454
+ });
455
+
456
+ await this.runTest('Lexical Interface - Set Operations', async () => {
457
+ const lex = this.storage.lexical();
458
+ const friends = lex.get('users').get('bob').get('friends');
459
+
460
+ // Test set operations
461
+ await friends.set({
462
+ alice: { name: 'Alice', status: 'online' },
463
+ charlie: { name: 'Charlie', status: 'offline' }
464
+ });
465
+
466
+ // Verify set data was stored
467
+ const setData = await this.storage.retrieve('users:bob:friends:_set');
468
+ if (!setData || !setData.alice || !setData.charlie) {
469
+ throw new Error('Set data not stored correctly');
470
+ }
471
+
472
+ console.log(' Set operations verified');
473
+ });
474
+
475
+ await this.runTest('Lexical Interface - Property Access', async () => {
476
+ const lex = this.storage.lexical();
477
+
478
+ // Test proxy-based property access
479
+ const settings = lex.users.alice.settings;
480
+ await settings.put({ theme: 'dark', language: 'en' });
481
+
482
+ const theme = await settings.theme.val();
483
+ if (theme !== 'dark') {
484
+ throw new Error(`Expected 'dark', got '${theme}'`);
485
+ }
486
+
487
+ console.log(' Property access verified');
488
+ });
489
+
490
+ await this.runTest('Lexical Interface - Update and Delete', async () => {
491
+ const lex = this.storage.lexical();
492
+ const profile = lex.get('profiles').get('user1');
493
+
494
+ // Test update
495
+ await profile.put({ name: 'John', age: 25 });
496
+ await profile.update({ age: 26, city: 'Boston' });
497
+
498
+ const updatedProfile = await profile.val();
499
+ if (updatedProfile.age !== 26 || updatedProfile.city !== 'Boston' || updatedProfile.name !== 'John') {
500
+ throw new Error('Update operation failed');
501
+ }
502
+
503
+ // Test delete
504
+ await profile.delete();
505
+ const deletedProfile = await profile.val();
506
+ if (deletedProfile !== null) {
507
+ throw new Error('Delete operation failed');
508
+ }
509
+
510
+ console.log(' Update and delete operations verified');
511
+ });
512
+
513
+ await this.runTest('Lexical Interface - Utility Methods', async () => {
514
+ const lex = this.storage.lexical();
515
+ const testObj = lex.get('test').get('object');
516
+
517
+ await testObj.put({ prop1: 'value1', prop2: 'value2', prop3: 'value3' });
518
+
519
+ // Test exists
520
+ const exists = await testObj.exists();
521
+ if (!exists) {
522
+ throw new Error('exists() should return true');
523
+ }
524
+
525
+ // Test keys
526
+ const keys = await testObj.keys();
527
+ if (!keys.includes('prop1') || !keys.includes('prop2') || !keys.includes('prop3')) {
528
+ throw new Error('keys() did not return expected keys');
529
+ }
530
+
531
+ // Test getPath
532
+ const path = testObj.getPath();
533
+ if (path !== 'test:object') {
534
+ throw new Error(`Expected path 'test:object', got '${path}'`);
535
+ }
536
+
537
+ console.log(' Utility methods verified');
404
538
  });
405
539
  }
406
540
 
@@ -427,6 +561,7 @@ class StorageTest {
427
561
  await this.testBackupAndRestore();
428
562
  await this.testStatistics();
429
563
  await this.testStorageToggle();
564
+ await this.testLexicalInterface();
430
565
  await this.testCleanup();
431
566
 
432
567
  this.printSummary();
package/index.js CHANGED
@@ -5,6 +5,9 @@ export { SignalingClient } from './src/SignalingClient.js';
5
5
  export { WebDHT } from './src/WebDHT.js';
6
6
  export { DistributedStorageManager } from './src/DistributedStorageManager.js';
7
7
 
8
+ // Export debug logger for controlling console output
9
+ export { default as DebugLogger } from './src/DebugLogger.js';
10
+
8
11
  // Export environment detection utilities
9
12
  export {
10
13
  EnvironmentDetector,