@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.js CHANGED
@@ -543,8 +543,9 @@ var SYSTEM_TAGS = [
543
543
  "teammate-message"
544
544
  ];
545
545
  var SYSTEM_TAG_RE = new RegExp(`<(${SYSTEM_TAGS.join("|")})[^>]*>[\\s\\S]*?<\\/\\1>`, "g");
546
+ var PASTED_CONTENT_RE = /<pasted_content id="[0-9a-f]{4}">([\s\S]*?)<\/pasted_content(?: id="[0-9a-f]{4}")?>/g;
546
547
  function cleanSystemTags(text) {
547
- return text.replace(SYSTEM_TAG_RE, "").replace(/[^\S\n]+/g, " ").replace(/\n{3,}/g, "\n\n").trim();
548
+ return text.replace(SYSTEM_TAG_RE, "").replace(PASTED_CONTENT_RE, "$1").replace(/[^\S\n]+/g, " ").replace(/\n{3,}/g, "\n\n").trim();
548
549
  }
549
550
 
550
551
  // src/parser.ts
@@ -2345,7 +2346,7 @@ import { mkdirSync } from "fs";
2345
2346
  import { dirname as dirname4 } from "path";
2346
2347
 
2347
2348
  // src/persistent/schema.ts
2348
- var SCHEMA_VERSION = 9;
2349
+ var SCHEMA_VERSION = 10;
2349
2350
  var SCHEMA_SQL = `
2350
2351
  CREATE TABLE IF NOT EXISTS conversation_files (
2351
2352
  id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -2638,6 +2639,21 @@ function runMigrations(db) {
2638
2639
  if (current >= 1 && current < 9 && tableExists(db, "conversations")) {
2639
2640
  db.exec(`UPDATE conversations SET provider = 'cursor' WHERE provider = 'cursor-cli'`);
2640
2641
  }
2642
+ if (current >= 1 && current < 10 && tableExists(db, "conversation_files")) {
2643
+ const assignments = [];
2644
+ if (hasColumn(db, "conversation_files", "last_indexed_offset")) {
2645
+ assignments.push("last_indexed_offset = 0");
2646
+ }
2647
+ if (hasColumn(db, "conversation_files", "last_indexed_line")) {
2648
+ assignments.push("last_indexed_line = 0");
2649
+ }
2650
+ if (hasColumn(db, "conversation_files", "reducer_state")) {
2651
+ assignments.push("reducer_state = NULL");
2652
+ }
2653
+ if (assignments.length > 0) {
2654
+ db.exec(`UPDATE conversation_files SET ${assignments.join(", ")}`);
2655
+ }
2656
+ }
2641
2657
  db.exec(SCHEMA_SQL);
2642
2658
  db.pragma(`user_version = ${SCHEMA_VERSION}`);
2643
2659
  }