@threadbase-sh/scanner 0.19.1 → 0.19.3

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/dist/index.cjs CHANGED
@@ -621,8 +621,9 @@ var SYSTEM_TAGS = [
621
621
  "teammate-message"
622
622
  ];
623
623
  var SYSTEM_TAG_RE = new RegExp(`<(${SYSTEM_TAGS.join("|")})[^>]*>[\\s\\S]*?<\\/\\1>`, "g");
624
+ var PASTED_CONTENT_RE = /<pasted_content id="[0-9a-f]{4}">([\s\S]*?)<\/pasted_content(?: id="[0-9a-f]{4}")?>/g;
624
625
  function cleanSystemTags(text) {
625
- return text.replace(SYSTEM_TAG_RE, "").replace(/[^\S\n]+/g, " ").replace(/\n{3,}/g, "\n\n").trim();
626
+ return text.replace(SYSTEM_TAG_RE, "").replace(PASTED_CONTENT_RE, "$1").replace(/[^\S\n]+/g, " ").replace(/\n{3,}/g, "\n\n").trim();
626
627
  }
627
628
 
628
629
  // src/parser.ts
@@ -2423,7 +2424,7 @@ var import_fs10 = require("fs");
2423
2424
  var import_path9 = require("path");
2424
2425
 
2425
2426
  // src/persistent/schema.ts
2426
- var SCHEMA_VERSION = 9;
2427
+ var SCHEMA_VERSION = 10;
2427
2428
  var SCHEMA_SQL = `
2428
2429
  CREATE TABLE IF NOT EXISTS conversation_files (
2429
2430
  id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -2716,6 +2717,21 @@ function runMigrations(db) {
2716
2717
  if (current >= 1 && current < 9 && tableExists(db, "conversations")) {
2717
2718
  db.exec(`UPDATE conversations SET provider = 'cursor' WHERE provider = 'cursor-cli'`);
2718
2719
  }
2720
+ if (current >= 1 && current < 10 && tableExists(db, "conversation_files")) {
2721
+ const assignments = [];
2722
+ if (hasColumn(db, "conversation_files", "last_indexed_offset")) {
2723
+ assignments.push("last_indexed_offset = 0");
2724
+ }
2725
+ if (hasColumn(db, "conversation_files", "last_indexed_line")) {
2726
+ assignments.push("last_indexed_line = 0");
2727
+ }
2728
+ if (hasColumn(db, "conversation_files", "reducer_state")) {
2729
+ assignments.push("reducer_state = NULL");
2730
+ }
2731
+ if (assignments.length > 0) {
2732
+ db.exec(`UPDATE conversation_files SET ${assignments.join(", ")}`);
2733
+ }
2734
+ }
2719
2735
  db.exec(SCHEMA_SQL);
2720
2736
  db.pragma(`user_version = ${SCHEMA_VERSION}`);
2721
2737
  }