@tb.p/dd 1.1.0 → 1.1.2
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/package.json +1 -1
- package/utils/candidateDetection.js +14 -2
package/package.json
CHANGED
|
@@ -403,8 +403,11 @@ class CandidateDetection {
|
|
|
403
403
|
}
|
|
404
404
|
|
|
405
405
|
// Calculate hash
|
|
406
|
+
if (this.options.verbose) {
|
|
407
|
+
console.log(`🔍 Hashing: ${candidate.file_path}`);
|
|
408
|
+
}
|
|
406
409
|
const hash = await calculateContentHash(candidate.file_path, this.options.hashAlgorithm);
|
|
407
|
-
|
|
410
|
+
|
|
408
411
|
// Update database
|
|
409
412
|
const updateResult = await this.db.updateFileHash(candidate.id, hash);
|
|
410
413
|
|
|
@@ -425,6 +428,9 @@ class CandidateDetection {
|
|
|
425
428
|
};
|
|
426
429
|
|
|
427
430
|
} catch (error) {
|
|
431
|
+
if (this.options.verbose) {
|
|
432
|
+
console.error(`❌ Error hashing ${candidate.file_path}: ${error.message}`);
|
|
433
|
+
}
|
|
428
434
|
return {
|
|
429
435
|
success: false,
|
|
430
436
|
error: error.message,
|
|
@@ -506,7 +512,13 @@ export async function runCandidateDetection(options) {
|
|
|
506
512
|
hashAlgorithm: options.hashAlgorithm || 'blake3',
|
|
507
513
|
batchSize: parseInt(options.batchSize) || 100,
|
|
508
514
|
maxConcurrency: parseInt(options.maxConcurrency) || 5,
|
|
509
|
-
verbose: options.verbose || false
|
|
515
|
+
verbose: options.verbose || false,
|
|
516
|
+
onProgress: options.verbose ? (progress) => {
|
|
517
|
+
if (progress.phase === 'hashing') {
|
|
518
|
+
const percentage = (progress.percentage || 0).toFixed(1);
|
|
519
|
+
console.log(`📊 Hashing progress: ${progress.processed}/${progress.total} files (${percentage}%) - ${progress.hashedFiles} hashed, ${progress.errors} errors`);
|
|
520
|
+
}
|
|
521
|
+
} : null
|
|
510
522
|
});
|
|
511
523
|
|
|
512
524
|
const result = await detector.detectAndProcessCandidates();
|