@threadbase-sh/scanner 0.8.1 → 0.8.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
@@ -1302,7 +1302,10 @@ function classify(filePath, existing) {
1302
1302
  }
1303
1303
  return { change: "unchanged", stat: stat3 };
1304
1304
  }
1305
- return { change: "appended", stat: stat3 };
1305
+ if (existing.content_fingerprint && existing.size_bytes === existing.last_indexed_offset && fingerprint(filePath, existing.last_indexed_offset) === existing.content_fingerprint) {
1306
+ return { change: "appended", stat: stat3 };
1307
+ }
1308
+ return { change: "reindex", stat: stat3 };
1306
1309
  }
1307
1310
 
1308
1311
  // src/providers/parse.ts
@@ -2242,6 +2245,15 @@ var PersistentEngine = class {
2242
2245
  const meta = this.conversations.getByIdOrSession(id);
2243
2246
  if (!meta) return null;
2244
2247
  const filePath = meta.filePath;
2248
+ if (meta.provider === CODEX_CLI_PROVIDER) {
2249
+ const conversation = await parseCodexConversation(filePath, meta.account);
2250
+ if (!conversation) return null;
2251
+ const { messages } = conversation;
2252
+ const total2 = messages.length;
2253
+ const beforeIndex2 = options.beforeIndex ?? total2;
2254
+ const fromIndex2 = Math.max(0, beforeIndex2 - options.limit);
2255
+ return { messages: messages.slice(fromIndex2, beforeIndex2), total: total2, fromIndex: fromIndex2 };
2256
+ }
2245
2257
  const total = this.conversations.pageMessageCount(filePath);
2246
2258
  if (total > CHECKPOINT_INTERVAL && this.checkpoints.count(filePath) === 0) {
2247
2259
  const built = await buildCheckpoints(filePath);