scai 0.1.123 → 0.1.125
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.
|
@@ -217,20 +217,21 @@ Expected JSON shape:
|
|
|
217
217
|
confidence: Math.min(0.9, 0.4 + target.score * 0.1),
|
|
218
218
|
};
|
|
219
219
|
// --------------------------------------------------
|
|
220
|
-
// Persist capsule
|
|
220
|
+
// Persist capsule safely using parameterized queries
|
|
221
221
|
// --------------------------------------------------
|
|
222
222
|
const now = new Date().toISOString();
|
|
223
|
+
// Insert folder capsule
|
|
223
224
|
db.prepare(`
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
225
|
+
INSERT INTO folder_capsules (
|
|
226
|
+
path, depth, capsule_json, confidence, last_generated, source_file_count
|
|
227
|
+
) VALUES (?, ?, ?, ?, ?, ?)
|
|
228
|
+
`).run(capsule.path, capsule.depth, JSON.stringify(capsule), capsule.confidence, now, files.length);
|
|
229
|
+
// Update file processing status
|
|
229
230
|
db.prepare(`
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
UPDATE files
|
|
232
|
+
SET processing_status = 'capsuled'
|
|
233
|
+
WHERE path LIKE ?
|
|
234
|
+
`).run(`${folderPath}/%`);
|
|
234
235
|
log(`✅ Folder capsule written: ${folderPath}`);
|
|
235
236
|
}
|
|
236
237
|
catch (err) {
|