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 (inline folderPath)
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
- INSERT INTO folder_capsules (
225
- path, depth, capsule_json, confidence, last_generated, source_file_count
226
- )
227
- VALUES ('${capsule.path.replace(/'/g, "''")}', ${capsule.depth}, '${JSON.stringify(capsule)}', ${capsule.confidence}, '${now}', ${files.length})
228
- `).run();
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
- UPDATE files
231
- SET processing_status = 'capsuled'
232
- WHERE path LIKE '${folderPathSQL}/%'
233
- `).run();
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scai",
3
- "version": "0.1.123",
3
+ "version": "0.1.125",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "scai": "./dist/index.js"